1. Introduction
Guided by the development trend of the “sensor city”, wireless sensor networks (WSN) have been widely used in the field of information, from the field of military and national defense to the fields of medical care, industry and agriculture, urban management, environmental monitoring [
1], and smart homes [
2] that are closely related to people. The WSN is an ad hoc network composed of randomly distributed sensor nodes [
3]. The nodes perceive the environment to enable data collection, processing and transmission. However, the sensor nodes in WSN use limited energy (such as batteries), and in some complex working environments, it is difficult to supply power in time, which will lead to the unreliable lifetime and quality of the network. In addition, for scenarios with high real-time requirements, such as disaster monitoring, military supervision, medical inspection, etc., it is even more necessary to consider how to balance the energy consumption of nodes [
4]. Therefore, how to balance the energy consumption and extend the lifetime of network is the research focus in WSN.
The selection of cluster head (CH) nodes in routing protocols is a key to efficient communication in WSN. The CH nodes undertake the tasks of information collection, data fusion and data transmission in the cluster, and their energy consumption is faster than other nodes. By designing an effective clustering protocol, each sensor node can use the limited energy more reasonably. The clustering routing protocol is divided into four processes: cluster head election, cluster formation, data fusion, and data transmission. It divides the entire network into multiple clusters. In each cluster, select one node as the cluster head (CH) node and the other nodes as the cluster member (CM) nodes. The CM nodes communicate with the CH node in each cluster and forward the data to the CH node. The CH nodes integrate the data and send it to the sink node, and then the sink node transmits the data to the network for communication management between users [
5], as shown in
Figure 1. In addition, the performance of routing clustering protocols in homogeneous networks is not good in heterogeneous networks, so the research based on clustering routing protocols is one of the research hotspots in heterogeneous networks at present.
Using the metaheuristic algorithm to design the cluster routing protocol has always been a popular direction of industry research [
6]. The metaheuristic algorithm is a powerful tool to solve complex optimization problems [
7]. It can obtain the best approximate solution for more complex NP-hard problems in polynomial time [
8]. As the research on bionics becomes more and more mature, metaheuristic algorithms are proposed one after another; for example, the particle swarm optimization algorithm (PSO) [
9,
10], genetic algorithm (GA) [
11,
12], bat algorithm (BA) [
13], seagull optimization algorithm (SOA) [
14], and the grey wolf optimizer (GWO) [
15], etc. The formulas for individual movements of many metaheuristic algorithms are based on operations such as addition, subtraction, multiplication, and division. The mathematical model of the algorithm is not closely related to the essence of things, and there is no specific scientific theory support. In order to come up with a metaheuristic algorithm with good performance and a close connection between the mathematical model and the essence of things, we searched for formula derivation about the growth principle of bamboo forest in biology. Based on the differential model of the bamboo growth and the Gaussian mixture models [
16], this study proposes a new metaheuristic optimization algorithm named the bamboo forest growth optimizer (BFGO) and demonstrates the effectiveness of the algorithm’s optimization ability is proved on the CEC test sets and engineering optimization problems.
In addition, for the problem of energy consumption in WSN, based on the BFGO algorithm, this paper proposes an energy-efficient clustering mechanism of protocol (BFGO-C) for two-level heterogeneous WSN is proposed. The following are the characteristics of this study:
A small number of heterogeneous nodes in WSN can usually be used to improve network life and stability, and different types of nodes have different initial energy and consumption rates. In the two-level heterogeneous WSN studied, only energy heterogeneity is considered, and the sensor nodes are divided into advanced nodes and normal nodes;
The encoding method of the BFGO algorithm is redesigned in this paper. Each individual in the algorithm represents a set of cluster heads;
The fitness function is improved for BFGO-C, which first considers the relationship between remaining energy and node energy, and also considers the separation of inter-cluster and the compactness of intra-cluster. The purpose of both is to reduce energy consumption and shorten the transmission distance of node communication;
In experimental, using the four indicators of the lifetime of network, the lifetime of network until the first node dies, remaining energy, and data transmission volume to analysis, and it uses the entropy weight method [
17] to conduct a comprehensive analysis.
The remaining structure of the paper is as follows.
Section 2 reviews related work.
Section 3 presents the BFGO algorithm.
Section 4 analyzes the proposed network clustering mechanism of routing protocol (BFGO-C).
Section 5 tests the performance of the BFGO algorithm.
Section 6 simulates and analyzes the protocol in heterogeneous WSN. In
Section 7, the conclusions are given.
5. Performance Test of BFGO Algorithm
The CEC test suite is a set of functions commonly used for testing and evaluating the performance of the metaheuristic algorithm, including unimodal functions, simple multimodal functions, hybrid functions, and composite functions. The tests of multi-type functions can show the performance of the algorithm more comprehensively. To test the optimization performance of the BFGO algorithm, tests and analysis are conducted in the CEC2013 benchmark function set [
45], CEC2017 benchmark function set [
46], and three engineering optimization problems [
47].
Table 2 summarizes the relevant parameters, ’own’ represents the parameters set by the algorithm itself, and ’unified’ is the public parameter in the experiment.
5.1. Test of CEC2013 Benchmark Function
The experimental results of this part are shown in the
Appendix A,
Figure 8 shows the number of functions the BFGO algorithm outperforms in other algorithms in 10-dimensional (10D) and 50-dimensional (50D) spaces.
From
Table A1, among the 28 functions of the CEC2013 test set, the BFGO algorithm is superior to the BA algorithm, PSO algorithm, GWO algorithm, and SOA algorithm in 23, 18, 16, and 26 functions. It can be seen from
Table A2 that the BFGO algorithm is superior to the BA algorithm, PSO algorithm, GWO algorithm, and SOA algorithm in 20, 21, 13, and 25 functions, respectively. It can be seen that the BFGO algorithm has advantages over other algorithms in both low and high dimensions, especially in low dimensional space, showing strong competitiveness.
The scalability of the algorithm in CEC2013 can be analyzed in
Figure 8. The performance of the BFGO algorithm decreases with the increase of dimension. However, it is still better than the other algorithms in most functions.
5.2. Test of CEC2017 Benchmark Function
The experimental results of this part are shown in the
Appendix A,
Figure 9 shows the number of functions the BFGO algorithm outperforms in other algorithms in 10D and 50D space.
It can be seen from
Table A3 that for the 30 functions of CEC2017, the overall performance of BFGO is better than other algorithms on 10D. The BFGO algorithm is superior to the BA algorithm, PSO algorithm, GWO algorithm, and SOA algorithm in 24, 20, 16, and 24 functions. It can be seen from
Table A4 that the BFGO algorithm also has good performance on 50-D. The BFGO algorithm is superior to the BA algorithm, PSO algorithm, GWO algorithm, and SOA algorithm in 21, 26, 14, and 27 functions.
The scalability of the algorithm in CEC2017 can be analyzed in
Figure 9. The performance of the BFGO algorithm decreases slightly with the increase of dimension. However, it is still better than the other algorithms in most functions.
According to the test results of five algorithms in the CEC2013 and CEC2017, the BFGO algorithm is significantly better than the BA, PSO, and SOA algorithms in both low-dimensional and high-dimensional space, and its performance is similar to the GWO algorithm, only slightly lower than the GWO algorithm in high-dimensional space. To sum up, the BFGO algorithm has good optimization performance and strong competitiveness.
5.3. Test of Engineering Optimization
Three classical engineering optimization problems are used to test the performance of the BFGO algorithm in finding appropriate parameters to optimize the solution of practical problems, including compression spring design, welded beam design, and speed reducer design [
48,
49]. The three issues are optimized with parameters 3, 4, and 7 to minimize cost dissipation.
Table 3,
Table 4 and
Table 5 compare the results of the BFGO algorithm with the BA, GWO, PSO, and SOA algorithms tested on the three engineering design problems 30 times, respectively. The table shows the optimal parameters, the mean (Mean), the standard deviation (Std), and the minimum (Min) values for the 30 tests. Where underline represents the same optimum and bold represents the optimum.
In the test of compression spring design, the BGFO algorithm obtains the same optimal value as the GWO and SOA algorithms in the mean and minimum values. The standard deviation is slight, indicating that the algorithm is stable. In the test of welded beam design, the mean value of 30 tests obtained by the BFGO algorithm ranks second, second only to the GWO algorithm, and other algorithms are still far behind the BFGO algorithm. Similarly, in the speed reducer design problem, the mean value of the BFGO algorithm in the 30 tests is the first, the minimum value is tied for the first best with the GWO algorithm, and the standard deviation is still tiny, indicating that the algorithm is relatively stable.
Therefore, compared with other algorithms, the BFGO algorithm also has powerful optimization ability for engineering optimization problems.
6. Simulation and Analysis of Protocol Based on BFGO-C in HWSN
This study simulates the protocol based on the BFGO-C and compares the results with the SEP, HCR, and ERP clustering protocols.
Table 6 describes the parameters in the simulation experiments. In this paper, four indicators are used as measures to analyze the experimental results: the life of the network, the life of the network until the first node dies, energy consumption, and the data transmission volume.
Figure 10 shows the assignment of initial CH nodes in the 100 × 100 area, where the red dot in the middle is the sink node, the blue dot is the normal node, the purple dot is the advanced node, and the green pentagram is the initial CH node [
50].
Figure 11 is the initial node interaction diagram. The black arrows indicate that the CH nodes transmit data to the sink node, and the orange arrows indicate that the nodes in the cluster transmit data to the CH nodes [
51].
6.1. Comparison of the Lifetime of Network
The number of rounds in which the last node dies represents the life of the network.
Figure 12 shows the changes in the surviving nodes of the SEP protocol, the HCR protocol, the ERP protocol, and the protocol based on BFGO-C with the number of rounds.
The survival trend of the four clustering protocols SEP, HCR, ERP, and the protocol based on BFGO-C in
Figure 12. As the network runs, the consume energy of nodes for data transmission and forwarding. After several operation rounds, some nodes run out of energy and become dead nodes. The graph shows that the nodes of the protocol based on BFGO-C die a little slower, and the network lives a little longer than all three other protocols.
There are also application scenarios that pay more attention to the comprehensiveness of the node information. Once the first node in the network dies, the data are missing by default. Hence the paper records the number of rounds when the first node dies, half of the nodes die, and the last node dies, as shown in
Figure 13.
In
Figure 13, the growth cycles of the four cluster protocols SEP, HCR, ERP, and the protocol based on BFGO-C are 2602, 1771, 1763, and 3909 rounds, respectively. The protocol based on BFGO-C has the longest lifetime of the network. In SEP protocol, the network ran 999 rounds when the first node died and 1385 rounds when half of the nodes died. The first node of the HCR and ERP protocol died in rounds 919 and 1078, and half of the nodes died in rounds 1771 and 1763. The number of rounds when the first node of the protocol based on BFGO-C died was 1134, and the number of rounds when the intermediate node died was 1570.
It can be shown that the protocol based on BFGO-C has a higher number of rounds at the death of the first node and a higher number of rounds at the end of half of the nodes than the other three protocols.
6.2. Comparison of Remaining Energy
The energy consumption during network operation reflects the performance of the network. More remaining energy indicates less energy consumption and better network performance. The variation of remaining energy with the number of rounds for the protocols SEP, HCR, ERP, and the protocol based on BFGO-C running in the network is shown in
Figure 14, and the remaining energy for the rounds when the first node dies and half of the nodes die is shown in
Figure 15.
The trend in energy consumption from
Figure 14 shows that the protocol based on BFGO-C has more remaining energy than SEP, HCR, and ERP protocols. At the death of the first node in the network, the HCR protocol has the most residual energy and consumes the least, and the protocol based on BFGO-C is second. At the death of half of the nodes, the protocol based on BFGO-C and HCR protocol have similar residual energy, and both consume less energy than the SEP and ERP protocols. At the death of all nodes, the protocol based on BFGO-C consumes the least total energy than SEP, HCR, and ERP protocols. Protocol based on BFGO-C reduces network energy consumption to a certain extent.
6.3. Comparison of the Data Transmission Volume
The surviving nodes in the network transmit a data packet to the CH nodes every round, and then the CH nodes transmit it to the base station, and the base station counts the number of data packets collected. The data transmission volume represents the total number of packets sent, it reflects the throughput of the network. The data transmission volume of the four protocols is shown in
Figure 16, and
Figure 17 also shows the data transmission volume when the first node dies, half of the nodes die and the last node dies.
The trend of the data transmission volume shows that the protocol based on BFGO-C has the fastest and highest transmission volume. With all the nodes dead, the number of packets stopped growing, and the SEP protocol, HCR protocol, ERP protocol, and protocol based on BFGO-C had 14,725, 35,699, 628,07, and 122,068 data transmissions, respectively, with a protocol based on BFGO-C eventually transmitting the most data. The protocol based on BFGO-C was consistently ahead of the other protocols regarding the number of packets transmitted in the early and middle stages of the network.
The protocol based on BFGO-C has achieved good performance in HWSN network clustering. Compared with the SEP, HCR and ERC protocols, it extends network life to a certain extent, reduces network energy consumption, and effectively improves network performance.
6.4. Comprehensive Evaluation Based on Entropy Weight Method
Information entropy can measure the discreteness of indicators, and the larger the discreteness, the more significant the impact of the index on a comprehensive evaluation. The entropy weight method determines the index’s weight in the comprehensive evaluation according to the variability of the information entropy reaction of the index.
From the simulation results and analysis of the protocol based on BFGO-C in
Section 5, the entropy weight method is used to comprehensively evaluate the four protocols in combination with four metrics: the lifetime of the network, the death time of the first node, remaining energy, and the volume of transmission. The radar chart of the comprehensive analysis is shown in
Figure 18.
As can be seen from
Figure 18, the comprehensive performance of the protocol based on BFGO-C covers the most extensive range, and it has outstanding performance in the two indicators of network life and volume of transmission, although it is slightly worse in the indicator of the remaining energy of the first node death. Compared with the HCR protocol, the energy of the protocol based on BFGO-C lasts longer in the network. It can be seen from the comprehensive evaluation that the protocol based on BFGO-C can effectively extend the network lifetime by saving energy.
7. Conclusions
This paper proposes an energy-efficient clustering mechanism of routing protocol for heterogeneous WSN based on the BFGO algorithm. Its core concept is to use the optimization ability of the BFGO algorithm to conduct cluster head selection, find the optimal set of CH nodes, guarantee the rationality of the cluster allocation, and maximize the network performance. First, based on the growth characteristics of a bamboo forest, a bionic intelligent optimization algorithm is proposed for the optimization problem. The algorithm has been shown to be highly competitive in both low-dimensional and high-dimensional spaces for CEC2013 and CEC2017 test functions and engineering optimization problems. The fitness function is redesigned when the BFGO algorithm is applied to the clustering mechanism of the routing protocol in heterogeneous WSN. Not only are the intra-cluster compactness and inter-cluster separation of the clusters considered, but the ratio of the initial to remaining energy is also taken as an important measure.
This study compared the protocol based on BFGO-C with the SEP, HCR, and ERP protocols using four indicators in simulation experiments. The experimental results show that the algorithm can reduce the network energy consumption, extend the network life, and significantly improve the data transmission volume. Finally, to evaluate the clustering performance of these protocols comprehensively, the study used the entropy weight method to give weights and comprehensive analysis, and the results prove that the comprehensive performance of the protocol based on BFGO-C is greater than the other protocols.
This paper does not consider other types of node performance heterogeneity, such as computational or link heterogeneity. In the future, we will continue to investigate how to improve and optimize the cluster routing protocols in heterogeneous and complex environments.