The spatial and temporal characteristics of urban spatial evolution under the constraint of ecological security are studied, and the general situation of regional ecological environment is analyzed. The index system of regional ecological security is constructed, and the status of regional ecological security is obtained through the combination of these indexes and membership function. The elasticity coefficient and intensity coefficient of urban expansion are obtained by calculation, and the degree of interprovincial difference is obtained by calculating the Gini coefficient. The urban spatial center of gravity is calculated according to the gravity synthesis analysis method, and the spatial and temporal characteristics of the final urban spatial evolution are obtained by integrating these coefficients. The study area data was input into Matlab software to simulate the urban spatial evolution of the study area. Through analysis, 2010 to 2015 is the key period of the ecological security of the region, the degree of ecological security decreased, and the ecological security of the region has been greatly improved from 2015 to 2020. Under the constraints of ecological security and under the influence of economic factors, this region has witnessed stable urban spatial evolution after 2015, with small fluctuations in the future, indicating that this region has achieved good results in the evolution process to the suburbs. This study provides new ideas for future urban evolution and development.