There is a certain energy loss in the process of wireless sensor network information collection. Moreover, the current network protocols and network coverage methods are not sufficient to effectively reduce system energy consumption. In order to improve the operating efficiency and service life of wireless sensor networks, this study analyzes the classic LEACH protocol, summarizes the advantages and disadvantages, and proposes a targeted clustering method based on the K-means algorithm. At the same time, in order to maximize the network coverage and minimize the energy consumption on the basis of ensuring the quality of service, a wireless sensor network coverage optimization method based on an improved artificial fish swarm algorithm was proposed. In addition, a controlled experiment is designed to analyze the effectiveness and practical effects of the proposed algorithm. The experimental results show that the method proposed in this paper has certain advantages over traditional methods and can provide theoretical references for subsequent related research. INDEX TERMS Feedback, K-means clustering, artificial fish swarm algorithm, network coverage, algorithm optimization.