#### Abstract

Data collection is the basic purpose of deploying in heterogeneous WSNs for Internet of things, and the problem of data collection is the key problem that needs to be solved in heterogeneous WSNs. How to collect energy-efficient and reliable data is one of the key technologies of heterogeneous WSNs. Collecting the sensor node data by mobile sink is an effective measure to solve data collection efficiency. To this end, a data collection strategy of mobile sink for heterogeneous WSNs based on pigeon-inspired optimization by PSO algorithm is proposed. The proposed algorithm uses the improved pigeon-inspired optimization by particle swarm optimization algorithm to select the best dwell point and then regards the construction of the moving path based on the dwell point as a traveling salesman problem to optimize the moving path and solve the optimal moving path. The experimental analysis and simulation results show that, compared with other algorithms, the algorithm proposed in this paper can effectively prolong the lifetime of the network and reduce the delay of data collection, increasing the amount of data collection.

#### 1. Introduction

With the rapid development of information technology and Internet of things, wireless sensor networks (WSNs) have been widely used in environmental monitoring, industrial production, intelligent agriculture, intelligent transportation systems, rehabilitation medicine, and other applications [1–3]. As a key technology in the field of data collection, it is now also the basis for big data and artificial intelligence technologies. In traditional heterogeneous WSNs, the data forwarding between sensor nodes usually adopts a multihop approach [4, 5]. However, due to the large amount of data forwarded from other nodes, the sensor nodes near sink are prone to die due to excessive energy consumption, resulting in the interruption of the network link [6, 7]. At the same time, these sensing nodes are micronodes, which are generally powered by batteries. Their node energy is limited, and the transmission of sensing data requires multiple hops, which limits the application of WSNs [8]. To avoid this problem, researchers propose a mobile sink data collection method [9]. The mobile sink moves according to a certain path in the monitoring area. It is not advisable to move the sink to visit every sensor node [10]. How to plan the path of moving sinks in the sensing area of heterogeneous WSNs, so that the sensing data passes through fewer hops and is collected to sink nodes within a limited delay, becomes a challenge.

The core problem of this paper is how to use the mobile sink to collect data efficiently and reliably for heterogeneous WSNs [11]. In order to better achieve the goal, we need to save network energy, extend the network life cycle, and reduce network latency [12]. To this end, the following two algorithms according to the number of mobile sinks are proposed. A data collection strategy for heterogeneous WSNs is based on a single mobile sink. The main work of this paper is as follows: A data collection algorithm based on a single sink is proposed. The algorithm is divided into two different stages: clustering and path planning. (1) In the clustering stage, the average residual energy of network nodes and the distribution density of neighbor nodes are considered. (2) In the path planning stage, for the selected number of cluster head nodes, the mobile sink will traverse the position of each cluster head according to the planned path to collect data. The mobile sink adopts pigeon-inspired optimization by PSO algorithm for path planning. The Euclidean distance between cluster heads is used as the weight, and the optimal path is found on the basis of the minimum spanning tree formed by all cluster heads. Since some nodes of the obtained minimum spanning tree have multiple connection paths, the idea of the PSO-PIO algorithm is to delete multiple branches of a node and reconnect all nodes. There is only one path in the entire area, and each cluster head is only passed through once, so as to obtain the shortest path for moving the sink, so that the network has the shortest delay in data collection.

In traditional heterogeneous WSNs, usually adopts a multihop approach. However, due to the massive forwarding of data from other nodes, the nodes located near the sink are prone to die due to excessive energy consumption, resulting in network link interruption. At the same time, these sensing nodes are micronodes, which are generally powered by batteries. Their node energy is limited, and the transmission of sensing data requires multiple hops, which limits the application of WSNs. To avoid this problem, a mobile sink-based data collection method of heterogeneous WSNs is proposed. The mobile sink starts from a certain point, visits each node, and completes the task of data collection. Such a process can generally be viewed as the traveling salesman problem. Solving the path planning strategy of moving sink is an NP-hard problem. The PIO algorithm performs search calculation and problem solving according to the unique homing behavior of the pigeon flock. Through the experimental analysis of the heterogeneous WSNs data collection method of the PSO-PIO algorithm and the comparison with other algorithms, the algorithm can effectively prolong the lifetime of the network and reduce the delay of data collection.

#### 2. Related Work

In traditional heterogeneous WSNs, the nodes transmit data to a fixed base station in a multihop manner, which easily causes nodes near the base station to participate in excessive data forwarding. The researchers propose a data collection scheme of mobile sink. The coordination network formed between UAVs and WSNs helps to improve the quality and coverage. Combined with the UAV maneuverability model, a data collection model combining UAVs and wireless sensor networks is established. The model considers the importance of topology and strategic location to determine UAV waypoints and determine data transfer patterns. Sayeed et al. proposed a new maneuverability of attraction factor of UAV moving waypoints [13]. Data loss and latency in cluster heads are caused by energy consumption and duplication of work. Cluster members send data from the threshold model to the cluster head. Cluster heads collect data from mobile sinks and report to receivers when data arrives nearby [14].

The data collection scheme of heterogeneous WSNs based on the mobile sink mainly includes fixed movement, random movement, and controlled movement.

##### 2.1. Random Movement

In random movement, the path of moving the sink is not set in advance. For example, if the node is placed on an animal, the movement trajectory of the animal is random, although this scheme is easy to implement [14, 15]. The remaining energy and position of nodes are the main parameters for selecting cluster heads. A control strategy for mobile receivers to collect data from cluster heads is designed [16]. Movement trajectory planning of mobile agents has been receiving much attention. Based on the traversal sequence, the mobile agent uses the particle swarm algorithm to select anchor nodes for each CHs within the communication range. The communication range is dynamically adjusted, and anchor nodes are merged in duplicate coverage areas to further improve performance [17]. In MWSN, the nodes enter and exit the network randomly, and due to the limited resources in WSNs, the link quality of the path used for data transmission and the time consumed by data forwarding must be tested [18].

##### 2.2. Fixed Movement

In fixed movement, mobile sinks visit some prespecified locations along a fixed route and collect data from groups of sensor nodes. Kumar et al. proposed an efficient algorithm to improve the data collection process, using a network flow approach to achieve efficient data forwarding [19, 20]. According to the traveling salesman problem (TSP), the mobile actor tour program passes through these rendezvous points. We also propose a new rendezvous node rotation scheme to equitably utilize all nodes [21]. In resource-constrained wireless sensor networks, energy saving is a key issue. The use of mobile receivers to transmit sensory data has become a common method to save the limited energy of sensors. Agrawal et al. proposed a mesh round-robin routing protocol (GCRP), which aims to minimize the overhead of updating the latest location of mobile receivers. A set of sharing rules is also proposed to govern when and with whom mobile sinks share the latest location information of receivers [22].

##### 2.3. Controlled Movement

Controllable movement means that path planning can be performed according to the information fed back by the path [23]. Ren et al. proposed a mobile sink reliable data acquisition algorithm; this method greatly improves the efficiency of network work. [24].

In summary, solving the mobile sink path planning strategy is an NP-hard problem, such as node energy and node density. The pigeon flock algorithm performs search calculation and problem solving according to the unique homing behavior of the pigeon flock, and the PIO algorithm provides an effective approach.

#### 3. Mathematical Model of Data Collection

The data collection of heterogeneous WSNs is mainly based on clustering data method, and its main content is to divide the network hierarchically. The entire network is divided into several cluster heads, and adjacent nodes are in one cluster [25]. Each cluster will choose a node as the cluster head, and all communications in the network are transmitted in the backbone network [26]. Compared with other routing protocols, the clustering algorithm pays more attention to balancing the energy consumption, avoiding hotspot problems.

Although the mobile sink scheme can effectively improve the data collection rate, there is still a problem that must be solved in this scheme: the planning of the moving path of the sink. Obviously, with different moving paths, the data collected by nodes may be different, and the network energy consumption will also be different. Therefore, how to plan the movement of the sink is the key technology of the data collection scheme based on the mobile sink.

At present, there are two strategies to plan the movement path of the sink: (1) The mobile sink traverses the entire area within the network. (2) Moving sink only traverses some preset positions; these positions are called resident point rendezvous points (RPs). Compared with the first strategy, the path planning strategy citing RPs is more efficient and consumes less energy. The collection process of mobile sink based on RPs heterogeneous WSNs is shown in Figure 1. Mobile sinks form data collection paths by traversing RPs.

Mathematical model of mobile sink data collection for heterogeneous WSNs based on resident points rendezvous points (RPs):

The number of nodes is deployed in the monitoring area of . Let denote the -th sensing node, and . Each moving path of MS consists of the number of RPs, where . RPs constitute the set of RPs .

Let the parameter denote a moving path of the MS, which consists of RPs. The sequence of paths is . Use the following formula to calculate the length of the path : where the parameter represents the distance between and traversed in the path.

The data collection method for heterogeneous WSNs aims to minimize the path length and satisfy the constraints of data transmission delay and data volume. Let the parameter denote the time delay for the sink node to collect data along the path , and define the parameter by . That is where the parameter represents the maximum delay allowed. Furthermore, let the parameter denote the maximum data capacity allowed by the channel. The data transmitted by RP to the sink node each time should be less than . Therefore, , where the parameter represents the amount of data transmitted by the -th RP to the sink node in each round.

Finally, the objective function for establishing the data collection of heterogeneous WSNs based on path planning is as follows:

However, solving the mobile sink path planning strategy for RPs is an *NP*-hard problem, which is affected by multiple factors, such as node energy and node density. The pigeon flock algorithm performs search calculation and problem solving; according to the unique homing behavior of the pigeon flock, the pigeon-inspired optimization algorithm provides an effective new approach. Therefore, a mobile sink data acquisition algorithm based on PIO optimization by PSO algorithm is proposed, and the sink moves according to these resident points to form the optimal data transmission path.

#### 4. Pigeon-Inspired Algorithm Optimization by Particle Swarm Optimization

##### 4.1. Pigeon-Inspired Optimization Algorithm

Pigeon-inspired optimization (PIO) algorithm was proposed by Duan Haibin [27]. The design inspiration of the pigeon flock algorithm comes from the unique homing behavior of the pigeon flock [28, 29]. The algorithm mainly finds the global optimal solution of the optimization problem by simulating the navigation behavior of the pigeon flock. According to the behavior of pigeons in the process of homing, there are three key reference factors for their main navigation, which are [30] as follows: (1) the influence of the sun on the pigeon’s homing and its navigation ability depend on the position of the sun; (2) the influence of geomagnetic field on pigeons [31]; the upper beak of pigeons contains a magnetic induction structure, which plays an important role in indicating the flight of pigeons. and (3) the influence of terrain landmarks on pigeon navigation and similar terrain will speed up the homing process of pigeons [32].

The homing navigation of the pigeon flock is mainly carried out in two ways. At different flight positions, pigeons will use different navigation tools. They should refer to the geomagnetic field to determine the direction [33]. Use iconic landmarks to navigate when they close to the destination [34].

Initialize a pigeon group with individuals in the -dimensional space; the position of the -th pigeon in the population is represented by ; the speed of the -th pigeon is represented by ; and the fitness of the pigeon is represented by the function , the geomagnetic compass operator is marked as , and the landmark operator is marked as . Each pigeon is based on the geomagnetic compass operator [35, 36]: where the parameter is the center position after the -th iteration, which is identified as a landmark. is the fitness function. For solving (minimum optimal solution), (maximum optimal solution) has two different forms, and is the number of pigeons remaining after the -th iteration [37, 38]. After the above iteration loop reaches , the landmark operator stops working and outputs the optimal solution adapted at this time [39].

##### 4.2. Pigeon-Inspired Algorithm Optimization by PSO

The PSO algorithm is a novel optimization algorithm proposed in recent years. There are not many studies on it at present. The advantage of PSO-PIO algorithm is that the PSO algorithm with fast convergence speed in the early stage can quickly lock the region where the optimal solution is located and sets up diversity monitoring. After the diversity drops to a certain level, the PIO algorithm performs a locked area search to quickly find the optimal solution.

###### 4.2.1. The PSO Algorithm

The mathematical model of article swarm optimization (PSO) is as follows [40]: Assuming that there are particles in a random distribution state in the -dimensional space, let the coordinates of the -th particle in the population be

After iterations, the optimal coordinate of the -th particle is

The optimal coordinates of the swarm particles are

The velocity of the -th particle is

After iterations of the particle, its own velocity and position are updated as where is the dynamic inertia factor, and are the learning factors, and are random numbers between [0,1], is the maximum value of the factor, is the minimum value, and is the speed [41].

###### 4.2.2. Particle Swarm Algorithm with Jump Operator

In the later iteration of particle swarm optimization, the optimal coordinates will be limited to the local area. To this end, an adaptive jump operator is added to compare the similarity between the optimal coordinates of individual particles and the optimal coordinates of group particles. Given the particles of different jump probabilities, after the -th iteration, the probability formula and jump formula for the-th particle to jump out of the current position are where the parameter rand is between [0,1] and parameters and are upper and lower limits.

###### 4.2.3. Pigeon Flock Algorithm with Interference Operator

In practical problems, the PIO algorithm also has a limited number of iterations that are prone to local optimal solutions. This phenomenon is particularly serious when solving optimization problems of complex functions. Tn interference operator is introduced: where the parameters , , and are random numbers on [0,1] and the parameter is the interference operator.

###### 4.2.4. Particle Swarm and Pigeon Swarm Hybrid Optimization Algorithm (PSO-PIO)

The PSO-PIO algorithm redefines a diversity function. where the parameter is the -th iteration. The parameter is the variance of the -th generation population. The parameter is the distance between the population particle, and the optimal particle after iterations, , the parameter is the dimension. The parameter is the average Euclidean distance between the population particle and the optimal particle after iterations, .

The solution process of the PSO-PIO algorithm mainly includes two steps: The first step uses the particle swarm algorithm with a jump operator to perform a preliminary search, and when the diversity function drops to a certain threshold, it goes to the second step. Further optimal solutions are performed using the landmark operator of the pigeon colony algorithm with disturbance operator. The algorithm adopts the PSO algorithm with fast convergence speed in the early stage to quickly lock the region where the optimal solution is located and sets up diversity monitoring. After the diversity drops to a certain level, the interference algorithm PIO algorithm is used to search the locked area to quickly find the optimal solution. The implementation process is shown in Figure 2.

The basic steps of PSO-PIO algorithm are as follows:

Step 1. Initialization algorithm parameters. The population , the space dimension , the inertia factors and , the learning factors and , and the maximum number of iterations .

Step 2. According to the fitness function, mark the individual optimal solution and the current global optimal solution .

Step 3. According to the PSO algorithm, gradually calculate the new position and new speed of each particle, compare the similarity between the particle’s and , and calculate the particle’s jump probability , and set the random number . If , the particle jumps out of the current position according to the jump formula; otherwise, it stays at the current position to calculate and for the next round.

Step 4. Use the diversity function to evaluate the diversity level of the population, and judge whether the diversity is less than the set diversity threshold. If it is less than the set diversity threshold, terminate the PSO algorithm, enter the pigeon flock algorithm ,and go to step 5; otherwise, go to step 3.

Step5. Enter the landmark operator of the PIO algorithm with interference operator, and calculate the center position of the population through the center position calculation formula (3).

Step 6. Update the center position of the population and the position of each individual according to the landmark operator of the PIO algorithm, and calculate the probability according to the interference operator, determine the update position, and repeatedly calculate the particle position for the next iteration.

Step 7. Whether is greater than , if so, terminate the algorithm and output the result, otherwise go to step 6.

#### 5. Data Collection Strategy of HWSNs Based on PSO-PIO

The main process of the data collection method of heterogeneous WSNs based on the PSO-PIO algorithm is as follows:

##### 5.1. Improvement of SEP Clustering Algorithm

The traditional SEP clustering algorithm is improved, and the threshold function is optimized based on the average residual energy factor and the distribution density factor of neighbor nodes.

##### 5.2. Path Planning Strategy Based on PSO-PIO Algorithm

After clustering in the first section and selecting cluster heads (residence points RPs), the mobile sink will traverse the positions of each cluster head according to the planned path to collect data. The minimum spanning tree of the backbone network composed of the entire nodes. Once the resident point RPs are selected, constructing the movement trajectory according to the RPs is a traveling salesman problem (TSP).

In order to ensure that the moving path of sink is optimal, that is, the mobile sink moves from the first cluster head to the last one, and each cluster head passes through only once during the movement. The proposed PSO-PIO algorithm can obtain the optimal mobile sink path planning strategy, and the PSO-PIO algorithm optimizes the edges and nodes in the minimum spanning tree, so as to obtain the optimal path of sink.

##### 5.3. Data Collection

###### 5.3.1. Intracluster data collection

Step 1: After the cluster head node of each cluster is successfully selected, the cluster head broadcasts information such as its ID number, location, and remaining energy within its maximum propagation radius.

Step 2: After the nodes receive the information from cluster head, they record the information.

Step 3: The member nodes perform data transmission according to the divided clusters. The cluster head node uses the TDMA strategy to allocate time slots for the nodes in the cluster, and all ordinary nodes perform data transmission in the allocated time slots.

###### 5.3.2. Mobile Sink to Collect Data

The cluster head node processes the received data and then forwards it to the base station to complete the data collection of heterogeneous WSNs.

#### 6. Algorithm Comparison and Performance Analysis

This paper compares four data collection strategies, which are the random walk method, the movement strategy of the PSO algorithm, the movement strategy of the PIO algorithm, and the PSO-PIO algorithm. In the mobile strategy, four algorithms are compared. In the experiment, the number of populations are 30, the iterations are 50, and the best and average values of 30 independent runs were used as the final test results. The population size of the pigeon colony algorithm is 30, the number of iterations of the map and compass operator is 40, the number of iterations of the compass operator is 10, and the factor of the map and compass is 0.2. The parameter settings of the heterogeneous wireless sensor network are shown in Table 1.

##### 6.1. Comparison of Mobile Path Planning

In order to visually see the movement process of the mobile sink node of heterogeneous WSNs, this paper describes its movement path in detail and gives the movement paths of two different network architectures with 24 resident points and 32 resident points, respectively. The moving path of the algorithm is shown in Figures 3 and 4.

**(a) Random walk**

**(b) PSO**

**(c) PIO**

**(d) PSO-PIO**

**(a) Random walk**

**(b) PSO**

**(c) PIO**

**(d) PSO-PIO**

From the network simulation of 24 RPs in Figure 3, the simulation area in this paper is large, and the total movement path is relatively long, so the movement path planning strategies of the four algorithms are relatively long. Among them, in the movement mode of random walk, its moving path is disordered, and the path is the longest. Particle swarm optimization is a little better than random movement; it has less chaotic movement. Compared with random movement and the PSO algorithm, the PIO algorithm has a relatively shorter movement path, and the strategy of the movement path is relatively better, but it is not the optimal one.

Figure 4 shows the mobility of 32 resident nodes, which can be compared by path planning. Due to the large scope of simulation in this paper, there are many RPs. The relative effects of the proposed four algorithms are not the best, but from the perspective of the four current literature methods, this paper proposes its moving path compared with the other three methods. Obviously shorter, the strategy is better.

##### 6.2. Comparison of Network Energy Consumption

The energy consumption comparison of the four algorithms is shown in Figure 5. The RW method in the figure is an abbreviation for the random walk method.

From the perspective of the growth rate of the network, the method of random movement consumes the most energy. The PIO algorithm optimization by PSO algorithm has the smallest network energy consumption, and the smaller the growth rate, the lowest network energy consumption.

Moreover, we add a comparison of the three-dimensional energy consumption of the algorithms, as shown in Figure 6.

**(a) Random walk**

**(b) PSO**

**(c) PIO**

**(d) PSO-PIO**

Similarly, through the energy consumption comparison of the three-dimensional network, it can be seen that the energy consumption of this paper is the smallest.

##### 6.3. Comparison of the Number of Packets Received by Sink

The comparison of the number of packets collected by the four algorithms is shown in Figure 7.

The number of received data packets for the four algorithms is the same, and as the simulation progresses, the gap gradually emerges. The number of datagrams collected by random walk gradually decreases. With the progress of the simulation, the network energy consumption of random walk is relatively large, resulting in the death of some nodes, resulting in a small number of data packets accepted by the sink. The number of received packets of the other three types is not much different. The improved PIO algorithm proposed in this paper receives the most packets, but compared with the PSO algorithm and the basic PIO algorithm, the difference is not so obvious.

##### 6.4. Comparison of the Number of Cluster Head Nodes

The comparison of the number of cluster head nodes is shown in Figure 8.

With the simulation progresses, the number of cluster head nodes in the random walk movement method fluctuates greatly. The number of cluster head nodes gradually decreased and finally dropped to 10. The number of cluster head nodes of the other three intelligent optimization algorithms is not much different, and the number of cluster head nodes is relatively balanced, with little difference.

##### 6.5. Comparison of Network Load Balance

The calculation formula of network load balancing is in reference [5]. According to the calculation in reference [5], we can obtain the network load balancing performance of the four algorithms. Figure 9 shows the simulation results.

From the comparison of network load balance in Figure 9, it can be seen that in the first 25 times of polling, the network load balance of the four methods has little difference. After 25 times of polling, the network load balance of the random walk method is sharp. The main reason is that the network energy consumption of the random walk method is too large, the energy of the nodes is exhausted in a large area, and its load balance fluctuates greatly. The other three methods are relatively balanced.

##### 6.6. Comparison of Network Transmission Delay

The transmission delay measures the real-time performance of different data collection methods by the transmission time of successfully received data packets. The calculation formula of network transmission delay is in reference [5]. According to the calculation of reference [5], we can obtain the network transmission delay of four algorithms. The network delays of the three algorithms are shown in Figure 10.

At the beginning of the network transmission delay, the network delay is long, mainly because the algorithm needs to perform a lot of operations at the beginning, and it takes some calculation time to find the optimal moving path. As the iterative operation of the intelligent optimization algorithm progresses, it gradually gains an advantage in finding the optimal path, and gradually finds a relatively optimal path plan, so that the transmission time is gradually shortened. From the perspective of the transmission delay of the entire network, the random walk method takes the longest time, the basic PIO algorithm has a longer delay, and the PSO algorithm has a shorter transmission delay. The PSO-PIO algorithm has the shortest transmission delay. The main benefit is that the path it calculates is optimal, so the transmission delay is the shortest.

##### 6.7. Network Connectivity Comparison

The network connectivity generally adopts the method of continuous motion discretization to calculate the network connectivity. The calculation formula of network connectivity is in reference [5]. The network connectivity comparison is shown in Figure 11.

The connectivity of the network is an important indicator to be considered in the data collection process, which directly affects the working stability and reliability of heterogeneous WSNs. From the comparison of network connectivity in Figure 11, except for the huge fluctuation of random walk, the network connectivity of the other three algorithms is relatively good. The PSO-PIO algorithm has the best moving path planning, and its network connectivity performance is also the best. In this way, the phenomenon of data congestion and large area packet loss that is easy to occur in the data transmission process is avoided, and the stability of the network operation is improved.

#### 7. Conclusions

In this paper, an efficient data collection method based on path optimization is proposed in heterogeneous WSNs for Internet of things. Aiming at the path problem of mobile sinks in heterogeneous WSNs, a path optimization strategy based on the PSO-PIO algorithm t is proposed. The PSO-PIO algorithm considers the network energy consumption, data transmission delay, and network work efficiency when collecting data when selecting the resident point, and uses the PSO algorithm to select some nodes as the resident point, and then constructs the optimal mobile path. Compared with the PSO and PIO algorithms, the algorithm can ensure the balance of energy consumption, effectively reduce the transmission delay, and greatly prolong the network life. In addition, the algorithm can overcome the fatal impact of unreliable links on multihop data collection and ensure the algorithm’s energy-saving and efficient data collection in the actual environment.

The current work does not consider the reliability and data redundancy in the process of data transmission. The next step is to further improve the efficiency of heterogeneous WSNs data collection and the reliability of the network, expand the mobile path of multiple sink and achieve the goal of multiple sink to complete data collection together.

#### Data Availability

The data used to support the findings of this study are included in the article.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

This work was supported in part by the Natural Science Foundation of Hubei Province under Grant 2020CFB304, in part by Wenzhou basic scientific research project under Grant R20210030 and the talent introduction project of Wenzhou University of Technology, scientific research project of Wenzhou University of Technology of Yinggao Yue and Li Cao, Wenzhou intelligent Image Processing and Analysis Key Laboratory Construction Project under Grant 2021HZSY007105, in part by open project of Wenzhou Key Laboratory of intelligent image processing and analysis under Grant ZY2019020, and major scientific and technological innovation projects of Wenzhou science and technology plan under Grant ZG2021021, major project of Zhejiang Natural Science Foundation under Grant LD21F020001.