# A Method for Energy Balance and Data Transmission Optimal Routing in Wireless Sensor Networks
## 2 Analysis of Clustering Protocol in Wireless Sensor Networks  
In the wireless sensor network application shown in Figure 1, the acquisition node can send data to the base station directly or in multi-hop mode. The energy consumption of nodes is related to the number and distance of data transmission. Nodes that are far away from the base station or have more forwarding tasks consume more energy than other nodes, which causes energy imbalance and makes some nodes exhaust energy ahead of time. A research hotspot in WSNs is to solve the problem of energy imbalance [10; 11; 12].  
The common solution is to apply clustering routing protocol [13]. The basic idea of clustering protocol is to divide all acquisition nodes into several clusters. The cluster head is responsible for collecting the data in the cluster and sending it to the base station [14]. Because the cluster head takes on a lot of data transmission work, it consumes more energy than other nodes. The cluster head is re-elected periodically in the cluster, so that the work of sending data is distributed equally. Low-Energy Adaptive Clustering Hierarchy (LEACH) protocol is a typical clustering protocol in wireless sensor networks [15].  
Figure 1: Application of wireless sensor networks.  
Itlects cluster heads randomly and sends data to base stations in a single hop. The probability of each acquisition node being elected as cluster head is equal, and the energy consumption of each node in the cluster is the same. However, due to the different distances from each cluster to the central node, there are differences in energy consumption among different clusters, and the farther clusters deplete energy earlier. Many protocols have made some improvements to LEACH [16; 17; 18; 19], mostly focusing on clustering, cluster head election, routing and other issues, such as Hybrid Energy-Efficient Distributed Clustering, (HEED) protocol [20]. Some studies use renewable energy to replenish energy in wireless sensor networks [21; 22]. However, renewable energy sources are unstable and unevenly distributed and cannot be used as a reliable power source. Other studies have optimized data collection, data compression, and data transmission to reduce losses [23; 24; 25; 26; 27].  
Clustering protocol improves the energy imbalance in wireless sensor networks. However, from the perspective of the overall energy consumption of the system, the energy balance between nodes is achieved at the cost of wasting some node energy. The application of clustering protocol in a wireless sensor network is shown in Figure 2. The nodes are divided into two clusters, the cluster heads are CH 1 and CH2. For Node A, under clustering protocols such as EEUC (the Energy-Efficient Uneven Clustering), its data is sent along the path of A-CH1-CH2-BS, and arrives at the base station after two hops. Obviously, considering the overall energy consumption of the system, the A-C-BS path of data transmission consumes the least overall energy. Similarly, in the clustering protocol, Node B belongs to CH2 cluster, and its data transmission path is B-CH2-BS. However, if Node B sends data directly to BS, it will save overall energy. It can be seen that clustering protocol inevitably increases the number of hops and the total transfer distance from the acquisition node to the base station, which results in the waste of the overall energy of the system.  
Therefore, in wireless sensor networks, the goal of minimizing the overall energy consumption and balancing the energy of all nodes cannot be achieved at the same time, so the system lifetime cannot be maximized. In this paper, a power line connection scheme for acquisition nodes is proposed, which enables the energy between acquisition nodes to be transferred to each other, so that the energy can be balanced. The node chooses a path that minimizes the overall energy consumption to transmit data, thus saving the most data transmission energy.