Rapid urbanization and economic development have inevitably led to light pollution. However, currently the world has not yet formed a unified technical standard for light pollution, and light pollution cannot be effectively controlled when the environmental protection department is unable to operate. To effectively solve this problem, this paper establishes a combined weight ideal point method evaluation model based on TOPSIS evaluation method to obtain comprehensive index weights to evaluate the light pollution risk levels of four different land types in urban, suburban, rural and nature reserve areas in Beijing, China, and uses one-way ANOVA to test the differences among the four regions. Based on the Random Forest algorithm to determine the three variables with the top three feature importance weights, and based on the nonlinear optimization algorithm, using the SLSQP method, the optimal parameter combinations with the smallest cost are obtained after iteration, so as to put forward three feasible intervention strategies such as adjusting the design of the nightscape lighting, reducing the time of nonessential lighting, and rationally planning the layout of the city’s lighting, etc., to solve the light pollution problem, which effectively promote the urban nightscape lighting’s it effectively promotes the healthy and sustainable development of urban nightscape lighting.