[0031] In the result,
[0032] σ = 1 n - 1 X i = 1 n ( RSSI i - 1 n X i = 1 n RSSI i ) 2
[0033] μ = 1 n X i = 1 n RSSI i - - - ( 3 )
[0034] In the laboratory, through the CC2431 positioning kit introduced above, experiment with the different distances between 6 reference nodes and one positioning node, and record 100 sets of RSSI values at each positioning point. Filter processing through the two methods described above, and finally compare which filter is better. The details are shown in Table 1. From Table 1, it can be seen that the Gaussian filtering effect is better in the filter selection. The RSSI measured value after filtering is relatively smooth, which solves the random jitter problem of the RSSI value affected by the environment to a certain extent.
[0035] Table 1
[0036]
[0037]
[0038] The RSSI value is stored in the non-volatile memory of the CC2431 chip, and the data can be obtained directly from the BUF of the register. The LQI value reflects the connection quality, which is obtained through the structure in the positioning system protocol stack. The LQI value is directly proportional to the quality of the signal connection. The larger the value, the better the channel connection quality. In the CC2431 solution, both the RSSI value and LQI value can reflect the impact of environmental factors on indoor wireless signal attenuation. The distance calculated by the single RSSI value and the coordinates obtained by the positioning engine are actually not accurate, so this method obtains the relationship with the distance d by collecting multiple sets of LQI values, and finally completes the assistance of the RSSI value through dynamic optimization Positioning. Using matlab simulation software, the least squares curve fitting method is used to obtain the relationship between the LQI value and the distance d between the measured nodes. The way to collect the LQI value here is the same as the way to collect the RSSI, but the place to extract the corresponding value is different, one is in the hardware register, and the other is in the data packet of the software protocol stack. Also record the distances from multiple positioning nodes to the reference node and the corresponding LQI values to form multiple key-value pairs {(d1,LQI1)(d2,LQI2)(d3,LQI3)...(dn,LQIn)}. According to the data of these key-value pairs, the relationship curve between LQI and distance d in the actual environment can be obtained, such as image 3 Shown.
[0039] In the matlab simulation environment, these obtained LQI values can be subjected to the 3rd power curve fitting and 5th power curve fitting of the least square method. The curve fitting diagram is as follows image 3 Shown. It can be seen from the figure that the effect of 5th power curve fitting is better. Therefore, this embodiment adopts the 5th power least square curve fitting formula as the algorithm of the LQI value. Among them, the dynamic range of LQI is higher than that of RSSI.
[0040] LQI(d)=p 3 d 3 +p 2 d 2 +p 1 d+p 0 (4)
[0041] Where p 0 =172.15, p 1 = -4.6778, p 2 = 0.7417, p 3 = -0.03068,
[0042] LQI(d)=p 5 d 5 +p 4 d 4 +p 3 d 3 +p 2 d 2 +p 1 d+p 0 (5)
[0043] Where p 0 = 169.4996, p 1 = -1.4184, p 2 =0.0273, p 3 = -0.002, p 4 =0.000074p 5 = -0.0000048.
[0044] Since polynomials solve the LQI value at a certain distance, there are many situations, so there are cases where the value of the code is not accurate. The RSSI and LQI also have a certain relationship, and the relationship is shown in formula (6).
[0045] RSSI=-(81-(LQI×91)/255) (6)
[0046] Then, through the estimation fitting method, the LQI value is fitted into a logarithmic curve close to the fifth-order polynomial, and the relationship between LQI and distance d is obtained as shown in formula (7).
[0047] LQI(d 2 )=172.3348-28.5536lg(d 2 ) (7)
[0048] After the above processing, the code implementation will greatly reduce the calculation process of the distance between nodes. In addition, the slope of the polynomial curve of the fifth degree fit can be obtained by derivation, and the accurate LQI value can be obtained by comparing the slopes. In this way, two different positioning methods, RSSI or LQI, can be adopted at different distances, and the most suitable algorithm can be used to calculate the distance value closer to the real measurement, thereby solving the problem that the actual measurement value deviates from the theory after the actual distance exceeds 5 meters. Too many curves cause the problem of excessive ranging error.
[0049] The present invention uses two positioning algorithms to obtain the distance from the positioning node to the reference node, and the RSSI value and the LQI value of the two methods have a certain linear relationship. Therefore, a dynamic weighting method is proposed to improve the accuracy of ranging. The distance between the nodes in the laboratory environment is within 5 meters, and the attenuation of the RSSI value conforms to the theoretical model, so the distance obtained by the RSSI value is used, and the measured distance between the reference node and the positioning point obtained by simplifying the model d 1 more precise. Similarly, the distance between two points measured by LQI is d 2. Through the dynamic optimization of the obtained distance, the accuracy of distance measurement between nodes is improved. The method is mainly to perform weighting, and the weighting method is shown in formula (8).
[0050] d=α 1 d 1 +α 2 d 2 (8)
[0051] Considering the environmental factors of the laboratory and the results of previous experiments, a threshold value of 5 meters is selected. When|d 1 -d 2 |≤4m, the LQI value needs to be corrected at this time, and its own jitter change value ΔLQI is added to it, and then d is calculated by the corrected value 2 And bring it into the weighting calculation above. When|d 1 -d 2 |>4m, the RSSI value needs to be corrected at this time, add its own jitter change value ΔRSSI, and then calculate d from the corrected value 1 And bring into the above weighting calculation. The choice of different environmental weight values will also affect the positioning results. In this embodiment, when the distance between the reference node and the positioning node is less than 5 meters, d 1 The weight coefficient of is 0.8, d 2 The weight coefficient of is 0.2, when the distance between the reference node and the positioning node is greater than 5 meters, the opposite is true. Since this method involves the correction of jitter before and after the RSSI and LQI values, it has a better effect than general dynamic weighting.
[0052] Through the introduction of the previous algorithm improvement, the positioning platform using the CC2431 solution has completed three different ways of obtaining the ranging error after the improved algorithm. They are the ranging error based on the RSSI algorithm, the ranging error based on the LQI algorithm and the ranging error of the RSSI+LQI hybrid positioning algorithm. After extracting the improved algorithm, the average ranging error of 16 test points under different algorithms is compared, and the result is as follows Figure 4 Shown.
[0053] Because the attenuation model based on the wireless signal is selected in this embodiment, the RSSI value is mainly collected, and because the signal value has a certain amount of jitter at the same sampling point, a large distance error is finally caused. Analysis, using Gaussian filtering method to filter the RSSI value. The RSSI value after Gaussian filtering becomes smoother, which can solve the problem of excessive jitter range of the RSSI value at the test point and increase the ranging error, thereby indirectly improving the positioning accuracy. In addition, the CC2431 solution is selected in this embodiment. The hardware system's built-in positioning algorithm in the solution only has the RSSI value to complete the positioning algorithm. The positioning effect is not good, and the link quality LQI and RSSI are in a linear relationship while also complying with The relationship between the attenuation of the distance and the distance, so the LQI-assisted positioning algorithm supported by multi-variables is used, and a curve fitting method is used to find a relationship formula that is more consistent with the LQI value and the distance in the real environment. At the same time, the dynamic weighting method is used to optimize the measured The distance between the two points makes up for the inaccurate ranging accuracy of the RSSI value positioning algorithm when the actual distance is greater than 5 meters, and further reduces the ranging error, thereby improving the overall positioning accuracy.
[0054] by Figure 4 Comparing the experimental data of the test points in the middle, it can be concluded that the average ranging error obtained using only the RSSI value is about 2.5 meters, and the average ranging error obtained only using the LQI value is about 3.5 meters. The average ranging error obtained by the hybrid positioning algorithm of the model is about 1 meter, which greatly improves the accuracy of ranging. The obtained distance is closest to the actual ranging value, which solves the problem of real environment to a certain extent. The measured distance error is too large, so that the positioning accuracy of the entire positioning system has been greatly improved to meet more indoor positioning application research.
[0055] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that it can be combined in form and Various changes are made to the details without departing from the scope defined by the claims of the present invention.