Iterative Positioning Algorithm for Indoor Node Based on Distance Correction in WSNs

Node position information is critical in wireless sensor networks (WSN). However, existing positioning algorithms commonly have the issue of low positioning accuracy due to noise interferences in communication. Hence, proposed in this paper is an iterative positioning algorithm based on distance correction to improve the positioning accuracy of target nodes in WSNs, with contributions including (1) a log-distance distribution model of received signal strength indication (RSSI) ranging which is built and from which is derived a noise impact factor based on the model, (2) the initial position coordinates of the target node obtained using a triangle centroid localization algorithm, via which the distance deviation coefficient under the influence of noise is calculated, and (3) the ratio of the distance measured by the log-distance distribution model to the median distance deviation coefficient which is taken as the new distance between the target node and the anchor node. Based on the new distance, the triangular centroid positioning algorithm is applied to calculate the coordinates of the target node, after which the iterative positioning model is constructed and the distance deviation coefficient updated repeatedly to update the positioning result until the criteria of iterations are reached. Experiment results show that the proposed iterative positioning algorithm is promising and effectively improves positioning accuracy.


Introduction
Wireless sensor networks have been widely applied in indoor scenarios where satellite or cellular signals do not work properly, primarily in fields of defense, industry, and social life due to the networks' advantages of low power consumption, low cost, and self-organization [1]. In order to provide adequate monitoring services in engineering applications, node position information must be provided [2,3]. Node position information is the key to whether the information obtained is valuable or not in the WSN-based Zigbee protocol, especially for target surveillance and tracking in the fields of military work and anti-terrorism [4][5][6][7]. That is, it can be said that perceived data is meaningless if no node position information is provided. However, wireless signals are inevitably interfered with by noises such as multi-path fading [8,9], diffraction [10], antenna gain [11], and non-line of sight [12] when propagating in actual physical environments, and uncertain propagation loss is produced, resulting in inaccuracies in ranging. It is known that the maximum ranging error rate is up to ±50% [13]. To solve this problem, issues and methods on node positioning in WSN should be widely explored. An effective node positioning method must consider the following points. (1) How should a mathematical model be constructed to fit the nonlinear relationship between the received signal strength indication (RSSI) and the distance? (2) What positioning algorithm should be used to obtain a higher positioning accuracy? (3) What are the basic requirements to consider in terms of hardware resources and computational complexity when building a positioning algorithm?
Based on the three issues mentioned above, we propose a target node iterative positioning algorithm based on distance correction in this paper. The motivation of this paper is to reduce the positioning error of the target node to support users to retrieve accurate position information. The process of our target node iterative positioning model based on distance correction is shown in Figure 1. loss is produced, resulting in inaccuracies in ranging. It is known that the maximum ranging error rate is up to ±50% [13].
To solve this problem, issues and methods on node positioning in WSN should be widely explored. An effective node positioning method must consider the following points. (1) How should a mathematical model be constructed to fit the nonlinear relationship between the received signal strength indication (RSSI) and the distance? (2) What positioning algorithm should be used to obtain a higher positioning accuracy? (3) What are the basic requirements to consider in terms of hardware resources and computational complexity when building a positioning algorithm?
Based on the three issues mentioned above, we propose a target node iterative positioning algorithm based on distance correction in this paper. The motivation of this paper is to reduce the positioning error of the target node to support users to retrieve accurate position information. The process of our target node iterative positioning model based on distance correction is shown in Figure 1. The dbi is the distance between the given anchor node and unknown target node, which is calculated by the log-distance distribution model in Figure 1. The dci is the distance between the coordinates of the anchor node and the coordinates calculated by the triangle centroid positioning algorithm. The dni is the distance between the anchor node and the target node, which is recalculated based on the median. Legend: RSSI, received signal strength indication.
In the proposed algorithm, the median of the distance deviation coefficients is used to modify the measured distance during each iteration. The median of the distance deviation coefficients can more closely express the overall distance deviation characteristic. The log-distance distribution model is applied to calculate the distances among unknown target nodes and connected anchor nodes to fit more accurately the nonlinear relationship between distance and RSSI, reducing computational complexity as well. The iterative positioning model is constructed to ensure that the The d bi is the distance between the given anchor node and unknown target node, which is calculated by the log-distance distribution model in Figure 1. The d ci is the distance between the coordinates of the anchor node and the coordinates calculated by the triangle centroid positioning algorithm. The d ni is the distance between the anchor node and the target node, which is recalculated based on the median. Legend: RSSI, received signal strength indication.
In the proposed algorithm, the median of the distance deviation coefficients is used to modify the measured distance during each iteration. The median of the distance deviation coefficients can more closely express the overall distance deviation characteristic. The log-distance distribution model is applied to calculate the distances among unknown target nodes and connected anchor nodes to fit more accurately the nonlinear relationship between distance and RSSI, reducing computational complexity as well. The iterative positioning model is constructed to ensure that the target node is in the region surrounded by its connected anchor nodes, which is also of great help to improving the positioning accuracy. Additionally, the node iterative positioning algorithm based on distance correction can provide theoretical support for future research. Contributions are included in the following aspects.
(1) Derivation of noise impact factor based on a log-distance distribution model The expression of the noise impact factor F N is derived by reconstructing the mathematical model, which is the corresponding numerical relationship between the noise impact factor F N and the measured distance. The noise impact factor derived in this paper is used to describe the influence degree of noise on the measured values of RSSI. (2) The selection of distance deviation coefficient on node measured distance The distance deviation coefficient is used to evaluate the deviation degree of the distances calculated by the log-distance distribution model and the triangle centroid algorithm, respectively, and a distance deviation coefficients set is established. The median of the distance deviation coefficient set is selected to characterize the measured distance deviation of all nodes, which can better reflect the overall distance deviation characteristic. (3) Construction of the iterative positioning algorithm based on distance correction The distance deviation coefficient median is used as an iteration factor for the iterative positioning algorithm.
In the process of each iteration, the median of the distance deviation coefficients is used to correct the distance from the last positioning, obtaining a distance value closer to the real value. The triangle centroid localization algorithm is iteratively applied to reduce the positioning fluctuation error and improve positioning accuracy.
The rest of this paper is organized as follows. A brief review of related works is presented in Section 2, while the proposed iterative positioning algorithm is introduced in Section 3. The iterative positioning model is constructed in Section 4, the experimental results and corresponding analyses are given in Section 5, and, finally, conclusions and general discussions are summarized in Section 6.

Related Work
This section reviews two existing works that are the reference foundation theories for the positioning of the target node in WSN. The former is the measurement of the distance between the target node and the anchor node while the latter is to determine the position coordinates of the unknown target node.

The Measurement of the Distance between the Target Node and the Anchor Node
The measurement of the distance between the target node and the anchor node is an important research topic of the node positioning in WSN. Nowadays, most of the existing node positioning algorithms can be divided into two categories according to whether distance measurements are required or not. One is the range-based measurement positioning algorithm and the other is a range-free measurement positioning algorithm [14]. The distance measurement refers to calculating the distance between the unknown target node and the given anchor node connected to it through communication between them [15,16]. The classic distance measurement algorithms include the algorithm based-TOA (time of arrival), the algorithm based-TDOA (time difference of arrival) [17], the algorithm based-AOA (angle of arrival) [18] and the algorithm based-RSSI [19,20].
In the above distance measurement algorithms, the first three algorithms (TOA, TDOA, and AOA) need to calculate the distance between the unknown target node and given anchor node accurately by using an algorithm with high complexity that requires not only additional hardware equipment but also excellent node energy consumption. All these significantly increase the communication cost and energy consumption of the positioning process. Hence, the algorithm based-RSSI is adopted to measure distance in the paper for fitting the principle of low power consumption and low cost.

The Target Node Positioning Algorithm
The target node positioning algorithm can be built in several ways. A triangle centroid positioning (TCP) algorithm based on the distance or relative angle information between the target node and the anchor node has been proposed in the existing documents [21][22][23]. Since the node distribution characteristics are not fully considered, the problems in the TCP algorithm are twofold: the target node deviating active locating area and the significant positioning error. The weighted centroid positioning (WCP) algorithm has been presented in the existing literature [24][25][26][27] by introducing a weight factor, which is related to the distance estimation. Nevertheless, the positioning error will be significantly enlarged if there is a significant deviation in the distance estimating process of the WCP algorithm. A fingerprint database positioning algorithm has been constructed to improve the positioning accuracy in the existing literature [28][29][30] by collecting the positioning samples in advance. The positioning algorithm highly relies on fingerprint database data and the positioning accuracy will become weak if the environment changes. A positioning algorithm based on the neural network has been put forward in the literature where [31,32] the input of the algorithm is the value of RSSI and the output is the distance between nodes. Due to simple learning rules, the output of the neural network cannot be correct when the data is not sufficient. A positioning algorithm based on Bounding-Box has been proposed in the existing literature [33,34]. The number of given anchor nodes determines the positioning accuracy of the algorithm and the positioning accuracy is not high if the number of anchor nodes is not enough.
Aiming to address the above problems of low positioning accuracy, several experts have presented the solution of cooperative positioning. A cooperative positioning method fusing inertial-measurement unit and UWB ranging measurement is presented in [35] and a cooperative positioning method combining the inertial-measurement unit with long-range WiFi RSS and short-range UWB ranging measurements is proposed in [36] which significantly improves positioning accuracy. However, cooperative positioning methods need additional equipment. For positioning accuracy and low cost, an iterative positioning algorithm based on distance correction is proposed through correcting the estimated distance between the given anchor node and the target node and constraining the target node in the sub-triangular positioning area of the iterative positioning model in this paper. The algorithm calculates the target node coordinates iteratively and improves positioning accuracy effectively.

Iterative Positioning Algorithm for the Target Node Based on Distance Correction
An iterative positioning algorithm for the target node based on distance correction is proposed to help users overcome the influence of noise on positioning accuracy. The main issues presented in this paper for building an iterative positioning algorithm based on distance correction are threefold. First, a log-normal distribution mathematical model should be constructed to measure RSSI, based upon which the impact factor of noise on distance detecting can be derived. Second, a triangle centroid positioning algorithm should be built to determine the initial positioning coordinates of the unknown target node, and lastly, the distance deviation coefficient and its median can be determined. Therefore, the iterative positioning algorithm for the target node based on distance correction is constructed according to the median of the distance deviation coefficient.

Basic Concept
Definition 1. WSN node positioning. WSN node positioning refers to when the position of the unknown target node is calculated based on the communication between the anchor nodes whose position information is known in the network by specific techniques, algorithms, and schemes [37].

Definition 2.
Anchor node. The anchor node is the node whose coordinates or position information is known in WSN [38]. Definition 3. Target node. The target node refers to the node whose coordinates or positioning information is unknown in the WSN [39].

The Preprocessing of the Iterative Positioning Algorithm
Before the design of the iterative positioning algorithm, some pre-processing tasks must be performed. First of all, the mathematical model of the RSSI is constructed and used to calculate the initially measured distance. Then, the influence of noise on the measured distance is analyzed and thereby the noise impact factor is derived. Finally, the triangle centroid positioning algorithm is used to obtain the initial positioning coordinates of the target node.

RSSI Ranging Algorithm
The concept of the RSSI ranging algorithm is to calculate the distance between the transmitting signal node and the receiving signal node by measuring the received signal strength, since there is a varying degree of losses in the propagating process of wireless signals. Therefore, it is imperative to build an appropriate RSSI ranging model. At present, the model used commonly is the log-distance distribution model [40][41][42][43].
Pd is used to indicate the power measurement corresponding to the distance between two nodes, denoted d. Pd 0 is used to indicate the power measurement corresponding to the distance between two nodes, denoted d 0 . The relationship between Pd and d can be expressed as where n is a signal propagation factor, which is usually obtained by empirical value or actual calibration. The logarithmic processing is performed on both sides of Equation (1), and after arranging, Equation (2) can be obtained as The relationship between RSSI value and power can be expressed as Thus, a mathematical model of RSSI ranging can be obtained as where P(d) is the RSSI value when the distance between two nodes is d and P(d 0 ) is the RSSI value when the distance between two nodes is d 0 .

The Effect of Noise on RSSI Ranging
The loss of wireless signals during propagation has a significant influence on the accuracy of the RSSI ranging algorithm and must be considered in practical applications. Next we will analyze the effect of signal propagation loss on RSSI ranging. In Equation (4), the measurement value P(d) is composed of the true signal strength value and the noise signal strength value, which are denoted P T (d) and P N (d), respectively. P(d 0 ) is the RSSI value when the distance between the two nodes is d 0 .
To simplify the calculation, d 0 is usually taken as 1 and P(d 0 ) is denoted as A.
Thus, the actual mathematical model of the log-distance distribution model is From Equation (5), the distance between two nodes can be calculated as Equation (6) can be calculated as follows by further mathematical transformation, i.e., Assume that 10n . Equation (7) can be expressed as Equation (8) can be expanded further as Assuming that d T = 10 K 1 , F N = 10 K 2 −1, the calculation of distance d can be simplified to where d T = 10 K 1 is the real distance between the given anchor node and unknown target node and F N = 10 K 2 −1 is the impact factor of noise on distance measurement. F N is designated the noise impact factor.

The Triangular Centroid Positioning Algorithm
The basic principle of the triangle centroid positioning algorithm is as follows: the three circles are determined by treating the three anchor nodes as their respective circle centers by addressing the distances between the given anchor nodes and unknown target node as their respective radiuses. The intersection of the three circles can obtain six intersection points and a triangle is constructed by treating the three closer intersection points as vertexes, with the centroid of a triangle taken as the coordinates of the node to be positioned. The schematic diagram of triangular centroid positioning is shown in Figure 2.
Equation (6) can be calculated as follows by further mathematical transformation, i.e., − 10 10 10 10 Assume that Equation (7) can be expressed as ( ) − 1 10 1 10 Equation (8) can be expanded further as − 1 1 2 10 10 10 1 Assuming that is the real distance between the given anchor node and unknown target node and 2 =10 -1 K N F is the impact factor of noise on distance measurement. FN is designated the noise impact factor.

The Triangular Centroid Positioning Algorithm
The basic principle of the triangle centroid positioning algorithm is as follows: the three circles are determined by treating the three anchor nodes as their respective circle centers by addressing the distances between the given anchor nodes and unknown target node as their respective radiuses. The intersection of the three circles can obtain six intersection points and a triangle is constructed by treating the three closer intersection points as vertexes, with the centroid of a triangle taken as the coordinates of the node to be positioned. The schematic diagram of triangular centroid positioning is shown in Figure 2. 11 11 ( , ) x y 33 33 ( , ) x y 22 22 ( , ) x y Figure 2. Schematic diagram of triangular centroid positioning.
The intersection point coordinates of the circles O1 and O2 can be obtained by Equation (11). In Figure 2, O 1 , O 2 and O 3 are defined as the positions of three anchor nodes with coordinates of O 1 (x 11 , y 11 ), O 2 (x 22 , y 22 ), and O 3 (x 33 , y 33 ) and whose radiuses are d 1 , d 2 , and d 3 , respectively. Points S 1 (x 1 , y 1 ), S 2 (x 2 , y 2 ), and S 3 (x 3 , y 3 ) are the three closer intersections points, that is, the three vertices of the triangle centroid positioning algorithm.
The intersection point coordinates of the circles O 1 and O 2 can be obtained by Equation (11).
In two sets of coordinates solved by Equation (11), the intersection S 3 (x 3 , y 3 ) is closer to the center of the positioning triangle. The solution of the remaining points S 1 (x 1 , y 1 ) and S 2 (x 2 , y 2 ) is similar to that of point S 3 (x 3 , y 3 ).
Thus, the initial coordinates O(x g , y g ) of the target node can be calculated by Equation (12).

The Iterative Positioning Algorithm
In the actual physical environment, signals are easily disturbed by noise in the transmission process. Therefore, there is a large deviation between the distance obtained by the log-distance distribution model and the real distance value. To further reduce the positioning error, a node iterative positioning algorithm based on distance correction is introduced.
The basic principle of the iterative positioning algorithm based on distance correction is as follows: the distance deviation coefficient is introduced to evaluate the degree of deviation of the distance measured by the log-distance distribution model and the triangle centroid positioning algorithm, respectively. The distance between the given anchor node and the unknown target node is recalculated based on the distance deviation coefficient. By constantly updating the distance between the given anchor node and the unknown target node, the target node coordinates are iteratively calculated.

The Calculation of the Distance Deviation Coefficient
The distance between the given anchor node and unknown target node, which is calculated by the log-distance distribution model, is denoted d bi . The distance between the coordinates of the anchor node and the coordinates calculated by the triangle centroid positioning algorithm is denoted d ci .
To indicate the deviation of the two distances, the distance deviation coefficient C dev is defined by Equation (13).
As distance deviation coefficients can be solved by Equation (13), it is essential to determine a characteristic quantity to represent the degree of deviation of the overall node measurement distance. The two statistical parameters, the average value and the median of distance deviation coefficients, can be closely used to express the overall distance deviation characteristics.
The average value of the distance deviation coefficients can express the average level of the overall measurement distance deviation. However, its fatal disadvantage is that if the extremum at both ends is too low or too high, the final calculation result will significantly deviate from the real situation.
Therefore, the median distance deviation coefficients are usually used to express the overall distance deviation characteristics. The median is not affected by the extreme values of both ends and can better reflect the overall distance deviation characteristics, making the final calculation result closer to the real situation.
The distance deviation coefficients are calculated by Equation (13). Then, the values of C dev are sorted to obtain the median named C m-dev . The distance between the given anchor node and unknown target node can be recalculated based on the median C m-dev , as shown in Equation (14).
The new distance d ni is obtained by Equation (14) and the triangular centroid positioning algorithm is iteratively conducted to obtain the positioning result (x G , y G ).

The Iteration Termination Criteria for the Algorithm
If the termination condition of the iterative positioning algorithm is set correctly, the higher positioning accuracy can be obtained within a small number of iterations and the algorithm is prevented from falling into an infinite loop. That is, the iteration termination condition is defined as where PÔ n is the RSSI value between the centroid of the nth iteration and the unknown target node, and ε is the set threshold.
Under different environmental conditions, as Equation (15) is used as the iterative termination condition, its computational complexity is very high, even higher than the complexity of the iterative positioning algorithm itself. In this way, the hardware complexity of the system increases significantly and the algorithm becomes almost infeasible.
The purpose of iterative positioning is to make the positioning error converge to the expected value, as the convergence property and convergence velocity are essential issues of the iteration. In the process of iteration, with the increased number of iterations, the convergence processes in which the error converges to the expected value usually have the following cases: fast convergence, slow convergence, and periodic oscillation. In order to further study the convergence property of the above three cases, a series of simulations are conducted to analyze the relationship between the positioning error and the number of iterations in the paper. Through simulation analysis, it can be noted that the iterative error varies with the above different regular patterns when the number of iterations is between 0-10 since the iteration error no longer varies when the number of iterations is between 10-20. A flow chart of the iterative positioning algorithm is shown in Figure 3.

The Construction of the Iterative Positioning Model
In the procedure of iterative positioning, the unknown target node in the positioning triangle area has a significant influence on its positioning accuracy. The positioning error of the target node located in the positioning triangle area is much smaller than that of the target node outside the positioning triangle area. To improve the positioning accuracy, an iterative positioning model is established in the paper, as shown in Figure 4.
In Figure 4, the quadrilateral A1A2A3A4 is a square, the point O is its center, and the points B1, B2, B3, and B4 are the midpoints of the respective sides. According to the connection shown in Figure 4, the square A1A2A3A4 is subdivided into eight triangular regions: region 1 to region 8. The anchor nodes (9 in total) are placed at points A1, A2, A3, A4, B1, B2, B3, B4, and O.
There is a target node X in the quadrilateral A1B1OB4 in Figure 4 and the points closest to the point X are points A1, B1, O, and B4 in turn. The node X is included in both ΔA1B1B4 and ΔA1B1O. In ΔA1B1B4, the coordinates (xG1, yG1) are calculated by the iterative positioning algorithm. In order to reduce effectively the positioning error caused by noise, the other coordinate (xG2, yG2) is calculated by the iterative positioning algorithm in ΔA1B1O. The weighted average of these two coordinates

The Construction of the Iterative Positioning Model
In the procedure of iterative positioning, the unknown target node in the positioning triangle area has a significant influence on its positioning accuracy. The positioning error of the target node located in the positioning triangle area is much smaller than that of the target node outside the positioning triangle area. To improve the positioning accuracy, an iterative positioning model is established in the paper, as shown in Figure 4.
In Figure 4, the quadrilateral A 1 A 2 A 3 A 4 is a square, the point O is its center, and the points B 1 , B 2 , B 3 , and B 4 are the midpoints of the respective sides. According to the connection shown in Figure 4, the square A 1 A 2 A 3 A 4 is subdivided into eight triangular regions: region 1 to region 8. The anchor nodes (9 in total) are placed at points A 1 , A 2 , A 3 , A 4 , B 1 , B 2 , B 3 , B 4

, and O.
There is a target node X in the quadrilateral A 1 B 1 OB 4 in Figure 4 and the points closest to the point X are points A 1 , B 1 , O, and B 4 in turn. The node X is included in both ∆A 1 B 1 B 4 and ∆A 1 B 1 O. In ∆A 1 B 1 B 4 , the coordinates (x G1 , y G1 ) are calculated by the iterative positioning algorithm. In order to reduce effectively the positioning error caused by noise, the other coordinate (x G2 , y G2 ) is calculated by the iterative positioning algorithm in ∆A 1 B 1 O. The weighted average of these two coordinates can be taken as the final coordinates (x G3 , y G3 ). The closer the distance between the given anchor node and the unknown target node is, the more reliable the calculation result is. Hence, the weight of the former coordinate should be higher than the weight of the latter coordinate. can be taken as the final coordinates (xG3, yG3). The closer the distance between the given anchor node and the unknown target node is, the more reliable the calculation result is. Hence, the weight of the former coordinate should be higher than the weight of the latter coordinate.
In actual positioning progress, the RSSI values of the nine anchor nodes are recorded and arranged in descending order. The first four larger RSSI values are denotedRSSI1, RSSI2, RSSI3, and RSSI4. The primary positioning coordinate (xG1,yG1) is calculated by RSSI1, RSSI2, RSSI3 and their corresponding coordinates. The second positioning coordinate (xG2,yG2) is calculated by RSSI1, RSSI2, RSSI4, and their corresponding coordinates. The weighted average of two coordinates according to the weights mentioned above is the final positioning result (xG3,yG3).
The positioning process of the iterative positioning algorithm is shown in Figure 5.

The Method
To accurately and quantitatively verify the performance of the iterative positioning algorithm proposed, the experimental positioning area is set as a square of 40 m × 40 m with nine anchor nodes located at the vertices, center, and in the middle of the edges of the square. Now, 50 target nodes are generated in the square area by random and their positioning results calculated in turn. The final positioning results can be expressed as follows in Equation (16).
In actual positioning progress, the RSSI values of the nine anchor nodes are recorded and arranged in descending order. The first four larger RSSI values are denoted RSSI 1 , RSSI 2 , RSSI 3 , and RSSI 4 . The primary positioning coordinate (x G1 ,y G1 ) is calculated by RSSI 1 , RSSI 2 , RSSI 3 and their corresponding coordinates. The second positioning coordinate (x G2 ,y G2 ) is calculated by RSSI 1 , RSSI 2 , RSSI 4 , and their corresponding coordinates. The weighted average of two coordinates according to the weights mentioned above is the final positioning result (x G3 ,y G3 ).
The positioning process of the iterative positioning algorithm is shown in Figure 5. can be taken as the final coordinates (xG3, yG3). The closer the distance between the given anchor node and the unknown target node is, the more reliable the calculation result is. Hence, the weight of the former coordinate should be higher than the weight of the latter coordinate.
In actual positioning progress, the RSSI values of the nine anchor nodes are recorded and arranged in descending order. The first four larger RSSI values are denotedRSSI1, RSSI2, RSSI3, and RSSI4. The primary positioning coordinate (xG1,yG1) is calculated by RSSI1, RSSI2, RSSI3 and their corresponding coordinates. The second positioning coordinate (xG2,yG2) is calculated by RSSI1, RSSI2, RSSI4, and their corresponding coordinates. The weighted average of two coordinates according to the weights mentioned above is the final positioning result (xG3,yG3).
The positioning process of the iterative positioning algorithm is shown in Figure 5.

The Method
To accurately and quantitatively verify the performance of the iterative positioning algorithm proposed, the experimental positioning area is set as a square of 40 m × 40 m with nine anchor nodes located at the vertices, center, and in the middle of the edges of the square. Now, 50 target nodes are generated in the square area by random and their positioning results calculated in turn.

The Method
To accurately and quantitatively verify the performance of the iterative positioning algorithm proposed, the experimental positioning area is set as a square of 40 m × 40 m with nine anchor nodes located at the vertices, center, and in the middle of the edges of the square. Now, 50 target nodes are generated in the square area by random and their positioning results calculated in turn.
In this experiment, for different noise impact factors F N , positioning error is discussed by three methods, namely, the centroid positioning algorithm, the weighted centroid positioning algorithm, and the iterative positioning algorithm based on distance correction. The value of F N is taken into account in two situations: that involving a constant value and that involving a random value.

Experimental Analysis
According to the above experimental method, two experiments were conducted.

The First Experiment: F N is Constant
When F N is a constant value, considering the effects of the actual noise on the signal, three typical F N values are used for the experiments, these being 0.1, 0.2, and 0.3, respectively.
The experiments for the three parameters are shown as follows.
The positioning errors are shown in Figure 6 in the case of the noise impact factor of 0.1. In this experiment, for different noise impact factors FN, positioning error is discussed by three methods, namely, the centroid positioning algorithm, the weighted centroid positioning algorithm, and the iterative positioning algorithm based on distance correction. The value of FN is taken into account in two situations: that involving a constant value and that involving a random value.

Experimental Analysis
According to the above experimental method, two experiments were conducted.

The First Experiment: FN is Constant
When FN is a constant value, considering the effects of the actual noise on the signal, three typical FN values are used for the experiments, these being 0.1, 0.2, and 0.3, respectively.
The experiments for the three parameters are shown as follows.
The positioning errors are shown in Figure 6 in the case of the noise impact factor of 0.1. The x-coordinate represents the target node sequence, the unit is the number of nodes, and the y-coordinate represents the positioning error, with the unit being m (meters).
When FN is 0.1, the average positioning errors of the three algorithms are 0.77, 0.70, and 0.17, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 77.92% and 75.71% compared with the centroid algorithm and the weighted centroid algorithm.
The positioning errors are shown in Figure 7 in the case of the noise impact factor of 0.2. The x-coordinate represents the target node sequence, the unit is the number of nodes, and the y-coordinate represents the positioning error, with the unit being m (meters).
When F N is 0.1, the average positioning errors of the three algorithms are 0.77, 0.70, and 0.17, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 77.92% and 75.71% compared with the centroid algorithm and the weighted centroid algorithm.
The positioning errors are shown in Figure 7 in the case of the noise impact factor of 0.2.  When FN is 0.2, the average positioning errors of the three algorithms are 1.68, 1.30, and 0.42, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 75% and 67.69% compared with the centroid algorithm and the weighted centroid algorithm.
The positioning errors are shown in Figure 8 in the case of a noise impact factor of 0.3. When FN is 0.3, the average positioning errors of the three algorithms are 2.63, 1.85, and 0.79, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 69.96% and 57.29% compared with the centroid algorithm and the weighted centroid algorithm.

The Second Experiment: FN Is a Random Value
When FN is an arbitrary value, considering the effect of the actual noise on the signal, the random value is 0.3 times that of the random function.
The positioning errors are shown in Figure 9 in the case of the noise impact factor of a random value. When F N is 0.2, the average positioning errors of the three algorithms are 1.68, 1.30, and 0.42, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 75% and 67.69% compared with the centroid algorithm and the weighted centroid algorithm.
The positioning errors are shown in Figure 8 in the case of a noise impact factor of 0.3. When FN is 0.2, the average positioning errors of the three algorithms are 1.68, 1.30, and 0.42, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 75% and 67.69% compared with the centroid algorithm and the weighted centroid algorithm.
The positioning errors are shown in Figure 8 in the case of a noise impact factor of 0.3. When FN is 0.3, the average positioning errors of the three algorithms are 2.63, 1.85, and 0.79, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 69.96% and 57.29% compared with the centroid algorithm and the weighted centroid algorithm.

The Second Experiment: FN Is a Random Value
When FN is an arbitrary value, considering the effect of the actual noise on the signal, the random value is 0.3 times that of the random function.
The positioning errors are shown in Figure 9 in the case of the noise impact factor of a random value. When F N is 0.3, the average positioning errors of the three algorithms are 2.63, 1.85, and 0.79, respectively, and the positioning accuracy of the iterative positioning algorithm is improved by 69.96% and 57.29% compared with the centroid algorithm and the weighted centroid algorithm.

The Second Experiment: F N Is a Random Value
When F N is an arbitrary value, considering the effect of the actual noise on the signal, the random value is 0.3 times that of the random function.
The positioning errors are shown in Figure 9 in the case of the noise impact factor of a random value. In the case of different noise impact factors, the positioning errors of the three positioning algorithms are shown in Table 1. As can be seen from Table 1, when FN is constant, the positioning accuracy decreases with the increase of FN, i.e., the noise has more and more influence on the positioning accuracy; when FN is a random value, the positioning accuracy of the iterative positioning algorithm is improved by 37.71% compared with the centroid algorithm and the positioning accuracy of the iterative positioning algorithm is improved by 28.76% compared with the weighted centroid algorithm.
The positioning errors of the three positioning algorithms for different values of noise impact factors are shown in Figure 10.  In the case of different noise impact factors, the positioning errors of the three positioning algorithms are shown in Table 1. As can be seen from Table 1, when F N is constant, the positioning accuracy decreases with the increase of F N , i.e., the noise has more and more influence on the positioning accuracy; when F N is a random value, the positioning accuracy of the iterative positioning algorithm is improved by 37.71% compared with the centroid algorithm and the positioning accuracy of the iterative positioning algorithm is improved by 28.76% compared with the weighted centroid algorithm.
The positioning errors of the three positioning algorithms for different values of noise impact factors are shown in Figure 10. In the case of different noise impact factors, the positioning errors of the three positioning algorithms are shown in Table 1. As can be seen from Table 1, when FN is constant, the positioning accuracy decreases with the increase of FN, i.e., the noise has more and more influence on the positioning accuracy; when FN is a random value, the positioning accuracy of the iterative positioning algorithm is improved by 37.71% compared with the centroid algorithm and the positioning accuracy of the iterative positioning algorithm is improved by 28.76% compared with the weighted centroid algorithm.
The positioning errors of the three positioning algorithms for different values of noise impact factors are shown in Figure 10.  As can be seen from Figure 10, the positioning error of the iterative positioning algorithm is smaller than that of the centroid positioning algorithm and the weighted centroid positioning algorithm in the case of different noise impact factors F N .

Conclusions
With the development of wireless communication technology, the position information of data is playing an increasingly important role. There are errors in node positioning due to various interferences in the data transmission process. As an alternative to this problem, a node iterative positioning algorithm based on distance correction is proposed in this paper to help users obtain accurate position information. Contributions include the following aspects: (1) The noise impact factor F N has been derived based on the original log-distance distribution model, which is used to describe the corresponding relationship between the noise impact factor F N and the measured distance. Proposing a noise impact factor provides a novel method for analyzing the influence of noise on the distance measurement between nodes in WSN. (2) The median of the distance deviation coefficient has been constructed to characterize the deviation degree of the whole measured distances and used to correct the range from the last positioning. The triangle centroid localization algorithm has been iteratively conducted based on the adjusted new distance value to improve the node positioning accuracy.
Experimental results show that the node iterative positioning algorithm based on distance correction can reduce the positioning error of unknown target nodes in wireless sensor networks effectively and help users obtain more accurate node coordinates. In the future, based on the node iterative positioning algorithm proposed in this paper, we will move forward with related research including real-time tracking and path planning of moving nodes in WSNs.