With the rapid development of economy and society, environmental pressure is increasing and environmental problems are emerging. The pollution of urban water environment is particularly serious. A large number of river channels are cut off and landfilled, land plants are destroyed and hardened, and domestic and production sewage is directly discharged into river channels, resulting in serious damage to the ecological environment of urban water bodies. In the perspective of ecological environment protection, urban polluted rivers have become the focus of water pollution control. In order to improve the ecological environment of urban water body and ensure the sustainable development of social economy, it is of great significance to study the control of urban river water pollution. In this paper, the methods of data collection, numerical simulation and theoretical analysis are used to study the water pollution control of urban inland rivers. Firstly, the current situation of urban water pollution is understood through data access, and then the hydrological water quality model is established based on RMA2 and RMA4 models in SMS. The main parameters of the model were determined by the method of sensitivity analysis. The results show that RMA2 model with Peclet number of 20 and roughness of 0.045, RMA4 model with diffusion coefficient of 1 and NH 3 -N degradation coefficient of 0.16 d −1 can simulate pollutant diffusion well. This paper uses the water quality model to simulate the water environment of urban inland rivers. The research results show that the water quality model can calculate the water environment capacity and pollutant capacity, so as to obtain the amount of water pollutants to be reduced, and realize the effective control of urban river water pollution. • This paper uses data collection, numerical simulation and theoretical analysis to study the prevention and control of water pollution in urban inland rivers. • This article first understands the current situation of urban water pollution through data access, and then establishes a hydrological and water quality model based on the RMA2 and RMA4 models in the SMS. • In this paper, through the calculation of the water quality model, the urban mainstream water environmental capacity is obtained, and the environmental capacity is allocated to the tributaries.