Method and system for LEACH routing protocol based on optimized gold mining algorithm

By introducing an optimized gold thrust algorithm into the LEACH protocol, optimizing cluster head selection and data transmission methods, the energy dissipation problems caused by uneven cluster head selection and single-hop data transmission in the LEACH protocol are solved, and a more balanced energy distribution and a longer network life cycle are achieved.

CN119450641BActive Publication Date: 2025-05-23ZHEJIANG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510020429.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-23
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

In the LEACH protocol, the cluster head selection is uneven, resulting in energy-rich nodes being underutilized, while energy-poor nodes are frequently selected as cluster heads, resulting in non-uniform energy dissipation. At the same time, single-hop data transmission will quickly exhaust energy when the cluster head node is far away from the base station, affecting the connectivity and stability of the network.

Method used

The LEACH routing protocol based on the optimization gold rush algorithm is adopted, and the number of cluster heads and fitness functions are optimized by introducing Kent mapping, adaptive Levy flight and Cauchy variant mechanisms, and the cluster heads are dynamically elected, and a hierarchical progressive method is adopted in the data transmission stage to shorten the length of the data transmission path.

Benefits of technology

It effectively reduces the overall energy consumption of the network, balances the energy distribution of each node, extends the life cycle of the network, and improves the stability and reliability of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450641B_ABST
    Figure CN119450641B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of routing protocol technology, and in particular to a method and system for a LEACH routing protocol based on an optimized gold panning algorithm, the method comprising the following steps: 1. Optimizing the LEACH protocol based on the optimized gold panning algorithm, including calculating the optimal cluster head number formula and designing a fitness function, wherein the optimization of the gold panning algorithm includes introducing Kent mapping, adaptive Levy flight, and Cauchy mutation mechanism; 2. Optimizing the data transmission phase according to the optimized LEACH protocol. The present invention is based on a method and system for a LEACH routing protocol based on an optimized gold panning algorithm, adopts an optimized gold panning algorithm in cluster head election, dynamically elects cluster heads, and comprehensively considers factors such as node residual energy, distance from a node to a base station, and number of neighboring nodes when designing a fitness function, in order to find the optimal cluster head combination, thereby reducing the overall energy consumption of the network and balancing the energy of each node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of routing protocols, and in particular relates to a method and system for a LEACH routing protocol based on an optimized gold-mining algorithm. Background Art

[0002] Wireless Sensor Network (WSN) is a self-organizing network composed of a large number of distributed sensor nodes, which can collect data in various environments and transmit and process data through wireless communication. In remote areas such as mines, deserts, and islands, WSN nodes often rely on limited micro-batteries for power supply, and the replacement cost is high. For this reason, improving the energy efficiency of WSN has become a research focus in this field. Among them, optimizing routing protocols is an effective way to reduce energy consumption. Low Energy Adaptive Clustering Hierarchy (LEACH) is a commonly used clustering routing protocol in wireless sensor networks. This protocol effectively improves the energy utilization efficiency of nodes in wireless sensor networks through a cluster head selection mechanism, and simplifies network management through a hierarchical structure. However, this method of the prior art also has some inherent limitations, as follows:

[0003] 1) Unbalanced cluster head selection in the LEACH protocol. Since the selection of cluster heads depends entirely on random probability, this mechanism may cause energy-rich nodes to be underutilized, while energy-poor nodes may be frequently elected as cluster heads, resulting in uneven energy dissipation.

[0004] 2) The LEACH protocol only uses a single hop for data transmission during the data transmission phase. When the cluster head node is far away from the base station, single-hop data transmission will cause the cluster head node to quickly run out of energy, which will affect the connectivity and stability of the entire network, limiting the effective operation time and reliability of the network. Summary of the invention

[0005] In order to solve the problems raised in the above background technology, the present invention provides a method of LEACH routing protocol based on optimized gold mining algorithm.

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] A method for LEACH routing protocol based on an optimized gold rush algorithm, the method comprising the following steps:

[0008] S1, optimization of LEACH protocol based on optimized gold panning algorithm, including calculation of optimal cluster head number formula and fitness function design; optimization of gold panning algorithm, including introduction of Kent mapping, adaptive Levy flight and Cauchy mutation mechanism;

[0009] S2, optimizing data transmission according to the LEACH protocol optimized in step S1.

[0010] Preferably, in step S1, the optimized gold panning algorithm comprises the following specific steps:

[0011] Step 1: Use Kent mapping to initialize the initial position of the gold digger;

[0012] Step 2: Calculate the fitness value of the gold diggers in the initial population;

[0013] Step 3: Determine whether the position is better than the previous round position according to the fitness value. If so, update the position; otherwise, return to the original position and update the historical optimal gold mine position;

[0014] Step 4: Determine whether it is trapped in the local optimum. If so, perform Cauchy mutation on the individual positions of all gold diggers and then go to step 5; if not, go directly to step 5;

[0015] Step 5: Take a random value m for each individual gold digger;

[0016] Step 6: Determine whether the individual random value m of the gold diggers is greater than or equal to 2 / 3. If so, perform migration operations on these gold diggers and then go to step 9; if not, go to step 7;

[0017] Step 7: Determine whether the individual random value m of the gold diggers is greater than or equal to 1 / 3. If so, these gold diggers perform gold digging operations and then go to step 9; if not, go to step 8;

[0018] Step 8: The gold diggers perform collaborative operations and then proceed to step 9;

[0019] Step 9: Determine whether the termination condition is met. If so, output the optimal individual and the process ends; if not, perform adaptive Levy flight on the historical optimal gold mine location information and go to step 2.

[0020] Preferably, in step S1, the randomness and unpredictability of Kent mapping are used to initialize the population position, which can effectively overcome the limitations of random initialization, thereby improving the operating efficiency and convergence speed of the gold panning algorithm. The expression of Kent mapping is as shown in formula (1):

[0021] (1)

[0022] In the formula, represents the next value in the sequence, Represents the current value in the sequence. a is a constant with a value range of (0, 1).

[0023] Preferably, in step S1, an adaptive Levy flight is introduced. In each round of cluster head election, an adaptive Levy flight is performed on the historical optimal solution to explore whether there is a better solution around it. By introducing the adaptive Levy flight strategy, the gold panning algorithm can enhance the ability to explore unknown areas while tracking the current optimal solution. The mathematical expression of Levy flight is as shown in formula (2):

[0024] (2)

[0025] In the formula represents the position of the current historical optimal solution after adaptive Levy flight transformation, Indicates the location of the current historical optimal solution, represents the convergence factor, preferably 0.01, Represents element-wise multiplication; represents the random search path, as shown in formula (3):

[0026] (3)

[0027] In the formula, The value range is , preferably ; and are two independent random variables, which are usually drawn from a standard normal distribution, As shown in formula (4), As shown in formula (5):

[0028] (4)

[0029] (5)

[0030] In formula (4) and formula (5), represents a normal distribution; and Represent random variables and The standard deviation of (i.e., the square root of the variance); and The values ​​are as follows:

[0031] , (6)

[0032] In the formula, is the Gamma function, and its mathematical expression is shown in formula (7):

[0033] (7)

[0034] Here, p represents the integral variable, which is a dummy variable, meaning that its name can be changed without affecting the result of the integral. In this context, p represents any real value from 0 to positive infinity. q is the parameter of the Gamma function, which can be any positive real number. d is part of the integral symbol, indicating that the integral is performed over the variable p.

[0035] The mathematical expression of the adaptive Levy flight strategy is shown in formula (8):

[0036] (8)

[0037] in, Indicates that at time moment, i.e. the position vector of the next time step, represents the position vector at time t; is the adaptive value, as shown in formula (9):

[0038] (9)

[0039] In the formula, h represents the current number of iterations, and maxh represents the set total number of iterations.

[0040] Preferably, in step S1, a Cauchy mutation strategy is introduced. When the algorithm falls into a local optimal solution, a Cauchy mutation is performed on all current gold digger populations. By adding disturbances, the diversity of the population is maintained and the ability to jump out of the local optimal solution is enhanced. The mathematical expression of the Cauchy mutation is shown in formula (10):

[0041] (10)

[0042] in, Indicates that at time moment, i.e. the position vector of the next time step, represents the position vector at time t; represents a random variable generated based on one-dimensional Cauchy distribution, and its probability density function is expressed as shown in formula (11):

[0043] (11)

[0044] Where s is a continuous random variable that can take any value from negative infinity to positive infinity, and c represents the scale parameter.

[0045] Preferably, in step eight of the gold panning algorithm, an adaptive value is introduced into the cooperation mechanism of the gold panning algorithm. , the modified collaboration formula is shown in formula (12):

[0046] (12)

[0047] in, Indicates that at time moment, i.e. the position vector of the next time step, represents the position vector at time t; in the early stage, the larger The value makes the individual more dependent on the current position, which helps to quickly converge to a better solution; in the later stage, the smaller The value reduces the dependence on the current individual position and enhances the individual's exploration ability, which helps the algorithm to escape from the local optimal solution. is a random value between 0 and 1. represents the collaboration vector, as shown in formula (13):

[0048] (13)

[0049] In the formula, and Represents the location information of two randomly selected gold diggers in the gold digger population at time t.

[0050] Preferably, in step S1, the optimal number of cluster heads is calculated as follows:

[0051] Assume that the number of cluster heads is k, the monitoring area is a L*L rectangle, and the energy consumption of each cluster head includes the energy consumption of receiving data from ordinary nodes in the cluster , as shown in formula (15); the energy consumption of the data received by fusion , as shown in formula (16); the energy consumption of sending data to the base station , as shown in formula (17); the total energy consumption of the cluster head , as shown in formula (14); specifically as follows:

[0052] (14)

[0053] (15)

[0054] (16)

[0055] In the formula, is the length of the data to be sent, is the energy consumed to send 1 bit of data, N is the number of all nodes, It represents the energy consumed by fusing 1 bit of data;

[0056] (17)

[0057] In the formula, represents the fourth power of the distance from the cluster head node to the base station, is the multipath fading model coefficient;

[0058] Therefore, the energy consumed by each cluster head As shown in formula (18):

[0059] (18)

[0060] Ordinary nodes use the free space model, and the energy consumption is shown in formula (19), where: represents the square of the distance from the common node to the cluster head, are the coefficients of the free decay model:

[0061] (19)

[0062] Therefore, the total energy consumed in each cluster is:

[0063] (20)

[0064] The area of ​​each cluster is / k, the perception area is randomly distributed, and the distribution density is , let the cluster head be located at the center of the cluster, then:

[0065] (twenty one)

[0066] in, represents the expected value of the square of the distance to the cluster head; and The horizontal and vertical coordinates of a point in the perception area in the Cartesian coordinate system; represents the distribution density function within the perception area, defined in the Cartesian coordinate system; and Represents radial distance and angle in polar coordinate system;

[0067] Assume that the radius of this area ,and In r and is constant, then formula (21) can be simplified to:

[0068] (twenty two)

[0069] Assuming that the cluster node density is constant, , ;

[0070] Therefore, the energy consumption of the entire area is:

[0071] (twenty three)

[0072] By taking the derivative of k, we can get the formula for the optimal number of cluster heads K:

[0073] (twenty four).

[0074] Preferably, in step S1, the fitness function is designed as follows:

[0075] Reduce the probability of nodes with energy below the threshold becoming cluster heads:

[0076] (25)

[0077] In the formula, represents the average residual energy of the cluster head combination, represents the remaining power of a single node, and N represents the number of cluster head nodes;

[0078] When considering the suitability of a node as a cluster head, its distance from the base station is a factor that cannot be ignored. As shown in formula (26), its function is to reduce the probability of nodes at the edge of the network becoming cluster heads:

[0079] (26)

[0080] In the formula, Represents a normal node The distance to the base station, represents the average distance from the cluster head to the base station;

[0081] The expression for calculating the neighbor nodes of the cluster head node to be selected is shown in formula (27):

[0082] (27)

[0083] In the formula Represents the number of nodes that meet the conditions and, Representation Node , Representation Node , For Node The competition radius, Representation Node and The distance between is the set of neighbor nodes;

[0084] The LEACH routing protocol based on the optimized gold rush algorithm (C-CLGRO-LEACH) protocol allows ordinary nodes to join the cluster closest to them first when forming clusters, thereby optimizing the distribution structure of clusters. When calculating the number of neighbor nodes, each node should only belong to the nearest cluster head to avoid being repeatedly counted in the statistical range of neighbor nodes by multiple cluster heads, effectively avoiding cluster heads from appearing in areas with high node density, thereby avoiding the problem of uneven clustering. Its expression is shown in formula (28):

[0085] (28)

[0086] In the formula Indicates the minimum value, represents the distance between node j and its nearest cluster head;

[0087] Neighbor node number factor of cluster head set The expression is shown in formula (29), which is used to reduce the probability of a node with a small number of neighbor nodes becoming a cluster head:

[0088] (29)

[0089] The final fitness function expression is shown in formula (30):

[0090] (30)

[0091] In the formula, is the weight coefficient, and the sum of the three is 1.

[0092] Preferably, in step S2, the specific steps of optimizing the data transmission phase include:

[0093] Cluster head node distance calculation and sorting: The base station will calculate the distance from each cluster head node to the base station and sort these distances from large to small. Assuming that there are N cluster head nodes in the network, a list [N, N-1, N-2, …, 2, 1] is formed after sorting. Among them, cluster head node No. N is the farthest from the base station, and cluster head node No. 1 is the closest to the base station. This sorting provides a basis for subsequent data transmission path planning;

[0094] Forward cluster head node selection: The base station first calculates the distance from the Nth cluster head node farthest from the base station to other cluster head nodes based on the relative distance between the cluster head node and other cluster head nodes in the list, and selects a set of forward cluster head nodes closer to the base station. In this set, a cluster head node is selected so that the sum of the distance from the Nth cluster head node to the node and the distance from the node to the base station is minimized. The node is set as the next hop node of the Nth cluster head node and the information is recorded. Subsequently, the entire list [N, N-1, N-2, …, 2, 1] is traversed in sequence, and the corresponding next hop node is calculated and recorded for each cluster head node. If a cluster head node does not have a qualified forward cluster head node, the base station is directly used as its next hop node.

[0095] Hierarchical progressive data transmission: The base station sends data transmission instructions and next-hop nodes to the cluster head nodes in sequence according to the order of cluster head nodes [N, N-1, N-2, …, 2, 1]. Before receiving the transmission instruction, the cluster head node is responsible for receiving and fusing the data from the previous hop cluster head node; after receiving the transmission instruction from the base station, the cluster head node transmits the fused data to its next hop node. The transmission process is carried out step by step until the data of all cluster head nodes are successively gathered and successfully transmitted to the base station.

[0096] The present invention also discloses a system of LEACH routing protocol based on optimized gold panning algorithm, which is used to execute the above method, and the system includes the following modules:

[0097] LEACH protocol optimization module: optimizes the LEACH protocol based on the optimized gold panning algorithm, including the calculation of the optimal number of cluster heads and the design of the fitness function; optimizes the gold panning algorithm, including the introduction of Kent mapping, adaptive Levy flight and Cauchy mutation;

[0098] Data transmission module: Optimizes data transmission according to the optimized LEACH protocol.

[0099] Compared with the prior art, the present invention has the following beneficial effects:

[0100] The method and system of the LEACH routing protocol based on the optimized gold-mining algorithm proposed in the present invention adopt the optimized gold-mining algorithm to dynamically elect cluster heads, and when designing the fitness function, comprehensively consider factors such as the node's remaining energy, the distance from the node to the base station, and the number of neighboring nodes, in order to find the optimal cluster head combination, thereby reducing the overall energy consumption of the network and balancing the energy of each node. In the data transmission stage, a hierarchical and progressive data transmission method is adopted, thereby effectively shortening the length of the data transmission path and reducing the energy consumed by data transmission. After simulation, the results show that the C-CLGRO-LEACH protocol can further extend the network life cycle and reduce the overall energy consumption of the network. The research results of the present invention explore a new method for low-power control of wireless sensor networks, and also provide a useful reference for the optimization of related low-power routing protocols. BRIEF DESCRIPTION OF THE DRAWINGS

[0101] Figure 1 A method flow chart of a LEACH routing protocol based on an optimized gold-mining algorithm in a preferred embodiment of the present invention;

[0102] Figure 2 The flowchart of the gold panning algorithm optimized for the preferred embodiment of the present invention;

[0103] Figure 3 This is a data transmission flow chart of a preferred embodiment of the present invention;

[0104] Figure 4 This is a comparison diagram of the number of remaining nodes in the network of the present invention;

[0105] Figure 5 It is the residual energy diagram of the network of the present invention;

[0106] Figure 6 This is a graph of the number of first node failure rounds of different algorithms of the present invention;

[0107] Figure 7 It is the average residual energy diagram of nodes of the present invention;

[0108] Figure 8 It is the variance diagram of the average residual energy of nodes of the present invention;

[0109] Fig. 9 It is a graph of the amount of data packets sent through the network of the present invention;

[0110] Fig.10 The system block diagram of a LEACH routing protocol based on an optimized gold-mining algorithm according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0111] In order to make the purpose and technical solution of the present invention clearly and completely described, and the advantages more clearly understood, the embodiments of the present invention are further described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, rather than all of the embodiments, and are only used to explain the embodiments of the present invention, and are not used to limit the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0112] This embodiment provides a method for LEACH routing protocol based on an optimized gold rush algorithm, the method comprising the following steps:

[0113] 1. Optimize the LEACH protocol based on the optimized gold panning algorithm, including the calculation of the optimal number of cluster heads and the design of the fitness function; optimize the gold panning algorithm, including the introduction of Kent mapping, adaptive Levy flight and Cauchy mutation;

[0114] 2. Optimize data transmission according to the LEACH protocol optimized in step 1.

[0115] like Figure 2 As shown, the specific steps of optimizing the gold mining algorithm are as follows:

[0116] Step 1: Use Kent mapping to initialize the initial position of the gold digger;

[0117] Step 2: Calculate the fitness value of the gold diggers in the initial population;

[0118] Step 3: Determine whether the position is better than the previous round position according to the fitness value. If so, update the position; otherwise, return to the original position and update the historical optimal gold mine position;

[0119] Step 4: Determine whether it is trapped in the local optimum. If so, perform Cauchy mutation on the individual positions of all gold diggers and then go to step 5; if not, go directly to step 5;

[0120] Step 5: Take a random value m for each individual gold digger;

[0121] Step 6: Determine whether the individual random value m of the gold diggers is greater than or equal to 2 / 3. If so, perform migration operations on these gold diggers and then go to step 9; if not, go to step 7;

[0122] Step 7: Determine whether the individual random value m of the gold diggers is greater than or equal to 1 / 3. If so, these gold diggers perform gold digging operations and then go to step 9; if not, go to step 8;

[0123] Step 8: The gold diggers perform collaborative operations and then proceed to step 9;

[0124] Step 9: Determine whether the termination condition is met. If so, output the optimal individual and the process ends; if not, perform adaptive Levy flight on the historical optimal gold mine location information and go to step 2.

[0125] In this embodiment, Kent mapping, adaptive Levy flight and Cauchy mutation mechanism are introduced to optimize the gold panning algorithm. The randomness and unpredictability of Kent mapping are used to initialize the population position, which can effectively overcome the limitations of random initialization, thereby improving the operating efficiency and convergence speed of the gold panning algorithm. The expression of Kent mapping is as shown in formula (1):

[0126] (1)

[0127] In the formula, represents the next value in the sequence, Represents the current value in the sequence. a is a constant with a value range of (0, 1).

[0128] This embodiment also introduces adaptive Levy flight. In each round of cluster head election, an adaptive Levy flight is performed on the historical optimal solution to explore whether there is a better solution around it. By introducing the adaptive Levy flight strategy, the gold panning algorithm can enhance the ability to explore unknown areas while tracking the current optimal solution. The mathematical expression of Levy flight is as follows:

[0129] (2)

[0130] In the formula represents the position of the current historical optimal solution after adaptive Levy flight transformation, Indicates the location of the current historical optimal solution, represents the convergence factor, which is 0.01 in this embodiment. Represents element-wise multiplication; represents the random search path, as shown in formula (3):

[0131] (3)

[0132] In the formula, The value range is , in an embodiment, ; and are two independent random variables, which are usually drawn from a standard normal distribution, As shown in formula (4), As shown in formula (5):

[0133] (4)

[0134] (5)

[0135] In formula (4) and formula (5), represents a normal distribution; and Represent random variables and The standard deviation of (i.e., the square root of the variance); and The values ​​are as follows:

[0136] , (6)

[0137] In the formula, is the Gamma function, and its mathematical expression is shown in formula (7):

[0138] (7)

[0139] Here, p represents the integral variable, which is a dummy variable, meaning that its name can be changed without affecting the result of the integral. In this context, p represents any real value from 0 to positive infinity. q is the parameter of the Gamma function, which can be any positive real number. d is part of the integral symbol, indicating that the integral is performed over the variable p.

[0140] The mathematical expression of the adaptive Levy flight strategy is shown in formula (8):

[0141] (8)

[0142] in, Indicates that at time moment, i.e. the position vector of the next time step, represents the position vector at time t; is the adaptive value, as shown in formula (9):

[0143] (9)

[0144] In the formula, h represents the current number of iterations, and maxh represents the set total number of iterations.

[0145] In the gold panning algorithm of this embodiment, the Cauchy mutation strategy is introduced. When the algorithm falls into a local optimal solution, the Cauchy mutation is performed on all current gold panner populations. By adding disturbances, the diversity of the population is maintained and the ability to jump out of the local optimal solution is enhanced. The mathematical expression of the Cauchy mutation is shown in formula (10):

[0146] (10)

[0147] in, Indicates that at time moment, i.e. the position vector of the next time step, represents the position vector at time t; represents a random variable generated based on one-dimensional Cauchy distribution, and its probability density function is expressed as shown in formula (11):

[0148] (11)

[0149] Where s is a continuous random variable that can take any value from negative infinity to positive infinity, and c represents the scale parameter.

[0150] In step eight of the gold rush algorithm, an adaptive value is introduced into the cooperation mechanism of the gold rush algorithm. , the modified collaboration formula is shown in formula (12):

[0151] (12)

[0152] in, Indicates that at time moment, i.e. the position vector of the next time step, It represents the position vector at time t. is a random value between 0 and 1. represents the collaboration vector, as shown in formula (13):

[0153] (13)

[0154] In the formula, and Represents the location information of two randomly selected gold diggers in the gold digger population at time t.

[0155] In the early stages, the larger The value makes the individual more dependent on the current position, which helps to quickly converge to a better solution; in the later stage, the smaller The value reduces the dependence on the current individual position and enhances the individual's exploration ability, which helps the algorithm to escape from the local optimal solution.

[0156] This embodiment is based on the LEACH protocol optimization process of the optimized gold panning algorithm, including the calculation of the optimal number of cluster heads and the design of the fitness function; wherein the optimal number of cluster heads is calculated as follows:

[0157] Assume that the number of cluster heads is k, the monitoring area is a L*L rectangle, and the energy consumption of each cluster head includes the energy consumption of receiving data from ordinary nodes in the cluster , as shown in formula (15); the energy consumption of the data received by fusion , as shown in formula (16); the energy consumption of sending data to the base station , as shown in formula (17); the total energy consumption of the cluster head , as shown in formula (14); specifically as follows:

[0158] (14)

[0159] (15)

[0160] (16)

[0161] In the formula, is the length of the data to be sent, is the energy consumed to send 1 bit of data, N is the number of all nodes, It represents the energy consumed by fusing 1 bit of data;

[0162] (17)

[0163] In the formula, represents the fourth power of the distance from the cluster head node to the base station, is the multipath fading model coefficient;

[0164] Therefore, the energy consumed by each cluster head As shown in formula (18):

[0165] (18)

[0166] Ordinary nodes use the free space model, and the energy consumption is shown in formula (19), where: represents the square of the distance from the common node to the cluster head, are the coefficients of the free decay model:

[0167] (19)

[0168] Therefore, the total energy consumed in each cluster is:

[0169] (20)

[0170] The area of ​​each cluster is / k, the perception area is randomly distributed, and the distribution density is , let the cluster head be located at the center of the cluster, then:

[0171] (twenty one)

[0172] in, represents the expected value of the square of the distance to the cluster head; and The horizontal and vertical coordinates of a point in the perception area in the Cartesian coordinate system; represents the distribution density function within the perception area, defined in the Cartesian coordinate system; and Represents radial distance and angle in polar coordinate system;

[0173] Assume that the radius of this area ,and In r and is constant, then formula (21) can be simplified to:

[0174] (twenty two)

[0175] Assuming that the cluster node density is constant, , ;

[0176] Therefore, the energy consumption of the entire area is:

[0177] (twenty three)

[0178] By taking the derivative of k, we can get the formula for the optimal number of cluster heads K:

[0179] (twenty four).

[0180] In step 1 of this embodiment, Figure 3 As shown in Figure 2, the specific operations of fitness function design include:

[0181] Reduce the probability of nodes with energy below the threshold becoming cluster heads:

[0182] (25)

[0183] In the formula, represents the average residual energy of the cluster head combination, represents the remaining power of a single node, and N represents the number of cluster head nodes;

[0184] When considering the suitability of a node as a cluster head, its distance from the base station is a factor that cannot be ignored. As shown in formula (26), its function is to reduce the probability of nodes at the edge of the network becoming cluster heads:

[0185] (26)

[0186] In the formula, Represents a normal node The distance to the base station, represents the average distance from the cluster head to the base station;

[0187] The expression for calculating the neighbor nodes of the cluster head node to be selected is shown in formula (27):

[0188] (27)

[0189] In the formula Represents the number of nodes that meet the conditions and, Representation Node , Representation Node , For Node The competition radius, Representation Node and The distance between is the set of neighbor nodes;

[0190] The LEACH routing protocol based on the optimized gold rush algorithm (C-CLGRO-LEACH) protocol allows ordinary nodes to join the cluster closest to them first when forming clusters, thereby optimizing the distribution structure of clusters. When calculating the number of neighbor nodes, each node should only belong to the nearest cluster head to avoid being repeatedly counted in the statistical range of neighbor nodes by multiple cluster heads, effectively avoiding cluster heads from appearing in areas with high node density, thereby avoiding the problem of uneven clustering. Its expression is shown in formula (28):

[0191] (28)

[0192] In the formula Indicates the minimum value, represents the distance between node j and its nearest cluster head;

[0193] Neighbor node number factor of cluster head set The expression is shown in formula (29), which is used to reduce the probability of a node with a small number of neighbor nodes becoming a cluster head:

[0194] (29)

[0195] The final fitness function expression is shown in formula (30):

[0196] (30)

[0197] In the formula, is the weight coefficient, and the sum of the three is 1.

[0198] In step 2 of this embodiment, the data transmission phase is optimized, specifically including:

[0199] 1) Cluster head node distance calculation and sorting: The base station will calculate the distance from each cluster head node to the base station and sort these distances from large to small. Assuming there are N cluster head nodes in the network, they are sorted into a list [N, N-1, N-2, …, 2, 1], where cluster head node No. N is the farthest from the base station and cluster head node No. 1 is the closest to the base station. This sorting provides a basis for subsequent data transmission path planning;

[0200] 2) Forward cluster head node selection: The base station starts from the Nth cluster head node farthest from the base station according to the relative distance between the cluster head node and other cluster head nodes in the list, calculates its distance to other cluster head nodes, and selects a set of forward cluster head nodes closer to the base station. In this set, a cluster head node is selected so that the sum of the distance from the Nth cluster head node to the node and the distance from the node to the base station is minimized. The node is set as the next hop node of the Nth cluster head node and the information is recorded. Subsequently, the entire list [N, N-1, N-2, …, 2, 1] is traversed in sequence, and the corresponding next hop node is calculated and recorded for each cluster head node. If a cluster head node does not have a qualified forward cluster head node, the base station is directly used as its next hop node.

[0201] 3) Hierarchical progressive data transmission: The base station sends data transmission instructions and next-hop nodes to the cluster head nodes in sequence according to the order of cluster head nodes [N, N-1, N-2, …, 2, 1]. Before receiving the transmission instruction, the cluster head node is responsible for receiving and fusing the data from the previous hop cluster head node; after receiving the transmission instruction from the base station, the cluster head node transmits the fused data to its next hop node. The transmission process is carried out step by step until the data of all cluster head nodes are successively gathered and successfully transmitted to the base station.

[0202] In summary, if Figure 1 As shown, the overall process of a method for a LEACH routing protocol based on an optimized gold rush algorithm in this embodiment is briefly described as follows:

[0203] 1) The base station broadcasts messages to the entire network, and the nodes feedback their own information;

[0204] 2) The base station calculates the optimal number of cluster heads, selects cluster heads using the CLGRO algorithm, and broadcasts the cluster head numbers;

[0205] 3) Ordinary nodes select the nearest cluster head to join the cluster and send data; establish a distance list and calculate the forward cluster head;

[0206] 4) The base station sends a command and determines whether the cluster head has received the command. If so, execute step 5); if not, determine whether the cluster head has received the data information. If so, perform data fusion and return to step 4); if not, directly return to step 4);

[0207] 5) The cluster head sends data to the next hop;

[0208] 6) Determine whether the data transmission is completed. If so, end; if not, return to step 4).

[0209] In order to verify the significant performance of the C-CLGRO-LEACH protocol method of the preferred embodiment of the present invention, the present invention conducts simulation experiments in Matlab, pays attention to indicators such as the number of remaining nodes in the network and the remaining energy of the network, and conducts a performance comparison analysis of the C-CLGRO-LEACH protocol with the existing LEACH protocol, TSI-LEACH protocol and FIGWO protocol.

[0210] In order to verify the performance of the C-CLGRO-LEACH protocol method proposed in this invention, the simulation environment is set in a rectangular area of ​​400m×400m, the base station coordinates are located at (200m, 200m), and contains 400 nodes. The simulation parameters are shown in Table 1:

[0211] Table 1 Network simulation environment parameters

[0212]

[0213] Each protocol is simulated and the results are analyzed as follows:

[0214] Figure 4 This is a comparison chart of the number of remaining nodes in the network of different protocols. Figure 4 It can be seen that in the initial stage, the node failure rate under the TSI-LEACH protocol is significantly lower than that of other algorithms. However, after about 650 rounds of communication, the node failure rate of the TSI-LEACH protocol rises sharply, and at about 750 rounds, the number of surviving nodes is less than that of the C-CLGRO-LEACH protocol of the present invention. Specifically, the rounds in which the nodes of each protocol completely fail are: LEACH protocol in round 1126, FIGWO protocol in round 1633, and C-CLGRO-LEACH protocol of the present invention is delayed to round 2031. Although the TSI-LEACH protocol did not completely fail until the 1617th round, only a small number of nodes remained active after about the 1200th round, indicating that the network function has declined significantly at this stage. These results show that the C-CLGRO-LEACH protocol of the present invention can more effectively balance the load distribution in the network, thereby effectively extending the overall life cycle of the network.

[0215] Figure 5This is a comparison chart of network residual energy of different protocols. Figure 5 It can be seen that in the initial operation stage of the network, the TSI-LEACH protocol has a higher residual energy level; however, its energy consumption rate is significantly higher than other protocols. In contrast, the C-CLGRO-LEACH protocol of the present invention exhibits a higher residual energy value throughout the entire network life cycle. This shows that the C-CLGRO-LEACH protocol of the present invention can effectively balance the energy load between nodes, reduce energy consumption, and thus effectively extend the overall life cycle of the network.

[0216] Figure 6 This is a comparison chart of the first node failure rounds of different protocols. Figure 6 It can be seen that the first node failure time of the LEACH protocol is 141 rounds, the TSI-LEACH protocol is 275 rounds, the FIGWO protocol is 82 rounds, and the C-CLGRO-LEACH protocol of the present invention is 193 rounds. It can be seen that the first node failure time of the C-CLGRO-LEACH protocol of the present invention is later than that of the LEACH protocol and the FIGWO protocol, but earlier than that of the TSI-LEACH protocol. This is because the TSI-LEACH protocol only selects cluster heads based on the energy level of the nodes, so that nodes with higher energy are given priority to become cluster heads, thereby avoiding the premature failure of nodes with lower energy. In contrast, the C-CLGRO-LEACH protocol of the present invention adopts a more comprehensive standard in the cluster head election mechanism. Although its first node failure time is slightly earlier than that of the TSI-LEACH protocol, it performs better in other performance indicators.

[0217] Figure 7 This is a comparison chart of the average residual energy of nodes in different protocols. Figure 7 It can be seen that the C-CLGRO-LEACH protocol of the present invention maintains a relatively high average node residual energy level throughout the entire network life cycle, which indicates that the C-CLGRO-LEACH protocol of the present invention can effectively balance the network load and extend the overall network life cycle.

[0218] Figure 8 It is a comparison chart of the average residual energy variance of nodes in different protocols. Figure 8It can be seen that the LEACH protocol reaches the peak value of the average node residual energy variance at the 268th round, which is about 4.3J; the TSI-LEACH protocol reaches the peak value at the 431st round, which is about 2.4J; the FIGWO protocol reaches the peak value at the 254th round, which is about 5.1J; and the C-CLGRO-LEACH protocol of the present invention reaches the peak value of the average node residual energy variance at the 273rd round, which is about 2.43J. The peak values ​​of the average node residual energy variance of the C-CLGRO-LEACH protocol of the present invention are close to those of the TSI-LEACH protocol, and are significantly lower than those of the LEACH protocol and the FIGWO protocol, which further proves the superior performance of the C-CLGRO-LEACH protocol of the present invention in energy balance.

[0219] Fig. 9 This is a comparison chart of the amount of network data packets sent by different protocols. Fig. 9 It can be seen that in the initial stage, the difference in the amount of data packets sent by each protocol is small, but after entering the mid-term, the gap gradually widens. Specifically, the LEACH protocol sent about 2.5×10^5 data packets at the end of the simulation, the TSI-LEACH protocol sent about 3.0×10^5 data packets, the FIGWO protocol sent about 3.6×10^5 data packets, and the C-CLGRO-LEACH protocol of the present invention sent about 4.6×10^5 data packets, which is significantly more than other protocols. This result proves the effectiveness of the C-CLGRO-LEACH protocol of the present invention in improving network efficiency and extending network life cycle.

[0220] like Fig.10 As shown, this embodiment discloses a system of a LEACH routing protocol based on an optimized gold rush algorithm, which is used to execute the above method. The system includes the following modules:

[0221] LEACH protocol optimization module: optimizes the LEACH protocol based on the optimized gold panning algorithm, including the calculation of the optimal number of cluster heads and the design of the fitness function; optimizes the gold panning algorithm, including the introduction of Kent mapping, adaptive Levy flight and Cauchy mutation;

[0222] Data transmission module: Optimizes data transmission according to the optimized LEACH protocol.

[0223] For other contents of this embodiment, please refer to the above method embodiment.

[0224] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for LEACH routing protocol based on an optimized gold rush algorithm, characterized in that: The method comprises the following steps: Step S1, the base station broadcasts a message to the entire network, and the node feeds back its own information; Step S2, the base station calculates the optimal number of cluster heads, selects cluster heads using the gold-mining optimization CLGRO algorithm based on Cauchy mutation and adaptive Levy flight, and broadcasts the cluster head numbers; Step S3, the common node selects the nearest cluster head to join the cluster and sends data; establishes a distance list and calculates the forward cluster head; Step S4, the base station sends a command and determines whether the cluster head receives the command. If so, execute step S5; if not, determine whether the cluster head receives the data information. If so, perform data fusion and return to step S4. If not, directly return to step S4; Step S5, the cluster head sends data to the next hop; Step S6, determine whether the data transmission is completed, if so, end; if not, return to step S4; In step S2, the optimal number of cluster heads is calculated as follows: Assume that the number of cluster heads is k, the monitoring area is a L*L rectangle, and the energy consumption of each cluster head includes the energy consumption E of receiving data from ordinary nodes in the cluster. RX , as shown in formula (15); the energy consumption of the data received by fusion is E DF , as shown in formula (16); the energy consumption E for sending data to the base station TX , as shown in formula (17); the total energy consumption of the cluster head E CH , as shown in formula (14); specifically as follows: AND CH =And RX +E DF +E TX (14) Where l is the length of the data sent, E elec is the energy consumed to send 1 bit of data, N is the number of all nodes, E DA It represents the energy consumed by fusing 1 bit of data; In the formula, represents the fourth power of the distance from the cluster head node to the base station, ε mp is the multipath fading model coefficient; Therefore, the energy consumed by each cluster head is CH As shown in formula (18): Ordinary nodes adopt the free space model, and the energy consumption is shown in formula (19), where: represents the square of the distance from the common node to the cluster head, ε fs are the coefficients of the free decay model: Therefore, the total energy consumed in each cluster is: The area of ​​each cluster is L 2 / k, the sensing area is randomly distributed with a distribution density of ρ(m,n). Let the cluster head be located at the center of the cluster, then: in, represents the expected value of the square of the distance to the cluster head; m and n represent the abscissa and ordinate of a point in the sensing area in the Cartesian coordinate system; ρ(m, n) represents the distribution density function in the sensing area, defined in the Cartesian coordinate system; r and θ represent the radial distance and angle in the polar coordinate system; Set the area radius And r and θ in ρ(r,θ) are constant, then equation (21) is simplified to: Assuming the cluster node density is constant, then Therefore, the energy consumption of the entire area is: By taking the derivative of k, we can get the formula for the optimal number of cluster heads K: Design the fitness function as follows: Reduce the probability of nodes with energy below the threshold becoming cluster heads: In the formula, E c represents the average residual energy of the cluster head combination, E i represents the remaining power of a single node, N represents the number of all nodes; the distance factor f between the node and the base station D As shown in formula (26): Where, d toBS (i) represents the distance from common node i to the base station, d CtoBS represents the average distance from the cluster head to the base station; The expression for calculating the neighbor nodes of the cluster head node to be selected is shown in formula (27): Number(i)=size{neighbour(s i )|d ij ≤R i ,s i ≠s j } (27) In the formula, size represents the number of nodes that meet the conditions and s i Represents node i, s j represents node j, R i is the competition radius of node i, d ij represents the distance between nodes i and j, neighbor(s i ) is a set of neighbor nodes; When forming a cluster, the LEACH protocol allows ordinary nodes to preferentially join the cluster closest to them. When calculating the number of neighbor nodes, each node only belongs to its nearest cluster head. The expression is shown in formula (28): Number(i)=size{neighbour(s i )|d ij ≤R i ,s i ≠s j ,d ij =min(d jc )} (28) Where min represents the minimum value, d jc represents the distance between node j and its nearest cluster head; The number factor f of neighbor nodes of cluster head set N The expression is shown in formula (29): The final fitness function expression is shown in formula (30): Fit=α·f E +β·f D +γ·f N (30) In the formula, ɑ, β, and γ are weight coefficients; The specific steps of the optimized gold mining algorithm are as follows: Step 1: Use Kent mapping to initialize the initial position of the gold digger; Step 2: Calculate the fitness value of the gold diggers in the initial population; Step 3: Determine whether the position is better than the previous round position according to the fitness value. If so, update the position; otherwise, return to the original position and update the historical optimal gold mine position; Step 4: Determine whether it is trapped in the local optimum. If so, perform Cauchy mutation on the individual positions of all gold diggers and then go to step 5; if not, go directly to step 5; Step 5: Take a random value m for each individual gold digger; Step 6: Determine whether the individual random value m of the gold digger is greater than or equal to 2 / 3. If so, migrate the gold digger and go to step 9; if not, go to step 7; Step 7: Determine whether the individual random value m of the gold digger is greater than or equal to 1 / 3. If so, perform the gold digger operation on the individual gold digger and then go to step 9; if not, go to step 8; Step 8: The gold diggers perform collaborative operations and then proceed to step 9; Step 9: Determine whether the termination condition is met. If so, output the optimal individual; if not, perform adaptive Levy flight on the historical optimal gold mine position and go to step 2.

2. The method of LEACH routing protocol based on optimized gold panning algorithm according to claim 1, characterized in that: The expression of Kent mapping is as follows: Where, X i+1 represents the next value in the sequence, X i Represents the current value in the sequence. a is a constant with a value range of (0, 1).

3. The method of LEACH routing protocol based on optimized gold panning algorithm according to claim 2, characterized in that: The mathematical expression of Levy flight is as follows: Where X * (t+1) represents the position of the current historical optimal solution after adaptive Levy flight transformation, X * (t) represents the current historical optimal solution position, ɑ represents the convergence factor, represents element-wise multiplication; Levy(β) represents the random search path, as shown in formula (3): Where, the value range of β is 1<β<3; u and v are two independent random variables drawn from the standard normal distribution, u is shown in formula (4), and v is shown in formula (5): In formula (4) and formula (5), N(0, σ 2 ) represents the normal distribution; σ u and σ v Represent the standard deviations of random variables u and v respectively; σ u With σ v The values ​​are as follows: Where Γ is the Gamma function, and its mathematical expression is shown in formula (7): Among them, p represents the integral variable, specifically a dummy variable, representing any real value in the range from 0 to positive infinity; q is the parameter of the Gamma function; d is part of the integral symbol, indicating the integration of the variable p; The mathematical expression of the adaptive Levy flight strategy is shown in formula (8): Among them, X(t+1) represents the position vector at time t+1, that is, the next time step, and X(t) represents the position vector at time t; ω is an adaptive value, as shown in formula (9): In the formula, h represents the current number of iterations, and maxh represents the set total number of iterations.

4. The method of LEACH routing protocol based on optimized gold panning algorithm according to claim 3 is characterized in that: The mathematical expression of Cauchy variation is shown in formula (10): Among them, X(t+1) represents the position vector at time t+1, that is, the next time step, and X(t) represents the position vector at time t; cauchy(0,1) represents a random variable generated based on a one-dimensional Cauchy distribution, and the mathematical expression of its probability density function is shown in formula (11): Where s is a continuous random variable that can take any value from negative infinity to positive infinity, and c represents the scale parameter.

5. The method of LEACH routing protocol based on optimized gold panning algorithm according to claim 4 is characterized in that: In step eight of the gold panning algorithm, the adaptive value ω is introduced into the collaborative operation, and the collaborative formula is shown in formula (12): X(t+1)=ω·X(t)+r1·D3 (12) Among them, X(t+1) represents the position vector at time t+1, that is, the next time step, and X(t) represents the position vector at time t; r1 is a random value between 0 and 1; D3 represents the collaboration vector, as shown in formula (13): In the formula, and Represents the location information of two randomly selected gold diggers in the gold digger population at time t.

6. The method for LEACH routing protocol based on optimized gold panning algorithm according to any one of claims 1 to 5, characterized in that: The optimization of data transmission is as follows: Cluster head node distance calculation and sorting: The base station calculates the distance from each cluster head node to the base station and sorts these distances from large to small. Suppose there are a total of N cluster head nodes in the network. After sorting, a list [N, N-1, N-2, …, 2, 1] is formed, among which cluster head node No. N is the farthest from the base station, and cluster head node No. 1 is the closest to the base station. Forward cluster head node selection: The base station starts from the Nth cluster head node farthest from the base station according to the relative distance between the cluster head node and other cluster head nodes in the list, calculates its distance to other cluster head nodes, and selects the forward cluster head node set whose distance to the base station is less than the threshold. In this set, select a cluster head node so that the sum of the distance from the Nth cluster head node to the node and the distance from the node to the base station is minimized, set it as the next hop node of the Nth cluster head node, and record the next hop node. Then, traverse the entire list [N, N-1, N-2, …, 2, 1] in turn, calculate and record the corresponding The next hop node of a cluster head node. If a cluster head node does not have a qualified forward cluster head node, the base station is directly used as its next hop node; hierarchical progressive data transmission: the base station sends data transmission instructions and next hop nodes to the cluster head nodes in sequence according to the ranking of the cluster head nodes [N, N-1, N-2, …, 2, 1]. Before receiving the transmission instruction, the cluster head node is responsible for receiving and fusing the data from the previous hop cluster head node; after receiving the transmission instruction from the base station, the cluster head node transmits the fused data to its next hop node, and the transmission process is carried out step by step until the data of all cluster head nodes are successively gathered and transmitted to the base station.

7. A system for LEACH routing protocol based on an optimized gold rush algorithm, for executing the method according to any one of claims 1 to 6, characterized in that: The system includes the following modules: LEACH protocol optimization module: optimizes the LEACH protocol based on the optimized gold panning algorithm, including the calculation of the optimal number of cluster heads and the design of the fitness function; optimizes the gold panning algorithm, including the introduction of Kent mapping, adaptive Levy flight and Cauchy mutation; Data transmission module: Optimizes data transmission according to the optimized LEACH protocol.