In response to the problem of UAV-assisted communication, utilizing the characteristics of wireless ultraviolet with strong anti-jamming performance and good confidentiality, providing emergency communication services by covering ground users with UAVs as aerial base stations is crucial. A K-means clustering coverage algorithm based on the local density is proposed, which increases the connectivity term of UAVs on the basis of minimizing the squared error; secondly, the definition formula of the local density is proposed, and a heuristic decision function is used to determine the selection of the initial cluster center. The simulation results show that the initial coverage of the initial cluster center selected by the heuristic function is increased by 31.6%. Compared to the standard K-means algorithm and FSFDP algorithm, the coverage rate of the proposed algorithm in this paper is improved by 7.2% and 4.3%, respectively.