1 Introduction

Wireless sensor network (WSN), as a rapidly developing technology, has been widely applied in health monitoring, environmental monitoring, precision agriculture, and so on [1, 2]. With the improvement of people’s living standards and living quality, the demand of economic crops becomes larger and larger [3]. Apple, as one of the most important economic crops in China, the precise management of apple orchard has an important role in promoting the economic growth of China [4]. Given the characteristics of WSN, orchard environment monitoring based on WSN has attracted widespread attention.

Generally, the sensor nodes in a WSN are battery powered and difficult to replace after deployment, so the sensor nodes have very limited energy. If the sensor nodes in the network are unable to work due to energy exhaustion, the network topology will be changed [5] and the routing will be re-established [6]. Therefore, how to effectively utilize the limited battery energy of network without affecting the function becomes the key issue to be considered in network design [7,8,9,10,11,12,13,14]. At present, a lot of domestic and international researches have been done on WSN routing protocols [15,16,17,18,19,20,21,22,23,24,25,26,27,28], and found that a better route can prolong the network lifetime and improve the network stability. Hierarchical routing protocols can provide good scalability for numerous sensor nodes, and can realize the data aggregation through cluster head (CH) in each cluster [29]. For example, an E-LEACH protocol was proposed in which the remnant power of the sensor nodes and optimal cluster size are taken to balance network loads and change the round time [30]. The PEGASIS-E protocol was proposed in which the average distance among the sensor nodes is utilized as the criteria for chaining [31].

In apple orchard, the fruit trees are planted in rows that are spaced 3–4 m apart. Different from other monitoring regions, the sensor nodes are deployed based on the locations of fruit trees. Considering the distribution characteristics of deployed sensor nodes, it is essential to investigate the routing protocol in orchard environment. It is noted that very little research has focused on investigating routing protocol in orchard environment. In this paper, based on LEACH algorithm, an improved chain-based clustering hierarchical routing (ICCHR) is proposed, which adapts to the monitoring environment of orchard line planting. In this protocol, the CH nodes do not directly transmit signals to BS, but transmit them to the outside one by one by using the chain method, which overcomes the problem that the internal nodes die too fast. At the same time, a new CH competition parameter is adopted in the selection of CH to reduce the energy consumption of the network and improve the stability. The findings in this research can provide references for WSN networking in complex orchard environment.

The paper can be organized as follows: Sect. 2 presents the detailed study of routing based clustering protocol. Section 3 presents advantages and inefficiency of the typical hierarchical routing algorithms. The proposed ICCHR algorithm is described in Sect. 4. The performance analysis and results discussion are drawn in Sect. 5. Section 6 concludes the paper.

2 Related Works

Recently, there have been many researches focused on investigating the energy-efficient routing protocols. For example, in [32], a new protocol called ECHERP which can pursue energy conservation through balanced clustering has been proposed. It is found that the proposed protocol is efficient in energy consumption. In [33], the EDAL protocol which can reduce computational overhead has been proposed. It is found the proposed protocol can achieve considerable reduction in total traffic cost for collecting sensor readings under loose delay bounds. In [34], the M-ATTEMPT protocol has been proposed. It is found that the proposed protocol has less energy consumption and more reliable as compared to Multi-hop communication. In [35], the routing protocol was developed with an efficient particle encoding scheme and multi-objective fitness function. It is found that the proposed protocol can perform better in terms of network lifetime, energy consumption and delivery of data packets to the base station. In [36], a new energy-efficient routing protocol using message success rate has been proposed. It is found that the protocol can outperform the existing schemes in terms of communication reliability and energy efficiency. In [37], the DVRP protocol in which the forwarding of data packets is based on the flooding zone angle by the sender nodes toward the surface sink has been proposed. It is found that the proposed protocol can perform better in terms of end-to-end delays, energy consumption and data delivery ratios. In [38], the DFCR protocol which adopting a distributed run time recovery of the sensor nodes due to sudden failure of the CHs has been proposed. It is found that the proposed protocol is energy efficient and fault tolerant. In [39], a cluster-based routing protocol for wireless sensor networks with nonuniform node distribution has been proposed. It is found that the proposed protocol can balance the energy consumption among nodes and increase the network lifetime significantly. In [40], the BEENISH protocol which assuming WSN containing four energy levels of nodes has been proposed. It is found that the proposed protocol can achieve longer stability, lifetime and more effective messages. In [41], the EDDEEC protocol which electing CH based on changing dynamically probability has been proposed. It is found that the proposed protocol can present longer lifetime, stability period and more effective messages to BS than DEEC. In [42], the ESRPSDC routing protocol which adopting error recovery to avoid end-to-end error recovery has been proposed. It is found that the proposed protocol can significantly improve the energy efficiency and packet reception rate. In [43], an EELBC algorithm that addressing energy efficiency as well as load balancing has been proposed. It is found that the proposed algorithm can perform better in terms of load balancing, energy efficiency, and execution time. In [44], the EHGUC-OAPR algorithm which combining the energy harvesting genetic-based unequal clustering algorithm and optimal adaptive performance routing algorithm has been proposed. It is found that the proposed algorithm has a great improvement in network energy balance and data delivery ratio.

3 The Typical Hierarchical Routing Algorithms and Existing Problems

Researches on hierarchical routing algorithms of WSN has made some progress, among which LEACH and PEGASIS algorithms are the most typical.

3.1 E-LEACH Protocol Algorithm

The E-LEACH algorithm adopts the same round concept with the original LEACH [30], and each round can be divided into clustering phase and stable transmission phase. In the clustering stage, each node that has not served as the CH produces a random number between 0 and 1. If the generated random number is less than the given threshold value T(n), the node is elected as the CH. The threshold T(n) can be calculated as follows:

$$T(n) = \left\{ {\begin{array}{*{20}l} {\frac{P}{{1 - P \times \left[ {r\,\bmod \,(1/P)} \right]}} \times \frac{{E_{residual} }}{{E_{0} }}} \hfill & {\quad n \in G} \hfill \\ 0 \hfill & {\quad n \notin G} \hfill \\ \end{array} } \right.,$$
(1)

where P is the expected percentage to become the CH, r is the current number of rounds, \(E_{residual}\) is the residual energy of nodes at the r round, \(E_{0}\) is the initial energy of nodes, and G is the node set that has not become the CH in the last 1/P round.

In the stable transmission phase, the member nodes transmit data to the CH according to TDMA time slot allocated. The CH integrates the received data and transfers it to the sink node.

3.2 PEGASIS-E Protocol Algorithm

PEGASIS-E is a improved chain based routing algorithm which operates in round [31], and each round can be divided into chain construction phase, leader selection phase, and data transmission phase. In the chain construction phase, the node farthest from BS join the chain first till all the nodes join the chain. In the leader selection phase, the leader in each round of communication is at the random location on the chain which ensuring robustness of network towards failures [31]. In the data transmission phase, each node delivers its own sensed data to its neighbor, and the neighbor nodes further fuse the received data with their own data and forwards further towards the leader [31].

4 The ICCHR Algorithm

4.1 Network Model and Assumptions

In this paper, there are N sensor nodes randomly arranged in a M × M square area. Moreover, some assumptions are made as follows: the sensor nodes and BS are at the static; the energy of sink node is unlimited and that of common nodes are energy-constrained; all sensor nodes location is known; Links are symmetric.

4.2 Energy Consumption Model

Herein, we adopt the First-order Radio Model [30] which has been employed in many researches [29, 31] as the energy model. For k-bit messages transmission, the energy consumed can be calculated as follows:

$$E_{Tx} \left( {k,d} \right) = \left\{ {\begin{array}{*{20}l} {kE_{elec} + kE_{fs} d^{2} } \hfill & {\quad d < d_{0} } \hfill \\ {kE_{elec} + kE_{amp} d^{4} } \hfill & {\quad d \ge d_{0} } \hfill \\ \end{array} } \right.,$$
(2)

where k is the number of messages, d is the distance from transmitter, and Eelec is the amount of energy consumed in electronics. Moreover, Eamp and Efs are the energy consumed in amplifiers. The energy expended in receiving k-bit messages can be calculated as follows:

$$E_{Rx} \left( k \right) = kE_{elec} .$$
(3)

The energy consumed for fusion of l length of k bits data packet can be calculated as follows:

$$E_{Rx} = klE_{DF} ,$$
(4)

where EDF is the energy required to fuse the data per bit.

4.3 The Description of ICCHR Algorithm

The implementation process of ICCHR algorithm is periodic, and each round can be divided into two stages, i.e., the formation of cluster and stable data communication. The network architecture is presented in Fig. 1.

Fig. 1
figure 1

The architecture of ICCHR algorithm

4.3.1 CH Election

In order to resolve the deficiency of LEACH algorithm, the ICCHR algorithm adopts a threshold setting method which is applicable for orchard long direct deployment environment:

$$T(n) = \left\{ {\begin{array}{*{20}l} {\frac{P}{{1 - P \times \left[ {r\,\bmod \,(1/P)} \right]}} \times \left( {\frac{{E_{initial} }}{{E(i)_{r} }}} \right) \times \left( {1 - \frac{{D_{2} (i)}}{D(i)}} \right) \times \frac{{D_{1} (i)}}{D(i)}} \hfill & {n \in G} \hfill \\ 0 \hfill & {n \notin G} \hfill \\ \end{array} } \right.,$$
(5)

where E(i)r is the residual energy of sensor node, Einitial is the initial energy of sensor node, D1(i) is the sum of the distances between sensor node i and other sensor nodes, and D2(i) is the distance between sensor node i and sink node. Moreover, D(i) can be calculated as follows:

$$D(i) = \omega \times D_{1} \left( i \right) + (1 - \omega ) \times D_{2} (i),$$
(6)

where \(\omega \in \left[ {0,1} \right]\). If the generated random number of sensor node i is smaller than the calculated threshold, the sensor node i is elected as CH.

4.3.2 The Formation of Cluster

To balance the energy consumption of CH, we adopt the non-uniform clustering algorithm.

$$\overline{D} = \frac{{d\left( {N_{k} ,C_{i} } \right)}}{{d_{\text{max} } (N,C_{i} )}} + \left( {1 - \frac{{d(C_{i} ,BS)}}{{d_{\text{max} } (C,BS)}}} \right),$$
(7)

where \(d\left( {N_{k} ,C_{i} } \right)\) represents the distance from cluster members to CH, \(d_{\text{max} } (N,C_{i} )\) indicates the maximum distance from cluster members to CH, \(d(C_{i} ,BS)\) represents the distance from CH to BS, and \(d_{\text{max} } (C,BS)\) indicates the maximum distance from CH to BS. After receiving the broadcast sent by the CH, the node selects the CH owning the smallest \(\overline{D}\) to join. When the node selects the cluster it belongs to, the CH receives the ID of the cluster members as well as the distance between the cluster members and CH, and then CH assigns TDMA to the cluster members. The cluster members continuously collect monitoring data, and then send the data to the CH for aggregation.

4.3.3 Chain Clustering Routing Mechanism

The elected CHs employ greedy algorithm to be a chain, and the CH farthest from the sink node can be labeled as the current access node. Then, the CH farthest from the sink node which has not been labeled can be set as the neighbor node, and further be labeled as the current access node. And so on, until all CHs are labeled, indicating that all CHs are on the chain. Considering that the forwarding tasks undertaken by the chain leader are the most numerous and the energy consumption is the fastest, the CH closest to the BS is selected as the chain header to directly communicate with the BS. Figures 2 and 3 are the pseudocode description and the flow chart of the ICCHR algorithm. As can be seen, first of all, all sensor nodes send their location and energy information to the BS. Then, the nodes with the shortest distance from other nodes, the farthest distance from the BS and the maximum residual energy in the cluster are elected as CHs. Next, the BS notifies the CH information to the cluster members, and the cluster members then send the confirmation information to the BS. All the elected CHs form a chain, and the CHs with the shortest distance from the BS are elected as the chain leader which can directly communicate with the BS.

Fig. 2
figure 2

The pseudocode description of ICCHR algorithm

Fig. 3
figure 3

The flow chart of ICCHR algorithm

4.4 Stable Transmission Phase

4.4.1 Communications Within the Clusters

The cluster members only send messages to the CH, and there is no forwarding process of the cluster members, which reducing the energy consumption of controlling information transmission. The CH receives the information sent by the cluster members, and the fusion of information will be shown.

4.4.2 Inter-cluster Communication

All information between clusters shall be aggregated along the chain to the chain leader after fusion, and then forwarded to the BS. For the stable communication stage, in the last round, all cluster members send their residual energy to the CH which is sent to the BS through the chain, and then the process of re-electing the CH in the next round will begin. The data transmission process as presented in Fig. 4 can be described as follows: cluster members send data to the corresponding CH, and the CH transfers data along the optimal path depicted in Fig. 1 and converges to the chain leader which can directly communicate with the BS.

Fig. 4
figure 4

The data transmission process of ICCHR algorithm

5 Simulation and Results

5.1 Simulation Setup

The simulations are performed in an area of 100 m × 100 m with 100 sensor nodes randomly distributed. The location of BS is set to (0, 0), (50, 50), and (50, 175), respectively. The initial energy of each sensor node is equal to 0.5 J, and each node can transmit 2000 bits messages. For each node sends or receives data, the energy required by the transmitting circuit is Eelec = 50 nJ/bit, the energy consumed by the power amplifier is Efs = 100 pJ/(bit m2), the energy consumed by the CH data fusion is EDA = 5 npJ/bit, the amplification factor of the signal amplifier is Eamp = 0.0013 pJ/bit/m4, the signal transmission distance d0 = 87 m, and the sampling period is 10 s. The detailed simulation parameters are listed in Table 1.

Table 1 The simulation parameters

5.2 Performance Analysis

To evaluate the performance of the proposed ICCHR algorithm, the simulations are performed by MATLAB and compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS [45], and P-LEACH [46] algorithms. The performance metrics include network lifetime, throughput, even distribution of energy usage, and time complexity.

5.2.1 Network Lifetime

Figure 5 shows the network lifetime diagram for E-LEACH algorithm, PEGASIS-E algorithm, LEACH-1R PEGASIS algorithm, P-LEACH algorithm, and the proposed ICCHR algorithm. As can be seen, the first node death occur in the 1497 round, and all the nodes death is at about 2997 round in E-LEACH algorithm. The first node death in PEGASIS-E algorithm is at 247 round, and all the nodes death is at about 2627 round. For the LEACH-1R PEGASIS algorithm, the first node death is at about 47 round, and all the nodes death occur at 1998 round. For the P-LEACH algorithm, the first node death is at about 38 round, and all the nodes death occur at 1763 round. While for the proposed ICCHR algorithm, the first node death appears in 1600 round, and all the nodes death is at about 3099 round. Obviously, the proposed ICCHR algorithm can greatly delay the round of node death. Moreover, the changing curve of the proposed ICCHR algorithm is relatively smooth, indicating that ICCHR algorithm is more stable than E-LEACH, PEGASIS-E, LEACH-1R PEGASIS, and P-LEACH algorithms.

Fig. 5
figure 5

The number of dead nodes varying with rounds for BS at (50, 175)

To describe the effect of the BS location on network lifetime, the comparisons of five algorithms using first node death (FND), half of nodes death (HND), and last node death (LND) three metrics with BS locations at (0, 0), (50, 50), and (50, 175) are illustrated in Fig. 6. As can be seen, for BS at (0, 0), from the point of view of FND, the proposed ICCHR algorithm extends the network lifetime approximately by 6.30, 84.49, 97.00, and 97.46% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS, and P-LEACH algorithms, respectively. From perspective of HND, the proposed ICCHR algorithm extends the network lifetime approximately by 4.05, 11.53, 39.70, and 47.69% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS, and P-LEACH algorithms, respectively. From perspective of AND, the proposed ICCHR algorithm extends the network lifetime approximately by 3.29, 8.78, 35.53, and 43.11% in comparison with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS, and P-LEACH algorithms, respectively. For BS at (50, 50), the proposed ICCHR algorithm extends the network lifetime approximately by 6.30, 84.52, 96.99 and 97.48% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms in terms of FND. For HND, the proposed ICCHR algorithm exhibits the longer network lifetime approximately by 4.13, 11.53, 39.70 and 47.71% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms. From the point of view of AND, the proposed ICCHR algorithm extends the network lifetime approximately by 3.31, 9.43, 35.54, and 43.11% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS, and P-LEACH algorithms, respectively. For BS at (50, 175), the proposed ICCHR algorithm extends the network lifetime in terms of FND approximately by 6.31, 84.50, 97.00, and 97.50% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms. From perspective of HND, the proposed ICCHR algorithm extends the network lifetime approximately by 4.08, 11.52, 39.69 and 47.67% in contrast with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms. From perspective of AND, the proposed ICCHR algorithm extends the network lifetime approximately by 3.29, 8.78, 35.53, and 43.11% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms. Therefore, the proposed ICCHR algorithm is significantly superior to the other four algorithms in terms of the number of communication rounds corresponding to either first node death or the last node death and the communication interval between them. The results show that the proposed ICCHR algorithm has higher energy utilization, more balanced load and longer life cycle.

Fig. 6
figure 6

The comparisons of five algorithms using FND, HND, and AND three metrics for BS locations at (0, 0), (50, 50), and (50, 175)

5.2.2 Even Distribution of Energy Usage

The comparisons of the residual energy varying with the rounds for BS at (50, 175) are presented in Fig. 7. As can be seen, the residual energy in the proposed ICCHR algorithm is higher than that in E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms at the same round. Especially at round 2997, the residual energy in E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms is close to zero, but that in the proposed ICCHR algorithm is approximately 0.6 J. In the initial stage of simulation, there is no obvious differences in energy consumption among five algorithms. As the number of rounds increases, the ICCHR algorithm exhibits significant advantages in extending the network lifetime, which is consistent with the analysis of alive nodes. This phenomenon can be attributed to the ICCHR algorithm employing chain transmission among clusters, further avoiding the shortages of communication between each CH and BS in E-LEACH algorithm and the long distance transmission in PEGASIS-E algorithm. The average energy consumed per round for BS at (0, 0), (50, 50) and (50, 175) is listed in Table 2. As can be seen, for BS at (0, 0), the proposed ICCHR algorithm consumes less energy compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms approximately by 3.49, 8.79, 35.66, and 43.15%, respectively. For BS at (50, 50), the proposed ICCHR algorithm consumes less energy compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms by 2.96, 9.39, 35.43 and 43.06%, respectively. While for BS at (50, 175), the proposed ICCHR algorithm consumes less energy compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms approximately by 4.73, 9.04, 35.60, and 43.31%, respectively. Obviously, the proposed ICCHR algorithm consumes less energy per round compared with the other four algorithms, indicating that the ICCHR algorithm is more sustainable and energy saving.

Fig. 7
figure 7

The residual energy of sensor nodes varying with rounds for BS at (50, 175)

Table 2 The average energy consumed per round for BS at (0, 0), (50, 50) and (50, 175)

5.2.3 Throughput

Figure 8 depicts the number of data messages received by BS varying with rounds. Compared with the E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms, the data messages received by BS for the proposed ICCHR algorithm is greater. The reason can be ascribed to the extending network lifetime and more balancing energy consumption.

Fig. 8
figure 8

The number of packets sent to BS varying with rounds for BS at (50, 175)

5.2.4 Time Complexity

Time complexity analysis of five algorithms is illustrated in Table 3. As can be seen, O(L) explains the time complexity of solving a linear optimization problem. The simulation results illustrate that the proposed ICCHR algorithm has lower time complexity compared with PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms.

Table 3 The time complexity for E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms

6 Conclusion

The WSN architecture suitable for orchard information acquisition is constructed, and the hierarchical routing is adopted to achieve energy consumption load balancing and prolonging network lifetime. Based on the analysis of ICCHR algorithm, the clustering formation, the election of CH, chain formation and the data transmission process are described in detail, and the simulation results are given. According to the analysis of simulation results, for BS at (50, 175), from the prospective of AND, the proposed ICCHR algorithm extends the network lifetime approximately by 3.29, 8.78, 35.53, and 43.11% compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms, respectively. Moreover, the proposed ICCHR algorithm consumes less energy compared with E-LEACH, PEGASIS-E, LEACH-1R PEGASIS and P-LEACH algorithms approximately by 4.73, 9.04, 35.60 and 43.31%, making the energy consumption load more balancing.