Abstract:Identifying ecological security patterns(ESPs) is essential for guaranteeing regional ecological security. Achieving a balance in the supply and demand of ecosystem services(ESs) plays a pivotal role in achieving human well-being. Taking the balance of supply and demand for ESs as the starting point, constructing an ecological security pattern is crucial for achieving ecological security and enhancing human well-being. This study focused on Shanghai, a densely urbanized metropolitan area. We examined the scale-responsive characteristics of the supply and demand relationship of ecosystem services, and developed an optimized model for the ecological security pattern. This was accomplished utilizing methods such as the InVEST model, Ecosystem Service Demand and Supply Ratio (ESDR), Coupling Coordination Degree (CCD), and the Minimum Cumulative Resistance (MCR) model. The results showed that: (1) there was significant spatial variation in the levels of both ecosystem services supply and demand in Shanghai. Specifically, the high-supply areas were predominantly distributed in suburban regions with rich resources of forested land, cultivated land, and water bodies, whereas the high-demand areas were concentrated in densely populated central urban areas. (2) The spatial pattern differentiation of ESDR and CCD demonstrated evident scale dependence in Shanghai. The evaluation results of the 1500 m grid scale and township administrative scale respectively reflected the internal details and overall supply-demand conditions of ecosystem services in Shanghai, which could be served as reference scales for optimizing the construction of the ecological security pattern. (3) The spatial location of ecological source sites was jointly determined by the integrated supply of ecosystem services and ESDR at the 1500 m grid scale. A total of 275 ecological source sites were identified in Shanghai, with a total area of 303.54 km2, densely distributed in the western and northern regions of the city; 472 ecological corridors with a total length of 3252.35 km were distributed in the form of a network; and 338 ecological pinch points and 411.84 km2 ecological obstacles were mainly located outside the central urban area. (4) Based on the supply-demand relationship of ecosystem services at the township scale, the 221 townships in Shanghai could be categorized into ecological coordination zones (55), ecological conservation zones (89), ecological improvement zones (24), ecological control zones (33), and ecological reconstruction zones (20). This research work can enrich the theory related to scale effect. Moreover, it provides invaluable insights and references for directing ecological conservation, restoration practices, and management strategies in urbanized areas.