Wireless sensor network data acquisition method and system based on drone

By constructing covariance matrices and sparse transformation matrices, clustering and compressing data, combined with optimal path planning of UAVs, the problem of energy depletion of sensor nodes and data transmission delays is solved, and fast and low-energy data transmission in wireless sensor networks is achieved. consumption acquisition and accurate recovery.

CN117896691BActive Publication Date: 2024-10-01YANTAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410116834.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2024-10-01
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

Energy exhaustion of sensor nodes leads to disconnection of wireless sensor networks. Traditional data collection methods increase energy consumption and have large data transmission delays in wide areas or when there are obstacles. How to use drones to achieve efficient data collection is still a challenge.

Method used

By collecting historical data of sensor nodes, constructing covariance matrices and sparse transformation matrices, performing data compression and clustering, using drones for optimal path planning and data collection, and combining the Transformer model with reinforcement learning to optimize paths and reduce the amount of data transmission. and number of flights.

Benefits of technology

It achieves rapid collection of sensor node data, reduces data transmission energy consumption, extends network life, and accurately restores data through sparse matrix reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117896691B_ABST
    Figure CN117896691B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of wireless sensor networks, and in particular to a wireless sensor network data collection method and system based on an unmanned aerial vehicle. The method comprises the following steps: collecting historical data of all sensor nodes at the same time as samples to obtain a sparse transformation matrix; compressing sample data of a number of sensor nodes to obtain a measurement vector, and reconstructing the sample data through the measurement vector; clustering all sensor nodes and determining a cluster head of each cluster; setting the unmanned aerial vehicle to take a sink node as a starting point and an end point and each cluster head as a stop point to perform optimal path planning; collecting data of each cluster head based on the planned optimal path to obtain a measurement vector; updating the cluster head, and collecting data of each updated cluster head until the sink node obtains the measurement vectors of all sensor nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wireless sensor networks, and in particular to a wireless sensor network data collection method and system based on an unmanned aerial vehicle. Background Art

[0002] Wireless sensor networks are composed of a large number of micro sensor nodes and a sink node, which form a multi-hop self-organizing network through wireless communication. Due to its advantages such as simple deployment, low cost and strong scalability, wireless sensor networks have broad application prospects in environmental monitoring, intelligent transportation and medical care.

[0003] Sensor nodes periodically collect data within the network monitoring area. However, due to the battery power supply capacity, their computing and communication capabilities are limited. If traditional methods are used for data collection, the data of the sensor nodes is transmitted to the sink node through single-hop or multi-hop wireless communication, which increases the amount of data forwarded by the sensor nodes around the sink node, resulting in increased energy consumption. Once the energy of these sensor nodes is exhausted, the network will become disconnected, affecting the life of the entire network.

[0004] To solve this problem, domestic and foreign scholars have studied data collection methods based on ground mobile data collectors. This method uses mobile data collectors to send data from a single sensor node or fuse the data of multiple sensor nodes to a sink node, thereby reducing communication overhead and network congestion. When the distribution range of sensor nodes is wide or there are obstacles in the monitoring area, the collector may not be able to communicate with some sensor nodes, resulting in packet loss and large data transmission delays. Compared with ground mobile data collectors, drones are not restricted by geographical location and terrain, and can quickly fly to designated locations to collect data, reducing the time required for data collection. However, the onboard energy of drones is limited. How to use drones to achieve efficient data collection is still a key problem that needs to be solved in wireless sensor networks. Summary of the invention

[0005] To solve the above problems, the first aspect of the present invention provides a wireless sensor network data collection method based on an unmanned aerial vehicle, comprising:

[0006] S1, collect the historical data of all sensor nodes in the network at the same time as sample data, build a covariance matrix based on the sample data, and perform eigenvalue decomposition to obtain a sparse transformation matrix and numerical sparsity;

[0007] S2, compressing the sample data of several sensor nodes to obtain a measurement vector, reconstructing the sample data through the measurement vector, and if the reconstructed data is equal to the sample data, determining the minimum number of measurements corresponding to the number of sensor nodes according to the numerical sparsity and the number of sensor nodes;

[0008] S3, clustering all sensor nodes and determining the cluster head of each cluster, wherein the minimum number of clusters is equal to the minimum number of measurements, and the minimum number of measurements is the minimum number of acquisitions for a single flight of the UAV;

[0009] S4, set the data collection path of the UAV with the aggregation node as the starting point, each cluster head as the stop point, and the aggregation node as the end point, and perform optimal path planning;

[0010] S5. Collect data from each cluster head based on the planned optimal path, obtain a measurement vector, and return it to the sink node; update the cluster head, and collect the updated data from each cluster head until the sink node obtains the measurement vectors of all sensor nodes.

[0011] The method further comprises the step of obtaining a sparse measurement matrix by a converging node through a measurement vector, and reconstructing data of each sensor node through the sparse measurement matrix and a sparse transformation matrix.

[0012] The sparse transformation matrix is ​​constructed by using sample data and remains unchanged; the sparse measurement matrix is ​​constructed according to the numbers of the sensor nodes corresponding to the cluster heads when the UAV collects data.

[0013] In some implementations of the first aspect, the specific method for updating the cluster head is:

[0014] Select a sensor node from each cluster that has not been visited by the drone to replace the current cluster head as the new cluster head, and accumulate the number of visits to the replaced sensor node;

[0015] If the number of visits to each sensor node in the cluster is the same, then the sensor node with the smallest distance to the cluster center is reselected as the cluster head;

[0016] If the number of visits to each sensor node in the cluster is different, the sensor node with the least number of visits is selected as the cluster head.

[0017] The step of determining the minimum number of measurements corresponding to the number of sensor nodes according to the numerical sparsity and the number of sensor nodes includes:

[0018] The data of different numbers of sensor nodes are selected from the sample data and compressed respectively to obtain the corresponding measurement vectors. The data of each sensor node is reconstructed through the measurement vectors to determine the minimum number of measurements corresponding to different numbers of sensor nodes.

[0019] Through Monte Carlo experiments, curve fitting is performed on several minimum measurement times to determine the functional relationship between numerical sparsity, the number of sensor nodes and the minimum measurement times.

[0020] Substituting the numerical sparsity and the number of sensor nodes into the functional relationship, the minimum number of measurements corresponding to the number of sensor nodes is calculated.

[0021] The S4 performs optimal path planning for the UAV through a Transformer model trained by reinforcement learning.

[0022] The specific operations of the Transformer model for optimal path planning of UAV are:

[0023] Import the sink node and each cluster head sensor node that have been marked with coordinates into the encoder of the model, and generate an input sequence according to the coordinate values ​​of the sink node and each cluster head sensor node;

[0024] The encoder embedding layer maps each coordinate value in the input sequence to a high-dimensional vector space, and outputs the target sequence through the query matrix, key matrix, and value matrix of the encoder layer multi-head attention mechanism;

[0025] The target sequence is used as the input of the decoder, and the probability distribution of all nodes in the encoder input sequence is obtained through decoding.

[0026] Based on the probability distribution of all nodes, the order of visiting each node is determined by beam search;

[0027] The coordinate values ​​of the cluster head sensor nodes to be visited are determined in sequence according to the access order, and the optimal path planning of the UAV is generated.

[0028] The second aspect provides a wireless sensor network data acquisition system based on a drone, comprising:

[0029] The sample data module is used to collect the historical data of all sensor nodes in the network at the same time as sample data, build a covariance matrix based on the sample data, and perform eigenvalue decomposition to obtain a sparse transformation matrix and numerical sparsity;

[0030] A compression measurement module is used to compress the sample data of several sensor nodes to obtain a measurement vector, and reconstruct the sample data through the measurement vector. If the reconstructed data is equal to the sample data, the minimum number of measurements corresponding to the number of sensor nodes is determined according to the numerical sparsity and the number of sensor nodes.

[0031] A clustering module is used to cluster all sensor nodes and determine the cluster head of each cluster. The minimum number of clusters is equal to the minimum number of measurements, which is the minimum number of acquisitions for a single flight of the UAV.

[0032] The path planning module is used to set the data collection path of the UAV with the aggregation node as the starting point, each cluster head as the stop point, and the aggregation node as the end point, and perform optimal path planning;

[0033] The acquisition module is used to collect data from each cluster head based on the planned optimal path, obtain the measurement vector, and return it to the sink node; update the cluster head, and collect the updated data from each cluster head until the sink node obtains the measurement vectors of all sensor nodes.

[0034] The third aspect provides a UAV-based wireless sensor network data acquisition device, comprising a processor and a memory, wherein the processor implements the UAV-based wireless sensor network data acquisition method as described above when executing program data stored in the memory.

[0035] A fourth aspect provides a readable storage medium for storing control program data, wherein the control program data, when executed by a processor, implements the wireless sensor network data collection method based on a drone as described above.

[0036] Beneficial effects: The present invention clusters all sensor nodes in a wireless sensor network, determines the minimum number of clusters, combines the selection of cluster heads with the measurement matrix of compressed sensing, and constructs a sparse measurement matrix containing only elements 0 and 1, thereby reducing the amount of data collection; uses drones as mobile relays so that the data of sensor nodes does not need to be transmitted over long distances, reduces the energy consumption of data transmission, and extends the network life; plans the optimal path of the drone based on the Transformer model to achieve rapid data collection. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the process of the present invention;

[0038] Figure 2 Schematic diagram of collecting data for drone path planning. DETAILED DESCRIPTION

[0039] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings.

[0040] This embodiment provides a wireless sensor network data collection method based on a drone, and the specific implementation steps of the method are as follows:

[0041] Step 1: Collect the historical data of all sensor nodes in the network at the same time as sample data, build a covariance matrix based on the sample data, and perform eigenvalue decomposition to obtain a sparse transformation matrix and numerical sparsity;

[0042] Collect the historical data of N sensor nodes at the same time as sample data x = [x1, x2, ..., x i ,...,x N ] T , Among them, N is the number of all sensor nodes in the wireless sensor network, and x i is the data of the sensor node S numbered i i .

[0043] Based on the sample data x = [x1, x2,..., x i ,..., x N T construct the covariance matrix Z = Ε(xx T ), perform eigenvalue decomposition on Z, Z = UΛU T to obtain U, let U be the sparse transformation matrix of x, and calculate the sparse coefficient vector Θ through x = UΘ.

[0044] Calculate the numerical sparsity k of x according to the sparse coefficient vector Θ, and its calculation formula is as follows:[[]]

[0045]

[0046] In the formula, ||Θ||1 and ||Θ||2 respectively represent the 1-norm and 2-norm of Θ.

[0047] Step 2: Compress the sample data of several sensor nodes to obtain a measurement vector, and reconstruct the sample data through the measurement vector. If the reconstructed data is equal to the sample data, determine the minimum number of measurements corresponding to the number of sensor nodes according to the numerical sparsity and the number of sensor nodes;

[0048] Use compressive sensing technology to compress the sample data x of N sensor nodes at the same time to obtain a measurement vector with M (M << N) rows and one column, where M represents the number of measurements.

[0049] The measurement matrix used in the compressive sensing technology is a matrix with M rows and N columns. Each row of the matrix randomly selects an element at a position and sets it to 1, and the elements at the remaining positions are set to 0.

[0050] Reconstruct the data through the measurement vector. When the reconstructed data satisfies the condition , it means that the sample data can be accurately reconstructed. For N sensor nodes, determine M min , M min represents the minimum number of measurements. If the reconstructed data , it means that the sample data cannot be accurately reconstructed. Gradually increase the value of M, and then determine the corresponding measurement vector through compressive sensing technology to perform data reconstruction until M min is determined.

[0051] Express M min as a functional relationship of N and k, M min ​=aklog(N / k+b)+c, where a, b, c are parameters.

[0052] To determine the specific values ​​of the parameters in the functional relationship, the method of determining the minimum number of measurements corresponding to the number of sensor nodes according to the numerical sparsity and the number of sensor nodes includes:

[0053] The data of different numbers of sensor nodes are selected from the sample data and compressed respectively to obtain the corresponding measurement vectors. The data of each sensor node is reconstructed through the measurement vectors to determine the minimum number of measurements corresponding to different numbers of sensor nodes.

[0054] Randomly select N0 (N0≤N) sample data x0 of sensor nodes from x, calculate the sparse transformation matrix U0 and numerical sparsity k0 of the sample data x0, let the M value start from 2k0 log(N0 / k0) to conduct experiments, and generate a measurement matrix with M rows and N0 columns for each M value. Each row of the measurement matrix randomly selects an element and sets it to 1, and the remaining elements are set to 0. Determine the M matrix that accurately reconstructs the sample data x0 corresponding to N0 sensor nodes. min ;

[0055] Repeat the experiment by changing N0 and calibrate the M corresponding to different N0 values min .

[0056] Through Monte Carlo experiments, curve fitting is performed on several minimum measurement times to determine the functional relationship between numerical sparsity, sensor nodes and the minimum measurement times.

[0057] Determine the functional relationship M by curve fitting min =aklog(N / k+b)+c where the values ​​of a, b, and c are:

[0058] Substituting the numerical sparsity and the number of sensor nodes into the functional relationship, the minimum number of measurements corresponding to the number of sensor nodes is calculated.

[0059] Step 3: cluster all sensor nodes and determine the cluster head of each cluster, the minimum number of clusters is equal to the minimum number of measurements, and the minimum number of measurements is the minimum number of acquisitions for a single flight of the UAV;

[0060] In a specific implementation, each cluster selects the sensor node with the shortest distance from the cluster center as the cluster head.

[0061] Step 4: Set the data collection path of the UAV with the aggregation node as the starting point, each cluster head as the stop point, and the aggregation node as the end point, and perform optimal path planning;

[0062] By establishing an attention mechanism sequence model (Transformer) for reinforcement learning training, the total path length of a single flight of the UAV is minimized, and the trained Transformer model is used for optimal path planning of the UAV.

[0063] The Transformer model includes an encoder and a decoder. The encoder consists of an embedding layer and six identical encoding layers, each of which includes a multi-head attention mechanism. Residual connection, batch normalization BN and feedforward neural network FF. The decoder consists of two identical decoding layers and a single-head attention mechanism, wherein each decoding layer includes two multi-head attention mechanisms, residual connection and layer normalization LN.

[0064] The specific operations of the Transformer model for optimal path planning of UAV are:

[0065] S4.1, importing the sink node and each cluster head sensor node that have been marked with coordinates into the encoder of the model, and generating an input sequence according to the coordinate values ​​of the sink node and each cluster head sensor node;

[0066] The coordinates of the sink node and the M cluster head sensor nodes are recorded as X = (X0; X1; ...; X i ...;X M ), Among them, X0 represents the coordinates of the sink node, X i represents the cluster head sensor node (referred to as cluster head) C with number i (1≤i≤M) i coordinate.

[0067] S4.2, map each coordinate value in the input sequence to a high-dimensional vector space through the encoder embedding layer, and output the target sequence through the query matrix, key matrix and value matrix of the encoder layer multi-head attention mechanism;

[0068] Each coordinate value X in X i (0≤i≤M) is mapped to a d-dimensional vector through the embedding layer Get X (0) ,

[0069] X (0) The target sequence output by the lth (1≤l≤6) coding layer is

[0070] X (l) =BN(MH′ (l) +FF(MH′ (l) )),

[0071] MH′ (l) =BN(MH(l) +X (l-1) ),

[0072]

[0073]

[0074]

[0075] In the formula, is the output of the h-th attention mechanism of the l-th encoding layer, denote the query matrix, key matrix, and value matrix of the h-th head attention mechanism of the l-th encoding layer, respectively. yes The transposed matrix of is the parameter matrix.

[0076] S4.3, taking the target sequence as the input of the decoder, and obtaining the probability distribution of all nodes in the encoder input sequence through decoding processing, wherein the nodes include the sink node and each cluster head sensor node;

[0077] After t decodings, the positions of t nodes in the target sequence are π(0), π(1)…π(t-1) in sequence. Then, the input of the first decoding layer at the t+1 decoding is

[0078]

[0079]

[0080] In the formula, Indicates the tth decoding time X (6) A d-dimensional vector corresponding to π(t-1), PE (t-1) yes The position code.

[0081] After the first multi-head attention mechanism Residual connection and layer normalization LN get

[0082]

[0083]

[0084]

[0085]

[0086] In the formula, Indicates the first decoding layer The parameter matrix of yes Output of the h1-th attention mechanism.

[0087] After the second multi-head attention mechanism Residual connection and layer normalization LN get

[0088]

[0089]

[0090]

[0091]

[0092] In the formula, Indicates the first decoding layer The parameter matrix of . is the output of the h2-th attention mechanism. t is the mask matrix of visited nodes, ⊙ represents the Hadamard product. S4.4, based on the probability distribution of all nodes, determine the visit order of each node through beam search;

[0093] Input the second decoding layer, output Let the probability distribution of all nodes be P t , use beam search from P t Select some nodes to be visited with high probability, use each node to be visited as the input of the decoder again, repeat the decoding process and beam search until all nodes are visited, obtain the sequence set of each node, and select the sequence with the highest probability from the sequence set as the node visit order.

[0094]

[0095]

[0096] In the formula, and is the parameter matrix of the single-head attention mechanism.

[0097] S4.5. Determine the coordinate values ​​of the cluster head sensor nodes to be visited in turn according to the access order, and generate the optimal path planning of the UAV.

[0098] Step 5: Collect data from each cluster head based on the planned optimal path, obtain a measurement vector, and return it to the sink node; update the cluster head, and collect data from each updated cluster head until the sink node obtains the measurement vectors of all sensor nodes.

[0099] Wherein, the specific method of updating the cluster head is:

[0100] Select a sensor node from each cluster that has not been visited by the drone to replace the current cluster head as the new cluster head, and accumulate the number of visits to the replaced sensor node;

[0101] If the number of visits to each sensor node in the cluster is the same, then the sensor node with the smallest distance to the cluster center is reselected as the cluster head;

[0102] If the number of visits to each sensor node in the cluster is different, the sensor node with the least number of visits is selected as the cluster head.

[0103] The method further comprises the step of obtaining a sparse measurement matrix by a converging node through a measurement vector, and reconstructing data of each sensor node through the sparse measurement matrix and a sparse transformation matrix.

[0104] The UAV stops above each cluster head according to the planned optimal path to collect data and obtains the measurement vector y=(y1,y2,...,y M ), and the sparse measurement matrix is ​​obtained by y = Φx

[0105] The sink node reconstructs the data of each sensor node according to the measurement vector y, the sparse transformation matrix U and the sparse measurement matrix Φ.

[0106] The data reconstruction method is the same as the compressed sensing reconstruction method in step 2. The sparse transformation matrix U is obtained through sample data and remains unchanged, while the measurement matrix Φ is determined by the number of the sensor node corresponding to the cluster head when the drone collects data. M The corresponding sensor nodes are S2→S1→…→S5, then the element in the first row and second column of Φ is 1, and the elements in the other columns are all 0; the element in the second row and first column is 1, and the other elements are 0, and so on to construct a sparse measurement matrix.

[0107] The present invention also provides a wireless sensor network data acquisition system based on an unmanned aerial vehicle, comprising:

[0108] The sample data module is used to collect the historical data of all sensor nodes in the network at the same time as sample data, build a covariance matrix based on the sample data, and perform eigenvalue decomposition to obtain a sparse transformation matrix and numerical sparsity;

[0109] A compression measurement module is used to compress the sample data of several sensor nodes to obtain a measurement vector, and reconstruct the sample data through the measurement vector. If the reconstructed data is equal to the sample data, the minimum number of measurements corresponding to the number of sensor nodes is determined according to the numerical sparsity and the number of sensor nodes.

[0110] A clustering module is used to cluster all sensor nodes and determine the cluster head of each cluster. The minimum number of clusters is equal to the minimum number of measurements, which is the minimum number of acquisitions for a single flight of the UAV.

[0111] The path planning module is used to set the data collection path of the UAV with the aggregation node as the starting point, each cluster head as the stop point, and the aggregation node as the end point, and perform optimal path planning;

[0112] The acquisition module is used to collect data from each cluster head based on the planned optimal path, obtain the measurement vector, and return it to the sink node; update the cluster head, and collect the updated data from each cluster head until the sink node obtains the measurement vectors of all sensor nodes.

[0113] Secondly, a wireless sensor network data acquisition device based on a drone is also provided, comprising a processor and a memory, wherein the processor implements the wireless sensor network data acquisition method based on a drone as described above when executing program data stored in the memory.

[0114] Finally, a readable storage medium is also provided for storing control program data, wherein the control program data, when executed by a processor, implements the wireless sensor network data collection method based on a drone as described above.

Claims

1. A wireless sensor network data collection method based on drones, characterized in that: include: S1, collect the historical data of all sensor nodes in the network at the same time as sample data, build a covariance matrix based on the sample data, and perform eigenvalue decomposition to obtain a sparse transformation matrix and numerical sparsity; S2, compressing the sample data of several sensor nodes to obtain a measurement vector, reconstructing the sample data through the measurement vector, and if the reconstructed data is equal to the sample data, determining the minimum number of measurements corresponding to the number of sensor nodes according to the numerical sparsity and the number of sensor nodes; Using compressed sensing technology N The sample data of sensor nodes at the same time x Compress and get M A measurement vector with one row and one column, where M Represents the number of measurements; the measurement matrix used in the compressed sensing technology is a M OK N A matrix of columns, in which a randomly selected element in each row is set to 1, and the elements in the remaining positions are set to 0; The data is reconstructed by measuring the vector. Satisfy the conditions When , it means that the sample data can be accurately reconstructed. N sensor nodes determine the exact reconstruction of the data M min , M min Indicates the minimum number of measurements; if the reconstructed data When , it means that the sample data cannot be accurately reconstructed, and gradually increases M The corresponding measurement vector is determined by compressed sensing technology, and data is reconstructed until it is determined M min ; Will M min Expressed as N and k Functional relationship M min = ak log( N / k + b )+ c ,in a , b , c is a parameter; The step of determining the minimum number of measurements corresponding to the number of sensor nodes according to the numerical sparsity and the number of sensor nodes includes: The data of different numbers of sensor nodes are selected from the sample data and compressed respectively to obtain the corresponding measurement vectors. The data of each sensor node is reconstructed through the measurement vectors to determine the minimum number of measurements corresponding to different numbers of sensor nodes. from x Randomly select N Sample data of 0 sensor nodes x 0, calculated sample data x 0 sparse transformation matrix U 0 and numerical sparsity k 0, let M Value from Start the experiment, for each M The value generates a M OK N 0 columns of the measurement matrix, each row of which randomly selects an element and sets it to 1, and sets the remaining elements to 0, to determine the corresponding N Sample data of 0 sensor nodes x 0Accurate reconstruction M min ; By changing N 0 repeated experiments with different calibrations N The value 0 corresponds to M min ; Through Monte Carlo experiments, curve fitting is performed on several minimum measurement times to determine the functional relationship between numerical sparsity, sensor nodes and the minimum measurement times. Determine the functional relationship through curve fitting M min = ak log( N / k + b )+ c middle a , b , c The value of Substitute the numerical sparsity and the number of sensor nodes into the functional relationship to calculate the minimum number of measurements corresponding to the number of sensor nodes; S3, clustering all sensor nodes and determining the cluster head of each cluster, the minimum number of clusters is equal to the minimum number of measurements, and the minimum number of measurements is the minimum number of acquisitions for a single flight of the UAV; S4, set the data collection path of the UAV with the aggregation node as the starting point, each cluster head as the stop point, and the aggregation node as the end point, and perform optimal path planning; The Transformer model trained by reinforcement learning is used to plan the optimal path for the UAV. The specific operations of the Transformer model for planning the optimal path for the UAV are as follows: S4.1, importing the sink node and each cluster head sensor node that have been marked with coordinates into the encoder of the model, and generating an input sequence according to the coordinate values ​​of the sink node and each cluster head sensor node; The aggregation node and M The coordinate values ​​of the cluster head sensor nodes are recorded as , ,in, X 0 represents the coordinates of the sink node, X i Indicates the number i Cluster head sensor node C i coordinate; S4.2, map each coordinate value in the input sequence to a high-dimensional vector space through the encoder embedding layer, and output the target sequence through the query matrix, key matrix and value matrix of the encoder layer multi-head attention mechanism; Each coordinate value in X X i Mapping via Embedding Layer d Dimensional vector ,get , ; The l The target sequence output by the encoding layer is : , , , , , , , In the formula, It is l Coding layer h The output of the head attention mechanism, Respectively represent l Coding layer h The query matrix, key matrix, and value matrix of the head attention mechanism, yes The transposed matrix of is the parameter matrix; S4.3, taking the target sequence as the input of the decoder, and obtaining the probability distribution of all nodes in the encoder input sequence through decoding processing, wherein the nodes include the sink node and each cluster head sensor node; The target sequence t The decoded output is in the input sequence t The positions of the nodes are π (0), π (1), …, π ( t -1), then t The input of the first decoding layer when +1 decoding is , , , In the formula, Indicates t Decoding time Corresponding π ( t -1) d dimensional vector, PE (t-1) yes Positional encoding; After the first multi-head attention mechanism , residual connection and layer normalization LN , , , , , , , In the formula, Indicates the first decoding layer The parameter matrix of yes No. h Output of 1-head attention mechanism; After the second multi-head attention mechanism , residual connection and layer normalization LN , , , , , , , In the formula, Indicates the first decoding layer The parameter matrix of It is h Output of the 2-head attention mechanism; I t is the mask matrix of visited nodes, represents the Hadamard product; S4.4, based on the probability distribution of all nodes, determine the access order of each node through beam search; Input the second decoding layer, output , let the probability distribution of all nodes be P t , using beam search from P t Select some nodes to be visited with high probability, use each node to be visited as the input of the decoder again, repeat the decoding process and beam search until all nodes are visited, obtain the sequence set of each node, and select the sequence with the highest probability from the sequence set as the node visit order. , , , In the formula, and is the parameter matrix of the single-head attention mechanism; S4.5, determine the coordinate values ​​of the cluster head sensor nodes to be visited in turn according to the access order, and generate the optimal path planning of the UAV; S5. Collect data from each cluster head based on the planned optimal path, obtain a measurement vector, and return it to the sink node; update the cluster head, and collect the updated data from each cluster head until the sink node obtains the measurement vectors of all sensor nodes.

2. The wireless sensor network data collection method based on drone according to claim 1 is characterized in that: It also includes obtaining a sparse measurement matrix through a measurement vector at a sink node, and reconstructing data of each sensor node through the sparse measurement matrix and a sparse transformation matrix.

3. The wireless sensor network data collection method based on drone according to claim 1 is characterized in that: The specific method for updating the cluster head is: Select a sensor node that has not been visited by the drone from each cluster to replace the current cluster head as the new cluster head, and accumulate the number of visits to the replaced sensor node; If the number of visits to each sensor node in the cluster is the same, then the sensor node with the smallest distance to the cluster center is reselected as the cluster head; If the number of visits to each sensor node in the cluster is different, the sensor node with the least number of visits is selected as the cluster head.

4. The wireless sensor network data collection method based on unmanned aerial vehicle according to claim 2 is characterized in that: The sparse transformation matrix is ​​constructed by using sample data and remains unchanged; the sparse measurement matrix is ​​constructed according to the numbers of the sensor nodes corresponding to the cluster heads when the UAV collects data.

5. A wireless sensor network data acquisition system based on drones, characterized in that: include: The sample data module is used to collect the historical data of all sensor nodes in the network at the same time as sample data, build a covariance matrix based on the sample data, and perform eigenvalue decomposition to obtain a sparse transformation matrix and numerical sparsity; A compression measurement module is used to compress the sample data of several sensor nodes to obtain a measurement vector, and reconstruct the sample data through the measurement vector. If the reconstructed data is equal to the sample data, the minimum number of measurements corresponding to the number of sensor nodes is determined according to the numerical sparsity and the number of sensor nodes. Using compressed sensing technology N The sample data of sensor nodes at the same time x Compress and get M A measurement vector with one row and one column, where M Represents the number of measurements; the measurement matrix used in the compressed sensing technology is a M OK N A matrix of columns, in which a randomly selected element in each row is set to 1, and the elements in the remaining positions are set to 0; The data is reconstructed by measuring the vector. Satisfy the conditions When , it means that the sample data can be accurately reconstructed. N sensor nodes determine the exact reconstruction of the data M min , M min Indicates the minimum number of measurements; if the reconstructed data When , it means that the sample data cannot be accurately reconstructed, and gradually increases M The corresponding measurement vector is determined by compressed sensing technology, and data is reconstructed until it is determined M min ; Will M min Expressed as N and k Functional relationship M min = ak log( N / k + b )+ c ,in a , b , c is a parameter; The step of determining the minimum number of measurements corresponding to the number of sensor nodes according to the numerical sparsity and the number of sensor nodes includes: The data of different numbers of sensor nodes are selected from the sample data and compressed respectively to obtain the corresponding measurement vectors. The data of each sensor node is reconstructed through the measurement vectors to determine the minimum number of measurements corresponding to different numbers of sensor nodes. from x Randomly select N Sample data of 0 sensor nodes x 0, calculated sample data x 0 sparse transformation matrix U 0 and numerical sparsity k 0, let M Value from Start the experiment, for each M Generate a value M OK N 0 columns of the measurement matrix, each row of which randomly selects an element and sets it to 1, and sets the remaining elements to 0, to determine the corresponding N Sample data of 0 sensor nodes x 0Accurate reconstruction M min ; By changing N 0 repeated experiments with different calibrations N The value 0 corresponds to M min ; Through Monte Carlo experiments, curve fitting is performed on several minimum measurement times to determine the functional relationship between numerical sparsity, sensor nodes and the minimum measurement times. Determine the functional relationship through curve fitting M min = ak log( N / k + b )+ c middle a , b , c The value of Substitute the numerical sparsity and the number of sensor nodes into the functional relationship to calculate the minimum number of measurements corresponding to the number of sensor nodes; A clustering module is used to cluster all sensor nodes and determine the cluster head of each cluster. The minimum number of clusters is equal to the minimum number of measurements, which is the minimum number of acquisitions for a single flight of the UAV. The path planning module is used to set the data collection path of the UAV with the aggregation node as the starting point, each cluster head as the stop point, and the aggregation node as the end point, and perform optimal path planning; the optimal path planning of the UAV is performed by the Transformer model trained by reinforcement learning. The specific operations of the Transformer model for the optimal path planning of the UAV are: Import the sink node and each cluster head sensor node that have been marked with coordinates into the encoder of the model, and generate an input sequence according to the coordinate values ​​of the sink node and each cluster head sensor node; The aggregation node and M The coordinate values ​​of the cluster head sensor nodes are recorded as , ,in, X 0 represents the coordinates of the sink node, X i Indicates the number i Cluster head sensor node C i coordinate; The encoder embedding layer maps each coordinate value in the input sequence to a high-dimensional vector space, and outputs the target sequence through the query matrix, key matrix, and value matrix of the encoder layer multi-head attention mechanism; Each coordinate value in X X i Mapping via Embedding Layer d Dimensional vector ,get , ; The l The target sequence output by the encoding layer is : , , , , , , , In the formula, It is l Coding layer h The output of the head attention mechanism, Respectively represent l Coding layer h The query matrix, key matrix, and value matrix of the head attention mechanism, yes The transposed matrix of is the parameter matrix; The target sequence is used as the input of the decoder, and the probability distribution of all nodes in the encoder input sequence is obtained through decoding, wherein the nodes include the sink node and each cluster head sensor node; The target sequence t The decoded output is in the input sequence t The positions of the nodes are π (0), π (1), …, π ( t -1), then t The input of the first decoding layer when +1 decoding is , , , In the formula, Indicates t Decoding time Corresponding π ( t -1) d dimensional vector, PE (t-1) yes Positional encoding; After the first multi-head attention mechanism , residual connection and layer normalization LN , , , , , , , In the formula, Indicates the first decoding layer The parameter matrix of yes No. h Output of 1-head attention mechanism; After the second multi-head attention mechanism , residual connection and layer normalization LN , , , , , , , In the formula, Indicates the first decoding layer The parameter matrix of It is h Output of the 2-head attention mechanism; I t is the mask matrix of visited nodes, represents the Hadamard product; Based on the probability distribution of all nodes, the order of visiting each node is determined by beam search; Input the second decoding layer, output , let the probability distribution of all nodes be P t , using beam search from P t Select some nodes to be visited with high probability, use each node to be visited as the input of the decoder again, repeat the decoding process and beam search until all nodes are visited, obtain the sequence set of each node, and select the sequence with the highest probability from the sequence set as the node visit order. , , , In the formula, and is the parameter matrix of the single-head attention mechanism; Determine the coordinate values ​​of the cluster head sensor nodes to be visited in turn according to the access order, and generate the optimal path planning of the UAV; The acquisition module is used to collect data from each cluster head based on the planned optimal path, obtain the measurement vector, and return it to the sink node; update the cluster head, and collect the updated data from each cluster head until the sink node obtains the measurement vectors of all sensor nodes.

6. A wireless sensor network data acquisition device based on drones, characterized in that: It comprises a processor and a memory, wherein when the processor executes the program data stored in the memory, the wireless sensor network data collection method based on a drone as described in any one of claims 1 to 4 is implemented.

7. A readable storage medium, characterized in that: Used to store control program data, wherein when the control program data is executed by a processor, the wireless sensor network data collection method based on a drone as described in any one of claims 1-4 is implemented.