Predicting Rural Ecological Space Boundaries in the Urban Fringe Area Based on Bayesian Network: A Case Study in Nanjing, China

: Urban fringe areas are locations that compete between urban development and ecological protection; their ecological spatial boundaries face the risk of erosion and degradation. Previous studies have so far focused on the core area inside the ecological space. However, research on the ecological boundary zone has so far been insufﬁcient. The delineation of ECR is based on large-scale administrative units, while it is less precise at the level of small-scale rural areas. This study selected Paifang village in Nanjing City as the study area and built a Bayesian network model to predict the ecological space boundary for 2030. The study also identiﬁed the driving factors and their mechanisms affecting the changes in the rural ecological space in an urban fringe area and put forward targeted suggestions for its protection. The results suggested that: (1) The ecological space of Paifang village will expand in 2030. Speciﬁcally, agricultural land has the greatest potential for restoration of ecological space, followed by shrubland and grassland, and water bodies and their surrounding areas are potentially shrinking ecological space. (2) Artiﬁcial construction activities will disturb the ecological space, with the change in agricultural land being the main factor affecting the change in the ecological space boundary. (3) The Ecological Conservation Redline has a signiﬁcant effect on the protection of the rural ecological space. The results of this study can provide a reference for rural planning and the formulation of protection policies in urban fringe areas.


Introduction
Rural areas are settlements where various production and living activities are carried out and are formed under the combined effects of artificial construction and natural evolution [1]. Currently, approximately 510 million people in China live in rural areas, accounting for 36.11% of the country's total population [2]. In terms of area, rural areas account for more than 94% of China's land area and are an important aspect of national land spatial planning [3]. The development of the rural environment directly affects the level of the overall environment for human settlement. A village is an ecological unit with basic functions of material circulation and energy flow [4] and is also an important ecological source in the regional ecological network. Villages undertake ecosystem service functions such as water conservation, soil conservation, material exchange, and promotion of a virtuous cycle of the ecosystem [5]. In the context of rapid urbanization in China, the countryside needs to provide ecosystem services to the city. However, with the development of the rural economy, activities such as construction expansion, and the development of tourism have caused the villages to face severe risks of damage to the ecological environment and ecological function degradation [6][7][8].
The Chinese government proposed the Rural Revitalization Strategy in 2017 to solve the ecological dilemma faced by rural development; it aims to solve the problems of Land 2022, 11,1886 2 of 24 ecological space occupation, ecological damage, and environmental pollution caused by disorderly, excessive, and scattered development [9]. In the same year, the Provincial Spatial Planning Pilot Program was issued, which proposed to scientifically delineate the spatial pattern of "Three Districts and Three Lines" in urban and rural areas [10], which was officially incorporated into the National Land Spatial Planning System in 2019. Here, the "Three Districts" refer to the urban, ecological, and agricultural spaces, and the "Three Lines" correspond to the three control lines {Aalders, 2008 #44} of the urban development boundary, the Ecological Conservation Redline (ECR), and permanent basic farmland [11]. Among them, ecological space is based on nature and is an area that provides ecological products and services as the leading function, thereby playing an important role in regulating, maintaining, and ensuring regional ecological security [12]. The ECR is an area boundary line for areas with special important ecological functions and ecologically high sensitivity within ecological spaces that need to be strictly protected and prohibited from development [13].
Previous studies have so far focused on core areas inside the ecological space of urban fringe areas. However, research on ecological boundary zones has been insufficient. A rural ecological space is the basis of production and living space [14], and its stability is an important guarantee for maintaining the ecological security pattern while also contributing to the protection of rural characteristic landscape resources [15,16]. In recent years, in the practice of the Rural Revitalization Strategy, production-living-ecological (PLE) spaces have become a research hotspot [17,18]. However, related research mostly focuses on the coupling relationship between the structure and function of a PLE space [19,20], with a pertinent focus on ecological spaces. Compared with cities, different types of spaces in rural areas are highly integrated into functions [21]. For example, orchards and tea fields have dual functions of ecology and production [22,23]. They are not only productive spaces with high economic value, but are also complex ecosystems with high vegetation coverage and species richness, so their ecological function value cannot be ignored. Therefore, a rural ecological space is not purely ecological land but includes important ecological areas such as ECR permanent reserves, ecological planting industry areas, and ecological service function areas [24]. Compared with the strict protection system in the core area of the ecological space delineated by the ECR, the erosion of ecological space outside the red line has not been prioritized. Considering these facts, the retreat of the ecological space boundary will have an impact on the ecological area of the internal core, which is not conducive to the construction of the ecological security pattern. However, the ecological space at the junction of agricultural and forestry land is usually a symbiotic area of different habitat types where the energy flow is more active and has a higher ecological value [25]. Therefore, in rural space planning, attention should be paid to the overall protection of areas within the rural ecological space boundary. Because of the unique location, villages in urban fringe areas are important in the competition between urban development and ecological protection, the flow of urban and rural elements is extremely frequent, the risk of erosion of the ecological space boundary is more serious, and the sustainable development of the ecological space is also faced with bigger challenges. Therefore, understanding and identifying the evolution of rural ecological spaces in urban fringe areas and their driving factors have become crucial issues.
Currently, most research on ecological space boundaries has focused on identifying important ecological function areas and ecologically sensitive and fragile areas [26,27]. For example, The ECR [28] is usually based on a larger range of administrative regions, making it unsuitable for multi-scale ecological space protection in practical scenarios. Within the context of small-scale ecological protection, such as in villages, the microhabitats in the ecological space are often ignored [29], and the boundaries of the ecological space are left ambiguous [30]. Additionally, the ECR only protects the core area within an ecological space, rather than the overall ecological space [31]. Constructing the minimum cumulative resistance (MCR) model according to the "source-sink" theory, one can realize the prediction of the rural ecological spatial pattern [32]. However, this method is an idealized simulation of ecological processes. On the one hand, this method does not consider the characteristics of the dynamic changes in natural and artificial factors over time. The resistance surface constructed is an evaluation of the current ecological conditions, and predicts the form of the ecological space at an uncertain time in the future. This cannot reflect the evolutionary characteristics of ecological space over time. In addition, various natural and artificial factors change dynamically with time, which will also have a greater impact on the prediction results. However, it is still worth noting that rural ecological space is formed under the competition of different functional spaces. Considering only the reasons for changes in an ecological space will lead to one-sided results. Considering the above-mentioned shortcomings, this paper attempts to introduce a land-use pattern prediction model to simulate the evolution of ecological space and explore the conflict and transformation relationship between different land functions and the evolutionary process of the ecological space by predicting areas at risk of potential ecological loss and areas of potential ecological restoration [33].
Traditional land-use pattern prediction models, such as Markov chains [34,35], artificial neural networks (ANN) [36,37], CLUE-S [38,39], cellular automata (CA) [40,41], the future land-use simulation (FLUS) model [42], the multi-agent system (MAS) [43], etc., belong to the black box model [44]. These models generally need to be combined with linear regression analysis to make statistical and logical predictions [45,46], but they cannot reflect ecological processes and changing regularity regarding land-use type. The Bayesian network (BN) model is an uncertain knowledge representation and reasoning model based on probability and graph theory. Bayesian probability is the underlying mathematical principle on which the model operates [47], where it is essential that the observer combines prior knowledge and collected evidence data to express the prediction of the possibility of an unknown event in the form of probability. At present, BN models are widely used in the simulation and prediction of land-use change [48][49][50], early ecological risk warning [51,52], and ecosystem service assessment [53,54]. Compared with the black box model, the BN model has a good graphical description method and a priori knowledge integration ability, which can not only demonstrate the complex relationship between the influencing factors [55] but can also support reverse reasoning to perform diagnostic analysis on the prediction results [56]. The BN model integrates ecological knowledge and dynamic changes in regularity regarding land-use and combines the data on the current situation of influencing factors for parameter learning [57], which can realize the prediction of the future rural ecological space boundary.
This study selected Paifang Village, a suburban village in Nanjing city, as the study area. This study aimed to explore the evolution of rural ecological space boundaries in the urban fringe area and the mechanism of the internal driving factors. The study learns from the data from 2010 and 2020 by building a BN prediction model to predict the ecological space boundary in 2030. On this basis, the study combined the comparative analysis of ecological space boundaries in 2020 and 2030 to identify potential areas of ecological loss and ecological restoration and demonstrated the protective effect of the ECR on the rural ecological space. The research results can provide a reference for rural space planning and ecological space protection.

Materials and Methods
The BN model framework constructed in this paper is presented in Figure 1. The period of the research was set to 10 years, and the study used historical data (2010), current data (2020), and forecasted data (2030). Firstly, according to the ecological characteristics of the village itself and the law of land-use change, the appropriate influencing factors were selected to construct the rural ecological spatial boundary prediction index system. Relevant prior knowledge was then integrated to build a network model structure. Data from 2010 and 2020 were imported into the network model for parameter learning, and a conditional probability table (CPT) was subsequently obtained. The current status data were imported into the model for Bayesian inference to predict the ecological space boundary in 2030. The forecast results were finally compared with the data in 2020, and the changes in the ecological space of the village and potential ecological risks were analyzed in detail. In this paper, the Bayes Net Toolbox (BNT) based on MATLAB R2018a software and Netica were used to construct the BN model. Among them, BNT is a BN learning software package developed based on MATLAB language [58], and provides models such as conditional probability distribution, network reasoning, parameter learning, and structure learning, while Netica is a BN analysis software developed based on the Java language. It has a strong graphical ability and can perform diagnostic and sensitivity analyses [59].

Study Area and Data Source
Paifang Village is an administrative village in Jiangning District, Nanjing City, Jiangsu Province, with a total population of 2154 ( Figure 2). Located in the southeastern suburbs of the city, it covers an area of 8.2 square kilometers. The village is a typical "landscapepastoral" rural village in the hilly area of southeastern China. Surrounded by tea fields and bamboo forests, it has abundant resources and a landscape spatial pattern of "mountainwater-tea-forest-village". The western area of Paifang Village is dominated by farmland, scattered with architectural settlements and ponds. Architectural settlements, tea fields, and hilly woodlands are distributed on both sides of the main road running along the east-west direction in the central and eastern areas. Paifang Reservoir and Yanhu Reservoir are two larger water bodies located in the center of the village and southeast of the village, respectively. According to the ECR delineated by Nanjing City in 2018 [60], the ecological woodland on the north and south sides of the village is located within the ecological red line, with water conservation being the main ecological function. Paifang Village is a typical suburban village, only 15 km away from the main urban area of Nanjing, allowing for a continuous interaction of urban-rural elements. This occurs while the village retains its rural characteristics, despite being greatly threatened by urban expansion. However, in recent years, with the development of a rural economy featuring tea culture, tea fields have encroached on ecological woodland, increasing the risk of soil erosion in the region. At the same time, considering the fact that Paifang Village is a famous tourist destination in the suburbs of the city, the rapid development of rural tourism has brought about a certain degree of over-construction, which may lead to the deterioration of the ecological environment.  The remote sensing image data used in this study were procured from the multispectral images carried by Gaofen-2, including the data of the study area in 2010 and 2020. According to the LUCC land-use classification system of the Institute of Geographical Sciences and Natural Resources Research, Chinese Academy of Sciences, the land-use types are divided into six categories: construction land, woodland, water, shrubland and grassland, agricultural land, and bare land. After the interpretation of ENVI5.3, combined with field investigation and manual correction, the land-use maps of Paifang Village were obtained for 2010 and 2020 (Figures 3 and 4). The land-use types of woodland, water, shrubland, and grassland were then combined to obtain the rural ecological spatial distribution map. DEM and data on buildings, roads, water, woodland, and other ground features were derived from the surveying and mapping data provided by the Paifang Village Management Committee. In addition, the Nanjing ECR data were downloaded from the official website of the Nanjing Municipal Bureau of Ecology and Environment (http://hbj.nanjing.gov.cn/hbyw/zrst/201804/t20180410_615032.html, accessed on 11 May 2022).

Bayesian Network Node Variable Selection
There are usually three types of node variables in BN: (1) input layer node variables, which are the initial driving factors; (2) intermediate layer node variables, which are used to link input variables and output variables to express the mapping relationship between input and output; and (3) the output layer variable, which is usually the final problem to be analyzed, or the goal of the solution. Combined with previous research and field investigations, this study screened the factors that cause changes in the ecological space of Paifang Village and used them as node variables. The factors were divided into five types: spatial, ecological suitability, policy, land-use expansion, and target ( Table 1). The spatial, ecological suitability, and policy factors were used as the node variables of the input layer, whereas the land-use expansion was used as the node variable of the middle layer; finally, the target factor was used as the node variable of the output layer. In terms of spatial factors, six indicators were selected for the study: altitude, slope, distance from water, distance from roads, distance from buildings, and distance from woodland. Among them, altitude can reflect the environmental conditions, such as moisture and heat in the area. Different moisture and heat characteristics at different altitudes will have varied impacts on the growth of natural vegetation and crops. "Slope" is a basic landform feature and is also an important cause of surface runoff and nutrient flow affecting agricultural cultivation and natural vegetation growth [61]. "Distance from water" can reflect the irrigation and drainage conditions; at the same time, it is related to ecological sensitivity to a certain extent and will have an impact on the changes in agricultural and ecological land [62]. "Distance from roads" is closely related to artificial construction activities. The road is an important driving force for the expansion of construction land, not only affecting the ecological space pattern and land use but also having a certain hindering effect on the expansion of ecological land. "Distance from buildings" also reflects the likelihood of the occurrence of the activity of human construction. The buildingconcentrated areas in the countryside are usually those settlements where the villagers live. The construction of the settlement area expands in the form of concentric circles with the possibility of occupying ecological land in the process. The ecological suitability factors primarily include ecological sensitivity and the importance of ecosystem services. Among them, ecological sensitivity reflects the sensitivity of the ecosystem to the disturbance of various natural and human activities [63]. Ecological woodlands and water source areas are highly ecologically sensitive areas which, if excessively disturbed, will easily lead to ecological problems. Ecological service function refers to the efficiency of ecosystems and their ecological processes to maintain the natural environment conditions on which human beings depend on and provide continuous services for [64]. The key service functions for the urban fringe areas are water conservation capacity and soil conservation capacity [65]. In the selected case in this study, the policy factor considered is the ECR, a strict control boundary delimited by law to focus on protecting important or fragile ecological spaces such as ecologically functional and ecologically sensitive areas. Therefore, the ECR has a restrictive effect on the expansion of agriculture and construction land to a certain extent. Three indicators were selected in terms of land-use expansion: agricultural expansion, construction expansion, and ecological expansion. The mutual competitive relationship between these three indicators can directly reflect changes within the ecological space.

Data Processing
DEM and data of buildings, roads, waters, and woodlands were input into the ArcGIS 10.2 software (Redlands, California), and spatial analysis and distance tools were used to obtain the spatial factor data. The ecological suitability factor data are then obtained, and this process includes ecological sensitivity evaluation and the importance of ecosystem service value (ESV) evaluation [66,67]. The ecological sensitivity evaluation refers to the ability of ecological factors to adapt to external disturbances without a loss in ecological integrity [68]. In this study, we use the analytic hierarchy process (AHP) [69] to comprehensively evaluate the ecological sensitivity of factors such as terrain, water systems, land use, and vegetation and determine their weight. Then, in ArcGIS software, according to the evaluation index system, each factor is graded and assigned. Finally, the rasterized ecological sensitivity evaluation results are obtained after the weighted sum is calculated. EVS evaluation is a comprehensive evaluation based on the characteristics of Paifang Village, combined with water conservation capacity and soil conservation capacity [70]. In this study, the water balance equation is used to calculate the water conservation amount [71], and its formula is as follows: where Q is the total water conservation (m 3 ); P i is the rainfall (mm); R i is the surface runoff (mm); ET i is the evapotranspiration (mm); A is the area of the ecosystem of type i (km 2 ); i is the i-th ecosystem type in the study area; and j is the number of ecosystem types in the study area.
where R is the surface runoff(mm); P is the annual average rainfall (mm); and α is the average surface runoff coefficient. The surface runoff Ri is obtained by multiplying the rainfall by the surface runoff coefficient. The surface runoff coefficient describes the degree to which rainfall is converted into runoff. The coefficient accounts for the impact of ecosystems on rainfall and runoff.
Soil retention capacity is the ability of ecosystems (e.g., forests, grasslands, etc.) to reduce soil erosion caused by water erosion through their structure and processes. In this paper, the revised universal soil loss equation (RUSLE) [72] is used to conduct the evaluation, and the formula is as follows: where Ac is the soil conservation amount; R is the rainfall erosivity index; K is the soil erodibility factor; LS is the length-slope factor; and C is the surface vegetation coverage factor. We reclassified the evaluation results of water conservation capacity and soil conservation capacity, carried out AHP and weighted superposition, and finally calculated the ESV importance grid map.
Finally, the data obtained from the analysis and land-use maps from 2010 and 2020 were subsequently rasterized. The resultant raster maps were then superimposed and analyzed to characterize land-use expansion, specifically agricultural, construction, and ecological expansion. After acquiring the node variable data, taking the administrative boundary of Paifang Village as the scope, 38,883 random sample points were generated according to the area ratio. The sample points were superimposed on the data grid map to obtain the element variable values of each sample point. Considering BNT can only handle discrete variables, the values of each variable were discretized into two to three classes (Table 2).

Bayesian Network Model Structuring and Parameter Learning
A complete BN model must include the network structure and parameters, in which the structure must be a directed acyclic graph (DAG), and its pointing relationship represents the interdependence between different variables. The parameters are CPT, used to indicate the strength of the causal relationship between nodes. The BN structure may be expressed as: where, S represents the BN structure. Here, S is composed of node variable set V (V = {V 1 , V 2 , V 3 , . . . , V n }) and directed edge L (L = V i V j |V i , V j , ∈ V). Among them, the node variable V i is the abstract representation of the research problem, and the directed edge L is the dependency or causal relationship between the node variables V i , V j . The parameters between the node variables are the probability distribution sets reflecting the local correlation between the nodes, with the following expression: where, if V pi is used to represent the parent node set of variables V i , the joint probability distribution of V is: The construction of the BN model network may be obtained through data training for structure learning, including greedy search, the K2 algorithm, the hill-climbing algorithm, etc. It may also be directly provided by expert experience. However, the relationship between factors obtained through structural learning is essentially a statistical relationship [48] which cannot explain its internal scientific connotation and may be different from the real causal relationship. Therefore, this study adopts the expert experience method to construct the Bayesian causality network and uses BNT to complete the coding in MATLAB ( Figure 5).
for structure learning, including greedy search, the K2 algorithm, the hill-climbing algorithm, etc. It may also be directly provided by expert experience. However, the relationship between factors obtained through structural learning is essentially a statistical relationship [48] which cannot explain its internal scientific connotation and may be different from the real causal relationship. Therefore, this study adopts the expert experience method to construct the Bayesian causality network and uses BNT to complete the coding in MATLAB ( Figure 5). The purpose of BN parameter learning is to learn the conditional probability distribution of each node under the condition of a known network structure. In the case of complete data, this may be calculated using the maximum likelihood estimation (MLE). If the data are partially missing, it may be calculated using the expectation-maximization (EM) algorithm [73]. Considering the training data were complete in the BN setting, the MLE was used for parameter learning in this study. Discretized spatial factors, ecological suitability evaluation factors, land-use expansion factors, and policy factor data in 2010, as well as the ecological spatial data in 2020 (Figure 6), were used as training samples for parameter learning in MATLAB. The complete CPT was obtained after the training. The training sample data were finally imported into Netica software to visualize the results (Figure 7). The purpose of BN parameter learning is to learn the conditional probability distribution of each node under the condition of a known network structure. In the case of complete data, this may be calculated using the maximum likelihood estimation (MLE). If the data are partially missing, it may be calculated using the expectation-maximization (EM) algorithm [73]. Considering the training data were complete in the BN setting, the MLE was used for parameter learning in this study. Discretized spatial factors, ecological suitability evaluation factors, land-use expansion factors, and policy factor data in 2010, as well as the ecological spatial data in 2020 (Figure 6), were used as training samples for parameter learning in MATLAB. The complete CPT was obtained after the training. The training sample data were finally imported into Netica software to visualize the results (Figure 7).

Bayesian Network Inference
After obtaining the network structure and CPT, new evidence samples were loaded, and the node value probability of the target variable and the maximum a posteriori probability (MAP) explanation were calculated. First, the spatial factor, ecological suitability factors, and policy factor data for 2020 ( Figure 8) were loaded into the BN model as new evidence samples, and the Bayesian inference engine was used to predict the probability distribution of the target variable, which is the ecological space in 2030. Then, the MAP explanation of the probability distribution was calculated to determine whether a sample point is located within the ecological space. Finally, the resultant data of the calculation of all the sample points were imported into ArcGIS for analysis, and the ecological space boundary was displayed for 2030.

Sensitivity and Diagnostic Analyses
Sensitivity and diagnostic analyses can realize the quantitative analysis of the relationship between the variables in the BN model [74]. Sensitivity analysis is used to measure the influence of the input variable on the target variable. It is carried out through the forward-reasoning ability of BN, and the influence is expressed by variance reduction. The calculation process is presented in Formula (4). The greater the degree of variance reduction, the stronger the influence of the input variable on the target variable [75]. The diagnostic analysis set a specific state for the target variable, and the impact factor on the target variable was evaluated by observing its probability change. The results are generally expressed by the degree of change in the probability value. The greater the change in the probability value, the stronger the effect of the influence factor on the target variable.
where VR represents the variance reduction; V(ES) represents the variance of variable ES; V(ES)|I represents the variance of variable ES when variable I is known; and s represents the state of the output variable.

Analysis of Forecast Results
Based on the information on the ecological space in 2020 ( Figure 9) and the predicted ecological space in 2030 (Figure 10), the total area of ecological space in 2020 and 2030 are 3,296,490 m 2 and 3,587,175 m 2 , respectively. From 2020 to 2030, the proportion of the ecological space to the total area in Paifang Village increased from 37.68% to 41.00%, thereby demonstrating an expansion. In terms of the changes in the ecological space distribution ( Figure 11) over the past 10 years, approximately 3,020,850 m 2 of the ecological space remained stable, and the local expansion area reached 566,325 m 2 . However, 275,625 m 2 of the ecological space was determined to be lost at the same time.   The relationship between eco-spatial changes and land-use types was additionally explored (Figures 12 and 13). The prediction results demonstrated that, on the one hand, 67.99% of the expanded ecological space was converted from non-ecological land, including construction land, bare land, and agricultural land, where a majority was converted from agricultural land (382,500 m 2 ). In addition, 32.14% of the newly added ecological space was transformed from originally non-ecological space, such as woodland, shrubland and grassland, and waterfront areas with better ecological conditions. Among them, the ecological space recovery of shrubland and grassland was more remarkable, reaching 89,100 m 2 . Moreover, ecological space shrinkage primarily occurred in the water area, with an area of up to 191,250 m 2 , accounting for 65.31% of the total shrinking area within the ecological space. Therefore, it may be deduced that the area around the water body of Paifang Village is facing severe ecological problems. Finally, considering the large proportion of its own ecological space, the expansion and shrinkage of the woodland did not fluctuate significantly, and the overall ecological status was relatively stable.

Sensitivity Analysis
In this study, the predicted ecological space of the target variable was used as the analysis variable, and Netica was used to conduct the sensitivity analysis on other variables. The results are presented in Table 3. In terms of spatial factors, the variance reductions in distance to buildings, distance to the road, distance to water, distance to woodland, altitude, and slope were found to be 3.19%, 1.19%, 0.51%, 0.30%, 0.51%, and 0.00%, respectively. Therefore, the distance from buildings and roads was determined to have a stronger impact on the ecological space, while topography demonstrated a weaker impact. Regarding land-use expansion, the variances of agricultural expansion, construction expansion, and ecological expansion were reduced by 2.43%, 5.07%, and 1.13%, respectively. It may be observed that changes in agricultural land and construction land will have a strong impact on ecological space. Among them, the effect of the change in agricultural land was found to be the most significant. In addition, in terms of ecological suitability factors, the impact of ecological sensitivity is stronger than that of importance of ESV. Finally, the ECR is also a factor that was found to have a strong impact on the ecological space, with a variance reduction of up to 59.56%.

Diagnostic Analysis
The quantitative causal relationship between the impact factor and the target variable may be obtained through a diagnostic analysis of the reverse reasoning ability of the BN model. The value of the "potential ecological space" was set to "yes," under the assumption that a sample point is within the ecological space. The changes in the value of the impact variable are presented in Table 4. It was observed that in terms of the spatial factor, the probability of the variable "distance from buildings" demonstrated a large change, where the probability of "<50 m" dropped by −1.4%, and the probability of "50-200 m" and ">200 m" both increased by 0.7%, indicating that areas away from construction land are better protected. However, there was no significant change in "distance from woodland" at each level, indicating that the overall structure of the forest woodland in the village area is relatively stable, and the ecological space cannot be easily changed. In terms of the ecological suitability factors, the probability of "low sensitivity" and "medium sensitivity" in ecological sensitivity decreased by 2.5% and 25.4%, respectively, and the probability of "high sensitivity" increased by 27.8%. This demonstrates that a large number of medium-sensitive areas transformed into high ecological sensitivity areas following the expansion of ecological space. Therefore, moderately sensitive areas have great ecological potential, and proper restoration may improve the overall ecological benefits. In terms of the importance of ESV, the probability of "generally important" decreased by 12.1%, while the probability of "moderately important" and "most important" increased by 8.4% and 3.7%, respectively, which shows that compared with ecological sensitivity, this factor has less impact on the ecological space boundary. It will, however, improve the overall ecological function value of the village.

Changes in Ecological Space and Suggestions for Protection
Suburban villages are areas with a high risk of ecological loss in the process of urbanization, but the main driving forces for changes in their ecological space vary due to their unique socioeconomic context and natural conditions [76]. For example, Guli Village, which is also located in Jiangning District, assumed the function of agricultural production in the early days, and their ecological space greatly shrunk compared to villages that have had different developmental trajectories. In the process of rapid urban expansion, most spatial changes in such villages entail the transformation of agricultural land to industrial land [77]. Therefore, the main reason for the shrinking of ecological space is the decline in the ecological function of agricultural land. Another example is Longtan Village, Qixia District, Nanjing. The main reason for the shrinking of the ecological space for this village is the encroachment of mountain forests caused by mining or construction. Compared with the above two cases, Paifang Village is a typical "landscape-pastoral" rural village in a hilly area. Its own ecological conditions are more pristine. The maintenance of these conditions can be attributed to terrain-related constraints, which have kept industrial and agricultural development at a minimum, resulting in the village having a more stable ecological space. However, with the development of rural tourism in recent years, the Paifang Reservoir and Yanhu Reservoir, located in the core tourist areas, have greatly increased the probability of ecological degradation, but the stability of the ecological space of non-core tourist areas can be expected to remain relatively stable.
According to the predicted ecological space boundary in 2030, the potential shrinking areas of the ecological space in Paifang Village were primarily distributed in the shorelines of the Paifang Reservoir and Yanhu Reservoir, as well as the woodland nearby, while the possibility of ecological space restoration in the mountain area on the south side of Paifang Reservoir was observed. The ecological conservation forest on the north side of the central and western parts of the village is a relatively stable ecological space. After having analyzed trends in Paifang Village, we believe that Paifang Reservoir and Yanhu Reservoir are closely related to the artificial environment and are located close to the built-up area of the village, so they are more likely to be affected by human activities than ecological conservation forests. The two reservoirs have not only become core areas of tourism development in Paifang Village (i.e., because of their good natural scenery), but also main water sources for agricultural production in the village. Therefore, the ecological functions of Paifang Reservoir and Yanhu Reservoir will inevitably be disturbed and weakened to a certain extent.
Specifically, there is ongoing development and construction of hotels and restaurants on the east side of Paifang Reservoir (Figure 14a). This area is also an area of concentrated activity for tourists. Human-induced disturbances lead to greater risks of water pollution, water surface shrinkage, and degradation of ecological function. However, the Paifang Reservoir, as an important water source, must strictly be protected. Therefore, it is necessary to limit the scale of development of the reservoir and its surrounding areas. There is an additional risk of shrinking ecological space at the edge of the woodland around the Paifang Reservoir. Considering this area is the junction of agricultural land and forest land, it is also necessary to limit the intensity of agricultural activities in this area. The ecological space of the mountain on the south side of the reservoir has the potential to expand to the south (Figure 14b). This area is located within the scope of the Nanjing ECR, and its west is currently dominated by shrubland and grassland. Under the strict protection of the ECR, combined with appropriate ecological restoration measures, the ecological space area can be further expanded. The east side is dominated by tea fields. Although it is agricultural land, it has the potential to develop into an ecological space because of its higher ecosystem service function compared to other paddy fields. Compared with the Paifang Reservoir, the Yanhu Reservoir area faces greater ecological risks (Figure 14c). Not only is the edge of its ecological space eroded, but there is also the risk of ecological fragmentation within. On analyzing the current situation around the Yanhu Reservoir, it was found that the area with the shrinking ecological space is adjacent to the external road, which is the entrance of the village, where human disturbance is inevitable. Therefore, this area should limit the scope of human activities to the greatest extent and build an ecological buffer zone at the junction of water and land to relieve external ecological pressure.

Driving Factors Affecting Ecological Spatial Change and Their Mechanisms
The change in rural ecological space not only reflects the status of ecological development but also the contradiction and conflict between different functional spaces [78]. Considering that the PLE space in the countryside is highly integrated [79], the mechanism of influencing factors on ecological space changes is complex. Based on the results of diagnostic and sensitivity analysis, it was found that the topography is not the main factor affecting changes in ecological space in urban fringe areas; artificial construction and other factors will have a greater impact. In the case of Paifang Village, the result is reflected in the shrinking of ecological space caused by the large-scale construction of tourist facilities such as hotels and restaurants. Through the lens of landuse expansion, the impact of agricultural expansion on the ecological space is stronger than that of construction land. For this, there are believed to be two main reasons. First, the superior planning of Paifang Village limits the boundaries of rural construction and development, thereby reducing the possibility of construction occupying ecological space. Second, there are several mixed spaces between agricultural land and ecological land, which not only involve conflicts between land-use types but also provide dual functional services of ecology and production. The impact of agricultural expansion on ecological space is, therefore, bidirectional; it may not only cause the shrinking of ecological space but also promote its expansion to a certain extent.

Evolution of the Ecological Space Boundary and Its Impact
The edge of an ecological space is usually in an unstable state. This is especially true when we consider the fact that the nature and function of its land use change frequently, resulting in chaotic land development and a spatial structure not conducive to the maintenance of ecological integrity [33]. On the other hand, material and energy flows are more active in marginal areas, and their habitat composition is more complex [80]. This type of area has the potential to be restored to ecological forest land, with multiple

Driving Factors Affecting Ecological Spatial Change and Their Mechanisms
The change in rural ecological space not only reflects the status of ecological development but also the contradiction and conflict between different functional spaces [78]. Considering that the PLE space in the countryside is highly integrated [79], the mechanism of influencing factors on ecological space changes is complex. Based on the results of diagnostic and sensitivity analysis, it was found that the topography is not the main factor affecting changes in ecological space in urban fringe areas; artificial construction and other factors will have a greater impact. In the case of Paifang Village, the result is reflected in the shrinking of ecological space caused by the large-scale construction of tourist facilities such as hotels and restaurants. Through the lens of land-use expansion, the impact of agricultural expansion on the ecological space is stronger than that of construction land. For this, there are believed to be two main reasons. First, the superior planning of Paifang Village limits the boundaries of rural construction and development, thereby reducing the possibility of construction occupying ecological space. Second, there are several mixed spaces between agricultural land and ecological land, which not only involve conflicts between land-use types but also provide dual functional services of ecology and production. The impact of agricultural expansion on ecological space is, therefore, bidirectional; it may not only cause the shrinking of ecological space but also promote its expansion to a certain extent.

Evolution of the Ecological Space Boundary and Its Impact
The edge of an ecological space is usually in an unstable state. This is especially true when we consider the fact that the nature and function of its land use change frequently, resulting in chaotic land development and a spatial structure not conducive to the maintenance of ecological integrity [33]. On the other hand, material and energy flows are more active in marginal areas, and their habitat composition is more complex [80]. This type of area has the potential to be restored to ecological forest land, with multiple possibilities for development and construction or reclamation into agricultural space. Reasonable policy formulation and ecological space planning are, therefore, conducive to the sustainable stability of the ecosystem and the development of the rural economy. According to the forecast results, the ecological boundary of Paifang Village in 2030 will be significantly different from that in 2020. Specifically, the ecological boundary will be further promoted towards agriculture and construction, culminating in an increase in the boundary across various measures [81]. The current ecological boundary (i.e., 2020) is largely in the form of "farmland-forest land", "tea field-forest land", "forest land-construction land", "water area-construction land", "water area-farmland", etc. However, in 2030, it will shift towards being "farmland-tea field-woodland" or "construction land-tea field-woodland". This means that the scope of the ecological cross-zone will expand, and the overall complexity and heterogeneity of the ecological space will increase [82]. The implications of these changes will be manifested in more frequent material and energy flows, an increased species richness, and more complex community structures, culminating in an overall improvement in the habitat quality of the village.
Taking Paifang Village as an example, the marginal area of its ecological space is dominated by agricultural lands such as cultivated land and tea fields. These land-use types also have important ecological functions such as material production, nutrient sequestration, habitat support, and soil carbon sequestration [83]. From this point of view, it may be regarded as a component of ecological space. When restoring the ecological space in this area, it is necessary to wholly consider the configuration of the agricultural and forestry structure combined with the permanent basic farmland line and relevant policies on food security [84]. For example, tea fields have the dual functions of production and ecology [85], which can improve green vegetation coverage while having good economic benefits and supporting the development of tourism and agriculture. It is believed that the internal structure of agricultural land may be properly adjusted and optimized under the premise of abiding by the bottom line of food security, such as converting part of fallow land into tea fields or economic forests, which is not only favorable to the restoration of the ecological space but also brings forth certain economic benefits.

The Protective Effect of The ECR on Ecological Space
The ECR is a nationwide unified supervision system with high management efficiency [86]. The mountain forests on the north and south sides of the central and eastern parts of Paifang Village are in the Dongkeng Ecological Public Welfare Forest. The public welfare forest is a functional area for water conservation in the ECR designated by Nanjing City. It is not only highly ecologically sensitive but also an extremely important area for ESV. In the predicted ecological space boundary for 2030, the ecological woodland within the ECR did not shrink. In addition, in areas other than the ECR, a small portion of non-ecological lands, such as agricultural land and construction land, was converted into ecological space. Compared with the shrinking ecological space of water and its surrounding areas, the ECR demonstrated a more significant effect on the protection of ecological woodlands in urban fringe areas. Therefore, it may be thought that to play the role of the ECR further, the protection level for ecological space may be further delineated. For example, the protection level of the core ecological waters of Paifang Reservoir and Yanhu Reservoir may be improved. On the other hand, the buffer zone between the ECR area and the construction space may be expanded by constructing an "agroforestry complex space" [87]. Not only can the ecological effect be enhanced, but it may also contribute to an improvement in economic benefits.

Limitations
However, the BN model constructed in this study to predict rural ecological space boundaries in urban fringe areas has certain limitations: (1) The selection of the node variables and the construction of network structure are based on the ecological and morphological characteristics and the land-use pattern of Paifang Village. To a certain extent, this study may be considered specific research on the urban fringe area in the hilly region of the middle and lower reaches of the Yangtze River. When researching villages with different natural geographical environments, industrial development directions, and socioeconomic conditions, there is a need to adjust node selection and the network structure accordingly. (2) Variables affecting rural ecological spatial boundaries in urban fringe areas and their causal structures are not static; significant policy changes and sudden natural disasters within the study period may result in bias. Therefore, when using this method for parameter learning, the selected period should not be too large, and there should be no disruptive events occurring during the period. (3) Due to the selection of a small study area, the number of selected sample points was subsequently small. This may affect the accuracy of the results to a certain extent. Therefore, we may expand the study area in the future.

Conclusions
In this study, a Bayesian network was used to predict rural ecological space. Firstly, this study addresses issues seen in previous studies that were directed towards a similar problem, such as not being able to reflect the randomness of human activities in a rural spatiotemporal context, resulting in inaccurate predictions. Secondly, the Bayesian network structure effectively reflects the mechanism of action between factors affecting the evolution of rural ecological space while also reflecting the competitive relationship between different types of functional spaces, quantitatively expressed in the form of CPT. Overall, our study has yielded predictions that are largely more accurate. The research on the rural ecological boundary in this paper accounts for the lack of precision and accuracy of the ECR through the delineation of large-scale administrative units at the level of small-scale rural areas. In addition, this paper identifies the key driving factors and their probabilities affecting the evolution of rural ecological space. These results provide a reference for the optimal allocation of resources aimed at protecting and developing rural ecological space.
The main conclusions of this study are as follows: (1) It was predicted that the total ecological space area of Paifang Village in 2030 will be 3,587,175 m 2 , demonstrating expansion compared with 2020. Changes in the ecological space include expansion as well as shrinkage. Agricultural land has the greatest potential for ecological restoration, followed by shrubland and grassland, while water bodies and their surrounding areas are potential areas of shrinking ecological space that need to be focused on; (2) Competition exists between ecological and production spaces in urban fringe areas.
Artificial construction activities and changes in agricultural land will disturb the ecological space to a certain extent and are the main driving factors affecting the changes in ecological space boundaries; (3) The edge of rural ecological spaces in urban fringe areas is often in an unstable state.
The flow of material and energy in this type of area is relatively active and has various functional values and good recovery potential; (4) The protection effect of the ECR on the rural ecological space is remarkable. In addition to the strict protection of the area within the ECR, attention should also be paid to the protection of the ecological space outside the ECR boundary.