In response to the current issues of high network energy consumption and short lifespan in the wireless sensor network clustering routing strategy of the intelligent substation comprehensive error prevention system, this paper proposes a combination of improved ant colony algorithm and improved genetic algorithm for clustering routing strategy in wireless sensor networks. By improving (Gaussian distribution function, elite selection strategy, single point crossover, mutation operation, etc.) genetic algorithm to optimize cluster position and reduce communication energy consumption, and by improving (transmission probability and pheromone update, etc.) ant colony algorithm to find the transmission path of each cluster head node. Comparative analysis is conducted on the number of surviving nodes, remaining energy, and received data in the network through simulation. The results indicate that compared with the methods in some references, the proposed method can effectively balance the energy consumption in the network. In terms of the number of surviving nodes, remaining energy, and receiving data packets in the network, there has been a certain improvement. The number of surviving nodes in the network has increased by 75% and 20%, the remaining energy has increased by 23.06% and 2.12%, and the data receiving ability has increased by 39.17% and 14.24%, respectively, which has certain application value.