Application of a WiFi/Geomagnetic Combined Positioning Method in a Single Access Point Environment

Because of the particularity of urban underground pipe corridor environment, the distribution of wireless access points is sparse. It causes great interference to a single WiFi positioning method or geomagnetic method. In order to meet the positioning needs of daily inspection sta ﬀ , this paper proposes a WiFi/geomagnetic combined positioning method. In this combination method, ﬁ rstly, the collected WiFi strength data was ﬁ ltered by outlier detection method. Then, the ﬁ ltered data set was used to construct the o ﬄ ine ﬁ ngerprint database. In the following positioning operation, the classical k -nearest neighbor algorithm was ﬁ rstly used for preliminary positioning. Then, a standard circle was constructed based on the points obtained by the algorithm and the actual coordinate points. The diameter of the standard circle was the error, and the geomagnetic data were used for more accurate positioning in this circle. The method reduced the WiFi mismatch rate caused by multipath e ﬀ ects and improved positioning accuracy. Finally, a positioning accuracy experiment was performed in a single AP distribution environment that simulates a pipe corridor environment. The results proves that the WiFi/geomagnetic combined positioning method proposed in this paper is superior to the traditional WiFi and geomagnetic positioning methods in terms of positioning accuracy.


Introduction
With the development of the mobile Internet and the innovation of location-based services, the market potential and application prospects of positioning technology are selfevident. Today, as the information society is gradually deepening and applications related to intelligent control are becoming more widespread, location services are also beginning to seize more markets. In such an industry environment, positioning technology not only meets basic positioning and navigation requirements but also brings huge changes to more scenarios. According to the application of positioning technology, the projects under construction and completed projects of the domestic integrated pipeline gallery can be divided into passive personnel positioning based on online patrol [1], personnel positioning based on WiFi [2], personnel positioning based on UWB (ultrawide band) technology [3], personnel positioning based on RFID (radio frequency identification) technology [4], and personnel positioning based on Bluetooth technology [5]. Among them, WiFi-based fingerprint positioning has been the most widely used due to its low cost, multiuser accessibility, wide coverage, high transmission rate, and strong anti-interference ability.
In the operation and maintenance management of urban underground comprehensive pipe corridors, there are multiple types of work and multiprocess construction operations and inspections. From a safety point of view, due to poor air circulation and complex working conditions in the underground pipe gallery, there is a certain degree of danger. When an emergency occurs, the backstage needs to quickly calibrate the location of personnel for rescue; from the perspective of operation and maintenance management requirements, carry out personnel attendance, real-time tracking and positioning, optimizing deployment, optimizing inspection routes, and appraisal of inspection effects. Among these requirements, the personnel positioning system mentioned is an important part of operation and maintenance management.
However, the main structure of the urban underground integrated pipe gallery is located underground, and operator's mobile phone signals and GPS (global positioning system) satellite positioning signals cannot be received in the pipe gallery. Therefore, a dedicated indoor positioning system needs to be installed in the gallery. And each zone is distributed with three or four wireless AP (access point), and the interval is about 50 m, so when the AP distribution is relatively sparse, the equipment of the staff in the corridor cannot guarantee to receive the signal strength values of three or more APs at the same time. The AP distribution and signal strength distribution in the corridor are shown in Figure 1 at the same time.
Aiming at the sparse distribution of underground wireless access points, Song and Qian put forward an improved positioning method of virtual wireless access points in their paper [6]. This method can solve the weak correlation problem of the received signal strength collected by traditional virtual wireless access points and improve the accuracy of positioning. Keser et al. proposed an F-score-weighted indoor position algorithm [7] integrating WiFi and magnetic field fingerprints in their paper. In the proposed approach, the positioning is first performed by maximum likelihood estimation for both WiFi-RSS and magnetic field signal values to calculate the F-score of each signal type. Then, each signal type is combined using F-score values as a weight to estimate a position. This method not only improves the positioning accuracy but also consolidates the performance of the system. Arshra et al. proposed a fingerprint location method based on AP coverage area [8]. This method mainly proposed the uniqueness of a single AP coverage area and the concept of overlap of multiple AP coverage areas. The distribution of overlapping coverage areas is used to distinguish whether the target node is in the coverage area of a single AP or in the overlapping coverage area of multiple APs; the position estimation in his article is based on the relative position of the target node coverage area solving the wireless problem when APs are sparsely distributed in a small area. Liu et al. proposed a positioning method combining indoor geomagnetic map (IMM) in their paper [9]. First, an Euclidean distance constraint (EDC) with a variable search radius is proposed to estimate the location of the entity, then an iterative interpolation method (IIM) is proposed to refine the IMM, and a multimagnetic fingerprint fusion (MMFF) is proposed to match the magnetic fingerprints based on the refined local IMM. Zheng et al. proposed an indoor magnetic positioning method using multiple magnetic beacons to achieve indoor positioning based on fingerprint and confidence evaluation in their paper [10]. In the paper [11], David et al. analyzed the influence of height on indoor positioning of magnetic field and concluded that the positioning trajectory error of the same height was lower.
For the situation that a single WiFi location method and a single geomagnetic location method cannot achieve good positioning effect in the sparse wireless access point environment, Xu et al. proposed a global dynamic fusion location algorithm for multiple classifiers based on WiFi and geomagnetic fingerprints in their paper [12]. Ji et al. presented their commercially adopted end-to-end geomagnetic sensing-based solution including a cost-effective measurement methodology to collect geomagnetic field signals, an online calibration technique to address sensor distortion and diversity issues, and an online motion identification technique to resolve issues of motion dynamics [13]. Zhou et al. designed a new hybrid hypothesis test based on the idea of asymptotic relative efficiency (ARE) exploiting signal distributions by considering different access point (AP) contributions to the Wi-Fi indoor localization accuracy [14]. Alhomayani and Mahoor presented a convolutional neural network-based method for designing and developing a novel smartwatch-based indoor geomagnetic field positioning system [15]; the positioning accuracy is further improved. On the basis of the above paper, we proposed a positioning method combining WiFi and geomagnetic field.
The contributions of this paper are as follows: (1) Based on the requirements of the urban underground integrated pipe gallery environment and the inspection requirements of the pipe gallery, a WiFi/geomagnetic combined positioning method has been proposed. The WiFi signal strength value after outlier detection and screening has been used to constrain the geomagnetic fingerprint for combined matching and positioning, which has reduced the WiFi mismatch rate caused by the multipath effect has improved the positioning accuracy (2) The positioning accuracy experiment was carried out in a single AP distribution environment simulating a pipe gallery environment. The performance of the proposed method, the traditional WiFi, and the traditional geomagnetic positioning method were evaluated from the two indexes of average error and error cumulative distribution probability. The results showed that the WiFi/geomagnetic combined positioning method in this paper was superior to the traditional WiFi and geomagnetic positioning method in the two indexes of average error and error cumulative distribution probability The structure of this article is as follows: the first section introduces the current mainstream indoor positioning technology, introduces the environment of the urban underground comprehensive pipe gallery and the requirements for staff inspections, and introduces the innovations of this article. The second section introduces the WiFi/geomagnetic combined positioning method proposed in this paper in detail. The third section introduces the experimental part and conducts positioning accuracy experiments in a single AP distribution environment. The fourth section is the summary part, summarizing the content of this article. Due to the dense environment and propagation effects such as reflection, diffraction, and scattering. It is difficult to predict the signal changes transmitted indoors. The multipath fading effect causes the received signal to fluctuate around an average value at a specific location. The received signal is usually modeled by a combination of large-scale attenuation and small-scale attenuation effects. Large-scale attenuation is due to the attenuation that occurs when the signal travels a distance and is absorbed by walls and floors to reach the receiving terminal. It predicts the mean value of RSSI (received signal strength indicator) and usually has a lognormal distribution. The small-scale attenuation explains the fluctuations due to multipath attenuation. If there is no line-of-sight component, small-scale attenuation is usually modeled by Rayleigh distribution (Rayleigh). Such a scene is called non-line-of-sight. The probability density of Rayleigh distribution is as shown in Equation (1), where σ 2 is the multipath signal component power; if there is a lineof-sight component, the rice distribution is usually used to model. The probability density of the rice distribution is shown in Equation (2), where R is the sine (cosine) signal plus the narrowband Gaussian random signal envelope, parameter A is the peak value of the amplitude of the main signal, and I 0 ðÞ is a modified 0th-order Bessel function of the first kind.
Due to the complex indoor environment, the RSSI at a specific location is not fixed, but fluctuates around its average value. According to the wireless signal propagation attenuation model, the average signal strength is determined by the distance from the collection point to the AP, and the fluctuation range is determined by environmental interference factors expressed by the RSSI standard deviation. This article collected 300 RSSI samples for a fixed AP in line-ofsight and non-line-of-sight conditions and used histogram statistics to describe its probability distribution (as shown in Figures 2 and 3).
It could be seen that although RSSI has some left-biased characteristics in the WiFi environment, it can be roughly regarded as a normal distribution. Compared some parameters of RSSI under the condition of line of sight and nonline-of-sight, the results were shown in Table 1.

Wireless Communications and Mobile Computing
It could be seen that the RSSI fluctuates more, and the average signal was weaker in the case of non-line-of-sight. Although the average signal strength in the line-of-sight range was greater, it was still unstable, and the overall distribution was normal. When data was collected in real time, there would be a data jump point differing from other points in the same location. Based on this, it was necessary to set corresponding constraints to detect outliers in the collected data, the signal strength value of the point to be measured, and the true value of the signal strength of the point should be less than a threshold.
Among them, T i is the real-time measured WiFi signal strength value of the ith test point; M i is the true signal strength value at that point; this value was obtained by averaging the 20 WiFi signal strength values measured at this point without abnormality (referring to the absence of large signal fluctuations and human interference); G is the measurement threshold, generally three to five dBm, and this article used five dBm.
The actual collection of data is shown in Figure 4. The real signal strength value of this point was -42.9 dBm. After outlier detection was performed, the three points marked by the arrow were eliminated improving the accuracy of WiFi data collection.
The WiFi received signal strength value after the outlier detection processing and the location coordinates of the current point were combined to form a WiFi location fingerprint, and the location fingerprint of the ith point was expressed as: Among them, X i is the abscissa of the real position of the ith point, Y i is the ordinate of the real position of the ith point, and Rssi is the WiFi fingerprint preprocessed by the ith reference point.

Geomagnetic Field Strength
Data. The distribution of the strength of earth's magnetic field is regular under normal circumstances, but in buildings containing reinforced concrete, the original geomagnetic field will be disturbed by metal materials and be distorted, so that a unique geomagnetic field pattern is formed in the building. In this way, the geomagnetic intensity in the indoor space has particularity. When there are no dynamically changing metal objects or charged objects in the indoor environment, the distribution characteristics of the indoor magnetic field strength are basically stable. Indoor geomagnetic fingerprint matching uses the stable characteristics of geomagnetic fingerprints and estimates the final positioning coordinates through the difference of geomagnetic intensity at different geographic locations in indoor space.
Generally, the geomagnetic intensity vector is threedimensional, including components in three directions: geographic north, geographic east, and pointing to the center of the earth. The geomagnetic intensity of the three directions could be combined according to Equation (5), and the total geomagnetism strength of the location can be solved.
Among them, G x , G y , and G z respectively, represent the components of the geomagnetic vector intensity in the north, east, and perpendicular to the center of the earth. In this article, an application developed by a smart phone was used to collect the geomagnetic vector intensity in three directions.
Among them, L and M, respectively, represent the number of marked reference points and the number of APs arranged in the indoor environment; ðRSS i,1 , RSS i,2 , ⋯RS S i,M Þ represents the RSS mean sample of the ith reference point in the location fingerprint; ðrss 1 , rss 2 , ⋯, rss M Þ represents the RSS mean sample from Mth APs measured online; D q,i indicates the RSS distance between the online collection and offline reference point RSS average samples. Among them, q takes two, which means Euclidean distance.
After calculating the L RSS distances, arrange them in ascending order. The smaller the RSS distance between two RSS samples, the more similar they are. Therefore, the reference points corresponding to the first K minimum RSS distances are selected, and the average value of the position coordinates of these reference points is calculated as user's positioning coordinates: Among them, loc i indicates the position coordinates of the selected neighboring reference point; D i ∈ fMIN KðD 1 , ⋯, D L Þg represents the set of minimum K RSS distances; ð x, yÞ represents positioning coordinates. In this article, both WiFi fingerprints and geomagnetic fingerprints are matched according to the K-nearest neighbor method to obtain the final positioning coordinates.

WiFi/Geomagnetic Combined Positioning Method.
Due to the characteristics of WiFi fingerprints and geomagnetic fingerprints, this paper designed a combined positioning method that used WiFi positioning errors to constrain geomagnetic positioning matching positioning. This method could not only reduce the calculation amount of magnetic field matching but also reduce the mismatch rate of the entire positioning algorithm and improve the position accuracy. The schematic diagram of WiFi/geomagnetic combined positioning is shown in Figure 5. As shown in Figure 5, even though the entire environment was in a magnetic field, the magnetic field fingerprint matching range was limited to the circle S formed by the WiFi positioning point and the real coordinate point. The purpose of this method was to reduce the datasets that need fingerprint matching when using conventional methods for positioning and to reduce the range to the circle where S is located, instead of using every data in the datasets when carrying out matching positioning each time. The diameter of this circle is the positioning error, where Pos_WiFi is the coordinates of the WiFi location fingerprint positioning, Pos_Truth is the real coordinate position, and Err_WiFi is the positioning error caused by WiFi fingerprint positioning. S is the circular area formed by the real coordinate point, the positioning point, and the error diameter. Geomagnetic fingerprint points outside this area were not used as reference points for geomagnetic matching, and geomagnetic fingerprint matching was performed at reference points within S as the final positioning result.
As shown in Equation (8), Pos represents the final positioning result, and Fin mag i represents the magnetic fingerprint point. KNNfFin mag i ∈ Sg indicates that the K-nearest neighbor method is used to match n geomagnetic fingerprints in the S area. Finally, K points with the nearest Euclidean distance were selected to take the average value as the final positioning coordinates of the combined positioning method.
So, the complete algorithm positioning process is shown in Figure 6.
As shown in Figure 6, the specific steps of the combined indoor positioning method mentioned in this paper were as follows: firstly, WiFi fingerprint information was collected through the self-developed mobile phone application and was stored in the database on the server. At this time, the fingerprint information was filtered by the outlier detection method. In the following positioning operation, the classical K-nearest neighbor algorithm was firstly used for preliminary positioning. Then, a standard circle was constructed based on the points obtained by the algorithm and the actual  Wireless Communications and Mobile Computing coordinate points. The diameter of the standard circle was the error, and the geomagnetic data were used for more accurate positioning in this circle. After the double positioning operation, the final positioning coordinate was obtained, that was the positioning coordinate obtained by using the combined positioning method.

Experimental Part
3.1. Introduction to the Experimental Environment. The experiment scene was selected in the laboratory and corridor environment of the teaching building, with a total area of 6:9 × 8:37 m 2 , including a laboratory environment of 6:9 × 6:27 m 2 and a corridor environment of 6:9 × 2:1 m 2 . A total of one wireless AP was placed to simulate the urban integrated corridor. The wireless WiFi signal environment was shown in Figure 7. The indoor was divided into a grid of 0:95 × 0:9 m 2 , and the corridor was divided into a grid of 0:8 × 0:8 m 2 . The smartphone was used to collect the WiFi fingerprint and geomagnetic fingerprint information of the reference point and the location information.
The walking route was first walked from point A to point B, then to point D; then, started from point C, walked to point D, walked from point D to point E to point F; the whole route included the laboratory and the corridor class environment, including line-of-sight and non-line-of-sight situations. Among them, the area where points A, B, C, and D located was the laboratory room and the range of visual range. However, E and F were in the laboratory corridor environment and belonged to the non-line-of-sight range.
In the offline collection phase, use the APP developed by the smartphone to collect the WiFi fingerprint information, geomagnetic fingerprint information, and location information of the reference point and store them in the server. At the same time, in order to ensure the rigor of the experiment, all kinds of information collection devices were hand-held, at a height of 1.5 m, and were collected in the same position towards the same direction reducing the influence of height or orientation on positioning error; in the online positioning phase, the WiFi received signal strength and geomagnetic values collected in real time were sent the server which executes the combined positioning algorithm to obtain the final positioning coordinates.

Positioning Performance Analysis.
In the above experimental scenarios, traditional WiFi positioning, traditional geomagnetic positioning, and the WiFi/geomagnetic combined positioning method described in this article were used to conduct positioning accuracy experiments. The average error distribution of the experiment is shown in Figure 8. In this paper, a total of 27 test points were selected in the experimental environment to compare the positioning errors of each method. Among them, 18 test points were located in the line-of-sight environment, and nine test points were located in the non-line-of-sight environment to meet the positioning requirements in different environments. It could be seen from the figure that the traditional geomagnetic positioning method had the worst accuracy. The   Wireless Communications and Mobile Computing accuracy of traditional WiFi positioning method was higher than that of traditional geomagnetic method. The WiFi/geomagnetic combination method described in this article had the best positioning accuracy.
The average error of the three methods is shown in Table 2.
It could be seen from the table that the average error of the traditional WiFi positioning method was 1.79 m, while the average error of the traditional geomagnetic positioning method was 2.9 m. The average error of the WiFi/geomagnetic combined positioning method described in this article was 0.83 m being less than traditional WiFi and traditional geomagnetic positioning. The average error was reduced by 53.6% and 71.4%, respectively, compared with traditional WiFi and traditional geomagnetic positioning methods.
At the same time, three methods of positioning error of the cumulative probability contrast diagram is shown in Figure 9; the figure shows that the combination of WiFi/geomagnetic localization algorithm was a 72% chance of within one meter. At the same accuracy, the probability of a single WiFi positioning algorithm was only 34%, and the probability of a single geomagnetic location algorithm was only 10%. Therefore, the proposed algorithm performance compared with traditional WiFi or geomagnetic localization algorithm was improved.

Conclusions
Aiming at the sparseness of AP distribution in urban underground pipe corridors, that is, the indoor positioning of the coverage of a single AP, because the WiFi location fingerprint single positioning technology is easily affected by factors such as multipath effects, make the received signal strength fingerprint not unique. So, this paper proposed that a WiFi/geomagnetic combined positioning method used the WiFi signal strength value after outlier detection and screened to constrain the geomagnetic fingerprint for combined positioning improving the positioning accuracy.

Wireless Communications and Mobile Computing
The positioning experiment was carried out in a single AP experimental environment simulating a pipe gallery and compared with the traditional WiFi positioning method and geomagnetic positioning method. The results show that the average error of the WiFi/geomagnetic combined positioning method described in this article was 0.83 m, which was more traditional; the average error of WiFi and traditional geomagnetic positioning methods increased by 53.6% and 71.4%, respectively. The error cumulative probability distribution comparison shows that the combined positioning method mentioned in this paper had a 72% probability within one meter, while the WiFi positioning algorithm alone had only a 34% probability, and the geomagnetic positioning algorithm alone had only a 10% probability under the same accuracy. Therefore, the performance of the combined positioning method described in this paper was better than that of the traditional WiFi or geomagnetic positioning methods.

Data Availability
The raw/processed data required to reproduce these findings cannot be shared at this time as the data also forms part of an ongoing study.