1 Introduction

The wireless sensor network is the product of combining computing, communication, and sensors as an information acquisition and processing technology. It plays an important role in many aspects of daily life. Wireless sensor networks can be used to transmit information and have low device costs (Benzi et al. 2019). Considering that many people still faced hunger globally, for ensuring food storage, Muthukumar (Muthukumar et al. 2018) deployed sensors in warehouses to monitor the environment. In industrial manufacturing (Vitturi et al. 2020), WSNs were used to monitor the entire production process. Similarly, WSNs were also applied in animal husbandry (Joshitha et al. 2021) to manage the feeding process, identify stray animals and monitor animal health. In addition, water quality sensors were deployed in water (Shahra et al. 2021) to monitor the location of water injection, contaminant concentrations and dose levels. The experiment showed that the health impact of water quality was reduced by 98.37% after the deployment of water quality sensors.

Obviously, WSNs have far-reaching importance in transmitting vital information. Considering that sensors used for monitoring tend to have limited energy, once the energy is exhausted, the network may break down and the production schedule may be delayed. While most energy consumption of sensors is caused by wireless communication, therefore, choosing an effective routing protocol can decrease the communication consumption significantly. For example, we can apply the WSN to the underground coal mine environment for the purpose of establishing a complete underground safety detection system. Due to the long-distance strip environment in underground coal mines, which easily causes the problem of “hot zone” and uneven energy consumption of sensors, thus, a reasonable routing protocol should be designed to help reduce the overall energy consumption of the WSN. In recent years, many new studies have been conducted to reduce the energy consumption of nodes in WSNs from the aspects of sensor node localization, data fusion, and routing protocol, which aims at maximizing the utilization of WSNs.

The LEACH protocol randomly selects cluster heads and without considering factors such as the remaining energy of nodes and their locations, which leads to accelerating the death of some clusters. Therefore, in the previous work, we proposed the LEACH-EA (Wang and Guoxiang 2020) protocol to improve the performance of WSNs. Fuzzy logic parameters were added to optimize the threshold of cluster node selection, and the competitive radius of cluster sensor nodes was introduced to improve the quality of cluster generation. By improving the ant colony algorithm, the routing of the network was optimized to generate the optimal transmission path. However, the random initialization of sensor node deployment leads to unstable network node coverage and uneven data transmission load. Furthermore, in this paper, we focus on the deployment of sensor nodes and propose an improved particle swarm optimization algorithm for the initial location of the deployed nodes, which can be applied to the LEACH-EA protocol to extend the network coverage. Compared with the whale optimization algorithm and the artificial fish swarm algorithm, the particle swarm algorithm converges faster and it is easier to find the global optimum without falling into the local optimum. This is consistent with our deployment goal of seeking maximum network coverage. In addition, we adaptively adjust the values of the particle swarm inertia weights, which ensures the diversity of the population search in the initial iteration and enhances the subsequent local search capability.

The main contributions of this paper are as follows:

  1. 1)

    An improved particle swarm optimization algorithm is used to improve the coverage and connectivity of the network. When the sensing radius is 6 m, the network is fully connected and the coverage rate is improved from the initial 68–93%.

  2. 2)

    We propose an improved particle swarm algorithm for deploying the initial positions of the network nodes. Adaptive inertia weights are used to enhance the global search capability of the particle swarm algorithm, and a suitable fitness function is selected to evaluate the spatially optimal solution.

  3. 3)

    The experimental environment is built using Python and simulation experiments are conducted. The node optimization scheme was obtained from IPSO. The network layout uses a global optimal deployment scheme based on the LEACH-EA protocol. The performance of the scheme is analyzed in terms of the network life cycle, node death rate, energy loss process, and packet forwarding volume. The experimental results show that the wireless sensor network survives 30% longer and the number of forwarded packets increases by 1.5 times.

The rest of this paper is organized as follows: Sect. 2 describes the related work in this field, Sect. 3 introduces the system model, Sect. 4 explains the improvement of the particle swarm algorithm, Sect. 5 introduces the proposed scheme PSOR, Sect. 6 analyzes the simulation results, Sect. 7 draws the relevant conclusion and Sect. 8 analyzes the future development.

2 Related work

Many types of research have been conducted to enhance the utilization of wireless sensor networks in order to improve the performance of sensor networks. The design and optimization of the routing scheme have a significant impact on improving the performance of the WSNs. It aims at planning an optimal path from the source node to the sink node, along which packets can be transmitted accurately, efficiently and quickly to the sink node. Srinidhi (Srinidhi et al. 2020) proposed a cluster-based self-optimizing multi-objective routing scheme that used an optimal adaptive strategy to select cluster nodes. The authors of (Pingale et al. 2021) combined the sunflower optimization algorithm (SFO) with the gray wolf optimization algorithm (GWO). The optimal path was selected in terms of context awareness, network survival, residual energy, trust, and delay. To balance the network load, Adil (2021) introduced the DHSSRP protocol, which addressed the network congestion problem based on dynamic multi-hop. Costa Bento and Wille (2020) presented the FUNNET routing protocol by referring to the growth characteristics of fungi. In this WSN, the data flow was described based on the biological transmission mechanism of the fungus, indicating the location in the network with the highest transmission capacity and enhanced packet forwarding. John and Sakthivel (2021) implemented a multicast routing protocol with multiple objective factors, including distance, delay, energy, link quality factor, and trust. To improve the network coverage, Qi et al. (2021) proposed two node deployment algorithms. One was an improved virtual force (VF) algorithm, and the other was a resampling particle swarm optimization algorithm (RPSO-DV) embedded with virtual force. The simulation results showed that the above algorithm could make the network reach a steady state quickly and achieve high coverage. With the aim of reducing the energy consumption of mobile nodes, Yarinezhad and Azizi (2021) suggested two mechanisms for managing the network. One was improving the geographic routing algorithm and the other was proposing a tree-based structure. This mechanism allowed to construct the network with minimal control packets and update the node deployment. The work of Sadrishojaei and Navimipour (2021) described a clustered localization prediction algorithm based on multiple mobile nodes. The method could predict the next location of mobile nodes and reduce the distance between cluster head nodes and base stations. Experiments showed that the network energy consumption was reduced by 28.12% and the throughput was increased by 26.74%. With the aim of extending wireless sensor networks, Poluru and Lokeshkumar (2021) proposed an algorithm called M-PASAD. It not only provided more possibilities for industrial environments but also resisted malicious attacks from the sensor level. In (Kathiriya et al. 2020), nodes could automatically obtain energy from the environment for sustainable utilization of wireless sensor networks. Han (Guangjie et al. 2020) used multiple aggregated nodes to protect the SLP technique during the transmission of node data. Simultaneously, more non-hotspot nodes were allowed to participate, which not only protected the data security but also reduced the energy consumption of hotspot nodes. The author of (Nandan et al. 2021) compared the performance of the OptiGACHS protocol in three different cases, that was, single, multiple static, and multiple removable receivers. Based on the above deployments, the authors determined that deploying the network with multiple movable receivers shortened the distance between receivers and nodes.

Different from some traditional node sleep scheduling mechanisms, Dowlatshahi et al. (2021) divided the sensor nodes in the entire network region into k distinct subsets. Each subset could individually cover the entire network region. Experiments indicated that the algorithm was superior to other heuristic algorithms in terms of running time. A two-hop IoT communication network was presented in (Phan et al. 2021), where each node utilized a separate transmission buffer to store data. With a Voronoi structure for multi-hop communication, data could be transmitted to the gateway either directly or indirectly. For node-mobile networks, Jain (Jain et al. 2021) presented a delay-aware green routing protocol based on virtual infrastructure. That would be, multiple rings were employed in the network, and when a node moved, only the nodes belonging to that ring needed to be updated. EBBT (Wang et al. 2021) analyzed the influence of the number and length of each branch on the lifecycle of the network during the formation of tree-like multi-branch paths. The experimental results indicated that the algorithm not only provided a long life cycle and diverse transmission paths but also had good confidentiality. The work of Sutagundar and Basaprabu (2020) proposed a multi-agent-based acoustic sensor node deployment (MASD) to deploy acoustic nodes at ideal locations for enhanced coverage and seamless connectivity. In the initialization phase, information and expected common reference points were collected by the AUV, followed by the calculation of path overhead by the base station to determine the location of new nodes, and the final node deployment was completed by the AUV. SCSAP (Almasri et al. 2022) determined the optimal number of nodes with the goal of maximizing network coverage and initialized the network in this way. The random node detection model proposed by Cho and Lee (2021) could quickly adapt to changes in node locations and build new network topologies. Compared with the LEACH algorithm, this algorithm improved the energy consumption and throughput of the surviving nodes. The related improvements are given in Table 1.

Table 1 Summary of related improvements

3 System model

3.1 Basic assumption

In the initialization phase, we adopt an improved particle swarm algorithm to deploy the nodes and ensure maximum network coverage. To verify the effectiveness of this deployment, we assume that the subsequent node locations are constant and the data transmission is conflict-free. Wireless sensor nodes are usually battery-powered and cannot participate in data transmission once their batteries are depleted. Therefore, after each round of data transmission, the aggregation node needs to calculate the energy consumption of each node and define whether the energy of the node is exhausted, which is related to the next round of data transmission. The following are some assumptions (Gao et al. 2019) used to simplify the experimental network.

  1. 1)

    After the deployment of nodes, the locations of all nodes no longer change.

  2. 2)

    All nodes have the same initial energy, and when the energy is exhausted, the node is considered dead, otherwise, the node survives.

  3. 3)

    The communication radius of each node is the same. When it is within the communication range of node i, the data transmission is non-conflict.

  4. 4)

    The calculation of the remaining energy of the node is implemented by the aggregation node and is completed after the data transmission.

3.2 Network node deployment

The nodes are initialized according to the deterministic deployment (Jiang et al. 2018) method. In this model, if a point (or event) P belongs to the network is within the sensing range R of sensor node S, then P is assumed to be covered by S. The sensing region of S is defined as a circular region with S as a center and radius as the sensing range R. The covering function f (S, P) is shown in Eq. (1):

$${\text{f}}\left( {S,P} \right) = \left\{ {\begin{array}{*{20}c} {1\;\;d\left( {S,P} \right) \le R} \\ {0 \;\;\; otherwise} \\ \end{array} } \right.,$$
(1)

where d (S, P) is the distance between node S and target point P. When the distance is less than R, P is considered to be covered by sensor S.

3.3 The energy model

The energy consumption model used in the experiments is the multipath fading energy consumption model under different channel modes (Wang and Guoxiang 2020; Yildiz et al. 2018). The energy consumption loss of data transmission is simulated as follows:

$$E_{send} = \left\{ {\begin{array}{*{20}c} {E_{t} k + \varepsilon_{fs} kd^{2} , d < d_{0} } \\ {E_{t} k + \varepsilon_{mp} kd^{2} ,d \ge d_{0} } \\ {d_{0} = \sqrt {\frac{{\varepsilon_{fs} }}{{\varepsilon_{mp} }}} } \\ \end{array} } \right.,$$
(2)

where Et denotes the energy consumed in single data transmission. k means the packet size, and d represents the distance of data transmission. εfs and εmp represent the energy loss of the power amplifier for the data transmission at different distances, respectively, and d0 is the distance threshold associated with εfs and εmp.

$$E_{rece} = E_{r} \cdot k \cdot cc \cdot \omega .$$
(3)

The energy consumed by the node in receiving data is shown in Eq. (3). Er is the energy consumption required to receive data. cc means the data fusion rate and ω means the number of packets received at that point in time.

4 Improved particle swarm algorithm

4.1 Particle swarm algorithm

The particle swarm algorithm (Guan et al. 2018) establishes the corresponding particle model by simulating the foraging process of birds. Each particle searches for the best position in the space independently by the fitness function, and the position of the particle corresponding to the maximum value of the fitness is noted as the current optimal solution. In the process of each round of cluster iteration, the individual optimal solutions of all particles are recorded and denoted as the global optimal solutions. By comparing their own optimal solutions with the global optimal solution, the particles share their searched optimal solutions and adjust the speed and direction of motion until all particles can no longer update their motion trajectories, then the final global optimal solution is obtained, which is the optimal position we are searching for. Particle swarm optimization algorithms are widely applied in wireless sensor networks, Gao (Gao et al. 2019) combined ant colony optimization and particle swarm optimization for planning the movement path of mobile agents, and PSO was also applied in selecting cluster heads (Kiran et al. 2021).

Suppose there are 100 nodes in a region of 100 m \(\times\) 100 m. Assume that the particle has no mass and only has two properties: velocity V and position X. The calculation formula of velocity V is shown in Eq. (4):

$$V_{i}^{k + 1} = \omega V_{i}^{k} + C_{1} \gamma \left( {P_{best}^{k} - X_{i}^{k} } \right) + C_{2} \eta \left( {G_{best}^{k} - X_{i}^{k} } \right).$$
(4)

The calculation formula of position X is shown in Eq. (5):

$$X_{i}^{k + 1} = X_{i}^{k} + rV_{i}^{k + 1} ,$$
(5)

Among them, ω is the inertia weight factor. C1 represents the individual learning degree of the particle to the previous optimal location, also known as the “cognitive factor”, indicating the cognition of the particle. C2 represents the learning degree of the particle to the optimal solution of the previous population, also known as the “social factor”, which represents the cognition of the whole particle swarm. γ and η are the random numbers evenly distributed within [0,1], and r is the velocity constraint factor, which is usually 1.

4.2 Inertial weight

The inertia weight (Bansal 2019) indicates the retention degree of particles to the speed generated by the last motion. To ensure the quality of the solution set, the inertia weight parameters are set as a dynamic adaptive value so that the inertia weights of the particles can be adjusted dynamically. Simultaneously, the velocity of the particle can be changed for each iteration. During the initial iteration, increasing the inertia weight can keep the particle at a higher velocity, increase the diversity of the search, and expand the search range of the particle. As a result, the global search capability is enhanced. During the subsequent iterations, the inertia weight gradually decreases and the particle moves at a slower speed and searches in the local space comprehensively. The following are the improved adaptive inertia weight parameters.

$$P_{1} = \left\{ {\begin{array}{*{20}c} {\omega + \frac{{f_{i} - f_{avg} }}{{f_{max} - f_{min} }} f > f_{avg} } \\ {\omega - \frac{{f_{avg} - f_{i} }}{{f_{max} - f_{min} }} f \le f_{avg} } \\ \end{array} } \right.,$$
(6)
$$P_{2} = \frac{t}{{t_{max} }},$$
(7)
$${\upomega } = e^{{ - p_{2} }} + P_{1} ,$$
(8)

where tmax is the number of iterations of the algorithm, and t is the current number of iterations. ω means the initial inertia weight. fi represents the fitness of the ith particle in the current iteration process, and favg represents the average fitness of the particle swarm in the current iteration process. fmax and fmin are the maximum and the minimum individual fitness of the current iterative particle, respectively.

4.3 Fitness

In the IPSO algorithm, the fitness function is used to evaluate possible solutions, and the value of fitness reflects the accuracy of the evaluation results. A larger particle fitness value indicates that the closer the particle is to the ideal optimal solution. Different problems correspond to different fitness functions, which directly affect the performance of the algorithm and the quality of the solution space.

Adopting the Monte Carlo (Ghahfarokhi et al. 2020) method to determine the fitness function of the IPSO, the initial data for training are the coordinates of the points generated randomly in the region. Suppose that the sensor nodes set is S = {s1, s2, s3…sn}, the area of the region is discretized into m \(\times\) n pixels and noted as the set G = {g1, g2… gmxn}. If the distance between a pixel and a node is less than the communication radius of the node, we consider that the pixel is covered by the node. The joint probability that the pixel can be perceived by the network node is as follows:

$${\text{P}}\left( {{\text{S}},{\text{G}}} \right) = 1 - \mathop \prod \limits_{g \in G} \left( {1 - f\left( {S,g} \right)} \right).$$
(9)

Then the coverage formula of set S to the network region is shown as follows:

$${\text{fitness}}\left( {\text{S}} \right) = \frac{{\mathop \sum \nolimits_{g \in G} P\left( {S,g} \right)}}{m \times n}.$$
(10)

The numerator represents the covered range, that is, the sum of the coverage of each pixel like {g1, g2 … gmxn}, and the denominator is the whole network area, namely m×n pixels. Using its value as the fitness function of the improved particle swarm algorithm can measure the effectiveness of the current network deployment scheme. The scheme flow of improved particle swarm optimization mainly includes:

Step 1: Initialize the particle swarm: set the number of particles and determine the initial position X and velocity V of the particles according to Eqs. (4) to (5).

Step 2: Calculate the optimal individual fitness and the optimal population fitness of the current particle population according to Eq. (10).

Step 3: Record the fitness values obtained by each particle in each iteration of the particle swarm, compare the historical record of particle individual and update the historical individual optimal solution of the current particle gBest.

Step 4: Compare the current historical individual optimal solutions for all particles and update the global optimal solution.

Step 5: Calculate the velocity V and position X in the next movement of the current particle, and judge whether the data is out of bounds. If the boundary is crossed, set the result to a critical point, and record the velocity and position information of the particle after the movement.

Step 6: Determine whether the scheme iteration is completed or not, then stop the iteration and return to the global optimal particle coordinate, otherwise, repeat Step 2 to Step 6.

5 Our proposed PSOR scheme

The PSOR proposed in this paper optimizes the random deployment of nodes in the LEACH-EA protocol and uses the IPSO algorithm to initialize the node locations. Under the premise of ensuring network connectivity, the network coverage is improved as well as the node distribution. This facilitates the load balancing of subsequent data transmission.

figure e

5.1 LEACH-EA protocol

In the clustering phase, incorrect selection of cluster head nodes is one of the drawbacks of LEACH protocol, thus, the incorporated fuzzy logic parameters were added in LEACH-EA protocol to optimize the cluster head selection threshold T(n). That was, the current energy and distance from the cluster head to the base station were considered. The improved thresholds were calculated as Eq. (11):

$${\text{T}}\left( {\text{n}} \right) = \frac{p}{{1 - p\left( {r \cdot mod\left( \frac{1}{p} \right)} \right)}}\left( {\alpha + \beta \left( {\frac{{E_{current} }}{{E_{0} }}} \right)} \right),$$
(11)

where Ecurrent was the residual energy of the current node, E0 represented the initial energy of the current node, and α and β were the distance impact factor and energy impact factor, respectively. Under the improved threshold filtering, the residual energy value of the selected cluster head node was balanced, and the distance from the cluster head node to the base station decreased.

Referring to the node competition radius model proposed by Shidi (Shidi et al. 2018), the competition radius of nodes was improved as shown in Eq. (12):

$$R_{c} \left[ {S_{i} } \right] = \left( {1 - \left[ {\left( {\varepsilon + c\frac{{E_{0} - E_{current} }}{{E_{0} }}} \right)\left( {\frac{{d_{max} - d\left( {S_{i,} Sink} \right)}}{{d_{max} - d_{min} }}} \right)} \right]} \right).$$
(12)

The ε and c were constants between 0 and 1, and their relationship satisfied the following conditions. To avoid the overhead of data transmission caused by the joining of nodes, the scope of filtrating the member of the cluster head node was reduced.

$$\left\{ {\begin{array}{*{20}c} {\frac{c}{\varepsilon } < \frac{{Rc_{max} }}{{d_{max} - 2Rc_{max} }};} \\ {0 \le \varepsilon + c \le 1.} \\ \end{array} } \right.$$
(13)

In the case of data transmission with LEACH protocol, the cluster heads fuse the data from member nodes and send it to the sink node through a single-hop transmission. To avoid long-distance data transmission from edge nodes, LEACH-EA divided the entire network area into three concentric circles, group1, group2 and group3, and different groups corresponding to different routing policies. The radii were R/3, 2R/3, R, respectively, where R was the diagonal half value of the entire network. What’s more, we applied the ant colony algorithm to optimize the transmission path of each node, which was modified by adding fuzzy logic parameters to the roulette. By varying the influencing factors according to the type of the nodes, the node in line with the outstanding energy balance strategy was more likely to be a branch of the optimal path. Ants moved by calculating the transfer probability of the neighbor nodes. The probability function Pij(t) is shown in Eq. (14):

$$Pij\left( t \right) = \left\{ {\begin{array}{*{20}c} {\frac{{\tau_{ij}^{a} \eta_{ij}^{b} }}{{\mathop \sum \nolimits_{{k\in U_{i} }} \tau_{ik}^{a} \eta_{ik}^{b} }}} \\ {\eta ij = \frac{{E_{j\_current} }}{{d_{ij} }}} \\ \end{array} } \right.,$$
(14)

where τij was the pheromone concentration value from node i to node j within time t. ηij was the heuristic factor. a and b represented the pheromone concentration value and the influence coefficient of the heuristic factor, respectively. Ej_current was the residual energy value of the unavailable node, and dij was the distance value of [i, j] in the column.

Update the pheromone concentration on the path after each movement, and the final communication path with the highest pheromone concentration.

5.2 Particle swarm optimization routing scheme

As the LEACH-EA protocol deployed the initial network nodes randomly, the randomness of node distribution led to instability of network node coverage and imbalance of node data transmission load. Therefore, we propose the particle swarm optimization routing scheme (PSOR). The IPSO algorithm is used to optimize the coordinates, set the inertia weights of the particles to dynamic adaptive values, and determine the fitness function of the algorithm with the Monte Carlo method. The training data are the points generated randomly in the region.

UAPSO algorithm (Vinitha et al. 2020) discussed the settings of adaptive control parameters in particle swarm optimization. It has been proven to be effective in improving convergence, consistency, and execution rate. Therefore, the parameters such as C1 and C2 involved in the PSOR scheme in this paper refer to the UAPSO algorithm. The specific parameter values are shown in Table 2.

Table 2 Parameter setting table

To design an ideal deployment scheme, the optimal sensing radius is set based on ensuring network connectivity. The sensing radius of nodes is set to 4 m, 5 m, 6 m, and 7 m to test the PSOR scheme. Standardization of data between 0–1 for presentation. The coverage optimization process is shown in Fig. 1.

Fig. 1
figure 1

Comparison of coverage optimization of difference perceived radius

When the sensing radius is 4 m, the initial coverage of the network is only about 40% and the network connectivity is limited. On deploying the nodes with the IPSO, the network coverage reaches 73%. However, the sensing radius is too small to form an effective network connection and ideal coverage. Experimental results show that network connectivity is not satisfied even when the sensing radius is 5 m. When the sensing radius is 6 m, the network nodes can form a fully connected state, and the coverage rate increases from the initial 68–93%. This expands the monitoring area of the network significantly, reduces the overlap between nodes, and avoids ineffective data monitoring and forwarding.

Figures 2 and 3 show the initial network layout when the sensing radius of network nodes is equal to 6 m and the optimized network layout after the PSOR scheme, respectively. It can be noted that the network coverage rate is increased significantly.

Fig. 2
figure 2

Initialize the network layout

Fig. 3
figure 3

IPSO optimizes network layout

6 Performance analysis

6.1 Experiments

In this work, the experimental environment is built using Python to perform simulation experiments. First, using IPSO to obtain the node-optimal deployment scheme. Then, applying the node-optimal deployment scheme to the LEACH-EA protocol. The performance of the scheme is analyzed in terms of network life cycle, node death rate, energy loss process and packet forwarding volume. Assuming 100 network nodes are located randomly in a bounding area of 100 m \(\times\) 100 m. The initial energy of nodes is 5000 J, the sensing radius is 6 m, and the energy loss of each packet forwarding is 1 J. Parameters such as transmission amplification of sensors and received power are referred to the LEACH-EA (Wang and Guoxiang 2020) experiment, which simulates 3000 rounds of data transmission. The experimental parameters are shown in Table 3.

Table 3 Experimental Parameter setting

Figures 4 and 5 show the current number of surviving nodes in the network in the LEACH (Yildiz et al. 2018; Wang and Guoxiang 2020), LEACH-EA (Wang and Guoxiang 2020), and PSOR scheme as well as the number of dead nodes. As is shown in Fig. 4, the curves of LEACH and LEACH-EA coincide. In Fig. 5, the first death node of LEACH appears in 79 rounds, the first death node of PSOR appears in the 1704 rounds, and the first death node of LEACH-EA appears in 1420 rounds. The results suggest that the optimized node deployment enables the entire network to transmit data more effectively, avoiding the invalidity caused by node overlap, delaying the node death, and improving the network utilization.

Fig. 4
figure 4

Network nodes survival process. [LEACH-EA (Wang and Guoxiang 2020) and LEACH (Yildiz et al. 2018)]

Fig. 5
figure 5

Network nodes dead process. [LEACH-EA (Wang and Guoxiang 2020) and LEACH (Yildiz et al. 2018)]

Figure 6 shows the energy consumption process of the three protocols throughout the network life cycle. LEACH (Yildiz et al. 2018) protocol reaches the state of network paralysis in round 441, LEACH-EA (Wang and Guoxiang 2020) protocol exhausts in round 2107, and the PSOR scheme collapses in round 2729. Compared with LEACH-EA, the PSOR scheme prolongs the network life cycle by about 30%. It can be seen that in the middle stage of the network, the energy consumption of the network after deployment optimization is more gentle. Because some of the dead nodes appear in the middle stage, causing the remaining nodes in the network to undertake more data transmission tasks. The random deployment of nodes may cause a transmission blind area. Under this circumstance, the LEACH-EA protocol increased the number of relay nodes to ensure that data can be successfully transmitted to the base station. As a result, these relay nodes cause additional energy losses. While the PSOR scheme optimizes the node deployment, which reduces the appearance of the data transmission blind spots. By balancing the network load, the network energy loss rate can be slowed.

Fig. 6
figure 6

Comparison of network energy losses. [LEACH-EA (Wang and Guoxiang 2020) and LEACH (Yildiz et al. 2018)]

The total number of packets generated by the three protocols during the 3000 rounds of data transmission is shown in Fig. 7. The total number of packets for LEACH (Yildiz et al. 2018), LEACH-EA (Wang and Guoxiang 2020), and PSOR are 4269, 175,376, and 425,834, respectively. The calculation of the total packet includes the broadcast signal packets generated by the cluster and data transmission packets. The PSOR scheme reduces the death rate of nodes and makes more nodes survive longer. Compared with the LEACH-EA protocol, the total packet number is increased by nearly 1.5 times, enhancing the work efficiency of network nodes greatly.

Fig. 7
figure 7

Comparison of network packet forwarding volume. [LEACH-EA (Wang and Guoxiang 2020) and LEACH (Yildiz et al. 2018)]

Table 4 is the performance comparison of LEACH, LEACH-EA, SCSAP and PSOR. It can be seen that the PSOR scheme which is based on optimized node deployment improves the node survival rate, network life cycle, and packet forwarding volume greatly.

Table 4 Performance comparison of different protocols

7 Conclusion

The PSOR scheme proposed in this paper has improved the network deployment in LEACH-EA. The problems of unstable network coverage and unbalanced data transmission load of nodes due to the randomness of node distribution have been solved. The adaptive inertia weight has been set and the fitness function has been constructed by the Monte Carlo method in IPSO. The influence of different sensing radii on the coverage rate has been analyzed through experiments and the optimal sensing radius has been selected to generate the deployment scheme. It can be seen that the PSOR scheme has improved the node survival rate, network lifetime, and packet forwarding volume significantly. In the scheme of this paper, the transmission power of sensor nodes to send data is a fixed parameter value, and the initial fixed transmission power may no longer be applicable to all surviving nodes as the number of surviving nodes and the location matrix of working nodes in the network keep changing and the topology may change. Too much transmission power may lead to additional energy consumption, while insufficient transmission power may increase the packet loss rate. Therefore, in future research, we will focus on addressing the above issues and propose improvements in the next section.

8 Future work

Considering that the topological structure of the network may also change with the continuous change of the number of surviving nodes and the location of working nodes, the chaotic immune evolutionary algorithm (CIEA) will be considered to solve the above problems.

8.1 Chaotic immune evolutionary algorithm

The CIEA will be applied to optimize the transmission power of network nodes. Construct the affinity function from three aspects: the optimal number of cluster heads, the average bit error rate, and the data transmission energy consumption per round. What’s more, the Pareto solution will be generated iteratively by the algorithm to ensure that the above three aspects are optimal under the premise of setting the parameter value.

The CIEA will combine the immune algorithm (Liu et al. 2020) and chaos algorithm. We intend to use the chaotic search mechanism to improve the local search capability of the immune algorithm and optimize the transmission power of the network nodes. The flow of the CIEA scheme is as follows:

Step 1: Initialize antibody population N (i), size n.

Step 2: The affinity value of each antibody Ni will be calculated according to the affinity function in the antibody population, and the antibody Ni with the highest affinity will be selected.

Step 3: Clone the selected antibody Ni. The copy number is proportional to its affinity, with a greater number of clones indicating a greater affinity.

Step 4: The new antibody after mutation cloning will be denoted as N2i, and the mutation probability is inversely proportional to the affinity, that is, the higher the affinity is, the smaller the mutation rate is.

Step 5: The antibodies with the highest affinity among the mutated antibodies will be selected, and some low-affinity antibodies in N (i) will be replaced by these antibodies to form a new population in N (j).

Step 6: Repeat Step 2 to Step 5 until meeting the termination conditions.

8.2 The application of CIEA in PSOR

The affinity function will involve three aspects, namely, the optimal number of cluster heads, the energy consumption of each round of data transmission, and the average bit error rate.

For sensor networks, the optimal number of cluster heads will be determined by a combination of the number of sensor nodes, the data transmission radius, and the distance between cluster heads and base station. The model for calculating the optimal number of cluster heads is as follows:

$${\text{K}} = {\text{M}} \times \sqrt {\frac{{N \times {\upvarepsilon }_{fs} }}{\pi }} \times \sqrt {\frac{1}{{E_{{elec + \varepsilon_{mp} }} \times \left( {d^{4} + d_{toBS}^{4} } \right)}},}$$
(15)

where M is the total area of the network area. N is the number of nodes. d means the transmission radius of the nodes. dtoBS represents the distance between the cluster head node and the base station node. εfs and εmp are the energy loss of the power amplifier for data transmission in different channel modes.

For each round of data transmission, the total energy generated by forwarding data in the network is shown in Eq. (16):

$$E_{trans} = \mathop \sum \limits_{i \in M} E_{send} + \mathop \sum \limits_{j \in C} E_{send} ,$$
(16)

where Esend is the energy loss model in Eq. (2), M means a member node-set, and C denotes a cluster head node-set.

The average bit error rate (Tandon et al. 2021) will quote the following formula:

$$P_{ABEP} = \frac{1}{{2{\Gamma }\left( b \right){\Gamma }\left( {mL} \right)}} \cdot G_{2,2}^{1,2} \left[ {\frac{m}{{a\mathop \gamma \limits^{ - } }}|_{0,mL}^{1,1 - b} } \right],$$
(17)

among them, Γ() is a complementary incomplete gamma function. b means a detection type, and the range is (1/2,1), representing uncorrelated and correlated types, respectively. G is the Mayer G function, and L denotes the number of subcarriers per node. m is the channel attenuation coefficient, and a is the current average transmission power.

Normalize the three optimization objective functions, as shown in Eq. (18):

$${\text{y}} = \min \left( {\begin{array}{*{20}c} {\left| {C_{num} - K} \right|,} & {E_{trans} ,} & {P_{ABEP} } \\ \end{array} } \right),$$
(18)

where Cnum is the number of cluster heads in the current round, and this function ai to evaluate the performance of the proposed solution.

The purpose of this section is to allow nodes to adaptively adjust the transmission power of PSOR by applying CIEA and to reduce the network energy consumption by setting a reasonable transmission power. Due to time constraints, these experiments need to be completed in future studies.