A Location Estimation Algorithm Based on RSSI Vector Similarity Degree

We present a detailed study on the RSS-based location techniques in wireless sensor networks (WSN). There are two aspects in this paper. On the one hand, the accurate RSSI received from nodes is the premise of accurate location. Firstly, the distribution trend of RSSI is analyzed in this experiment and determined the loss model of signal propagation by processing experimental data. Secondly, in order to determine the distance between receiving nodes and sending nodes, Gaussian fitting is used to process specific RSSI at different distance. Moreover, the piecewise linear interpolation is introduced to calculate the distance of any RSSI. On the other hand, firstly, the RSSI vector similarity degree (R-VSD) is used to choose anchor nodes. Secondly, we designed a new localization algorithm which is based on the quadrilateral location unit by using more accurate RSSI and range. Particularly, there are two localization mechanisms in our study. In addition, the generalized inverse is introduced to solve the coordinates of nodes. At last, location error of the new algorithm is about 17.6% by simulation experiment.


Introduction
Localization is certainly needed for robots to efficiently carry out given tasks such as cleaning, serving, and guiding.It is a challenging research topic in mobile robot which has received much attention [1].Moving around without location for robots is the same as walking with closed eyes for people [2].They do not know where they are and which direction they should move to.Under this background, reliable and efficient localization is still a critical issue for mobile robots.Research on localizing mobile robots has come to prominence in wireless sensor network over the last years [3].
To a large extent, WSN has changed the current situation that people get information by the traditional way, such as their sense of touch, sight, and smell.WSN has become a new formula of technology to get data.Wherever in the field of national security or national economy building, WSN has been applied widely [4].In a variety of applications in WSN, only if the location information of the node itself is combined with the information which is captured and collected from sensor nodes "the location of the incident" can be illustrated accurately and the region of target monitoring is reflected truly.Obviously, the location information of the node is the premise of sensor nodes that are perceived and collected data.It is imprecise and lacking practical significance that there is only perception data of nodes and there is not the perception of location information which signed the source of perception data [5].Therefore, it is important to locate the node in WSN, so the location technology also is becoming an essential function and a critical supporting technology in WSN [6].In terms of the collection of network data and event monitoring, the location information of nodes is important.In the field of remote sensing, it is significant to track and monitor.It is contributed to compare composited route and optimize communication task and improve composited routing table [7].Some domestic scholars also research on deep discussions of localization in WSN [8,9].Unknown nodes and anchor nodes are two important parts of location system.In addition, in terms of choosing anchor nodes, some researchers pay attention to research on RSSI-similarity degree [10].
There are two existing formulas of methods of node localization in WSN by measuring distance or angle information between nodes in the location process and not measuring 2 International Journal of Distributed Sensor Networks information: the method is based on range location (Rangebased) and without range location (Range-free) [11]; the information of range or angle between communication nodes is obtained; it is the premise of the former method to locate nodes; the latter method is not needed to measure range information between nodes directly; it is estimated coordinates of nodes just by getting information of communication hops between nodes or network connectivity.There are common ranging methods as follows: TOA ranging method [9,11], TDOA ranging method [11], AOA ranging [12], and RSSI ranging method [13].
Range is the premise of location; precise range is the assurance of accurate location.Only a certain number of reference nodes (anchor nodes) are combined with effective localization algorithm if they ensured feasible location task, lots of equipment is included in the process; they are arranged before and are able to communicate.At the same time, in the place of receiving nodes, information of signal strength and angle between nodes is needed to measure and convert it into distance information.With the help of geometric or mathematical relationships we can carry out the location task after achieving information of distance or orientation between nodes.In typical location algorithms, the method of Range-based mainly included trilateral location and triangulation location and maximum likelihood location; Rangefree mainly included centroid location, convex programming location, and DV-Hop location method.
The principle of Hop count [12] ranging method is based on hop counts between anchor nodes and unknown node and the product of distance of mean hop in the network to determine their distance.Information of hop count is obtained as follows: anchor nodes send a packet which included lots of information such as its location information to the network, if receiving nodes received the packet, it will add one hop to itself and retransmission, until the unknown node receives this packet; at this time, the minimum hop (the shortest path) is regarded as the hop count between anchor nodes and the unknown node.This range method requires the uniform distribution of nodes in the network; it can ensure that the distance of mean hop in the network better reflected the layout of nodes and achieved higher ranging precision.
The coordinate of the unknown node is estimated by the trilateral location method; it has got good effect [14].
In [15], the value of nodes localization is achieved by the steepest descent algorithm which is a modified algorithm of maximum likelihood estimation method; moreover, the location accuracy and smaller computational cost can be obtained from the steepest descent algorithm which has obvious effect.In [16], the maximum likelihood estimation and the Kalman filtering are composited; it has a double effect on node prelocation and tracking, and it also has higher location accuracy.
The location principle of centroid localization is as follows: the unknown node sends broadcast messages to the network for determining its location information; after anchor nodes received broadcast messages, they sent response of information of its own location to the unknown node; the center of mass in this graphic is regarded as the estimation coordinate of the unknown node [17,18], which is formed by anchor nodes.
In [19], Approximate Point In triangulation Test (APIT) is mentioned.It is a concrete application of centroid localization method; the location principle is as follows: there are any three anchor nodes that composed one triangle; there is a collection formed by all triangles which included the unknown node; the coordinate of the unknown node is determined by determining the center of mass of graphic which is composed of all triangles of the collection.
Centroid algorithm is the most popular algorithm in many location methods in WSN, because the easy operation and the characteristics of few errors are included in the algorithm.Yedavalli and Krishnamachari has put forward sequence of location algorithm [20] (SBL, Sequence-based Localization); Liu et al. has put forward a new SBL algorithm; it combined SBL with three orthocenter algorithm [21]; it is a concrete instance of centroid localization method; it achieved good localization accuracy, but it is needed to improve on boundary node location or ideal environment.
The location principle of convex programming location method [22] (convex optimization) is that the whole network is regarded as a model of convex collection by using the network connectivity; it is through the way of bound combination and plans to determine the possible region within the unknown node and estimate coordinates.
In [23], researchers have analyzed location methods of DV-Hop and DV-distance; the experimental result has shown that the location accuracy can achieve 20% when the network connectivity is 9 and the proportion of anchor nodes is 10%, but the location accuracy is declining evidently along with the increasing range error.Zhang and Wu have put forward a modified location algorithm [24] which is based on the estimation of mean hop distance and location correction; it has solved the situation that the distance of mean hop cannot reflect the real distance, which is estimated by the single anchor node in the network.The result of experiment has shown that mean error of the modified algorithm is reduced about 8.8497% and 14.457%; it has achieved better location accuracy.
In this paper, a novel location algorithm based on RSSI vector similarity degree is presented and a location system is designed, which is applied to locate sensor nodes indoor.Our proposed contributions are as follows.
(1) The Gaussian fitting has optimized the value of RSSI at different distance.
(2) The linear interpolation is used to decrease the calculation of RSSI; it is according to the relation between different RSSI and distance.
(3) The vector similar degree is helpful in choosing anchor nodes.
(4) The generalized inverse is solved to estimate the coordinate of unknown node by equations.
(5) The location system is able to work well indoor when the mobile node is dynamic.

Ranging Method of RSSI-Based
Received signal strength indicator (RSSI) indicated the energy loss in the process of signal transmission; the RSSI value is associated with the size of signal attenuation.In the process of signal transmission, the smaller the RSSI value the less the attenuation.Usually, the RSSI ranging [25] is based on the experience model or theory model.The RSSI ranging of model-based experience has shown that an offline database is built between few RSSI values of nodes which are known location information and their distance of signal propagation; in the process of nodes location, the stored data in the database is constantly compared to implement nodes location.The RSSI ranging model-based theory implemented nodes localization by determining the environmental parameters in the loss model of signal propagation and plugging the RSSI value which is received from receiving nodes into the model, so as to estimate distance between nodes.There is a key of former method; lots of measuring work of off-line in the region is required; in addition, the location accuracy is limited by the number of nodes and measuring workload.
The core of the latter method lied in researching on critical parameters of the model detail by the accurate measuring of RSSI value; hardware conditions and actual environment can be better reflected; in addition, location accuracy and improved location performance can be enhanced.Common methods of RSSI ranging are as follows, which are based on the theory model: the path loss model of free space propagation [26] and the block model of logarithmic normal [26] (Shadowing model), and so forth.
The path loss model of free space propagation is an ideal transmission case, it is known that there is an infinite vacuum around antenna, the signal transmission energy is only related to transmission distance, there is a linear relationship between the signal transmission energy and transmission distance, this model has no effect on obstacles and scattered reflection, and so forth.The path loss model [26] is as follows: In this formula, loss indicated the path loss of signal energy,  indicated the signal transmission distance (m),  indicated the wireless signal frequency (MHz), and  indicated the path attenuation factor in the actual environment.However, the application environment of wireless sensor signal is not in a free space, but in the actual environment such as industrial sites or indoor buildings; it needs to consider shade and absorbance by obstacles and the interference of scattered reflection, and so forth.The attenuation characteristic of channels in the long distance is following the lognormal distribution; it is commonly used by the block model of logarithmic normal; the path loss model is as follows: In this formula,   () indicated the path loss of receiving sign when the measuring distance is  (m), it indicated the absolute power value, and it is in dBm;   ( 0 ) indicated the path loss of receiving sign when the reference distance is  0 ;  indicated the path loss index in a specific environment; it indicated the speed of the path loss, which is increased along with increasing distance;   is in dB; it is a cover factor when the range of standard deviation  is 4∼10 and the mean value is 0; the larger the , the greater the uncertainty of the model.The signal strength of receiving nodes is as follows: In this formula,   indicated the signal transmission power,   () indicated the path loss when the distance is , and they are both in dBm. indicated the signal strength which is received from reference nodes at the distance  0 ;  is as follows: The path loss model is as follows, which is measured at the real distance  (m): In this formula, () indicated the received signal strength when the measured real distance is  (m).( 0 ) indicated received signal strength when the reference distance is  0 ,   ∼ (0,  2 ).
We take the reference distance  0 = 1m; it can be obtained from formula (3) and formula (5).
RSSI is regarded as RSSI value of multiple times of measurement is regarded as the undetermined distance The Shadowing model is chosen to indicate the power attenuation in the process of the wireless signal transmission; due to various obstacles and interference factors, there are kinds of the wireless signal propagation environment; it can be reflected the real measurement environment by determining related environmental parameters in the model.In this paper, the range of RSSI ranging is kept 0∼25 m.For example, the distance between sending node and receiving node is taken 5 m and 10 m, respectively, we have made statistics for collecting RSSI value and chosen more than 400 times of measurement to be a sample and got the characteristics picture of RSSI, and they are as in Figures 1 and 2. Figures 1 and 2 can be seen, with the passage of time; although RSSI generally presented obvious nonstationary characteristics, the RSSI value in certain distance are always fluctuated up and down between the constant real RSSI value, the closer distance from emission node, and the frequenter change of measurement value; on the contrary, the farther the distance from emission node, the gentler the change.

Shadowing Model.
In order to exactly describe the actual measurement environment and ensure the accuracy of RSSI ranging, the parameters of signal propagation model are needed to define. indicated the received signal strength value when the reference distance is  0 = 1 m and  indicated the path loss index.
The determination of parameter  is as follows. = ( 0 ), the radio frequency parameter  indicating the received absolute value of mean energy, which is received from the projection node when distance is 1 m; it is in dBm.When the distance is 1 m, 500 groups of data are continuously measured; finally, there is a result that  = 117.
The determination of parameter  is as follows.Environment factor  indicated, along with the increasing distance, the speed of signal loss in the process of actual transmission.They are satisfied with the following relationship: where  is obtained by generating into more than 3000 groups of data in the range of 2 ∼ 10 m; it is as in Table 1.
The mean value  can be obtained as follows:  Volatility.The trends of two sides of curves are declined gradually at the place of mean value.
Some scholars also research on the kind of distribution of RSSI [27][28][29]; they think RSSI value approximately followed normal distributions as a whole.According to the experimental data and probability density in this paper, it can be seen that there is a similarity between actual measured probability density of RSSI and normal distribution [30].So Gaussian fitting is used to fit RSSI value in experiment and probability error and invalid data are eliminated, the peak value of probability is found, the estimating distance is extracted, which is closer to the real distance, and the process is prived an experiment basis to get accurate location.
If RSSI data is closed to normal distribution, the peak of normal distribution will be the place of the greatest probability density, and the RSSI value is most likely the corresponding distance.So the Gaussian fitting [31] is used to fit the original RSSI data by looking for the peak of probability density; it is aimed at reducing the interference that small probability events have an effect on the overall measurement process.In order to improve the precision of RSSI ranging, the least square [32] is used to fit curves of probability density of RSSI.
(RSSI  ,   ) is described in a two-dimensional coordinate system; RSSI  indicated the th value of signal strength;   indicated the peak value of probability density, which is correspondent to RSSI  ; there is a relationship as follows: In this formula,  1 ,  2 , . . .,   indicated  pending constant.
There is an assumed fitting function between RSSI  and   as follows: In this formula, â1 , â2 , . . ., â indicated the optimal estimating value which is correspondent to constants of original function.If fitting points are falling on the curve of the original function, there will be a relationship as follows: However, under normal circumstances, the original function and the fitting function do not have to be same, there is a residual relationship as follows: The smaller the residual   the smaller the difference between fitting function and original function;   can be better reflecting the distribution trend of RSSI  at different distance.
If all errors are following normal distribution, the probability ( 1 ,  2 , . . .,   ) will be changed; there is a formula as follows: The fitting curve will be the best fitting form of the original curve, if ( 1 ,  2 , . . .,   ) got the peak of normal distribution.At the same time, the sum of squares of fitting residual is minimal; there is a formula as follows: Formula ( 18) can be described as Obviously, there are relationships as follows: where  1 ,  2 , . . .,   is determined by solving the above equation; at the same time, the least square solutions of the equation is obtained.Figure 7 has shown the probability density of fitting when RSSI = 117 DBM.Since then, the RSSI value at the highest peak of curve is regarded as the signal strength value (distance 1 m).Similarly, in terms of any RSSI value, the distance is regarded as the basis of distance estimation, which is correspondent to the peak of probability density.
The Gaussian fitting function protoformula is as follows: The fitting probability density curve of RSSI = 117 DBM is as follows: Figure 7 has shown that the maximum value of the original probability density is RSSI = 117 dBm, but the maximum probability value of fitting is  = 117 dBm.There is the same effect between fitting and original.
International Journal of Distributed Sensor Networks

Ranging Method Based on Interpolation
. 400 groups of RSSI data are taken at intervals of permanent distance; in Figure 8, the blue line is the real measurement value of RSSI in different distance; it can be seen that, with the increasing distance, different distance of RSSI overall has shown the trend of exponential attenuation, but there is a certain fluctuation which is influenced on interference factors around.The green line is the fitting value of RSSI in different distance.
Due to the fact that the trend of RSSI value is in accord with the distribution characteristics of indexes, the least squares are also used to fit the indexes function between the relation of RSSI-d, 0.0001237 and 128.2 are presented in this formula when the range of RSSI value is taken from 117 DBM to RSSI = 61 DBM, and there is a formula of fitting curve as follows: Figure 8 has shown the relationship between the experimental RSSI-d value and the fitting curve, respectively, the blue line indicated RSSI curve and the green line indicated fitting curve; in the graph, it can be seen that there is a deviation between fitting result and experimental RSSI-d at individual distance, but on the whole, it tended the exponential decay.Due to the fact that the obvious transmission signal is quickly attenuated at close distance, there is a slow attenuation and increasing error when the distance is farther.From the experimental figure it can be also seen that there is a better effect when the fitting curve is within 6 m and the trend of fitting error is smaller; along with the increasing distance, the fitting effect has shown a certain deviation and the fitting error is increased.So there is a linear relationship of RSSI value between adjacent distances which is less than 10 m, the not-measured RSSI value can be obtained by using the interpolation [33].
It is known that the real RSSI value is close to Gaussian distribution at different distance by analyzing the above section; the place of larger distribution density of RSSI is most likely to be the distance between receiving nodes and projection nodes.As shown in Figure 9, the corresponding RSSI value is measured at intervals of 1 m and the distribution of probability density is analyzed.The probability density curves when RSSI = 117 DBM and RSSI = 61 DBM are drawn, respectively, in the diagram.But it is uncertain that the notmeasured RSSI value is at the distance of 1.5 m and 2.5 m; similarly, in terms of a given RSSI value, the distance between sending nodes and receiving nodes is uncertain.To this end, the interpolation mode is built according to the measured probability distribution of RSSI value; the distance between nodes is estimated according to the received RSSI value.
The Gaussian fitting is used to fit the probability distribution of RSSI.There is a fitting function as follows: International Journal of Distributed Sensor Networks Figure 10: The linear interpolation.
Parameters  0 and  can be determined by two groups of specific RSSI value, such as RSSI = 117 DBM and RSSI = 61 DBM.The peak of probability density of RSSI is searched at each distance; the distance is regarded as the estimation distance between receiving nodes and sending nodes, which is corresponded to the peak.Along with the increasing distance between nodes, the RSSI value between nodes is decreased, so there is a linear relation between the peak of probability density and distance as follows: Along with the changed distance, parameters  and  indicated the changed tendency of the probability density; they can be obtained by generating data.The model of RSSI-d is shown as follows [34]: As shown in Figure 10,  1 max and  2 max indicated functions of RSSI 1 and RSSI 2 , respectively, so, in terms of for all RSSI  ∈ (RSSI 1 , RSSI 2 ), if the corresponding equation   max ∈ ( 1 max ,  2 max ) is needed to be obtained, there is a relationship as follows: In formula (26),  indicated the interpolation coefficient, in terms of any couples of RSSI according to the linear rule; their coefficient  is the same value.So, there is an equation between different couples of RSSI.If  > 1, it is indicated that the RSSI  is in the range of RSSI 1 and RSSI 2 , so the extrapolation can be used; on the contrary, if  < 1, the interpolation can be used.
If it is known that RSSI  , the corresponding normal peak   max , is calculated by and indicated the probability density when RSSI = 117 and RSSI = 61 by generating the related data into formula (23), and the interpolation model of RSSI-d is built as follows.When the distance is 1 m and RSSI is 117 DBM,  = −0.3534and  = 0.401 are obtained from formula (25), and the equation is as follows:  = 0.401 + (−0.3534) *  −2(RSSI  −64.8864) 2 /1054.9 .
In terms of different RSSI-d models at different RSSI, they can be used in interpolation.In order to extrapolate the RSSId model to greater RSSI range, it is significant to estimate the long distant, so we have extrapolated the range of RSSI from 117 to 56 (corresponding distance is 1∼10 m).Finally, the contrast between mean range error and mean ranging error of Shadowing model is as in Table 2.
From Table 2, it can be seen that Shadowing model and RSSI-d interpolation model can obtain corresponding distance by speculating the RSSI value; they achieved the ranging effect.But from the ranging error, it can be known that mean range errors of RSSI-d interpolation model are less than Shadowing model; it is benefit from linear interpolation of short distance.

The Location Algorithm Based on R-VSD
Along with growing demands of applications, there are many kinds of methods, but every method has its merits.At present, the research on indoor location technology in wireless is relatively concentrated on signal-based RF [35], there are various technologies in wireless network, such as ultra wideband (UWB), Wi-Fi (IEEE 802.11),Bluetooth, and radio frequency identification (RFID).If researchers consider hardware conditions of location and signal resources and location accuracy, the method based on the received signal strength indicator (RSSI) [21] is widely used in all of location methods.Existing localization algorithms [23] can also obtain good location effect, but the researching is not completed on the part of edge nodes; in addition, there is a problem of large location errors which are caused by the pending location nodes that are outside of the unit.On account of the above problems, an improved localization algorithm RSSI-based with vector similarity is proposed.In the process of location, the method of R-VSD is used to choose optimal anchor nodes; the new location algorithm is used to estimate coordinates of unknown nodes.

The RSSI Vector Similarity Degree.
In order to describe the similar degree between the RSSI vector of unknown nodes and the RSSI vector of reference sample points, the new indicator, similar degrees of RSSI vector is built; reference sample points which are nearest to the unknown node accurately can be found.Definition 1.If a node can receive radio signal from  anchor nodes, the received RSSI value can set a vector collection as follows: In this formula, RSSI  indicated RSSI values which is received from th anchor node node.
RSSI value of the vector collection Ψ is ordered from big to small; the collection Ψ is as follows: Ψ  = { ( 1 ) ,  ( 2 ) , . . .,  (  )} ( = 1, 2, . . ., ) . ( The collection Ψ  indicated the key collection of RSSI value; (  ) indicated the received RSSI value which is ranked the th; namely, anchor node is regarded as the key of RSSI value, which is the th distance from the unknown node.
The RSSI vector which is formed by  anchor nodes and  reference sample points is as follows: There is a collection by ordering RSSI value in the vector table as follows: (  ) indicated the RSSI values of the th ordering; it is received from the th reference sample points; namely, anchor node which is the th distance from the unknown node.
So, the similar degree () between the RSSI vector   and   is as follows: In this formula, (  ) indicated the deviation degree of keyword (  ); RSSI  is the importance of RSSI at the place of .
According to Definition 3, the vector similarity is satisfied with the following relations: (1) (  ,   ) ≥ 0; it is established only when the deviation (  ) ( = 1, 2, . . ., ) is 0; International Journal of Distributed Sensor Networks (2) the smaller the (  ,   ), the smaller the difference between   and   ; there is a higher similar degree; on the other hand, the lower similar degree is shown.

𝜌(𝑘) (
In this paper, according to above definition of similar degree,  reference sample points are searched, which are the most similar to the unknown node; the region of the known node is narrowed constantly.After iterative times, the area is regarded as the estimation regional of the unknown node, which is formed by  reference sample points which are the similar degree (), in order to describe the similar degree between the unknown node and other reference sample points accurately and estimate the coordinate of the unknown node accurately.According to the similar degree, these reference sample points are weighted.The mass center of this region is regarded as the ultimate estimation coordinate of the unknown node.The formula is as follows: The method of node location based on RSSI included two location mechanisms which are internal and external, the coordinate of the unknown node is estimated by combining with the similar degree of RSSI which is used to find reference sample points which are the closest to the unknown node.The algorithm flow chart is as in Figure 11.
In Figure 11, firstly, there are a number of Un unknown nodes and the number of  anchor nodes is distributed in the region of pending.Secondly, unknown nodes received RSSI which are sent and created the RSSI vector table which is arranged by descending sort.Thirdly, the top four anchor nodes are taken to determine the quadrilateral location unit.Fourthly, the unknown node  is judged whether it is inside of the quadrilateral location unit or not.If it is inside of the quadrilateral location unit, the internal location arithmetic is implemented; on the contrary, the external location arithmetic is implemented.Finally, the number of unknown nodes in the range of Un should be judged before estimation coordinates of unknown nodes are calculated.Otherwise, the unknown node had to judge that whether it is inside of the quadrilateral location unit or not.
The time consuming of points collection and vector table are both () ( is the number of anchor nodes).The time of arranging consumed is ( 2 ).There are three times of iterative loop when the area is narrowed and when it is judged whether it is inside of the quadrilateral location unit or not.In the process of location arithmetic, it is required to compare the RSSI vector of the unknown node with the respective RSSI vector of six reference sample points when each unknown node is needed to be located; the time consuming is (1).In conclusion, the algorithm complexity is significantly lower than time complexity ( 6 ) of SBL.
In this paper, in terms of the triangle location unit , which has shown the initial area, three median lines are divided into four small triangles for the original triangle; there is a triangle called a median triangle, which is formed by three median lines; the areas of four triangle are /4.So, according to the dividing way, the location area is narrowed to /4 when the iterative algorithm is used; at the same time, three reference sample points are added in this process.The area within the unknown node is restricted to /256 when it is divided to 4 times; at this time, reference sample points the number of 16 are required.So, the region area within the node will be compressed to /4  when the times of repetitions of narrowing the area is , clearly, this kind of iteration is convergence.

The Location Algorithm Based on the Quadrilateral Location Unit.
There are four anchor nodes regarded as reference anchor nodes, which are the closest to the unknown node.The quadrilateral is regarded as the location region, which is formed by these four anchor nodes.The unknown node is determined whether inside of the quadrilateral or outside of the quadrilateral by the relation of area constraint.Under this section, these problems are solved: how to select reference sample point if it is inside of quadrilateral; if it is outside of the quadrangle, how to determine the coordinate of the unknown node in the case of making location error as small as possible.

The Determination of the Location Unit
Theorem 4. The midpoint of the each edge of the triangle is taken; the new three midpoint points and three top points of the original triangle are regarded as reference sample points; there is uniqueness of the RSSI vector which is formed by the RSSI value of sample points which are received from all anchor nodes.

Proof (by reduction).
As shown in Figure 12, it is assumed that there are different coordinates of two different nodes P1 and P2, but they have the same RSSI vector with same dimension and value (the numbers of anchor nodes are 3, the dimension of vector is 3), 1(, ), the distance from P1 to anchor nodes A, B, and  are  1 ,  1 , and  1 ; similarly, in terms of P2, distances are  2 ,  2 , and  2 .
∵ There is the same RSSI vector with same dimension and valuefor P1 and P2 ⇒ By Shadowing model, there is a same distance vector with same dimension and value for P1 and P2.
⇒There is the same distance from P1 or P2 to any same anchor nodes.
∴ There is the following equation: ) .
(38) There is a unique solution for the coordinate of P1 by above formula (43) and formula (44).
There is a known assumption that So, there is the same coordinates of P1 and P2; clearly, there is a contradiction relationship with known assumptions, so the original theorem is established.That has just finished.
According to Theorem 4, there is uniqueness for every vector of reference sample points in subsequent localization algorithm.

The Main Idea of the Localization Algorithm.
As shown in Figure 13, P1 and P2 are indicated unknown nodes, A, B, C, and  are indicated reference anchor nodes which are the closest to P1 and P2, and the quadrilateral indicated the location unit, which is surrounded by A, B, C, and D. AC and BD indicated two diagonals of the quadrilateral ABCD and  indicated diagonals intersection (coordinates can be obtained); it is regarded as the new reference sample point.
By the following relation of area constraint, the location of unknown node can be determined roughly as ⇒Point  is inside of quadrilateral of ABCD ⇒Point  is inside of Δ.
By Algorithm 1 of two location system, the location of unknown node can be determined.

The Location Mechanism of the Unknown Node Is inside
of the Location Unit.As shown in Figure 14, if the unknown The input: These reference anchor nodes , , , , which are the closest to   , they are made of a set   :   = {  ,   ,   ,   }.There are number Un unknown nodes are distributed in the region of locating.The output: The unknown node  is inside of the location unit or external.
Step 1. FOR  = 1: Un Step 2. IF   =  Δ +  Δ +  Δ +  Δ Step 3. RUN InternA //The algorithm of location mechanism that  is inside of graphics.node is inside of ABCD, some operations will be taken to reduce the location unit as follows.
Step 2. If point  is inside of any one triangle, three new reference sample points are obtained by taking the middle point of each edge of triangle.
Step 3. The similar degree for the RSSI vector of the unknown node  are compared with the top points of the original triangle and the RSSI vector of three new reference sample points (there are six RSSI vectors); the most similar reference sample points are found; namely, three reference sample points which are closest to  are , , .
By analogy, above steps are repeated, reference sample points are obtained by looking for the midpoint of the location triangle constantly, which are the closest to the unknown node P, the microtriangle region which included the unknown node is narrowed, and Figure 14 has shown that midpoint  is locked in the region of Δ.as shown in Figure 15, the coordinates of the unknown node is determined by determining two triangles of copoint.

The Location Mechanism of Unknown
Main operations are as follows.
Step 1. Points  and  are found, which are first and second of the RSSI vector of the unknown node ; they are made of Δ.
Step 2. Points  and  are found, which are first and second of the RSSI vector of the unknown node ; they are made of Δ.
Step 3. Since the RSSI can be measured, the distance between points can be obtained by the signal attenuation model.Since three lengths of sides are known, the triangle area can be obtained.Since coordinates of two tops are known, the height from point  to its edge can be obtained by the area formulation  = (1/2) × ℎ.
The coordinate of known node is obtained by the following equations: In this formula,  indicated the circumference of the triangle,  indicated the area of the triangle,  indicated length of sides of the triangle,  *  +  *  +  = 0 indicated the linear equation which is included the line , and two groups of coordinates of unknown nodes can be obtained by (47).By the same token, RSSI values of points  and  are chosen, which are first and third in RSSI vector.Δ is made of points , , and ; two groups of coordinates of unknown nodes can be obtained; they are (, ) and 1(2, 2).The public top point  of two triangles can be obtained by synthesizing two groups of solutions; the coordinate of the unknown node is (, ).
Although this method is feasible, the rate of measurement error of RSSI on all directions may not be consistent in the process of distance measuring; it will be leaded to distance changes of the corresponding direction showing different conditions; at this time, the above method cannot get two public point of two triangles; namely, there is not public solution for simultaneous equations.

The Method of Generalized Inverse.
As shown in Figure 16, there are random measurement errors of RSSI; the calculation result is not coincidence.Furthermore, there is not public solution for simultaneous equations.To this end, a complementary localization algorithm is designed when the node is outside of the location unit by using the generalized inverse [36].
∈  × and  ∈   are both known; the vector  ∈   is unknown, which is included in the linear equations  = .
If there is a solution of equations, the equation is regarded as the compatibility equations; on the contrary, it is the incompatible equation.In terms of the incompatible equations, there is no general solution.So in this section, the optimal and approximate solution of incompatible and insoluble equations is obtained by using the generalized inverse The solution of the above formula is regarded as the least squares solution of incompatible equations; the symbol ‖ ‖ is the European norm.
Definition 5.If the incompatible linear equation  =  is satisfied with  =  −  ,  −  indicated the least square generalized inverse of ; there will be a relation that X is satisfied with ‖ X − ‖ 2 < ‖ − ‖ 2 , so X =  −   indicated the least square solution of equations, and there is the minimum sum of squares of error by comparing to other solutions.
Above equation set is turned into a form such as the linear equations  = ; the coefficient matrix  and vector  are as follows: Because there is no common solution of equations, it is the incompatible linear equations.Then, the least square generalized inverse of equations is as follows: So, the least squares solution of incompatible linear equations is as follows: Consider X = [ x ỹ ]; the estimation coordinate of the unknown node is ( x, ỹ).

Results of Simulation Experiment and Real Experiment
4.1.The Result of Simulation Experiment.In order to simulate the real environment, the Shadowing model is used to convert RSSI value into its corresponding distance; ranging errors are setup to simulate the range environment.In this section, localization algorithm is simulated by the tool of MATLAB 7.0, 8 anchor nodes and 160 unknown nodes are taken in this experiment, all nodes are isomorphic, unknown nodes are random distributed in the rectangle area 10 × 10 m 2 in the experiment environment, and anchor nodes are in the scope of the region that unknown nodes can be communicated (Figure 17). Figure 18 has shown that location error is obtained by simulation when anchor nodes numbers are 8, 16, 24, and 32.Along with the increasing numbers of anchor nodes, location errors are decreased gradually.Because the more the numbers of anchor nodes are in the locating area, the more the numbers of anchor nodes are nearest to the unknown node, the smaller quadrilateral area is formed by anchor nodes; namely, sample reference points are more closer to the unknown node.In order to describe the effection of ranging error and the trend of ranging error, we have drawn a picture of the relationship between location error and ranging error.In Figure 19, the increasing trends of anchor nodes are increased from 8 to 32, and the changing of the location error is changed.
At the same time, under the condition that the total number of unknown nodes is invariable at UN = 160, Figure 19 has shown the simulation result when RSSI ranging errors are 0.1 and 0.2, which are obtained by the method of average calculation, and it also means that the percentages of RSSI ranging error are 10% and 20%.According to Figure 19, when the number of anchor nodes is unchanged, the bigger the RSSI ranging error, the larger the location error; at the same time, when the RSSI ranging error is constant, the more  the number of anchor nodes, the smaller the location error.It is also suggested that location error based on RSSI is not only dependent on the localization algorithm, but also dependent on the accuracy of ranging analysis of RSSI [10].
There is a relation analysis between the number of anchor nodes and location error and RSSI range error in Figure 19, in the real measurement environment.The measurement errors of RSSI at all directions are not consistent; the generalized inverse is used to solve the problem that there is not public solution of equations which is formed by the external location unit.The picture of location error is shown from Figures 20,21,22,and 23; the colorful lines indicated the mean location error when RSSI ranging errors are 0.05, 0.1, and 0.2, according to these figures, the mean location error = 0.2 is regarded as the better mean value, along with the increasing number of anchor nodes; location error has shown a decreasing trend on the whole; in addition, the final location error of the random ranging error is almost constant with the final location error of the constant ranging error before, but it is practical in application.
In Table 3, there is a comparative relationship of the number of reference sample points required when each unknown node is required to locate between localization algorithm and localization algorithm of FTLM model.According to Table 3, it can be seen that this algorithm needed less reference sample points when the microarea of positing is the same one; moreover, less amount of calculation is needed.The iteration location by reducing the area is convergent.When the location area is 10 × 10 m 2 , the comparison of location error between the new algorithm and the sequence three-orthocenter method and the sequence location method and three other center methods is shown, respectively, in Figure 24.
Visibly, along with the decreasing number of anchor nodes, location error of these methods will be increased, because the more the number of anchor nodes, the more the times that original location area is divided into different formulas of smaller area, unknown node is more closer to anchor nodes, the more accurate location; Figure 24 has shown that location error of three-orthocenter method is more than five times than new location algorithm when the anchor node number is 8, because the new location   continuously narrowed the area which included the unknown node by the scale of 1/4 in the process of location; thus the actual location of the original node can be better restored; in this paper, the location error of the new location algorithm is almost constant with the sequence three-orthocenter method and the sequence location method when the anchor node number is 32, because the numbers of location sequence of sequence three-orthocenter method and sequence location method are already increased to 462273 when the anchor node number is increased to 32; the area is quite small, which included the unknown node, but, obviously, lots of measurements should be taken; a great amount of calculation and sequence alignment should be made; at this point, the 16 reference sample points are needed to compare with each unknown node in the new location algorithm; the location error is lower than three-orthocenter method; the superiority is shown.In this simulation experiment, four anchor nodes and four unknown nodes are set up in the region 3 × 3 m 2 .The mean absolute ranging error of nodes is obtained as 0.27 m; the percentage of location error is about 17.6% by the calculation formula: In this formula,   indicated the percent of location error of the th unknown node,  − indicated the absolute ranging error between real coordinate of the th unknown node and estimated coordinate,   indicated the distance between the th unknown node and original point.
In Figure 25, black points indicated anchor nodes which are settled before, red points indicated the real coordinates of unknown nodes (they are ranged by tools), and blue triangle indicated estimated coordinates of unknown nodes by the new location algorithm.
The location error is not only related to the location algorithm but also related to RSSI range and the number of A RFID tag is carried with robot which is regarded as the unknown node.In addition, the location system is set as a server and a transmission PC and a router (see Figure 35).Firstly, anchor nodes send strength signal to the robot which can be received and sent signal.Secondly, the server received signal information from the robot and processed these data.Thirdly, mobile terminal gets processed data from server by router.Finally, information of mobile robot is displayed in the interface of mobile terminal.Particularly, the card reader is set at the door; it is a caution of the mobile robot when the robot is outside of the location region.

The Design of Mobile Terminal.
This system can be applied to prevent children lost indoor; accounting that the children's speed of movement is relatively much slower than parents, the process of implement is regarded as a lower level dynamic environment.The system is able to work well when child moves into room.There are some pictures of experiment displayed in the interface of mobile terminal.In Figure 36, the application is set at home, so the background of the interface is the picture of home, and the black point indicated the mobile robot.
In Figure 37, it is shown that there is an alarm's tooltip in the picture; it indicated that the RFID tag is read by card reader; namely, the mobile robot is outside of home.Particularly, this system designed the alarm's music with the alarm's function.

Conclusion
In this paper, we studied on the location technology of RSSIbased in WSN.In order to get accurate RSSI value and simulate the real experimental environment, there is a large amount of experimental data.In the process of location, we determined the related parameters of the Shadowing model and analyzed the RSSI value at the specific distance by the Gaussian fitting; in addition, not only we built the RSSI-based interpolation model of node, but also we analyzed the influence of the number of nodes.In terms of the new location algorithm, we proposed the location mechanism; it is used to estimate that the unknown node is internal or external.Moreover, we proposed the concept of vector similar degree; it is helpful to choose anchor nodes.Particularly, the generalized inverse is solved to estimate the coordinate of unknown node by equations.Simulation and experiment results show that our approach outperforms existing approaches in terms of location accuracy, and our location system is applied to locate the robot quite well.

Figure 3 :
Figure 3: First group of RSSI probability density.

Figure 6 :
Figure 6: Fourth group of RSSI probability density.

Figure 8 :Figure 9 :
Figure 8: The trend of curves of RSSI value between experiment and fitting.

1 Figure 12 :
Figure 12: A set of RSSI vector is uniquely correspondent to the coordinates of node.

Figure 13 :
Figure 13: Unknown nodes of P1 and P2 for locating.

Figure 14 :
Figure 14: The division of the location unit when the unknown node is inside of graphics and the determination of sample points.

Figure 15 :
Figure 15: The unknown node is outside of the graph.

Figure 16 :
Figure 16: The complementary localization algorithm used the generalized inverse.

Figure 17 :
Figure 17: The layout of anchor nodes and unknown nodes.

Figure 18 : 1 Figure 19 :
Figure 18: The relation between the number of anchor nodes and location error.

2 Figure 20 :
Figure 20: The number of anchor nodes is 8.

2 Figure 23 :
Figure 23: The number of anchor nodes is 32.

Figure 25 :
Figure 25: The result of location.

Figure 27 :y vs. x Fit 1 Figure 28 :
Figure 27: The fitting curve of number 1 node when distance is 4 m.

Figure 29 :Figure 30 :
Figure 29: The fitting curve of number 2 node when distance is 4 m.

Figure 31 :Figure 32 :
Figure 31: The fitting curve of number 3 node when distance is 4 m.

Figure 33 :Figure 34 :
Figure 33: The fitting curve of number 4 node when distance is 4 m.

Table 1 :
The value of .

Table 2 :
The contrast of range error between RSSI-d interpolation model and Shadowing model.

Table 3 :
The relationship of the number of reference sample points between localization algorithm in this paper and localization algorithm of LTFM model.

Table 4 :
Location error of unknown nodes.