Indoor localization based on hybrid Wi-Fi hotspots

Most existing indoor localization algorithms based on Wi-Fi signals mainly rely on wireless access points (APs), i.e. hotspots, with fixed deployment, which are easily affected by the non-line of sight (NLOS) factors and the multipath effect. There also exist many other problems, such as positioning stability and blind spots, which can cause decline in positioning accuracy at certain positions, or even failure of positioning. However, it will increase the hardware cost by adding more static APs; if the localization mechanism integrates different wireless signals is adopted, it tends to cause high cost of positioning and long complex positioning process, etc. In this paper, we proposed a novel hybrid Wi-Fi access point-based localization algorithm (HAPLA), which utilizes the received signal strength indications (RSSI) from static APs and dynamic APs to determine location scenes. It flexibly selects available AP signals and dynamically switches the positioning methods, thus to achieve efficient positioning. HAPLA only relies on the Wi-Fi signal strength values, which can reduce the cost of hardware and the complexity of localization system. The proposed method can also be able to effectively prevent interference from different signal sources. In our test scenario, we deployed typical indoor scenes with the NLOS factors and the multipath effect for experiments. The experiments demonstrate the effectiveness of proposed method and the results show that, compared with the classic K nearest neighbor-based location algorithm (KNN) and the variance-based fingerprint distance adjustment algorithm (VFDA), HAPLA has better adaptability and higher positioning accuracy, and can effectively solve the problem of positioning blind spots.


I. INTRODUCTION
The location based services (LBS) have attracted wide attention and concern from the researchers, and how to achieve efficient and accurate positioning is the key point in current research. The localization technologies can be divided into two types: the outdoor localization and the indoor localization. So far, the global positioning system (GPS) [1][2][3] is commonly used in outdoor localization. However, it is difficult for GPS to provide satisfactory indoor positioning services [4]. At present, the localization methods based on wireless fidelity, infrared beam, Bluetooth, radio frequency identification (RFID) and sensor are mainly used in the indoor environment.
The Wi-Fi access points (APs) are widely deployed at various indoor locations, and the smart phones, tablets, laptops as well as other mobile terminals are also generally equipped with wireless transceiver modules which can receive Wi-Fi signals. Compared with the location methods based on infrared beam, Bluetooth and other wireless technologies, the method based on Wi-Fi signals has significant advantages, including wider range, higher stability, and no requirements for additional hardware devices or transformation of infrastructure, etc. [5]. At present, the algorithms widely used in the field of indoor location based on Wi-Fi include the angle of arrival localization algorithm (AOA), the time of arrival localization algorithm (TOA), the time difference of arrival localization algorithm (TDOA), the received signal strength indication localization algorithm (RSSI), the fingerprint-based localization algorithm, and so on [6][7][8][9][10][11][12][13].
However, existing indoor localization algorithms based on Wi-Fi signals significantly rely on APs with fixed deployment (i.e. static APs), and there are still many problems needed to be solved. For example, the signal propagation is easily affected by doors, furniture and other obstacles as well as human activities, which will cause problems like reflection, refraction, etc., due to the non-line of sight (NLOS) factors, the multipath effect and so on. Moreover, other indoor wireless signals and electromagnetic interferences can also affect the positioning accuracy [5]. To carry out fingerprint-based localization or other similar algorithms, based on RSSI and other techniques, it has strict requirements of the number of APs and their locations. Either too many or too few APs maybe affect the positioning accuracy. In some cases, the indoor environment could be too large, where localization based on fingerprints cannot be proceeded [14]. For example, the positioning premise of indoor localization algorithms based on fingerprints is that it must be able to receive no less than 4 specified intensity values of AP signals in the area where the location is going to be measured, because the positioning accuracy mainly relies on the number of APs operating during the localization phase, and the positioning results will have smaller errors when the same number of APs are used in both off-line and localization phases. In the actual localization phase, if the positioning region is larger, or static APs are failed, the location to be measured cannot obtain desired intensity values of AP signals at all, which results in that currently obtained number of AP used to locate will be insufficient for the fingerprint-based localization. Therefore, the positioning accuracy of algorithms will decline significantly, and may even be unable to complete the localization. On the other hand, more static APs will increase the cost of hardware, which cannot even be achieved in some circumstances.
To solve the above problems, researchers have proposed different approaches based on data fusion, including: combining the positioning algorithms of WLAN channel propagation model and the intensity value of RSSI signals to achieve indoor fingerprint-based localization [15]; integrating positioning methods of the Ultra-Wideband (UWB) with the differential global positioning system (DGPS) [16]; the AOA/TDOA-based hybrid localization algorithm [17]; the collaborative indoor localization method based on Wi-Fi and Bluetooth [18]; the indoor localization system based on RSSI and low power Bluetooth [19]; the real-time indoor localization mechanism based on RFID and Bluetooth [20]; the indoor localization system based on the combination of inertial sensors and Wi-Fi [21]; the comprehensive pedestrian and indoor localization system of Wi-Fi and geomagnetic information [22]; the indoor localization mechanism based on the data fusion of multi-sensors [23]; the hybrid indoor localization system based on multi-sensors, Wi-Fi and Low Energy Bluetooth (BLE)_ [24]; the hybrid indoor localization based on wireless signals, multi-sensors and video data [25], etc. In brief, these hybrid localization algorithms usually need to rely on a variety of sensors and different types of wireless signals to improve the positioning accuracy, which have the defects of high cost, long process of localization and difficulties of positioning and deployment, etc.
During specific investigation of indoor environments where the localization is conducted based on the intensity values of wireless signals, the relative positions of static APs are fixed. Moreover, many mobile terminals with the function of Wi-Fi hotspot (i.e. mobile terminals can be dynamic APs.) are also distributed in indoor environments, and the channel transmission of Wi-Fi and APs are both consistent with the WLAN channel transmission model. We can receive relevant information of the surrounding APs while opening the Wi-Fi sensor of terminals to scan the AP signals. In addition to obtaining RSSIs used in fingerprint-based localization, we can also obtain signal parameters of other APs, such as basic service set identifier (BSSID), service set identifier (SSID) and channel [26] etc. When the mobile terminal opens the hotspot function, the current mobile terminal can also serve as a dynamic AP, which also has a unique BSSID and the signal intensity values of RSSI and SSID.
In accordance with the scenarios mentioned above, a hybrid Wi-Fi access point-based localization algorithm (HAPLA) is proposed in this work. Based on the function of hotspot equipped on the mobile terminals, the target terminals to be located can determine the localization and flexibly choose available AP signals to switch positioning methods according to the RSSIs received from the static and dynamic APs to achieve efficient hybrid localization. HAPLA is only based on the values of Wi-Fi signals, without using other wireless positioning signals, which can reduce the hardware costs and the complexity of localization. It can also effectively prevent different positioning signal sources from interfering with each other during the process of localization.

II. RELATED WORKS
The localization algorithm proposed in [15] combines the WLAN channel propagation model with the intensity values of RSSI signals to achieve indoor fingerprint-based localization. The wireless channel model for indoor propagation is based on WLAN, and considering the relation between the intensity and distance in signal propagation and the loss of RSSI generated by the multipath effect and NLOS in the propagation process, it does not need to carry out the collection for the off-line fingerprint database, and it can also adapt to the changes of positioning regions soon. However, the computation is complex and the positioning error is larger in this model; it uses the fingerprint localization for the off-line collection of RSSI and collects data for the establishment of the fingerprint database of signal intensity, the physical location and intensity values of each AP for the periodic signal are corresponded to the coordinate. But the labor and time cost in the off-line phase can be very high, and the fingerprint-based localization database needs to be rebuilt when the network environment changes.
The UWB signal can handle the multipath effect well, and the positioning technology based on UWB can achieve higher positioning accuracy and real-time performance. Reference [16] proposed a positioning technology combining UWB and DGPS, which uses a mixture of the particle filter and the Savitzky-Golay filter to achieve the integration of multi-signal sources, and it can realize the seamless positioning switch between indoor and outdoor environments. Reference [17] proposes applying the smart antenna array to ensure that the service base can provide more accurate wireless signal AOA measurements of mobile terminals, which can also improve the TDOA, and it also proposes an AOA/TDOA hybrid poisoning algorithm, which achieves better positioning performance when AOA measurements reach a certain precision. Reference [18] proposes a collaborative indoor positioning method based on Wi-Fi and Bluetooth, which calculates the position coordinates of neighbor mobile devices as well as the distance between them, and then uses a spring model to correct the positioning errors. Reference [19] constructs an indoor localization system based on RSSI and low power Bluetooth, and proposes a dilatation algorithm with low complexity and easy implementation based on hardware, and this system has better positioning performance in a multi-node deployment. Reference [20] proposes a real-time indoor localization mechanism based on RFID and Bluetooth, two or more tags with radio frequency identification source are deployed on the walls in an indoor room with a single door, then the indoor positioning device can be held with hand to match the Bluetooth ID on RFID readers, and after that, it connects with corresponding RFID to achieve localization. Reference [21] proposes an indoor localization system based on the integration of inertial sensors and Wi-Fi, which can achieve better positioning performance by installing inertial sensors on the foot of users and continue to modify the accumulated errors of inertial navigation system. Reference [22] proposes the comprehensive pedestrian and indoor localization system of Wi-Fi and geomagnetic information to achieve high accuracy of indoor positioning. Reference [23] proposes an indoor localization method based on signal data fusion of multiple sensors to achieve higher positioning accuracy and better robustness. Reference [24] combines the three-dimensional accelerometer, the gyroscope, the magnetic field sensor, Wi-Fi and low power Bluetooth to achieve hybrid indoor localization. Reference [25] proposes a data fusion algorithm based on particle filters, combining wireless signals, videos and sensors together to achieve accurate indoor localization.
In this work, we integrate and optimize the methods mentioned above, and choose the suitable model of signal propagation to establish the fingerprint database. Then, we measure related reference points at certain locations according to the measurement, and the measured RSSI fingerprint-based localization has high accuracy; after that, we combine the RSSI fingerprint localization with the database generated by the wireless channel model to modify the database predicted by the channel model.

A. Localization scenarios
According to the indoor location where the mobile terminals are placed, the localization scenarios can be divided into the following three typical scenarios: localization algorithm based on hybrid Wi-Fi hotspots Scenario 2: Dynamic AP-based method. The mobile terminals roam to the blind spots of positioning where not enough AP signals can be received. Although the terminals to be located in these blind spots cannot receive effective static AP signals for localization, there are dynamic APs nearby, and the terminals to be located measure the received intensity of dynamic AP signals, and then realize localization according to existing coordinates of these dynamic APs.
Scenario 3: Hybrid APs. The number of static APs used to locate is not enough to support high accuracy of indoor localization. However, some dynamic APs are close to the terminals to be located. Therefore, the available static and dynamic APs can be combined together to achieve more efficient localization.

B. Algorithm
The proposed HAPLA can flexibly conduct dynamic switch according to the actual localization scenarios. HAPLA prefers to can choose static APs based on fingerprint to conduct localization. In the localization scenarios where localizations do not or partially rely on the static APs, HAPLA will automatically introduce dynamic APs to assist localization, that is combining the indoor fixed static APs and the current dynamic APs to realize more accurate localization, without the fingerprint-based localization method at this moment. The fingerprint-based localization methods will map fingerprints for positioning regions first in the off-line phase, and then establish databases. Notice that it cannot be achieved using mobile terminals with continuously changing locations. The positioning results of mobile terminals with dynamic APs based on the fingerprint and BSSID would be transmitted to the positioning server timely. The terminals to be located obtain lists from the positioning server when receiving signals from the static and dynamic APs. As shown in Table1, the terminals to be located can know the coordinates of surrounding dynamic APs. Both static and dynamic APs can satisfy the channel propagation model of indoor WLAN. Due to human movements and various changing physical factors, the fading characteristics of the signal intensity are closely related to specific indoor layouts. The quality of channels will decline, since human movements can affect the propagation of signals, and it will have a greater impact on the intensity of signals near the source of signal transmission. The channel propagation is based on the following lognormal model [11]: where d is the physical distance (m) between the receiving devices and the emission sources; 0 d is a reference distance; Terminals to be located receive the intensity values of dynamic AP signals which are greater than or equal to the preset thresholds (e.g. -40dbm). The channel propagation model of indoor WLAN demonstrates that the actual physical location of terminals to be located is very close to the location of dynamic AP, which means the difference of calculated coordinates is very small, and it can use the physical locations of dynamic APs as the approximate locations to be tested. If multiple dynamic APs meet this condition, the weighted average method can be used to correct results: where   , xy is the final positioning coordinates; n is the number of dynamic APs whose RSSI values are greater than the preset threshold values of signals; k r is the kth intensity value of AP signals, which is greater than or equal to the value of preset threshold; and k w is the weight parameter.
If no dynamic Aps available, according to the channel propagation model, HAPLA will utilize the intensity values of signals radiating from the static and other dynamic APs to calculate and obtain corresponding physical distances. HAPLA consists of two phases: distance measurement and localization. In the phase of distance measurement, the location obtains the intensity values of hotspot signals from three known coordinates first, and then calculates the distance between the location to be measured and APs according to the wireless channel propagation model. In the phase of localization, when calculating the position of locations to be measured with TOA, the physical locations of any 3 known APs are chosen as the center of a circle, then the intensity values of received AP signals are calculated at the location to be measured. After that, the distance between the location to be measured and APs is calculated according to the channel propagation model of indoor WLAN.
As shown in Figure.
Similarly, we can calculate the coordinates of E and F. Calculate the coordinates of these 3 points, then form a triangle with these 3 points, and the centroid coordinates are calculated. The result is used as the location M to be measured. According to (4) x x x y y y Mx During the process of localization, there are usually more than 3 AP signals obtained, and the combination of the selected APs is uncertain in the region where triangles are used for localization. The higher the intensity values of signals are, the closer the APs, and the more influenced they are by the multipath effect and NLOS. The distances between APs and measured coordinates M are sorted in ascending order according to in the phase of localization, and the top 4 shortest distances are chosen for the calculation of coordinates M. Then, 4 sets of coordinates of the location are obtained, denoted as         , y , 4 4 x x x x y y y y Mx C. Workflow One advantage of HAPLA is its ability of dynamical adaptation to indoor environments. Localization is mainly determined by the received signals of Wi-Fi hotspots. The fingerprint-based localization algorithm will be used, if the BSSIDs of Wi-Fi hotspots received by positioning terminals satisfy the requirement of positioning. If this requirement is not satisfied, the hybrid Wi-Fi hotspots is utilized for localization. First, HAPLA discriminates which Wi-Fi hotspot can be received by the terminals to be located in current positioning regions, and then determines the numbers and signal intensity values of static and dynamic APs according to the received BSSIDs. After that, HAPLA needs to select the appropriate method to calculate the localization according to the intensity values of signals. The workflow of HAPLA is shown in Fig. 3 Step 1. A mobile terminal to be located searches for the specified static APs with its Wi-Fi module, and then, searches for their BSSIDs to check whether they satisfy the requirements of the fingerprint-based localization algorithm. If they do, HAPLA will utilize static APs only to realize localization; if not, go to "Step 2", i.e. the dynamic APs will be introduced for indoor localization.
Step 2. The mobile terminal continues to receive the RSSIs from the dynamic APs in the positioning regions, and then the corresponding information of the dynamic APs and the current physical location from the server of localization. The terminal sorts the intensity values of signals of the dynamic APs in descending order.
Step 3. Check whether RSSIs of dynamic APs' signals are greater than or equal to the preset threshold. If they are, conduct localization according to the coordinates of these dynamic APs, and calculate the coordinates of the location to be measured according to (5); otherwise, turn to "Step 4".
Step 4. If all the signal intensity values of dynamic APs are lower than the preset thresholds, indoor localization will be implemented with the static and dynamic APs together based on the triangle centroid algorithm.
Step 5. Based on the channel model of indoor WLAN propagation, 4 APs with highest RSSI intensities are selected. According to (3), (4) and (5), the coordinates of the location to be measured are measured in accordance with every three of their coordinates respectively.
Step 6. Finally, the coordinates of the location are determined based on the data fusion with hybrid Wi-Fi hotspots according to (6), and then the BSSID and the positioning results of the location are uploaded.

A. Performance Index
The mean square error (MSE) and the cumulative distribution function (CDF) [27] are widely (can be used) used to evaluate the performance of localization algorithm.
MSE is used to measure the positioning accuracy by calculating the straight-line distance between the actual location and the positioning result with: where ( , y ) r r x represents the coordinates of the positioning result, and 0 0 ( , y ) x represents the actual location of positioning terminals.
CDF is able to evaluate the positioning accuracy with the probability of the experiment number within a range of certain errors: which is used to draw the chart of CDF.

B. Experimental Scenarios
We built the experimental environment in our lab with tables, chairs and other furniture and people walking around, which means there are the NLOS factors and the multipath effect here, as shown in Fig. 4.
We used the TP-LINK TL-WR720N wireless routers as static APs, and the mobile terminals are with the Android platform and the Wi-Fi function. As shown in Fig. 4, we built two experimental environments with 6 and 5 static APs deployed respectively. In the experimental environment with 6 static APs, mobile terminals at a corner cannot receive the effective signals from the AP at the opposite corner. In the experimental environment with 5 static APs, mobile terminals at a corner cannot receive the effective signals from the AP at the opposite corner, either; and there are other "blind spots" without sufficient signals of static APs.

C. Experiments
We chose the classical K-nearest neighborhood algorithm (KNN) and the typical improved variance-based fingerprint distance adjustment algorithm (VFDA) as the comparative objects to HAPLA proposed here.
We carried out ten groups of experiments, and the experimental results are listed in Table II. The chart of CDF is drawn according to Table II, as shown in Fig. 5. From Table II and Fig. 5, we can find that VFDA can achieve the more accurate localization in some cases than KNN. However, both VFDA and KNN have large deviations for several times because of the blind spots in the localization process leading to a significant positioning errors. HAPLA can ensure the most distances of positioning error less than 4m, which proves that HAPLA can dynamically adapt to different positioning environments to address the problem of blind spot. In this paper, we further compare the trajectory of a mobile terminal measured by HAPLA and VFDA respectively and its actual trajectory, as shown in Fig. 6. As shown in Fig. 6, we can see that HAPLA has better positioning performance than VFDA, for VFDA has large deviations and fluctuations at some location points.

V. CONCLUSION
Due to large scale of positioning regions, failure of APs and interference of hotspots, traditional indoor localization technology based on static Wi-Fi APs cannot solve the problem that in some positioning regions mobile terminals cannot receive adequate static AP signals, causing poor positioning performance. HAPLA neatly utilizes mobile terminals with the Wi-Fi hotspots to serve as dynamic APs, in order to assist localization effectively. HAPLA can flexibly select different positioning methods to realize high positioning accuracy. However, during the positioning process, HAPLA will bring about a certain amount of additional overhead when selecting the positioning APs. In the future, we will improve the performance of HAPLA, especially lowering the computing cost of HAPLA.