A positioning solution model for indoor Bluetooth Low Energy
By preprocessing, smoothing, and filtering the RSSI values, and combining the least squares method and Graham scan method, the problem of insufficient indoor positioning accuracy of Bluetooth Low Energy was solved, and higher accuracy positioning calculation was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2026-04-03
AI Technical Summary
Existing RSSI-based low-power Bluetooth indoor positioning technology suffers from poor positioning accuracy and significant location fluctuations. Traditional calculation models cannot provide accurate location calculation results in certain situations.
By removing outliers from the RSSI values, performing Gaussian smoothing and weighted correction, processing the signal with Kalman filtering, fitting the logarithmic loss model using the least squares method, screening anchor nodes, and selecting convex polygons using the Graham scan method, a weighted positioning solution is performed.
It improves the accuracy and precision of indoor positioning calculations, reduces positioning errors, and enhances positioning stability in complex environments.
Smart Images

Figure CN116359838B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of indoor positioning technology, specifically relating to a positioning calculation model for indoor low-power Bluetooth. Background Technology
[0002] In recent decades, thanks to the rapid development of GNSS technology, high-precision positioning and navigation can now be achieved outdoors, 24 / 7 and globally. Positioning accuracy is generally maintained at the meter level, with some reaching decimeter levels. The main principle is to use multiple satellites at known locations to measure the distance to a target and then use a range intersection model to calculate the position information. However, due to issues such as obstruction, multipath effects, fading, reflection, and cross-interference, accurate location services cannot be obtained using GNSS in indoor environments.
[0003] To enable users to access location-based services indoors, numerous indoor positioning technologies and models have emerged. The most common indoor positioning solution involves pre-deploying hardware devices and using appropriate positioning models. Common indoor positioning technologies include Ultra-Wideband (UWB), ZigBee, WiFi, and Bluetooth Low Energy (BLE). UWB offers high positioning accuracy and stability, but its deployment costs are high. ZigBee signal transmission is significantly affected by multipath effects and motion, and its positioning accuracy depends on channel physical quality, signal source density, environment, and algorithm precision, resulting in high-cost positioning software and significant room for improvement. WiFi boasts advantages such as high penetration, low cost, good compatibility, and relatively high positioning accuracy, but it suffers from significant drawbacks in power consumption, stability, and high-voltage deployment. BLE is a radio technology supporting short-range communication between terminal devices. Since the release of the BLE 5.0 specification, BLE devices have made breakthroughs in low power consumption and high-speed connectivity, significantly improving effective transmission distance. Furthermore, the widespread availability of Bluetooth modules in various mobile terminals greatly facilitates wireless information exchange between mobile devices and communication between mobile devices and the internet. Therefore, BLE has excellent development prospects and is the preferred indoor positioning solution for the future, as well as the most flexible positioning service technology.
[0004] Currently, both academia and industry generally believe that traditional RSSI-based indoor positioning technologies have poor positioning accuracy and significant location fluctuations. Comprehensive analysis reveals that this problem is mainly due to: the existence of jumps in BLE signals, and the fluctuations in signal values directly affect the distance calculated by the positioning model; and the inherent limitations of traditional RSSI-based indoor positioning models, such as trilateration, trilateration weighted centroid method, and least squares method. Specifically, trilateration and trilateration weighted centroid methods have relatively large positioning ranges, which can lead to larger errors in the positioning results. When the number of anchor nodes exceeds three, trilateration only utilizes some useful anchor nodes, thus failing to provide a sufficiently accurate solution. Least squares method becomes unsuitable in certain situations, such as when base station deployment is sparse, requiring the solution of ill-conditioned matrices, which can result in significant errors in the final location. Summary of the Invention
[0005] The purpose of this invention is to provide a positioning calculation model for indoor low-power Bluetooth.
[0006] The objective of this invention is achieved through the following technical solution:
[0007] A positioning calculation model for indoor low-power Bluetooth, the specific steps of which are as follows:
[0008] Step 1: RSSI processing stage;
[0009] Step 1.1: Remove outliers from the original RSSI values;
[0010] Step 1.2: Preprocess RSSI based on threshold;
[0011] Step 1.3: Perform Gaussian smoothing on the preprocessed RSSI values;
[0012] Step 1.4: Weighted adjustment of RSSI values;
[0013] Step 1.5: Perform final processing on the RSSI values based on Kalman filtering;
[0014] Step 2: Distance estimation stage;
[0015] Step 2.1: Select a wireless signal loss model;
[0016] Step 2.2: Fit the logarithmic loss model based on the least squares method;
[0017] Step 3: Position Calculation Stage;
[0018] Step 3.1: Filter anchor nodes;
[0019] Step 3.2: Use Graham's scan method to select points outside the polygon to obtain the largest convex polygon;
[0020] Step 3.3: Iteratively solve for the internal convex polygon;
[0021] Step 3.4: Anchor node rights confirmation and positioning calculation.
[0022] Furthermore, step 1 specifically includes:
[0023] Step 1.1: Remove outliers from the original RSSI values;
[0024] RSSI raw The RSSI is obtained by sorting them in ascending order. sort ={RSSI′1,RSSI′2,...,RSSI′ n Then, the five statistics are calculated using the following formulas:
[0025]
[0026] Among them, RSSI MID The median value is the value located in the middle of the RSSI data queue arranged in ascending order; RSSI Q1 The lower quartile is the number located at the 25th percentile after the RSSI data queue is sorted in ascending order; RSSI Q3 The upper quartile is the number located at the 75th percentile after the RSSI data queue is sorted in ascending order; RSSII QR Interquartile range (RSSI) is the difference between the third quartile and the first quartile. min The minimum value of the RSSI data queue; RSSI max This represents the maximum value of the RSSI data queue. L1 has three possible values: if L1 is an integer and odd, then the value is taken as RSSI. sort The L1-th value in the queue; if L1 is an integer and even, then take RSSI. sort The average of the L1-th and L1+1-th values in the queue; if L1 is not an integer, take the next nearest integer; the same applies to L2 and L3;
[0027] Finally, RSSI raw If a value in the queue meets the following requirement, it is retained; otherwise, it is removed as an outlier. Finally, the preprocessed RSSI value is obtained, i.e., RSSI. elim ;
[0028] RSSI min <RSSI i <RSSI max, i∈{1,2,...,n}
[0029] Step 1.2: Preprocess RSSI based on threshold;
[0030] First, using RSSI elim The average RSSI of each queue is calculated separately. avg and median RSSI mid Next, the average of the mean and the median is calculated, which is the ideal RSSI value. ideal Finally, RSSI elim The difference between the values in the queue and the ideal RSSI value is used to calculate the ratio of this ratio to the ideal value. The maximum ratio is the RSSI. ratio :
[0031]
[0032]
[0033] Among them, RSSI avg For average values, RSSI mid The median value is used; after obtaining the ideal RSSI and the threshold, the RSSI is optimized using the two formulas mentioned above. elim Each value and ratio in the table corresponds to a value in RSSI. ratio The value is a threshold; if an RSSI value is greater than the RSSI value... rati The value needs to be large; this data cannot meet the actual value requirements, so records need to be deleted to obtain the preprocessed RSSI queue, i.e., RSSI. pre ={rssi1, rssi2,..., rssi m};
[0034] Step 1.3: Perform Gaussian smoothing on the preprocessed RSSI values;
[0035] Gaussian smoothing filtering is as follows: A Gaussian distribution model is established for the m RSSI signal intensities, and this Gaussian distribution model is used as the weight allocation mode. pre Each value in the algorithm is assigned a weight based on its position on the Gaussian distribution curve to obtain a weighted average. Finally, the Gaussian smoothing filter result is output; the Gaussian density function is:
[0036]
[0037] in:
[0038]
[0039] Based on the Gaussian density function, the RSSI is obtained. pre Weight matrix, and then normalized:
[0040]
[0041]
[0042] After that, RSSI pre After multiplying each value in the Gaussian smoothing algorithm by its weight, the result is:
[0043]
[0044] Step 1.4: Weighted adjustment of RSSI values;
[0045] After correcting the RSSI value using Gaussian smoothing filtering, calculate the average of the m RSSI values after smoothing filtering, and then calculate the RSSI using the formula. MID After the value is calculated, different weights are assigned to m RSSI values, with larger weights assigned to values that differ significantly from the mean. Finally, the weights are normalized to obtain weighting coefficients, thus yielding the corrected RSSI value.
[0046]
[0047]
[0048]
[0049] Step 1.5: Perform final processing on the RSSI values based on Kalman filtering;
[0050] Kalman filtering is performed on the RSSI value corrected in step 1.4 to obtain the final processed RSSI value; the state equation and observation equation for the Kalman filter are as follows:
[0051] X k =AX k-1 +ω k
[0052] Z k =HX k +v k
[0053] Among them, X k Z represents the predicted value of the system at time k. k Let A represent the measured value of the system at time k, and let A and H represent the system state transition matrix and measurement matrix, respectively. ω k The mean is 0, and the covariance matrix is Q, v k The mean of is 0, and the covariance matrix is R;
[0054] Kalman estimation mainly consists of two phases: In the prediction phase, the filter uses estimates from previous states to predict the current state value; in the correction phase, the observed current state value is used to correct the predictions obtained in the prediction phase, resulting in a new estimate that is more relevant to the true value. The specific process is as follows:
[0055] Step 1.5.1: System State Prediction: RSSI′ out This is the optimal result obtained in the previous time step;
[0056] Step 1.5.2: Error covariance propagation:
[0057] P′ k =P k-1 +Q
[0058] Step 1.5.3: Gain matrix calculation:
[0059] K k =P′ k (P′ k +R) -1
[0060] Step 1.5.4: Correct and update the status:
[0061] RSSI out =RSSI′ out +K k (RSSI i -RSSI′ out )
[0062] Step 1.5.5: Update covariance:
[0063] P k = (1-K) k )P′ k
[0064] Among them, RSSI out For the optimal result at this moment, RSSI′ out P is the predicted value. k To estimate the error covariance, P′ k To predict the covariance of the error, K k Let Q be the filter gain matrix, Q be the process noise covariance, and R be the observation noise covariance.
[0065] Furthermore, step 2 specifically involves:
[0066] Step 2.1: Select a wireless signal loss model;
[0067] Distance estimation relies on wireless signal loss models; wireless signals do not remain constant during propagation and attenuate due to environmental influences. Researchers have established different RSSI models to estimate the physical distance between beacon nodes and mobile terminals.
[0068] Step 2.2: Fit the logarithmic loss model based on the least squares method;
[0069] The logarithmic path loss model expression is:
[0070]
[0071] Where P(d) is the RSSI value of the Bluetooth signal after traveling a distance d; P(d0) is the RSSI value of the Bluetooth signal after traveling d0, usually taken as d0 = 1m; n is the path loss exponent, the more obstacles in the environment, the larger the value of n; generally, in a fully open space, n is 2 to 2.5, in a semi-open environment, n is 2.5 to 3, and in a fully enclosed environment, n is 3 to 3.5; ξ n It is a normal distribution with a mean of zero and a variance of σ;
[0072] The distance between the anchor node and the unknown node can be obtained from the above formula:
[0073]
[0074] Based on the distance relationship between the anchor node and the unknown node, when the terminal device receives more than three anchor nodes at the unknown node, the positioning algorithm is used to solve the position coordinates. The value of n in the above formula reflects the degree of influence of the surrounding environment on the distance measurement. Therefore, selecting an appropriate value of n is of great significance to the accuracy of the position measurement results. After fitting with the least squares method, the most suitable value of n for the logarithmic loss model and the value of P(d0) when d0 = 1 are obtained.
[0075] Furthermore, step 3 specifically involves:
[0076] Step 3.1: Filter anchor nodes;
[0077] The algorithm calculates the average RSSI of each anchor node obtained by the user. If the average RSSI of the anchor node queue is less than or equal to a system preset threshold, the anchor node queue is retained; otherwise, it is discarded. Finally, it identifies m anchor nodes that satisfy the threshold requirement, i.e., {rssi1, rssi2, ..., rssi...}. m};
[0078] Step 3.2: Use Graham's scan method to select points outside the polygon to obtain the largest convex polygon;
[0079] Given a set of points on a two-dimensional plane, the convex hull is a convex polygon formed by connecting the outermost points, containing all points in the set. Graham's scan algorithm is one of the most commonly used algorithms for finding the convex hull. The algorithm iterates through the points in polar order, checking the direction of each point relative to the top two points of the stack: if the point turns right, it adds the current point to the stack; otherwise, it pops the top point from the stack. After traversing the entire set, the points still on the stack are the points on the convex hull. Furthermore, popping points from the stack in sequence yields all the points on the convex hull rotated clockwise from the starting point. The specific steps are as follows:
[0080] Step 3.2.1: Select the point with the smallest x as the pole, that is: if x is the same, select the point with the smallest y; this point must be on the convex hull;
[0081] Step 3.2.2: Sort the remaining points by polar angle. If the polar angles are the same, compare the distances to the poles and prioritize the points that are closer to the poles.
[0082] Step 3.2.3: Use a stack S to store the points on the convex hull. First, push the two points with the smallest polar angle and poles onto the stack.
[0083] Step 3.2.4: Scan each point as needed, and check if the line segment formed by the top two elements of the stack and this point turns to the right, with a cross product ≤ 0; the cross product of p1 and p2 is:
[0084]
[0085] Where p1 and p2 are vectors. If p1×p2>0, it means that p1 is in the clockwise direction of p2; if p1<0, it means that p1 is in the counterclockwise direction of p2.
[0086] Step 3.2.5: If satisfied, pop the top element of the stack and return to step 3.2.4 to check again until satisfied; push the point onto the stack and continuously perform the operation of step 3.2.5 on other points;
[0087] Step 3.2.6: The final stack contains a sequence of vertices of the convex hull;
[0088] Step 3.3: Iteratively solve for the internal convex polygon;
[0089] Step 3.3.1: After determining the largest convex polygon with intersection points, solve for the points located inside the convex polygon;
[0090] Step 3.3.2: Determine whether the points inside the convex polygon are smaller than a preset threshold;
[0091] Step 3.3.3: If satisfied, proceed directly to the next step; if not satisfied, use the Graham scan method to solve for the maximum convex polygon, then return to step 3.3.2 to check again, until satisfied.
[0092] Step 3.3.4: Finally, solve for the internal convex polygon;
[0093] Step 3.4: Anchor node rights confirmation and location calculation;
[0094] Appropriate weights are selected for the points inside the polygon. The weight of the beacon node is the sum of the reciprocals of the distances between nodes, and an exponential value is added to improve this, making the weight allocation more reasonable. After repeated trials, the weights that achieve the highest positioning accuracy are determined, as shown in the following formula:
[0095]
[0096]
[0097] Finally, the coordinate results are obtained, and the formula is as follows:
[0098]
[0099] The beneficial effects of this invention are as follows:
[0100] This invention presents a positioning calculation model for indoor Bluetooth Low Energy (BLE) signals. First, a signal receiver receives the RSSI (Radio Signal Indicator Sequence) value of the wireless signal. Then, the RSSI value is processed, and the distance between the transmitter and receiver is calculated based on the correlation between RSSI attenuation and signal propagation distance in space. Finally, the user's location information is calculated using a positioning model with a weighted centroid of a convex polygon, based on the anchor node's location. This invention provides a novel model for wireless signal-based positioning calculation in indoor environments, possessing significant research and practical value for indoor positioning. Narrowing the positioning calculation area improves accuracy; the more measurements used in the calculation, the more accurate the positioning result. Attached Figure Description
[0101] Figure 1 A data processing framework for a weighted centroid localization model of a convex polygon;
[0102] Figure 2 This is a diagram illustrating the queue recursion.
[0103] Figure 3 A schematic diagram of a weighted centroid localization model for convex polygons;
[0104] Figure 4 Flowchart of the algorithm for the weighted centroid localization model of convex polygons;
[0105] Figure 5 This is a diagram illustrating the steps of the Graham scan method. Detailed Implementation
[0106] The present invention will now be further described with reference to the accompanying drawings.
[0107] Step 1: RSSI Processing Stage
[0108] Step 1.1: Remove outliers from the original RSSI;
[0109] First, the n consecutively sampled values are grouped into a queue with a fixed length of n. The resulting raw RSSI data is called RSSI. raw ={RSSI1,RSSI2,...,RSSI n}; Then, a new RSSI value sampled each time is placed at the tail of the queue, and the original RSSI value at the head of the queue is removed according to the first-in-first-out principle to ensure effective suppression of periodic interference. The basic principle diagram is as follows (e.g. Figure 2 (As shown). Then, to make RSSI raw The data accurately reflects the actual situation. Box plots are used to identify and remove RSSI outliers, ultimately yielding the RSSI values after outlier removal. Box plots are a method that accurately displays outliers in an RSSI data set, showing the dispersion and symmetry of the data distribution. They characterize the RSSI data set using five statistics: minimum, upper quartile, median, lower quartile, and maximum.
[0110] RSSI raw The RSSI is obtained by sorting them in ascending order. sort ={RSSI′1,RSSI′2,...,RSSI′ n Then, the five statistical measures are solved, as shown in equation (1).
[0111]
[0112] Among them, RSSI MJD The median value is the value located in the middle of the RSSI data queue arranged in ascending order; RSSI Q1 The lower quartile is the number located at the 25th percentile after the RSSI data queue is sorted in ascending order; RSSI Q3 The upper quartile is the number located at the 75th percentile after the RSSI data queue is sorted in ascending order; RSSI IqR Interquartile range (RSSI) is the difference between the third quartile and the first quartile. min The minimum value of the RSSI data queue; RSSI max This represents the maximum value of the RSSI data queue. L1 has three possible values: if L1 is an integer and odd, then the value is taken as RSSI. sortThe L1-th value in the queue; if L1 is an integer and even, then take RSSI. sort The average of the L1-th and L1+1-th values in the queue; if L1 is not an integer, take the next nearest integer. The same applies to L2 and L3.
[0113] Finally, if RSSI raw If a value in the queue meets the requirements of formula (2), it is retained; otherwise, it is discarded as an outlier. Finally, the preprocessed RSSI value is obtained, i.e.: RSSI elim .
[0114] RSSI min <RSSI i <RSSI max , i∈{1,2,...,n} (2)
[0115] Step 1.2: Preprocess RSSI based on threshold;
[0116] First, using RSSI elim The average RSSI of each queue is calculated separately. avg and median RSSI mid Next, the average of the mean and the median is calculated, which is the ideal RSSI value. ideal Finally, RSSI elim The difference between the values in the queue and the ideal RSSI value is used to calculate the ratio of this ratio to the ideal value. The maximum ratio is the RSSI. ratio :
[0117]
[0118]
[0119] In the formula, RSSI avg For average values, RSSI mid The median value is used. After obtaining the ideal RSSI and the threshold, the RSSI is adjusted using equations (3) and (4). elim Each value in the table corresponds to a ratio. (RSSI) ratio The value is a threshold; if an RSSI value is greater than the RSSI value... rat If the value is too large, then this data cannot meet the requirements of the true value and lacks reference value. Therefore, records need to be deleted to obtain the preprocessed RSSI queue, i.e., RSSI. pre ={rssi1, rssi2,..., rssi m}
[0120] Step 1.3: Perform Gaussian smoothing on the preprocessed RSSI values;
[0121] Gaussian smoothing filtering, also known as Gaussian blurring, is a linear smoothing filtering algorithm that considers global signal characteristics more when optimizing RSSI signal observation data, thus effectively eliminating and suppressing the influence of Gaussian noise. The principle of Gaussian smoothing filtering is: to establish a Gaussian distribution model for the m RSSI signal intensities, and to use the Gaussian distribution model as a preferred weight allocation mode. pre Each value in the algorithm is assigned a weight based on its position on the Gaussian distribution curve, resulting in a weighted average. The final Gaussian smoothing filter output is then obtained. The Gaussian density function is:
[0122]
[0123] in:
[0124]
[0125] Based on the Gaussian density function, the RSSI is obtained. pre Weight matrix, and then normalized:
[0126]
[0127]
[0128] After that, RSSI pre After multiplying each value in the Gaussian smoothing algorithm by its weight, the result is:
[0129]
[0130] Step 1.4: Weighted adjustment of RSSI values;
[0131] After correcting the RSSI value using Gaussian smoothing filtering, calculate the average of the m RSSI values after smoothing filtering, and then calculate the RSSI using the formula. MID After assigning different weights to the m RSSI values, the larger weights are given to values that differ significantly from the mean. Finally, the weights are normalized to obtain weighting coefficients, thus yielding the corrected RSSI value.
[0132]
[0133]
[0134]
[0135] Step 1.5: Perform final processing on the RSSI values based on Kalman filtering;
[0136] The corrected RSSI values are then subjected to Kalman filtering to obtain the final processed RSSI values. Kalman filtering (KF) is the optimal least-squares estimator for estimating the state of a dynamic linear system. The state equation and observation equation for KF are shown in equation (3).
[0137]
[0138] Among them, X k Z represents the predicted value of the system at time k. k Let A represent the measured value of the system at time k, and let A and H represent the system state transition matrix and measurement matrix, respectively. ω k The mean is 0, and the covariance matrix is Q, v k The mean is 0, and the covariance matrix is R.
[0139] Kalman estimation mainly consists of two processes: prediction and correction. In the prediction phase, the filter uses estimates of previous states to predict the current state value. In the correction phase, the observed current state value is used to correct the prediction obtained in the prediction phase, resulting in a new estimate that is more relevant to the true value. The specific process is as follows:
[0140] (1) System state prediction: RSSI′ out This is the optimal result obtained in the previous time step;
[0141] (2) Error covariance propagation:
[0142] P′ k =P k-1 +Q (14)
[0143] (3) Calculation of gain matrix:
[0144] K k =P′ k (P′ k +R) -1 (15)
[0145] (4) Correct and update the state (optimal estimate):
[0146] RSSI out =RSSI′ out +K k (RSSI i -RSSI′ out (16)
[0147] (5) Update covariance:
[0148] P k = (1-K) k )P′ k(17)
[0149] Among them, RSSI out For the optimal result at this moment, RSSI′ out P is the predicted value. k To estimate the error covariance, P′ k To predict the covariance of the error, K k Let Q be the filter gain matrix, Q be the process noise covariance, and R be the observation noise covariance.
[0150] Step 2: Distance estimation stage;
[0151] Distance estimation relies on wireless signal loss models. Wireless signals do not remain constant during propagation; they attenuate to varying degrees due to environmental influences. The greater the propagation distance and the more complex the propagation path, the more severe the signal attenuation at the mobile terminal. Researchers have established different RSSI models to estimate the physical distance between the beacon node and the mobile terminal. Representative models include the free-space propagation model and the logarithmic path loss model. The free-space propagation model is the foundation of other propagation models. In unobstructed, multipath-free free space, electromagnetic waves propagate without considering any other forms of loss, playing a crucial fundamental role in electromagnetic wave propagation theory. However, due to many uncertainties in actual indoor environments, the free-space channel model is rarely applied in real-world indoor environments. The model used in this invention is the logarithmic path loss model.
[0152] The logarithmic path loss model is one of the most commonly used RSSI ranging models in indoor positioning. This model uses the characteristic that the signal strength of a wireless signal decreases exponentially with increasing distance during propagation to measure the physical distance between the signal receiver and the signal transmitter. Its model expression is shown in equation (18).
[0153]
[0154] Where P(d) is the RSSI value of the Bluetooth signal after traveling a distance d; P(d0) is the RSSI value of the Bluetooth signal after traveling d0, usually taken as d0 = 1m; n is the path loss exponent, the more obstacles in the environment, the larger the value of n. Generally, in a fully open space, n is 2 to 2.5; in a semi-open environment, n is 2.5 to 3; and in a fully enclosed environment, n is 3 to 3.5; ξ n It is a normal distribution with a mean of zero and a variance of σ.
[0155] The distance between the anchor node and the unknown node can be obtained according to equation (18), as shown in equation (19).
[0156]
[0157] Based on the distance relationship between the anchor node and the unknown node, when the terminal device receives more than three anchor nodes at the unknown node, the location coordinates can be solved using a positioning algorithm. The value of n in equation (19) reflects the degree of influence of the surrounding environment on the distance measurement. Therefore, selecting an appropriate value of n is of great significance to the accuracy of the location measurement results. After fitting using the least squares method, the value of n that is most suitable for the logarithmic loss model and the value of P(d0) when d0 = 1 are obtained.
[0158] Step 3: Position Calculation Stage;
[0159] Theoretically, introducing additional BLE anchor nodes can improve indoor positioning accuracy, and the more nodes there are, the more accurate the positioning results. However, considering the deployment of BLE anchor nodes and the computational complexity, such as... Figure 3 As shown, this invention fully utilizes the information from BLE anchor nodes and further converts the initial position of the target node into the position coordinates of the vertices of the internal polygon, thus reducing the range of the positioning area, reducing the error in the positioning solution, and improving the accuracy of the positioning solution. The flowchart for the position calculation stage is shown below. Figure 4 .
[0160] Step 3.1: Filter anchor nodes;
[0161] The algorithm calculates the average RSSI of each anchor node obtained by the user. If the average RSSI of the anchor node queue is less than or equal to a system preset threshold, the anchor node queue is retained; otherwise, it is discarded. Finally, m anchor nodes satisfying the threshold requirement are obtained, i.e., {rssi1, rssi2, ..., rssi...}. m}
[0162] Step 3.2: Use Graham's scan method to select points outside the polygon to obtain the largest convex polygon;
[0163] Given a set of points in a two-dimensional plane, the convex hull is a convex polygon formed by connecting the outermost points; it contains all the points in the set. Graham's scan method is one of the most commonly used algorithms for finding the convex hull. Its basic principle is as follows: Figure 5As shown, the points are ordered by polar angle and the two points at the top of the stack are compared to determine their direction: if the point turns right, the current point is added to the stack; otherwise, the point at the top of the stack is popped. After traversing the point set, the points still in the stack are the points on the convex hull, and popping points from the stack in sequence will give all the points on the convex hull rotating clockwise from the starting point. The specific steps are as follows: (i) Select the point with the smallest x as the pole (if x is the same, select the point with the smallest y). This point must be on the convex hull; (ii) Sort the remaining points by polar angle, and compare the distances to the pole when the polar angles are the same, prioritizing the points closer to the pole; (iii) Use a stack S to store the points on the convex hull, and first push the two points with the smallest polar angle and pole into the stack; (iv) Scan each point as needed, and check whether the broken line segment formed by the top two elements of the stack and this point turns to the right (cross product ≤ 0); the cross product of p1 and p2 is:
[0164]
[0165] Where p1 and p2 are vectors. If p1×p2>0, it means that p1 is in the clockwise direction of p2; if p1<0, it means that p1 is in the counterclockwise direction of p2.
[0166] (v) If satisfied, pop the top element from the stack and return to step (iv) to check again until satisfied. Push the point onto the stack and continue performing step 5 for other points. (vi) The final stack contains the vertex sequence of the convex hull.
[0167] Step 3: Iteratively solve for the internal convex polygon
[0168] (i) After determining the largest convex polygon at the intersection point, solve for the points located inside the convex polygon; (ii) Determine whether the points inside the convex polygon are less than a preset threshold; (iii) If the threshold is met, proceed directly to the next step; if not, use the Graham scan method to solve for the largest convex polygon, then return to step (ii) to check again until the threshold is met; (iv) Finally, solve for the internal convex polygon.
[0169] Step 3.4: Anchor node rights confirmation and location calculation;
[0170] Appropriate weights are selected for the points inside the polygon. The weight of the beacon node is the sum of the reciprocals of the distances between the nodes. Furthermore, power values are added to improve the weight distribution, making the weight allocation more reasonable. After repeated trials of the algorithm, the weights with the highest positioning accuracy are shown in the following formula (22):
[0171]
[0172]
[0173] Finally, the coordinate results obtained are shown in equation (23) below:
[0174]
[0175] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A positioning calculation model for indoor low-power Bluetooth, characterized in that, The specific steps are as follows: Step 1: RSSI processing stage; Step 1.1: Remove outliers from the original RSSI values; Step 1.2: Preprocess RSSI based on threshold; Step 1.3: Perform Gaussian smoothing on the preprocessed RSSI values; Step 1.4: Weighted adjustment of RSSI values; Step 1.5: Perform final processing on the RSSI values based on Kalman filtering; Step 2: Distance estimation stage; Step 2.1: Select a wireless signal loss model; Step 2.2: Fit the logarithmic loss model based on the least squares method; Step 3: Position Calculation Stage; Step 3.1: Filter anchor nodes; Step 3.2: Use Graham's scan method to select points outside the polygon to obtain the largest convex polygon; Step 3.3: Iteratively solve for the internal convex polygon; Step 3.4: Anchor node rights confirmation and positioning calculation; Appropriate weights are selected for the points inside the polygon. The weight of the beacon node is the sum of the reciprocals of the distances between nodes, and an exponential value is added to improve this, making the weight allocation more reasonable. After repeated trials, the weights that achieve the highest positioning accuracy are determined, as shown in the following formula: Finally, the coordinate results are obtained, and the formula is as follows: 。 2. The positioning calculation model for indoor low-power Bluetooth according to claim 1, characterized in that, Step 1 is as follows: Step 1.1: Remove outliers from the original RSSI values; Will After sorting in ascending order, we get Then, the five statistics are calculated using the following formulas: in, The median value is The value in the middle position after the data queue is arranged in ascending order; The lower quartile is located in The number at the 25th position after the data queue is sorted in ascending order; The upper quartile is located in The number at the 75th position after the data queue is sorted in ascending order; The interquartile range is the difference between the third quartile and the first quartile. for The minimum value in the data queue; for Maximum value of the data queue; There are three possible values: if If it is an integer and is odd, then take... The first in the queue One value; if If it is an integer and is even, then take... The first in the queue The value and the first The average of the values; if If it is not an integer, then take the next nearest integer; , Similarly; at last, If a value in the queue meets the following requirement, it is retained; otherwise, it is removed as an outlier. Finally, the preprocessed RSSI value is obtained, i.e.: ; Step 1.2: Preprocess RSSI based on threshold; First, using The average value is calculated for each queue. and median Then, calculate the average of the mean and the median, which is the ideal value. value Finally, Values in the queue and ideal Find the difference between the two values, and then find the ratio between the two ideal values to obtain the maximum ratio. : In the formula, This is the average value. The median value is used to derive the ideal value. After setting the threshold, equations (3) and (4) are used to make... Each value in the table corresponds to a ratio; The value is a threshold; if a value ratio If the value is too large, then this data cannot meet the requirements of the true value and lacks reference value. Records need to be deleted to obtain the preprocessed data. Queues, i.e.: ; Step 1.3: Preprocessing the... The values are Gaussian smoothed. Gaussian smoothing filtering is: for A Gaussian distribution model is established for each RSSI signal intensity, and the Gaussian distribution model is used as a preferred weight allocation mode. Each value in the algorithm is assigned a weight based on its position on the Gaussian distribution curve to obtain a weighted average. Finally, the Gaussian smoothing filter result is output; the Gaussian density function is: in: Based on the Gaussian density function, we obtain Weight matrix, and then normalized: after, After multiplying each value in the Gaussian smoothing algorithm by its weight, the result is: Step 1.4: Weighted adjustment of RSSI values; Correction after Gaussian smoothing filter Value, calculate the smoothed filtered result. indivual The average value is calculated according to the formula. Value assigned indivual Different weights are assigned to values that differ significantly from the mean; finally, the weights are normalized to obtain weighting coefficients, thus yielding the corrected weighted average. value; Step 1.5: Perform final processing on the RSSI values based on Kalman filtering; According to the correction in step 1.4 The values are then subjected to Kalman filtering to obtain the final processed values. Values; the state equation and observation equation for the Kalman filter are; in, express The predicted value of the time system express Measured values of the time system and These represent the system state transition matrix and the measurement matrix, respectively. The mean is 0, and the covariance matrix is , The mean is 0, and the covariance matrix is ; Kalman estimation mainly consists of two phases: In the prediction phase, the filter uses estimates from previous states to predict the current state value; in the correction phase, the observed current state value is used to correct the predicted value obtained in the prediction phase, resulting in a new estimate that is more relevant to the true value. The specific process is as follows: Step 1.5.1: System State Prediction: This is the optimal result obtained in the previous time step; Step 1.5.2: Error covariance propagation: Step 1.5.3: Gain matrix calculation: Step 1.5.4: Correct and update the status: Step 1.5.5: Update covariance: in, This is the optimal result at this moment. For predicted values, To estimate the error covariance, To predict the error covariance, Let Q be the filter gain matrix, Q be the process noise covariance, and R be the observation noise covariance.
3. The positioning calculation model for indoor low-power Bluetooth according to claim 1, characterized in that, Step 2 is as follows: Step 2.1: Select a wireless signal loss model; Distance estimation relies on wireless signal loss models; wireless signals do not remain constant during propagation and attenuate due to environmental influences. Researchers estimate the physical distance between beacon nodes and mobile terminals by establishing different RSSI models. Step 2.2: Fit the logarithmic loss model based on the least squares method; The logarithmic path loss model expression is: in, Bluetooth signal travels a distance RSSI value at that time; Bluetooth signal passes through The RSSI value at that time is taken as follows. ; This is the path loss index; the more obstacles in the environment, the higher the path loss index. The larger the value, the better; generally, in a fully open space, Take a value of 2 to 2.5, in a semi-open environment. Take 2.5~3, in a completely enclosed environment, Take 3~3.5; The mean is zero and the variance is... The normal distribution; The distance between the anchor node and the unknown node can be obtained from the above formula: Based on the distance relationship between the anchor node and the unknown node, when the terminal device receives more than three anchor nodes at the unknown node, it uses a positioning algorithm to solve for the location coordinates; in the above formula... The value reflects the degree of influence of the surrounding environment on distance measurement, therefore selecting an appropriate value is important. The value is crucial to the accuracy of the position measurement results; after fitting using the least squares method, the solution that best suits the logarithmic loss model is obtained. Value and when time value.
4. The positioning calculation model for indoor low-power Bluetooth according to claim 1, characterized in that, Step 3 specifically involves: Step 3.1: Filter anchor nodes; The algorithm calculates the average RSSI of each anchor node obtained by the user. If the average RSSI of the anchor node queue is less than or equal to a system preset threshold, the anchor node queue is retained; otherwise, it is discarded. Finally, it calculates the values that satisfy the threshold requirement. Anchor nodes, namely ; Step 3.2: Use Graham's scan method to select points outside the polygon to obtain the largest convex polygon; Given a set of points on a two-dimensional plane, the convex hull is a convex polygon formed by connecting the outermost points, containing all points in the set. Graham's scan algorithm is one of the most commonly used algorithms for finding the convex hull. The algorithm iterates through the points in polar order, checking the direction of each point relative to the top two points of the stack: if the point turns right, it adds the current point to the stack; otherwise, it pops the top point from the stack. After traversing the entire set, the points still on the stack are the points on the convex hull. Furthermore, popping points from the stack sequentially yields all points on the convex hull rotated clockwise from the starting point. The specific steps are as follows: Step 3.2.1: Select The smallest point is taken as the pole; This point must lie on the convex hull; Step 3.2.2: Sort the remaining points by polar angle. If the polar angles are the same, compare the distances to the poles and prioritize the points that are closer to the poles. Step 3.2.3: Use a stack S to store the points on the convex hull. First, push the two points with the smallest polar angle and poles onto the stack. Step 3.2.4: Scan each point as needed and check whether the polyline segment formed by the top two elements of the stack and this point turns to the right. and The cross product is: in, and If it is a vector; This means exist Clockwise direction; if , then it means exist The counterclockwise direction; Step 3.2.5: If satisfied, pop the top element from the stack and return to step 3.2.4 to check again until satisfied; push the point onto the stack and continuously perform the operation of step 3.2.5 on other points; Step 3.2.6: The final stack contains a sequence of vertices of the convex hull; Step 3.3: Iteratively solve for the internal convex polygon; Step 3.3.1: After determining the largest convex polygon with intersection points, solve for the points located inside the convex polygon; Step 3.3.2: Determine whether the points inside the convex polygon are smaller than a preset threshold; Step 3.3.3: If satisfied, proceed directly to the next step; if not satisfied, use the Graham scan method to solve for the maximum convex polygon, then return to step 3.3.2 to check again, until satisfied. Step 3.3.4: Finally, solve for the internal convex polygon; Step 3.4: Anchor node rights confirmation and location calculation.
Citation Information
Patent Citations
Method for finding mine with cubic forecast model based on three-dimensional modeling
CN101038680A
Optimization of indoor positioning algorithm based on Bluetooth
CN111246383A