Indoor Positioning System With Cellular Network Assistance Based on Received Signal Strength Indication of Beacon

With the development of the mobile Internet, the demand for indoor location based services(ILBS) is increasing. Applications and devices in indoor environments can determine their position based on Received Signal Strength Indication(RSSI) of bluetooth Beacons. However, because of multipath effects, shadow fading and the blockage of obstacles, RSSI values are unstable for positioning. The propagation model are various in different environments, which have caused great difficulty in high-precision indoor positioning. In this paper, a novel positioning algorithm based on cellular network and bluetooth Beacon’s RSSI is proposed for ILBS. The whole algorithm is divided into two parts: Offline Preparation and Online Positioning. During Offline Preparation, Beacon node is cellular networked in regular quadrilateral; a universal ranging model is derived from traditional ranging model for high-precision positioning. During Online Positioning, missing RSSI values are replaced firstly; next, Outliers Removed Median-Kalman Filter is used to process RSSI, which makes the signal smoother to range; then, the cell in which the mobile terminal is located is determined according to the strongest four RSSI values; after that, using filtered RSSI, distances without height influence could be calculated; finally, Weighted Multi-Point Positioning Algorithm With Cellular Network Assistance is used to calculate the real-time location of the mobile terminal. Experiment results show that our algorithm achieves average accuracy in 0.3m−0.5m and limits the maximum error within 0.8 m.


I. INTRODUCTION
Recently, indoor positioning has been widely used in many application scenarios, such as indoor parking lot, supermarket and hospital. When positioning in indoor environments, services require much higher accuracy than outdoor environments. In outdoor environments, global positioning systems (GPS) can provide high precision services for many applications. Unfortunately, GPS technology does not work successfully in most indoor environments due to GPS signal propagation problems. Many indoor positioning algorithms use Bluetooth Low Energy(BLE)'s Received Signal Strength Index (RSSI) for indoor positioning. Firstly, mobile terminal receives RSSI signal from beacons which are set up in advance. Then, RSSI values are used to calculate the distance The associate editor coordinating the review of this manuscript and approving it for publication was Min Jia . between mobile terminal and beacon. When mobile terminal gets the distance between beacons, triangulation is performed to determine its coordinates. Due to the multipath effect and the time-varying of indoor channels, the error of traditional indoor positioning methods is too high to meet the needs of indoor location based services(ILBS).
In order to improve the accuracy and stability of indoor positioning algorithm, a novel indoor positioning algorithm is proposed in our paper. The algorithm is divided into two parts: Offline Preparation and Online Positioning. During Offline Preparation, the bluetooth nodes are arranged according to a rectangular cellular network; a universal ranging model is derived from traditional ranging model. During Online Positioning, the fluctuation of beacon's RSSI is preprocessed firstly; next, Outliers Removed Median-Kalman Filter is used to further reduce the fluctuation; then, the cell in which the mobile terminal is located is determined VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ according to the strongest four RSSI values; after that, horizontal distances between the mobile terminal and beacons are calculated based on filtered RSSI; finally, a novel positioning algorithm is used to calculate the location of the mobile terminal in the cell. The rest of this paper is organized as follow: Section II introduces some related works in indoor positioning; Section III illustrates some preparation for online positioning; our positioning algorithm is described in section IV; Section V shows the experiment results of proposed algorithm; In Section VI, some android applications based on the proposed positioning algorithm are illuminated; Section VII concludes the paper.

II. RELATED WORK
Traditional indoor positioning methods mainly use WLAN/Wi-Fi, RFID, ZigBee and Ultra-Wideband(UWB) technology [1]. Recently, researchers presents a WiFi-based positioning technique that can improve the localization performance by using time of arrival(TOA) and angle of arrival(AOA) [2]. However, at present, lots of mobile terminals and Access Points do not support ToA/AoA technology. Therefore, this technology is difficult to put into engineering implementation. The work in [3] proposed one RFID indoor positioning system using passive tags. Nevertheless, customized devices are necessary in this indoor positioning system, which would be a burden on business applications.
Recently introduced BLE-based device by Apple which is iBeacon, enables accurate indoor positioning by using Beacon's RSSI. BLE-based indoor positioning algorithms are mainly divided into two categories: ranging-based and nonranging-based. Ranging-based algorithms mainly include RSSI-based positioning algorithms, TOA/AOA-based positioning algorithms and time difference of arrival(TDOA) based positioning algorithms. Non-range-based algorithms are mainly fingerprinting algorithms [4]. Compared with other ranging-based algorithms, RSSI can be easily obtained by mobile device without any additional hardware [5]. In [6], a novel placement was proposed to enhance the accuracy of indoor localization, which has given a great inspiration to the author of this paper. In [7] and [8], researchers proposed some novel methods to estimate the propagation model of actual enviroment, which reveals that positioning performance would be improved by modifying the propagation model. Kalman filter and particle filter can be used to promote GPS positioning [9]. Similarly, kalman filter or other signal processing algorithm can also be used to improve the performance of indoor positioning system.

III. OFFLINE PREPARATION
The indoor positioning system proposed in this paper needs to do the following preparations before positioning. Whether the preparation work is perfect has a huge influence on the positioning result(x,y,F).

A. REGULAR QUADRILATERAL CELLULAR NETWORKING
In this system, Beacon needs cellular networking. Each cell can be an arbitrary regular polygon. In the traditional cellular network, the regular hexagonal network shown in Fig.1(a) is used for network formation. In this algorithm, Beacon is networked using the regular quadrilateral network which is shown as follows. Compared with other regular polygon, regular quadrilateral cellular network makes it easy to cover the actual environment, such as houses, corridors and streets. And the regular quadrilateral cell can simplify the cell selection algorithm in IV-C and the position algorithm in IV-E. In order to perform subsequent positioning algorithms, three sets are defined.
• Position-set: Here, Id 1 − Id n are the cellular identification; X imin and X imax are the X axis coordinates minimum and maximum of the i-th cell; Y imin and Y imax are the Y axis coordinates minimum and maximum of the i-th cell; F 1 − F n are cell's floor number and different i-th cell's floor numbers probably the same; Uuid 1 − Uuid n are the beacons' identification; Uuid i1 ,Uuid i2 ,Uuid i3 and Uuid i4 are the Uuids of Beacon contained in the i-th cell, and each Uuid ij has a Uuid k corresponding to it; h 1 − h n are Beacons' height; X 1 − X n are the X axis coordinates of Beacons'; Y 1 − Y n are the Y axis coordinates of Beacons'; The three sets above are correspond one by one, and there is a mapping relation in them. 6692 VOLUME 8, 2020

B. ESTABLISHMENT OF A NOVEL TYPE OF RANGING MODEL
The positioning algorithm used in our system is rangebased, so the selection of propagation model is crucial for positioning.
In indoor environment, the RSSI received by terminal is usually unstable because of signal's reflection, diffraction and shadowing, so that the radio propagation path loss is not the same as theoretical value. In traditional ranging algorithm, the empirical propagation model is usually used to range. The empirical model is a simple and easy-tounderstand calculation formula which is fitted from a large amount of data. The calculation speed is very fast, and the input of the formula is not complicated. However, one propagation model can only correspond to a series of similar scenes, which makes it difficult for selection of propagation model. Deriving from the traditional propagation model, we deduced a new propagation model that can solve this problem to a certain extent. Some common empirical propagation models are shown below, which are instructive to our creation.
• Log-Distance Path Loss Model: The log-distance path loss model is the most traditional and widely used wireless signal propagation model which is shown in below.
Where γ is the loss factor of transmission, the value is usually between 2-5; X δ[dB] represents the normal random distribution of random noise, and the standard deviation is δ. When ranging, the influence of X δ[dB] is always not considered; d 0 is reference distance. In practice, for the convenience of calculation, usually takes 1m; d is the distance from the transmitting point to the receiving point; PL(d 0 ) is the power at d 0 ; PL(dB) is the power at d, and its unit is dBm. After a series of constant deformations shown in below, the traditional ranging function(5) can be obtained.
10γ log 10 ( • Other Propagation Models: Considering different aspects, researchers have proposed a variety of propagation models. Including some famous models, such as Floor Attenuation Factor Path Loss Model [11], which considers the attenuation caused by different types of buildings and obstacles; Keenan-Motley model [12], which mainly considers the influence of reflection of signals on walls, floors, etc; Multi-wall model [13], which concentrates on the refraction of the wall surface corresponding to the influence of wireless signal propagation; Two-Ray model [14], which considers that all kinds of environment have one reflecting surface. All of these models can simulate the weakness of wireless signals in certain environments. However, the determination of the corresponding relationship relies on experience and a huge amount of data measurements in the current scene, which is a very time consuming task for the construction of indoor positioning systems. In our positioning system, the PL(dB) shown in the model is the RSSI in practice. According to the actual situation, the specific model can be used for adaptation. However, this requires long-term testing to determine the model. Because these models all have one thing in common, that is the RSSI value decreases as distance increases within a range , which is about 1m−9m in experiment. Begin with this common thing, assuming the mapping function of RSSI and d in range of as follows.
When the d is in the range of , the above function monotonically decreases, and the corresponding range of RSSI is [RSSI min , RSSI max ]. So there must be an inverse function as shown below.
Then, using Taylor expansion, inverse function(7) could be expanded.
Here, R n (x) is the Piano residual and its value is o[(RSSI − RSSI 0 ) n ]. Next, (RSSI − RSSI 0 ) k in (8) can be expanded according to polynomial expansion which is shown in below.
Combined these above functions then simplifying the coefficients therein, ideal ranging model can be obtained, which is shown in below. Since this ranging model is extended by the traditional empirical model, it can adapt better to different environments.
Nevertheless, the value of n cannot be infinite in practical. The larger the n, the higher the complexity of the ranging algorithm is. In this paper, expanding the formula to N -th order, the value of N will be determined according to the VOLUME 8, 2020 results of experiment shown in V. Because the value of R(n) can be ignored, (10) could be simplified as follows.
However, when RSSI / ∈ , this ranging formula cannot successfully calculate d. RSSI can map the distance between mobile terminal and Beacon to a certain extent. The larger the RSSI, the smaller distance is. Therefore, the threshold can be set to process the RSSI , and then the proposed ranging function is obtained in below.

IV. ONLINE REAL-TIME POSITIONING ALGORITHM
After the preparation is completed, the positioning can proceed successfully. It is called Online Real-Time Positioning Algorithm because the input of this system is obtained in real time using Android mobile terminal. The period of received RSSI signal acquisition is 0.1s and the system can output results in about 10−20ms, which can meet application's needs for real-time positioning

A. RSSI VALUE PREPROCESSING
The received RSSI is very unstable, and due to the different quality of service(QoS) of the receiver, there will be some RSSI data loss, and the loss rate increases as d increases as shown in Table.1, where d refers to the distance between the mobile terminal and the Beacon. Thus the loss of RSSI needs to be processed before any further process. In this algorithm, the lost RSSI value will be substituted, which is shown as follows.
Here, RSSI s [n] means the RSSI substitution when the RSSI is loss. In order not to add extra gain to the signal, the ± operation in the formula uses the subtraction in this experiment. If use addition to perform operations, when the user is away from one Beacon and close to another Beacon, the far-end Beacon's RSSI signal will always be lost, and the far-end Beacon's RSSI s [n] may be higher than the nearend Beacon's RSSI . RSSI [n − 1] means the RSSI value at last moment; RSSI is the changing value of RSSI [n − 1]. Assuming that the walking speed of people walking indoors is about 2m/s∼3m/s, and the sampling period of terminal device is 100ms. RSSI would be calculate as shown in below.
In (15), RSSI (d) is the derivative of inverse function of the ranging function in (12). Therefore, RSSI presumably less than 0.2db in practical. Then, substitute RSSI = 0.2 into (13), which consider that device is always leaving away from Beacon. After substitution, the RSSI signal will become more continuous and the data's mutation rate will be significantly decreased, as shown in the figure below. In Fig.2, blue line shows the received RSSI that the Beacon is 1m away and facing directly to the mobile device; red line means the RSSI after substitution. As shown in the figure, RSSI value equal to −100dB means the loss of Beacon signal. After substitution, RSSI varies still vigorously from −60dB to −75dB. Thus the fluctuation of RSSI should be processed in the next step.

B. OUTLIERS REMOVED MEDIAN-KALMAN FILTER
The RSSI sequences after the substitution still have significant fluctuations. For this, the Outliers Removed Median-Kalman Filter proposed in this subsection can be used to further process the RSSI signal to make the signal stable. This filter combined several signal processing technology which is shown in above.
• Median filter: Median filter is to average multiple RSSI values to avoid the randomness which is shown as follows.
• Outliers Removing: the RSSI values are not stable and have some outliers, which make the average RSSI value not precise enough. Therefore, it's necessary to stripe these outliers before filtering. The most intuitive outliers is the maximum RSSI and minimum RSSI.
• Kalman filter: Kalman filter can be used to dynamic data to obtain a smooth numerical output, so the filter can be used to make the RSSI output smooth. Kalman filter can be divided into prediction stage and correction stage, which is shown as follows. 1) Prediction stage: 2) Correction stage: Here,RSSI n indicates the priori state estimate at time slot n;RSSI n andRSSI n−1 represents the posterior state estimation value at time slot n and n − 1; A indicates the state transition matrix; B and u n jointly control the input gain, in this algorithm, set them to 0;P n represents the priori estimate covariance at time slot n; P n andP n−1 respectively represent the posteriori estimation covariance at time slot n and n − 1, which is one of the filtering results; Q represents the covariance of the process excitation noise, which is the error between the state transition matrix and the actual process; K t represents the Kalman gain and is the intermediate result of the filtering; Z n indicates measured value at time slot n; H represents the measurement matrix; R indicates the measurement noise covariance, which is a numerical value, which is a characteristic associated with the instrument, as a known conditional input filter Combining these characteristics, the Outliers Removed Median-Kalman Filter can be designed to process the RSSI signal, after that the estimate RSSI signal is stable enough to perform the positioning algorithm. The process of Outliers Removed Media-Kalman filter is shown in above.
1) Stored ten recent RSSI in container R. If the amount of data currently received is less than 10, calculate RSSI m as the output RSSI f of this Filter according to (16). 2) If the amount of data currently in R is equal to 10, Removed the maximum and minimum RSSI in R, then according to (16), the mean RSSI of the remaining RSSI is obtained, refered as RSSI m . 3) According to the output of the algorithm at the previous moment, the prediction is performed using (17) R is an empirical and adjustable data which value is 3.719 determined by the results of experiment.P t will converge soon after iteration, so the initial value ofP t is not important. The initial value ofP t is 2.741 which is also an empirical data determined by experiment. 5) Finally, theRSSI t of the correction stage in the Kalman Filter is used as the output RSSI f of the Outliers Removed Median-Kalman Filter. In Fig.3, blue line expresses the filtered RSSI; red line means the RSSI after substitution. As shown in the figure, the stability of the RSSI sequences has been greatly improved, and the fluctuation is between −60dB and −64dB. This reason of promotion is that the outliers are stripped off before the Median-Kalman filter algorithm. After filter, the RSSI value tends to be stable, and the subsequent positioning algorithm can be entered.

C. CELL SELECTION ALGORITHM
Filtered RSSI calculated in IV-B are used to determine the cell in which the mobile terminal is located in. Once the area of the cell is accurately determined, the result of positioning algorithm must be within the area. In order to make full use of the existing RSSI data and not make this part of the algorithm too time consuming. This paper designs a cell selection algorithm to determine the cell which most likely to contain position result(x,y,F). The specific algorithm steps are as follows.
In (22), W is the weight coefficient column vector (4 × 1) which is determined by experiment result. The value of M are adjustable according to positioning environment. The result B is a column vector(M × 1) used to determine which cell the current position is in. 8) Determine that the firts index corresponding to the largest element in B is I , then the I -th Cell in the φ is the result of the algorithm output referred asĈ. The positioning result is most likely to be inĈ. In practice, M may be 1, 2, 3, 4, 6, 16 or other value as shown in Fig.4, which doesn't list all the possible situations, but those missing situations are actually undesired. If M = 1 or 2, it will occur when the algorithm peforming is normal. If M > 2, it is abnormal. Although the above selection algorithm can still outputĈ when M > 2, the probability of selection error will be greatly improved. Only when the user is away from the location area or some Beacons in the location area broken will cause M > 2. Using the value of M can monitor whether the positioning system is faulty, or whether the user leaves the location area.

D. RSSI RANGING WITHOUT HEIGHT INFLUENCE
According toĈ determined in IV-C, only need to calculate the distance between the mobile terminal and the Beacon inĈ, which will reduce the complexity of the algorithm. Then using RSSI f and proposed ranging function (12), these distances can be successfully calculated. However, this results of ranging is the three-dimensional(3D) distance with influence of height.
In order to eliminate the influence of the vertical distance between the terminal and the Beacon, the Pythagorean theorem is used to calculate the horizontal distance, then d i will be used instead of d i for positioning algorithm, it is shown as follows.

E. WEIGHTED MULTI-POINT POSITIONING ALGORITHM WITH CELLULAR NETWORK ASSISTANCE
The distance among the four Beacons in theĈ and the mobile terminal has been calculated in IV-D. Traditional triangulation uses only three Beacons for positioning, which obviously does not make full use of the existing RSSI values. Based on the traditional triangulation algorithm, this paper proposes a new positioning algorithm. Since terminal is currently inĈ, in order to fully use the RSSI information, multiple triangulation can be performed, and these results can be integrated in a weighted manner. Based on the above ideas, the Weighted Multi-Point Positioning Algorithm With Cellular Network Assistance is designed for indoor positioning. The specific steps of algorithm are as follows.

4) However, there is often no intersection between
Beacon circles, as shown in above. Therefore, it is necessary to adjust the radius in special cases and regenerate the transaction point for positioning. The specific adjustable algorithm step is shown as follows(5−7): 5) When the two circles are separated, The principle of adjustment is to make d 1 and d 2 increase proportionally and finally satisfy d 1 + d 2 = d 12 , which is shown in below. The dotted line in the figure is the circle corresponding to the radius after adjusted, and the solid   line is the circle corresponding to the original d i .
6) When the two circles are included,the principle of adjustment is to make d 1 increase proportionally and d 2 decrease proportionally and finally satisfy d 2 − d 1 = d 12 . The radius' adjusting method is shown as follows. A  and B), the third Beacon's position B 3 is used as an aid to determine the intersection. The AB 3 and BB 3 VOLUME 8, 2020 are cached, then the smaller one correspond point will be selected as the intersection. The process is shown in Fig.10. In this situation, A are chosen as the intersection of positioning algorithm.

8) After the radius adjustment, the three intersections
A(x i1 ,y i1 ),B(x i2 ,y i2 ) and C(x i3 ,y i3 ) can be obtained using Beacon-set, where i represent the i-th triangulation of positioning. Then, it is necessary to judge whether the three intersections are located in theĈ.
If not in the cell, take the point closest to the intersection point in the cell instead, which is shown as follows. In Fig.11, O represents the actual position, T is the intersection point, and R is the replacement point after the cell limitation. Obviously, this method can greatly reduce the maximum error. Because it is a square cell, you only need {X imax , X imin , Y imax , Y imin } in the Position-set(which is defined in III-A) to easily determine whether it is inside theĈ and choose the replacement point. Then, according to (26), the center(x i , y i ) of the triangle is calculated as the output of the positioning algorithm.
. When the intersection out of cell.
In (27), a i is the weight of the i-th positioning result. Since d 1 , d 2 , d 3 , and d 4 are incremented, which means that the position point is nearest to B 1 and second nearest to B 2 and so on, the corresponding weights should also be successively decremented. In this paper, using the coefficients α i as shown in Table.2, which is the empirical value determined by experiment result. These coefficients are adjustable according to positioning environment. 10) Finally, usingĈ and Position-set(which is defined in III-A), floor where the current positioning point is located are determined, which is used to complete the positioning data(x, y, F).

V. EXPERIMENTS & RESULTS
In order to determine the parameter of N shown in (12) and verify the performance of the proposed algorithm, the positioning experiment is designed. In this section, we will introduce our environment of experiment and show the result and performance of proposed positioning algorithm.

A. ENVIRONMENT OF EXPERIMENT
The environment of experiment is a three-floor high office building, which is shown in Fig.12. The mobile terminal is OPPO R17 PRO. In this experiment, the SHEN-DA infrared range finder is used for distance measurement. The error of the instrument is ±1.5mm, and the maximum measurement distance is 100m. Therefore, it can be considered that there is almost no measurement error in the course of this experiment. Use the lower left corner of the first floor room as the starting point(0,0,F 1 ) of the coordinates, and the Position-set can be acquired easily.

B. DETERMINATION OF RANGING FUNCTION
Before performing the positioning algorithm test, it is necessary to determine the corresponding parameters in the ranging function (12) and compare it with traditional ranging function (5). Because there are a lot of Beacons in experiment, it is impossible to fit the ranging function for all Beacons.
In the experiment, 5 Beacons are selected in the scene for data acquisition. Data acquisition is performed every 0.5m within 1−9m, and 1000 sets of RSSI is collected in each distance. Then, the standard deviation and expectation of these data are calculated, which is std and EX below. Next, the outliers RSSI are stripped of in which is satisfied.
In order to integrate thousands of RSSI data, we calculate the average value RSSI (i) j of the remaining RSSI data. The superscript i identifies the data corresponding to the i-th Beacon, and the subscript j identifies the data at the jm. Then, RSSI (i) j are further integrated into RSSI j , which is shown in below.
The RSSI j represents the RSSI of Beacon at jm, which will be used to fit the proposed ranging function (12) and traditional ranging function (5). When N in (12) is greater than or equal to 6, there is almost no difference in the range . So we fit the case where N is less than 6 and the fitting functions' parameters is shown in the following TABLE.3, where N /A means this parameter is not applicable in current ranging function. All these parameters are obtained using knowledge of curving fitting. The graph of the fitting function is shown as Fig.13. To quantify the performance of these ranging functions and determine the value N , MAE R (Mean Absolute Error of Ranging), RMSE R (Root Mean Square Error of Ranging) and Time Cost is used to measure the accuracy and efficiency of VOLUME 8, 2020 ranging functions, as is shown in follows. Whered i is the estimated value of the i-th distance measurement which is the output of ranging function; d i is the corresponding true value; n is the sampling numbles.
In this experiment, we select 3 Beacons and collect 1000 sets of RSSI values in 1m, 2m, · · · , 9m. These data are used to calculate MAE and RMSE of different distance. Then, We use mobile terminal statistics Time Cost of ranging functions.
The performances of these ranging models are shown in Fig.14 and TABLE.4. These performances indicates that when N is greater than 4, the improvement of ranging model is absolutely small. However, it costs more time, so we let N = 4 and only consider this situation in subsequent analysis. These measurements shown in follows illustrate that the MAE of proposed ranging function have reduced by 30.13% and RMSE have reduced by 24.85%.

C. PERFORMANCE OF POSITIONING ALGORITHM
In IV-C, the mobile terminal uses the filtered RSSI for cellular selection. At the same time, the location of the cell determines which floor the mobile terminal is located on. Therefore, it is necessary to collect data to show how effective the cell selection algorithm is. We collect data in 5 different locations in the same room, collect 1000 sets of data in each location, and count the probability of selection error, which shown in TABLE.5. The error rate of selection algorithm is less than 0.5%, so in the subsequent analysis, selection error's situation are not considered. In position algorithm, make the error shown in (32) as a standard for measuring the point error, here, (x, y), is the estimated coordinates of the terminal, (X , Y ) is the terminal coordinates Simulations and real tests were executed to evaluate the proposed positioning algorithm performance. The three locations (1, 1, F 3 ), (2, 2, F 2 ), and (3, 3, F 1 ) are selected for the positioning test, and the test results are shown in Fig.15; the title of each figure represents the average error of each test location. As shown in the follows, the proposed algorithm can make the positioning error lower and the positioning mutation is also effectively processed.
After that, all the data were combined for statistical analysis. MAE P (Mean Absolute Error of Positioning) and RMSE P (Root Mean Square Error of Positioning) and SD P (Standard Deviation of Positioning) are calculated, which is shown in follows.
These indicators can reflect the results of the experiment from different aspects. SD can evaluate the degree of change in the data, MAE and RMSE can better reflect the predicted value error. The smaller the value of SD, the better the accuracy of the experimental data. In (33)−(35), n is the number of samples,x i andŷ i are the i-th estimate of the X and Y axis position; x and y are the ideal position reference coordinates; u x and u y are the expectations ofx i andŷ i . The properties, improvements and time cost of this proposed method are shown in follows distance error's histogram and performances TABLE.6. These measurements show that RMSE have reduced by 48.79%, MAE have reduced by 52.71% and SD have reduced by 83.65%, however, the proposed algorithm are more complex compared with traditional algorithm, which raises time cost to 2.411ms. Fortunately, the disadvantage of time cost does not reduce the real-time performance of the positioning system. Fig.15∼17 shows that our algorithm achieves an average positioning accuracy of 0.3m−0.5m. Proposed algorithm has obvious optimization compared to traditional algorithms.

VI. APPS BASED ON PROPOSED POSITIONING ALGORITHM
One of the contributions of this indoor positioning research is developing several customized applications for mobile terminal based on Android which was developed by Google.  These applications can implement a wide range of functions: RSSI data collection; Online Positioning; Indoor Navigation and Intelligent Parking.
• RSSI data collection: sampling app could receive RSSI signal in any period and store it in a ''.db'' file as is shown in Fig.18(a). Our developed app records the data in three aspects: X-axis coordinate, Y-axis coordinate, floor identification(F i ) and RSSI of Beacons. VOLUME 8, 2020 This app can set the number of sampling points N and the sampling period T through the User Interface(UI). These collected data would be used to determine the ranging model, analysis ranging model and positioning algorithm.
• Online Positioning: this function can be realized by the positioning app. The positioning environment is a twofloor parking lot which is located in Chengdu, China. First of all, app download the ''.db'' file from server which include the dataset and ranging model. Then, using proposed algorithm to achieve real-time positiong. The black logo is the position(x, y) of mobile terminal and the current floor identification(F i ) is displayed at the bottom text of the UI, which is shown in Fig.18(b).
• Indoor Navigation: after combining with the traditional A-star algorithm [15], Viterbi decoding [16], and hidden markov model(HMM) technology [17](these are not the focus of this paper), the effect of indoor navigation can be realized. The UI interface of the indoor navigation app is shown in the Fig. 18(c). Users can reach any location within the building.
• Intelligent Parking: combined all the functions which is illuminated above, a intelligent parking(iParking) system have been developed to satisfy people's demand about parking. The specific implementation steps of this iParking system are as follows: 1) First of all, driver arrived at a strange environment, he wants to know where parking is available. 2) Then, he can use our app to make a parking reservation. After reservation, the lock based on Embedded Systems will close to ensure that the parking space is owned by the user. 3) Next, the outdoor navigation system based on GPS will guide the driver reach the entrance of parking lot. 4) When the distance between driver and entrance of parking lot less than 10m, outdoor navigation would transform to indoor navigation.

5)
After that, the indoor navigation system will guide the driver reach to the booked parking space using proposed positioning algorithm. 6) When the distance between driver and the specific parking place less than 3m, voice system would remind user to pay for the parking. 7) After the payment is completed, the lock would open and the driver could stop at the designated parking space. This intelligent parking system has been put into use in Chengdu and is currently in the internal testing stage.

VII. CONCLUSION
In this paper, a novel algorithm is proposed for indoor positioning. The whole algorithm is divided into two parts: Offline Preparation and Online Positioning. On Offline Preparation, positioning space should be networked in regular quadrilateral; a universal ranging model is derived from traditional ranging model for high-precision positioning. On Positioning Algorithm, first step is pre-processing RSSI to substitute the loss of RSSI. Next, proposed filter are used to make the input RSSI signal more smoothy. Then the filtered RSSI would be used to determine which cell the mobile terminal is most likely to be in. Before positioning, distance between mobile terminal and Beacon is calculated using the filtered RSSI. Finally, mobile device's position (x, y, F) is determined by Weighted Multi-Point Positioning Algorithm With Cellular Network Assistance. Results show that the proposed algorithm achieves an average positioning accuracy of 0.3∼0.5m and this method can correctly judge the floor where the mobile terminal is located. The advantage of this positioning system is accuracy and real-time performance.