Research and Application of Underground WLAN Adaptive Radio Fingerprint Database

Fingerprint positioning based on WiFi in coal mines has received much attention because of the widespread application of WiFi. Fingerprinting techniques have developed rapidly due to the efforts of many researchers. However, the off-line construction of the radio fingerprint database is a tedious and time-consuming process. When the underground environments change, it may be necessary to update the signal received signal strength indication (RSSI) of all reference points, which will affect the normal working of a personnel positioning system. To solve this problem, an adaptive construction and update method based on a quantum-behaved particle swarm optimization–user-location trajectory feedback (QPSO–ULTF) for a radio fingerprint database is proposed. The principle of ULTF is that the mobile terminal records and uploads the related dataset in the process of user’s walking, and it forms the user-location track with RSSI through the analysis and processing of the positioning system server. QPSO algorithm is used for the optimal radio fingerprint match between the RSSI of the access point (AP) contained in the dataset of user-location track and the calibration samples to achieve the adaptive generation and update of the radio fingerprint samples. The experimental results show that the radio fingerprint database generated by the QPSO–ULTF is similar to the traditional radio fingerprint database in the statistical distribution characteristics of the signal received signal strength (RSS) at each reference point. Therefore, the adaptive radio fingerprint database can replace the traditional radio fingerprint database. The comparable results of well-known traditional positioning methods demonstrate that the radio fingerprint database generated or updated by the QPSO–ULTF has a good positioning effect, which can ensure the normal operation of a personnel positioning system.


Introduction
The positioning of coal mine personnel is one of the important research topics in coal mine safety management [1,2]. The recording and monitoring of miners' locations ensure the management efficiency of coal mine production and the effectiveness of an underground accident rescue. In recent years, the method of underground location fingerprint positioning based on WiFi technology has been widely studied because of its low cost, wide coverage, high transmission rate, expandability, better confidentiality, maintainability, accessibility to many users, and strong anti-interference ability [3][4][5].
At present, the research on the location fingerprint positioning of a Wireless Local Area Network (WLAN) mainly focuses on the noise reduction of radio fingerprint samples [6], the optimal selection of the wireless access point [7], and an online radio fingerprint-matching algorithm [8,9]. Beyond that, there has been a lot of research on the construction and maintenance of a radio fingerprint database in applications. It takes a good deal of time to build a radio fingerprint database manually. When the location area environment changes, which results in a change in RSS distribution, the database needs to re-collect the radio fingerprint samples of a large number of reference points. This process will seriously affect the normal use of the underground personnel positioning system [10]. To solve this problem, a new Adaptive Indoor Positioning System model (called DIPS) has been proposed in [11]. DIPS is based on a dynamic radio map generator, RSS certainty technique, and peoples' presence effect integration for dynamic and multi-floor environments. DIPS is also able to overcome the mobile device heterogeneity problem and considers the presence of people as a WLAN signal's attenuation factor. Wu, Yang, and Liu designed a WLAN location fingerprint system named LiFS (Locating in Fingerprint Space) [12]. The feature of LiFS is that the radio map generator does not need to allocate a lot of time to create radio maps in the off-line phase, but only needs a small number of users' walking data recorded by a mobile device. In LiFS, the calibration of fingerprints is crowdsourced and automatic. Kim proposed an autonomous radio fingerprinting method based on cooperative feedback of mobile phones [13]. Mobile users track their position with mobile phones and measure RSS from the surrounding access points. Anonymous mobile users automatically collect data in daily life without purposefully surveying an entire positioning area. DIPS, LiFS, and the method in [13] effectively make up the drawbacks of creating radio maps. However, they are mainly used in indoor environments such as office buildings; those methods are not suitable for underground environments.
In view of the tedious construction and maintenance of the underground WLAN radio fingerprint database, this paper proposes an adaptive construction and update method of the radio fingerprint database based on the quantum-behaved particle swarm optimization-user-location trajectory feedback (QPSO-ULTF) algorithm. The concept map is shown in Figure 1. As the miners walk through an underground tunnel, the ULTF algorithm records their relevant positions and RSS data with the technical advantages of a mobile terminal. In the process of creating a radio fingerprint database, each user-location point has its corresponding candidate reference points. The calibration samples belonging to these candidate reference points are used as a scale, and the QPSO algorithm is used to adaptively adjust the RSS data feedback by the user-location track. In the process of updating the radio fingerprint database, the RSS data of filtered user-location track points is used as a scale, and the QPSO algorithm is used to update the calibration samples of corresponding reference points. The secondary construction of the radio fingerprint samples is then used to complete the update of the radio fingerprint database. In general, the radio fingerprint database can be updated in a relatively low-frequency period of time when the miners enter or leave the location area, so as to minimize the impact of the update process on the normal operation of the location fingerprint positioning system. The experiments and analysis show that the QPSO-ULTF can effectively replace the traditional manual acquisition process in the construction and update of the radio fingerprint database. It can also adaptively complete the maintenance of the radio fingerprint database without affecting the normal operation of the positioning system. Furthermore, it reduces resource consumption and makes the system more robust.
Sensors 2020, 20, x FOR PEER REVIEW 3 of 20 Figure 1. concept map of adaptive construction and update method based on the quantum-behaved particle swarm optimization-user-location trajectory (QPSO-ULTF) algorithm.

QPSO Algorithm
QPSO [14] is a particle swarm optimization (PSO) algorithm based on the quantum behavior of particles, proposed by Sun et al. It is an important improvement of the PSO algorithm in terms of its global search ability and operational efficiency. The PSO algorithm is a cluster optimization

QPSO Algorithm
QPSO [14] is a particle swarm optimization (PSO) algorithm based on the quantum behavior of particles, proposed by Sun et al. It is an important improvement of the PSO algorithm in terms of its global search ability and operational efficiency. The PSO algorithm is a cluster optimization algorithm that uses the histories of many potential optimal solutions to choose and share in the iteration. During this process, the particles continuously complete the evolution and approaches to the global optimal solution. PSO has a high complexity in the optimization problem with large dimensions. Each particle will carry out a large number of local optimal solutions in the high-dimension space, which has a significant impact on the overall performance of PSO. QPSO uses the quantum state of particles to replace the velocity of particles. It is useful to update the position of particles because this reduces the search complexity of each particle and improves the overall performance of PSO. The equation of QPSO is: where x t+1 id is the position of particle i at (t + 1)-th iteration, i = {1, · · · , M}, M is the size of particle swarm, D is the dimension of solution space, and ϕ t id and u t id are random numbers with uniform distribution between 0 and 1, respectively, If ϕ t id ≥ 0.5, then take "+" for "±" in formula x t+1 id , otherwise take "−". p t id is the local gravitational factor, β= (1 − 0.5) × (T − t)/T + 0.5 is called the contraction-expansion (CE) coefficient, P t id is the local optimal solution of particle i in dimension d at t-th iteration, P t gd is the global optimal solution in dimension d at t-th iteration, and mbest t d is the mean value of local optimal solutions for all particles in dimension d at t-th iteration.
The introduction of variable mbest t d improves the convergence rate and performance of the algorithm because it considers the distribution of the local optimal solution for all particles in the same dimension. In this paper, Equation (1) will be used as the solution equation for the adaptive generation and updating of radio fingerprint samples.

The Principle of ULTF
RSS collecting is the key for off-line and online phase in fingerprint positioning. The mobile terminal is used to collect RSS, but the traditional offline acquisition process is inefficient. Nowadays, many mobile terminals are equipped with an acceleration sensor, a direction sensor, and gyroscopes. These sensors make it convenient to calculate the specific moving direction and acceleration of the user with a mobile terminal. Not only that, mobile terminals have powerful data interaction and processing capabilities. ULTF makes full use of this ability of the mobile terminal to collect RSS and other data in the positioning area autonomously. Then, all feedback data will be uploaded to the positioning system server. Finally, these data will be used for generating the user-location track. From the user entering the underground positioning area to leaving this area, an integrated user-location track will be recorded. Each user-location track contains many user-location track points. Each user-location track point contains the user relative position (this position cannot be directly used as the user's estimated position) and received signal strength indication (RSSI) recorded at a certain time. QPSO algorithm will use the user relative position and RSSI to do the optimal radio fingerprint match.

User-Location TrackGeneration
In general, the underground tunnel has a special spatial structure. The width and length of the tunnel are not the same order of magnitude. The length of the tunnel is several hundred meters, even several kilometers, but the width of the tunnel is only a few meters. Therefore, a miner's movement in the tunnel width direction can practically be ignored. A sketch of a user-location track is shown in Figure 2. It is assumed that the user-location track points are always recorded at the middle position in the direction of tunnel width on the 2-D plane.
user-location track. From the user entering the underground positioning area to leaving this area, an integrated user-location track will be recorded. Each user-location track contains many user-location track points. Each user-location track point contains the user relative position (this position cannot be directly used as the user's estimated position) and received signal strength indication (RSSI) recorded at a certain time. QPSO algorithm will use the user relative position and RSSI to do the optimal radio fingerprint match.

User-Location TrackGeneration
In general, the underground tunnel has a special spatial structure. The width and length of the tunnel are not the same order of magnitude. The length of the tunnel is several hundred meters, even several kilometers, but the width of the tunnel is only a few meters. Therefore, a miner's movement in the tunnel width direction can practically be ignored. A sketch of a user-location track is shown in Figure 2. It is assumed that the user-location track points are always recorded at the middle position in the direction of tunnel width on the 2-D plane. The user-location track generation is related to the user's moving distance and direction. When the miners with mobile terminals walk in the tunnel, their movement direction and distance can be calculated through the data acquisition and processing of sensors in the mobile terminal. The different ways of holding a mobile phone may affect the calculation of the user's moving distance. To solve this problem, this paper uses the step-by-step method to correct the user's moving distance [15]. In this way, the user-location track can be accurately calculated.

Adaptive Radio Fingerprint Database
The construction and update of the adaptive radio fingerprint database are based on the combination of the ULTF and QPSO algorithms. ULTF is mainly responsible for the collection, upload, and calculation of the data related to the user-location track. These data include the user's walking status and RSS at each sampling time. The user relative position calculated by ULTF in the user-location track point is used for the best reference point match. In the process of building and updating the adaptive radio fingerprint database, the QPSO algorithm is used for generating RSSI adaptively, but QPSO is used differently in the process of building and updating. Section 4.2 will illustrate the construction and update of the adaptive radio fingerprint database, respectively. Each user-location track point generated by ULTF contains a feedback packet, and its data structure is UF t u = (MAC u : (TP t u , f t u )), where MAC u is the WLAN MAC address of the mobile phone carried by user u, TP t u is the data uploaded by user u to calculate the user's location track point at time t, and f t u is the real-time RSSI collected by user u at time t. With this feedback packet, the positioning system server will make the best match between user-location track points and reference points. The best match is mainly used to find the reference point with the most similar RSSI compared with the RSSI of the user-location track point. Then, the RSS generated by the QPSO algorithm will be stored in the radio fingerprint samples of this reference point.
To reduce the influence of accumulated error on the generation of radio fingerprint samples, it is necessary to select PB reference points closest to the user-location track point for the best reference point RP best matching. For example, the relative position between the user-location track and reference point is shown in Figure 3. If PB = 4, RP1, RP2, RP3, and RP4 will be the candidate reference points of RP best for user-location track point W. Because the RP1, RP2, RP3, and RP4 are the four nearest reference points to W, PB can also be regarded as the dimension of particle solution space in QPSO. The value of RP best is determined by the QPSO optimization process between the RSSI of user-location track points and the radio fingerprint calibration samples of reference points in each dimension. different ways of holding a mobile phone may affect the calculation of the user's moving distance. To solve this problem, this paper uses the step-by-step method to correct the user's moving distance [15]. In this way, the user-location track can be accurately calculated.

Adaptive Radio Fingerprint Database
The construction and update of the adaptive radio fingerprint database are based on the combination of the ULTF and QPSO algorithms. ULTF is mainly responsible for the collection, upload, and calculation of the data related to the user-location track. These data include the user's walking status and RSS at each sampling time. The user relative position calculated by ULTF in the user-location track point is used for the best reference point match. In the process of building and updating the adaptive radio fingerprint database, the QPSO algorithm is used for generating RSSI adaptively, but QPSO is used differently in the process of building and updating. Section 4.2 will illustrate the construction and update of the adaptive radio fingerprint database, respectively. With this feedback packet, the positioning system server will make the best match between user-location track points and reference points. The best match is mainly used to find the reference point with the most similar RSSI compared with the RSSI of the user-location track point. Then, the RSS generated by the QPSO algorithm will be stored in the radio fingerprint samples of this reference point.
To reduce the influence of accumulated error on the generation of radio fingerprint samples, it is necessary to select PB reference points closest to the user-location track point for the best reference point best RP matching. For example, the relative position between the user-location track and reference point is shown in Figure 3. If PB = 4, RP1, RP2, RP3, and RP4 will be the candidate reference points of best RP for user-location track point W. Because the RP1, RP2, RP3, and RP4 are the four nearest reference points to W, PB can also be regarded as the dimension of particle solution space in QPSO. The value of best RP is determined by the QPSO optimization process between the RSSI of user-location track points and the radio fingerprint calibration samples of reference points in each dimension.  In the off-line phase of most location fingerprints positioning systems, thousands of RSSI should be collected as the original radio fingerprint samples at each reference point. This phase is the most time-consuming and laborious part of the construction of an underground personnel positioning system. The method proposed in this paper also needs to manually collect the original samples as calibration samples, but the number of RSSI samples collected at each reference point can be reduced to 1/20 of the traditional original samples. The reason is that the QPSO-ULTF can generate a large set of samples from a small number of accurate radio fingerprint samples. The algorithm can improve the deployment efficiency of an underground personnel positioning system. In the QPSO algorithm, the variables to be solved are regarded as particles. The initially global optimal solution is generally the particle itself. The initially local optimal solution is also the particle itself in each dimension. For the application of QPSO in the adaptive construction of the radio fingerprint database, the f t u in the feedback packet UF t u of the user-location track point is regarded as the particle. The initially global optimal solution is f t u . The initially local optimal solution is f t u in each dimension. In QPSO-ULTF, 200 sets of RSSI samples are collected at each reference point as calibration samples. The calibration samples are mainly used as the random correlation data for QPSO. During the process of QPSO iteration, the f t u will be updated iteratively after being compared with the RSS mean value in the calibration samples. The number of RSSI involved in the QPSO operation in calibration samples is the total number of particles in the particle swarm.
The main steps of QPSO optimal radio fingerprint match and adaptive generation of RSSI are as follows.
Step 1. Initialize the QPSO parameter according to Equation (1). The number of particles is M. The dimension of solution space is D. The algorithm iteration is T. The constriction factor is β= (1. and R is the total number of WiFi signals. From all reference points, select PB (PB=D) reference points closest to W, whose location coordinates are Step 2. At the t-th iteration, the local optimal solution P t ρi on dimension ρ is calculated by Equation (2). The global optimal solution P t gρ is calculated by Equation (3). Equation (4) is used to update c f t ρi . This update does not affect the original calibration samples.
where · 2 is the Euclidean distance between two vectors.
where · stands for rounding in Equation (4), and the values of β, ϕ t ρi , and u t ρi are the same as those in Equation (1).
Step 3. Set t = t + 1. If t + 1 < T, return to Step 2. If t + 1 = T, terminate the iteration and output the global optimal solution P T gρ at iteration T. According to Equation (3), the candidate reference point corresponding to ρ in P T gρ is the best matching reference point. After the above three main steps, the best matching reference point is found at a certain location track point, and a set of adaptive RSSI samples corresponding to the best matching reference point is generated. These generated RSSI samples of this best matching reference point will be stored in the radio fingerprint database. When there are enough user-location tracks, the RSSI samples generated by the QPSO-ULTF of each reference points reach a certain number. The RSSI samples can represent the RSS statistical distribution characteristics of each reference point. At that point, the construction of the underground WLAN adaptive radio fingerprint database is complete.
Sensors 2020, 20, 1182 7 of 19 The positioning system will generate a large number of user-location track points during the process of the miners walking in the tunnel. There is a certain error between the positions of track points relative to PB candidate reference points and user-location track points. Meanwhile, there may be some interference in dynamic RSSI collected at the user-location track point. Therefore, it is necessary to determine whether the QPSO algorithm is applied to user-location track point W through Equation (5).
where E(s f ρi ) is the mean value of all s f ρi , and Q RSSI is the RSS threshold. The flowchart of the adaptive construction method of radio fingerprint database based on QPSO-ULTF is shown in Figure 4.
corresponding to ρ in T g P ρ is the best matching reference point.
After the above three main steps, the best matching reference point is found at a certain location track point, and a set of adaptive RSSI samples corresponding to the best matching reference point is generated. These generated RSSI samples of this best matching reference point will be stored in the radio fingerprint database. When there are enough user-location tracks, the RSSI samples generated by the QPSO-ULTF of each reference points reach a certain number. The RSSI samples can represent the RSS statistical distribution characteristics of each reference point. At that point, the construction of the underground WLAN adaptive radio fingerprint database is complete.
The positioning system will generate a large number of user-location track points during the process of the miners walking in the tunnel. There is a certain error between the positions of track points relative to PB candidate reference points and user-location track points. Meanwhile, there may be some interference in dynamic RSSI collected at the user-location track point. Therefore, it is necessary to determine whether the QPSO algorithm is applied to user-location track point W through Equation (5).
The flowchart of the adaptive construction method of radio fingerprint database based on QPSO-ULTF is shown in Figure 4.

Experimental Comparison of the Adaptive Radio Fingerprint Database and Traditional Radio Fingerprint Database
To verify the reliability of the adaptive radio fingerprint database, a comparison of the statistical distribution characteristics of the samples in the manual radio fingerprint database and the adaptive radio fingerprint database is made, and then analyzed in the same underground positioning environment [16].
The underground tunnel for the experiment is shown in Figure 5. The access point (AP) device used in all experiments of this paper is KJJ660W, which is shown in Figure 6. The mobile device is shown in Figure 7, its operating system is Android 6.0. As shown in Figure 8, there are three AP signals and 32 reference points in the positioning tunnel. The manual radio fingerprint database collects 3000 RSSI at each reference point, while the adaptive radio fingerprint database only collects 200 RSSI. In the process of building the adaptive radio fingerprint database, each one of the three miners carries a different intrinsic safety mobile phone and walks in the positioning tunnel 1000 times. This forms 3000 user-location tracks. The adaptive radio fingerprint database is constructed from 3000 user-location tracks and QPSO algorithm. Initialize the parameters, T = 20, PB = 4, M = 200, Q RSSI = 7.348, QUA LT = 2000, and Q EX LTP = 0.75.
statistical distribution characteristics of the samples in the manual radio fingerprint database and the adaptive radio fingerprint database is made, and then analyzed in the same underground positioning environment [16]. The underground tunnel for the experiment is shown in Figure 5. The access point (AP) device used in all experiments of this paper is KJJ660W, which is shown in Figure 6. The mobile device is shown in Figure 7, its operating system is Android 6.0. As shown in Figure 8, there are three AP signals and 32 reference points in the positioning tunnel. The manual radio fingerprint database collects 3000 RSSI at each reference point, while the adaptive radio fingerprint database only collects 200 RSSI. In the process of building the adaptive radio fingerprint database, each one of the three miners carries a different intrinsic safety mobile phone and walks in the positioning tunnel 1000 times. This forms 3000 user-location tracks. The adaptive radio fingerprint database is constructed from 3000 user-location tracks and QPSO algorithm. Initialize the parameters, T=20, PB=4, M=200,     adaptive radio fingerprint database is made, and then analyzed in the same underground positioning environment [16].
The underground tunnel for the experiment is shown in Figure 5. The access point (AP) device used in all experiments of this paper is KJJ660W, which is shown in Figure 6. The mobile device is shown in Figure 7, its operating system is Android 6.0. As shown in Figure 8, there are three AP signals and 32 reference points in the positioning tunnel. The manual radio fingerprint database collects 3000 RSSI at each reference point, while the adaptive radio fingerprint database only collects 200 RSSI. In the process of building the adaptive radio fingerprint database, each one of the three miners carries a different intrinsic safety mobile phone and walks in the positioning tunnel 1000 times. This forms 3000 user-location tracks. The adaptive radio fingerprint database is constructed from 3000 user-location tracks and QPSO algorithm. Initialize the parameters, T=20, PB=4, M=200,     positioning environment [16].
The underground tunnel for the experiment is shown in Figure 5. The access point (AP) device used in all experiments of this paper is KJJ660W, which is shown in Figure 6. The mobile device is shown in Figure 7, its operating system is Android 6.0. As shown in Figure 8, there are three AP signals and 32 reference points in the positioning tunnel. The manual radio fingerprint database collects 3000 RSSI at each reference point, while the adaptive radio fingerprint database only collects 200 RSSI. In the process of building the adaptive radio fingerprint database, each one of the three miners carries a different intrinsic safety mobile phone and walks in the positioning tunnel 1000 times. This forms 3000 user-location tracks. The adaptive radio fingerprint database is constructed from 3000 user-location tracks and QPSO algorithm. Initialize the parameters, T=20, PB=4, M=200,      Figure 9 shows the comparison of the statistical characteristic distribution between the adaptive radio fingerprint database and the traditional radio fingerprint database. Compared with the samples in the traditional radio fingerprint database, the mean value of RSSI received from three AP signals is similar, and the standard deviation of RSSI is also in a small range. In other words, the adaptive radio fingerprint database can replace the traditional radio fingerprint database. In addition, due to the reduction in the demand for the number of samples collected manually, the resource consumption of manpower and time is also reduced when building the adaptive radio fingerprint database. This has important theoretical significance and application value for the comprehensive research of underground WLAN personnel positioning systems.  Figure 9 shows the comparison of the statistical characteristic distribution between the adaptive radio fingerprint database and the traditional radio fingerprint database. Compared with the samples in the traditional radio fingerprint database, the mean value of RSSI received from three AP signals is similar, and the standard deviation of RSSI is also in a small range. In other words, the adaptive radio fingerprint database can replace the traditional radio fingerprint database. In addition, due to the reduction in the demand for the number of samples collected manually, the resource consumption of manpower and time is also reduced when building the adaptive radio fingerprint database. This has important theoretical significance and application value for the comprehensive research of underground WLAN personnel positioning systems. Figure 8. Plan of experiment tunnel with radio fingerprint database comparison. Figure 9 shows the comparison of the statistical characteristic distribution between the adaptive radio fingerprint database and the traditional radio fingerprint database. Compared with the samples in the traditional radio fingerprint database, the mean value of RSSI received from three AP signals is similar, and the standard deviation of RSSI is also in a small range. In other words, the adaptive radio fingerprint database can replace the traditional radio fingerprint database. In addition, due to the reduction in the demand for the number of samples collected manually, the resource consumption of manpower and time is also reduced when building the adaptive radio fingerprint database. This has important theoretical significance and application value for the comprehensive research of underground WLAN personnel positioning systems.

Adaptive Update of RadioFingerprint Database Based on QPSO-ULTF
Some tunnel environmental noise will affect the statistical distribution of RSS at reference points. Due to this, the accuracy of some original samples in the radio fingerprint database may be decreased. Therefore, these samples need to be updated. When the location area is too large with many reference points, however, it is difficult to determine which reference points need to be updated. In many cases, it can only update and collect the RSSI for most or even all reference points. Not only is it time-consuming and laborious, but it also seriously affects the normal operation of the underground personnel positioning system.
In the adaptive construction of the radio fingerprint database in Section 4.1, Equation (5) determines the real-time RSSI of each user-location track point to ensure that the RSSI calculated by QPSO is similar samples without large noise interference compared with the calibration samples of candidate reference points. However, if the real-time RSSI of continuous user-location track points in multiple user-location tracks do not satisfy Equation (5) in a period of time, it is possible that the change of location area environment has caused the change in RSS statistical characteristic distribution. It makes the real-time RSSI collected near the candidate reference points differ substantially from the calibration samples of the candidate reference points. Therefore, by analyzing and processing the abnormal data in multiple user-location trajectory feedback information, we can find the positions of the reference points where the RSS distribution changed. At that point, the calibration samples at these reference points should be updated.

RSS Distribution When Tunnel Environment Changes
In order to analyze the change in RSS distribution between f t u in UF t u and the calibration samples of the candidate reference points, eight metal cabinets, each with a length of 2.2 m, a width of 0.5 m, and a height of 2.1 m are placed in the tunnel, as shown in Figure 10.
Not only is it time-consuming and laborious, but it also seriously affects the normal operation of the underground personnel positioning system.
In the adaptive construction of the radio fingerprint database in Section 4.1, Equation (5) determines the real-time RSSI of each user-location track point to ensure that the RSSI calculated by QPSO is similar samples without large noise interference compared with the calibration samples of candidate reference points. However, if the real-time RSSI of continuous user-location track points in multiple user-location tracks do not satisfy Equation (5) in a period of time, it is possible that the change of location area environment has caused the change in RSS statistical characteristic distribution. It makes the real-time RSSI collected near the candidate reference points differ substantially from the calibration samples of the candidate reference points. Therefore, by analyzing and processing the abnormal data in multiple user-location trajectory feedback information, we can find the positions of the reference points where the RSS distribution changed. At that point, the calibration samples at these reference points should be updated.

RSS Distribution When Tunnel Environment Changes
In order to analyze the change in RSS distribution between t u f in t u UF and the calibration samples of the candidate reference points, eight metal cabinets, each with a length of 2.2 m, a width of 0.5 m, and a height of 2.1 m are placed in the tunnel, as shown in Figure 10.  Figure 11 shows the comparison of RSS mean value at each reference point after the tunnel environment has changed. Of these, Environment 1 is shown in Figure 8, and Environment 2 is shown in Figure 10. The results of Environment 1 are the RSS mean values of the radio fingerprint samples calculated in the experiments in Section 4.1.2. The results of Environment 2 are the RSS mean values collected from 1000 sets of RSSI at each reference point. The results of the comparison, as seen in Figure 11, show that the change of tunnel environments brings about the change of RSS mean value at some reference points. If the radio fingerprint database that is adaptively constructed in Environment 1 is still used to locate the miners, it is bound to make a large positioning error.  Figure 11 shows the comparison of RSS mean value at each reference point after the tunnel environment has changed. Of these, Environment 1 is shown in Figure 8, and Environment 2 is shown in Figure 10. The results of Environment 1 are the RSS mean values of the radio fingerprint samples calculated in the experiments in Section 4.1.2. The results of Environment 2 are the RSS mean values collected from 1000 sets of RSSI at each reference point. The results of the comparison, as seen in Figure 11, show that the change of tunnel environments brings about the change of RSS mean value at some reference points. If the radio fingerprint database that is adaptively constructed in Environment 1 is still used to locate the miners, it is bound to make a large positioning error.

The Principle and Process of QPSO-ULTF for Adaptive Update of Radio Fingerprint Database
According to the analysis in Section 4.2.1, the RSS distribution at most reference points will change when the location environments change. There will be a big difference between the f t u in feedback data of user-location track points and the RSS mean values of calibration samples of candidate reference points. Most of the feedback data of user-location track points are not satisfied with Equation (5). We can observe that the number of user-location track points have filtered out what they are not satisfied with Equation (5) in experiments. Figure 12 gives the number of radio fingerprint samples generated by the QPSO-ULTF at each reference point in the two tunnel environments. The experimental data collection process is similar to the process explained in Section 4.1.2. The adaptive radio fingerprint database is constructed by 3000 user-location tracks of three miners. The calibration samples of each reference point are collected in tunnel Environment 1. The comparison between the number of user-location track points and the number of user-location track points that do not satisfied with Equation (5) is shown in Figure 13. In Environment 1,126,742 location track points are recorded, and 91,031 radio fingerprint samples are generated adaptively from 32 reference points. In Environment 2, 122,945 location track points are recorded, and 27,036 radio fingerprint samples are generated adaptively from 32 reference points. The comparison results in Figure 13 show that 77% of the location track points are filtered out because they do not meet the criteria of the QPSO-ULTF operation after the tunnel environment changed. Therefore, considering that the change in RSS distribution at reference point caused by the change of tunnel environment is generally happened. A scale threshold can be set as a criterion to determine whether the location environment has changed.  In general, once the adaptive radio fingerprint database is constructed, the QPSO-ULTF operation will not be performed on user-location track points. Due to the necessity to monitor the RSS distribution in a tunnel environment, the comparison process between t u f in the feedback data of user-location track points and the statistical mean E( ) i sf ρ of calibration samples in candidate reference points still need to be carried out continuously. In addition, the data of all filtered user-location track points are stored during the comparison process. To improve the examined ability and accuracy of the personnel positioning system once the tunnel environment has changed, Equation (5) needs to be modified.  In general, once the adaptive radio fingerprint database is constructed, the QPSO-ULTF operation will not be performed on user-location track points. Due to the necessity to monitor the RSS distribution in a tunnel environment, the comparison process between t u f in the feedback data of user-location track points and the statistical mean E( ) i sf ρ of calibration samples in candidate reference points still need to be carried out continuously. In addition, the data of all filtered user-location track points are stored during the comparison process. To improve the examined ability and accuracy of the personnel positioning system once the tunnel environment has changed, Equation (5) needs to be modified.
Because the miners go in and out of the mine in teams, there will be different users going in and In general, once the adaptive radio fingerprint database is constructed, the QPSO-ULTF operation will not be performed on user-location track points. Due to the necessity to monitor the RSS distribution in a tunnel environment, the comparison process between f t u in the feedback data of user-location track points and the statistical mean E(s f ρi ) of calibration samples in candidate reference points still need to be carried out continuously. In addition, the data of all filtered user-location track points are stored during the comparison process. To improve the examined ability and accuracy of the personnel positioning system once the tunnel environment has changed, Equation (5) needs to be modified.
Because the miners go in and out of the mine in teams, there will be different users going in and out of the positioning area at different time intervals. In addition, the number of miners in each team is not the same. So, in order to better record and differentiate the user-location tracks, it is necessary to add time stamp TIME u into the user-location trajectory feedback packet. Accordingly, UF t u is modified to UF t u = (MAC u : (TP t u , f t u ) : TIME u ). The introduction of time stamp is useful for analyzing the proportion of location track points that are filtered better at a specific time interval.
According to Equation (5), the filtering condition of location track points is: where the definitions of f W , E(s f ρi ), and Q RSSI are the same as those in Equation (5). PB EX is the number of reference points closest to the user-location track point for data comparison when determining whether the user-location track point is filtered or not; its value usually sets to 2.
If f W of location track point is satisfied with Equation (6) for the nearest PB EX reference points, the relevant data of this track point will be recorded as W EX = MAC u , f W , EX RP , TIME u , where EX RP = RP Num1 , · · · , RP NumPB EX is the serial number of PB EX reference points closest to this filtered track point.
Therefore, the basis for determining the change of positioning area environments is as follows: where Qua LT is the number of user-location tracks generated in a specific period Time EX , QUA LT is the given number of user-location tracks, Qua EX LTP and Qua LTP are, respectively, the number of filtering and generation of user-location track points in a specific period Time EX , and Q EX LTP is the percentage of filtered location track points. Qua LT , Qua EX LTP , and Qua LTP will change dynamically over time. The record of their value is determined by the current system time, Time EX and TIME u .
When Equation (7) is satisfied, the environment of positioning area changes and the radio fingerprint database needs to be updated dynamically. Because the existing radio fingerprint samples can no longer be used for precise positioning, most of the radio fingerprint samples of reference points need to be rebuilt. However, the calibration samples of reference points cannot be used for QPSO calculation in the adaptive generation of radio fingerprint samples. As shown in Figure 1, calibration samples should be updated first. Overall, QPSO for the adaptive update of the radio fingerprint database mainly updates the calibration samples of each reference point. The RSSI in the filtered user-location track points is used as the reference for updating calibration samples. Similar to the best match between user-location track points and reference points in the adaptive construction of the radio fingerprint database, each filtered user-location track point also has its corresponding filtering candidate reference points.
The update steps are as follows.
Step 1. First, the filtered user-location track points are clustered. If the EX RP in the record data W EX of filtered user-location track points are the same, the filtered user-location track points with the same EX RP shall be classified as W EX (EX RP ).
Step 2. To reduce the noise interference in RSSI, LQI is used to filter the RSSI with noise in user-location track points after clustering [17]. The filtered W EX (EX RP ) is recorded as W EX (EX RP ).
Step 3. The RSSI in W EX (EX RP ) mainly correspond to PB EX filtering candidate reference points EX RP . Suppose that W EX (EX RP ) contains M EX filtered user-location track points, then their corresponding RSSI are { f 1 W , · · · , f r W , · · · , f M EX W } and f r W = f r W (AP 1 ), · · · , f r W (AP k ), · · · , f r W (AP R ) . Filtered candidate reference points are EX RP = RP Num1 , · · · , RP Numl , · · · , RP NumPB EX . The iteration number of algorithm is T, and a QPSO operation is performed on each filtered user-location track point in turn. The number of particles in particle swarm is M. The solution space dimension is D = PB EX . ρ = {1, · · · , PB EX }. The original calibration samples of filtered candidate reference point RP Numl is SF ρ = s f ρ1 , · · · , s f ρi , · · · , s f ρM , where s f ρi = s f ρi (AP 1 ), · · · , s f ρi (AP k ), · · · , s f ρi (AP R ) .
Step 4. For the r-th filtered user-location track point at the t-th iteration, the local optimal solution P t ρi on dimension ρ is calculated by Equation (8), and the global optimal solution P t gρ is calculated by Equation (9). Equation (10) is used to update s f t ρi for getting s f t+1 ρi at (t + 1)-th iteration.
Step 5. Set t = t + 1. If t + 1 < T, return to Step 4. If t + 1 = T, the reference point number Numl of the filtered candidate reference point RP Numl corresponding to ρ is the reference point for updating the calibration samples. At this time, the global optimal solution P T gρ is used as the updated calibration samples of this reference point. It will be stored in the new calibration sample set SF NEW Numl . Then, proceed to Step 6.
Step 6. Set r = r + 1. If r + 1 ≤ M EX , set t = 1, and return to Step 4. If r + 1 > M EX , then an adaptive radio fingerprint update is completed for filtered user-location track points W EX (EX RP ), corresponding to the reference point EX RP .
Step 7. Repeat Steps 2 to 6 for all classified filtered location track points W EX (EX RP ). Finally, the original calibration samples SF is replaced by the newly generated calibration samples SF NEW at each reference point. If the number of generated calibration samples at some reference points is small or none, the original calibration samples remain. The adaptive update process of the radio fingerprint database is finished.
The separation of training sets and test sets in radio maps are determined by the main parameters set by QPSO-ULTF, including PB, PB EX and the number of calibration samples. After the adaptive update of the radio fingerprint database, it is also necessary to again perform the adaptive construction of the radio fingerprint database. The construction process is the same as the method proposed in Section 4.1.1.
The flowchart of the adaptive update method of radio fingerprint database based on QPSO-ULTF is shown in Figure 14.

Adaptive Updating Experiment of Radio Fingerprint Database
The tunnel plan for the adaptive updating experiment of the radio fingerprint database is shown in Figure 10. The original calibration samples are collected from the tunnel environment shown in Figure 8. The miner walks randomly 1000 times in the tunnel of Figure 10. Initialize the parameters, T = 20, PB = 4, PB EX = 2, M = 200, Q RSSI = 7.348, QUA LT = 1000, and Q EX LTP = 0.7. Figure 15 shows the RSS mean value comparison results between 1000 groups of RSSI collected manually and RSSI generated by adaptive update at each reference point in the tunnel environment, as shown in Figure 10. After updating, the mean value of RSS calibration samples at each reference point is basically the same as the mean value of manually collected RSSI. It can be inferred that the adaptive updating of the radio fingerprint database based on QPSO-ULTF can achieve the better adaptive correction of RSS distribution at each reference point. The specific positioning experiments will be discussed in Section 4.  When RSSI Q is large, only 32% of user-location track points are filtered out even if the positioning environment has changed. This will lead to a situation in which the system cannot accurately determine whether the tunnel environment is indeed changed. When RSSI Q is small, nearly all the user-location track points are judged to be filtered out, which causes an increase in the load of the positioning system. In practical applications, it is necessary to choose a reasonable value. This should not only ensure that the observing sensitivity of underground positioning environment has changed, but should also consider the working efficiency of the positioning system. At the same time, it also should take into account the number of user-location track points filtered by the QPSO-ULTF when the radio fingerprint database is updated adaptively. The value of Q RSSI in Equation (6) is the main parameter that affects the updating performance of the radio fingerprint database. To analyze the influence of Q RSSI on the adaptive updating process of radio fingerprints, the number of filtered user-location track points is recorded and compared with different values of Q RSSI . The initial data of experiments show 122,945 user-location track points of information generated by the miner who walked 3000 times in the tunnel environment, as shown in Figure 10. Four values of Q RSSI are used for adaptive updating of the radio fingerprint database. The four values of Q RSSI are The number of AP signals R is three. The other parameter PB EX is two. Figure 16 shows the comparison of the quantity of filtered user-location track points in all user-location tracks with different values of Q RSSI . The total number of filtered user-location track points is 11,1491, 95,050, 75,231, and 39,940 when Q RSSI is 2.449,4.899, 7.348, and 9.798, respectively. When Q RSSI is large, only 32% of user-location track points are filtered out even if the positioning environment has changed. This will lead to a situation in which the system cannot accurately determine whether the tunnel environment is indeed changed. When Q RSSI is small, nearly all the user-location track points are judged to be filtered out, which causes an increase in the load of the positioning system. In practical applications, it is necessary to choose a reasonable value. This should not only ensure that the observing sensitivity of underground positioning environment has changed, but should also consider the working efficiency of the positioning system. At the same time, it also should take into account the number of user-location track points filtered by the QPSO-ULTF when the radio fingerprint database is updated adaptively.
positioning system. In practical applications, it is necessary to choose a reasonable value. This should not only ensure that the observing sensitivity of underground positioning environment has changed, but should also consider the working efficiency of the positioning system. At the same time, it also should take into account the number of user-location track points filtered by the QPSO-ULTF when the radio fingerprint database is updated adaptively.

Establishment of Underground Positioning Experiment
This section mainly verifies the positioning performance of the adaptive radio fingerprint database in the tunnel. The experiments are divided into two groups: Experiment 1 and Experiment 2. The tunnel environments of the two groups are different. The AP device used in those two experiments is KJ660W which shown in Figure 6. The mobile device is an intrinsic safety mobile phone which shown in Figure 7. Experiment 1 is aimed at verifying the positioning performance of an adaptive radio fingerprint database. The environment of this experimental tunnel is shown in Figures 5 and 8. There are three AP signals and 32 reference points in the positioning tunnel. The two databases used in this experiment are the traditional radio fingerprint database constructed manually in Section 4.1.2 and the database constructed adaptively. The miners carry out 500 positioning tests for each of these two databases. In order to achieve comparable results, Weight K-Nearest Neighbors (WKNN) [18], Local Discriminant Embedding (LDE) [19,20], and Kernel Principal Component Analysis (KPCA) [21,22] are used to doing the positioning test. Experiment 2 is aimed at verifying the positioning performance of the radio fingerprint database updated adaptively. The environment of this experimental tunnel is shown in Figure 10. As in Experiment 1, the two databases used in Experiment 2 are the traditional radio fingerprint databases constructed manually and the database updated adaptively which environment changed from Figures 8-10. The underground personnel positioning system records and processes the positioning data of miners 500 times as they walked. Similar to Experiment 1, WKNN, LDE, and KPCA are also used for positioning tests.

Experimental Results and Analysis
The positioning results of Experiment 1 are shown in Figure 17 and Table 1. The results in Figure 17 show that the adaptive radio fingerprint database has similar positioning performance with the manually constructed database, and the positioning errors are similar when the confidence probability is greater than 80%. For three positioning algorithms in Table 1, the positioning errors with confidence probability 90% of two radio fingerprint databases are basically the same. The construction of the adaptive radio fingerprint database only needs a small number of calibration samples, which effectively reduces the complexity of the process of off-line location fingerprint acquisition.
with the manually constructed database, and the positioning errors are similar when the confidence probability is greater than 80%. For three positioning algorithms in Table 1, the positioning errors with confidence probability 90% of two radio fingerprint databases are basically the same. The construction of the adaptive radio fingerprint database only needs a small number of calibration samples, which effectively reduces the complexity of the process of off-line location fingerprint acquisition.   The results in Figure 18 and Table 2 show that the adaptive update of radio fingerprints is better able to capture the change in RSS distribution in the positioning environment, and that the positioning performance of radio fingerprint database updated adaptively can also be guaranteed. Although the positioning errors of LDE and KPCA for adaptive radio maps are 0.5 m larger than that of manually radio maps, these errors are acceptable in the application of underground personnel positioning. Moreover, the process of adaptive updating is completely processed by the underground personnel positioning system. Although this update process takes quite a long time for the positioning system (in Experiment 2, it took 1 h, 23 min, and 36 s), the radio fingerprint database can be reasonably updated in the relatively low-frequency period of time when the miners enter or exit the underground positioning area. The superior performance of the adaptive radio fingerprint database is due to the efficient search ability of the potential optimal solution in a multi-dimensional solution space by QPSO, as well as the dynamic extraction ability of particle swarm for individual and overall features of large samples of data.   The results in Figure 18 and Table 2 show that the adaptive update of radio fingerprints is better able to capture the change in RSS distribution in the positioning environment, and that the positioning performance of radio fingerprint database updated adaptively can also be guaranteed. Although the positioning errors of LDE and KPCA for adaptive radio maps are 0.5 m larger than that of manually radio maps, these errors are acceptable in the application of underground personnel positioning. Moreover, the process of adaptive updating is completely processed by the underground personnel positioning system. Although this update process takes quite a long time for the positioning system (in Experiment 2, it took 1 h, 23 min, and 36 s), the radio fingerprint database can be reasonably updated in the relatively low-frequency period of time when the miners enter or exit the underground positioning area. The superior performance of the adaptive radio fingerprint database is due to the efficient search ability of the potential optimal solution in a multi-dimensional solution space by QPSO, as well as the dynamic extraction ability of particle swarm for individual and overall features of large samples of data.

Conclusions
In view of the tedious construction process of a WLAN radio fingerprint database, an adaptive construction and update method of radio fingerprint database based on the QPSO-ULTF is proposed.
The miners' walking trajectories are recorded in real-time by the miners' personal positioning mobile terminal. The data UF t u collected at each time are uploaded to the personnel positioning system server. The system calculates and generates the user-location track according to these feedback packets, and all user-location track points in user-location tracks have their own reference points, which are relatively close to each other. According to the ULTF algorithm, the user-location track points that may contain noise are filtered out, and the filtered user-location track points may be an important parameter for adaptive updating of the radio fingerprint database. Then, by using the quantum properties in the process of particle dynamic search in QPSO, through the multi-dimensional feature learning with small samples of radio fingerprint, the potential global optimal solution is quickly found in the solution space, so as to complete the adaptive generation of radio fingerprints.
Due to the peculiarity of coal mine production scheduling, there will be a certain number of miners entering or exiting the positioning area in a specific time period. Hence, the user-location trajectory can be recorded by a miner's mobile terminal when the miner is walking in the tunnel. If the number of miners is large, in a short period of time, the user-location tracks will be recorded to achieve the requirements for building the radio fingerprint database. To reduce the impact of the update process on the normal operation of the underground personnel positioning system, the adaptive update of the radio fingerprint database can be carried out in the period of relatively low frequency when miners are entering or exiting the underground positioning area.
It can be inferred from the experiment results that the adaptive radio fingerprint database constructed by the QPSO-ULTF has similar positioning performance with the traditional manual database, and it is better able to adaptively adjust to changes in the tunnel environment.