Research on WSN Node Localization Algorithm Based on RSSI Iterative Centroid Estimation

: For the traditional RSSI-based sensor nodes the positioning accuracy is low and sensitive to noise, which can not be applied to the rapid positioning of large-scale WSN wireless sensor nodes. Based on the traditional localization algorithm, this paper proposes a WSN node localization algorithm based on RSSI iterative centroid estimation. The algorithm determines the convergence condition by the positional relationship between the node to be located and the existing beacon node, and uses the RSSI value instead of the traditional distance centroid estimation. The experiment is carried out in a random node distribution simulation environment of 100 × 100 m. The effects of communication distance variation and beacon node ratio on the algorithm are verified, and the influence of distance calculation error on the algorithm is verified. Because the signal strength difference of the main beacon node is used in the localization algorithm, and the beacon node corresponding to the maximum signal strength value is selected as the main beacon node, the error caused by the conversion of the signal strength value into the distance is successfully suppressed. The influence of obstacle interference on the positioning of the node reduces the positioning error and achieves better positioning accuracy. The simulation results show that the proposed algorithm has better positioning accuracy and robustness to noise, and is suitable for large-scale WSN wireless sensor node location.


INTRODUCTION
Wireless sensor network (WSN) is a complex network composed of many types of sensors.The data transmitted in this network is mainly various sensor data [1].The sensors are arranged in the network space and are called nodes.The nodes are usually arranged in the user's area of interest, collecting various sensor data for the area, and collecting the sensor data collected by each area through the wireless network.In WSN, sensor position information is the most basic element of monitoring activities.Sensing data without accurate position often has no physical meaning [2].Wireless sensor networks are applicationoriented, network systems that are close to the objective world.In most sensor network applications, accurately determining the exact location of each node's event occurrence and the precise location of the message acquisition is critical and one of the essential functions of the WSN [3].Therefore, in combination with the characteristics of WSN, how to design energy-efficient, simple and accurate, and distributed scalability positioning algorithms has become a hot topic in academic research at home and abroad in recent years.
Research institutes and university laboratories at home and abroad have increased their research on WSN positioning technology and achieved rapid development.There are many classification standards for WSN positioning technology.As mentioned above, the classification criteria of Range-free positioning technology and Range-based positioning technology are generally accepted classification standards.Based on the ranging positioning methods of received signal strength indication (RSSI), time of arrival (TOA), Time Difference of Arrival (TDOA), and Angle of Arrival (AOA), these positioning methods need to obtain a large number of measurement information to obtain the location information of unknown nodes, such as distance and angle between nodes.Li, Dina expounded that the node location methods in WSN are mainly divided into two categories, which are based on ranging technology and on non-ranging technology [4].The ranging technology is generally based on hardware devices.The accuracy of this type of algorithm is high, but the cost is relatively high due to the introduction of hardware devices by REN [5], including the centroid localization algorithm and the DV-Hop algorithm [6].The positioning accuracy of such algorithms is high, but there are many factors limited by hardware and other conditions, and it cannot be widely promoted in application.Based on non-ranging technology, it is not necessary to measure the actual distance between sensor nodes.Instead, some data information on communication is used to estimate the distance, including data such as TOA by WU [7], RSSI by SHI [8] and lighthouse [9].Distance estimation algorithm for information.The accuracy of such algorithms is low but not affected by distance calculations, and distances can be estimated from other communication information.In the calculation of a large number of communication information, the received signal strength indication value (RSSI) generated by the communication among nodes has the characteristics of computing nodes and the minimum hardware equipment, which is suitable for the positioning of large-scale WSN wireless sensor nodes.However, the current accuracy of the positioning results based on the RSSI calculation is low, and the error increases with the increase of the radius in the positioning of the WSN in a wide range [10].
The sensor node based on RSSI value has large error and low positioning accuracy in practical positioning applications.In order to solve the above problems, this paper proposes a node localization algorithm based on iterative RSSI centroid estimation.The algorithm determines the convergence condition by the positional relationship between the node to be located and the existing beacon node, and uses the RSSI value instead of the traditional distance centroid estimation.Through continuous iteration to complete the positioning and improve the accuracy of the centroid estimation, this paper replaces the position of the node to be located with the centroid.The algorithm is analyzed and discussed, and a more reasonable weighting method is proposed, which makes the positioning more accurate.The simulation results show that the proposed algorithm has better positioning accuracy and robustness to noise, and is suitable for large-scale WSN wireless sensor node location.

ALGORITHM MODEL 2.1 Wireless Signal Propagation Model
Commonly used propagation path loss models for wireless signals are free-space propagation models, logdistance path loss models, Hata models, lognormal distribution models [11].The most commonly used in these theoretical models is the lognormal distribution model.It is supposed that node A transmits a signal to node B, the power loss is PAB, and the distance traveled is d AB •x σ is the Gaussian distribution random variable with an average value of 0. K represents the path attenuation factor.The path loss is calculated as follows: AB 0 10 AB 0 ( ) 10 log ( / ) Finishing can be obtained as follows.
The distance between node A and node B is d AB .At the same time, the signal strength when B receives the signal A is as follows.

RSSI = transmit power + antenna gain − path loss (P AB )
In practical applications, the average value of the received power can be obtained by multiple measurements to effectively reduce the system error of the RSSI.

RSSI Channel Model
Since the signal strength between the beacon node and the unknown node is used in the process of positioning, the accuracy of the RSSI measurement will directly affect the positioning accuracy of the node.Therefore, the electromagnetic distance transmission model of all nodes in the network adopts the logarithmic distance path of lineof-sight transmission.0 0 ( ) ( ) 10 ( ) where P r (d) represents the signal strength dBm received by the node at the transmission point dm, P T is the transmit power of the node.PL(d 0 ) indicates the strength at which the node receives the signal transmitted at the reference point d 0 .d 0 represents the distance between the reference point and the receiving node.η indicates that the path attenuation factor.X σ represents a Gaussian random variable with a mean of 0 and a variance of σ 2 .

Centroid Localization Algorithm
In the WSN, the network node can be divided into a beacon node and an unknown location node according to whether its own location is known in the network.Although the exact location of the beacon node is known, the beacon node has less distribution on the network plane and can only assist in the positioning of the node to be located.As shown in Fig. 1a, in a common WSN, both the beacon node and the node to be located are distributed on the network plane.The basic principle of network node location is based on a limited number of beacon nodes known in the network.The communication process between neighbor nodes is implemented.In this paper, the approximate location of the neighbor nodes of the beacon node is estimated by some specific algorithm mechanisms, and the positioning result of the infinite sensor network node is obtained.

Beacon node
Node to locate Large WSNs are generally composed of thousands of micro sensor nodes.The manual work to locate each sensor position is too large to be realized.However, if GPS (Global Positioning System) is used for precise positioning, the cost is too high.However, most practical applications do not require high accuracy for positioning, and traditional positioning methods are limited in practical applications [11].Therefore, in the process of network node location, several beacon nodes are usually accurately located manually or by GPS.Then the beacon node is used as a reference node, and the communication mode and content between the reference node and other unknown nodes are collected.The positioning technology can roughly estimate the position information of the node to be tested.From the literature review of network nodes, there are more or less problems in the current ranging or positioning technology without ranging, resulting in excessive positioning error [12].In order to solve this problem, this paper adopts the "Received Signal Strength Indication Value (RSSI)" and the iterative centroid algorithm in the process of communication with the surrounding nodes by the beacon node.The RSSI data is used to iterate the centroid and reduce the position range of the node to be located.The advantage between the two obtains the location of the node to be located, further improving the accuracy of the positioning of the wireless network node.

NODE LOCALIZATION ALGORITHM FOR RSSI ITERATIVE CENTROID ESTIMATION 3.1 Calculation of Nodes RSSI Value
In general, the Shadowing model [14] is used to simulate the wireless signal attenuation model in a conventional WSN.The Shadowing model calculates the average energy of the received signal strength at a distance by simulating the path loss model pr(d).In order to give the calculation process of the Shadowing model, it is assumed that A and B are beacon nodes in the wireless network respectively, and the distance between them is d 0 , according to the Shadowing model, it can be calculated: wherein, p r (d 0 ) indicates that the beacon node A receives the signal strength average energy provided by the beacon node B. p r (d i ) indicates that the unknown node C receives the signal strength average energy provided by the beacon node B, d i indicates the distance between node C and the beacon node A, and β indicates the degree of path loss.
In wireless network positioning, the unit of measurement of path loss is generally set to dB, and the above formula can be converted into dB unit form by the decibel conversion formula.0 0 ( ) 10 log ( ) The Shadowing model simulates the received energy change by adding noise at a certain distance, and simulates the energy change by adding a logarithmic Gaussian distribution random variable.In dB, a Shadowing model with random perturbation noise can be expressed as follows.
where Gaussian (X dB ) is the added Gaussian distribution random variable.In the calculation of the RSSI value, the path model calculated by the Shadowing model converts the loss during signal propagation into the RSSI value.

RSSI Iterative Centroid Estimation Node Localization
The traditional centroid localization algorithm directly calculates the centroid of the plane as the estimated position of the sensor, which is usually affected by much noise.As the number of beacon nodes increases, the position estimation error becomes larger and the precision becomes lower and lower.The traditional centroid localization algorithm is less robust, and the accumulated error will cause the positioning to deviate gradually.In this paper, a node localization algorithm based on RSSI iterative centroid estimation is proposed.Assume that in the WSN, the node to be located is O and its coordinate is (x, y).There are N beacon nodes in the network, which are respectively S1, S 2 , …, S N , and the coordinates of the N-th beacon node S n are (x n , y n ).First, the distance between the node O to be located and the beacon node S n can be calculated: The coordinate (x O1 , y O1 ) of the centroid O 1 of the twodimensional plane surrounded by N beacon nodes S 1 , S 2 , …, S N .The coordinate (x O1 , y O1 ) can be calculated as follows.
Then the distance between the centroid O 1 and the node O to be located can be calculated as follows.
According to the calculation of the above formula, when the coordinates of the N beacon nodes and the distance between the beacon node and the node O to locate are known, N connected letters can be calculated through Eq. ( 8) and Eq.(11).The labeled node constitutes the coordinate (x O1 , y O1 ) of the centroid O 1 of the planar space, and the distance d O1 between the centroid O 1 of the planar space and the node O to be located.In fact, by sizing and erasing, we can further simplify Eq. ( 12) and get: The algebra in the above formula is expressed as: where d ij represents the distance between beacon node S i and beacon node S j , it is assumed that the N beacon nodes in the plane space have the following relationship due to the distance between the nodes to locate.
Substituting it into Eq.( 14) yields an inequality group: By solving the inequality group, the relationship between the centroid to the node to be located and the distance from the centroid to the beacon node in the plane space composed of N beacon nodes can be obtained: According to the above formula, if the distance between the beacon node and the node to be located is arranged in ascending order, at least one node exists in the N beacon nodes, and the distance d N of the node N to the node O to locate must be greater than the distance d O1 of the centroid.In fact, if the current centroid O 1 node is used instead of the beacon node S N farthest from the node O to be located, the polygon plane composed of the new N nodes S 1 , S 2 , …, S N−1 , O 1 must be smaller than the original polygon plane, which can further narrow the node O to be located.For this process, a smaller polygon plane can be obtained through multiple iterations, and the search range of the node O to locate is gradually reduced.
After multiple iterations, the RSSI value can be used instead of the traditional distance calculation method to continuously narrow the range of the node to be located in the plane.Compared with the traditional centroid calculation method, the iterative RSSI centroid calculation method effectively avoids a large number of distance calculations and improves the accuracy, efficiency, and robustness of node positioning.

Implementation Steps of RSSI Localization Algorithm
Fig. 2 below shows the flow of the RSSI iterative centroid estimation WSN node localization algorithm.Suppose there are N beacon nodes in the plane space, and the coordinates of the nodes to be located are (x, y).The algorithm flow is as follows: (1) The beacon node periodically broadcasts information such as its own location and ID to the area around the plane space; (2) After receiving the broadcast information of the beacon node, the to-be-located node records the RSSI value of the same beacon node and calculates the RSSI average value; (3) The labeled node constitutes the coordinate (xn, y n ).After the node to be located receives the information of the n beacon nodes within the threshold range, three information sets are established, the beacon node set is (5) Set the appropriate iteration termination condition, and calculate the position (x, y) of the node to be located when the iteration ends.

SIMULATION EXPERIMENT AND RESULT ANALYSIS 4.1 Experimental Initialization and Process
In order to verify the effectiveness of the proposed algorithm, 100 nodes are randomly distributed in a twodimensional plane of 100 × 100 m, and the location of the randomly distributed nodes located by the algorithm.Fig. 3 shows the location of a randomly distributed node.By changing the communication range of nodes in the network and the number of connections between unknown nodes and beacon nodes, the effects of different conditions on the proposed positioning algorithm are verified.In addition, the anti-noise ability of the WSN node localization algorithm based on the iterative RSSI centroid proposed in this paper is also needed.According to Eq. ( 16), since there is a linear relationship between the RSSI value and the distance, the accuracy of the distance is directly set in the simulation experiment as the termination condition of the iteration.This setting can eliminate the influence of the parameter setting on the iterative algorithm itself.In the simulation experiment of this paper, the iteration termination conditions of the settings are as follows.The unknown node inside the square enclosed by the initial beacon node, the termination condition is: The unknown node outside the square enclosed by the initial beacon node, the termination condition is as follows.
where O n d represents the distance between the centroid and the unknown node O n .It can be seen from the results of Fig. 4 that the number of beacon nodes is the same, as the communication distance among nodes, the number of beacon nodes in the communication distance to locate will also increase.Under this parameter change, the algorithm error proposed in this paper decreases, and the accuracy increases.When the communication distance between nodes remains unchanged, as the number of beacon nodes increases, the probability that the node to be located exists in the plane formed by the initial communication target node will also increase.In the case where the communication distance between the two nodes R = 20, R = 25 is relatively small, although the probability that the node to locate exists in the plane of the initial communication target node.The robustness of the algorithm is reduced, and the accuracy of the positioning calculation increase in the proportion of beacon nodes has resulted in a series of irregular fluctuations.For example, when the beacon node ratio is 15%, the actual positioning error is higher than the beacon node ratio is 10%.However, from the overall macroscopic point of view, the relative positioning error of the proposed algorithm is still at a low level, and it tends to decrease as the proportion of beacons increases, but this trend is more obvious when the communication distance is large.

The Relative Positioning Error
In addition, we also use the error coefficient of distance measurement to replace the RSSI measurement error coefficient in the simulation experiment, which is used to compare the relative positioning error by the distance measurement error coefficient.In the simulation experiment of coefficient influence error, we define the error coefficient of distance measurement μ and satisfy the following relationship.
(1 rand(0, 1)) where rand(0, 1) is the random number generated on the interval of [0, 1], d n is the actual value of the node to locate, and n d ' is the actual measured values of the beacon node n, respectively.In the ideal case, , that is, the coefficient μ of the error is 0, and there is no error in the measured value at this time.As the error factor μ increases, the error of the distance measurement will also become larger and larger.Fig. 5 below shows the effect of the relative positioning error received by the error coefficient of distance measurement.

Distance measurement error coefficient
Figure 5 The relative positioning error received by the distance measurement error coefficient Fig. 5 selected a comparison of the communication distances.The main observation object of the simulation experiment is the influence of the error coefficient of the distance measurement on the performance of the algorithm.In order to analyze these data more comprehensively, we set different beacon ratios in different communication distances, which are smaller 5% and larger 45%.It can be found from the experimental results that when the distance measurement error coefficient (RSSI measurement error coefficient) changes, there is no influence on the relative positioning error of the algorithm.

Influence of Beacon Node Density on Positioning
Fig. 6 shows the variation of the positioning error as the beacon node density increases with a 10% ranging error.It can be seen from the figure that the positioning errors of the two algorithms have different degrees of decline.The traditional centroid localization algorithm is more significant.When the beacon node density increases from 10% to 30%, the positioning error only decreases from 13.5% to 8.1%.Therefore, the beacon node density less affects the localization algorithm, and higher node positioning accuracy can be obtained at lower beacon node density.

Impact on Location Coverage
Fig. 7 shows the trend of the positioning coverage rate with the number of node positioning (the first 20 times) when the beacon node density is 15% and the ranging error is 20%.Fig. 8 shows the trend of the average positioning coverage of the first 20 locations of the node as a function of beacon node density with a 20% ranging error.
It can be seen from Fig. 7 that the traditional centroid localization algorithm has substantially no change in the positioning coverage rate as the number of node positioning increases.However, the RSSI positioning algorithm in this paper is obviously improved.By the sixth positioning, the node positioning coverage rate reaches 99%, and by the 15 th positioning, the node positioning coverage rate reaches 100%.
As can be seen from Fig. 8, the node location coverage increases as the beacon node density increases.However, the impact on the positioning algorithm of this paper is relatively small, that is, in the case where the density of the beacon node is not high, the higher node positioning coverage can be achieved.

CONCLUSIONS
In the node location of wireless sensor networks, the traditional method is limited by the high cost of hardware and the accuracy of the software, and cannot be applied to the node location of a wide range of wireless sensor networks.In this paper, a WSN node localization algorithm based on RSSI iterative centroid estimation is proposed.The performance of the algorithm mainly appears in the following two aspects: (1) During the initialization process, the beacon nodes need to be sorted according to the RSSI value.The calculation error of the RSSI will affect the sorting result.The wrong calculation result will cause the node that is not the beacon to be considered as the beacon node by the algorithm.The centroid obtained by calculation in this way replaces the beacon node that would not be replaced.This error affects the convergence speed of the iterative process and increases the number of iterations.However, since the proposed algorithm is an iterative process, it does not affect the accuracy of the distance calculation.
(2) During the iterative process, the RSSI value between the centroids and the nodes to be located needs to be calculated according to the RSSI measurement value.The wrong RSSI measurement value may cause the corresponding RSSI value to be incorrectly calculated.Although this error value will cause the sorting error of the centroid in the beacon node, it still only affects the convergence speed of the iteration, and does not affect the accuracy of the distance calculation.
According to the above analysis, when the distance measurement error coefficient (RSSI measurement error coefficient) changes, there is no influence on the relative positioning error of the algorithm.The iterative centroid estimation algorithm of the RSSI coefficient selected in this paper has good anti-interference ability.In the future research, the node positioning of the sensor network should be carried out toward the idea of iteration, and the accuracy of the result is gradually improved by continuously iterating the reduced error.
where P t is the signal transmission power of node A, and P x is the signal power received by node B. It is a Gaussian distribution random variable with an average x σ value of 0, and its standard deviation ranges from 4 to 10.The coefficient k is different depending on the transmission position, and the range is between 2 and 5.The typical value of d 0 is 1 m.Consider the RSSI ideal model, k = 2, ignore the influence of x σ , substitute the above formula, and sort (2) to get the following relationship.

Figure 1
Distribution schematic of WSN nodes and communication distance overlap The range of centroids in the plane space is continuously reduced according to the iterative RSSI value localization algorithm in Section 3.3;

Figure 2
Figure 2 Flow chart of WSN node localization based on RSSI iterative centroid estimation

Figure 3 A
Figure 3 A situation map of randomly distributed node locations

Figure 4
Figure 4 The role parameters of different conditions in the algorithm and the corresponding error localization range

Figure 6
Figure 6 Beacon node density and positioning error

Figure 7 Figure 8
Figure 7 Node positioning times and positioning coverage RSSI positioning method in this paper