Introduction

As a crucial setting for residents' daily activities, the community plays a vital role in promoting the concept of a healthy community in the era of globalization. Community human settlements are an integral part of the community system. It does not exist in isolation [1, 2]. Globalization has profoundly influenced community human settlements in various ways. Urbanization has worsened the issue of inefficient land utilization and has led to significant environmental degradation in certain regions. Simultaneously, globalization has facilitated increased international resource flows and exchanges. This can lead to resource consumption, competition and a pronounced imbalance between environmental supply and demand. Additionally, heightened cultural and social interactions may give rise to cultural conflicts and social unrest. This has negative impacts on community human settlements and human health. These factors have tangible effects on human health activities. Challenges such as resource scarcity, environmental pollution, health risks, urbanization, and social development pose significant threats to the well-being of community residents. It has become an urgent challenge to meet the needs of community residents. Particularly in countries like the United States, China, and India, large population sizes, high population densities, and frequent social mobility have led to the hollowing out and impoverishment of certain industrial and manufacturing cities, exacerbating socioeconomic inequalities. Concurrently, rapid urbanization has resulted in the gradual disappearance of urban open spaces, deteriorating urban health, and causing serious physical and mental health issues among urban residents. This has significantly impacted the connection between people and places in communities, reducing the stability and adaptability of community human settlement systems [3, 4]. Resilience, as an inherent property of systems, serves as a powerful means of maintaining stable operation and promoting sustainable system evolution. The varying levels of resilience observed in different communities directly reflect their ability to withstand diverse shocks and are closely tied to the well-being of their residents [7,8,9]. To address the influence of globalization on community human settlements and human health, various organizations worldwide have undertaken numerous policy initiatives. The United Nations Environment Programme (UNEP) advocates sustainable development and environmental protection to promote the sustainability of community human settlements. UN-Habitat aims to enhance the quality of the human environment in cities and communities while fostering sustainable development in the context of urbanization. Moreover, many countries have formulated policies and programs to promote the resilience and sustainability of community human settlements. Therefore, it is crucial to examine how to adapt to the risks of stress in a globalized environment and to address the tension between the health movement and environmental supply and demand. This will promote a symbiotic harmony between people and the environment and an increase in the level of resilience of community human settlements. At the same time, it will effectively improve the human settlements environment and human health.

In this context, researchers are increasingly focusing on CR [10,11,12,13]. Resilience refers to the ability of a system to maintain functional stability and adaptability in the face of shocks. Within the context of community human settlements, increased resilience can help communities effectively confront the challenges posed by globalization and safeguard the health and well-being of their residents. However, there are still certain limitations in current CR research. Firstly, the research scope has primarily concentrated on single natural ecosystems [14,15,16,17,37,38] to a combination of qualitative and quantitative approaches such as comprehensive index methods [39, 40] and econometric methods [41, 42]. Although these findings provide methods for deconstructing CR, they tend to neglect the comprehensive impact by focusing on specific aspects. There is a two-way mutual perturbation and adaptation between residents' health activities and the environmental economy. This has important implications for the study of community resilience and community human settlements [43, 44].

In addition, improving community habitat is a priority task for achieving high-quality urban development. It can promote the sustainable development of community habitat systems and effectively alleviate the contradiction between people's aspirations for a better life and urban development [45,46,47]. Currently, domestic and international scholars have focused on the conceptual understanding of human settlements [46, 48] from the perspectives of sustainable development [49,50,1). These districts were selected based on data accessibility and coverage, ensuring the study's reliability.

Fig. 1
figure 1

Overview of the study area

Data subjects and sources

The model used in this study combines data on residents' health activities, socioeconomics, ecological environment and urban geography. The data primarily originates from the Shanghai Statistical Yearbook, Shanghai regional statistical bulletins, and regional environmental status bulletins. Meteorological data is sourced from the China Air Quality Online Monitoring and Analysis Platform (https://www.aqistudy.cn/).Geospatial data is obtained from the Resource and Environmental Science Data center (http://www.resdc.cn/). To capture residents' health activity trajectories, this paper utilizes jogging data from the Dorray Sports APP (as shown in Fig. 2). All data was collected in 2018. In order to achieve a balance between computational efficiency and matching accuracy, the spatial analysis unit is set as a regular grid with a side length of 500 m. Data pre-processing includes collection, cleaning, coordinate decoding, projection conversion, and other procedures.

Fig. 2
figure 2

Data map of residents' jogging trajectories

DPSIR model and indicator system construction

Figure 3 represents the DPSIR model of the CR evaluation system. The DPSIR model represents: “Driving forces (D)”, “Pressure (P)”, “State (S)”, “Impact (I)”, “Responses (R)” five dimensions respectively. It is an optimization and development of the PSR and DSR models, which can analyze the intrinsic links between activity, economic, social and environmental factors from a systemic perspective.

Fig. 3
figure 3

CR evaluation system DPSIR model

This study introduces the DPSIR model to assess the resilience of community human settlements. The model uses five levels and twenty-five indicators (Table 1). Within this model, drivers (D) exert pressures (P) on the environment, leading to changes in environmental states (S). This further affects human activities and health (I). Community environments respond (R) by providing feedback on drivers, pressures, states, and impacts (R) to promote healthy city development.

Table 1 Human settlement resilience evaluation system based on the DPSIR model

Drawing on previous research and experimental requirements [63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78], this study identifies key indicators for each criterion level. Drivers (D) encompass dynamic elements driving resilience in community human settlements. Selected indicators include regional GDP, Regional GNP, population density, total imports and exports, DEM, and climate factors [63, 64]. They reflect economic, population, and trade dynamics. These drivers influence pressure factors, state factors, and response factors, affecting residents' health activities and the environment.

Pressure (P) refers to elements stressing the resilience of community human settlements. Indicators include CO2 emissions, PM2.5 emissions, amount of dust fall, and average daily volume of wet and dry waste. They reflect environmental pressures and pollution in the community [65, 66]. These factors impact state and response factors, affecting air quality and residents' health activities [67].

State (S) represents the current conditions of the health activity environment influenced by drivers and pressures. Indicators such as building, road, bus stop and metro density, density of the water system, and land-use mix reflect environmental conditions and community features [68,69,70]. These factors are influenced by drivers and pressures and also impact other factors and responses. For example, high building and road density may lead to congestion and transportation issues. This will be detrimental to the residents' health activities [71, 72].

Impact (I) refers to the outcomes of environmental elements on human health activities. Indicators like number of jogging trajectories and total jogging length reflect community resources for physical exercise [73,74,75]. These indicators directly affect residents' health activities. This is because more trajectories and longer lengths provide more opportunities for exercise and encourage resident participation [73, 74].

Response (R) indicators capture human feedback on the natural, social, and built environment and their impact on health activities. Indicators such as NDVI, green space density, nighttime lighting, facility functional mix, distance from metro station, and distance to bus stops reflect residents' responses and preferences related to health activities [76,77,78].

Calculation method of human settlement resilience evaluation index

This paper uses a combination of subjective and objective weights. The hierarchical analysis method determines the subjective weights, while the entropy weight method determines the objective weights. Through the combination of these two methods, we can get the comprehensive weights. It can reflect the importance of evaluation indicators more comprehensively and accurately. After determining the weights of the indicators in the evaluation model, we used the evaluation index formula to calculate the evaluation index for each criterion layer. Subsequently, we use the corresponding formula to derive the evaluation index for the human settlements resilience. The specific calculation of indicator weights is as follows:

1) Standardization of indicator data. The following formula is used:

$$\begin{array}{ll}\text{Standardization of positive indicators}&{Z}_{ij}=\frac{{x}_{ij}-\mathrm{min}{x}_{ij}}{\mathrm{max}{x}_{ij}-\mathrm{min}{x}_{ij}}\end{array}$$
(1)
$$\begin{array}{ll}\text{Standardization of negative indicators}&{Z}_{ij}=\frac{\mathrm{max}{x}_{ij}-{x}_{ij}}{\mathrm{max}{x}_{ij}-\mathrm{min}{x}_{ij}}\end{array}$$
(2)

where \({x}_{ij}\) is the standardised value of the \(j\) th indicator for the \(i\) th evaluation sample.

2) Entropy weighting method to calculate indicator weights, the formula is:

$$\begin{array}{ll}\text{Calculate the weight of the}\,j\text{th indicator of the}\,i\text{th evaluation sample}&{Y_{ij}} = {\raise0.7ex\hbox{${{Z_{ij}}}$} \!\mathord{\left/ {\vphantom {{{Z_{ij}}} {\sum {{Z_{ij}}} }}}\right.\kern-0pt}\!\lower0.7ex\hbox{${\sum {{Z_{ij}}} }$}}\end{array}$$
(3)
$$\begin{array}{ll}\text{Calculate the information entropy value of the}\,j\text{th indicator}&{{\text{e}}_{\text{j}}} = - k\sum\limits_{i = 1}^m {{Y_{ij}}\ln {Y_{ij}}}\end{array}$$
(4)
$$\begin{array}{ll}\text{Calculate the information entropy redundancy of the}\,j\text{th indicator}&{{\text{g}}_i} = 1 - {e_j}\end{array}$$
(5)
$$\begin{array}{ll}\text{Calculate the weight of the}\,j\text{th indicator}&{{\text{w}}_j} = {\raise0.7ex\hbox{${g_j}$} \!\mathord{\left/ {\vphantom {{g_j} {\sum\limits_{j = 1}^n {g_j} }}}\right.\kern-0pt}\!\lower0.7ex\hbox{${\sum\limits_{j = 1}^n {g_j} }$}}\end{array}$$
(6)

where \({Y}_{ij}\) denotes the weight value of the \(j\) th indicator for the \(i\) th evaluation sample.\({e}_{j}\) denotes the information entropy value of the \(j\) th indicator;\({g}_{j}\) denotes the information entropy redundancy of the \(j\) th indicator. \({W}_{j}\) denotes the value of the weight coefficient of the \(j\) th indicator.

3) Hierarchical analysis method to calculate the indicator weights at the criterion level, the formula is:

$$B=\left(\begin{array}{ccc}{a}_{11}& \dots & {a}_{1n}\\ \dots & \dots & \dots \\ {a}_{j1}& \dots & {a}_{jn}\end{array}\right)$$
(7)
$${M}_{j}=\sqrt[n]{{a}_{j1}{a}_{j2}{a}_{j3}\cdots {a}_{jn}}$$
(8)
$${Q}_{j}=\frac{{M}_{ij}}{\sum_{j=1}^{n}{M}_{j}}\left(\mathrm{j }= 1, 2,...,\mathrm{ n}\right)$$
(9)
$${\uplambda }_{\mathrm{max}}=\frac{1}{n}\sum_{j=1}^{n}\frac{{a}_{jn}{Q}_{j}}{{Q}_{j}}(\mathrm{j }= 1, 2,...,\mathrm{ n})$$
(10)
$$\mathrm{CI}=\left({\uplambda }_{\mathrm{max}}-\mathrm{n}\right)/\left(\mathrm{n}-1\right)$$
(11)
$$\mathrm{RI}=\frac{{\mathrm{CI}}_{1}+{\mathrm{CI}}_{2}+\cdots +{\mathrm{CI}}_{\mathrm{n}}}{\mathrm{n}}$$
(12)
$$\mathrm{CR}=\frac{\mathrm{CI}}{\mathrm{RI}}$$
(13)

where \({a}_{jn}\) denotes Criterion layer indicator data; \(B\) denotes the judgment matrix. \({M}_{j}\) is the geometric mean of the row vector elements of the judgment matrix; \(n\) denotes the number of indicators; \({Q}_{j}\) is the weight of the jth evaluation indicator; \({\uplambda }_{max}\) is the maximum characteristic root; \(CI\) is the consistency indicator; \(RI\) is the random consistency indicator.

4) Calculate the human settlement resilience evaluation index. The formula for calculating the weights is:

$$D=\sum {W}_{Dj}{Z}_{Dj};\;P=\sum {W}_{Pj}{Z}_{Pj};\;S=\sum {W}_{Sj}{Z}_{Sj};\;I=\sum {W}_{Ij}{Z}_{Ij};\;R=\sum {W}_{Rj}{Z}_{Rj}$$
(14)
$$U=D\times {W}_{D}+P\times {W}_{P}+S\times {W}_{S}+I\times {W}_{I}+R\times {W}_{R}$$
(15)

where U is the human settlement resilience evaluation index. Combined with the index setting of the DPSIR model. D denotes the driving force index and \({W}_{Dj}\) is the weight corresponding to the jth indicator under the D criterion layer and \({Z}_{Dj}\) is the standardised value of the \(j\) th indicator under the D criterion layer and \({W}_{D}\) is the weight corresponding to the D quasi-lateral layer; P, S, I and R index are set and calculated in the same way as the D index.

ArcGIS spatial analysis

In the analysis process, we used the natural break method with the help of ArcGIS software to classify the CR class types based on CRI (Table 2). This can show the spatial changes of CR index in downtown Shanghai more intuitively.

Table 2 Classifying criteria of human settlement resilience level

The study used two spatial autocorrelation statistics, Global Moran's I and Local Moran's I, in the testing phase. The purpose of the methodology is to analyze the overall spatial autocorrelation characteristics and the local spatial autocorrelation characteristics of the human settlements resilience of the region.

1) Calculate the global Moran index. Where \({G}_{0}=\sum_{i=1}^{n}\sum_{j=1}^{n}{w}_{ij}\), n is the total number of spatial cells, the \({y}_{i}\) and \({y}_{j}\) denote the attribute values of the \(i\) th spatial unit and the \(j\) th spatial unit respectively and \(\overline{y}\) is the mean value of the attribute values of all spatial units and \({w}_{ij}\) is the average value of the attribute values of all spatial units, and is the spatial weight value. The calculation formula is:

$$I=\frac{n}{{G}_{0}}\times \frac{\sum_{i=1}^{n}\sum_{j=1}^{n}{w}_{ij}({y}_{i}-\overline{y})({y}_{j}-\overline{y})}{\sum_{i=1}^{n}{({y}_{i}-\overline{y})}^{2}}$$
(16)

Calculate the local Moran index. where \({F}_{i}={y}_{i}-\overline{y}\),\({F}_{j}={y}_{j}-\overline{y}\),\({G}^{2}=\frac{1}{\mathrm{n}}\sum {({y}_{j}-\overline{y})}^{2}\),\({w}_{ij}\) are the spatial weight values, n is the total number of all regions on the study area and \({I}_{i}\) then represents the local Moran index for the ith region. The formula is calculated as:

$${I}_{i}=\frac{{F}_{i}}{{G}_{2}}\sum_{j\ne i}^{n}{w}_{ij}{F}_{j}$$
(17)

Geodetector model

Geodetector represents a statistical model extensively employed in the fields of geography and environmental science. It is used to examine the effects of various geographical factors, such as landforms, soils, and climate, on a specific phenomenon, including vegetation distribution, species occurrence, and land-use changes. This model dissects the phenomenon into a combination of geographical elements and quantifies the impact of each element on the phenomenon, thereby unraveling the intricate interplay between geographical factors and the observed phenomenon. Based on the analysis of spatial variation of geographical layers, this study uses factor detector to analyze the influence of internal driving factor X of five criteria layers on Y, i.e. CR. Interaction detection is used to identify the relationship among the factors that affect the resilience level of community human settlement [79, 80]. The model is as follows:

$$q=1-\frac{1}{N{\sigma }^{2}}{\sum }_{h-1}^{L}{N}_{h}{\sigma }_{h}^{2}$$
(18)

where: \(q\) is the influence of the influence factor on the resilience of community human settlement; \(h\) represents the stratification of factor X. \({N}_{h}\) and \(N\) represent the number of cells in stratum \(h\) and the whole area, respectively; \({\sigma }_{h}^{2}\) and \({\sigma }^{2}\) represent the variance of Y values in stratum \(h\) and the whole area, respectively. The value range of \(q\) is [0, 1], with larger values indicating stronger explanatory power of factor X on attribute Y and vice versa.

Results

Condition of regional human settlement resilience level

Based on the resilience index, the paper ranks the resilience level of the human environment in each district in Shanghai (Table 3). Xuhui District obtained the highest resilience index score of 6.62, which is much higher than the other six districts. This indicates that its resilience quality is very high. Putuo District and Yangpu District followed closely with resilience index scores of 4.23 and 4.01. This indicates that those two districts also have a high quality of resilience. Changning District and **g'an District obtained resilience index scores of 3.22 and 3.05, respectively, indicating a medium quality of resilience. Huangpu District has a low resilience index of 2.56 but has the potential to improve towards medium quality. Hongkou District had the lowest resilience index score of 1.52, indicating a very low quality of resilience. The resilience index of Hongkou District is significantly different from the other districts.

Table 3 Regional-scale human settlement resilience rating index ranking

Regarding the spatial distribution (Fig. 4), the overall pattern in the basin displayed a central area with lower resilience levels and a peripheral area with higher resilience levels. Xuhui District stood out as relatively high in resilience, followed by Putuo District and Yangpu District.

Fig. 4
figure 4

Spatial distribution of regional-scale human settlement resilience level

Condition of CR level

Based on Fig. 5, we rank the CRI of each district from highest to lowest. It was observed that Xuhui and Putuo districts exhibited a gradual decline in the CRI, with relatively smooth curves. The CRI for Yangpu District initially shows a sharp downward trend, followed by a more stable downward trend. It eventually fluctuates slightly after it reaches a certain level. The downward trend of CRI in Changning District is similar to that of Xuhui District, but with some irregular fluctuations at the bend. **g'an District displayed a linear and consistent decline in the CRI. Huangpu District initially had an irregular curve, but later exhibited a linear and steady decline after surpassing a specific threshold. Hongkou District experienced a drastic and irregular decline in the CRI.

Fig. 5
figure 5

Analysis of community-scale human settlement resilience Level by district

Overall, Xuhui District displayed the highest level of community resilience compared to the other six districts. Putuo District, Yangpu District, **g'an District, Huangpu District, and Changning District maintained a relatively consistent level of community resilience. They differ in that Changning District has a higher level of human settlements resilience. In contrast, Hongkou District had significantly lower community resilience compared to the other district. This suggests that effective measures need to be taken to improve the resilience of the district.

Condition of high human settlement resilience communities by district

To gain a better understanding of communities with high human settlement resilience in each district, this study compared the top ten communities in each district (as shown in Table 4 and Fig. 6). The analysis reveals that Changning District exhibits the highest level of community resilience among the seven districts, showcasing its superior performance. Xuhui District demonstrates an overall high and consistent level of community resilience. Yangpu District also has a high level of community resilience, but there are significant differences within its range. The highest index reaches 0.0997, while the tenth ranked community scores only 0. 0404.The difference between the two is 0.0593.

Table 4 Regional ranking of high-quality CR level (top 10)
Fig. 6
figure 6

Comparison of high-quality CR Level

The CRI values for Huangpu and Putuo districts range from 0.3 to 0.6. The values are stable but not outstanding. Only three communities in the Hongkou district have CRI values around 0.05. Both Hongkou District and **g'an District generally display low CRI levels, ranging from 0.2 to 0.4. However, the top ten communities in **g'an District show a tendency towards consistent CRI values. This indicates a relatively equitable development of resilience levels in the district.

Spatial characteristics of human settlement resilience

CR spatial autocorrelation

Based on the CRI, this study implemented a global spatial autocorrelation analysis with the help of Space/Univariate Moran's I in Geoda software. The results show that Moran's I value is 0.281. This indicates that there is a significant positive spatial autocorrelation for CRI, which exhibits spatial clustering (Fig. 7).

Fig. 7
figure 7

Scatterplot of Moran's I index of CR level by district in Shanghai

To assess the local spatial aggregation and analyze the similarity and spatial divergence of human settlement resilience levels among neighboring community units, we used ArcGIS 10.2. As shown in Fig. 8, we have mapped the evolution of the aggregation of human settlements resilience levels across regional communities. The Moran's I index LISA plot in the "High-High" (HH) and "Low-Low" (LL) quadrants indicate a strong positive spatial correlation of CR levels. This suggests a homogeneous and aggregated distribution pattern across regions. Conversely, the "High-Low" (HL) and "Low–High" (LH) quadrants represent areas with a strong negative spatial correlation. This suggests spatial heterogeneity and discrete distribution patterns of CR levels across regions during the study period. The distribution of communities across the HH, LL, HL, and LH quadrants can be observed in Fig. 8. Communities are more concentrated in the HH and LL quadrants than in the HL and LH quadrants. Additionally, there is a notable regional concentration of overall CR levels. Communities in the LL quadrant are concentrated in the north, while those in the HH quadrant are located mainly in the south. Communities in the HL and LH quadrants are scattered around communities in the HH and LL quadrants. Overall, there is a clear spatial dependence between CR levels in each region. This indicates clustering characteristics with neighboring regions. Within the study area, fewer gathering areas are displaying a "high-low" polarization effect and a "low–high" transitional type at a significance level of 0.05.

Fig. 8
figure 8

LISA chart of Moran's I index of CR level by district in Shanghai

Spatially descriptive statistics of CR by district

Based on the research formula, we calculated the human settlements resilience index for each area and derived the CRI. We then classified the CRIs into five categories: very low quality zone, low quality zone, medium quality zone, high quality zone, and very high quality zone using the natural interruption point grading method. The classification and quantity of human settlement resilience are presented in Tables 5 and 6, and the spatial distribution of the proportion of communities in different grades in the participating cities is illustrated in Fig. 9.

Table 5 Overall statistics for the human settlement resilience evaluation
Table 6 CR Evaluation statistics
Fig. 9
figure 9

Spatial distribution proportion of communities with different human settlement resilience level in Shanghai

Table 5 reveals that low quality areas have the highest proportion of CR evaluations, with a total of 340, accounting for 34.62% of the total. Very low quality areas follow with 331 evaluations, accounting for 33.71% of the total. Medium quality areas have 243 evaluations, accounting for 24.75% of the total. On the other hand, the number of very high quality and high quality zones is the smallest, with 58 and 10 zones respectively, accounting for only 5.91% and 1.02% of the total.

Table 6 and Fig. 9 provide insights into the composition of different levels of communities in the participating cities. There are obvious regional differences in the level of community building in Shanghai, with an overall distribution pattern of "northwest to southeast bulge". The distribution of the index and the number of communities exhibit similar patterns. Generally, the southeastern part of the city demonstrates higher CR levels compared to the northwestern part. Xuhui District and Changning District have the highest proportion of very high and high quality communities, accounting for 21.4% and 31% respectively, serving as the leading "twin cores" in the development of Shanghai's CR quality. **g'an District lacks very high and high quality communities, indicating a low level of development and emphasizing the need to accelerate the construction of high-quality human settlement resilience communities. Yangpu District and Putuo District have the highest percentage of very low and low quality communities, with 78.8% and 74.5% respectively, indicating a majority of communities with low quality. The government should prioritize the development of resilient qualities in community human settlement and solve the problems of "Weak Communities" and " Fragile Communities". The government should also focus on transforming "backward communities" into "resilient communities" as soon as possible.

Spatial heterogeneity of CR

To visualize the spatial characteristics of the CR level in each region of Shanghai, we utilized ArcGIS 10.2 software to generate Figs. 10 and 11. The figures illustrate the spatial distribution of the CR level and subsystem indices.

Fig. 10
figure 10

Comprehensive CR evaluation for spatial heterogeneity characteristics

Fig. 11
figure 11

CR evaluation for spatial heterogeneity characteristics of each system

Figure 10 reveals clear spatial differentiation characteristics of CR levels. Communities with very high human settlement resilience exhibit a "pole-core" spatial pattern, clustering around the central areas of the district and the vicinity of the Huangpu River. Core communities with medium and high human settlement resilience display an irregular open pattern, forming a "ring-like agglomeration and radiation" type. Resilience values are dispersed across most of the region. Resilient communities with middle and high-value human settlements are primarily concentrated in the central and southeastern parts of the old city. Conversely, northern, western, and southern communities demonstrate a balanced yet low level of resilience, showing a "flake-like agglomeration and radiation" spatial pattern. Overall, the central city mainly consists of low and medium resilience zones, with wider distribution. On the other hand, the peripheral areas are dominated by very low resilience zones, forming a semi-humped spatial pattern of "low inner circle, high middle circle and low outer circle".

Figure 11 displays the spatial distribution of the subsystems in the CRI model, indicating significant variation. The driving force index (D-system) shows a typical pyramidal spatial pattern. Higher values are found in the centre and lower values in the peripheral areas. The reason may be that Huangpu and Xuhui districts are the most economically developed areas in Shanghai. The development of enterprises not only increases the GDP of the region, but also attracts a large number of labors. The stress index (P-system) exhibits a patchy characteristic due to its dependence on district and county-level environmental pollution data. It displays a basin-type spatial pattern of "low in the center and high in the periphery," reflecting the overall seriousness of environmental pollution in the old city. The areas with high values of the stress index cover a wide area, up to three "red areas" and one "orange area ". The state index (S-system) generally maintains a low level of balanced distribution, with more high-value neighborhoods near the Huangpu River. The overall spatial pattern of "low in the west and high in the east" is formed. The reason for this may be the dense concentration of businesses and population along the river. This often requires more buildings and transport facilities. The impact index (I-system) showcases a "polar core" spatial pattern, with scattered high-value areas. Finally, the response index (R-system) appears as a "mosaic" type spatial pattern. The overall distribution is freely dispersed. But most of the high value areas are distributed in the west. The reason may be that the economic development level of this area is not so developed compared with Huangpu and Hongkou districts. There are more green spaces to be developed in the region.

Driver factors analysis of community resilience for human settlement

The paper first calculates the standard deviation of the normalized indicator values. Then we use the geodetector technique to examine and analyze the impact on the resilience of human settlements.

Factor detection analysis

This study employed the GIS-Jenks Natural Breaks Method to classify the original numerical quantities of the five variables, transforming them into categorical values based on the classification results. Then we introduced the CRI and categorical values into the respective dependent variable Y and independent variable X in the geographical detector to identify influential factors. A higher q-value indicates a stronger explanatory power of the independent variable X on the dependent variable Y.

The results in Table 7 demonstrate that R6 (distance from bus stops) holds the highest rank with a q-value of 0.292. It indicates that it is the most influential factor affecting the resilience of human settlements in the community. The proximity to public transportation reflects the infrastructure development of a city and represents an external response to its economic level. Therefore, future community development efforts should focus on enhancing public transport service facilities and innovations in transport technology.

Table 7 Results of CR level factor detection

D7 (average annual temperature) and P1 (CO2 emissions) both hold a q-value of 0.12, securing the second rank. This suggests that both D7 and P1 significantly impact community human settlement resilience. Sustainable urban development depends on the development of clean energy. Governments should increase the recycling rate of energy, reduce carbon dioxide emissions and mitigate the greenhouse effect.

S1 (building density) acquires a q-value of 0.11, ranking third. Although slightly lower than the second rank, this indicates that S1 has a notable influence on CR. It underscores the importance of building density as a crucial expression of community development.

I1 (number of jogging trajectories) holds the fifth rank with a q-value of 0.077, indicating a minor impact on CR. This suggests that human health activities have limited influence on human settlement resilience. However, it is important to note that human health activities cannot be dissociated from the environment and social support. Attention can be given to human health activities without compromising other aspects of community development.

Interaction detection analysis

Interaction detection was employed to assess whether the combined effect of factors increased or decreased the explanatory power for the level of CR (Table 8). The results of factor interactions revealed that the values of the factor effects in two-way interactions were higher than those of single factors, demonstrating enhanced and nonlinear effects of the two-factor interactions. This indicates that the combined action of factors augmented the explanatory capacity of the resilience level. Specifically, the two-factor interactions between D7 and S1, D7 and I1, P1 and S1, P1 and I1, S1 and R6, and I1 and R6 exhibited significant effects on CR levels, indicating a robust association between these factors.

Table 8 Results of CR level interaction detection

Correlation analysis

As shown in Fig. 12, we analyzed the correlation between CRI and drivers using R language software and Origin software. The results indicate a significant positive correlation between the CRI and D7, I1, and R6, while exhibiting a negative correlation with P1 and S1. Notably, R6 exhibited the strongest influence on CR, with the highest correlation coefficient of 0.53 in absolute value. Both D7 and I1 displayed the same correlation strength with CR, with an absolute value of 0.32. On the other hand, P1 exhibited the weakest correlation with CR, with an absolute value of 0.17.

Fig. 12
figure 12

CRI correlation

Discussion

This study assessed the CRs in the study area based on the integrated evaluation index method of the DPSIR model. Also this study considered the interaction between health activities and environmental supply and demand.

The findings reveal that while some communities demonstrate excellent human settlement characteristics, well-developed infrastructure, and a strong capacity to withstand external disasters. However, the overall resilience of communities still needs to be improved. In general, most communities score lower in ecological environment, built environment, and social functions. Additionally, there is a significant disparity in human settlement resilience among communities, emphasizing the need for prompt improvement. This result can be attributed to severe urban growth. Urban growth has led to problems such as urban flooding, traffic congestion and ecological damage [81,82,83]. Consequently, this hinders the endogenous development momentum for human health activities [84, 85]. A positive trend in this element is crucial for enhancing the CR. Residents are the main contributors to community activities. If they lack healthy activities, it is difficult to maintain endogenous development dynamics. This trend is detrimental to the stable development of the community human settlement system [86, 87]. To enhance the resilience of the community human settlement system and achieve sustainable and high-quality development, it is necessary to adopt incentive response measures based on the current state of the system and its impact results. For instance, encouraging residents to engage in healthy physical activities and improving community sports facilities can bring positive feedback to the system.

The spatial distribution analysis reveals that at the district and county scale, CR follows a spatial pattern of being low in the center and high in the periphery. At the community scale, CR exhibits an irregular spatial pattern characterized by pole-core agglomeration and radiation. Communities with high resilience are predominantly found in the south-central and Huangpu River areas. The spatial patterns of the two types of systems vary considerably. This may be due to differences in the proportion of communities within the regional space. This leads to large differences in the comparison of resilience systems between districts and counties. The disparity in resilience between areas outside the polar nuclei and the polar nuclei can be attributed to the daily health activities of urban residents being concentrated and dispersed mainly in the monocentric clustering of polar nuclei in the district centers. The spatial clustering of resilience is moderately distributed in most areas. This reflects a spatial supply–demand mismatch or complementary relationship between health activities and the environment. This leads to a low-level equilibrium in the spatial distribution characteristics of CR, aligning with existing research [88,89,90]. Furthermore, it is observed that high resilience areas are primarily concentrated in the central and southeastern parts of Shanghai's old city, including Huangpu District, Xuhui District, and **g'an District. These areas serve as the core regions for integrated urban functions, characterized by intensive and frequent daily health activities. On the other hand, the northern, northeastern, and western areas of the old city, and the southern end of the city exhibit weaker resilience capacity due to imperfect integrated functions and location levels of the activity environment. These areas also display less dynamism in terms of health activity [91]. To overcome the spatial layout inertia of one-way overdraft in the "center-periphery" pattern, efforts should focus on promoting the orderly distribution of resilient elements related to urban residents' health activities and environmental systems. This requires ensuring that spaces for everyday health activities are autonomous, balanced and inclusive, rather than relying solely on static differences in spatial hierarchical scales and functional positioning.

In addition, based on the results of the spatial distribution of subsystems, we recommend the following actions. Firstly, there is a need to accelerate the orderly decentralization and relocation of over-concentrated public service resources and population from the old city center to peripheral communities. This will promote comprehensive development, improved supporting facilities, and population concentration in the new central area, enhancing the concentration of modern and traditional living atmospheres. Secondly, the government should vigorously promote the construction of an integrated slow-moving transport network and the promotion of mixed use of various land uses among key communities. This can link health activities and environmental elements through multiple channels. This facilitates the micro-circulation of health activities within communities, forming balanced spatial clusters for daily health activities. In addition, it is necessary to promote the organic regeneration of older urban neighborhoods and the planned development of new towns. This enhances synergies and complementarities between communities in the region. This reduces the gradient among communities and optimizes two-way interaction, enhancing the efficiency, effectiveness, and quality of daily health activities.

Regarding the contribution results, it is evident that the construction of community public transport services can promote environmental and economic development, which constitutes the primary reason for the increase in CR in the study area [82, 93]. Reducing the distance between the community and public transport stations can further enhance CR. The average annual temperature and CO2 emissions also exert a significant impact on CR. Therefore, natural environmental stresses such as climate, air pollution and vegetation are key factors influencing changes in CR. Building density and the number of jogging trajectories serve as indicators of the vitality of human activity systems in the face of environmental disturbances. Communities with low building density and dense jogging trajectories demonstrate higher resilience. Furthermore, it is worth noting that the correlation between annual mean temperature, jogging activity, and CR exhibits a significantly positive and non-linearly increasing relationship. This suggests that human health activities are influenced by temperature, resulting in notable changes in resilience. Conversely, the non-linear increase in CO2 and building density signifies an intensification of the greenhouse effect and severe urban sprawl due to human activities related to urbanization. These factors contribute to an overall low level of CR. Therefore, it is strongly recommended that governments worldwide focus on the rational use of ecological resources and control the extent of urban community growth during rapid urbanization. Simultaneously, efforts should be made to strengthen the protection of existing woodland and grassland vegetation, especially by promoting residents' engagement in health activities. These measures ensure the sustainability of community human settlements.

Advantages and limitations

The study of the resilience of human settlements is of great importance in the field of global geographic studies. While urban human settlements and urban resilience have gained attention, there is still a scarcity of academic research specifically focused on human settlement resilience. This paper incorporates the principle of resilience into the study of human settlements and addresses the spatial supply–demand contradiction related to daily health activities as a primary community conflict. By exploring the dynamic relationship between people and land, the study reveals the human values and micro-details of spatiotemporal interactions. And the paper establishes an organically integrated CR evaluation index system through comprehensive correlation and multiple characterization of resilience elements and capacities. This research contributes to the academic understanding of resilience.

The research methodology employed in this paper is reasonable. Based on the DPSIR model, this paper analyses the interactions between the elements from a system perspective. This paper further constructs an evaluation index system for urban habitat resilience. Previous studies have used various methods to investigate the influencing mechanisms of geographic environmental phenomena, but they often lack the identification of interactions among multiple variables. In contrast, this study utilizes geodetector technology to explore the driving forces that impact the level of CR. This approach effectively identifies relationships among multiple variables, leading to a better understanding of the mechanisms at play.

The feasibility of the research data is supported by geographic big data, which enables comprehensive assessment and spatial visualization of urban resilience. This solid foundation facilitates scientific governance practices and spatial carriers for urban resilience. The study offers valuable insights for expanding the research field, deepening theoretical understanding, improving measurement methods, and enhancing CR governance.

However, there are limitations in this paper. The community human settlement system is a complex and open system, and solely understanding the five major subsystems is insufficient. It is necessary to examine the interactions among various subsystems and enhance the knowledge of overall CR. Additionally, due to data acquisition limitations, this paper has selected relatively important and representative indicators. Further research should refine data acquisition and processing methods and improve the indicator system for measuring the CR. Furthermore, since community human settlement systems are constantly evolving, it is important to track their evolution over time and adjust the research methodology based on macroscopic observations. This will allow for continuous follow-up research on the resilience of community human settlement systems.

Conclusion

In the complex context of global environmental change and urbanization, the dynamic and evolving contradiction between the supply and demand for healthy living necessitates the promotion of a more resilient supply and demand process. This paper first constructs a CR evaluation index system based on the DPSIR model. Then this paper conducted a comprehensive evaluation of the resilience of Shanghai central habitat by integrating the AHP-entropy method, GIS spatial analysis and geographical detector method. The main findings of the study are as follows:

  1. (1)

    There are significant variations in the level of human settlement resilience across the study area, exhibiting a basic "slide-shaped" fluctuation tendency.

  2. (2)

    The spatial distribution of human settlement resilience shows two patterns. One is the " pole-core agglomeration radiation" type characterized by core colonies with very high resilience values. The other is the typical irregular, open "ring agglomeration radiation" type dominated by core colonies with medium and high resilience values.

  3. (3)

    Geographical detection, interaction detection, and correlation analysis highlight the dominant factors influencing CR. The analysis indicates that the CRI is positively correlated with average annual temperature and the number of jogging trajectories, while negatively correlated with CO2 emissions and building density. In addition, the interactions between these factors enhanced resilience in a non-linear and bivariate manner.

The results of this study hold significant implications for countries and communities worldwide. Firstly, the findings emphasize the importance of evaluating CR, particularly about health activities and the balance between environmental supply and demand. This highlights the need for governments and communities to prioritize CR and enhance the quality of life and health of community residents. Secondly, the comprehensive evaluation methods and techniques employed in this study can serve as a reference to develop their evaluation indicator systems and methods suitable for local community human settlements. Finally, this study provides insights for countries to formulate relevant environmental policies and climate change adaptation strategies, so as to safeguard human health and promote environmentally sustainable development.