DV-Hop method based on improved locust search algorithm
By improving the grasshopper search algorithm, combining Levy flight, golden sine strategy and elite Gaussian mutation operator, the problem of low positioning accuracy of DV-Hop algorithm in wireless sensor networks is solved, and higher positioning accuracy and global search capabilities are achieved.
Patent Information
- Application Number
- CN202411155489.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-13
AI Technical Summary
The DV-Hop algorithm in existing wireless sensor networks has large errors in the calculation of the distance between nodes, resulting in low positioning accuracy of unknown nodes.
The DV-Hop method based on the improved grasshopper search algorithm is adopted to improve the search speed by integrating Levy flight and gold sine strategies, and the elite Gaussian mutant operator and adaptive attenuation factor are introduced to enhance the global search capability, and the dynamic weighting factor is used to correct the jump distance. Improve grasshopper search algorithm to improve positioning accuracy.
It effectively reduces the error of unknown node positioning, improves positioning accuracy, enhances the algorithm's global search capability, and is suitable for wireless sensor networks in complex environments.
Smart Images

Figure CN119136305A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of wireless sensor network node positioning, in particular to a DV-Hop method based on an improved grasshopper search algorithm. Background Art
[0002] In recent years, with the development of wireless sensor technology, wireless sensor networks have been widely used in military safety, forest fire prevention, environmental monitoring and other fields. In many fields of application, the information perceived by the sensor network is very important, but in most cases, people need the location of the information. However, the two-dimensional WSN positioning method cannot accurately reflect the spatial differences such as environmental terrain in complex environments, resulting in large differences in information acquisition. Therefore, three-dimensional positioning algorithms in wireless sensor networks have emerged in recent years. In wireless sensor networks, wireless positioning technology can realize the functions of locating the source of toxic and harmful gas leakage and personnel positioning, such as locating the source of toxic gas leakage in petrochemical plants and locating personnel in petrochemical plants. The construction of micro sensor nodes can greatly save the cost of building the positioning system. At present, the positioning technology in wireless sensor networks is mainly divided into two categories: one is the positioning method based on ranging, which has the advantage of high positioning accuracy but also requires good hardware technology support and high energy consumption, such as positioning method based on signal strength and positioning method based on arrival time; the other is the positioning algorithm independent of distance, which has the advantages of low hardware requirements and relatively low energy consumption, such as centroid algorithm, DV-Hop positioning algorithm, APIT positioning algorithm, etc. Among them, the DV-Hop algorithm, as a typical positioning method without ranging, has been favored by many scholars and applied in practice. The classic DV-hop algorithm establishes the basic framework of wireless sensor non-ranging node positioning, which is of great significance to the hardware implementation of wireless sensor network node positioning, but it still has the following disadvantages: there is a large error in the distance calculation between nodes in the network. The accuracy of directly using the least squares method to estimate unknown nodes is low, so we propose a DV-Hop method based on the improved grasshopper search algorithm to solve the above problems. Summary of the invention
[0003] 1. Technical issues to be resolved
[0004] In view of the deficiencies in the prior art, the present invention provides a DV-Hop method based on an improved grasshopper search algorithm, which solves the problems raised in the above background technology.
[0005] (II) Technical solution
[0006] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions:
[0007] A DV-Hop method based on an improved grasshopper search algorithm comprises the following steps:
[0008] S1: Nodes are randomly arranged in the specified area. Each beacon node broadcasts its location coordinates and hop count information through flooding. After receiving this information, the unknown node calculates the average hop distance and broadcasts the result to the entire network. The specific operation steps include:
[0009] Step S1.1: During network initialization, k beacon nodes and n unknown nodes are randomly deployed in a target area of 100m x 100m;
[0010] Step S1.2: Each beacon node (anchor node) broadcasts its location information to neighboring nodes within its communication range. The receiving node records the shortest hop count to each beacon node and ignores the larger hop count information received from the same beacon node. Then, the receiving node increases the hop count by 1 and continues to forward this information to other neighboring nodes. This process requires the use of the average hop distance formula, which is:
[0011]
[0012] S2: Let the coordinates of the unknown node (x, y) be, and the coordinates of the beacon node be (x i ,y i ), then the fitness function of positioning is:
[0013]
[0014] S3: Generate multiple positioning schemes based on the improved grasshopper algorithm according to the improved tent chaotic map;
[0015] S4: When the iteration starts, the initial optimal positioning solution is calculated according to the fitness function, and the position of the individual with the minimum fitness is determined as the optimal position;
[0016] S5: Based on the original discoverer of the grasshopper search algorithm, this study aims to improve the search speed of the grasshopper search algorithm by integrating Levy flight and golden sine strategy. Through this improvement, an enhanced grasshopper search algorithm is developed. This method uses the long-step jump characteristics of Levy flight to avoid local optimality, while the mutualism strategy promotes information exchange between individuals in the algorithm, thereby accelerating the search for the global optimal solution;
[0017] S6: Based on the original search of the grasshopper search algorithm, this study aims to improve the global search capability of the grasshopper search algorithm by integrating the elite Gaussian mutation operator and the adaptive attenuation factor;
[0018] S7: Use probabilistic mutation at the optimal position to allow the algorithm to make further random selections;
[0019] S8: Based on the corrected hop distance between the beacon node and the unknown node obtained in step 2, the unknown node is located using the improved grasshopper algorithm described in step 3 to obtain the estimated position coordinates of the unknown node;
[0020] S9: Determine whether the current number of iterations reaches the preset number of iterations. If so, output the global optimal solution, that is, the minimum fitness function and the corresponding node position; otherwise, proceed to the next iteration.
[0021] Furthermore, in S3, this study uses an improved tent mapping to initialize the particle distribution. This strategy for optimization and search can effectively maintain the diversity of the population, inhibit the algorithm from falling into the local optimum, and enhance the global search capability. The expression of the tent mapping is as follows:
[0022]
[0023] Furthermore, after the grasshopper lands in S5, the finder places it at any position in the search space. Aiming at the problem that the grasshopper finder search algorithm is prone to fall into the local optimum, the Levy flight perturbation strategy is introduced, so that the algorithm can randomly change between long and short distances, maximize the diversification of the search domain, and enhance the global optimal search capability. Levy flight is a special random walk strategy, which can realize the interweaving of long-term short-distance back-and-forth search trajectories and occasional long-distance search trajectories. Levy flight satisfies both the fine search in a small range so as not to miss the target and the rough search in a large range, avoiding falling into the limitations of local search.
[0024] The length of the motion trajectory of the Levy flight characteristic motion is a randomly changing process without a fixed distribution function. The research summary points out that the distribution density function of the Levy flight step length change can be simply expressed as:
[0025] L(s)~|s -1-β ,0<β≤2
[0026] The s in the formula refers to the Levy motion step length. Mantegna et al. pointed out that s can be obtained from the formula:
[0027]
[0028] Among them, μ and ν are random numbers that conform to the normal distribution. Among them, σ μ , σ ν From the formula:
[0029]
[0030] Among them, the value range of parameter β is 0<β<2, generally β=1.5;
[0031] The golden sine perturbation strategy is introduced to enable the algorithm to randomly change between long and short distances, maximize the diversification of the search domain, and enhance the global optimal search capability. To address the problem of slow convergence, the dynamic learning factor ω is further combined with the levy search strategy and the golden sine strategy, and a nonlinear factor is used for perturbation. The position update is as follows:
[0032]
[0033] Where ω1∈[0,2π], ω2∈[0,π] are random numbers; ε is the golden section coefficient. The specific formula is:
[0034] ε1=a1×h+a2×(1-h)
[0035] ε2=a1×(1-h)+a2×h
[0036] in Where a is [π, -π]
[0037] For each new position calculated by the grasshopper, if it improves the value of the objective function, it will be accepted, otherwise, the grasshopper will maintain its original position. This process is expressed by the following formula, which can be regarded as a greedy rule.
[0038]
[0039] here is to calculate the new position of the i-th grasshopper, is its jth dimension, F i P1 is its objective function value, r is a random number in the interval [0,1], which is an integer randomly selected from the set {1,2}, It is randomly generated at its location on the ground.
[0040] Furthermore, in order to more accurately control the dynamics of the search process in S6, the GOA algorithm introduces an elite Gaussian mutation operator and an adaptive attenuation factor;
[0041] In the second stage of GOA (grasshopper optimization algorithm), namely the exploration stage, the position update simulates the grasshopper's escape behavior when encountering a predator. This stage reflects the local development ability of the algorithm, that is, when a grasshopper is attacked by a predator, it will quickly escape from its current position to a relatively safe position. In order to effectively simulate this escape behavior, the algorithm will generate a random position near the current position of each grasshopper individual. Such a movement strategy not only reflects the dynamic escape mechanism, but also helps to explore the surrounding area of the local solution and improve the efficiency and accuracy of the algorithm in local search. In addition, in order to more accurately regulate the dynamics of the search process, the GOA algorithm adopts an adaptive attenuation factor, which is a function that decreases nonlinearly with the increase of the number of iterations. The expression of the attenuation factor is:
[0042] M∈[0.3,0.7]
[0043] Where t is the current number of iterations, and T is the maximum number of iterations. Due to its exponential form, the decay factor M is larger in the early stage of the search, which makes the search step size of the grasshopper individual larger, so that a wide range of global searches can be performed in the search space, maximizing the use of the global search capability of the algorithm in the early stage. As the number of iterations increases, the value of the decay factor M gradually decreases, and accordingly, the search step size of the grasshopper individual will also become smaller, which helps to improve the accuracy of the search and gradually shift the algorithm from global search to more detailed local search. In order to enhance the search capability of the algorithm, this model also introduces an elite Gaussian mutation operator and an adaptive decay factor. The elite Gaussian mutation operator helps the grasshopper individual jump out of the local optimal solution and increase the search diversity by introducing random Gaussian perturbations. The adaptive decay factor dynamically adjusts the decay rate according to the progress of the search to better balance the globality and locality of the search, further improving the performance and efficiency of the algorithm. The elite Gaussian mutation operator and the adaptive decay factor are added on the basis of the original search:
[0044]
[0045] In the above formula, It is the length of elite variable asynchrony, which is a Gaussian distribution The mutation operator for adaptively adjusting the step size; c4 and r are random numbers uniformly distributed in [0,1]; l is the current iteration number, L is the total iteration number; b is the system parameter that determines the degree of eliteness, and its value is [1,5]. In this paper, the value is b=2; F j is the location of the food source in the j-dimensional space; σ is the standard deviation of the Gaussian distribution;
[0046]
[0047] Similar to the development phase, greedy selection is also used to decide whether to replace or keep the original position;
[0048] In GOA (Grasshopper Optimization Algorithm), for each new position calculated by the grasshopper, the algorithm will evaluate the impact of the position on the objective function value. If the new position provides a better objective function value, then this new position will be accepted as the new coordinates of the grasshopper;
[0049] Mutually beneficial operations generate new individuals:
[0050] X inew =X i +rand -1,1 ·(X best -X j )
[0051] X jnew =X j +rand -1,1 ·(X best -X i )
[0052]
[0053] Furthermore, in the process of searching for the global optimal solution in S7, when the individual in the optimal position falls into the local optimum, the individuals around the individual in the optimal position are also likely to fall into the local optimum. The Gaussian and Cauchy mutation mechanisms are introduced into the algorithm, the local and global optimal positions of the individuals are mutated, and the "greedy" strategy is adopted to select the mutation positions. The specific mutation rules are designed as follows:
[0054]
[0055] In the formula, X * (t) represents the local optimal position of the individual after the Gaussian mutation mechanism mutation; in order to prevent the algorithm instability caused by Gaussian mutation, the optimal position Gaussian Cauchy mutation strategy only occurs with a probability of 0.5.
[0056] Furthermore, in S8, it is assumed that the communication radius of the network is set to R, the connection between the beacon node and its neighbor nodes is divided into m levels, and the actual distance between each beacon node and its neighbor node in the network is recorded as d. In addition, a dynamic weighting factor is introduced to adjust the number of hops, and the factor will change dynamically according to the ratio of the actual distance and the communication radius. The number of hops introduced by the dynamic weighting factor is recorded as:
[0057]
[0058] In actual networks, due to the uneven distribution of nodes in different areas, the average hop distance will also be different. The traditional Dv-hop algorithm only uses a single average hop distance to estimate the distance, which may lead to large errors. In order to more accurately reflect the network status, this paper proposes the following formula to correct the average hop distance of unknown nodes:
[0059]
[0060] hopsize i =w i *hopsize i
[0061] Then the estimated distance between the unknown node and the beacon node can be expressed as:
[0062] d w =h w ×Hopsize i .
[0063] (III) Beneficial effects
[0064] Compared with the prior art, the present invention provides a DV-Hop method based on an improved grasshopper search algorithm, which has the following beneficial effects:
[0065] In actual situations, the average hop distance and the minimum number of hops are inaccurate due to the unevenness of the nodes in the wireless sensor network. In order to reduce this error, the present invention introduces a dynamic weighting factor to improve the calculation accuracy of the average hop distance when calculating the average node hop distance of the unknown node, so as to avoid the positioning error of the unknown node caused by the average hop distance. The present invention uses an improved grasshopper search algorithm to locate the unknown node, replacing the least squares method, so that the error is reduced and the positioning accuracy of the unknown node is enhanced. The grasshopper search algorithm has the characteristics of premature convergence and low global optimization ability, so the global optimization ability of the grasshopper search algorithm is improved. The present invention can effectively reduce the positioning error of the unknown node, better improve the positioning accuracy of the unknown node, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 is a flow chart of the method of the present invention;
[0067] Figure 2 It is a comparison chart of positioning errors between different algorithms under different conditions of anchor nodes;
[0068] Figure 3 It is a comparison chart of positioning errors between different algorithms under different conditions of total nodes;
[0069] Figure 4 It is a comparison chart of positioning errors between different algorithms under different communication radius. DETAILED DESCRIPTION
[0070] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on 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.
[0071] Example
[0072] like Figure 1-4 As shown, a DV-Hop method based on an improved grasshopper search algorithm proposed in one embodiment of the present invention includes the following steps:
[0073] S1: Nodes are randomly arranged in the specified area. Each beacon node broadcasts its location coordinates and hop count information through flooding. After receiving this information, the unknown node calculates the average hop distance and broadcasts the result to the entire network. The specific operation steps include:
[0074] Step S1.1: During network initialization, k beacon nodes and n unknown nodes are randomly deployed in a target area of 100m x 100m;
[0075] Step S1.2: Each beacon node (anchor node) broadcasts its location information to neighboring nodes within its communication range. The receiving node records the shortest hop count to each beacon node and ignores the larger hop count information received from the same beacon node. Then, the receiving node increases the hop count by 1 and continues to forward this information to other neighboring nodes. This process requires the use of the average hop distance formula, which is:
[0076]
[0077] S2: Let the coordinates of the unknown node (x, y) be, and the coordinates of the beacon node be (x i ,y i ), then the fitness function of positioning is:
[0078]
[0079] S3: Generate multiple positioning schemes based on the improved grasshopper algorithm according to the improved tent chaotic map;
[0080] This study uses an improved tent mapping to initialize particle distribution. This strategy for optimization and search can effectively maintain the diversity of the population, prevent the algorithm from falling into local optimality, and enhance the global search capability. The expression of the tent mapping is as follows:
[0081]
[0082] S4: When the iteration starts, the initial optimal positioning solution is calculated according to the fitness function, and the position of the individual with the minimum fitness is determined as the optimal position;
[0083] S5: Based on the original discoverer of the grasshopper search algorithm, this study aims to improve the search speed of the grasshopper search algorithm by integrating Levy flight and golden sine strategy. Through this improvement, an enhanced grasshopper search algorithm is developed. This method uses the long-step jump characteristics of Levy flight to avoid local optimality, while the mutualism strategy promotes information exchange between individuals in the algorithm, thereby accelerating the search for the global optimal solution;
[0084] After the grasshopper lands, the finder places it at any position in the search space. To address the problem that the grasshopper finder search algorithm is prone to fall into the local optimum, the Levy flight perturbation strategy is introduced, which enables the algorithm to randomly change between long and short distances, maximizes the diversification of the search domain, and enhances the global optimal search capability. Levy flight is a special random walk strategy that can achieve long-term short-distance back-and-forth search trajectories interspersed with occasional long-distance search trajectories. Levy flight satisfies both a small-scale fine search so as not to miss the target and a large-scale rough search to avoid falling into the limitations of local search.
[0085] The length of the motion trajectory of the Levy flight characteristic motion is a randomly changing process without a fixed distribution function. The research summary points out that the distribution density function of the Levy flight step length change can be simply expressed as:
[0086] L(s)~|s -1-β ,0<β≤2
[0087] The s in the formula refers to the Levy motion step length. Mantegna et al. pointed out that s can be obtained from the formula:
[0088]
[0089] Among them, μ and ν are random numbers that conform to the normal distribution. Among them, σ μ , σ ν From the formula:
[0090]
[0091] Among them, the value range of parameter β is 0<β<2, generally β=1.5;
[0092] The golden sine perturbation strategy is introduced to enable the algorithm to randomly change between long and short distances, maximize the diversification of the search domain, and enhance the global optimal search capability. To address the problem of slow convergence, the dynamic learning factor ω is further combined with the levy search strategy and the golden sine strategy, and a nonlinear factor is used for perturbation. The position update is as follows:
[0093]
[0094] Where ω1∈[0,2π], ω2∈[0,π] are random numbers; ε is the golden section coefficient. The specific formula is:
[0095] ε1=a1×h+a2×(1-h)
[0096] ε2=a1×(1-h)+a2×h
[0097] in Where a is [π, -π]
[0098] For each new position calculated by the grasshopper, if it improves the value of the objective function, it will be accepted, otherwise, the grasshopper will maintain its original position. This process is expressed by the following formula, which can be regarded as a greedy rule.
[0099]
[0100] here is to calculate the new position of the i-th grasshopper, is its jth dimension, F i P1 is its objective function value, r is a random number in the interval [0,1], which is an integer randomly selected from the set {1,2}, It is randomly generated at its location on the ground.
[0101] S6: Based on the original search of the grasshopper search algorithm, this study aims to improve the global search capability of the grasshopper search algorithm by integrating the elite Gaussian mutation operator and the adaptive attenuation factor;
[0102] In order to more accurately control the dynamics of the search process, the GOA algorithm introduces an elite Gaussian mutation operator and an adaptive attenuation factor;
[0103] In the second stage of GOA (grasshopper optimization algorithm), namely the exploration stage, the position update simulates the grasshopper's escape behavior when encountering a predator. This stage reflects the local development ability of the algorithm, that is, when a grasshopper is attacked by a predator, it will quickly escape from its current position to a relatively safe position. In order to effectively simulate this escape behavior, the algorithm will generate a random position near the current position of each grasshopper individual. Such a movement strategy not only reflects the dynamic escape mechanism, but also helps to explore the surrounding area of the local solution and improve the efficiency and accuracy of the algorithm in local search. In addition, in order to more accurately regulate the dynamics of the search process, the GOA algorithm adopts an adaptive attenuation factor, which is a function that decreases nonlinearly with the increase of the number of iterations. The expression of the attenuation factor is:
[0104] M∈[0.3,0.7]
[0105] Where t is the current number of iterations, and T is the maximum number of iterations. Due to its exponential form, the decay factor M is larger in the early stage of the search, which makes the search step size of the grasshopper individual larger, so that a wide range of global searches can be performed in the search space, maximizing the use of the global search capability of the algorithm in the early stage. As the number of iterations increases, the value of the decay factor M gradually decreases, and accordingly, the search step size of the grasshopper individual will also become smaller, which helps to improve the accuracy of the search and gradually shift the algorithm from global search to more detailed local search. In order to enhance the search capability of the algorithm, this model also introduces an elite Gaussian mutation operator and an adaptive decay factor. The elite Gaussian mutation operator helps the grasshopper individual jump out of the local optimal solution and increase the search diversity by introducing random Gaussian perturbations. The adaptive decay factor dynamically adjusts the decay rate according to the progress of the search to better balance the globality and locality of the search, further improving the performance and efficiency of the algorithm. The elite Gaussian mutation operator and the adaptive decay factor are added on the basis of the original search:
[0106]
[0107] In the above formula, It is the length of elite variable asynchrony, which is a Gaussian distribution The mutation operator for adaptively adjusting the step size; c4 and r are random numbers uniformly distributed in [0,1]; l is the current iteration number, L is the total iteration number; b is the system parameter that determines the degree of eliteness, and its value is [1,5]. In this paper, the value is b=2; F j is the location of the food source in the j-dimensional space; σ is the standard deviation of the Gaussian distribution;
[0108]
[0109] Similar to the development phase, greedy selection is also used to decide whether to replace or keep the original position;
[0110] In GOA (Grasshopper Optimization Algorithm), for each new position calculated by the grasshopper, the algorithm will evaluate the impact of the position on the objective function value. If the new position provides a better objective function value, then this new position will be accepted as the new coordinates of the grasshopper;
[0111] Mutually beneficial operations generate new individuals:
[0112] X inew =X i +rand -1,1 ·(X best -X j )
[0113] X jnew =X j +rand -1,1 ·(X best -X i )
[0114]
[0115] S7: Use probabilistic mutation at the optimal position to allow the algorithm to make further random selections;
[0116] In the process of searching for the global optimal solution, when the individual in the optimal position falls into the local optimum, the individuals around the individual in the optimal position are also likely to fall into the local optimum. The Gaussian and Cauchy mutation mechanisms are introduced into the algorithm to perform mutation operations on the local and global optimal positions of the individuals, and a "greedy" strategy is used to select the mutation positions. The specific mutation rules are designed as follows:
[0117]
[0118] In the formula, X * (t) represents the local optimal position of the individual after the Gaussian mutation mechanism mutation; in order to prevent the algorithm instability caused by Gaussian mutation, the optimal position Gaussian Cauchy mutation strategy only occurs with a probability of 0.5.
[0119] S8: Based on the corrected hop distance between the beacon node and the unknown node obtained in step 2, the unknown node is located using the improved grasshopper algorithm described in step 3 to obtain the estimated position coordinates of the unknown node;
[0120] Assume that the communication radius of the network is set to R, and the connection between the beacon node and its neighbor nodes is divided into m levels. The actual distance between each beacon node and its neighbor nodes in the network is recorded as d. In addition, a dynamic weighting factor is introduced to adjust the number of hops. This factor will change dynamically according to the ratio of the actual distance and the communication radius. The number of hops with the introduction of the dynamic weighting factor is recorded as:
[0121]
[0122] In actual networks, due to the uneven distribution of nodes in different areas, the average hop distance will also be different. The traditional Dv-hop algorithm only uses a single average hop distance to estimate the distance, which may lead to large errors. In order to more accurately reflect the network status, this paper proposes the following formula to correct the average hop distance of unknown nodes:
[0123]
[0124] hopsize i =w i *hopsize i
[0125] Then the estimated distance between the unknown node and the beacon node can be expressed as:
[0126] d w =h w ×Hopsize i .
[0127] S9: Determine whether the current number of iterations reaches the preset number of iterations. If so, output the global optimal solution, that is, the minimum fitness function and the corresponding node position; otherwise, proceed to the next iteration.
[0128] from Figures 2 to 4 We can see that the improved grasshopper Dvhop positioning algorithm (MRW-GOA-Dvhop) has a greater optimization in positioning error and better stability than the traditional original Dvhop positioning algorithm and the original grasshopper positioning algorithm (GOA-Dvhop) in terms of different numbers of nodes and different communication radius. Especially in the case of different anchor nodes, the algorithm has the smallest average positioning error, which shows that the optimization effect of the algorithm is significant.
[0129] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A DV-Hop method based on an improved grasshopper search algorithm, characterized in that: The following steps are involved: S1: Nodes are randomly arranged in a specified area. Each beacon node broadcasts its location coordinates and hop count information through flooding. After receiving this information, the unknown node calculates the average hop distance and broadcasts the result to the entire network. The specific steps include: Step S1.1: During network initialization, k beacon nodes and n unknown nodes are randomly deployed in a target area of 100m x100m; Step S1.2: Each beacon node (anchor node) broadcasts its location information to neighboring nodes within its communication range. The receiving node records the shortest hop count to each beacon node and ignores the larger hop count information received from the same beacon node. Then, the receiving node increases the hop count by 1 and continues to forward this information to other neighboring nodes. This process requires the use of the average hop distance formula, which is: S2: Let the coordinates of the unknown node (x, y) be, and the coordinates of the beacon node be (x i ,y i ), then the fitness function of positioning is: S3: Generate multiple positioning schemes based on the improved grasshopper algorithm according to the improved tent chaotic map; S4: When the iteration starts, the initial optimal positioning solution is calculated according to the fitness function, and the position of the individual with the minimum fitness is determined as the optimal position; S5: Based on the original discoverer of the grasshopper search algorithm, this study aims to improve the search speed of the grasshopper search algorithm by integrating Levy flight and golden sine strategy. Through this improvement, an enhanced grasshopper search algorithm is developed. This method uses the long-step jump characteristics of Levy flight to avoid local optimality, while the mutualism strategy promotes information exchange between individuals in the algorithm, thereby accelerating the search for the global optimal solution; S6: Based on the original search of the grasshopper search algorithm, this study aims to improve the global search capability of the grasshopper search algorithm by integrating the elite Gaussian mutation operator and the adaptive attenuation factor; S7: Use probabilistic mutation at the optimal position to allow the algorithm to make further random selections; S8: Based on the corrected hop distance between the beacon node and the unknown node obtained in step 2, the unknown node is located using the improved grasshopper algorithm described in step 3 to obtain the estimated position coordinates of the unknown node; S9: Determine whether the current number of iterations reaches the preset number of iterations. If so, output the global optimal solution, that is, the minimum fitness function and the corresponding node position; otherwise, proceed to the next iteration.
2. The DV-Hop method based on the improved grasshopper search algorithm according to claim 1, characterized in that: In S3, this study uses an improved tent mapping to initialize the particle distribution. This strategy for optimization and search can effectively maintain the diversity of the population, prevent the algorithm from falling into the local optimum, and enhance the global search capability. The expression of the tent mapping is as follows:
3. The DV-Hop method based on the improved grasshopper search algorithm according to claim 1, characterized in that: After the grasshopper lands in S5, the finder places it at any position in the search space. Aiming at the problem that the grasshopper finder search algorithm is prone to fall into the local optimum, the Levy flight perturbation strategy is introduced, so that the algorithm can randomly change between long and short distances, maximize the diversification of the search domain, and enhance the global optimal search capability. Levy flight is a special random walk strategy, which can realize the interweaving of long-term short-distance back-and-forth search trajectories and occasional long-distance search trajectories. Levy flight satisfies both the fine search in a small range so as not to miss the target and the rough search in a large range to avoid falling into the limitations of local search. The length of the motion trajectory of the Levy flight characteristic motion is a randomly changing process without a fixed distribution function. The research summary points out that the distribution density function of the Levy flight step length change can be simply expressed as: L(s)~|s- 1 -β,0<β≤2 The s in the formula refers to the Levy motion step length. Mantegna et al. pointed out that s can be obtained from the formula: Among them, μ and ν are random numbers that conform to the normal distribution. Among them, σ μ , σ ν From the formula: Among them, the value range of parameter β is 0<β<2, generally β=1.5; The golden sine perturbation strategy is introduced to enable the algorithm to randomly change between long and short distances, maximize the diversification of the search domain, and enhance the global optimal search capability. To address the problem of slow convergence, the dynamic learning factor ω is further combined with the levy search strategy and the golden sine strategy, and a nonlinear factor is used for perturbation. The position update is as follows: Where ω1∈[0,2π], ω2∈[0,π] are random numbers; ε is the golden section coefficient. The specific formula is: ε1=a1×h+a2×(1-h) ε2=a1×(1-h)+a2×h in Where a is [π, -π] For each new position calculated by the grasshopper, if it improves the value of the objective function, it will be accepted, otherwise, the grasshopper will maintain its original position. This process is expressed by the following formula, which can be regarded as a greedy rule. here is to calculate the new position of the i-th grasshopper, is its jth dimension, F i P1 is its objective function value, r is a random number in the interval [0,1], which is an integer randomly selected from the set {1,2}, It is randomly generated at its location on the ground.
4. The DV-Hop method based on the improved grasshopper search algorithm according to claim 3, characterized in that: In order to more accurately control the dynamics of the search process in S6, the GOA algorithm introduces an elite Gaussian mutation operator and an adaptive attenuation factor; In the second stage of GOA (grasshopper optimization algorithm), namely the exploration stage, the position update simulates the grasshopper's escape behavior when encountering a predator. This stage reflects the local development ability of the algorithm, that is, when a grasshopper is attacked by a predator, it will quickly escape from its current position to a relatively safe position. In order to effectively simulate this escape behavior, the algorithm will generate a random position near the current position of each grasshopper individual. Such a movement strategy not only reflects the dynamic escape mechanism, but also helps to explore the surrounding area of the local solution and improve the efficiency and accuracy of the algorithm in local search. In addition, in order to more accurately regulate the dynamics of the search process, the GOA algorithm adopts an adaptive attenuation factor, which is a function that decreases nonlinearly with the increase of the number of iterations. The expression of the attenuation factor is: Where t is the current number of iterations, and T is the maximum number of iterations. Due to its exponential form, the decay factor M is larger in the early stage of the search, which makes the search step size of the grasshopper individual larger, so that a wide range of global searches can be performed in the search space, maximizing the use of the global search capability of the algorithm in the early stage. As the number of iterations increases, the value of the decay factor M gradually decreases, and accordingly, the search step size of the grasshopper individual will also become smaller, which helps to improve the accuracy of the search and gradually shift the algorithm from global search to more detailed local search. In order to enhance the search capability of the algorithm, this model also introduces an elite Gaussian mutation operator and an adaptive decay factor. The elite Gaussian mutation operator helps the grasshopper individual jump out of the local optimal solution and increase the search diversity by introducing random Gaussian perturbations. The adaptive decay factor dynamically adjusts the decay rate according to the progress of the search to better balance the globality and locality of the search, further improving the performance and efficiency of the algorithm. The elite Gaussian mutation operator and the adaptive decay factor are added on the basis of the original search: In the above formula, It is the length of elite variable asynchrony, which is a Gaussian distribution The mutation operator for adaptively adjusting the step size; c4 and r are random numbers uniformly distributed in [0,1]; l is the current iteration number, L is the total iteration number; b is the system parameter that determines the degree of eliteness, and its value is [1,5]. In this paper, the value is b=2; F j is the location of the food source in the j-dimensional space; σ is the standard deviation of the Gaussian distribution; Similar to the development phase, greedy selection is also used to decide whether to replace or keep the original position; In GOA (Grasshopper Optimization Algorithm), for each new position calculated by the grasshopper, the algorithm will evaluate the impact of the position on the objective function value. If the new position provides a better objective function value, then this new position will be accepted as the new coordinates of the grasshopper; Mutually beneficial operations generate new individuals: X inew =X i +rand -1,1 ·(X best -X j ) X jnew =X j +rand -1,1 ·(X best -X i ) 5. The DV-Hop method based on the improved grasshopper search algorithm according to claim 1, characterized in that: In the process of searching for the global optimal solution in S7, when the individual in the optimal position falls into the local optimum, the individuals around the individual in the optimal position are also likely to fall into the local optimum. The Gaussian and Cauchy mutation mechanisms are introduced into the algorithm to perform mutation operations on the local and global optimal positions of the individuals, and a "greedy" strategy is used to select the mutation positions. The specific mutation rules are designed as follows: In the formula, X * (t) represents the local optimal position of the individual after the Gaussian mutation mechanism mutation; in order to prevent the algorithm instability caused by Gaussian mutation, the optimal position Gaussian Cauchy mutation strategy only occurs with a probability of 0.
5.
6. The DV-Hop method based on the improved grasshopper search algorithm according to claim 1, characterized in that: In S8, it is assumed that the communication radius of the network is set to R, the connection between the beacon node and its neighbor nodes is divided into m levels, and the actual distance between each beacon node and its neighbor nodes in the network is recorded as d. In addition, a dynamic weighting factor is introduced to adjust the number of hops. The factor will change dynamically according to the ratio of the actual distance and the communication radius. The number of hops introduced by the dynamic weighting factor is recorded as: In actual networks, due to the uneven distribution of nodes in different areas, the average hop distance will also be different. The traditional Dv-hop algorithm only uses a single average hop distance to estimate the distance, which may lead to large errors. In order to more accurately reflect the network status, this paper proposes the following formula to correct the average hop distance of unknown nodes: hopsize i =w i *hopsize i Then the estimated distance between the unknown node and the beacon node can be expressed as: d w =h w ×Hopsize i 。
