Data Collection Method of Energy Adaptive Distributed Wireless Sensor Networks Based on UAV

In sensor networks, UAVs are often introduced to assist data collection tasks. UAVs can operate as data ferry nodes, connecting distributed areas that are separated from each other. This paper proposes a data collection method for distributed wireless sensor networks based on UAV and introduces the idea of edge computing in it. In the single-hop transmission scenario, the K -means++ clustering method is used for sensor node clustering and cluster head election in the initial state. In the next rounds of data collection, UAV is used to assist in the election of new cluster heads and data collection tasks, taking into account the relative distance and the relative remaining energy relationship of the sensor nodes in their clusters. In addition, reasonable priorities are set for some nodes that have never been elected in the previous rounds and for the dead nodes. In the multihop transmission scenarios, for nodes that cannot deliver directly, the optimal relay node is selected for routing by comprehensively considering factors such as transmission angle, transmission distance, and remaining energy of the node in each cluster. The method proposed in this paper coordinates the overall energy consumption of sensor nodes in the environmental monitoring area, delays the death time of key sensor nodes, and extends the network lifetime. At the same time, an improved ACO is used to reasonably plan the data collection path of the UAV. Compared with the comparison scheme, the improved ACO can obtain a better shortest path length and has the fastest convergence speed when reaching the shortest path.


Introduction
In recent years, with the rapid development of wireless networks and the technical advantages of wireless sensor networks, such as self-organization, rapid deployment, high error tolerance, and low cost, sensor networks are often used to monitor and collect ecological environment data, collect information in the process of geological monitoring, and sense some areas that are not suitable for human beings to stay and live for a long time. However, due to the influence of the volume of sensor nodes and the difficulty of replacing batteries of a large number of sensor nodes, how to reduce energy consumption when collecting data is an important problem. After a large number of sensor nodes are deployed, how to effectively collect sensor network data and how to effectively prolong the service life of sensor nodes in the process of sensor network data col-lection have become hot issues in academic and industrial circles in recent years.
For sensor data monitoring and collection tasks in special environments, multiple sensor data collection areas may be separated from each other due to geographical environmental factors such as rivers, mountains, and swamps. Deploying relay nodes in these areas will consume a lot of manpower and material resources and is very inconvenient to implement. The use of UAVs can effectively solve the impact of ground environmental factors on data collection tasks. With the increasing maturity of UAV technology, UAVs have been widely used in vehicle networking, agriculture, military reconnaissance, and other fields, and civil UAVs are also gradually popularized.
By introducing UAVs into wireless sensor networks, it can form a delay-tolerant network with traditional sensor networks, and effectively assist sensor networks in data collection tasks by using the "store-carry-forward" method. The UAV serves as a relay to collect data from sensor networks in remote areas and transmit it to the data center for processing, thus avoiding manual data collection and effectively addressing the impact of environmental factors on data collection on the ground.
UAVs assist wireless sensor networks where the UAV can move over the network, retrieve and collect data from sensor nodes. Using effective routing protocols can reduce energy consumption, avoid long-distance transmission and redundant transmission, and prolong the service life of sensors.
We have previously studied data collection by UAVassisted wireless sensor networks. In reference [1], we mainly proposed a data collection strategy based on drone technology in wireless sensor networks, using K-means++ method to conduct clustering and cluster head election in the initial state. Then, on the basis of comprehensive consideration of relative distance and relative residual energy of each sensor node, UAV is used to assist cluster head election and data collection. In addition, for some unelected nodes, a reasonable priority is set to make the energy consumption of sensor nodes more balanced. Experiments show that this strategy reduces the energy consumption and improves the performance of sensor networks. On the basis of the previous work, this paper further expands and utilizes UAVrelated technology to assist data collection from multiple distributed sensor network areas separated from each other due to geographical environmental factors, so as to make the energy consumption of sensor nodes in the monitoring area more balanced. The main contributions of this paper are as follows.
Introducing the idea of edge computing into the data collection process of distributed sensor network can greatly improve the efficiency of data collection. We discuss the case that the sensor node transmits the environmental data to the cluster head node through single-hop or multihop transmission mode. This method is not only flexible but also has low cost, which solves the problem that the data collection task of sensor network cannot be carried out uniformly in the environment monitoring area under complex geographical conditions.
Due to the limited battery capacity and high energy consumption of UAV, an efficient and energy-saving routing protocol is needed in both military and commercial applications. In addition, the deployment and trajectory planning of UAVs have a significant impact on the performance of routing protocols. Therefore, an improved ACO is used in this paper to plan the UAV's path, and the "store-carryforward" method is adopted to collect sensor data from each cluster head node. In this way, the data is transmitted to the data center with a small path cost and time cost.
The remaining chapters of this paper are organized as follows. The second chapter mainly introduces the related work, including the data collection method of the sensor network and the typical UAV path planning method. The third chapter mainly introduces the system model. The fourth chapter mainly introduces the data collection of UAV-based sensor network. The fifth chapter mainly introduces the UAV path planning based on improved ACO. The sixth chapter mainly introduces the simulation experiment and result analysis. The seventh chapter mainly introduces the conclusion and outlook.

Related Work
2.1. Data Collection Method of Sensor Network. For the data collection scheme of traditional sensor network, the data collection performance of the sensor network can be greatly improved by introducing mobile nodes as assistance, which has been paid attention to by most researchers [2][3][4]. In recent years, due to the reduction of UAV cost and the rapid development of UAV technology, using UAV as an auxiliary node to assist sensor network in data collection has become a research hotspot [5][6][7][8]. Traditional mobile nodes are susceptible to ground path restrictions and often cannot fully utilize the performance of sensor networks. However, the UAV has broken through the node's movement path restriction and has better flexibility in data collection tasks.
Chen et al. [9] proposed a universal NOMA-enabled UAV-assisted data collection protocol to maximize the total rate of wireless sensor networks during the data collection process. Xu et al. [10] introduced blockchain into the UAV-assisted IoT scenario and proposed a data collection system that takes into account both safety and energy efficiency, which can effectively improve the safety and efficiency of data collection. In order to ensure the timeliness of the collected data, Zhu et al. [11] optimized the trajectory and wake-up time allocation of the UAV as well as the transmission power of the sensor nodes to minimize the task completion time. Ma et al. [12] modelled the convergence node, UAV deployment, and resource allocation as a mixed-integer nonconvex optimization problem. They used heuristic methods to effectively solve the problem, thereby prolonging the life of the network. Ebrahimi et al. [13] used UAVs in dense wireless sensor networks to use projectionbased compressed data collection (CDG) as a novel solution to collect data. Du et al. [14] used UAVs to vehicle tolerance delay network (VDTN) for message storage and forwarding and proposed a VDTN routing protocol based on UAV, which considered both the probability of each encounter and the duration of connection between mobile nodes. This method not only reduced network overhead and end-to-end delay but also improved the reliability of message forwarding.
In summary, the existing data collection methods of sensor network rarely consider the problem of distributed wireless sensor networks composed of multiple isolated monitoring areas. In this network environment, how to collect data from the sensor network to reduce the overall energy consumption of the network and how to plan the UAV to optimize the data collection path of the separated monitoring area are problems worthy of study. These are also the focus of this paper.

2.2.
Typical UAV Path Planning Method. Typical UAV path planning methods are mainly divided into two categories: classic UAV path planning methods and UAV path planning methods based on intelligent algorithms. The classic 2 Wireless Communications and Mobile Computing UAV path planning methods mainly include A-star algorithm, cell decomposition method, and artificial potential field method. UAV path planning methods based on intelligent algorithms mainly include genetic algorithm, particle swam optimization, and wolf colony algorithm. The A-star algorithm is a direct search algorithm for planning the shortest flight path of UAVs in static state. At the same time, the A-star algorithm is one of the heuristic algorithms [15]. Its basic algorithm idea is to use the heuristic function to evaluate some candidate nodes and select the node with the best condition as the next node on the path. This is a purposeful search method that effectively avoids blind searches. The A-star algorithm can achieve faster calculation speed when the path matrix is small and efficiently obtain the UAV path information that needs path planning. However, when the number of paths increases sharply, its running time also increases accordingly, which is not suitable for path planning problems in dynamic states.
The artificial potential field path planning is a method that uses virtual forces in the environment to assist path planning. The basic idea of this algorithm is to abstract the movement process of the UAV in the environment as a movement process of the UAV under the virtual artificial potential field. The target point to be reached by the UAV is a gravitational field for it, and the obstacles in the path are a repulsive field for it. Under the combined action of the gravitational field and the repulsive field, the UAV starts from the starting point, avoids obstacles, and finally reaches the destination node. Generally speaking, the path generated by using the artificial potential field to plan the UAV's path is smooth and safe, but this method has the problem of generating local optimal solutions, and there are certain human factors in the design of the repulsion field and the gravitational field. When there are obstacles near the target node, the UAV may not be able to reach the target node, which also limits the development of artificial potential field.
Particle swarm optimization is a kind of evolutionary algorithm. It simulates a predation behaviour of a flock of birds randomly searching for food, without requiring any leader. In Particle swarm optimization, the potential solution of each UAV optimization problem can be abstracted as a "particle" in the search space, that is, a bird. "Particles" follow the current optimal "particles" to search in the solution space. These "particles" are initially some random solutions, and the optimal solution is found after many iterations of optimization. Particle swarm optimization is widely used in the field of UAV path planning. It has good convergence and path optimization capabilities and is suitable for the optimization of continuous problems. However, the algorithm may get trapped in local optimal solutions and cannot handle optimization problems in discrete cases well.
Wolf colony algorithm is an algorithm based on the swarm intelligence of wolves. The algorithm simulates the predation behaviour of wolves and how wolves distribute their prey. The main body of the wolf colony algorithm is composed of three intelligent behaviours: wandering, calling, and besieging. The algorithm's method of generating the head wolf uses the "winner is king" rule, while the algorithm's method of updating the wolf colony uses the "stron-ger survival" mechanism. In solving the problem of UAV path planning, the wolf colony algorithm improves the probability of obtaining the optimal solution of UAV path planning in a limited time to a certain extent and reduces the understanding space. Although it can deal with simple UAV path planning problems and realize UAV path planning in a continuous environment, it cannot realize path planning in a discrete environment, and the iteration convergence speed is slow.
Reinforcement learning is a new algorithm based on learning. In recent years, reinforcement learning has been widely used. Chen et al. [16] applied reinforcement learning to the Internet of Vehicles and proposed an online deep reinforcement learning scheme. Each mobile user only made use of local information to make decisions such as channel auction, computational task unloading, and input packet scheduling, so as to optimize task unloading of the airground integrated multiaccess edge computing (MEC) system. Reinforcement learning has also been applied in path planning. In order to reduce communication delay between vehicles, Wu et al. [17] proposed a multichannel vehicle edge computing routing scheme based on cooperative learning to solve the communication path selection problem in multichannel vehicle environment. Tong et al. [18] modelled the UAV-assisted data collection problem as a limited range Markov decision process with limited state and action space and developed a deep reinforcement learning algorithm to find the asymptotically optimal strategy. The introduction of reinforcement learning breaks the previous idea of using intelligent algorithm to optimize the path and provides a new method for path planning. Therefore, we can consider future work and design reinforcement learning algorithm for our own application scenarios to optimize the flight path of UAV.

System Model
Edge computing refers to an open platform that integrates network, computing, storage, and application core capabilities to provide the nearest end service on one side of the object or data source. Edge computing provides faster services and is used to enforce business, security, and privacy. Introducing the idea of edge computing in the data collection process of distributed sensor networks can greatly improve the efficiency of data collection.
In a distributed sensor network environmental data monitoring and collection task which has multiple partitioned monitoring areas, multiple sensor nodes in each monitoring area are responsible for environmental data sensing. The sensor node transmits the environmental data to the cluster head node through single-hop transmission or multihop transmission. After that, the cluster head node aggregates and fuses the data of each sensor node. Starting from the data center, the UAV uses a "store-carry-forward" method according to a certain path planning method to collect data from the cluster head nodes in each partitioned area. The UAV returns the collected data to the data center for transmission and processing. The application scenario of sensor network data collection system is shown in Figure 1. The entities in the system and their functions are described as follows:

Wireless Communications and Mobile Computing
Sensor Node (SN). The sensor node is used to collect the sensing data in the environmental monitoring area, such as temperature, humidity, light intensity, and the acid, alkali, and salt concentration in the soil, etc. The sensor node periodically sends the sensed environmental data to the cluster head node and at the same time transmits its own remaining energy information to the cluster head node. Relay Node (RN). Due to the limited communication distance of the sensor node, when the Euclidean distance between the sensor node and the cluster head node is greater than the communication distance, the relay node is responsible for relaying the transmitted data. The relay node can replace an unreachable link with multiple links of better quality to obtain better network coverage. Cluster Head Node (Cluster Head, CH). The cluster head node converges and fuses the data information collected by the sensors in the cluster. At the same time, the cluster head node is responsible for interacting with the UAV, transmitting the collected sensing data to the UAV, and receiving control information from the UAV. Data Center. The data center gathers the environmental monitoring data collected by UAV from each partitioned monitoring area and performs data processing.
By delegating computing and processing tasks to sensor nodes and UAV nodes, many controls will be achieved through local equipment without having to hand over to the data center in the cloud. The processing process is completed at the local edge layer, which greatly improves pro-cessing efficiency. This way, because it is closer to the terminal, the demand can be solved at the edge.
The whole system model can be divided into two parts: data collection of sensor network based on UAV and UAV path planning based on improved ACO. Between them, the data collection of UAV-based sensor network is divided into two cases: single-hop transmission and multihop transmission, according to the relationship between communication distance and transmission distance.
The system model is based on the following premise assumptions. (1) The position coordinates of each sensor node are fixed and the initial energy is known. (2) The UAV stores the mapping relationship information between the identity document (ID) of the sensor node and its location coordinates.

Data Collection of UAV-Based
Sensor Network

Sensor Clustering and Cluster Head Election in the Initial
State. Abstract each area in the partitioned environmental monitoring area. Assume that each monitoring area is a rectangle with length A and width B. N sensor nodes are randomly distributed, as shown in Figure 2. The communication distance of each sensor node is R. The sensor node transmits the sensed data to the cluster head node of its own cluster. The cluster head node performs data fusion on the collected  Wireless Communications and Mobile Computing sensed data, waits for the arrival of the UAV, and interacts with the UAV. Then, the data is transferred to the data center. For each separated environmental monitoring area, when the coverage of the monitoring area exceeds the communication range of the sensor node, two ways can be used to realize the communication between sensor nodes. (1) Divide a large area so that the range of each divided area will not exceed the communication range of sensor nodes, thereby ensuring single-hop transmission between sensor nodes. (2) Sensor nodes use multihop transmission to transmit data to other nodes through relay nodes.
First discuss the first case, that is, clustering a larger network, so that each sensor node can communicate with all other nodes in the cluster. The cluster number Num of sensor nodes is calculated according to Equations (1) and (2). Num takes an integer value in the interval ½Num1, Num2.
where Num1 is the smallest value of the number of sensor node clusters in the environmental monitoring area, Num2 is the largest value of the number of sensor node clusters in the environmental monitoring area, Area is the area of the environmental monitoring area, and R is the communication distance of the sensor nodes. The environmental monitoring area can be of any shape. In order to simplify the description, a regular shape is selected for illustration. The basic idea of calculating the number of clusters of sensor nodes in a regular shape area or an irregular shape area is the same.
Because the main factor affecting the energy consumption of sensor nodes is transmission distance, the distance is evaluated as a similarity. Compared to the K-means algorithm, the K-means++ algorithm significantly reduces the error of classification results. So, we use the K-means++ algorithm to cluster the nodes in the sensor network.
In the initial state, by using the K-means++ algorithm, the clustering of randomly distributed sensor nodes in the environmental monitoring area is completed, and the initial cluster head nodes are elected. The initial cluster head node broadcasts its own node information in the cluster and uses time division multiple access (TDMA) [19] to allocate transmission time slots for the data collection of other sensor nodes in the cluster. During each round of data collection, the normal sensor nodes in each cluster use allocated time slots to transmit the sensing environmental data to the cluster head node and declare their remaining energy information. The data packet contains the remaining energy information of the node and the environmental monitoring data collected by the node in this round. The data packet format is shown in Figure 3. After the cluster head node obtains the remaining energy information of all nodes in the cluster, it forms the remaining energy matrix for the current round of transmission.

UAV-Assisted Cluster Head Election and Data
Collection in a Single-Hop Scenario. In the process of UAV-assisted sensor network data collection, each sensor node is fixed in the environmental monitoring area. Therefore, the relative distance value of each sensor node in the cluster is calculated using where Dis½i represents the intracluster distance relationship of the i-th node in each cluster, n i and n j represent the i-th node and the j-th node, C k represents the k-th cluster, dðn i , n j Þ represents the Euclidean distance between the current node and all nodes in the cluster, jC k j represents the total number of the nodes in the k-th cluster, and d max represents the maximum Euclidean distance between the current node and other nodes in the cluster. dðn i , n j Þ is calculated according to where the coordinate of node n i is ðx a , y a , z a Þ and the coor- In an environmental monitoring region, the position of each sensor node is fixed. Then after clustering in an initial state, the cluster of the node is fixed. Therefore, UAV only needs to calculate the relative distance of each sensor node once, which greatly reduces the calculation burden of the UAV.
During each round of data collection, the cluster head node collects and fuses the collection data of each node in the cluster and transmits the remaining energy information of each node in the cluster to the UAV. The UAV calculates the relative residual energy value of each node in each cluster according to where E r,C k ðn i Þ represents the remaining energy of the i-th node in the k-th cluster during the r-th round of data transmission, E r,C k ðmaxÞ represents the maximum remaining 5 Wireless Communications and Mobile Computing energy of the node in the k-th cluster during the r-th round of data transmission, i is an integer value in the interval ½1, q , and q is the total number of nodes in the current cluster.
Since the goal is to select the node with the smallest relative distance from other nodes in the cluster and the largest relative residual energy as possible as the new cluster head node in the next round, therefore, the UAV is used to calculate the priority of each node to be elected as the cluster head in each cluster according to the Equation (6) and save it in Pri½i.
where i is an integer value in the interval ½1, q and q is the total number of nodes in the current cluster.
If there is a node in the cluster that has never been elected as a cluster head in the previous 1/p (p is the proportion of cluster heads to all sensor nodes), its priority is added to the original basis by u (u ≥ 1, and u is an integer). That is to say, in the next round, a node that has not been elected as a cluster head for a long time and has a relatively small relative distance from other nodes and a relatively large residual energy has a greater probability of becoming a new cluster head node. The equation is described in When there is a node with a remaining energy value of 0 in the cluster, the priority value of the node is permanently set to −u (u ≥ 1, and u is an integer), as shown in Through the above method, the UAV calculates the priority of each node in the sensor network to be elected as the cluster head in the next round and forms a priority matrix. The node corresponding to the item with the largest element value in the priority matrix becomes the cluster head node elected in the next round. The priority matrix Total Pri formed by all clusters in the UAV is shown in : ð9Þ Among them, each column in the matrix represents the priority of each node in each cluster to be elected as the cluster head in the next round. There are k columns in total, representing k clusters. For clusters with fewer nodes, add several zeros at the end of the column.
UAV will use the identification number of the cluster head node in the next round as the control information to transmit to the current cluster head node. The current cluster head node broadcasts the information of the cluster head node in the next round in the cluster. The new cluster head node uses TDMA to allocate data transmission time slots for each node in the cluster. During the next round of data collection, the normal node will transmit the remaining energy information and data information to the new cluster head by the allocated time slot.
In this way, the UAV flies to each cluster head node to perform the task of collecting environmental monitoring data information, and the data information collected from each cluster head node is transmitted to the data center through the "store-carry-forward" DTN data transmission mode. The data center analyses, processes, and predicts the collected environmental monitoring data to complete a round of sensor network data collection tasks.

UAV-Assisted Data Collection in a Multihop Scenario.
When the clustering range of each environmental monitoring area is greater than the communication range of the sensor node, that is, for the second case, the nodes outside the communication range need to use multihop transmission, and the communication with the cluster head node is completed by selecting the relay node.
First, use the same method as the previous method to perform the clustering of sensor nodes and the election of cluster heads under the initial conditions. After that, the same UAV-assisted cluster head election method is used to elect the cluster head nodes of each environmental monitoring area in the next round. The UAV uses a "store-carryforward" approach to collect data from each cluster head node and passes it to the data center for processing. Next, the selection method of the relay node and the corresponding routing process are mainly explained. The model of data transmission using relay nodes is shown in Figure 4.
In the illustrated transmission model, during a round of data collection, nodes are mainly divided into three categories: cluster head nodes, relay nodes, and ordinary sensor nodes. Among them, the cluster head node is responsible for collecting the data sensed by noncluster head nodes in the cluster, performing data fusion, and then interacts with the UAV node. The relay node is selected from the set of candidate relay nodes and is responsible for relaying the data Wireless Communications and Mobile Computing of sensor nodes that cannot directly reach the cluster head node. The relay node also completing its own data sensing task. The ordinary sensor node mainly completes the basic environmental data sensing task. In the above figure, θ is the angle in the middle of the connection between the candidate relay node and the ordinary sensor node and the connection between the ordinary sensor node and the cluster head node. In the entire sensor network, the positions of all nodes are fixed. Therefore, it is assumed that after the initial state clustering is completed, each sensor node forms a mapping table of the distance between each node in the cluster and other nodes in the cluster.
Since ID and coordinates of each node in each cluster are known and they have a one-to-one correspondence, after the cluster head node broadcasts the next round of cluster head messages, the ordinary sensor node that needs to transmit data first obtains the distance between it and the cluster head node by querying the node distance mapping table. When the distance is less than the communication distance of an ordinary sensor node, the ordinary sensor node transfers the collected data to the cluster head node by direct delivery. When the distance is greater than the communication distance of an ordinary sensor node, the ordinary sensor node selects a relay node according to the method described below.
Assume that the position distribution relationship of cluster head node, candidate relay node, and ordinary sensor node is shown in Figure 5.
According to geometric knowledge, the calculation method of the included angle θ is shown in where d1 is the distance between the cluster head node and the candidate relay node, d2 is the distance between the candidate relay node and the ordinary sensor node, and d3 is the distance between the ordinary sensor node and the cluster head node. If the ordinary sensor node cannot directly transmit the data to the cluster head node, the nodes within the one-hop communication range of the ordinary sensor node are classified and stored in different sets. The classification method is based on the above-mentioned included angle θ, and nodes meeting different conditions will be divided into different sets.
Since the goal is to transfer data in the direction closer to the cluster head node, for nodes within the communication range of ordinary sensor nodes, nodes within the range of θ ∈ ½π/2, π are stored in the invalid set. The nodes in this set will never be selected. Next, divide the nodes in the range of θ ∈ ½0, π/2Þ into three sets. The Pri1 set stores the nodes in the range of θ ∈ ½0, π/6Þ. The Pri2 set stores the nodes in the range of θ ∈ ½π/6, π/3Þ. The Pri3 set stores the nodes in the range of θ ∈ ½π/3, π/2Þ. The priority relationship of the nodes is Pri1 > Pri2 > Pri3. Then, calculate the priority of each candidate relay node in the Pri1, Pri2, and Pri3, as shown in where Pri s ði, jÞ represents the priority function for the i-th ordinary sensor node in the cluster to select the j-th candidate relay node in the range of the set s for relaying. The set s is one of Pri1, Pri2, and Pri3. λ is the weight coefficient, and λ ∈ ð0, 1Þ. θ is the angle in the middle of the connection between the candidate relay node and the ordinary sensor node, and the connection between the ordinary sensor node and the cluster head node. The larger the value of ðπ/2Þ − θ, 7 Wireless Communications and Mobile Computing the closer the position of the candidate relay node is to the direction of the cluster head node within the range of the candidate set. d ij is the Euclidean distance between node i and node j. In order to reduce the number of hops from the ordinary sensor node to the cluster head node as much as possible, data should be transmitted to the candidate relay node closest to the cluster head node and farthest within the communication distance of the node. That is, a candidate relay node with a larger priority function value is more likely to become the final relay node.
Next, perform energy discrimination on the candidate relay node j with the largest priority function value Pri s ði, j Þ. When the remaining energy of node j is greater than the average remaining energy of all nodes in the set Pri1, Pri2, and Pri3, the candidate relay node becomes the final relay node. Otherwise, the node with the second priority function value is judged. By analogy, the energy discrimination method of nodes is shown in where Flag½j is the flag bit for whether node j is elected. If its value is greater than 1, node j is elected as the final relay node. E residual ½j is the remaining energy value of the current candidate relay node j, and E avg is the average remaining energy of all nodes in the set Pri1, Pri2, and Pri3. If there is no node in the set Pri1 that meets the requirements, the nodes in the set Pri2 are judged. If there is no node in the set Pri2 that meets the requirements, the nodes in the set P ri3 are judged until a suitable relay node is selected. If there is no suitable relay node for relaying, the ordinary sensor node is marked as unreachable.
If the data transmission range of the optimal relay node still cannot transmit data to the cluster head node, continue to select the next hop relay node for relay transmission according to the above method. If within the specified number of hops, the data still cannot be transmitted to the cluster head node, the ordinary sensor node is marked as unreachable.

Energy Consumption Model of Wireless Sensor Networks.
Since the energy consumption of nodes in a wireless sensor networks is mainly composed of transmission energy consumption and receiving energy consumption, in the process of data transmission and data reception of sensor nodes, for short-distance transmission, the free space model is adopted, and for long-distance transmission, the multipath fading model is adopted [20]. The wireless transmission model is shown in Figure 6.
For the symmetric propagation channel, the energy consumption when the sensor node transmits k bits data in the data packet to d meters away is shown in [21] The energy consumption of sensor nodes receiving k bits data is calculated according to where E Tx ðk, dÞ is the data sending energy consumption, E Rx ðkÞ is the data reception energy consumption, E ele is the energy consumption per bit of the transmitter or receiver, E f s is the free space model parameter, and E mp is the multipath fading model parameter.

Wireless Communications and Mobile Computing
The data fusion energy consumption of sensor nodes for k bits data is shown in where E F ðkÞ is the energy consumption of data fusion and E da is the energy consumption parameter of data fusion.

UAV Path Planning Based on Improved ACO
When there are multiple separated environmental monitoring areas, these different monitoring areas have different area and different number of sensor nodes, as shown in Figure 1 in Chapter 3. How to make the UAV start from the data center, use the new cluster head node information obtained in the previous round, use appropriate algorithms, follow the preplanned path to collect data from the cluster head nodes in each monitoring area, and transfer the collected environmental data to the data center is an important issue. This problem can be simplified to a traveling salesman problem (TSP) with a fixed starting point and ending point [22]. The TSP problem is one of the most well-known prob-lems in the field of mathematics. It can be described as follows: suppose a UAV starts from the data center and needs to fly to N sensor cluster head nodes for data collection. It must plan the flight path. The restriction is that each cluster head node can only be passed once and finally needs to return to the data center to submit sensing data. The goal of selecting the flight path is to require the resulting flight path to be the minimum of all paths. The TSP problem is an NP-hard problem with the computational complexity of NPC. Next, the research focus of this chapter will be put forward: UAV path planning method based on improved ant colony optimization.
For solving the task of UAV starting from a fixed data center, collecting sensing data from the cluster head nodes that in the separated environmental monitoring area in turn, and returning the collected data to the data center, this section uses an improved ACO to obtain a better approximate optimal solution. Introducing the simulated annealing algorithm with dynamic simulated annealing probability coefficient and tempering algorithm to further optimize the UAV's data collection path.
The algorithm process of the improved ACO is as follows. Obtain the optimal path and shortest path value

Wireless Communications and Mobile Computing
Step 1. Initialize ant pheromone and heuristic value. Initialize the pheromone value of each edge in the UAV data collection path and the taboo table of each ant. The pheromone value on each edge is initialized to a smaller value r 0 . The taboo table of each ant is used to record the sensor cluster head nodes that the ant has walked so far. Initialize the taboo table of each ant as the sensor cluster head node where the ant is currently located, and set the length of the taboo table to a. In the initial state, the pheromone value released by the ant on each edge is 0.
Step 2. Introduce the simulated annealing to iterate to construct the flight path of UAV. At the temperature T of the simulated annealing algorithm, perform an ant search. Ant k determines the sensor cluster head node to be reached in the next step according to the probability p k ij ðtÞ, until it finally forms a legal UAV data collection path. Among them, the cluster head nodes that have passed are recorded in the taboo table. These nodes recorded in the taboo table cannot be included in the cluster head nodes that the ant will reach in the future. The calculation method of probability p k ij ðtÞ is shown in where p k ij ðtÞ is the selection probability of ant k moving from cluster head node i to cluster head node j in the t-th iteration and α is the pheromone factor. The larger the value of α, the greater the influence factor of the pheromone in the selection probability of the cluster head node. β is the heuristic value factor. The larger the value of β, the greater the influence factor of the heuristic value in the selection probability of the cluster head node. a k represents the cluster head node set that is not restricted by the taboo table. τ ij ðtÞ represents the pheromone on the edge ði, jÞ of the ant in the t-th iteration, and η ij ðtÞ represents the heuristic value for the ant to 1. Initialize pheromone and heuristic value; 2. Initialize the taboo table of ants; 3. Introduce Simulated Annealing iteration; 4. Execute ant search algorithm; 5. Set the starting node of the ant search algorithm; 6. Calculate the cluster head node to be reached next; 7. If Path update is not complete then 8.
Return to step 5 and continue to execute; 9. Else 10.
If Ant search is not complete then 11.
Return to step 4 and continue to execute; 12.
Calculate the shortest path objective function value; 14.
If Better than the value at the previous temperature then 15.
Update path and shortest path value; 16.
If the tempering conditions are met then 18.
If the Simulated Annealing iteration is completed then 21.
Obtain the optimal path and shortest path value; move from the cluster head node i to the cluster head node j in the t-th iteration. This value is usually the reciprocal of the distance d ij between cluster head node i and cluster head node j. S are the cluster head nodes that are not restricted by the taboo table. With the constraint of Equation (18), the ant will not pass through the cluster head node again, thus ensuring that the UAV will not repeatedly pass the same cluster head node during the data collection process.
Step 3. Obtain the shortest flight path of the UAV in the t-th iteration. After the t-th iteration, each ant has completed a tour through each cluster head node. Calculate the length of the path travelled by each ant, and save the shortest path travelled, thereby obtaining the objective function value. Compare the newly obtained shortest path value with the original shortest path value (the shortest path value generated by the first iteration process is not compared, and the result of the next iteration is waited for). If the newly obtained shortest path value is better than the shortest path value at the last temperature, then directly update the UAV flight path and shortest path value. Then, follow Step 4 to update the pheromone on each edge. If the newly obtained UAV flight shortest path value is not better than the shortest where ω current is the dynamic simulated annealing probability coefficient of the current iteration number, ω max is the maximum dynamic simulated annealing probability coefficient, ω min is the minimum dynamic simulated annealing probability coefficient, t current is the current iteration number, and t max is the maximum iteration number. Then, the Metropolis acceptance criterion [23] is used to calculate the probability P current of introducing the dynamic simulated annealing probability coefficient at the current temperature T current to decide whether to accept the new path. The probability P current at temperature T current is calculated according to

Wireless Communications and Mobile Computing
where dE is the difference between the shortest path objective function value of this iteration and the shortest path objective function value of the previous iteration, k is the coefficient, and T current is the current temperature value.
Randomly generate a random number a 0 in the ð0, 1Þ interval. If a 0 ≤ P current , accept this solution, update the UAV flight path, and update the shortest path value. Otherwise, discard the solution generated in this iteration. From   (20), it can be concluded that as the iteration progresses, the temperature T is continuously reduced due to the effect of the cooling coefficient, and the value of ω current continues to decrease with the increase of the number of iterations. Therefore, the value of the probability P current is continuously reduced. That is, the probability of accepting a poor solution is constantly decreasing, similar to the annealing crystallization process of crystals in nature.
Step 4. Update the pheromone value. The update of the pheromone on each edge of the path includes the volatilization of the pheromone due to the passage of time and the newly produced pheromone released by the ants when they passed by. Pheromone is updated according to the rules shown in where τ ij ðt + 1Þ is the pheromone on the edge ði, jÞ at the ðt + 1Þ-th iteration and τ ij ðtÞ is the pheromone on the edge ði, jÞ at the t-th iteration. ρ is the pheromone volatilization factor, and ρ ∈ ð0, 1. 1-ρ is the pheromone maintenance factor. k is the k-th ant. m is the total number of ants. Δτ k ij ðt, t + 1Þ is the pheromone released by the k-th ant on the edge ði, jÞ when it passes during the t-th iteration. Δτ k ij ðt, t + 1Þ is calculated according to the method shown in where Q is the pheromone enhancement factor, l k is the length of the path constructed by the k-th ant, and μ is the coefficient. The smaller the path length l k , the Equation (22) shows that the higher the pheromone content on each edge of the path, and the greater the probability of being selected by other ants. After all ants complete the pheromone update operation, save and record the shortest path of current UAV data col-lection. Then, initialize the taboo table and pheromone increment.
Step 5. Judgement of tempering conditions. After the pheromone released by the ants on each edge is updated, it is checked whether the tempering conditions are met, so as to decide whether to perform the tempering operation. Whenever the temperature T during the simulated annealing operation is less than or equal to the minimum value of the tempering temperature T min tempering , and the current tempering times H current has not reached the set maximum upper limit of the tempering times H max , use Equation (23) for tempering operation.
where T current is the current temperature value and T max tempering is the highest temperature value of the tempering temperature. According to the above operation, at most H max tempering operations are performed, the objective function value is more optimized. Finally, use the cooling coefficient to update the temperature value, and the update method is shown in where Tðt + 1Þ is the temperature after the update, TðtÞ is the temperature before the update, and q cooling is the cooling coefficient.
Repeat the execution from Step 2 and loop in turn until the termination condition of the improved ACO is met. The final optimal path and shortest path value are output. The execution process of the improved ACO is shown in Figure 7 and Algorithm 1.
The improved ACO is implemented in the UAV node to realize edge computing. Before the next round of data collection tasks arrive, the UAV plans the data collection path through the new cluster head node ID and coordinate value calculated by itself in the previous round. The UAV collects sensor network data according to the data collection path planned in advance. Among them, when the UAV performs the first data collection task, it uses the cluster head node ID and coordinate values obtained by the initial clustering to plan the path, and can ignore the influence of other factors.

Simulation Experiment and Result Analysis
This chapter uses MATLAB R2019a to perform simulation experiments to analyse the performance of the solutions proposed and discussed above.
Dead nodes refer to the nodes whose remaining energy is not enough to continue to complete the data collection task of the sensor network. Figures 8-11 show the first rounds of 10% of the nodes die, 30% of the nodes die, half of the nodes die, and all of the nodes die in the sensor network under LEACH [24], Fuzzy [25], KM-CF [26], and DCSD-single scheme proposed in this paper which is suitable for singlehop scenarios. In a sensor network, the number of rounds in which 10% of the nodes die, 30% of the nodes die, half of the nodes die, and all of the nodes die for the first time is an important performance evaluation index for the life cycle of the sensor network. As can be seen from the figure, compared with the other three schemes, the scheme proposed in this paper delays the first occurrence of the death of 10% nodes, the death of 30% nodes, the death of half nodes, and the death of all nodes and has better performance. As mentioned earlier, for scenarios with a large network range, the UAV-assisted sensor data collection method pro-posed in this paper for single-hop scenarios can be used to divide an appropriate number of clusters. This method makes the distance between the sensor node and the cluster head node less than or equal to the communication distance of the node to complete the single-hop transmission between the sensor node and the cluster head node, which is the DCSD-single scheme. Or use the UAV-assisted sensor network data collection method proposed in this paper for multihop scenarios. Select a suitable relay node as a transmission relay, and solve the unreachable problem caused by the  15 Wireless Communications and Mobile Computing distance between the sensor node and the cluster head node being larger than the node communication distance. It is the DCSD-multi scheme.
The experimental scene is expanded. The DCSD-single scheme in the single-hop scenario and the DCSD-multi scheme in the multihop scenario are compared and tested in a 400 m * 400 m monitoring area with 200 sensor nodes randomly distributed. Among them, in order to make multihop transmission occur, appropriately expand the range of each cluster in the DCSD-multi scheme in the multihop transmission scenario, that is, reduce the number of cluster head nodes in the network.
Because the flying height of the UAV will affect the distance between nodes, it will affect the energy consumption of information transmission. Therefore, the following comparative experiment considered the influence of the UAV's flight height on the experimental results. Figures 12 and 13 show that when the number of cluster head nodes in the DCSD-single scheme is 16 and the number of cluster head nodes in the DCSD-multi scheme are 12 and 8, the comparison graph of 10% of the nodes die, 30% of the nodes die, half of the nodes die, and all of the nodes die for the first time and the comparison graph of the network life cycle with the UAV flight altitude change.

16
Wireless Communications and Mobile Computing Figure 13 shows the impact of UAV flight height on the performance of various schemes. As the flying height of the UAV increases, the cluster head node needs more transmission power to transmit data to the UAV node, which leads to an increase in the energy consumption of the cluster head node and reduces the life cycle of the network. Therefore, when the UAV is actually used to assist the sensor network for data collection, under the premise of ensuring safety, reducing the flying height of the UAV to a certain extent can delay the death time of the sensor nodes in the environmental monitoring area.
This chapter uses MATLAB R2019a to plan the UAV data collection path. Assume that there are five environmental monitoring areas separated from each other due to geographical environmental factors, which form a distributed wireless sensor networks through the flight transmission of UAV. According to the method of "store-carry-forward," starting from the data center, the UAV collects data from the cluster head nodes in each separated environmental monitoring area through the designated algorithm, and then according to the planned optimal path, the UAV finally transmits the data to the data center. In most ecological environmental monitoring scenarios, sensor nodes are deployed on the ground, so the height of each sensor node is ignored, and the network scenario is simplified to a two-dimensional coordinate plane. This scene has a data center and five separated sensor network environmental monitoring areas.
The algorithm evaluation indicators in this chapter mainly include the total path length of UAV data collection, the minimum number of iterations required for each algorithm to reach the shortest path, and the convergence speed of each algorithm. Suppose the data center coordinates are (500, 1000), the range of sensor network 1 is 300 m * 300 m, and the number of nodes is 100. The range of sensor network 2 and sensor network 3 is 250 m * 250 m, respectively, and the number of nodes is 70, respectively. The range of sensor network 4 and sensor network 5 is 150 m * 150 m, respectively, and the number of nodes is 50, respectively. According to the cluster head election method described in Chapter 4, the coordinates of the sensor cluster head nodes in each monitoring area can be obtained during a certain round of data collection. The simulation experiment parameter settings of the improved ACO are shown in Table 1.
This chapter conducts simulation experiments on four intelligent algorithms. The node numbered 1 shown by the five-pointed star logo represents the data center. The cluster head nodes elected in each partitioned environmental monitoring area are represented by number 2-31, respectively. The coordinate of the data center and the coordinate information of the cluster head nodes elected in each partitioned sensor network are shown in Table 2. Figures 14-17 show the results of using four algorithms for UAV data collection path planning, respectively. Figures 14-17 show the optimal flight path for UAV path planning using four algorithms, respectively. Among them, 1 is the data center, which is the starting point and end point of the UAV data collection process. Nodes 2-31 are cluster head nodes distributed in each partition monitoring area.
The comparison of the number of iterations and the shortest path length of the ant colony optimization,  17 Wireless Communications and Mobile Computing simulated annealing, genetic algorithm, and improved ACO to achieve convergence is shown in Table 3.
The comparison of the iterative curves of the four algorithms to reach the shortest path of UAV data collection is shown in Figure 18. It can be seen from the figure that in the experimental scenario proposed in this chapter, the quality of the solution is poor in the initial search execution stage of the simulated annealing and the convergence speed of the algorithm is slow when it reaches the shortest path. The genetic algorithm also has the problem of low solution quality in the initial search execution stage, and the convergence speed is slow when it reaches the shortest path. However, compared with simulated annealing, genetic algorithm greatly reduces the shortest path length. In comparison, the ant colony optimization and the improved ACO can obtain higher-quality solutions in a limited number of iterations; that is, they can converge to the shortest flight path of the UAV faster. Using the improved ACO to plan the UAV data collection path can get a better shortest path length and can get the convergent shortest path result at the fastest speed.

Conclusion and Outlook
This paper studies the data collection method of sensor network based on UAV and introduces the idea of edge computing into it. Distributed wireless sensor networks separated from each other are assisted by UAV technology for clustering and cluster head elections, which reduces the overall energy consumption of the distributed sensor network. Then, the improved ant colony optimization is used to plan the UAV data collection path. Through the "store-carry-forward" method, the UAV takes the shortest path to carry the sensed data and transmits it to the data center.
In future work, we will consider the use of UAVs to charge and collect data in the sensor network, consider the impact of different sensor node distribution patterns on the performance of the sensor network, and consider multi-UAVs to coordinate the data collection of the sensor network to further improve the efficiency of data collection to serve a wider monitoring area and complete the corresponding environmental monitoring tasks.
In addition, it is considered that the intelligent algorithm (improved ACO) can be changed into a reinforcement learning algorithm, and a reinforcement learning algorithm that conforms to its own scene can be set, so that the UAV can plan the optimal path by itself, thus improving the data collection efficiency of the sensor network.

Data Availability
The experimental data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors declare that there is no conflict of interest regarding the publication of this paper.

Acknowledgments
This work was supported by the National Natural Science Foundation of China (62077032), the Inner Mongolia Natural