Tourism ecological security is an integral component of sustainable tourism development. In this study, we utilized the DPSIR model to establish an evaluation index system for assessing the ecological security of tourism in Lanzhou. The study investigates the evolutionary characteristics of the tourism ecological security level in Lanzhou, a semi-arid river valley city, from 2009 to 2021. The research employs the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method, coupled with the coordination degree model and obstacle degree model, to examine the influencing factors on the tourism ecology of Lanzhou. The research results indicate that:(1) The overall evaluation value of tourism ecological security in Lanzhou exhibits an upward trend. Specifically, the evaluation values of various subsystems were higher in 2019 compared to 2009, while the evaluation values in 2009 were relatively lower. Furthermore, the evolution patterns of the evaluation values for the driver subsystems and the influencing subsystems were similar. The evaluation value curves for the state subsystem and the response subsystem evolved in a generally consistent manner. (2)The coupling coordination between the driver subsystem and the pressure subsystem (DP), the driver subsystem and the response subsystem (DR), the pressure subsystem and the response subsystem (PR), as well as the state subsystem and the response subsystem (SR) continuously increases. However, the coupling coordination between the pressure subsystem and the state subsystem (PS), the state subsystem and the impact subsystem (SI), and the impact subsystem and the response subsystem (SR) is unstable. (3)During the analysis of criterion layerobstacle degree, it was found that the state subsystem exhibited the most significant increase in obstacle degree, followed by the impact and pressure subsystems. The obstacle degree of the response subsystem fluctuated, while the driver subsystem experienced a significant decrease in obstacle degree. (4)The natural population growth rate has consistently been a primary obstacle factor in the tourism ecological security system of Lanzhou, and it has increased over time. On the other hand, the obstacle degrees of per capita disposable income and the growth rate of the tertiary industry have decreased over time. Indicators such as per capita park green area, forest coverage rate, proportion of natural protected areas to land area, green area, afforestation area of barren hills and wastelands, as well as general industrial solid emissions, have been major obstacle factors in most years. Among these indicators, the obstacle degrees for forest coverage rate, proportion of natural protected areas to land area, and green coverage rate are relatively high. The aim of this study is to enhance the tourism ecological security level of Lanzhou, a semi-arid river valley city, and provide valuable insights for the high-quality development of the tourism industry in the Yellow River Basin.