In view of the lack of consideration of environmental protection performance in the traditional path optimization model, a path optimization model for urban traffic networks from the perspective of environmental pollution protection is proposed. Firstly, the urban real-time traffic condition is expressed by the road traffic state index, and an integer programming model is established to optimize the route with the goal of low carbon and shortest distribution time. Then, a hybrid particle swarm optimization algorithm combined with adaptive disturbance mechanism based on variable neighborhood descent is designed, which can better carry out adaptive disturbance according to the situation that the population falls into local extreme value, and the 2-opt local search method is introduced to improve the quality of solution. Finally, the improved particle swarm optimization algorithm is used to solve the two-objective model to obtain the Pareto front solution set, that is, the path scheme under real-time traffic conditions. The experimental demonstration of the proposed model based on two application scenarios shows that its distribution cost, distribution time, and carbon emission are 1975 yuan, 27 h, and 213 kg, respectively, which are better than other comparison models and have high application value.