A clustering method for wireless sensor networks based on improved Gannet optimization algorithm

By improving the Tanggan optimization algorithm and differential evolution algorithm to elect cluster heads, combining the fitness function to consider energy and distance, the problems of low energy utilization and short life of wireless sensor networks are solved, and more efficient energy management and network stability are achieved.

CN117729518BActive Publication Date: 2024-11-05SHANDONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311552082.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2024-11-05
Estimated Expiration
2043-11-21

AI Technical Summary

Technical Problem

The energy utilization rate of existing wireless sensor networks is low and the network life is not long. This is mainly due to the insufficient consideration of the remaining energy of nodes, which leads to the unoptimized cluster head election, which in turn reduces the stability and life of the network.

Method used

The improved Tangganese optimization algorithm is adopted, and the cluster head is selected by designing the fitness function and combining the differential evolution algorithm. The cluster head is selected, taking into account the average distance in the cluster, the distance from the cluster head to the base station and the remaining energy of the cluster head node, so as to balance the performance of the cluster head to avoid redundancy. Energy consumption extends network life.

Benefits of technology

It effectively reduces network energy overhead, extends the life of wireless sensor network, improves energy utilization, and significantly improves network stability and data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117729518B_ABST
    Figure CN117729518B_ABST
Patent Text Reader

Abstract

The present invention discloses a wireless sensor network clustering method based on an improved gannet optimization algorithm, which belongs to the technical field of wireless sensor networks and includes the following steps: step 1, constructing a clustering model of a wireless sensor network; step 2, constructing an improved gannet optimization algorithm and designing a fitness function; step 3, adopting the improved gannet algorithm to elect cluster heads and perform wireless sensor network clustering. The present invention integrates a differential evolution algorithm to propose an improved gannet optimization algorithm, and selects cluster heads based on the improved gannet optimization algorithm. The fitness function used takes into account the average distance within the cluster, the distance from the cluster head to the base station, and the residual energy of the cluster head node, so as to balance the performance of the cluster head. The method of the present invention avoids unnecessary energy consumption, can effectively reduce network energy overhead, and extend network life.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of wireless sensor networks, and in particular relates to a wireless sensor network clustering method based on an improved gannet optimization algorithm. Background Art

[0002] As wireless sensor network (WSN) technology becomes more and more mature, it has attracted more and more attention from the outside world. WSN can be applied to various ways to make applications more convenient. Among them, WSN is mainly used for civil applications, military applications, environmental monitoring, medical and health, and agricultural applications. WSN consists of a large number of randomly assigned wireless sensor nodes, which collect the required data from the surrounding environment, such as temperature, sound, light intensity, or the concentration of certain gases, and transmit this information to the base station. In addition, the sensor node also has computing functions, data transmission functions, and energy supply functions. Since the battery can store less energy and it is difficult to replenish or replace the battery, the energy of WSN is limited. In recent years, many technologies have been proposed to improve the performance of WSN.

[0003] Clustering is a technology that can effectively reduce the energy consumption of WSNs, improve the stability of WSNs and the network life. It divides the wireless sensor network into many clusters and designates a node in the cluster as the head of the cluster, called the cluster head, which manages the nodes in each cluster. The cluster head is used to manage data transmission and data aggregation in each small cluster, and then send the data to the remote base station. Therefore, the cluster head must be a node with more residual energy. Otherwise, limited resources will greatly reduce the performance of WSNs. This requires the discovery of the optimal cluster head to improve the network life of WSNs, so the process of using meta-heuristic algorithms for clustering is highly necessary. The LEACH protocol is a traditional clustering protocol, which includes two steps: clustering phase and data transmission phase. First, all nodes are divided into several small clusters, and then nodes are randomly selected to become cluster heads. Next is the data transmission phase, where the cluster head processes the data from each node and then sends it to the base station. However, the residual energy of the node is not fully considered, which will cause the survival time of the WSN to drop sharply. Therefore, more versions of routing protocols have been proposed, such as the LEACH-C protocol, which is an optimized version of the LEACH protocol and adopts the idea of ​​simulated annealing. First, the data of each sensor node is transmitted to the base station. Then the average energy of all nodes is calculated, and the nodes with residual energy higher than the average value are selected as cluster heads, and then clusters are formed. LEACH-C has more global coordination than LEACH.

[0004] In summary, the existing technology has the problems of low energy utilization rate and short network life of wireless sensor networks. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes a wireless sensor network clustering method based on an improved Gannet optimization algorithm to improve the network lifespan.

[0006] The technical solution of the present invention is as follows:

[0007] A wireless sensor network clustering method based on an improved Gannet optimization algorithm comprises the following steps:

[0008] Step 1: Construct a clustering model of wireless sensor network;

[0009] Step 2: Construct an improved Gannet optimization algorithm and design a fitness function;

[0010] Step 3: Use the improved Gannet algorithm to elect cluster heads and perform clustering in the wireless sensor network.

[0011] Furthermore, the specific process of step 1 is: randomly distribute multiple sensor nodes in the two-dimensional network area and divide them into multiple clusters, the base station is located outside the range of the sensor nodes, a node is selected from the cluster as the cluster head, and other non-cluster head nodes select the nearest cluster head to form a cluster; the base station is connected to the user through the Internet.

[0012] Furthermore, in step 1, when sending data in the wireless sensor network, the energy consumed by the cluster head node to send an n-bit data packet is:

[0013] E Txc =(E elect +E agr )*n+E amp *n*d 2 (1);

[0014] The energy consumed by a non-cluster head node to send an n-bit data packet is:

[0015] E Tx =E elect *n+E amp *n*d 2 (2);

[0016] Among them, E Txc is the energy consumed by the cluster head node’s transmitter when sending an n-bit data packet; E Tx is the energy consumption of non-cluster head nodes when sending messages; E elect is the energy consumption requirement for transmission or reception; E agr It represents the energy consumed by the cluster head node when aggregating a single data; E amp is the amplification factor; n is the number of bits of the received or sent data packet; d is the distance between the sensor node and the corresponding cluster head node;

[0017] The energy consumption of the cluster head node after receiving n-bit data packets and processing the data is:

[0018] E Rx =(E re +E agr )*n (3);

[0019] Among them, E Rx It represents the energy required by the cluster head node to receive n-bit data packets; E re It represents the energy consumed by the cluster head node when receiving a single data.

[0020] Furthermore, in step 2, the differential evolution algorithm is integrated into the last part of the exploration phase of the traditional gannet algorithm to construct an improved gannet optimization algorithm; the traditional gannet algorithm includes population initialization, exploration phase, and development phase. After completing the calculation of the position update formula (9) in the exploration phase, the calculation of formulas (19) and (20) is performed, and finally the algorithm development phase is entered:

[0021]

[0022] u 2 =(2*r 4 -1)*a*(X i (t)-X r (t)) (10);

[0023] v 2 =(2*r 5 -1)*b*(X i (t)-X m (t)) (11);

[0024] Among them, MX i (t+1) represents the i-th individual in the storage matrix MX at the t+1th iteration; r 4 and r 5 are all random numbers between 0 and 1; u 1 is a random number between -a and a; u 2 It is to optimize the U-shaped diving; 1 is a random number between -b and b; v 2 It is to optimize the V-shaped diving; i (t) is the position of the i-th individual in the current population at the t-th iteration; X r (t) is a randomly selected individual in the current population; X m (t) represents the average position of all individuals in the current population;

[0025] V i,t =MX best,t +F*(MX r1,t-MX r2,t ) (19);

[0026] Among them, V i,t represents the i-th individual at the t-th iteration; MX best,t is the current global optimal solution; F is the scaling factor; MX r1,t is a random individual; MX r2,t is a different individual randomly selected from the other N-1 individuals;

[0027]

[0028] Among them, U i,j is the offspring individual obtained after crossover; V i,j is a mutated individual; MX i,j is the original parent individual; Cr is the crossover probability; j rand is a random variable, when rand(0,1)≤Cr or j=j rand When , the j-th dimension of the i-th individual of the new generation is taken as the j-th dimension value of the mutated individual, otherwise it takes the j-th dimension value of MX.

[0029] Furthermore, in step 2, the designed fitness function is as follows:

[0030]

[0031]

[0032] Among them, f 1 It represents the maximum value of the average distance between the cluster head node and the non-cluster head nodes; is the node nCH in the cluster i Cluster head node The total distance between them; node_n is the number of nodes in the cluster; f 2 Indicates the maximum distance from the base station to the cluster head node; From base station BS to cluster head node distance;

[0033] Formula (23) is the final form of the fitness function:

[0034]

[0035] Among them, f is the fitness function; β is the weight parameter; Represents the total energy of all cluster heads.

[0036] Furthermore, the specific process of step 3 is as follows:

[0037] Step 3.1, initialize the parameters of the improved gannet algorithm, the gannet population and the number of iterations, regard the cluster head nodes as gannets in the improved gannet algorithm, and each gannet represents a candidate for a cluster head node;

[0038] Step 3.2, assign candidate cluster heads to the gannet population;

[0039] Step 3.3, use the improved Gannet algorithm to iterate, use the proposed fitness function to calculate the fitness function value, the cluster head with the smallest value is the best cluster head, after the cluster head is selected by the improved Gannet algorithm and the fitness function, each cluster head node broadcasts, and each non-cluster head node selects the nearest cluster head node to join the cluster until there are no redundant non-cluster head nodes, thus forming multiple clusters;

[0040] Step 3.4, then tell each cluster the final result, aggregate the data through the cluster head, and transmit the data information to the base station;

[0041] Step 3.5: Determine whether all nodes in the current network have exhausted their energy. If all nodes have exhausted their energy, the process ends, and the network life of the WSN ends.

[0042] Beneficial technical effects brought by the present invention:

[0043] The present invention integrates the differential evolution algorithm to propose an improved Gannet optimization algorithm, and selects cluster heads based on the improved Gannet optimization algorithm. The fitness function used considers the average distance within the cluster, the distance from the cluster head to the base station, and the residual energy of the cluster head node, so as to balance the performance of the cluster head. The method of the present invention avoids unnecessary energy consumption, can effectively reduce network energy consumption, and prolong network life. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 The present invention is a flow chart of a wireless sensor network clustering method based on an improved Gannet optimization algorithm.

[0045] Figure 2 This is a clustering model diagram of the wireless sensor network of the present invention.

[0046] Figure 3 This is a schematic diagram of the distribution of sensor nodes and base stations of the present invention.

[0047] Figure 4 It is a comparative schematic diagram of the total residual energy change of the network of the improved Gannet optimization algorithm in the present invention and the traditional clustering routing algorithm.

[0048] Figure 5 This is a schematic diagram comparing the situations of base stations receiving data packets using the improved Gannet optimization algorithm of the present invention and the traditional cluster routing algorithm. DETAILED DESCRIPTION

[0049] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0050] like Figure 1 As shown, a wireless sensor network clustering method based on an improved Gannet optimization algorithm includes the following steps:

[0051] Step 1: Construct a clustering model of wireless sensor network;

[0052] Multiple sensor nodes are randomly distributed in a two-dimensional network area and divided into multiple clusters. The base station is located outside the range of the sensor nodes. A node is selected from the cluster as the cluster head, and other ordinary nodes (i.e., non-cluster head nodes) select the nearest cluster head to form a cluster; the base station is connected to the user through the Internet.

[0053] The clustering model of wireless sensor networks is as follows: Figure 2 As shown in the figure, it can be seen that the network is divided into multiple clusters, and the cluster heads are selected after screening. Because the remaining energy of each cluster head must be guaranteed, the cluster heads in each round may be different. This greatly improves the energy utilization of WSN, thereby extending the network life of WSN. If each sensor node is directly transmitted to the base station, then the long-distance transportation will also greatly reduce the network life. Figure 2 The information is first transmitted to the cluster head node, which then fuses the data and transmits it to the base station, and finally transmits it to the data center via the Internet. This greatly reduces the total energy required for the entire network.

[0054] Wireless sensor network model Figure 2 As shown in Figure 1, multiple sensor nodes are randomly distributed in a two-dimensional network area, and then these nodes no longer change, that is, static nodes. And the initial energy of all sensor nodes is the same, they are homogeneous sensor nodes. The base station is located outside the network area of ​​the sensor nodes.

[0055] Next is the energy model used in the present invention. When sending data in a wireless sensor network, non-cluster head nodes only need to consume the energy of sending n-bit data packets, but cluster head nodes also need to consume additional energy of aggregating data packets. The energy consumption of each node receiving data also needs to be calculated.

[0056] The cluster head node consumes more energy than the non-cluster head node to coordinate data transmission. Therefore, the energy consumed by the cluster head node to send an n-bit data packet is:

[0057] E Txc =(E elect +E agr )*n+E amp *n*d 2 (1);

[0058] The energy consumed by a non-cluster head node to send an n-bit data packet is:

[0059] E Tx =E elect *n+E amp *n*d 2 (2);

[0060] Among them, E Txc is the energy consumed by the cluster head node’s transmitter when sending an n-bit data packet; E Tx is the energy consumption of non-cluster head nodes when sending messages; E elect is the energy consumption requirement for transmission or reception; E agr It represents the energy consumed by the cluster head node when aggregating a single data; E amp is the amplification factor; n is the number of bits of the received or sent data packet; d is the distance between the sensor node and the corresponding cluster head node.

[0061] The energy consumption of the cluster head node after receiving n-bit data packets and processing the data is:

[0062] E Rx =(E re +E agr )*n (3);

[0063] Among them, E Rx It represents the energy required by the cluster head node to receive n-bit data packets; E re It represents the energy consumed by the cluster head node when receiving a single data.

[0064] Step 2: Construct an improved Gannet optimization algorithm and design a fitness function;

[0065] The principle of the traditional gannet algorithm is as follows: Gannets usually live in groups near lakes, feeding mainly on fish, but also on crustaceans, birds and amphibians. Even when flying at high altitudes, gannets can clearly capture fish swimming in the water. If a group of gannets find a fish, they will form a straight line or semicircular array to catch it, and then dive into the water from more than ten meters in the air to catch their prey. Because gannets also have strong swimming abilities, they can dive several meters into the water to continue catching fish. The Gannet Algorithm (GOA) is an algorithm created as a mathematical model based on the foraging process of gannets, which is used to explore and develop the optimal solution.

[0066] The traditional Gannet algorithm consists of three parts: population initialization, exploration phase, and development phase.

[0067] The population is initialized as follows:

[0068] In the Gannet Algorithm, the initial Gannet population has N individuals, represented by an N*D matrix X, where D is the upper limit of the solution dimension. The position x of the i-th individual i,j As shown in formula (4):

[0069] x i,j =LB j +(UB j -LB j )*rand,i=1,2,…,N,j=1,2,…,D (4);

[0070] Among them, UB j and LB j They represent the upper and lower limits of each individual in the jth dimension respectively; rand represents a random number between 0 and 1.

[0071] A matrix MX is also defined, called the storage matrix. The values ​​of the matrix X are assigned to MX during the initialization phase. In each evolutionary iteration, the position changes of the individual gannets will be recorded in the storage matrix MX. After the function is evaluated, if the gannets in the storage matrix MX are better than the gannets in the current matrix X, then the gannets in X are replaced by the gannets in MX.

[0072] The exploration phase is as follows:

[0073] Gannets adjust their diving patterns according to the depth of their prey, so they can better catch fish. Gannets have two types of diving: U-shaped diving and V-shaped diving. U-shaped diving is suitable for shallow waters, while V-shaped diving is suitable for deep waters.

[0074]

[0075] a=2*cos(2*π*r 2 )*t (6);

[0076] b=2*V(2*π*r 2 )*t (7);

[0077]

[0078] Where t is a function of the number of iterations; t pre is the current iteration number, t max is the maximum number of iterations; a is U-shaped diving; b is V-shaped diving; r 2 and r 3 are all random numbers between 0 and 1; V(x) represents the basic function of the V-shaped dive; x represents the independent variable of the basic function of the V-shaped dive.

[0079] The position update of the gannet uses these two diving strategies to update the position. Since the probability of selecting these two strategies is the same, a random number q is used to randomly select the two diving strategies. The position update formula is shown in formula (9).

[0080]

[0081] u 2 =(2*r 4 -1)*a*(X i (t)-X r (t)) (10);

[0082] v 2 =(2*r 5 -1)*b*(X i (t)-X m (t)) (11);

[0083] Among them, MX i (t+1) represents the i-th individual in the storage matrix MX at the t+1th iteration; r 4 and r 5 are all random numbers between 0 and 1; u 1 is a random number between -a and a; u 2 It is to optimize the U-shaped diving; 1 is a random number between -b and b; v 2 It is to optimize the V-shaped diving; i (t) is the position of the i-th individual in the current population at the t-th iteration; X r (t) is a randomly selected individual in the current population; X m (t) represents the average position of all individuals in the current population; X m (t) can be calculated using the following formula:

[0084]

[0085] The development stages are as follows:

[0086] During the hunting phase, the gannet may encounter a situation where the fish suddenly turns around, so the gannet's ability Ca is defined. When the gannet's ability is sufficient, the gannet can catch the fish. However, the gannet's ability will decrease over time, and the gannet will fail to catch the fish.

[0087]

[0088] L=0.2+(2-0.2)*r 6 (14);

[0089] Where L is the6 function, taking values ​​in (0.2, 2); r 6 is a random number between 0 and 1; the weight of the gannet Vel = 1.5 m / s is the speed of the gannet in the water, and the water resistance is ignored. If the gannet's catching ability is within the range of the prey it can catch, it will suddenly turn to update its position; otherwise, the gannet fails to catch the prey and performs Levy motion to randomly search for the next target, see formula (15).

[0090]

[0091] delta=Ca*|X i (t)-X best (t)| (16);

[0092]

[0093]

[0094] Among them, delta is the optimization of the gannet's ability; c and β are constants determined through multiple experiments, c = 0.2, β = 1.5; X best (t) is the best individual in the current population; Levy(·) is the Levy flight function; μ and σ are both random values ​​between (0,1); v is A random number, is the dimension; Γ is the gamma function.

[0095] In order to improve the diversity of the algorithm's solutions, make the fitness value of the solution smaller, and better jump out of the local optimal solution, the present invention incorporates the idea of ​​the differential evolution algorithm into the traditional Gannet algorithm, that is, after the end of the last part of the algorithm's exploration phase, that is, formula (9), in order to improve the algorithm's exploration degree and accelerate the algorithm's convergence and success rate, the present invention adds formula (19) and formula (20), and then enters the algorithm's development phase. The differential evolution algorithm (DE) is a random search algorithm with three phases: mutation phase, crossover phase, and selection phase.

[0096] The first stage is the mutation stage, which uses the optimal solution and the obtained mutant particles to mutate using the following formula:

[0097] V i,t =MX best,t +F*(MX r1,t -MX r2,t ) (19);

[0098] Among them, V i,t represents the i-th individual at the t-th iteration; MX best,tis the current global optimal solution; F is the scaling factor; MX r1,t is a random individual; MX r2,t It is a different individual randomly selected from the other N-1 individuals.

[0099] The second stage is the crossover stage, which crosses the parent solution and the mutated solution to obtain a new offspring. The formula used is as follows:

[0100]

[0101] Among them, U i,j is the offspring individual obtained after crossover; V i,j is a mutated individual; MX i,j is the original parent individual; Cr is the crossover probability; j rand is a random variable, when rand(0,1)≤Cr or j=j rand When , the j-th dimension of the i-th individual of the new generation is taken as the j-th dimension value of the mutated individual, otherwise it takes the j-th dimension value of MX.

[0102] The last stage is the selection stage. At this time, if the fitness value of the new individual U generated after mutation crossover is better, the new individual U is selected and saved in the population; otherwise, the original individual is used.

[0103] The election of cluster heads is based on the GOADE algorithm. The fitness function designed by the present invention is as follows, which takes into account the average distance within the cluster, the distance between the base station and the cluster head node, and the energy of the cluster head.

[0104]

[0105]

[0106] Among them, f 1 It represents the maximum value of the average distance between the cluster head node and the non-cluster head nodes; is the node nCH in the cluster i Cluster head node The total distance between them; node_n is the number of nodes in the cluster. 2 Indicates the maximum distance from the base station to the cluster head node; From base station BS to cluster head node distance.

[0107] Formula (23) is the final form of the fitness function:

[0108]

[0109] Among them, f is the fitness function; β is the weight parameter, and β takes the value of 0.2; Represents the total energy of all cluster heads.

[0110] Step 3: Use the improved Gannet algorithm to select cluster heads and perform clustering of wireless sensor networks. The specific process is as follows:

[0111] Step 3.1, initialize the parameters of the GOADE algorithm, the gannet population and the number of iterations, and regard the cluster head nodes as the gannets in the GOADE algorithm, that is, each gannet represents a candidate for a cluster head node;

[0112] Step 3.2, assign candidate cluster heads to the gannet population;

[0113] Step 3.3, use the GOADE algorithm to iterate, use the proposed fitness function to calculate the fitness function value, the cluster head with the smallest value is the best cluster head, after the cluster head is selected by the GOADE algorithm and the fitness function, each cluster head node broadcasts, and each non-cluster head node selects the nearest cluster head node to join the cluster until there are no redundant non-cluster head nodes, thus forming multiple clusters.

[0114] Step 3.4, then tell each cluster the final result, aggregate the data through the cluster head, and transmit the data information to the base station;

[0115] Step 3.5: Determine whether all nodes in the current network have exhausted their energy. If all nodes have exhausted their energy, the process ends, and the network life of the WSN ends.

[0116] The present invention uses MATLAB R2022 for simulation. By comparing with the traditional cluster routing algorithm LEACH, the total remaining energy of the network, the network life, and the data packets received by the base station are analyzed to verify the performance of the present invention. The simulation parameters are as described in Table 1. The simulated network model is as follows: Figure 3 shown.

[0117] Table 1 Simulation parameter settings

[0118]

[0119] Figure 4 is the energy consumption of the algorithm. Figure 4 As shown in FIG. 1 , the energy consumption curve of the GOADE algorithm of the present invention is always above the energy consumption curve of the LEACH protocol. The LEACH protocol runs out of energy around the 357th round, but the energy of the algorithm of the present invention is maintained until the 552th round. Figure 4 It can be seen that GOADE has significantly more residual energy than LEACH. When the total energy of LEACH is 0, GOADE still has about 12.23 J left. This shows that the total energy consumption of the network in the algorithm of the present invention is slower and the network life cycle is longer.

[0120] Figure 5This is a comparison of the number of packets received by the base station over time. It can be seen that when all nodes die, the number of packets received by the base station reaches the maximum value. Figure 5 The data received by the base station using the GOADE algorithm is 2664 bits, and the data received by the base station using the LEACH algorithm is 2078 bits. It can be seen that the data information transmission capacity is increased by about 28%.

[0121] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A wireless sensor network clustering method based on an improved Gannet optimization algorithm, characterized in that: The steps include: Step 1: Construct a clustering model of wireless sensor network; Step 2: Construct an improved Gannet optimization algorithm and design a fitness function; In step 2, the differential evolution algorithm is integrated into the last part of the exploration phase of the traditional gannet algorithm to construct an improved gannet optimization algorithm; the traditional gannet algorithm includes population initialization, exploration phase, and development phase. After completing the calculation of the position update formula (9) in the exploration phase, the calculation of formulas (19) and (20) is performed, and finally the algorithm development phase is entered: u2=(2*r4-1)*a*(X i (t)-X r (t)) (10): v2=(2*r5-1)*b*(X i (t)-X m (t)) (11); Among them, MX i (t+1) indicates the i-th individual in the storage matrix MX at the t+1th iteration; r4 and r5 are both random numbers between 0 and 1; u1 is a random number between -a and a; u2 is the optimization of U-shaped diving; v1 is a random number between -b and b; v2 is the optimization of V-shaped diving; X i (t) is the position of the i-th individual in the current population at the t-th iteration; X r (t) is a randomly selected individual in the current population; X m (t) represents the average position of all individuals in the current population; V i,t =MX best,t +F*(MX r1,t -MX r2,t ) (19); Among them, V i,t represents the i-th individual at the t-th iteration; MX best,t is the current global optimal solution; F is the scaling factor; MX r1,t is a random individual; MX r2,t is a different individual randomly selected from the other N-1 individuals; Among them, U i,j is the offspring individual obtained after crossover; V i,j is a mutated individual; MX i,j is the original parent individual; Cr is the crossover probability; j rand is a random variable, when rand(0,1)≤Cr or j=j rand When , the j-th dimension of the i-th individual in the new generation is the j-th dimension value of the mutated individual, otherwise it is the j-th dimension value of MX; Step 3: Use the improved Gannet algorithm to elect cluster heads and perform clustering in the wireless sensor network.

2. The wireless sensor network clustering method based on the improved Gannet optimization algorithm according to claim 1 is characterized in that: The specific process of step 1 is as follows: a plurality of sensor nodes are randomly distributed in a two-dimensional network area and divided into a plurality of clusters, a base station is located outside the range of the sensor nodes, a node is selected from the cluster as a cluster head, and other non-cluster head nodes select the nearest cluster head to form a cluster; the base station is connected to the user via the Internet.

3. The wireless sensor network clustering method based on the improved Gannet optimization algorithm according to claim 2 is characterized in that: In step 1, when sending data in the wireless sensor network, the energy consumed by the cluster head node to send an n-bit data packet is: AND Txc =(And elect +E agr )*n+E amp *n*d 2 (1); The energy consumed by a non-cluster head node to send an n-bit data packet is: E Tx =E elect *n+E amp *n*d 2 (2); Among them, E Txc is the energy consumed by the cluster head node’s transmitter when sending an n-bit data packet; E Tx is the energy consumption of non-cluster head nodes when sending messages; E elect is the energy consumption requirement for transmission or reception; E agr It represents the energy consumed by the cluster head node when aggregating a single data; E amp is the amplification factor; n is the number of bits of the received or sent data packet; d is the distance between the sensor node and the corresponding cluster head node; The energy consumption of the cluster head node after receiving n-bit data packets and processing the data is: AND Rx =(And re +E agr )*n (3); Among them, E Rx It represents the energy required by the cluster head node to receive n-bit data packets; E re It represents the energy consumed by the cluster head node when receiving a single data.

4. The wireless sensor network clustering method based on the improved Gannet optimization algorithm according to claim 1 is characterized in that: In step 2, the designed fitness function is as follows: Where f1 represents the maximum value of the average distance between the cluster head node and the non-cluster head nodes; is the node nCH in the cluster i Cluster head node The total distance between them; node_n is the number of nodes in the cluster; f2 represents the maximum distance from the base station to the cluster head node; From base station BS to cluster head node distance; Formula (23) is the final form of the fitness function: Among them, f is the fitness function; β is the weight parameter; Represents the total energy of all cluster heads.

5. The wireless sensor network clustering method based on the improved Gannet optimization algorithm according to claim 1 is characterized in that: The specific process of step 3 is as follows: Step 3.1, initialize the parameters of the improved gannet algorithm, the gannet population and the number of iterations, regard the cluster head nodes as gannets in the improved gannet algorithm, and each gannet represents a candidate for a cluster head node; Step 3.2, assign candidate cluster heads to the gannet population; Step 3.3, use the improved Gannet algorithm to iterate, use the proposed fitness function to calculate the fitness function value, the cluster head with the smallest value is the best cluster head, after the cluster head is selected by the improved Gannet algorithm and the fitness function, each cluster head node broadcasts, and each non-cluster head node selects the nearest cluster head node to join the cluster until there are no redundant non-cluster head nodes, thus forming multiple clusters; Step 3.4, then tell each cluster the final result, aggregate the data through the cluster head, and transmit the data information to the base station; Step 3.5: Determine whether all nodes in the current network have exhausted their energy. If all nodes have exhausted their energy, the process ends, and the network life of the WSN ends.