Positioning method based on indoor Bluetooth fingerprints
By combining UWB and Bluetooth technology, a fast offline fingerprint database is constructed and a particle filter algorithm is used for online matching, which solves the problems of high workload and low accuracy in traditional indoor Bluetooth fingerprint positioning methods, and achieves efficient and accurate indoor positioning.
Patent Information
- Application Number
- CN202410781450.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-05-22
- Filing Date
- 2024-06-18
- Publication Date
- 2024-08-23
Smart Images

Figure CN118540790A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of indoor positioning, and in particular relates to a positioning method based on indoor Bluetooth fingerprint. Background Art
[0002] In indoor positioning, Bluetooth fingerprint positioning is usually used to achieve high-precision indoor positioning. Bluetooth fingerprint positioning technology is mainly divided into two stages, offline and online. The offline stage is also the fingerprint collection stage. By collecting information on Bluetooth signal strength at different locations in a specific area (usually involving multiple Bluetooth transmitters), the Bluetooth signal strength at each location is recorded separately to form a unique "fingerprint". All collected fingerprint data is stored in the database. Each fingerprint corresponds to a specific location, thus establishing a fingerprint library. The online stage is also the location matching stage. When the user's device needs to be positioned, it will collect the strength information of the surrounding Bluetooth signals in real time and compare it with the data in the fingerprint library. Through the online matching algorithm, a specific algorithm is used to find the fingerprint that is most similar to the current signal strength, thereby determining the user's location. The advantage of fingerprint positioning is that it almost does not require reference measurement points and has relatively high positioning accuracy. However, the traditional workload of establishing an offline fingerprint library is huge, requiring a lot of manpower, financial resources and time, and it is difficult to adapt to scenes with large environmental changes. Traditional online matching algorithms, such as deterministic algorithms and probabilistic algorithms, have low positioning accuracy and large computational complexity, which greatly consumes people's time and energy. Therefore, it is very important to design a solution to optimize both offline fingerprint database establishment and online matching algorithm.
[0003] The Chinese invention patent with announcement number CN113453148B discloses an indoor position fingerprint positioning method combining deep learning with a weighted K-nearest neighbor algorithm. The method first collects WLAN signal feature data in the positioning area to establish a fingerprint library to train a convolutional neural network, and then performs an initial positioning of the user's position based on the trained CNN network model. The theoretical range of the user in the positioning area is then determined based on the user's initial positioning coordinates, and the weighted K-nearest neighbor algorithm is applied in the local Bluetooth Mesh network to accurately locate the user's position, and finally the user's precise position coordinates are fed back to the user device; however, training the convolutional neural network requires a large amount of fingerprint data and time to complete, which will consume a lot of manpower and time costs for data collection, and it is necessary to ensure good data quality, otherwise it will affect the accuracy and stability of the model. In addition, in the positioning stage, the computational complexity of this method will also weaken the positioning performance of the system. Summary of the invention
[0004] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide an optimization method based on indoor Bluetooth fingerprint positioning, which combines UWB and Bluetooth by establishing an offline fingerprint library, and corresponds the position coordinates to the RSSI sequence of Bluetooth one by one, so as to complete the rapid construction of the offline fingerprint library, replace the traditional manual library construction, greatly save time, and improve the efficiency of library construction; in the online matching stage, by making a position assumption by the RSSI sequence collected by Bluetooth, the error of the current assumed position is reduced by using the difference between the RSSI sequence of the assumed position and the RSSI sequence of the UWB collection position, the positioning result is constrained, and the generation of position jump is avoided, and then the assumed position corresponding to the minimum difference is updated by using particle filtering, and the optimization is continuously iterated to finally obtain the position positioning result closest to the real position; the present invention has the characteristics of high positioning result accuracy and high positioning efficiency.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] A positioning method based on indoor Bluetooth fingerprint includes the following steps:
[0007] Step 1: Build an offline fingerprint library, which includes the location coordinates (x i ,y i ) and the RSSI sequence collected by Bluetooth; installing several transmitting terminals in the collection area, the transmitting terminals include UWB base stations and Bluetooth beacons; installing a receiving terminal on the mobile device, the receiving terminal includes a UWB tag and a Bluetooth gateway, collecting the location coordinates of the UWB base station through the UWB tag, and collecting the RSSI sequence of the Bluetooth beacon through the Bluetooth gateway;
[0008] Step 2: Perform least squares fitting on the location coordinates collected by UWB in step 1 and the RSSI sequence collected by Bluetooth, so that the location coordinates collected by UWB correspond to the RSSI sequence collected by Bluetooth one by one, and obtain the RSSI weight matrix;
[0009] Step 3: Make a position assumption for the RSSI sequence collected by Bluetooth in step 1 to obtain the assumed position coordinates corresponding to the RSSI sequence collected by Bluetooth; input the assumed position coordinates into the RSSI weight matrix for online position matching to obtain the position positioning result.
[0010] The process of building the offline fingerprint library in step 1 is as follows:
[0011] Step 1.1: The process of collecting location coordinates by UWB is as follows:
[0012] Step 1.1.1: Receive the transmission time of the ranging signal between the UWB tag and the UWB base station through the UWB tag; then calculate the signal flight time TOF according to the transmission time of the ranging signal between the UWB tag and the UWB base station based on the TWR ranging method; finally, multiply the signal flight time TOF by the electromagnetic wave transmission rate to obtain the distance between the UWB tag and the UWB base station;
[0013] Step 1.1.2: The position coordinates of three non-collinear UWB base stations are randomly received through the UWB tag, and then the distances between the three non-collinear UWB base stations and the UWB tag are obtained according to step 1.1.1; based on the trilateral positioning method, the position coordinates of the three non-collinear UWB base stations and the distances between the three non-collinear UWB base stations and the UWB tag are substituted into the tag position calculation formula to obtain the position coordinates of the UWB tag;
[0014] Step 1.2: Collect the RSSI sequence of the Bluetooth beacon through the Bluetooth gateway;
[0015] Step 1.2.1: There are several Bluetooth beacons in the collection area. Each Bluetooth beacon transmits a broadcast packet in the collection area according to the preset transmission power. The broadcast packet contains the initial RSSI values of different signal strengths. The initial RSSI value is an unordered sequence data;
[0016] Step 1.2.2: Filter the initial RSSI values obtained in step 1.2.1, filter out missing items in the initial RSSI values and complete the values of the missing items to obtain an ordered RSSI sequence.
[0017] The calculation formula of signal flight time TOF in step 1.1.1 is as follows:
[0018]
[0019] Among them, TOF is the signal flight time, T1 is the time from the UWB tag sending out the ranging signal to receiving the feedback signal from the UWB base station, T2 is the time from the UWB base station receiving the UWB tag ranging signal to sending the feedback signal and the secondary ranging signal, T3 is the time from the UWB tag receiving the feedback signal and the secondary ranging signal from the UWB base station to sending the feedback signal, and T4 is the time from the UWB base station sending out the secondary ranging signal to receiving the feedback signal from the UWB tag.
[0020] The label position calculation formula in step 1.1.2 is as follows:
[0021]
[0022] Among them, (x i ,y i) represents the location coordinates of the UWB tag, (x1, y1), (x2, y2) and (x3, y3) represent the location coordinates of the three UWB base stations respectively, and l1, l2 and l3 represent the distances between the three UWB base stations and the UWB tag respectively.
[0023] The formula for the filtering process is as follows:
[0024]
[0025] Wherein, x[k] represents the sample value with index k in the signal sequence, y[k] represents the sample value after the signal sequence is processed, and M represents the normalization factor.
[0026] The least squares fitting formula in step 2 is as follows:
[0027]
[0028] in, represents the RSSI weight matrix, X is the RSSI sequence collected by Bluetooth, Y is the location coordinate collected by UWB, and T is the transpose of the matrix.
[0029] The online position matching process in step 3 is as follows:
[0030] Step 3.1: Input the assumed position coordinates into the RSSI weight matrix, find the UWB collected position coordinates with the smallest difference between the assumed position coordinates and all the UWB collected position coordinates in the RSSI weight matrix, and the RSSI sequence collected by Bluetooth corresponding to this UWB collected position coordinate is the RSSI sequence of the assumed position;
[0031] Step 3.2: Calculate the difference between the RSSI sequence of the assumed location and the Bluetooth RSSI sequence of the collected location to obtain the likelihood probability of the assumed location;
[0032] Step 3.3: Set a likelihood probability threshold, and input the assumed position coordinates corresponding to the likelihood probability threshold that are higher than the threshold into the constructed particle filter model for updating until the number of iterations reaches the set value to obtain the position positioning result.
[0033] The expression of the particle filter model is as follows:
[0034] f(f(k-1),k)=0.5f(k-1)+2.5f(k-1) / (1+f(k-1) 2 )+8cos(1.2k)+w
[0035] Among them, f(f(k-1), k) is the state quantity of the position coordinates of the current K-th Bluetooth RSSI value, f(k-1) is the state quantity of the position coordinates of the current K-1-th Bluetooth RSSI value, cos(1.2k) is the compensation amount of the position coordinates of the current K-th Bluetooth RSSI value, and w is the Gaussian noise of the position coordinates of the current K-th Bluetooth RSSI value.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] In the offline fingerprint library collection stage, the present invention collects signal values in the collection area by carrying a receiving end (UWB tag and Bluetooth gateway) on a mobile device. Compared with the prior art in which network nodes are manually arranged in the positioning area and a collection device with a WIFI module is used for collection, the present invention greatly reduces the manpower and time spent on the arrangement. At the same time, the motion state and motion trajectory of the mobile device are highly flexible. For complex and changeable indoor scenes, the receiving end and the transmitting end can also respond and change quickly, thereby improving the applicability of the Bluetooth fingerprint library positioning method. In the position coordinate positioning stage, compared with the weighted K-nearest neighbor algorithm in the prior art, the present invention makes a position assumption on the RSSI sequence collected by Bluetooth, and uses the difference between the RSSI sequence of the assumed position and the RSSI sequence of the UWB collection position to reduce the error of the current assumed position, constrains the positioning result, and avoids the generation of position jumps. Then, a particle filter is used to update the assumed position corresponding to the minimum difference, and the optimization is continuously iterated to finally obtain a position positioning result closest to the real position. The present invention has the characteristics of high positioning result accuracy and high positioning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 The present invention is a flow chart of a positioning method based on indoor Bluetooth fingerprint.
[0039] Figure 2 A comparison diagram of the positioning trajectory provided by the present invention and the actual trajectory. DETAILED DESCRIPTION
[0040] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0041] like Figure 1 and Figure 2 As shown, a positioning method based on indoor Bluetooth fingerprint includes the following steps:
[0042] Step 1: Build an offline fingerprint library, which includes the location coordinates collected by UWB and the RSSI sequence collected by Bluetooth; install several transmitters in the collection area, the transmitters include UWB base stations and Bluetooth beacons, and the UWB base stations include a UWB master base station and several UWB slave base stations; install a receiving end on the mobile device, the receiving end includes a UWB tag and a Bluetooth gateway, collect the location coordinates of the UWB base station through the UWB tag, and collect the RSSI sequence of the Bluetooth beacon through the Bluetooth gateway;
[0043] In this embodiment, the collection area is a rectangular area of 30m*4.2m, and the mobile devices collect relevant signals at intervals of 60cm; four transmitters are placed at the four corners of this area, one of which is a UWB master base station and the other three are UWB slave base stations;
[0044] Step 1.1: The UWB tag collects the location coordinates of the UWB base station;
[0045] Step 1.1.1: Receive the transmission time of the ranging signal between the UWB tag and the UWB base station through the UWB tag; then calculate the signal flight time TOF based on the transmission time of the ranging signal between the UWB tag and the UWB base station based on the TWR ranging method; finally, multiply the signal flight time TOF by the electromagnetic wave transmission rate to obtain the distance l between the UWB tag and the UWB base station i ;
[0046] The calculation formula of the signal flight time TOF is as follows:
[0047]
[0048] Wherein, TOF is the signal flight time, T1 is the time from when the UWB tag sends the ranging information to when it receives the feedback information from the UWB base station, T2 is the time from when the UWB base station receives the ranging information from the UWB tag to when it sends the feedback information and the secondary ranging information, T3 is the time from when the UWB tag receives the feedback information and the secondary ranging information from the UWB base station to when it sends the feedback information, and T4 is the time from when the UWB base station sends the secondary ranging information to when it receives the feedback information from the UWB tag;
[0049] Step 1.1.2: The position coordinates of three non-collinear UWB base stations are randomly received through the UWB tag, and then the distances between the three non-collinear UWB base stations and the UWB tag are obtained according to step 1.1.1; based on the trilateral positioning method, the position coordinates of the three non-collinear UWB base stations and the distances between the three non-collinear UWB base stations and the UWB tag are substituted into the tag position calculation formula to obtain the position coordinates of the UWB tag; the tag position calculation formula is as follows:
[0050]
[0051] Among them, (x i ,y i ) represents the position coordinates of the UWB tag, (x1, y1), (x2, y2) and (x3, y3) represent the position coordinates of the three UWB base stations, l1, l2 and l3 represent the distances between the three UWB base stations and the UWB tag respectively;
[0052] Step 1.2: Collect the RSSI sequence of the Bluetooth beacon through the Bluetooth gateway;
[0053] Step 1.2.1: There are several Bluetooth beacons in the collection area. Each Bluetooth beacon transmits a broadcast packet in the collection area according to the preset transmission power. The broadcast packet contains the initial RSSI values of different signal strengths. The initial RSSI value is an unordered sequence data;
[0054] The preset transmission power in this embodiment is 200ms / time;
[0055] Step 1.2.2: Filter the initial RSSI value obtained in step 1.2.1, filter the missing items in the initial RSSI value and complete the values of the missing items to obtain ordered RSSI sequence information; the formula for the filtering process is as follows:
[0056]
[0057] Where x[k] represents the sample value with index k in the signal sequence, y[k] represents the sample value after signal sequence processing, and M is a normalization factor used to average the sample values in the window;
[0058] Step 2: Perform least squares fitting on the location coordinates collected by UWB in step 1 and the RSSI sequence collected by Bluetooth, so that the location coordinates collected by UWB correspond to the RSSI sequence collected by Bluetooth one by one, and obtain the RSSI weight matrix;
[0059] The least squares fitting formula is as follows:
[0060]
[0061] in, represents the RSSI weight matrix, X is the RSSI sequence collected by Bluetooth, Y is the location coordinate collected by UWB, and T is the transpose of the matrix;
[0062] Step 3: Make a position assumption for the RSSI sequence collected by Bluetooth in step 1 to obtain the assumed position coordinates corresponding to the RSSI sequence collected by Bluetooth; input the assumed position coordinates into the RSSI weight matrix for online position matching to obtain the position positioning result.
[0063] Step 3.1: Input the assumed position coordinates into the RSSI weight matrix to find the UWB collected position coordinates with the smallest difference between the assumed position coordinates and all the UWB collected position coordinates in the RSSI weight matrix. The RSSI sequence collected by Bluetooth corresponding to the UWB collected position coordinates is the RSSI sequence of the assumed position.
[0064] Step 3.2: Calculate the difference between the RSSI sequence of the assumed location and the Bluetooth RSSI sequence of the collected location to obtain the likelihood probability of the assumed location;
[0065] Step 3.3: Set the likelihood probability threshold, remove the assumed position coordinates below the likelihood probability threshold, and input the assumed position coordinates corresponding to the likelihood probability threshold into the constructed particle filter model for updating until the number of iterations reaches the set value to obtain the position positioning result;
[0066] The expression of the particle filter model is as follows:
[0067] f(f(k-1),k)=0.5f(k-1)+2.5f(k-1) / (1+f(k-1) 2 )+8cos(1.2k)+w
[0068] Where f(f(k-1), k) is the state quantity of the position coordinates of the current K-th Bluetooth RSSI value, f(k-1) is the state quantity of the position coordinates of the current K-1-th Bluetooth RSSI value, cos(1.2k) is the compensation amount of the current K-th Bluetooth RSSI value, and w is the Gaussian noise of the position coordinates of the current K-th Bluetooth RSSI value;
[0069] In this embodiment, the likelihood probability threshold is set to 50%, and the number of iterations is set to 1000.
[0070] In order to evaluate the positioning matching algorithm of the present invention, the K nearest neighbor algorithm (KNN) and the weighted K nearest neighbor algorithm (WKNN) in the prior art are compared, as shown in Table 1;
[0071] Table 1 shows the error related parameters of the positioning results
[0072] Algorithm Type Average positioning error variance KNN 1.70 0.74 WKN 1.68 1.76 Algorithm of the present invention 1.32 0.52
[0073] It can be seen from Table 1 that, compared with the K nearest neighbor algorithm (KNN) and the weighted K nearest neighbor algorithm (WKNN) in the prior art, the average positioning error and variance of the positioning results obtained by the positioning method of the present invention are greatly reduced, indicating that the positioning results of the present invention are more accurate.
Claims
1. A positioning method based on indoor Bluetooth fingerprint, characterized in that: The following steps are involved: Step 1: Build an offline fingerprint library, which includes the location coordinates collected by UWB and the RSSI sequence collected by Bluetooth; install several transmitters in the collection area, including UWB base stations and Bluetooth beacons; install a receiving end on the mobile device, including a UWB tag and a Bluetooth gateway, collect the location coordinates of the UWB base station through the UWB tag, and collect the RSSI sequence of the Bluetooth beacon through the Bluetooth gateway; Step 2: Perform least squares fitting on the location coordinates collected by UWB in step 1 and the RSSI sequence collected by Bluetooth, so that the location coordinates collected by UWB correspond to the RSSI sequence collected by Bluetooth one by one, and obtain the RSSI weight matrix; Step 3: Make a position assumption for the RSSI sequence collected by Bluetooth in step 1 to obtain the assumed position coordinates corresponding to the RSSI sequence collected by Bluetooth; input the assumed position coordinates into the RSSI weight matrix for online position matching to obtain the position positioning result.
2. According to claim 1, a positioning method based on indoor Bluetooth fingerprint is characterized in that: The process of building the offline fingerprint library in step 1 is as follows: Step 1.1: The process of collecting location coordinates by UWB is as follows: Step 1.1.1: Receive the transmission time of the ranging signal between the UWB tag and the UWB base station through the UWB tag; then calculate the signal flight time TOF according to the transmission time of the ranging signal between the UWB tag and the UWB base station based on the TWR ranging method; finally, multiply the signal flight time TOF by the electromagnetic wave transmission rate to obtain the distance between the UWB tag and the UWB base station; Step 1.1.2: The position coordinates of three non-collinear UWB base stations are randomly received through the UWB tag, and then the distances between the three non-collinear UWB base stations and the UWB tag are obtained according to step 1.1.1; based on the trilateral positioning method, the position coordinates of the three non-collinear UWB base stations and the distances between the three non-collinear UWB base stations and the UWB tag are substituted into the tag position calculation formula to obtain the position coordinates of the UWB tag; Step 1.2: Collect the RSSI sequence of the Bluetooth beacon through the Bluetooth gateway; Step 1.2.1: There are several Bluetooth beacons in the collection area. Each Bluetooth beacon transmits a broadcast packet in the collection area according to the preset transmission power. The broadcast packet contains the initial RSSI values of different signal strengths. The initial RSSI value is an unordered sequence data; Step 1.2.2: Filter the initial RSSI values obtained in step 1.2.1, filter out missing items in the initial RSSI values and complete the values of the missing items to obtain an ordered RSSI sequence.
3. According to claim 2, a positioning method based on indoor Bluetooth fingerprint is characterized in that: The calculation formula of signal flight time TOF in step 1.1.1 is as follows: Among them, TOF is the signal flight time, T1 is the time from the UWB tag sending out the ranging signal to receiving the feedback signal from the UWB base station, T2 is the time from the UWB base station receiving the UWB tag ranging signal to sending the feedback signal and the secondary ranging signal, T3 is the time from the UWB tag receiving the feedback signal and the secondary ranging signal from the UWB base station to sending the feedback signal, and T4 is the time from the UWB base station sending out the secondary ranging signal to receiving the feedback signal from the UWB tag.
4. A positioning method based on indoor Bluetooth fingerprint according to claim 2 or 3, characterized in that: The label position calculation formula in step 1.1.2 is as follows: Among them, (x i ,y i ) represents the location coordinates of the UWB tag, (x1, y1), (x2, y2) and (x3, y3) represent the location coordinates of the three UWB base stations respectively, and l1, l2 and l3 represent the distances between the three UWB base stations and the UWB tag respectively.
5. The indoor Bluetooth fingerprint positioning method according to claim 2, characterized in that: The formula for the filtering process is as follows: Wherein, x[k] represents the sample value with index k in the signal sequence, y[k] represents the sample value after the signal sequence is processed, and M represents the normalization factor.
6. The indoor positioning method based on Bluetooth fingerprint according to claim 1, characterized in that: The least squares fitting formula in step 2 is as follows: in, represents the RSSI weight matrix, X is the RSSI sequence collected by Bluetooth, Y is the location coordinate collected by UWB, and T is the transpose of the matrix.
7. The indoor positioning method based on Bluetooth fingerprint according to claim 1, characterized in that: The online position matching process in step 3 is as follows: Step 3.1: Input the assumed position coordinates into the RSSI weight matrix, find the UWB collected position coordinates with the smallest difference between the assumed position coordinates and all the UWB collected position coordinates in the RSSI weight matrix, and the RSSI sequence collected by Bluetooth corresponding to this UWB collected position coordinate is the RSSI sequence of the assumed position; Step 3.2: Calculate the difference between the RSSI sequence of the assumed location and the Bluetooth RSSI sequence of the collected location to obtain the likelihood probability of the assumed location; Step 3.3: Set a likelihood probability threshold, and input the assumed position coordinates corresponding to the likelihood probability threshold that are higher than the threshold into the constructed particle filter model for updating until the number of iterations reaches the set value to obtain the position positioning result.
8. The indoor Bluetooth fingerprint positioning method according to claim 7, characterized in that: The expression of the particle filter model is as follows: f(f(k-1),k)=0.5f(k-1)+2.5f(k-1) / (1+f(k-1) 2 )+8cos(1.2k)+w Among them, f(f(k-1), k) is the state quantity of the position coordinates of the current K-th Bluetooth RSSI value, f(k-1) is the state quantity of the position coordinates of the current K-1-th Bluetooth RSSI value, cos(1.2k) is the compensation amount of the position coordinates of the current K-th Bluetooth RSSI value, and w is the Gaussian noise of the position coordinates of the current K-th Bluetooth RSSI value.
