Jian Ma, Zeyu Zhang, Junwei Wu, Ben Wang, Zhilei Zhen
Identifying and protecting key carbon sink areas is critical for maintaining regional ecological security and promoting the healthy development of ecosystems. This study investigated the spatial matching relationship between the supply and demand of carbon sequestration service (CSS), visualized the direction and scale of CSS flows, and combined the XGBoost–SHAP model with Bayesian networks to identify driving factors. Results indicated that the Shanxi section in Yellow River Basin (SYRB) generally displayed a carbon surplus, with the supply–demand ratio of CSS forming a spatial pattern of “low in urban areas and high in mountainous regions.” High-elevation areas such as the Lvliang Mountains, Taiyue Mountains, and Zhongtiao Mountains supplied CSS to deficit regions including Taiyuan City, Linfen City, and Yuncheng City through diverse flow paths. The ellipticity and azimuth angle of the standard deviation ellipse showed minimal change, indicating a stable spatial distribution of carbon surplus and deficit (CSD). Elevation and mean annual precipitation exerted positively effect on CSD, while GDP and population had significant negative impacts. From 2000 to 2020, the first-priority areas expanded from 7.82 × 10 3 km 2 to 13.98 × 10 3 km 2 (a 78.7% increase), while the second-priority areas shrank from 34.89 × 10 3 km 2 to 18.00 × 10 3 km 2 (a 48.4% decrease). This study enriches the theoretical research on basin-scale ecosystem services and contributes to the ecological restoration of the Yellow River Basin and the achievement of carbon neutrality goals.