1. Introduction
Wireless Sensor Networks (WSNs) enable IoT to obtain the required monitoring information. Node location is the key to WSNs monitoring information collection. Without location information, monitoring information will lose its meaning [
1,
2,
3]. Therefore, node location has become an issue in WSNs and a research hotspot [
4]. The precision of node location determines if the monitoring information can be related to the perceived phenomenon source, so it is crucial to ensure that nodes can obtain accurate location information [
5]. However, in large WSNs, it is unrealistic to equip each sensor node with a GPS (Global Positioning System) chip to obtain position information [
6]. A more reasonable solution is to allow some sensor nodes to obtain their own positions by equipping them with GPS, which are called beacon nodes (BNs), and estimate the locations of other nodes (nodes with unknown positions) by communicating with BNs.
On the basis of whether to measure the distance or azimuth between two nodes or not, there are two kinds of positioning algorithms—location algorithm based on distance measurement and location algorithm without distance measurement [
7]. The ranging technology required by the range-based positioning algorithm mainly includes Receive Signal Strength Indicator (RSSI), Time of Arrival (TOA), Time Difference of Arrival (TDOA) Angle of Arrival (AOA), etc. [
8]. Location algorithms without ranging mainly include centroid algorithm, convex programming algorithm, DV-Hop algorithm, etc. [
9].
Among location algorithms without range measurement, more and more researchers are paying attention to DV-Hop because of its simplicity and scalability [
10]. In order to further improve the location accuracy of DV-Hop algorithm, researchers have tried many improvement strategies. Fei Tang [
11] proposed a new DV-Hop location algorithm based on Simulated Annealing Evolution (DSAE). Jeng Shyang [
12] combined the proposed gas Brownian motion optimization CGMBO with the proposed layer DV-Hop to greatly improve the position. A multi-objective DV-Hop algorithm based on differential evolution quantum particle swarm optimization was proposed in reference [
13]. Shi Q [
14] uses a new particle swarm optimization and simulated annealing hybrid algorithm to enhance the positioning accuracy of the UN. Shi Q [
15] proposed that modifying the space between the UN and the beacon node (BN) and optimizing the initial position of the UN. A new DV-Hop with social studying class topper majorization was implemented in literature [
16]. Reference [
17] solved the mathematical weighted DV-Hop location model by using genetic algorithm. Reference [
18] used the optimized formula to compute the mean hops of BNs, so as to acquire higher positioning accuracy, but there is still a large distance estimation error. Literature [
19] introduced the concept of multiple communication radius to refine the hop number of nodes and used the sparrow search algorithm to correct the unknown node coordinate position. Literature [
20] proposed an improved DV-Hop algorithm based on dual communication radius to update the minimum hop number obtained by the unknown node closer to the beacon node. Several steps based on geometry improvements of the localization problem are added in literature [
21]. Literature [
22] proposed a three-time correction of the unknown node location. An improved DV-Hop algorithm based on hop thinning and distance correction was proposed in literature [
23].
The above algorithms have improved the positioning performance of DV-Hop algorithm to varying degrees, but in the non-uniform network, there is still error accumulation caused by unreasonable hops and jump distance. Therefore, this paper puts forward an improved DV-Hop algorithm on RSSI amendment to reduce the cumulative error generated in calculating the space between two nodes and enhance the positioning accuracy of nodes.
The major improvements from this paper are as follows:
- (1)
Optimization of hops. The RSSI is optimized by weighted normal filtering to cut down the interruption of RSSI from environment, noise, multipath propagation and other factors. The hops are divided continuously by the filtered distance, and the discrete hops are continuous to obtain more accurate hops.
- (2)
Optimization of jump distance calculation. The MMSE criterion under the best index is introduced to calculate the jump distance. The original algorithm fails to take into account the matching relationship between hops and the distance between BNs. Instead, it generally regards all BNs as equally important and minimizes the fitness function to obtain the jump distance, which will lead to error propagation. Therefore, this paper evaluates the relationship between the space and hops of the BN and minimizes fitness function as a weight. The change index value was introduced into the calculation of fitness function, and the optimal value was selected to solve the BN jump distance.
- (3)
Emendation coordination position of UNs. The estimated coordinates of UNs were modified for the first time by comparing whether the distance obtained by RSSI ranging technology and by the estimated coordinates of UNs. To obtain good positioning accuracy in the irregular network structure, the UN coordinates were modified twice.
The results of experiment illustrate that the improved algorithm at each stage has improved precision of UN coordinates, and the proposed algorithm performs very well compared to the algorithms in [
21,
22,
23].
The rest of the paper is organized as follows. In
Section 1, research background is presented, and related work is provided in
Section 2.
Section 3 describes the algorithm proposed in this article. Before concluding remarks, simulation results and discussion are given in
Section 4 for two topologies separately.
2. Research Background
DV-Hop localization algorithm was originally a distributed localization algorithm based on segment hopping mechanism proposed by scholars Niculescu and Nath [
24]. In the process of positioning, the unknown node does not need to directly measure the distance to obtain the coordination innates; instead, it obtains its own position by communicating with the anchor nodes with known coordination innates in the network. The way the unknown node obtains its own coordination innates is related to the minimum number of hops and the average hop distance in the network.
2.1. Positioning Process
The position course of DV-Hop is as follows.
Step 1: A packet containing identification number, its own coordination position and hops is broadcast to the network by BNs through using the flooding method, and the hops are initialized to 0. After broadcasting, the minimum hops of nodes from each BN are obtained.
Step 2: The average distance per hop (
) for each BN is calculated using Formula (1).
where
,
are the coordinates of nodes
, respectively, and
are the minimum hops between two nodes. Then,
is broadcast into the network.
Step 3: The coordination innate positions of UNs are acquired through trilateral measurement.
2.2. Positioning Error Analysis
DV-Hop estimates the UN coordination position by multiplying the hops by . The error is mainly derived from the following two aspects.
2.2.1. Error Caused by the Minimum Number of Hops
In DV-Hop, as long as the node receives packet from neighbor node, the hop count is 1 regardless of the distance, as shown in
Figure 1. Although the distance between L1 and P, P and A is different, they are all recorded as 1 hop. There will certainly be large error if the minimum hops calculated in this way, which are used to continue the subsequent localization.
2.2.2. Error Caused by Hopsize
Since L1, L2, and L3 are beacon nodes and the coordinate positions of the three nodes are known, both of the real distances between L1 and L2 and L1 and L3 are calculated as 40 using the Euclidean distance. The path with the minimum number of hops from L1 to L2 passes through P, A and C nodes, respectively, so the minimum number of hops is 4. Similarly, the minimum number of hops from L1 to L3 is 4. According to the second step of the DV-Hop positioning process, of L1 is calculated as by Formula (1). As L1 is the closest node of UN P, the of L1 is taken as the of UN P, and the estimated distance between L1 and UN P is while the actual distance is 5, so the error is large.
3. Related Research
The deployment scale of IoT equipment has grown rapidly in recent years. Many application fields need to obtain accurate location information of people and things. For location-based IoT services and indoor and outdoor integration positioning, academia and industry have conducted extensive exploration and practice. Satellite-based positioning systems are widely used in outdoor scenes, such as Beidou system, GPS system, etc.
However, the positioning accuracy of nodes widely distributed in the urban environment often decreases due to the obstruction of the building structure to the satellite signal. To resolve this problem, literature [
25] improves the positioning accuracy of nodes by building a GPS signal network sharing multiple nodes in a single car, integrating the acceleration sensor and magnetometer in the user’s smartphone to predict the user’s trajectory, and estimating the relative distance between two nodes in a single car. Literature [
26] designed a strategy to correct the original GPS observation information based on the reinforcement learning model, and achieved more stable positioning performance through an efficient confidence reward mechanism. In order to further improve the accuracy of satellite positioning and meet the needs of high-precision positioning in autopilot and other applications, Qianxun Location Network has achieved centimeter-level outdoor positioning precision degrees [
27]. Literature [
28] achieved a positioning accuracy of 0.2 m. This scheme requires complex sensors and high system computing power, resulting in high system power consumption and cost. Literature [
29] designed an outdoor group-aware location method based on WiFi hotspots, which simplifies the structure of the location system and reduces the power consumption of nodes. Literature [
30] designed an adaptive switching spatiotemporal fusion detection method, which realized the detection and positioning of small unmanned aerial vehicles in airspace through the image information observed by the electronic optical camera.
Unlike the outdoor scene, the indoor environment lacks a general positioning system due to the serious attenuation of satellite signals. In recent years, the academic and industrial circles have carried out research and application of indoor positioning through WiFi, RFID, Bluetooth, ultra-wideband (UWB), ultrasound and other means for node positioning in complex indoor environment. Reference [
31] designed a fingerprint location method based on user-guided following strategy. However, such methods need to build corresponding fingerprint database for specific environment. In response to this problem, literature [
32] designed an ultra-low load WiFi fingerprint map construction method, which reduced the cost of fingerprint database construction and extended the maintenance cycle. Literature [
33] designed a fingerprint location method based on multi-user group intelligence perception, which solved the problem of fingerprint database construction to a certain extent. Literature [
34] designed a privacy protection location method under the condition of ensuring accuracy to solve the problem of user privacy disclosure. Literature [
35] proposed a three-dimensional indoor localization system based on a Bayesian graphical model which collected received signal strength indicators from each access point in an offline training phase and then estimated the user location in an online localization phase. Literature [
36] proposed an application of the standard particle swarm optimization algorithm to Wi-Fi fingerprint-based indoor localization, wherein a new two-panel fingerprint homogeneity model is adopted to characterize fingerprint similarity.
4. The improved DV Hop Algorithm
4.1. Hop Correction Based on RSSI Ranging
Compared with the previous hop count method, the idea of multiple communication radii is adopted in literature [
19], but the idea of multiple communication radii will greatly increase energy consumption of the node, and the accuracy of the hop count is directly related to the degree of division of the pre-propagation radius. The idea of two communication half paths is adopted in literature [
20], which cannot make a more accurate division of the hops, and as the communication radius increases, the hop count becomes more and more inaccurate.
For this reason, this paper adopts the idea of RSSI ranging to divide hops continuously, making discrete hops become continuous hops. However, because RSSI is vulnerable to interference from environment, noise, multipath propagation and other factors, this paper first optimizes RSSI by weighted normal filtering, and uses the filtered distance to divide hops continuously.
4.1.1. RSSI Ranging Model
RSSI is now one of the most popular ranging algorithms, because most sensor chips now have the function of measuring RSSI strength, and it can complete the range estimation without adding any other additional hardware equipment to the sensor.
However, it is impossible to always carry out accurate ranging because RF signals are greatly affected by terrain, weather and human factors and because of the fluctuating characteristics of the received signal power, so the error of distance estimation based on transmission power loss is large. To avoid this problem, RSSI is introduced in this paper not to use it for ranging, but only as an auxiliary tool for hop thinning in DV-Hop algorithm. In this paper, the widely used Log Normal signal model is used to depict the relation between RSSI and space. Even in the environment with shelter, it can flexibly establish different expressions of signal attenuation and propagation distance. The model is expressed as
where
is the signal intensity at d from the transmission point,
is the signal strength from the transmission point, which is the reference signal strength, generally taken as 1 m and its value is known,
is the path loss index, and
is Gaussian noise.
4.1.2. Weighted Normal Filtering
Because signals are often interrupted by environment, noise, multipath effect, etc., when they are transmitted, the signal value taken over by the node is often not the true value, but the interfered value. Therefore, this paper uses weighted normal distribution to process the signal value received by the sensors. The normal distribution is
where,
μ is the mean of signal, and
is the standard deviation of signal. According to the
principle of normal distribution, the probability of signal distribution within the range
is 0.6526. In this paper, the value of
within this range is taken as the effective value to avoid the impact of abnormal values on the overall value, and a series of effective values within this range are weighted and optimized.
Assume that a group of valid values filtered by the node are
, and average them to obtain
The final
is obtained through the following equation:
After weighted normal processing, nodes can obtain more accurate RSSI values, which minimizes the impact of the external environment.
4.1.3. RSSI Ratio Correct Hops
The node communication radius R is selected as the best one-hop distance, and hop is recorded as 1 when the space between the two nodes is R, then hops between two nodes are calculated by using the proportion of the true distance within the communication range and R. When there are nodes with unknown coordinates in adjacent nodes, the true distance cannot be obtained. However, all nodes have the functionality of gathering RSSI, so the RSSI value received by UNs can be used to quantify hops.
When the distance between two nodes is R, is used to represent the received signal strength, and is defined as the reference value. The ratio of value between neighbor nodes and reference are used as hops between two nodes.
Assuming
received by node from the neighbor is
, the hops from node K to the neighbor node are
As shown in
Figure 2, it is an abridged general view of hop quantization between two nodes. When
, it means a node is on a circle with radius of communication radius, such as B. When
, it means the distance between nodes A and B
1 is less than R, that is, at points B
1 and B
2 in
Figure 2, the hops are less than 1.
The RSSI ranging technology is introduced to quantify the hops, serialize discrete hops, so the relative distance between actual nodes is more accurate, and make the distance estimation between two nodes more accurate.
4.2. Correct Hopsize
In DV-Hop, the is important for reckoning the distance of nodes. The DV-Hop used unbiased estimation to calculate the , but this method failed to take into account that the error is stochastically distributed into positive and negative phases, leading to the minimization of the overall error, which cannot minimize all errors. Therefore, the MMSE criterion under the best index is used to count the and introduces the matching relationship between BN distance and hops to jointly amend it, to further reduce the error of it and improve the positioning effect.
The adaptive MMSE criterion is adopted to minimize the total error globally. Compared with the deviation and variance, it is more reasonable to apply it to the calculation of
, but the fitness function must satisfy Formula (10):
where
,
are the coordination positions of BNs
and
, respectively,
is the number of BNs,
is the average distance per hop of BNs
and
,
are the minimum hops between BNs
and
.
In order to discuss the increment of
hopsize, the partial derivative of the fitness function is obtained, and the other independent variables are constant, so the derivative is taken as 0.
The
is calculated by Equation (12):
However, this fitness function does not take into account the matching relationship between the BN distance and hops when computing
of the BN, as shown in
Figure 3.
All of the distances between beacon node N and beacon node A, beacon node N and beacon node B, beacon node N and beacon node C are approximately the node communication radius distance R. However, the hops between beacon node N and beacon node A, B and C are approximately
,
,
. If this beacon node relationship is viewed in the same way, there will be a large error when computing
of the beacon node. In this paper, the hop distance matching factor
is used to modify the fitness function, where
where
,
are the coordination positions of BNs
and
, respectively,
are the minimum hops between BNs
and
.
This hop distance matching factor can make the weight value assigned to BNs with mismatched distance and hops smaller when calculating hop distance. As depicted in
Figure 1, when calculating the
of BN N, the weights assigned to BNs A, B and C are
where
,
,
are the coordination positions of nodes
and
, respectively,
are the minimum hops between nodes
and
A, nodes
and
B, nodes
and
C, respectively.
Therefore, the
is obtained by Equation (17):
In the same way, the partial derivative of fitness function is calculated and taken as 0.
is calculated as follows:
The deviation between the estimated distance and the true space is small in terms of the
calculated by Equation (19). In addition, this paper introduces the changed exponential value
into Equation (19) above. According to the influence of different values on the positioning error, the best value is selected to apply to the correction of
. Equation (20) is rewritten as follows:
4.3. Correct Coordination Position of UN
In terms of the quantized hops recorded by the UN and the modified , the estimated coordinates of the UN can be obtained. The space between the estimated coordinates and the real coordinates to each BN is different. To lessen the computation, only the distance discrepancy between the estimated coordinates and the real coordinates to the nearest BN of the UN is taken into account. In fact, the distance between the estimated coordinates to the nearest BN of the UN and should be the same as the space between the real coordinates to the nearest BN of the UN, so the estimated coordinates should be correct to meet the reality.
Because RSSI ranging technology can accurately estimate the space between two nodes that are close to each other, the RSSI value is applied to estimate the distance between the UN and the nearest BN, and the distance is regarded as the veritable distance between them.
Assume that the coordinates of A are estimated to be
by using the modified
of UN A and the consecutive hops to each BN, and the distance between the estimated coordinates and the nearest BN B
is
. RSSI ranging technology is used to estimate the distance between A and the nearest BN as
, and whether to correct the estimated coordinates of A is determined by comparing whether
and
are the same. Let the modified coordination be
, and the purpose of the modification is to make the distance from the modified coordination to the nearest BN of A equal to the distance from A to the nearest BN. To modify the estimated coordinates on the line is the best way, and the modified result of the estimated coordinates of node A can be obtained through of Equation (21):
Because DV-Hop location algorithm assumes that the location is carried out in the regular network topology structure, the location error increases in the irregular network structure, while most of the practical applications are irregular network structures. In order to obtain good location accuracy, this paper makes a secondary correction to the UN coordinates obtained. The BN A with the minimum hops originating from the UN is selected, and its coordination position is marked as
. A circle is drawn with UN N and BN A as the center,
,
as the radius, as shown in
Figure 4. where
,
.
The intersection of two circles
,
is determined. The triangle’s centroid obtained by the two intersection points and the BN is the coordination position of the UN. The final UN coordination position is calculated by Equation (22):
5. Simulation Results and Discussion
To evaluate the performance of the proposed algorithm, all experiments are designed to be simulated on the MATLAB platform. In the uniform random network and C-type random network, as depicted in
Figure 5a,b, the nodes are stochastically fixed up in the square area, and the localization deviation is used as the evaluation index of this experiment. We assume that the real coordinates and estimated coordinates of UNs are
respectively, the communication radius is R, the sum of nodes is N, the number of BNs is M, and the localization error is defined as
The proposed algorithms, the algorithm in literature [
21] (Improved DV-Hop1), literature [
22] (Improved DV-Hop2), literature [
23] (Improved DV-Hop3)and DV-Hop algorithm are run:
Figure 5.
(a) Uniform random network; (b) C-type random network.
Figure 5.
(a) Uniform random network; (b) C-type random network.
5.1. Simulation Results for the Uniform Random Network
In a uniform random network environment, 200 UNs are stochastically distributed, the sum of nodes is fixed, the percentage of BNs is 10%, and R of nodes is changed. The traditional DV-Hop is run, improved DV-Hop1, improved DV-Hop2, improved DV-Hop3 and the improved algorithm proposed in this paper are run separately.
Figure 6 depicts the results.
Figure 6 shows that DV-Hop1 only revised the coordination of UNs, DV-Hop2, DV-Hop3 and the new algorithm all revised the minimum hops and
between two nodes, reducing the estimated distance deviation between UNs and BNs, so their localization errors are lower than those of the traditional DV-Hop and DV-Hop1. With communication range R = 15 m, the proposed DV-Hop has an approximate 0.24 R localization error while DV-Hop has an approximate 0.45 R error and DV-Hop1 has an approximate 0.4 R error, and DV-Hop2 and DV-Hop3 also show better performance with approximate 0.25 R and 0.245 R localization errors, respectively. In the uniform network structure environment, the positioning deviation of the new algorithm is slightly higher than that of DV-Hop2 and DV-Hop3, as it corrects the UNs coordinates.
The sum of all nodes is unchanged, R = 15 m, and the proportion of BNs is changed. The four algorithms are then run separately.
Figure 7 depicts the simulation results.
Figure 7 depicts that the localization deviation of the five algorithms lessen when the proportion of BNs aggrandizes, but the localization precision of the new algorithm and the DV-Hop2 and DV-Hop3 is obviously better than that of DV-Hop and DV-Hop1. The average localization errors of DV-Hop2, DV-Hop3 and the proposed DV-Hop are approximately 0.27 R, 0.27 R and 0.26 R, respectively. The errors of DV-Hop and DV-Hop1 are approximately 0.49 R and 0.41 R, respectively. The proposed DV-Hop has the lowest localization error compared to other algorithms for scenario with five anchors.
The number of nodes is 200, 250, 300, 350, 400, with R = 15 m, and the ratio of BNs is 10%. The five algorithms are run separately. The simulation results are shown in
Figure 8.
Figure 8 shows that as the average number of neighbors per node increases (that is, the network density increases), the localization deviation of the five algorithms lessens when the proportion of BNs enlarges. However, the localization precision of the new algorithm and the improved DV-Hop2 and improved DV-Hop3 algorithms is much better than that of DV-Hop and the improved DV-Hop1. The new algorithm depicts the best performance, with the lowest average localization error at approximately 0.21 R. Compared to the improved DV-Hop2 and DV-Hop3, average localization error is lower by approximately 7% and approximately 6%. Compared to the improved DV-Hop1 and DV-Hop, average localization error of the proposed in the paper is lower by approximately 47% and 43%.
5.2. Simulation Results of C-Shaped Random Network
In the C-type random network environment, the sum nodes are kept unchanged and R is changed. The sum of nodes is kept unchanged, the proportion of BNs and the number of nodes are changed, and the proportion of BNs is unchanged. The five positioning algorithms are run. The simulation results are shown in
Figure 9,
Figure 10 and
Figure 11. The figures show that in the non-uniform network environment, the positioning deviation of DV-Hop and the improved DV-Hop2, DV-Hop3 is larger than that in the uniform network environment. However, since the new algorithm and the improved DV-Hop1 have modified the coordinates of UNs, it can still be effectively located in the non-uniform network. Compared to the improved DV-Hop2 and DV-Hop3, average localization error is lower by approximately 60% and approximately 51%. Compared to the improved DV-Hop1 and DV-Hop, average localization error of the one proposed in the paper is lower by approximately 68% and 44%.
5.3. Comparison of Energy Utilization Efficiency of Algorithms
When the simulation time of the five algorithms is the same, the comparison of total energy consumption is shown in
Figure 12. It can be seen from the figure that the energy consumption of the algorithm proposed in this paper is slightly higher than that of the other three algorithms, but it is not very obvious. This is due to the fact that in the positioning process, the improved algorithm optimizes the hops and the average distance per hop and corrects the coordinate position of unknown node twice, which constitutes part of the energy consumption. In wireless sensor networks with limited energy, it is of great significance to achieve higher positioning accuracy with little energy consumption.
6. Conclusions
DV-Hop has low localization precision. Because the hop number of 1 has the greatest impact on node location, the new DV-Hop put forward in this paper hierarchically processes the hop number of 1 to make it closer to the actual hop number. In addition, DV-Hop uses unbiased estimation to calculate the jump distance. When the overall error is minimized, it fails to minimize various errors. Therefore, this paper uses the square error function as the fitness function to solve the jump distance, and the original algorithm does not consider the matching relationship between the hops and the distance in the process of calculating of the BN, which introduces more errors. Therefore, the hop distance matching factor is proposed to weigh the fitness of each BN and introduce the change index value, so as to obtain more accurate , which effectively improves the localization precision of the algorithm. Finally, the UNs can still be located effectively in the irregular network by modifying their estimated positions twice.