The rapid development of artificial intelligence and UAV technology is driving the application of police UAV clusters in the fields of social governance and public safety. The article optimizes the coherent formation control of police UAV clusters based on the artificial intelligence algorithm of particle swarm. Its dynamics model is optimized according to the flight characteristics of quadrotor UAVs, and the convergence speed is further improved by the particle swarm algorithm. Introducing rounded variables in the discrete-time control barrier function makes the UAV more natural in the obstacle avoidance process. The range of the Liapunov function is adaptively adjusted to improve the success rate of intersection construction. Meanwhile, the event triggering strategy is introduced to solve the optimal control variables for obstacle avoidance. The coherent formation control algorithm in this paper can complete the UAV converging to the reference trajectory along the X-axis and Y-axis within 0.5 seconds. The clustering success rate of the event-triggered obstacle avoidance strategy is improved by 5.84% to 18.95% compared with the comparison algorithm. The police UAV using the cooperative control method in this paper monitors that the PM2.5 concentration on urban roads is significantly reduced after water sprinkling. For a comprehensive evaluation result of water quality in a watershed is 0.139, which belongs to class II water quality. The UAV cluster can be linked with the city management system to build an all-round and three-dimensional governance system.