Aiming at the problems of node redundancy and network cost increase in heterogeneous wireless sensor networks, this article proposes an improved whale optimization algorithm coverage optimization method. First, establish a mathematical model that balances node utilization, coverage, and energy consumption. Second, use the sine–cosine algorithm to improve the whale optimization algorithm and change the convergence factor of the original algorithm. The linear decrease is changed to the nonlinear decrease of the cosine form, which balances the global search and local search capabilities, and adds the inertial weight of the synchronous cosine form to improve the optimization accuracy and speed up the search speed. The improved whale optimization algorithm solves the heterogeneous wireless sensor network coverage optimization model and obtains the optimal coverage scheme. Simulation experiments show that the proposed method can effectively improve the network coverage effect, as well as the utilization rate of nodes, and reduce network cost consumption.