DV-HOP positioning method and system based on hop distance correction and SA-PSO optimization

By using the DV-HOP algorithm with hop count correction and simulated annealing particle swarm optimization, the initial hop count between anchor nodes is calibrated and the weighted average hop distance is corrected. Combined with the simulated annealing particle swarm algorithm for coordinate solving, the problems of coarse hop count estimation and weak anti-interference ability in the DV-HOP algorithm are solved, and high-precision positioning of wireless sensor networks is achieved.

CN121728558APending Publication Date: 2026-03-24HUBEI PUBLIC INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

The existing DV-HOP algorithm has a coarse estimation of hop count in wireless sensor networks, ignores the differences in actual communication distance between nodes, and has a rudimentary calculation of average hop distance, resulting in low positioning accuracy and easy getting trapped in local optima, as well as weak anti-interference ability.

Method used

By combining hop count correction with simulated annealed particle swarm optimization (SA-PSO), the initial hop count between anchor nodes is calibrated. Weighted average hop distance correction and simulated annealed particle swarm optimization are used to solve the coordinates, and a three-level progressive optimization structure is constructed to accurately fit the hop distance and coordinates of unknown nodes.

Benefits of technology

This technology improves the positioning accuracy of unknown nodes in wireless sensor networks, eliminates hop count estimation errors, enhances anti-interference capabilities, and avoids the problem of positioning results deviating from the true coordinates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121728558A_ABST
    Figure CN121728558A_ABST
Patent Text Reader

Abstract

The invention provides a DV-HOP positioning method and system based on hop distance correction and SA-PSO optimization, and relates to the field of wireless sensor network positioning. The method comprises the following steps: acquiring the minimum hop count of anchor nodes through anchor node broadcast by nodes in the whole network, calculating the actual geometric distance and the communication hop count between the anchor nodes, and correcting the minimum hop count by combining a hop count correction factor to obtain the refined hop count. And calculating the average hop distance error of the anchor nodes, and correcting the average hop distance of the unknown nodes in a weighting mode to obtain a weighted average hop distance. And constructing a fitness function taking the minimization of the coordinate estimation error as a target. And randomly distributing the position and speed of an unknown node coordinate for each particle, and calculating and iterating an individual historical optimal solution and a group historical optimal solution. And executing simulated annealing operation and judging whether a termination condition is met or not. The technical problems that hop count estimation is rough, average hop distance calculation is simple and crude, and the anti-interference capacity of coordinate solving is weak are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the field of wireless sensor network positioning, in particular to a DV-HOP positioning method and system based on hop distance correction and SA-PSO optimization. BACKGROUND

[0002] Wireless sensor network has been widely applied in environmental monitoring, intelligent transportation and other fields due to its characteristics of low cost, low power consumption and easy deployment. Precise positioning of nodes is the core prerequisite for realizing effective data tracing. Since equipping all nodes with GPS will greatly increase the cost, the industry usually only configures a few anchor nodes with positioning modules, and the remaining unknown nodes estimate coordinates by positioning algorithms. The existing DV-HOP algorithm completes positioning in three stages, that is, obtaining the minimum hop count through anchor node broadcast, calculating the average hop distance, and solving the coordinates by trilateration or maximum likelihood estimation. However, during actual use, the hop count estimation is rough, only integer hop count is used to represent the distance between nodes, and the actual communication distance difference is ignored. Moreover, only the minimum hop count is used to transfer information, which leads to distortion of the mapping between hop count and real distance and hides the error. At the same time, the average hop distance calculation is simple, the unknown node only uses the hop distance of the first received anchor node, which cannot reflect the distance contribution difference of multiple anchor nodes, and is easily affected by network topology unevenness to produce large deviation. Finally, the coordinate solving has weak anti-interference ability, the solution is highly sensitive to the error of the previous link, and is easily trapped in local optimum, which makes it difficult to guarantee the stability of positioning. SUMMARY

[0003] The application provides a DV-HOP positioning method and system based on hop distance correction and SA-PSO optimization, which solves the technical problems of rough hop count estimation, simple average hop distance calculation and weak anti-interference ability of coordinate solving in the prior art.

[0004] To achieve the above-mentioned purpose, the application adopts the following technical solutions: In a first aspect, the DV-HOP positioning method based on hop distance correction and SA-PSO optimization comprises: deploying anchor nodes and unknown nodes in the network and setting basic parameters, the basic parameters including particle swarm size, maximum iteration number and initial temperature of simulated annealing. The minimum hop count of the anchor nodes is obtained through anchor node broadcast by all network nodes, the actual geometric distance and communication hop count between the anchor nodes are calculated, and the minimum hop count is corrected by combining the hop count correction factor to obtain refined hop count. Based on the refined hop count, the average hop distance error of the anchor nodes is calculated, and the average hop distance of the unknown nodes is corrected by a weighted manner to obtain the weighted average hop distance. The weighted average hop distance and the refined hop count are used to construct a fitness function with the minimum coordinate estimation error as the target. The position and speed of the unknown node coordinates are randomly allocated to each particle, and the individual historical optimal solution and the group historical optimal solution are calculated and iterated. The simulated annealing operation is performed and it is judged whether the termination condition is met, and the global optimal solution is output as the optimal estimated coordinates of the unknown node.

[0005] Based on the above technical solutions, in the DV-HOP positioning method based on hop distance correction and SA-PSO optimization provided in this application, the initial hop count between anchor nodes is calibrated by calculating and applying the hop count correction factor. This solves the problem of hop count estimation error caused by relying solely on the minimum hop count transmission and ignoring the actual communication distance differences between nodes in the original algorithm, laying an accurate foundation for subsequent distance measurement. At the same time, addressing the drawback that the average hop distance value of unknown nodes only depends on the hop distance of the first received anchor node and cannot reflect the differences in distance contribution of multiple anchor nodes, a hop distance weighted correction mechanism is adopted. By combining the hop distance error and hop count ratio of each anchor node, weights are allocated to achieve accurate fitting of the average hop distance of unknown nodes, thus solving the distance estimation deviation problem caused by single-source hop distance values. Finally, a simulated annealing particle swarm optimization (PSO) algorithm is introduced to replace the traditional maximum likelihood estimation or trilateration method for coordinate solving. Leveraging the global search capability of the PSO algorithm and the ability of the simulated annealing algorithm to accept inferior solutions and escape local optima, a fitness function adapted to the localization scenario is constructed. This weakens the impact of residual errors from previous steps on the final coordinates, solving the problems of weak anti-interference capability and easy deviation of localization results from true coordinates in traditional coordinate solving methods. A three-level progressive optimization structure is then constructed, consisting of hop count correction, hop distance weighted correction, and simulated annealing PSO coordinate solving. This allows for progressive and synergistic effects, achieving error reduction throughout the entire process from hop count and hop distance to coordinate solving. Ultimately, this improves the localization accuracy of unknown nodes in wireless sensor networks, avoiding the low positioning accuracy caused by the traditional DV-HOP algorithm's coarse hop count estimation, single hop distance value, and susceptibility to local optima in coordinate solving.

[0006] In conjunction with the first aspect mentioned above, one possible implementation involves calculating the actual geometric distance and communication hop count between anchor nodes, and then adjusting the minimum hop count using a hop count correction factor to obtain a refined hop count. Specifically, this includes: calculating the actual geometric distance using the Euclidean distance formula based on the coordinate data of each pair of anchor nodes i and j in the network. Based on actual geometric distance Calculate the communication hop count based on the preset communication radius R. The minimum hop count between anchor nodes i and j is obtained through a flooding broadcast mechanism. Based on minimum hop count and communication hop count Calculate the jump correction factor Use jump number correction factor For minimum number of hops Perform product correction to obtain a refined jump count. .

[0007] In conjunction with the first aspect mentioned above, in one possible implementation, the process of calculating the average jump distance error of anchor nodes based on refined jump counts, and correcting the average jump distance of unknown nodes through a weighted method to obtain the weighted average jump distance specifically includes: obtaining the actual geometric distance. and refined jump count Based on the total number N of anchor nodes in the network, calculate the average hop distance of anchor node i. Based on average jump distance Calculate the estimated distance ij from each anchor node i to other anchor nodes j and the single-hop error. Based on single-hop error Calculate the average jump distance error Find the minimum number of hops from an unknown node to each anchor node i. And calculate the weight of each anchor node i with respect to the unknown node. and weighted average jump distance .

[0008] In conjunction with the first aspect mentioned above, one possible implementation involves constructing a fitness function aimed at minimizing coordinate estimation error using a weighted average hop distance and a refined hop count. Specifically, this includes: based on the weighted average hop distance (HopSize) and the minimum hop count... Calculate the measured distance from the unknown node to anchor node i. Based on the coordinates of all anchor nodes and measuring distance Construct the fitness function.

[0009] In conjunction with the first aspect mentioned above, one possible implementation involves randomly assigning unknown node coordinates and velocities to each particle, and calculating and iterating the individual historical best solution and the swarm historical best solution. Specifically, this includes: defining the solution space range based on the network deployment area; randomly generating position coordinates (x, y) and velocity vectors (vx, vy) for each particle; and calculating the current position fitness value for each particle based on the fitness function. The fitness value corresponding to the individual historical best solution for each particle is obtained and compared with the current position fitness value. If the current fitness is better, the individual historical best solution is updated to the current position coordinates. After traversing all particles, the individual historical best solution with the best fitness value is selected as the swarm historical best solution. Finally, the velocity vector and position coordinates of each particle are updated according to the particle swarm algorithm's velocity update formula and position iteration update formula.

[0010] Combined with the above first aspect, in a possible implementation, the process of performing simulated annealing operation, judging whether the termination condition is satisfied, and outputting the global optimal solution as the optimal estimated coordinates of the unknown node specifically includes: randomly selecting a candidate solution from the individual historical optimal solutions of all particles, and calculating the difference ΔE between the fitness value of the candidate solution and the fitness value of the current population historical optimal solution. Judge whether to accept the candidate solution according to the Metropolis criterion. If the difference ΔE < 0, accept the candidate solution as the new population historical optimal solution. Otherwise, generate a uniform random number rand within the range of [0, 1]. If the uniform random number rand < exp(-ΔE / T), accept the candidate solution as the new population historical optimal solution. Judge whether the termination condition that the current iteration number reaches the maximum iteration number is satisfied. If the termination condition is satisfied, output the current population historical optimal solution as the optimal estimated coordinates of the unknown node. Otherwise, continue to iteratively update the particle positions and velocities, and repeat the simulated annealing operation.

[0011] In a second aspect, a DV-HOP positioning system based on hop distance correction and SA-PSO optimization is provided, including: a communication unit and a processing unit; the communication unit is used to broadcast and receive data between anchor nodes and unknown nodes in a wireless sensor network. The processing unit integrates a dedicated SA-PSO optimization chip, and the dedicated SA-PSO optimization chip is configured to execute the simulated annealing particle swarm algorithm and adjust the node communication radius through a dynamic deployment module to optimize the network topology.

[0012] Combined with the above second aspect, in a possible implementation, the communication unit includes a hop count acquisition module and a data forwarding module: the hop count acquisition module is used to obtain the minimum hop count between anchor nodes through the anchor node flooding broadcast mechanism. The data forwarding module dynamically adjusts the data transmission path based on the physical deployment characteristics of the nodes, and the hop count acquisition module and the processing unit are connected through a dedicated bus.

[0013] Combined with the above second aspect, in a possible implementation, the processing unit includes a hop count correction module and a hop distance calculation module: the hop count correction module is used to calculate the actual geometric distance and communication hop count between anchor nodes, and combine the hop count correction factor to correct the minimum hop count to obtain a refined hop count. The hop distance calculation module calculates the average hop distance error of the anchor nodes based on the refined hop count through a weighted error compensation mechanism, and corrects the average hop distance of the unknown nodes. The hop count correction module and the hop distance calculation module exchange data through a multi-layer cache structure.

[0014] In conjunction with the second aspect mentioned above, in one possible implementation, the processing unit further includes a coordinate optimization module and a termination judgment module: the coordinate optimization module is used to construct a fitness function using a weighted average hop distance and a refined hop count, and executes a simulated annealing particle swarm optimization algorithm to solve for the coordinates of unknown nodes. The termination judgment module controls the algorithm to terminate based on the number of iterations and a temperature threshold. The coordinate optimization module integrates a thermal management unit and dynamically adjusts the chip temperature through a heat sink.

[0015] This application provides a DV-HOP positioning method and system based on hop distance correction and SA-PSO optimization. It can calibrate the initial hop count between anchor nodes by calculating and applying the hop count correction factor, which solves the problem of hop count estimation error caused by the original algorithm relying solely on the minimum hop count and ignoring the actual communication distance differences between nodes. This lays an accurate foundation for subsequent distance measurement. At the same time, in view of the drawback that the average hop distance value of unknown nodes only depends on the hop distance of the first received anchor node and cannot reflect the difference in distance contribution of multiple anchor nodes, a hop distance weighted correction mechanism is adopted. It combines the hop distance error of each anchor node with the hop count ratio to allocate weights, thereby achieving accurate fitting of the average hop distance of unknown nodes and solving the distance estimation deviation problem caused by single-source hop distance value. Finally, a simulated annealing particle swarm optimization (PSO) algorithm is introduced to replace the traditional maximum likelihood estimation or trilateration method for coordinate solving. Leveraging the global search capability of the PSO algorithm and the ability of the simulated annealing algorithm to accept inferior solutions and escape local optima, a fitness function adapted to the localization scenario is constructed. This weakens the impact of residual errors from previous steps on the final coordinates, solving the problems of weak anti-interference capability and easy deviation of localization results from true coordinates in traditional coordinate solving methods. A three-level progressive optimization structure is then constructed, consisting of hop count correction, hop distance weighted correction, and simulated annealing PSO coordinate solving. This allows for progressive and synergistic effects, achieving error reduction throughout the entire process from hop count and hop distance to coordinate solving. Ultimately, this improves the localization accuracy of unknown nodes in wireless sensor networks, avoiding the low positioning accuracy caused by the traditional DV-HOP algorithm's coarse hop count estimation, single hop distance value, and susceptibility to local optima in coordinate solving.

[0016] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0017] Figure 1 A system architecture diagram of the DV-HOP localization method based on jump distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 2 A random distribution diagram of wireless sensor network nodes in the DV-HOP positioning method based on hop distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 3 A localization error diagram for each node in the DV-HOP localization method based on jump distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 4 A random distribution diagram of wireless sensor network nodes after minimum hop count optimization in the DV-HOP positioning method based on hop distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 5 The positioning error diagram of each node after minimum hop number optimization in the DV-HOP positioning method based on hop distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 6 The positioning error diagram of each node after jump distance correction optimization in the DV-HOP positioning method based on jump distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 7 The localization error diagram of each node after optimization by combining hop distance correction with simulated annealing particle swarm algorithm in the DV-HOP localization method based on hop distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 8 A flowchart illustrating the DV-HOP positioning method based on jump distance correction and SA-PSO optimization provided in this application embodiment; Figure 9A flowchart illustrating the DV-HOP positioning method based on jump distance correction and SA-PSO optimization provided in this application embodiment; Figure 10 A flowchart illustrating the DV-HOP positioning method based on jump distance correction and SA-PSO optimization provided in this application embodiment; Figure 11 A flowchart illustrating the DV-HOP positioning method based on jump distance correction and SA-PSO optimization provided in this application embodiment; Figure 12 A flowchart of the simulated annealing particle swarm algorithm in the DV-HOP localization method based on jump distance correction and SA-PSO optimization provided in the embodiments of this application; Figure 13 The flowchart of the DV-HOP localization algorithm based on jump distance correction combined with simulated annealing particle swarm optimization in the DV-HOP localization method based on jump distance correction and SA-PSO optimization provided in the embodiments of this application is shown. Figure 14 A flowchart illustrating the DV-HOP positioning method based on jump distance correction and SA-PSO optimization provided in this application embodiment; Figure 15 A schematic diagram of the structure of the DV-HOP positioning system based on jump distance correction and SA-PSO optimization provided in the embodiments of this application. Detailed Implementation

[0018] In the description of this application, unless otherwise stated, "" means "or," for example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The words "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0019] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0020] This application provides a DV-HOP positioning method based on hop distance correction and SA-PSO optimization. This method calibrates the initial hop count between anchor nodes by calculating and applying a hop count correction factor, solving the problem of hop count estimation error caused by relying solely on the minimum hop count and ignoring the actual communication distance differences between nodes in the original algorithm. This lays an accurate foundation for subsequent distance measurement. At the same time, to address the drawback that the average hop distance value of unknown nodes only depends on the hop distance of the first received anchor node and cannot reflect the differences in distance contribution of multiple anchor nodes, a hop distance weighted correction mechanism is adopted. This mechanism combines the hop distance error of each anchor node with the hop count ratio to allocate weights, achieving accurate fitting of the average hop distance of unknown nodes and solving the distance estimation deviation problem caused by single-source hop distance values. Finally, a simulated annealing particle swarm optimization (PSO) algorithm is introduced to replace the traditional maximum likelihood estimation or trilateration method for coordinate solving. Leveraging the global search capability of the PSO algorithm and the ability of the simulated annealing algorithm to accept inferior solutions and escape local optima, a fitness function adapted to the localization scenario is constructed. This weakens the impact of residual errors from previous steps on the final coordinates, solving the problems of weak anti-interference capability and easy deviation of localization results from true coordinates in traditional coordinate solving methods. A three-level progressive optimization structure is then constructed, consisting of hop count correction, hop distance weighted correction, and simulated annealing PSO coordinate solving. This allows for progressive and synergistic effects, achieving error reduction throughout the entire process from hop count and hop distance to coordinate solving. Ultimately, this improves the localization accuracy of unknown nodes in wireless sensor networks, avoiding the low positioning accuracy caused by the traditional DV-HOP algorithm's coarse hop count estimation, single hop distance value, and susceptibility to local optima in coordinate solving.

[0021] like Figures 1-7 As shown, the DV-HOP localization method based on jump distance correction and SA-PSO optimization provided in this application includes: Step 101: Deploy anchor nodes and unknown nodes in the network and set basic parameters, including particle swarm size, maximum number of iterations, and initial temperature of simulated annealing.

[0022] In this context, anchor nodes are nodes in a wireless sensor network whose locations are known and used as positioning reference points. Unknown nodes are nodes whose locations are unknown and whose coordinates need to be calculated using a positioning algorithm.

[0023] In some implementations, anchor nodes and unknown nodes are deployed in the wireless sensor network. For example, 100 nodes are randomly generated in a 100m x 100m area, with 8 as anchor nodes and the rest as unknown nodes. The communication distance between nodes is set to 50 meters to ensure that nodes can exchange information within the communication range. Then, based on the network size and algorithm requirements, basic parameters such as particle swarm size, maximum number of iterations, and initial simulated annealing temperature are set for subsequent simulated annealing particle swarm optimization of the localization process. The particle swarm size determines the number of particles in the algorithm, the maximum number of iterations limits the upper limit of the algorithm's iterations, and the initial simulated annealing temperature affects the algorithm's global search capability.

[0024] For example, in a simulation environment, nodes are deployed as follows: Figure 2 As shown, 100 nodes are randomly distributed in a 100m by 100m area, including 8 anchor nodes. When setting the basic parameters, the particle swarm size can be set to a typical value such as 30, the maximum number of iterations is 100, and the initial temperature of simulated annealing is 100. The above values ​​are only examples and need to be adjusted according to the algorithm performance to optimize the positioning error.

[0025] Step 102: All network nodes obtain the minimum hop count of the anchor node through anchor node broadcast, calculate the actual geometric distance and communication hop count between anchor nodes, and correct the minimum hop count by combining the hop count correction factor to obtain the refined hop count.

[0026] The minimum hop count refers to the minimum number of hops required for inter-node communication obtained through flooding. The actual geometric distance is the Euclidean distance between anchor nodes calculated based on coordinates. The communication hop count is an optimized hop count calculated based on the actual distance and communication radius. The hop count correction factor is a calculation factor used to correct the hop count and reflects hop count errors. The refined hop count is the final hop count obtained after correction.

[0027] In some implementations, anchor nodes flood a data packet containing their own coordinates, ID, and an initial hop count of 0. This causes neighboring nodes to increment their hop count upon receiving the packet and forward it, while the anchor node retains the minimum hop count. The actual geometric distance between anchor nodes can then be directly calculated, and the communication hop count can be calculated based on this actual distance and the communication radius R. A hop count correction factor is then used to refine the minimum hop count, resulting in a more refined hop count and hop count optimization. In a specific simulation, the node distribution is as follows... Figure 4 As shown, 100 nodes (including 8 anchor nodes) are randomly deployed in a 100m×100m area, with a communication distance of 50m. After correcting the hop count through the above steps, the positioning error is significantly reduced. The optimized error result is as follows. Figure 5 As shown, its average positioning error is reduced.

[0028] Step 103: Based on the refined jump count, calculate the average jump distance error of the anchor node, and correct the average jump distance of the unknown node by weighting to obtain the weighted average jump distance.

[0029] In some implementations, the formula HopSize is used for each anchor node i. i Calculate its average jump distance, and then you can determine the hop count based on the refined jump count. ij Calculate the estimated distance from anchor node i to other anchor nodes, and then combine this with the actual distance d between anchor nodes. ij The single-hop error is calculated, and finally, the average hop distance error of anchor node i is obtained by averaging over all other anchor nodes. The average hop distance of unknown nodes can then be corrected using a weighted method: first, calculate the minimum hop number H from the unknown node to each anchor node. i Simultaneously, the weight of each anchor node is calculated, and finally, the weighted average jump distance is obtained using a weighted formula, which can more accurately reflect the contribution of different anchor nodes to the calculation of the jump distance of unknown nodes.

[0030] Step 104: Construct a fitness function with the goal of minimizing coordinate estimation error using the weighted average hop distance and refined hop count.

[0031] By calculating the measured distance from the unknown node to each anchor node using the weighted average jump distance and refined jump count, a fitness function can be constructed based on the difference between the measured distance and the estimated distance, with the goal of minimizing the coordinate estimation error.

[0032] Step 105: Randomly assign the position and velocity of the unknown node coordinates to each particle, and calculate and iterate the individual historical best solution and the group historical best solution.

[0033] Here, position is the coordinate representation of a particle in the solution space. Velocity is the direction and speed of a particle's movement in the solution space. The individual historical optimal solution is the coordinate corresponding to the optimal fitness found by a single particle during the iteration process. The swarm historical optimal solution is the coordinate corresponding to the globally optimal fitness found by the entire particle swarm during the iteration process.

[0034] During the algorithm initialization phase, within a defined solution space (e.g., a 100m × 100m network region), a random position coordinate (x, y) is generated for each particle as the initial solution, along with a corresponding random velocity vector. This allows the calculation of each particle's fitness value, and the constructed fitness function is used to evaluate the positioning error of the current coordinates. Iterative updates are then performed between the individual historical best solution and the swarm historical best solution. In each iteration, the current fitness of each particle is compared with its individual historical best solution; if the former is better, the individual historical best solution is updated to the current position. Simultaneously, the individual historical best solutions of all particles are compared, and the one with the best fitness is selected as the swarm historical best solution. This allows the particle swarm to continuously iterate using the velocity update formula of the particle swarm algorithm, ultimately leading the particle swarm to converge towards the coordinate with the minimum error.

[0035] Step 106: Perform simulated annealing and determine whether the termination condition is met. Output the global optimal solution as the optimal estimated coordinates of the unknown node.

[0036] Simulated annealing is an operation introduced into the particle swarm optimization algorithm, using the Metropolis criterion to accept inferior solutions with a certain probability to avoid local optima. The termination condition is the condition under which the algorithm stops iterating, such as reaching the maximum number of iterations. The global optimum is the coordinate solution with the best fitness found by the entire particle swarm during the iteration process. The optimal estimated coordinates of unknown nodes are the most accurate estimates of the unknown node's position obtained after algorithm optimization.

[0037] In the particle swarm optimization (PSO) iterative process, a roulette wheel strategy is used to randomly select a candidate solution from the individual historical best solutions of all particles. The difference between the candidate solution's fitness value and the current global optimum is calculated. The Metropolis criterion is then used to determine whether to accept the candidate solution: if the difference is less than 0, it is accepted directly; otherwise, it is accepted with a probability of exp(-difference / current temperature), thus introducing randomness to avoid getting trapped in local optima. Simulated annealing is then used to check if the current iteration count has reached the preset maximum iteration count (i.e., whether the termination condition is met). If not, the iteration continues to update particle positions and velocities, and the simulated annealing operation is repeated; if the condition is met, the iteration stops. This outputs the global optimum as the optimal estimated coordinates of the unknown node, using the coordinates corresponding to the swarm's historical best solution as the final location result, thus completing the node location optimization.

[0038] Based on the above technical solutions, in the hop count calculation stage, the initial hop count between anchor nodes is accurately calibrated through the calculation and application of the hop count correction factor. This effectively solves the drawback of the original algorithm, which relies solely on the minimum hop count and ignores the differences in actual communication distances between nodes, thus eliminating hop count estimation errors and laying a solid data foundation for subsequent distance calculations. Addressing the limitations of calculating the average hop distance for unknown nodes, a hop distance weighted correction mechanism is adopted. This mechanism scientifically allocates weights based on the hop distance error and hop count proportion of each anchor node, replacing the original algorithm's single-source hop distance method that only takes the hop distance of the first receiving anchor node. This fully reflects the differences in distance contribution from multiple anchor nodes, achieving accurate fitting of the average hop distance for unknown nodes and solving the distance estimation bias problem caused by single-source hop distance. In the coordinate solution stage, a simulated annealing particle swarm fusion algorithm is introduced to replace the traditional maximum likelihood estimation or trilateration method. This approach combines the global search advantages of particle swarm optimization with the ability of simulated annealing to accept inferior solutions and escape local optima. By constructing a fitness function adapted to the localization scenario, it effectively mitigates the impact of residual errors from preceding steps on the final coordinates, solving the problems of weak anti-interference capability and easy deviation of localization results from true coordinates in traditional methods. Its three-level optimization process—hop count correction, hop distance weighted correction, and simulated annealing particle swarm coordinate solution—works progressively and synergistically to achieve end-to-end error control from hop count and hop distance to coordinate solution. This thoroughly improves the shortcomings of traditional DV-HOP algorithms, such as coarse hop count estimation, single hop distance value, and easy getting trapped in local optima, ultimately enhancing the localization accuracy of unknown nodes in wireless sensor networks.

[0039] In one possible implementation of the embodiments of this application, combined with Figures 1-8 As shown, the actual geometric distance and communication hop count between anchor nodes are calculated, and the minimum hop count is corrected by combining a hop count correction factor to obtain a refined hop count. This can be achieved through the following steps 201 to 205, which are explained in detail below: Step 201: Based on the coordinate data of each pair of anchor nodes i and j in the network, calculate the actual geometric distance using the Euclidean distance formula. .

[0040] In a wireless sensor network, an anchor node is a node whose location is known and used as a reference point for positioning. Coordinate data represents the node's position in space, typically in two-dimensional or three-dimensional form. The actual geometric distance is the real spatial distance calculated based on the node's coordinates.

[0041] In some implementations, after deploying anchor nodes in the network, the preset coordinate data of each pair of anchor nodes i and j is obtained. and Each pair of anchor nodes can be directly extracted. Find the x and y coordinates and apply the Euclidean distance formula. Calculate the actual geometric distance During its time of use, the Euclidean distance formula assumes that nodes are deployed in a two-dimensional plane. If the actual network involves three-dimensional space, then further technical adjustments are needed, and the extended formula becomes: .

[0042] For example, assuming the coordinates of anchor node i are (10, 20) and the coordinates of anchor node j are (30, 40), then the actual geometric distance is... Unit length.

[0043] Step 202: Based on actual geometric distance Calculate the communication hop count based on the preset communication radius R. .

[0044] Here, the communication radius R is the maximum distance over which nodes in a wireless sensor network can communicate directly. The communication hop count is the number of hops required for inter-node communication, calculated based on the actual distance and the communication radius.

[0045] In some implementations, the actual geometric distance between each pair of anchor nodes i and j is obtained in the network. Then, the preset communication radius R representing the communication range of the node can be directly introduced, thereby representing the actual geometric distance. Divide by the communication radius R to calculate the communication hop count. ;at last.

[0046] Step 203: Obtain the minimum number of hops between anchor nodes i and j through a flooding broadcast mechanism. .

[0047] Flooding is a mechanism in wireless sensor networks where nodes broadcast information to all their neighboring nodes. Minimum hop count is the minimum number of forwards required for communication between two nodes.

[0048] In some implementations, the anchor node initializes a broadcast data packet containing its own coordinates, a unique identifier (ID), and a hop count field, with the hop count field initially set to 0. This allows the anchor node to flood the packet to all neighboring nodes within its direct communication range. Upon receiving the packet, a neighboring node increments the hop count field by 1 and forwards the updated packet to its neighbors. When each node receives multiple packets from the same anchor node, it compares the hop counts and retains only the packet with the smallest hop count. By repeating this process, all nodes in the network eventually obtain the minimum hop count between anchor nodes i and j, which represents the shortest hop count for the communication path between the two anchor nodes.

[0049] For example, if anchor node A (with known coordinates) broadcasts a data packet with an initial hop count of 0, node B receives it within communication range, its hop count becomes 1, and it forwards the packet. Node C receives the packet from B, and its hop count becomes 2. However, if node D receives the packet directly from A, its hop count is only 1. In this case, C will retain the data packet with a hop count of 1, and the final minimum hop count will be 1.

[0050] Step 204: Based on minimum hop count and communication hop count Calculate the jump correction factor .

[0051] In some implementations, the minimum hop count between anchor nodes i and j is obtained through a flooding broadcast mechanism in the network. and communication hop count Therefore, the difference between the minimum hop count and the communication hop count can be directly compared (i.e., the formula). Calculate the jump correction factor This is used for subsequent fine-tuning of the minimum hop count. The correction factor is... The value range is usually [0,1]. The larger the difference in the number of jumps, the smaller the correction factor, and vice versa.

[0052] For example, assume the minimum number of hops between anchor nodes i and j. The communication hop count is 4. The calculation is 3.2 hops, then the hop count correction factor is... At this point, the jump count correction factor value of 0.96 indicates that the jump count error is small and the correction factor is close to 1.

[0053] Step 205: Use the jump count correction factor For minimum number of hops Perform product correction to obtain a refined jump count. .

[0054] In some implementations, the minimum number of hops between anchor nodes i and j is obtained. and jump number correction factor This will adjust the jump count correction factor. With minimum number of hops Perform multiplication operations (and use formulas) The refined hop count was obtained. This information is then used in subsequent distance estimation steps to improve positioning accuracy.

[0055] For example, assume the minimum number of hops between anchor nodes i and j. The communication hop count is 5 hops. If the calculation is 4.5 hops, then the hop count correction factor is... It is 0.99, thus passing Jump, at this point the refined jump value of 4.95 is closer to the actual jump count.

[0056] Based on the above technical solution, an objective benchmark for hop count correction is provided by calculating the actual geometric distance. Simultaneously, the communication hop count is derived using the division operation between the actual distance and the communication radius, forming an ideal hop count reference. Then, a flooding broadcast mechanism is used to obtain the minimum hop count, which serves as the raw data for the actual network topology. Based on the difference between the minimum hop count and the communication hop count, an error squared normalization method is used to calculate the hop count correction factor, dynamically quantifying the hop count deviation. Finally, a product correction is used to transform the minimum hop count into a refined continuous value. Thus, by utilizing this overall process, hop count estimation is optimized from discrete integers to continuous values, making the values ​​more closely match the actual network topology. This effectively overcomes the hop count mapping distortion problem of traditional algorithms, laying a precise foundation for subsequent distance measurement.

[0057] Furthermore, to address the inherent problems of coarse hop count estimation, severe error accumulation, and weak anti-interference capability in existing technologies, hop count refinement can eliminate systematic errors caused by topological inhomogeneity, block the transmission of errors to hop distance calculation and coordinate solution, and form a three-level progressive optimization chain with subsequent hop distance weighted correction and simulated annealing particle swarm algorithm, thereby improving the overall positioning accuracy and stability.

[0058] In one possible implementation of the embodiments of this application, combined with Figures 1-9 As shown, the process of calculating the average jump distance error of anchor nodes based on refined jump counts, and correcting the average jump distance of unknown nodes through a weighted method to obtain the weighted average jump distance can be achieved through steps 301 to 304, which are explained in detail below: Step 301: Obtain the actual geometric distance and refined jump count Based on the total number N of anchor nodes in the network, calculate the average hop distance of anchor node i. .

[0059] Here, the total number N of anchor nodes in the network refers to the total number of all anchor nodes with known locations in the wireless sensor network. The average hop distance of anchor node i... It refers to the ratio of the sum of the actual geometric distances from anchor node i to all other anchor nodes to the sum of the refined hop count, representing the average distance per hop.

[0060] In some implementations, the actual geometric distance is obtained. and refined jump count This allows direct reading of the total number N of anchor nodes in the network (the parameter N should be set according to the actual deployment; generally, the more anchor nodes there are, the more accurate the hop distance calculation, but the computational complexity needs to be balanced). Calculate the average jump distance of anchor node i .

[0061] For example, if there are N=4 anchor nodes in a wireless sensor network, with anchor node 1 having coordinates (0,0), anchor node 2 having coordinates (3,4), anchor node 3 having coordinates (6,8), and anchor node 4 having coordinates (9,12), then calculate the actual geometric distance from anchor node 1 to the other anchor nodes: rice, and Meters. Simultaneously, assume refined jump count. Jump, Jump, The sum of the jumps is 5 + 10 + 15 = 30 meters, and the sum of the jumps is 1.5 + 3 + 4.5 = 9 jumps. Therefore, the average jump distance can be calculated. Rice / jump.

[0062] Step 302, based on average jump distance Calculate the estimated distance ij from each anchor node i to other anchor nodes j and the single-hop error. .

[0063] In some implementations, the average jump distance must be ensured first. and refined jump count They originate from the same network topology phase, and the hop distances within this network are uniformly distributed. Therefore, it can be directly determined based on...

[0064] Calculated average jump distance Combined with the refined hop count obtained from the hop count correction step Using multiplication operations The estimated distance ij is obtained. Then, the actual geometric distance between anchor nodes i and j is obtained. By subtraction ( ) to obtain the actual geometric distance The difference between the estimated distance ij and the calculated distance ij. This difference is then divided by the refined hop count. The single-hop error is obtained. Its formula is Error calculation can then be completed.

[0065] For example, assume the average jump distance of anchor node i. The refined number of jumps to anchor node j is 10 meters per jump. If there are 3 jumps, then the estimated distance ij = 10 × 3 = 30 meters; if the actual geometric distance... If the distance is 32 meters, then the single jump error is... =(32-30) / 3≈0.67 meters / jump, meaning that each jump is on average higher than 0.67 meters.

[0066] Step 303, based on single-hop error Calculate the average jump distance error .

[0067] In some implementations, the single-hop error from the node to each other anchor node j (j≠i) is obtained. And for all j≠i Summing the results and then dividing the sum by (N-1) yields the average jump distance error. This completes the calculation.

[0068] Step 304: Obtain the minimum number of hops from the unknown node to each anchor node i. And calculate the weight of each anchor node i with respect to the unknown node. and weighted average jump distance .

[0069] Among them, minimum number of hops This refers to the minimum hop count obtained from the unknown node to the anchor node i through a flooding broadcast mechanism, representing the hop count of the shortest communication path between the two nodes. Weight This refers to the minimum number of hops. The calculated weighting coefficients are used to distinguish the contribution ratio of different anchor nodes to the calculation of the jump distance of unknown nodes when using weighted averaging.

[0070] In some implementations, for unknown nodes, the anchor node data packets can be received via a flooding broadcast mechanism. In this case, the received data packets will contain the anchor node coordinates and hop count information, allowing for node comparison and retention of the minimum hop count to each anchor node i. Therefore, the minimum number of hops for each hop can be determined. The reciprocal of 1 / ,Again The normalized weights are obtained by summing the reciprocals of all anchor nodes and dividing each individual reciprocal by the sum. Therefore, combined with the average jump distance of the anchor node and average jump distance error Using a weighted formula This gives us the weighted average hop size (HopSize) for unknown nodes.

[0071] For example, suppose there are m=3 anchor nodes in the network, and the minimum number of hops from the unknown node to anchor nodes 1, 2, and 3 are respectively =2 jumps =3 jumps =4 jumps. Their reciprocals are: 1 / =0.5、1 / ≈0.333, 1 / =0.25, so summing them up (0.5 + 0.33 + 0.25) ≈ 1.083. Therefore, we obtain its weight. =0.5 / 1.083≈0.462 ≈0.307 ≈0.231. At this time, if anchor node 1's =10 meters =0.5 meters, anchor node 2 =12 meters =0.6 meters, anchor node 3 =11 meters =0.4 meters; then the weighted average jump distance HopSize=0.462×(10+0.5)+0.307×(12+0.6)+0.231×(11+0.4)≈4.851+3.874+2.630≈11.36 meters.

[0072] Based on the above technical solution, utilizing actual geometric distance and refined jump count Calculate the average jump distance Furthermore, a basic jump distance model was constructed using the Euclidean distance formula and ratio calculations, optimizing jump distance measurement from discrete integers to continuous values, thus solving the mapping distortion problem caused by coarse jump number estimation in existing technologies. Simultaneously, based on... i. Calculate the estimated distance and single-hop error By establishing an individual jump distance deviation monitoring structure through difference division and error quantization, the shortcomings of traditional algorithms that ignore actual distance differences can be effectively overcome. The average jump distance error... The averaging operation can aggregate error data from multiple anchor nodes, effectively addressing the shortcomings of existing technologies that are rudimentary in hop distance calculation and cannot reflect topological unevenness, thus forming a systematic error compensation basis. Finally, the minimum hop count is used... Calculate weights A weighted average was then applied to construct a weighted allocation model based on the proportion of hop counts. This model integrates the hop distance of unknown nodes with the contributions of multiple anchor nodes, directly solving the problem of bias accumulation caused by the reliance on single-source hop distances in traditional algorithms. This results in a chain-like process of error calculation and weighted fusion, achieving greater accuracy in hop distance measurement and improved anti-interference capabilities.

[0073] In one possible implementation of the embodiments of this application, combined with Figures 1-10 As shown, the process of constructing a fitness function with the objective of minimizing coordinate estimation error using weighted average hop distance and refined hop count can be achieved through the following steps 401 to 402, which are explained in detail below: Step 401: Based on the weighted average hop size (HopSize) and minimum number of hops Calculate the measured distance from the unknown node to anchor node i. .

[0074] In some implementations, the corrected weighted average hop size (HopSize) and minimum hop count are obtained. This ensures that the hop count data comes from the actual transmission path of network communication, while also combining the weighted average hop distance HopSize with the minimum hop count. Perform multiplication, that is Therefore, the measured distance can be directly obtained. As input data for coordinate solving.

[0075] For example, assuming the weighted average hop size (HopSize) in a wireless sensor network is calculated to be 10 meters per hop, the minimum number of hops from the unknown node to anchor node i is... If the result is 2 jumps, then measure the distance. =10×2=20 meters, which means the estimated distance from the unknown node to the anchor node is 20 meters.

[0076] Step 402: Based on the coordinates of all anchor nodes and measuring distance Construct the fitness function.

[0077] In some implementations, the coordinates of all anchor nodes are obtained. and measuring distance While ensuring that the data comes from accurate results after hop distance correction and hop count optimization, through Calculate the Euclidean distance from any given estimated coordinates (x, y) to each anchor node i to represent the true geometric distance between the estimated location and anchor node i. This allows for reuse... Calculate the measured distance for each anchor node i. The absolute difference between the distance to the Euclidean distance quantifies the distance estimation error of a single anchor node. Finally, the absolute differences of all N anchor nodes are summed and divided by the number of anchor nodes N to obtain the average error. This average error is used to construct an optimization function that minimizes the error; the expression for its fitness function is as follows: .

[0078] Based on the above technical solution, a multiplicative model of weighted hop distance and minimum hop count is adopted. By multiplying the weighted average hop distance (integrating multi-anchor node error compensation) with the refined hop count (reflecting the actual topology), a composite correction structure for distance estimation is constructed. This achieves the transformation from single-source hop distance to multi-source weighted hop distance, ensuring that the measured distance includes both the global hop distance characteristics of the network and the hop count differences between specific nodes, effectively solving the adaptability problem of distance estimation. Simultaneously, a fitness function is constructed using the mathematical form of the sum of average absolute errors, enabling a transformation from single distance matching to overall error minimization. By balancing and integrating the distance deviations of N anchor nodes, the optimization objective reflects both the distance consistency of individual anchor nodes and the overall positioning accuracy, forming the basis for optimal coordinate search under multiple constraints. Therefore, combining these two approaches creates a closed-loop error control structure for distance measurement calculation and fitness function mapping, achieving full-process optimization of positioning accuracy from distance estimation to coordinate solution.

[0079] In one possible implementation of the embodiments of this application, combined with Figures 1-13 As shown, the process of randomly assigning unknown node coordinates and velocities to each particle, and calculating and iterating the individual historical best solution and the group historical best solution, can be implemented through the following steps 501 to 505, which are explained in detail below: Step 501: Based on the network deployment area, set the solution space range, randomly generate position coordinates (x, y) and velocity vector (vx, vy) for each particle, and calculate the current position fitness value of each particle based on the fitness function.

[0080] In this context, the network deployment area refers to the physical space in which nodes are actually deployed in a wireless sensor network, typically a two-dimensional region defined by length and width. The solution space refers to the boundary of the set of feasible solutions used in the particle swarm optimization (PSO) algorithm to search for the coordinates of unknown nodes, and it coincides with the network deployment area. A particle is a basic search individual in the PSO algorithm, with each particle representing a possible solution for the coordinates of an unknown node. The position coordinates (x, y) are the coordinate representation of the particle in the two-dimensional solution space, where x is the horizontal coordinate and y is the vertical coordinate. The velocity vector (vx, vy) represents the direction and speed vector of the particle's movement in the solution space, where vx is the velocity component in the x-direction and vy is the velocity component in the y-direction.

[0081] In some implementations, the solution space range is set based on the actual size of the network deployment area (e.g., when the network deployment area is 100m×100m, the solution space range is directly set as a rectangular area with the x-axis from 0 to 100 and the y-axis from 0 to 100). This allows for the direct generation of a corresponding number of particles based on the preset particle swarm size. For each particle, position coordinates (x, y) are randomly generated within the solution space range, and coordinate values ​​are independently generated within the range of x and y using a uniform random distribution function, ensuring that the coordinate values ​​do not exceed the solution space boundary. Simultaneously, a velocity vector (vx, vy) is randomly generated for each particle, where the velocity component's value range is set based on the network communication radius or empirical values ​​(e.g., randomly generated within the interval [-R, R], where R is the communication radius). This ensures that the velocity vector covers the global search while avoiding excessive divergence. Finally, the initial positions and velocities of all particles are stored as input. The current position coordinates (x, y) of each particle after initialization or iterative update can be directly substituted into the fitness function fitness(x, y) to calculate the Euclidean distance from the estimated coordinates (x, y) of the unknown node to each anchor node, and then compared with the measured distance. Calculate the absolute difference; finally, sum the absolute differences of all anchor nodes and divide by the number of anchor nodes n to obtain the average error, which is then output as the fitness value.

[0082] It should be noted that when setting the solution space range, it is necessary to strictly match the physical boundaries of the network deployment area to avoid the initial positions of particles exceeding the areas where actual nodes may exist. At the same time, a uniform distribution should be used when randomly generating position coordinates to ensure the fairness of the search, while the random range of the velocity vector needs to be adjusted according to the network characteristics. For example, in densely deployed networks, the range can be reduced to improve convergence efficiency.

[0083] For example, if the particle's current position coordinates are (25.3, 35.7), and there are 3 anchor nodes in the network with coordinates (10, 10), (50, 50), and (30, 70), and the weighted average jump distance HopSize = 12m / jump, then the minimum number of jumps is... =2、 =4、 =3, then measure distance =24m、 =48m =36m; the estimated Euclidean distances from the coordinates to the anchor node are calculated to be 20.5m, 28.3m, and 34.2m, respectively. The absolute differences are calculated as |24-20.5|=3.5, |48-28.3|=19.7, and |36-34.2|=1.8. The sum of these values ​​is 25.0, and the fitness value is fitness=25.0 / 3≈8.33.

[0084] Step 502: Obtain the fitness value corresponding to the historical best solution of each particle and compare it with the fitness value of the current position. If the current fitness is better, update the historical best solution of the individual to the coordinates of the current position.

[0085] In some implementations, firstly, during each iteration, for each particle, the fitness value corresponding to its historical best solution is retrieved from its stored historical records (this fitness value is set at the initial position during algorithm initialization and dynamically updated during iteration). Then, the current coordinates (x, y) are substituted into the fitness function `fitness(x, y)` to calculate the particle's current fitness value. The current fitness value is then compared numerically with the fitness value of the historical best solution. Since the fitness function aims to minimize error, a smaller fitness value indicates a better solution. If the comparison shows that the current fitness value is less than the fitness value of the historical best solution, then the current fitness is considered better. At this point, the particle's historical best solution is updated to the current position coordinates, and the fitness value corresponding to the historical best solution is simultaneously updated to the current position fitness value. If the current fitness value is not less than the historical best value, then the historical best solution remains unchanged.

[0086] For example, the historical best solution coordinates of particle B are (25.3, 35.7), corresponding to a fitness value of 0.20. If the particle position is updated to (26.1, 34.8) in the current iteration, the fitness value of the current position is calculated to be 0.18. Comparing 0.18 and 0.20, since 0.18 is smaller, the current fitness is determined to be better. Therefore, the historical best solution is updated to (26.1, 34.8), and the fitness value is updated to 0.18. If the position coordinates change to (27.0, 36.2) in the next iteration, the fitness value is calculated to be 0.22. Comparing 0.22 and 0.18, it is determined that it is not better, so the historical best solution remains (26.1, 34.8).

[0087] Step 503: After traversing all particles, select the individual historical best solution with the best fitness value as the group historical best solution.

[0088] In some implementations, after updating the individual historical best solutions of all particles in each iteration, each individual in the particle swarm is visited sequentially to obtain the fitness value corresponding to the individual historical best solution of each particle. The fitness values ​​of all individual historical best solutions are then compared. Since the fitness function aims to minimize the error, the smaller the fitness value, the better the solution. Therefore, the individual historical best solution with the smallest fitness value is selected as the swarm historical best solution, and its coordinate value is recorded for subsequent particle swarm updates.

[0089] For example, if the particle swarm size is 3, the fitness value of the individual best solution of particle A is 0.10, that of particle B is 0.15, and that of particle C is 0.12. After traversing all particles, the fitness values ​​are compared, and the minimum value is 0.10. Therefore, the individual best solution of particle A is selected as the swarm's ...

[0090] Step 504: Update the velocity vector and position coordinates of each particle according to the particle swarm algorithm velocity update formula and position iteration update formula.

[0091] Among them, the particle swarm optimization algorithm is a swarm intelligence-based optimization algorithm that searches by simulating the foraging behavior of bird flocks. The velocity update formula is the mathematical expression used to update the particle velocity vector, specifically in the form of... Where w is the inertia weight, c1 is the individual learning factor, c2 is the social learning factor, r1 and r2 are random numbers in the range [0,1], pbest is the individual historical best solution, and gbest is the group historical best solution. The position iteration update formula is the mathematical expression used to update the particle's position coordinates, specifically in the form x = x + v. The velocity vector refers to the direction and speed of the particle's movement in the solution space, composed of vx and vy components.

[0092] In each iteration, the current velocity vector *v* and position coordinate *x* of each particle are obtained. Simultaneously, the individual historical best solution *pbest* and the swarm historical best solution *gbest* are read from the stored data. The velocity update formula can then be directly applied to calculate the new velocity vector. The inertia weight *w* controls the influence of historical velocities, while the individual learning factor *c1* and the social learning factor *c2* adjust the learning intensity towards the individual and swarm optima, respectively. Random numbers *r1* and *r2* introduce randomness to avoid local optima. The new velocity vector is then added to the current position coordinates using the position iteration update formula, resulting in the updated position coordinates. Finally, the new velocity vector and position coordinates are stored for the next iteration, completing the particle state refresh.

[0093] For example, if a particle's current velocity vector v is (0.5, -0.3), its position coordinate x is (20, 30), its individual historical best solution pbest is (22, 28), and its group historical best solution gbest is (25, 32), we can set w=0.8, C1=2.0, C2=2.0, r1=0.6, and r1=0.4; then the velocity update calculation v x =6.8,v y =-1.04; After the position is updated, the new x=20+6.8=26.8, y=30-1.04=28.96, so the new position coordinates are (26.8,28.96).

[0094] Based on the above technical solution, by directly mapping the network deployment area to the algorithm solution space, a direct correlation is established between the physical environment and algorithm parameters. The region boundary can be used as a constraint for generating particle position coordinates, ensuring that the initial solution conforms to the actual network topology and avoiding invalid searches. The velocity vector is set to a random range based on the communication radius, matching the particle movement step size with the network scale. This achieves a precise mapping between the solution space and the physical space, laying a reasonable starting point for subsequent optimization. Simultaneously, a dual-layer storage architecture of individual and group historical optimal solutions is adopted. This allows each particle to independently maintain its individual optimal solution, while integrating the optimal solutions of all particles at the group level. Through a fitness value comparison mechanism (smaller values ​​are better), a progressive selection process is constructed for individuals and the group, ensuring that both individual exploration capabilities and group collaboration capabilities are maintained, achieving a balance between local search and global guidance. Finally, the velocity update formula integrates inertia weights, individual learning factors, and social learning factors to form a three-element driving mechanism of historical inertia, individual experience, and group intelligence. Position updates use the linear superposition of the velocity vector and the current position to construct a directional search path in the solution space. This allows for a dynamic balance between exploration and development through parameter coordination, ensuring that the inertial weights maintain search continuity and that the learning factor guides the convergence direction.

[0095] In one possible implementation of the embodiments of this application, combined with Figures 1-14 As shown, the process of performing simulated annealing, determining whether the termination condition is met, and outputting the global optimal solution as the optimal estimated coordinates of the unknown node can be implemented through the following steps 601 to 605, which are explained in detail below: Step 601: Randomly select a candidate solution from the individual historical best solutions of all particles, and calculate the difference ΔE between the fitness value of the candidate solution and the fitness value of the current population historical best solution.

[0096] In each iteration of the particle swarm optimization algorithm, a set of individual historical best solutions for all particles is obtained. These solutions are the best position coordinates recorded by each particle during the search process. The probability distribution is then calculated based on the fitness value of each individual's historical best solution. Random numbers are generated to determine the selection target, and a candidate solution is chosen from this set. The fitness function (whose inputs are the candidate solution coordinates, anchor node coordinates, and measurement distance) outputs the average error. Simultaneously, the fitness value of the current swarm's historical best solution is obtained (dynamically updated during iteration). The difference ΔE is calculated by subtracting the fitness value of the selected solution from the fitness value of the swarm's historical best solution. A positive result indicates a worse candidate solution, while a negative result indicates a better one, thus providing a basis for subsequent Metropolis criterion judgments.

[0097] Step 602: Determine whether to accept the candidate solution according to the Metropolis criterion. If the difference ΔE < 0, accept the candidate solution as the new global best solution of the population; otherwise, generate a uniform random number rand within the range [0, 1]. If the uniform random number rand < exp(-ΔE / T), accept the candidate solution as the new global best solution of the population.

[0098] Among them, the Metropolis criterion is the core criterion in the simulated annealing algorithm, which is used to accept inferior solutions with a certain probability to avoid the algorithm falling into local optimum. The uniform random number rand is a value generated by a random number generator within the range [0, 1], which is used to introduce randomness.

[0099] In some implementation manners, after calculating the difference ΔE, directly determine whether ΔE is less than 0. If it is satisfied, directly accept the candidate solution as the new global best solution of the population; otherwise, call the random number generator to generate a uniform random number rand within the range [0, 1]. At the same time, obtain the current temperature T and calculate the exponential function value exp(-ΔE / T), and compare the sizes of rand and exp(-ΔE / T). If rand is less than the exponential value, accept the candidate solution to update the global best solution of the population, otherwise keep the original solution unchanged; finally, record the judgment result and enter the subsequent iteration step.

[0100] Exemplarily, assume that the fitness value of the current global best solution of the population is 0.10 and the fitness value of the candidate solution is 0.12, then ΔE = 0.12 - 0.10 = 0.02. If the temperature T = 50 at this time, calculate exp(-0.02 / 50) ≈ 0.9996. Then generate the random number rand = 0.5. Since 0.5 < 0.9996, accept the candidate solution as the new solution; if rand = 0.9997, then reject it and keep the original global best solution of the population.

[0101] Step 603: Determine whether the termination condition that the current iteration number reaches the maximum iteration number is satisfied. If the termination condition is satisfied, output the current global best solution of the population as the optimal estimated coordinates of the unknown node; otherwise, continue to iterate to update the particle positions and velocities, and repeat the simulated annealing operation.

[0102] In some implementations, at the end of each iteration, it is checked whether the current iteration number is greater than or equal to the preset maximum iteration number. If the condition is met, the loop terminates, and the coordinates of the current swarm's historical best solution are output as the optimal estimated coordinates of the unknown nodes. Otherwise, the iteration process continues: first, the velocity vector and position coordinates of each particle are refreshed according to the particle swarm algorithm's velocity update formula and position iteration update formula; then, the simulated annealing operation is repeatedly performed, including selecting candidate solutions from individual historical best solutions, calculating the fitness difference ΔE, and applying the Metropolis criterion to determine whether to update the swarm's historical best solution, until the termination condition is met.

[0103] Based on the above technical solution, by selecting random candidate solutions and calculating the difference between ΔE, and by quantitatively solving the quality differences, the algorithm injects randomness into the collective intelligence of the particle swarm. This solves the problem of traditional particle swarm algorithms prematurely falling into local optima due to over-reliance on the group's historical best solutions. Existing DV-HOP algorithms, using trilateration or maximum likelihood estimation, lack such dynamic exploration mechanisms and are sensitive to errors in preceding hop counts and hop distances, easily causing coordinate solution deviations. Simultaneously, the structure combining the Metropolis criterion and the iteration termination condition achieves a balance between exploration and utilization through the probability mapping of exp(-ΔE / T) and a fixed threshold number. This allows the algorithm to accept inferior solutions in the early stages of iteration to expand the search range, and gradually converge to high-quality solutions in the later stages, thereby improving the localization anti-interference capability. This addresses the problem of traditional DV-HOP coordinate solution methods lacking a probability acceptance mechanism, making it unable to escape local extrema, resulting in insufficient stability of the localization results, especially with severe error accumulation in uneven network topologies.

[0104] The above primarily describes the solutions of the embodiments of this application from the perspective of device implementation. It is understood that each device, such as the DV-HOP positioning system based on hop distance correction and SA-PSO optimization, includes at least one of the hardware structures and software modules corresponding to each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0105] This application embodiment can divide the DV-HOP positioning system based on hop distance correction and SA-PSO optimization into functional units according to the above method example. For example, each function can be divided into separate functional units, or two or more functions can be integrated into the same processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0106] When using integrated units, Figure 15 A possible structural diagram of the DV-HOP positioning system based on hop distance correction and SA-PSO optimization (denoted as DV-HOP positioning system 150 based on hop distance correction and SA-PSO optimization) involved in the above embodiments is shown. The DV-HOP positioning system 150 based on hop distance correction and SA-PSO optimization includes a processing unit 1501 and a communication unit 1502, and may also include a storage unit 1503. Figure 15 The schematic diagram shown can be used to illustrate the structure of the DV-HOP positioning system based on jump distance correction and SA-PSO optimization involved in the above embodiments.

[0107] when Figure 15 The schematic diagram shown illustrates the structure of the DV-HOP positioning system based on jump distance correction and SA-PSO optimization involved in the above embodiments. The processing unit 1501 is used to control and manage the operation of the DV-HOP positioning system based on jump distance correction and SA-PSO optimization. The communication unit 1502 is used for the DV-HOP positioning system based on jump distance correction and SA-PSO optimization to communicate with other devices. The storage unit 1503 is used to store the program code and data of the DV-HOP positioning system based on jump distance correction and SA-PSO optimization.

[0108] For example, the communication unit is used to broadcast and receive data between anchor nodes and unknown nodes in a wireless sensor network. The processing unit integrates a dedicated SA-PSO optimization chip, which is configured to execute the simulated annealing particle swarm optimization algorithm and adjust the node communication radius through a dynamic deployment module to optimize the network topology.

[0109] In one possible implementation, the communication unit includes a hop count acquisition module and a data forwarding module: the hop count acquisition module is used to obtain the minimum hop count between anchor nodes through an anchor node flooding mechanism. The data forwarding module dynamically adjusts the data transmission path based on the physical deployment characteristics of the nodes, wherein the hop count acquisition module is connected to the processing unit via a dedicated bus.

[0110] In one possible implementation, the processing unit includes a hop count correction module and a hop distance calculation module. The hop count correction module calculates the actual geometric distance and communication hop count between anchor nodes, and corrects the minimum hop count using a hop count correction factor to obtain a refined hop count. The hop distance calculation module, based on the refined hop count, calculates the average hop distance error of the anchor nodes through a weighted error compensation mechanism, and corrects the average hop distance of unknown nodes. The hop count correction module and the hop distance calculation module exchange data through a multi-layered caching structure.

[0111] In one possible implementation, the processing unit further includes a coordinate optimization module and a termination decision module: the coordinate optimization module constructs a fitness function using a weighted average hop distance and a refined hop count, and executes a simulated annealing particle swarm optimization algorithm to solve for the coordinates of unknown nodes. The termination decision module controls the algorithm termination based on the number of iterations and a temperature threshold. The coordinate optimization module integrates a thermal management unit and dynamically adjusts the chip temperature through a heat sink.

[0112] The processing unit 1501 can be a processor or a controller, and the communication unit 1502 can be a communication interface, transceiver, transceiver circuit, transceiver device, etc. The term "communication interface" is a general term and may include one or more interfaces. The storage unit 1503 can be a memory. When the DV-HOP positioning system 150 based on hop distance correction and SA-PSO optimization is a chip, the processing unit 1501 can be a processor or a controller, and the communication unit 1502 can be an input interface and / or an output interface, pins, or circuits, etc. The storage unit 1503 can be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip (e.g., read-only memory (ROM), random access memory (RAM, etc.)).

[0113] The communication unit can also be referred to as a transceiver unit. The antenna and control circuit with transceiver functions in the DV-HOP positioning system 150 based on hop distance correction and SA-PSO optimization can be considered as the communication unit 1502 of the DV-HOP positioning system 150 based on hop distance correction and SA-PSO optimization, and the processor with processing functions can be considered as the processing unit 1501 of the DV-HOP positioning system 150 based on hop distance correction and SA-PSO optimization. Optionally, the device in the communication unit 1502 used to implement the receiving function can be considered as a communication unit, which is used to execute the receiving steps in the embodiments of this application. The communication unit can be a receiver, a receiver circuit, etc. The device in the communication unit 1502 used to implement the transmitting function can be considered as a transmitting unit, which is used to execute the transmitting steps in the embodiments of this application. The transmitting unit can be a transmitter, a transmitter, a transmitting circuit, etc.

[0114] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely illustrative descriptions of the application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and variations.

Claims

1. A DV-HOP positioning method based on jump distance correction and SA-PSO optimization, characterized in that, including: Deploy anchor nodes and unknown nodes in the network and set basic parameters, where the basic parameters include the particle swarm size, the maximum number of iterations, and the initial temperature of simulated annealing; All nodes in the network obtain the minimum hop count of the anchor nodes through the broadcast of the anchor nodes, calculate the actual geometric distance and communication hop count between the anchor nodes, and correct the minimum hop count by combining the hop count correction factor to obtain the refined hop count; Based on the refined hop count, calculate the average hop distance error of the anchor nodes, and correct the average hop distance of the unknown nodes by a weighted method to obtain the weighted average hop distance; Use the weighted average hop distance and the refined hop count to construct a fitness function with the goal of minimizing the coordinate estimation error; Randomly assign positions and velocities of the unknown node coordinates to each particle, and calculate and iterate the individual historical optimal solution and the population historical optimal solution; Perform simulated annealing operations and determine whether the termination conditions are met, and output the global optimal solution as the optimal estimated coordinates of the unknown nodes.

2. The DV-HOP positioning method based on jump distance correction and SA-PSO optimization according to claim 1, characterized in that, The process of calculating the actual geometric distance and communication hop count between the anchor nodes, and correcting the minimum hop count by combining the hop count correction factor to obtain the refined hop count specifically includes: Based on the coordinate data of each pair of anchor nodes i and j in the network, the actual geometric distance is calculated using the Euclidean distance formula. ; Based on the actual geometric distance Calculate the communication hop count based on the preset communication radius R. ; The minimum hop count between anchor nodes i and j is obtained through a flooding broadcast mechanism. ; Based on the minimum number of hops and communication hop count Calculate the jump correction factor ; Using the aforementioned hop count correction factor For minimum number of hops Perform product correction to obtain a refined jump count. .

3. The DV-HOP positioning method based on jump distance correction and SA-PSO optimization according to claim 2, characterized in that, The process of calculating the average hop distance error of the anchor nodes based on the refined hop count, and correcting the average hop distance of the unknown nodes by a weighted method to obtain the weighted average hop distance specifically includes: Obtain the actual geometric distance and refined jump count Based on the total number N of anchor nodes in the network, calculate the average hop distance of anchor node i. ; Based on the average jump distance Calculate the estimated distance ij from each anchor node i to other anchor nodes j and the single-hop error. ; Based on the single-hop error Calculate the average jump distance error ; Find the minimum number of hops from an unknown node to each anchor node i. And calculate the weight of each anchor node i with respect to the unknown node. and weighted average jump distance .

4. The DV-HOP positioning method based on jump distance correction and SA-PSO optimization according to claim 3, characterized in that, The process of using the weighted average hop distance and the refined hop count to construct a fitness function with the goal of minimizing the coordinate estimation error specifically includes: Based on the weighted average hop distance HopSize and the minimum number of hops Calculate the measured distance from the unknown node to anchor node i. ; Based on the coordinates of all anchor nodes and the measured distance Construct the fitness function.

5. The DV-HOP positioning method based on jump distance correction and SA-PSO optimization according to claim 4, characterized in that, The process of randomly assigning positions and velocities of the unknown node coordinates to each particle, and calculating and iterating the individual historical optimal solution and the population historical optimal solution specifically includes: Set the solution space range based on the network deployment area, randomly generate position coordinates (x, y) and velocity vectors (vx, vy) for each particle, and calculate the current position fitness value of each particle based on the fitness function; Obtain the fitness value corresponding to the individual historical optimal solution of each particle, and compare it with the current position fitness value. If the current fitness is better, update the individual historical optimal solution to the current position coordinates; After traversing all particles, select the individual historical optimal solution with the best fitness value as the population historical optimal solution; Update the velocity vector and position coordinates of each particle according to the particle swarm algorithm velocity update formula and position iteration update formula.

6. The DV-HOP positioning method based on jump distance correction and SA-PSO optimization according to claim 5, characterized in that, The process of performing simulated annealing operations and determining whether the termination conditions are met, and outputting the global optimal solution as the optimal estimated coordinates of the unknown nodes specifically includes: Randomly select a candidate solution from the individual historical optimal solutions of all particles, and calculate the difference ΔE between the fitness value of the candidate solution and the fitness value of the current population historical optimal solution; Judge whether to accept the candidate solution according to the Metropolis criterion. If the difference ΔE < 0, accept the candidate solution as the new population historical optimal solution; otherwise, generate a uniform random number rand within the range of [0, 1]. If the uniform random number rand < exp(-ΔE / T), accept the candidate solution as the new population historical optimal solution; Determine whether the termination condition of reaching the maximum number of iterations is met. If the termination condition is met, output the current group's historical best solution as the optimal estimated coordinates of the unknown node; otherwise, continue iterating to update the particle position and velocity, and repeat the simulated annealing operation.

7. A DV-HOP positioning system based on jump distance correction and SA-PSO optimization, characterized in that... The DV-HOP positioning method based on hop distance correction and SA-PSO optimization as described in any one of claims 1-9 includes a communication unit and a processing unit: The communication unit is used to broadcast and receive data between the anchor node and the unknown node in a wireless sensor network; The processing unit integrates a dedicated SA-PSO optimization chip, which is configured to execute the simulated annealing particle swarm optimization algorithm and adjust the node communication radius through a dynamic deployment module to optimize the network topology.

8. The DV-HOP positioning system based on jump distance correction and SA-PSO optimization according to claim 7, characterized in that, The communication unit includes a hop count acquisition module and a data forwarding module: The hop count acquisition module is used to obtain the minimum hop count between anchor nodes through the anchor node flooding broadcast mechanism; The data forwarding module dynamically adjusts the data transmission path based on the physical deployment characteristics of the nodes, and the hop count acquisition module is connected to the processing unit via a dedicated bus.

9. The DV-HOP positioning system based on jump distance correction and SA-PSO optimization according to claim 8, characterized in that, The processing unit includes a hop count correction module and a hop distance calculation module: The hop count correction module is used to calculate the actual geometric distance and communication hop count between anchor nodes, and to correct the minimum hop count by combining the hop count correction factor to obtain a refined hop count. The jump distance calculation module calculates the average jump distance error of the anchor node based on the refined jump number through a weighted error compensation mechanism, and corrects the average jump distance of the unknown node. The jump number correction module and the jump distance calculation module exchange data through a multi-layer cache structure.

10. The DV-HOP positioning system based on jump distance correction and SA-PSO optimization according to claim 8, characterized in that, The processing unit further includes a coordinate optimization module and a termination judgment module: The coordinate optimization module is used to construct a fitness function using the weighted average jump distance and the refined jump number, and to execute the simulated annealing particle swarm algorithm to solve for the coordinates of unknown nodes; The termination judgment module terminates based on the number of iterations and the temperature threshold control algorithm. The coordinate optimization module integrates a thermal management unit and dynamically adjusts the chip temperature through a heat sink.