Methods, devices, and storage media for node localization in wireless sensor networks based on adaptive hop count.
By employing adaptive hop count calculation and swarm intelligence optimization methods, the problems of insufficient hop count estimation accuracy and poor positioning stability in wireless sensor networks are solved, achieving high-precision and stable positioning in complex network environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID ANHUI ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-31
AI Technical Summary
Existing hop count-based ranging-free localization methods suffer from insufficient hop count estimation accuracy and poor localization stability in complex network environments, making them unsuitable for real-world application scenarios with uneven node distribution and complex network topologies.
By constructing a weighted graph structure, calculating the adaptive hop count increment, and combining iterative solutions with swarm intelligence optimization methods, the accuracy of hop count estimation is improved. Furthermore, local search optimization is performed in complex networks to enhance the stability of localization results.
Without adding extra ranging hardware, it improves the positioning accuracy and stability of unknown node locations in wireless sensor networks, adapts to complex network environments, and provides a stable auxiliary positioning method.
Smart Images

Figure CN122496773A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless sensor positioning methods, specifically a method, device, and storage medium for positioning nodes in a wireless sensor network based on adaptive hop count. Background Technology
[0002] With the continuous development of smart grid and Internet of Things (IoT) technologies, application scenarios such as power grid inspection, equipment monitoring, and environmental sensing place higher demands on the reliability and stability of node positioning technology. In actual deployment environments, inspection terminals or sensor nodes are often distributed in areas with complex terrain, severe obstruction, or complex electromagnetic environments. When relying solely on satellite navigation systems for positioning, they are easily affected by factors such as signal blockage and multipath effects, leading to decreased positioning accuracy or even positioning failure. Therefore, under the constraints of satellite positioning, researching an auxiliary positioning technology that does not rely on additional ranging hardware has significant engineering application value.
[0003] Wireless sensor networks (WSNs) are widely used in various monitoring and inspection systems due to their flexible deployment, low cost, and easy scalability. To address the node localization problem in WSNs, existing technologies have proposed various localization methods, which can generally be divided into two categories: ranging localization methods and non-ranging localization methods. Among these, ranging localization methods require nodes to have distance or angle measurement capabilities, placing high demands on hardware and making them difficult to promote and apply in low-cost, large-scale deployment scenarios.
[0004] In contrast, range-free localization methods, which rely solely on network connectivity or hop count information for location estimation, offer advantages such as low energy consumption and simple implementation, making them an important direction in current wireless sensor network localization research. Hop count-based range-free localization methods are a typical example of this type of method. Their basic idea is to estimate the location of unknown nodes by statistically analyzing the minimum hop count between nodes and combining this with the known location information of anchor nodes.
[0005] Existing hop-count-based localization methods typically include the following main steps: First, the minimum hop count between each node and the anchor node is obtained through a network broadcast mechanism; second, the average hop distance is calculated based on the physical distance between anchor nodes and the corresponding hop count, and the distance from the unknown node to the anchor node is estimated accordingly; finally, the position of the unknown node is solved using analytical calculation methods. This type of method is simple to implement and has a certain localization effect under ideal network conditions.
[0006] However, in practical applications, the above methods still have significant shortcomings. On the one hand, traditional hop count calculation methods typically treat all nodes within the communication radius as a single hop, ignoring the actual physical distance differences between nodes. When node distribution is uneven or the network topology is complex, this can easily introduce large hop count discrepancies, thus affecting the accuracy of distance estimation. On the other hand, existing methods mostly employ analytical methods such as least squares for location solving. These methods are quite sensitive to distance estimation errors and the geometric distribution of anchor nodes. Under conditions of error accumulation or imperfect anchor node distribution, problems such as unstable positioning or error amplification can easily occur.
[0007] Furthermore, in complex application environments, network size, node density, and communication conditions may change dynamically. Existing fixed-parameter hop count models and analytical solution methods cannot balance positioning accuracy and stability, thus limiting the practical application effect of range-free positioning methods in engineering scenarios.
[0008] Therefore, how to improve the accuracy of hop count estimation while maintaining the range-free characteristic, and enhance the adaptability of the localization solution process to complex network environments, remains a technical problem that urgently needs to be solved in the field of wireless sensor network localization. Summary of the Invention
[0009] This invention provides a method, device, and storage medium for node localization in wireless sensor networks based on adaptive hop count, in order to solve the problems of insufficient hop count estimation accuracy and poor stability of localization results in existing hop count-based ranging-free localization methods in complex network environments.
[0010] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0011] A node localization method in a wireless sensor network based on adaptive hop count, wherein each wireless sensor is considered a node, with nodes whose locations are known serving as anchor nodes and the remaining nodes whose locations are unknown serving as unknown nodes to be located, is as follows:
[0012] Step 1: Determine the decimal jump increment between any two adjacent nodes;
[0013] Step 2: Using each node as a node in the graph structure, the communication between adjacent nodes as the edge between adjacent nodes in the graph structure, and the fractional hop increment of adjacent nodes as the weight of the corresponding edge, a weighted graph structure corresponding to the wireless sensor network is constructed; then, using each anchor node as a source node, the minimum cumulative hop count between each anchor node and all other nodes is calculated in the weighted graph structure.
[0014] Step 3: Based on the minimum cumulative number of hops between each anchor node and other anchor nodes and the actual physical distance, calculate the average hop distance parameter of each anchor node; then, based on the average hop distance parameter of each anchor node and the minimum cumulative number of hops from each anchor node to each unknown node, calculate the estimated physical distance between the corresponding unknown node and the corresponding anchor node, thus obtaining the estimated physical distance between each unknown node and each anchor node.
[0015] Step 4: Based on the coordinates of multiple anchor nodes and the estimated physical distance between each unknown node and each anchor node, obtain a rough position estimate for each unknown node.
[0016] Step 5: Using the coordinates of each unknown node as the unknown quantity to be solved, and combining the known coordinates of each anchor node with the estimated physical distance between each unknown node and each anchor node obtained in Step 3, establish the objective function for the localization problem of each unknown node; and, based on the coarse position estimate of each unknown node obtained in Step 4, construct the corresponding local search region, thereby transforming the localization problem of each unknown node into a continuous optimization problem; then, iteratively solve the continuous optimization problem using a swarm intelligence optimization method to obtain the final localization result of each unknown node.
[0017] Furthermore, in step 1, the normalized local density index of each node is first calculated.
[0018] Next, based on the normalized local density index of each node, the corresponding communication radius partitioning parameters are assigned to the corresponding nodes;
[0019] Then, the communication radius of each node is divided into multiple concentric distance intervals with the same number of communication radius intervals according to the allocated communication radius division parameters, and the width and distance range of each concentric distance interval are obtained.
[0020] Finally, based on the concentric distance interval to which the actual physical distance between any two adjacent nodes belongs, the decimal jump increment between the two adjacent nodes is allocated, thus obtaining the decimal jump increment between any two adjacent nodes.
[0021] Furthermore, the number of neighboring nodes within each node's communication radius is used as the degree of the corresponding node. Based on the degree of each node and the average degree of all nodes in the wireless sensor network, the normalized local density index of each node is calculated.
[0022] Furthermore, in step 2, the minimum cumulative number of hops between each anchor node and all other nodes is calculated in the weighted graph structure using an iterative relaxation method or a shortest path search method equivalent to the iterative relaxation method.
[0023] Furthermore, in step 3, the minimum mean square error criterion is used to calculate the average jump distance parameter of each anchor node based on the minimum cumulative number of jumps between each anchor node and other anchor nodes and the actual physical distance.
[0024] Furthermore, in step 4, based on the coordinates of each anchor node and combined with the estimated physical distance between each unknown node and each anchor node, a positioning equation for each unknown node relative to each anchor node is established.
[0025] The positioning equations of each unknown node relative to each anchor node are combined to form a set of positioning equations. The set of positioning equations is solved by the least squares method to obtain a rough position estimate of each unknown node.
[0026] Furthermore, in step 5, the process of constructing the local search region is as follows:
[0027] Based on the estimated physical distance between each unknown node and all anchor nodes, calculate the average estimated distance of each unknown node; take the smaller of the average estimated distance of each unknown node and the communication radius as the initial search radius; then, take the coarse location estimate of the corresponding unknown node obtained in step 4 as the center and construct the corresponding local search area based on the initial search radius.
[0028] Furthermore, in step 5, based on the objective function and the local search region corresponding to each unknown node, an iterative optimization solution is performed using a swarm intelligence optimization method. The optimization solution process is as follows:
[0029] Multiple candidate locations are constructed as candidate solutions within the local search region of each unknown node;
[0030] In each iteration, the fitness value of each candidate solution is calculated using the objective function, and the candidate solutions are divided according to the fitness value. The candidate solutions with smaller fitness values are designated as exploration candidate solutions, and the remaining candidate solutions are designated as exploration candidate solutions.
[0031] During each iteration, for exploratory candidate solutions, a global search update is performed within the local search region; for development candidate solutions, a local fine search update is performed within the local search region around the current best candidate solution. After each update, the fitness values of all candidate solutions are recalculated, and the current best candidate solution is updated.
[0032] Repeat the iteration multiple times until the iteration optimization termination condition is met, then terminate the iteration process, obtain the optimal candidate solution for the corresponding unknown node, and use the optimal candidate solution as the final location result of the corresponding unknown node.
[0033] Furthermore, among the multiple candidate solutions in the local search region of each unknown node, at least one candidate solution is a rough position estimate obtained by hop count localization, and the remaining candidate solutions are generated through chaotic mapping.
[0034] Furthermore, when the number of iterations reaches the set upper limit, or when the change in the objective function value is less than the set threshold during several consecutive iterations, the iteration optimization termination condition is met, and the iteration process is terminated.
[0035] An electronic device includes a processor and a memory, the memory storing program instructions that are read and executed by the processor to perform the above-described method for locating nodes in a wireless sensor network based on adaptive hop count.
[0036] A storage medium storing program instructions that are read and executed to perform the above-described method for locating nodes in a wireless sensor network based on adaptive hop count.
[0037] In this invention, wireless sensor nodes are deployed within the monitoring area, and network connections are established between the nodes through a preset communication radius. Some nodes are anchor nodes with known locations, while the remaining nodes are unknown nodes to be located. The adjacency relationships between the nodes are obtained through network communication.
[0038] The local connectivity of a node is characterized by the number of its neighboring nodes within its communication radius. Based on these connectivity characteristics, communication radius partitioning parameters are determined for each node. The communication radius is then segmented using these parameters. Different hop count increments are allocated based on the actual physical distance between adjacent nodes. The minimum cumulative hop count from the unknown node to each anchor node is calculated through iterative updates, thereby improving the precision of hop count estimation. The average hop distance of the anchor nodes is calculated based on the known physical distances between them and their corresponding minimum cumulative hop counts, and this is used to estimate the distance from the unknown node to each anchor node.
[0039] Building upon this foundation, the localization process of unknown nodes is transformed into an optimization problem aimed at minimizing distance error. A localization objective function is constructed and coarse localization guidance is provided to determine the local search area and initialize candidate solutions. Subsequently, a swarm intelligence optimization process is executed to iteratively update multiple candidate solutions, gradually approaching the optimal location estimate of the unknown node. This enhances the stability of the localization results in complex network environments. Collision detection and free step size adjustment mechanisms are introduced during the iteration process to enhance search diversity and avoid getting trapped in local optima. When a preset termination condition is met, the localization result of the unknown node is output.
[0040] Compared with the prior art, the advantages of the present invention are:
[0041] To address the issue that existing methods commonly employ fixed hop count models, which fail to reflect the actual spatial distribution characteristics of nodes, this invention introduces a hop count calculation mechanism related to the local connectivity characteristics of nodes. This allows the hop count estimation between nodes to adaptively adjust with changes in network density, thereby reducing distance estimation errors caused by hop count discrepancies.
[0042] Meanwhile, in view of the problem that existing analytical solution methods are prone to unstable positioning results under the conditions of accumulated distance estimation errors or imperfect anchor node distribution, this invention improves the adaptability of unknown node position estimation to complex network topology and measurement errors by constructing a positioning solution process based on error minimization.
[0043] Through the above-mentioned technical means, the present invention can reliably estimate the location of unknown nodes in a wireless sensor network without adding additional ranging hardware, thereby providing a stable and practical auxiliary positioning method for application scenarios such as power line inspection and intelligent monitoring under satellite positioning constraints. Attached Figure Description
[0044] Figure 1 This is a flowchart of the method according to an embodiment of the present invention. Detailed Implementation
[0045] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0046] This embodiment discloses a node localization method in a wireless sensor network based on adaptive hop count. The monitoring area deployed in this embodiment is a square region with side length L. Each wireless sensor in the network serves as a node, with some nodes being anchor nodes whose locations are known, and the remaining nodes being unknown nodes to be located. The communication radius of all nodes is set to R. A direct communication connection is considered to exist between any two nodes when the Euclidean distance between them does not exceed the communication radius R. Each node establishes adjacency relationships through a broadcast mechanism for subsequent hop count propagation and localization calculation.
[0047] like Figure 1 As shown in the figure, the process of the node localization method in the wireless sensor network based on adaptive hop count in this embodiment is as follows:
[0048] Step 1: Determine the decimal jump increment between any two adjacent nodes.
[0049] In this embodiment, the first step is to calculate the distance of each node within its respective communication radius. Let the number of neighboring nodes be denoted as the degree of the corresponding node, and let the degree of any i-th node be denoted as . .
[0050] Calculate the average degree of all nodes in the wireless sensor network based on the degree of all nodes. The calculation formula is as follows:
[0051]
[0052] Where N represents the total number of nodes in the wireless sensor network.
[0053] In this embodiment, the degree of each node and the average degree of all nodes in the wireless sensor network are considered. The normalized local density index of the corresponding node is calculated as shown in the following formula:
[0054]
[0055] in: Let be the normalized local density index for any i-th node, used to characterize the relative connectivity density of the region where the node is located.
[0056] Next, this embodiment assigns corresponding communication radius partitioning parameters to the corresponding nodes based on the normalized local density index of each node. As shown in the formula below:
[0057]
[0058] in: Let be the normalized local density index for any i-th node; Let be the communication radius partitioning parameter corresponding to any i-th node, representing the division of the communication radius of that i-th node into . There are concentric distance intervals. When the density of the i-th node is high, the corresponding normalized local density index is... Larger, corresponding to larger communication radius division parameters To obtain a more refined hop count characterization; when the density of the i-th node is low, the corresponding normalized local density index Smaller, corresponding to a smaller communication radius division parameter This is to ensure computational stability.
[0059] Then, in this embodiment, the communication radius of each node is divided into multiple concentric distance intervals, the same number as the allocated communication radius division parameters, according to the assigned communication radius division parameters, and the width and distance range of each concentric distance interval are obtained. Specifically, using the spatial coordinates of any i-th node... With the center as the radius of communication To find the maximum radius, the communication radius of any i-th node is... Parameters are divided according to the allocated communication radius. Divided into There are three concentric intervals, and the width of each concentric interval is... As shown in the following formula:
[0060]
[0061] Then the communication radius of any i-th node Parameters are divided according to the allocated communication radius. The distance range of the kth concentric interval is , .
[0062] Finally, in this embodiment, based on the concentric distance interval to which the actual physical distance between any two adjacent nodes belongs, the fractional hop increment between those two adjacent nodes is allocated. Specifically, let the actual physical distance between any adjacent i-th node and j-th node be... When satisfied Time, i.e., actual physical distance Communication radius belonging to the i-th node Parameters are divided according to the allocated communication radius. When considering the distance range of the k-th concentric interval, the increment of the decimal jump count between any adjacent i-th and j-th nodes is... As shown in the following formula:
[0063]
[0064] In the formula: .
[0065] in, , Let be the spatial coordinates of any i-th node. Let be the spatial coordinates of any j-th node adjacent to any i-th node. Let be the actual physical distance between any adjacent i-th node and j-th node. , which is the one-hop link distance between adjacent nodes, used to determine their concentric distance interval. In this embodiment, the actual physical distance... Preferably, the distance is obtained through node deployment records or offline calibration; alternatively, in engineering applications, a one-hop distance estimate can be obtained based on communication link parameters such as the Received Signal Strength Indication (RSSI) of the one-hop link, and this one-hop distance estimate can be used as... Used for interval determination.
[0066] By using the above method, the hop count increment between adjacent nodes is no longer fixed as an integer of 1, but is adaptively adjusted according to the local density of the nodes, thereby reducing the distance quantization error caused by the traditional integer hop count model and improving the accuracy of hop count estimation.
[0067] Step 2: Using each wireless sensor node in the wireless sensor network as a node in the graph structure, and the communication between adjacent nodes as the edges between adjacent nodes, and using the fractional hop increment of adjacent nodes as the weight of the corresponding edge, a weighted graph structure corresponding to the wireless sensor network is constructed. Then, using each anchor node as the source node, the minimum cumulative hop count between each anchor node and all other nodes in the network, including unknown nodes and other anchor nodes, is calculated in the weighted graph structure using an iterative relaxation method or an equivalent shortest path search method.
[0068] In this implementation, the process of calculating the minimum cumulative hop count between any i-th anchor node and all other nodes (including unknown nodes and other anchor nodes) using the iterative relaxation method is as follows:
[0069] (A1) Initialization:
[0070] Let any i-th anchor node be the source node, and let the cumulative hop count from source anchor node i to any j-th node be denoted as . During initialization, let the cumulative hop count from the source anchor node i to itself be... The cumulative number of hops for the remaining nodes Initialize to infinity.
[0071] (A2) Traverse and update:
[0072] For any two adjacent nodes , The edge between ,in , Let each edge be a node at one end and a node at the other end. The weight of the node , The corresponding decimal jump increments If the source node i is to the node Cumulative number of jumps Source node i to node Cumulative number of jumps ,satisfy Then the source node i will be transferred to the node. Cumulative number of jumps Updated as shown in the following formula:
[0073]
[0074] (A3) Repeatedly traverse all edges until the cumulative hop count of all nodes no longer changes, then the minimum cumulative hop count from any anchor node i to all other nodes is obtained.
[0075] In this implementation, the Dijkstra method is preferred as the shortest path search method. The process of calculating the minimum cumulative hop count from any i-th anchor node to all other nodes using the Dijkstra method is as follows:
[0076] (B1) Let any i-th anchor node be the source node. Add the source node i to the determined set, and its cumulative hop count is 0; add the remaining nodes to the undetermined set.
[0077] (B2) Select the node u with the smallest current cumulative hop count from the undetermined set and add node u to the determined set;
[0078] (B3) Using the node u selected in step (B2), perform a relaxation update on its adjacent node v, as shown in the following equation:
[0079]
[0080] in: For source node i to node The current cumulative number of hops; For source node i to node The current cumulative number of hops; Adjacent nodes , The corresponding decimal jump increments.
[0081] (B4) Repeat steps (B2)–(B3) until the minimum cumulative hop count for all nodes is determined, thereby obtaining the minimum cumulative hop count from source node i to all other nodes.
[0082] The process terminates when the iterative relaxation method or shortest path search method meets the convergence condition, thus obtaining the minimum cumulative hop count between each anchor node and all other nodes. Based on the minimum cumulative hop count between each anchor node and all other nodes, a minimum cumulative hop count matrix is constructed.
[0083] Specifically, in this embodiment, let any i-th anchor node be the source node and any j-th node be the target node. The minimum cumulative hop count from anchor node i (the source node) to target node j is denoted as . Then the minimum cumulative hop count matrix is constructed. As shown in the following formula:
[0084]
[0085] Where: M is the number of anchor nodes; N is the total number of nodes in the network; This represents the minimum cumulative hop count from any i-th anchor node to the j-th node. This minimum cumulative hop count matrix... The minimum cumulative number of jumps is used for subsequent average jump distance calculation and unknown node distance estimation.
[0086] Step 3: Based on the minimum cumulative number of hops between each anchor node and other anchor nodes and the actual physical distance, calculate the average hop distance parameter of each anchor node; then, based on the average hop distance parameter of each anchor node and the minimum cumulative number of hops from each anchor node to each unknown node, calculate the estimated physical distance between the corresponding unknown node and the corresponding anchor node, thus obtaining the estimated physical distance between each unknown node and each anchor node.
[0087] In this embodiment, after obtaining the minimum cumulative jump count, the average jump distance parameter of each anchor node is calculated using the known actual physical distance between each anchor node and other anchor nodes, as well as the minimum cumulative jump count between each anchor node and other anchor nodes. Specifically, let the coordinates of any i-th anchor node be... The coordinates of any j-th anchor node are Then the actual physical distance between any i-th anchor node and j-th anchor node is... As shown in the following formula:
[0088]
[0089] in, Let i be the spatial coordinates of any i-th anchor node. Let be the spatial coordinates of any j-th anchor node.
[0090] Furthermore, let the minimum cumulative hop count from any i-th anchor node to any j-th anchor node be . Then the average jump distance parameter of any i-th anchor node The calculation is performed using the minimum mean square error criterion, as shown in the following formula:
[0091]
[0092] The summation range includes all other anchor nodes except for the i-th anchor node itself.
[0093] In this embodiment, the estimated physical distance between the target unknown node and the corresponding anchor node is calculated based on the average hop distance parameter of each anchor node and the minimum cumulative hop count from each anchor node to each unknown node. Specifically, let the estimated physical distance between any unknown node u and any i-th anchor node be denoted as... ,but The calculation formula is as follows:
[0094]
[0095] in: Let be the minimum cumulative number of hops from any i-th anchor node to any unknown node u; Let be the average jump distance parameter for any i-th anchor node.
[0096] The above calculations yielded the estimated physical distance between each unknown node and each anchor node.
[0097] Step 4: Based on the coordinates of each anchor node and the estimated physical distance between each unknown node and each anchor node, establish the positioning equations between each unknown node and each anchor node. Combine the positioning equations between each unknown node and each anchor node to form a set of positioning equations. Solve the set of positioning equations using the least squares method to obtain a rough position estimate for each unknown node.
[0098] In this embodiment, let the coordinates of any unknown node u be... Let the coordinates of any i-th anchor node be... This is a known quantity. Combined with the estimated physical distance between the unknown node u and the i-th anchor node... The positioning equations for the unknown node u and the i-th anchor node are established as follows:
[0099]
[0100] A set of positioning equations is constructed by combining the positioning equations corresponding to the unknown node u and multiple valid anchor nodes. By solving the set of positioning equations using least squares, a coarse estimate of the location of the unknown node u can be obtained. Therefore, by using the coordinates of multiple anchor nodes and the estimated physical distance between each unknown node and its corresponding anchor node, a system of equations is established and solved using least squares to obtain a rough position estimate for each unknown node.
[0101] In this embodiment, when the number of effective anchor nodes in non-collinear positions participating in the calculation is less than three, or the least squares solution matrix does not meet the full rank condition, the coarse position estimate is recorded as invalid; when the coarse position estimate is available, step 5 is executed.
[0102] Step 5: Using the coordinates of each unknown node as the unknown quantity to be solved, and combining them with the known coordinates of each anchor node and the estimated physical distance between each unknown node and each anchor node obtained in Step 3, establish the objective function for the localization problem of each unknown node. Furthermore, based on the coarse location estimate of each unknown node obtained in Step 4, construct the corresponding local search region, thereby transforming the localization problem of each unknown node into a continuous optimization problem. Then, iteratively solve the continuous optimization problem using a swarm intelligence optimization method to obtain the final localization result of each unknown node. The process is as follows:
[0103] Step 5.1: Construct the objective function for the localization problem of each unknown node.
[0104] Let the coordinates of any u-th unknown node be... , which is the unknown quantity to be determined; the coordinates of any i-th anchor node are The known quantity is the estimated physical distance between the unknown node u and the i-th anchor node obtained in step 3. The objective function for locating the unknown node u is then expressed as follows:
[0105]
[0106] Where M is the number of valid anchor nodes participating in the calculation. This is the estimated physical distance between the unknown node u and the i-th anchor node obtained in step 3.
[0107] During the swarm intelligence optimization iteration process, the fitness value of the candidate solution is taken as the objective function value. A smaller fitness value indicates a smaller positioning error.
[0108] Step 5.2: When the coarse location estimate of each unknown node obtained in step 4 is available, construct the corresponding local search region centered on the coarse location estimate, and construct multiple candidate locations as candidate solutions within the local search region.
[0109] Specifically, for any u-th unknown node, firstly, based on the estimated physical distances between unknown node u and all anchor nodes, calculate the average estimated distance of unknown node u. As shown in the following formula:
[0110]
[0111] Take the average estimated distance of each unknown node , communication radius The smaller of the two will be used as the initial search radius. As shown in the following formula:
[0112]
[0113] Where R is the communication radius.
[0114] Then, using the rough position estimate of the unknown node u relative to the i-th anchor node as the center, and based on the initial search radius, the corresponding local search region is constructed as shown in the following equation:
[0115]
[0116] in: Let be the approximate position estimate of the unknown node u relative to the i-th anchor node; x is the x-coordinate of the corresponding local search region, and y is the y-coordinate of the corresponding local search region. This gives the range of the local search region corresponding to the unknown node u.
[0117] At the same time, the scope of the aforementioned local search area is trimmed based on the boundary of the monitoring search area to ensure that the candidate solutions do not exceed the monitoring area.
[0118] After obtaining the corresponding local search region, multiple candidate positions are constructed within this local search region as candidate solutions. Specifically, let the number of candidate solutions be P, and the first candidate solution... The initialization is based on the coarse position estimate obtained from the hop count localization in step 4, i.e. The remaining candidate solutions The solution is generated through a chaotic mapping method and mapped to the corresponding local search region to ensure the uniformity of the initial solution distribution.
[0119] Step 5.3: Based on the objective function and the local search region corresponding to each unknown node, iterative optimization is performed using swarm intelligence optimization methods to solve the problem.
[0120] Specifically, let the current iteration number be t, and the maximum iteration number be... .
[0121] For each candidate solution in the corresponding local search region of each unknown node The fitness value of each candidate solution is calculated using the objective function constructed in step 5.1. As shown in the formula below:
[0122]
[0123] Among them, fitness value The smaller the value, the smaller the positioning error.
[0124] Based on the fitness value, each candidate solution in the local search region is sorted, and the candidate solutions with smaller fitness values are classified as development candidate solutions, while the remaining candidate solutions are classified as exploration candidate solutions.
[0125] For exploratory candidate solutions, a global search update is performed within the local search region, with the update formula as follows:
[0126]
[0127] in: For the first The position of the k-th candidate solution in the next iteration; For the first The position of the k-th candidate solution in the next iteration; Let be a random vector within the interval [−1, 1].
[0128] For step size parameters, As shown in the following formula:
[0129]
[0130] For development-type candidate solutions, focus on the current optimal candidate solution. A fine-grained local search is performed within the local search region, and its update formula is shown below:
[0131]
[0132] in: This is the local search step size coefficient. As shown in the following formula:
[0133]
[0134] In the formula This is a preset constant.
[0135] During each iteration, the spatial distribution of candidate solutions within the local search region is monitored in real time. When any two candidate solutions... , The distance between them satisfies When this occurs, it is determined that aggregation or collision has occurred. The step size parameter is then readjusted as shown in the following formula:
[0136]
[0137] in, The distance threshold between candidate solutions; This is the step size adjustment coefficient. This is used to enhance search diversity and prevent the algorithm from getting stuck in local optima.
[0138] After each update, the fitness values of all candidate solutions in the local search region are recalculated, and the current best candidate solution is updated.
[0139] Step 5.4: Repeat step 5.3 until the number of iterations reaches the set upper limit, or the change in the objective function value is less than the set threshold during several consecutive iterations. Then, terminate the iteration process, obtain the optimal candidate solution in the local search region, and use the optimal candidate solution as the final location result of the corresponding unknown node.
[0140] For the u-th unknown node, select the candidate solution with the smallest fitness value. This serves as the final location result for the unknown node u.
[0141] This embodiment also discloses an electronic device, including a processor and a memory. The memory stores program instructions that can be read and executed by the processor. When the program instructions are read and executed by the processor, steps 1-5 of the above-described method for locating nodes in a wireless sensor network based on adaptive hop count are performed.
[0142] This embodiment also discloses a storage medium storing program instructions that can be read and run by any processor capable of reading and running the program instructions. When the program instructions are read and run by any processor, steps 1-5 of the above-described method for locating nodes in a wireless sensor network based on adaptive hop count are executed.
[0143] The wireless sensor network node localization method of this invention introduces an adaptive hop count calculation mechanism based on the local connectivity characteristics of nodes, enabling hop count estimation to reflect the actual spatial distribution characteristics between nodes and effectively reducing the distance estimation error caused by the traditional fixed hop count model. Furthermore, by transforming the node localization process into an optimization problem with the goal of minimizing distance error, the adaptability of the localization results to complex network topologies and measurement errors is improved, thereby enhancing the stability of the localization results.
[0144] Through the above adaptive hop count modeling and continuous optimization solution process, without increasing additional ranging hardware and communication overhead, stable estimation of the location of unknown nodes in wireless sensor networks under complex environments can be achieved, improving positioning accuracy and enhancing the algorithm's adaptability to complex network topologies.
[0145] The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. These embodiments are merely descriptions of preferred embodiments and are not intended to limit the scope or concept of the invention. The specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. Such combinations, as long as they do not violate the spirit of the present invention, should also be considered as part of this disclosure. To avoid unnecessary repetition, the present invention will not further describe the various possible combinations.
[0146] This invention is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this invention and without departing from the design idea of this invention, all modifications and improvements made by those skilled in the art to the technical solutions of this invention should fall within the protection scope of this invention. The technical content for which protection is sought in this invention has been fully described in the claims.
Claims
1. A node localization method in a wireless sensor network based on adaptive hop count, wherein each wireless sensor in the wireless sensor network is considered a node, with nodes whose locations are known serving as anchor nodes and the remaining nodes whose locations are unknown serving as unknown nodes to be located, characterized in that... The process is as follows: Step 1: Determine the decimal jump increment between any two adjacent nodes; Step 2: Using each node as a node in the graph structure, the communication between adjacent nodes as the edge between adjacent nodes in the graph structure, and the fractional hop increment of adjacent nodes as the weight of the corresponding edge, a weighted graph structure corresponding to the wireless sensor network is constructed; then, using each anchor node as a source node, the minimum cumulative hop count between each anchor node and all other nodes is calculated in the weighted graph structure. Step 3: Calculate the average jump distance parameter for each anchor node based on the minimum cumulative number of jumps between each anchor node and other anchor nodes and the actual physical distance. Then, based on the average jump distance parameter of each anchor node and the minimum cumulative number of jumps from each anchor node to each unknown node, the physical distance estimate between the corresponding unknown node and the corresponding anchor node is calculated, thus obtaining the physical distance estimate between each unknown node and each anchor node. Step 4: Based on the coordinates of multiple anchor nodes and the estimated physical distance between each unknown node and each anchor node, obtain a rough position estimate for each unknown node. Step 5: Using the coordinates of each unknown node as the unknown quantity to be solved, and combining the known coordinates of each anchor node with the estimated physical distance between each unknown node and each anchor node obtained in Step 3, establish the objective function for the localization problem of each unknown node; and, based on the coarse position estimate of each unknown node obtained in Step 4, construct the corresponding local search region, thereby transforming the localization problem of each unknown node into a continuous optimization problem; then, iteratively solve the continuous optimization problem using a swarm intelligence optimization method to obtain the final localization result of each unknown node.
2. The method of claim 1, wherein, In step 1, the normalized local density index of each node is first calculated; Next, based on the normalized local density index of each node, the corresponding communication radius partitioning parameters are assigned to the corresponding nodes; Then, the communication radius of each node is divided into multiple concentric distance intervals with the same number of communication radius intervals according to the allocated communication radius division parameters, and the width and distance range of each concentric distance interval are obtained. Finally, based on the concentric distance interval to which the actual physical distance between any two adjacent nodes belongs, the decimal jump increment between the two adjacent nodes is allocated, thus obtaining the decimal jump increment between any two adjacent nodes.
3. The method of claim 2, wherein, The number of neighboring nodes within each node's communication radius is used as the degree of the corresponding node. Based on the degree of each node and the average degree of all nodes in the wireless sensor network, the normalized local density index of each node is calculated.
4. The method of claim 1, wherein, In step 2, the minimum cumulative number of hops between each anchor node and all other nodes is calculated in the weighted graph structure using an iterative relaxation method or a shortest path search method equivalent to the iterative relaxation method.
5. The method of claim 1, wherein, In step 3, the minimum mean square error criterion is used to calculate the average jump distance parameter of each anchor node based on the minimum cumulative number of jumps between each anchor node and other anchor nodes and the actual physical distance.
6. The method of claim 1, wherein, In step 4, based on the coordinates of each anchor node and combined with the estimated physical distance between each unknown node and each anchor node, a positioning equation for each unknown node relative to each anchor node is established. The positioning equations of each unknown node relative to each anchor node are combined to form a set of positioning equations. The set of positioning equations is solved by the least squares method to obtain a rough position estimate of each unknown node.
7. The method of claim 1, wherein the number of hops is adaptively determined. In step 5, the process of constructing the local search region is as follows: Based on the estimated physical distance between each unknown node and all anchor nodes, calculate the average estimated distance of each unknown node; take the smaller of the average estimated distance of each unknown node and the communication radius as the initial search radius; then, take the coarse location estimate of the corresponding unknown node obtained in step 4 as the center and construct the corresponding local search area based on the initial search radius.
8. The method according to claim 1 or 7, wherein, In step 5, based on the objective function and the local search region corresponding to each unknown node, an iterative optimization method is used to solve the problem. The optimization process is as follows: Multiple candidate locations are constructed as candidate solutions within the local search region of each unknown node; In each iteration, the fitness value of each candidate solution is calculated using the objective function, and the candidate solutions are divided according to the fitness value. The candidate solutions with smaller fitness values are designated as exploration candidate solutions, and the remaining candidate solutions are designated as exploration candidate solutions. During each iteration, for exploratory candidate solutions, a global search update is performed within the local search region; for development candidate solutions, a local fine search update is performed within the local search region around the current best candidate solution. After each update, the fitness values of all candidate solutions are recalculated, and the current best candidate solution is updated. Repeat the iteration multiple times until the iteration optimization termination condition is met, then terminate the iteration process, obtain the optimal candidate solution for the corresponding unknown node, and use the optimal candidate solution as the final location result of the corresponding unknown node.
9. The method of claim 8, wherein, Among the multiple candidate solutions in the local search region of each unknown node, at least one candidate solution is a rough position estimate obtained by hop count localization, and the remaining candidate solutions are generated through chaotic mapping.
10. The method of claim 8, wherein, When the number of iterations reaches the set upper limit, or when the change in the objective function value is less than the set threshold during several consecutive iterations, the iteration optimization termination condition is met, and the iteration process is terminated.
11. An electronic device comprising a processor and a memory, the memory having stored therein program instructions, the device being characterized by: The program instructions are read and executed by the processor to perform the node localization method in a wireless sensor network based on adaptive hop count as described in any one of claims 1-10.
12. A storage medium storing program instructions, characterized in that, The program instructions are read and executed to perform the node localization method in a wireless sensor network based on adaptive hop count as described in any one of claims 1-10.