An indoor positioning method, system, medium and product based on momentum acceleration optimization
By introducing a momentum acceleration optimization mechanism into the Bluetooth indoor positioning algorithm, and combining historical gradient information with the current gradient to update coordinates, the oscillation problem of the Bluetooth indoor positioning algorithm in complex signal environments is solved, thereby improving the convergence speed and accuracy of positioning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUXI ZHENYUAN TECH CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-16
Smart Images

Figure CN122227385A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of indoor positioning technology, and in particular to an indoor positioning method, system, medium and product based on momentum acceleration optimization. Background Technology
[0002] With the development of IoT and mobile internet technologies, location-based services (LBS) are increasingly being used in indoor scenarios such as large shopping malls, underground parking lots, and airport terminals. Since satellite signals cannot penetrate buildings, indoor positioning solutions based on Bluetooth Low Energy (BLE) technology have become the mainstream choice in the current indoor positioning field due to their low cost, low power consumption, and ease of deployment. In these solutions, the mobile terminal receives broadcast signals from Bluetooth beacons at preset locations, analyzes the Received Signal Strength Indicator (RSSI), and uses a path loss model to estimate the terminal's location coordinates.
[0003] In related technologies, gradient-based iterative optimization algorithms (such as steepest descent or standard stochastic gradient descent) can be used to determine the location information of a mobile terminal. Specifically, in each iteration, the system obtains the current estimated coordinates of the mobile terminal and calculates the theoretically estimated signal strength by combining the known location of the beacon and the path loss model. Next, the measured signal strength is compared with the estimated signal strength to construct an error function, and the gradient vector of this error function at the current coordinates is calculated. Finally, the algorithm directly updates the estimated coordinates of the mobile terminal along the opposite direction of the current gradient vector with a preset step size. This process is repeated until the coordinate change meets a stopping condition.
[0004] However, in real-world indoor environments, Bluetooth signal propagation is highly susceptible to interference from multipath effects, shadow fading, and human movement, resulting in measured RSSI values often containing significant random noise and fluctuations. In this complex signal environment, the aforementioned technical solutions exhibit clear limitations: since the step size and direction of each coordinate update depend entirely on the gradient information calculated at the current moment, when signal noise is high or the error surface exhibits a narrow "canyon" shape, the current gradient direction often fails to accurately point to the global optimum (i.e., the true location), instead oscillating perpendicular to the canyon walls. This can cause the coordinate update trajectory to oscillate violently laterally during the search for the optimal solution (i.e., generating a zigzag oscillating path), making it difficult for the algorithm to quickly approximate the true coordinates. This oscillation phenomenon not only significantly increases the number of iterations and computation time, leading to high positioning latency, but also, in cases of severe noise, easily causes the algorithm to get trapped in local minima and fail to converge to the correct position, affecting the efficiency and accuracy of indoor positioning. Summary of the Invention
[0005] This application provides an indoor positioning method, system, medium, and product based on momentum acceleration optimization, which addresses the problem that iterative positioning algorithms in related technologies are susceptible to the randomness of signal acquisition, multipath effects, and dynamic changes in the environment in complex indoor signal environments. This leads to frequent and drastic changes and violent oscillations in the direction of the iterative gradient, resulting in a decrease in the convergence speed and iterative stability of the positioning model, thus affecting the accuracy of indoor positioning.
[0006] In a first aspect, this application provides an indoor positioning method based on momentum acceleration optimization, applied to an indoor positioning system based on momentum acceleration optimization, the method comprising: The mobile terminal receives broadcast signals from multiple Bluetooth beacons during the current positioning period, and analyzes the beacon node and measured signal strength corresponding to each broadcast signal to obtain the current observation set. In each positioning iteration loop, a target beacon node is randomly selected from the current observation set, and the measured signal strength of the target broadcast signal corresponding to the target beacon node is extracted; The estimated current coordinates of the mobile terminal and the preset position coordinates of the target beacon node are input into a preset logarithmic distance path loss model to calculate the estimated signal strength corresponding to the target broadcast signal. The RSSI error function is calculated based on the measured signal strength and the estimated signal strength, and the current gradient at the current coordinate estimate is determined based on the RSSI error function. The current coordinate estimate is updated based on the current gradient and the momentum vector of the current positioning cycle to obtain the updated coordinate estimate. The momentum vector is determined based on the historical gradient information of the preset iteration cycle. Determine whether the updated coordinate estimate meets the preset convergence condition, wherein the convergence condition is reached when the maximum number of iterations is reached or the coordinate error between two iterations is less than the preset error threshold. If not, set the updated coordinate estimate as the new current coordinate estimate and proceed to the next positioning iteration loop; If so, the updated coordinate estimate is set as the positioning result of the mobile terminal and output.
[0007] By adopting the above technical solution, the system introduces the momentum vector determined by historical gradient information and the current gradient to update the coordinate estimate during the iterative positioning process. This allows the update direction to incorporate the cumulative trend of historical gradients rather than relying solely on the current single gradient. When Bluetooth signal interference causes frequent abrupt changes in gradient direction, the system can smoothly optimize the path and suppress oscillations, thereby improving the positioning convergence speed and accuracy.
[0008] In some embodiments, before the step of updating the current coordinate estimate based on the current gradient and the momentum vector of the current positioning period to obtain the updated coordinate estimate, the method further includes: Based on the preset momentum decay factor and the historical momentum vector corresponding to the previous iteration, the decay momentum term is calculated. The gradient step size is calculated based on the current gradient and the preset learning rate. The momentum vector for the current positioning cycle is obtained by adding the decay momentum term and the gradient step size.
[0009] By adopting the above technical solution, the system obtains the decayed momentum term by weighting the historical momentum vector with a decay factor, and superimposes it with the gradient step size calculated based on the current gradient and learning rate to construct the momentum vector. This allows the system to retain the inertia of the historical optimization direction while incorporating the real-time correction of the current gradient, thereby achieving a balanced control of the coordinate update direction and magnitude. This balances the stability of iterative convergence with the sensitivity of response to new gradient information.
[0010] In some embodiments, the step of calculating the gradient step size based on the current gradient and a preset learning rate specifically includes: Obtain the variance of the measured signal strength of the target beacon node within a preset time window in the past; A confidence factor that is negatively correlated with the variance value is calculated based on a preset inverse proportional function relationship; The corrected learning rate is obtained by multiplying the preset learning rate by the confidence factor. The gradient step size is calculated based on the current gradient and the corrected learning rate.
[0011] By adopting the above technical solution, the system calculates the negative correlation confidence factor based on the variance of the measured signal strength of the target beacon node within the time window and corrects the learning rate, so that beacons with larger signal fluctuations correspond to smaller gradient step sizes and beacons with stable signals correspond to larger gradient step sizes. This adaptively adjusts the response of coordinate updates under different signal quality conditions, reduces the interference of noise signals on the positioning results, and improves the robustness of positioning.
[0012] In some embodiments, before the step of calculating the decay momentum term based on a preset momentum decay factor and the historical momentum vector corresponding to the previous iteration, the method further includes: Calculate the mathematical angle between the current gradient direction of the current iteration and the historical momentum vector direction corresponding to the previous iteration to obtain the gradient deflection angle; If the gradient deflection angle is greater than the preset conflict angle threshold, the historical measured signal strength sequence of the target beacon node within the preset time window is extracted and variance is calculated to obtain the link stability characteristics. If the link stability characteristic is less than or equal to the preset fluctuation threshold, the preset momentum decay factor is multiplied by the first penalty coefficient for numerical reduction processing to obtain the target momentum decay factor, which is used to replace the preset momentum decay factor. If the link stability characteristic is greater than the fluctuation threshold, the preset learning rate is multiplied by the second penalty coefficient to perform numerical reduction processing to obtain the target learning rate, which is used to replace the preset learning rate.
[0013] By adopting the above technical solution, when the system detects that the current gradient and the historical momentum direction deflection angle exceed the threshold, it further distinguishes the deflection cause based on the stability of the beacon link: if the link is stable, the momentum decay factor is reduced to suppress excessive historical inertia; if the link is unstable, the learning rate is reduced to reduce the influence of noise gradient, thereby achieving targeted parameter adjustment for different oscillation sources and improving the adaptive capability and positioning accuracy of iterative optimization under complex signal environments.
[0014] In some embodiments, the step of updating the current coordinate estimate based on the current gradient and the momentum vector of the current positioning period to obtain the updated coordinate estimate specifically includes: Extract the horizontal component of the momentum vector in the horizontal axis direction and the vertical component in the vertical axis direction for the current period. Calculate the difference between the x-coordinate of the current coordinate estimate and the x-component to obtain the updated x-coordinate; Calculate the difference between the ordinate of the current coordinate estimate and the longitudinal component to obtain the updated ordinate; The updated x-coordinate and the updated y-coordinate are combined to obtain the updated coordinate estimate.
[0015] By adopting the above technical solution, the system decomposes the momentum vector into components in the horizontal and vertical directions, and performs a dimension-by-dimensional update by subtracting the corresponding coordinates of the current coordinate estimate. This allows the coordinates on the two-dimensional plane to be adjusted independently in each dimension, which is beneficial for fine-grained control of the displacement correction in each spatial direction and improves the structured nature of the coordinate update and the computational clarity of the positioning process.
[0016] In some embodiments, the step of randomly selecting a target beacon node from the current observation set and extracting the measured signal strength of the target broadcast signal corresponding to the target beacon node specifically includes: Each beacon node in the current observation set is sorted according to its measured signal strength and assigned a weight value to obtain the selection probability of each beacon node. The weight value is positively correlated with the measured signal strength. Based on the selected probability, a target beacon node is randomly selected from the current observation set, and the measured signal strength of the target broadcast signal corresponding to the target beacon node is extracted.
[0017] By adopting the above technical solution, the system assigns positively correlated weights to each beacon node based on the measured signal strength and determines the probability of selection, making it easier for beacons with stronger signals to be selected to participate in gradient calculation. Since the signal strength of nearby beacons is usually higher and less affected by path loss, this mechanism helps to improve the reliability of the gradient information used in each iteration and improve the overall positioning accuracy.
[0018] In some embodiments, after the step of setting the updated coordinate estimate as the new current coordinate estimate and performing the next positioning iteration loop, the method further includes: If the mobile terminal detects that it has received a new batch of broadcast signals, the broadcast signals of the new batch are parsed to obtain the latest measured signal strength, and the latest measured signal strength is used to update the measured signal strength of the corresponding beacon node in the current observation set to obtain a dynamically refreshed observation set. According to the preset unloading attenuation ratio, the momentum vector of the current positioning cycle is calculated to achieve centripetal contraction, and the transition momentum vector after decompression and order reduction is obtained. The transition momentum vector is a penalty vector used to reduce historical optimization inertia when a temporal change occurs in the underlying signal observation space. The transition momentum vector is used to replace the momentum vector of the current positioning cycle, and the remaining positioning iteration loop is executed based on the dynamically refreshed observation set.
[0019] By adopting the above technical solution, when the system detects a new batch of broadcast signals during the iteration process, it uses the latest measured signal strength to cover and update the observation set to reflect real-time signal changes. At the same time, it performs centripetal contraction of the momentum vector according to the unloading attenuation ratio to reduce the historical inertia based on old signals, so that subsequent iterations are based on observation data and reduced momentum that are closer to the current environment, thereby improving the real-time performance and accuracy of positioning in dynamic environments.
[0020] Secondly, this application provides an indoor positioning system based on momentum acceleration optimization, the system comprising: one or more processors and a memory; The memory is coupled to the one or more processors. The memory is used to store computer program code, which includes computer instructions. The one or more processors call the computer instructions so that the system can implement the momentum acceleration optimization-based indoor positioning method provided in the above embodiments, which will not be described in detail here.
[0021] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on an indoor positioning system based on momentum acceleration optimization, enable the system to implement an indoor positioning method based on momentum acceleration optimization provided in the above embodiments, which will not be elaborated further here.
[0022] Fourthly, this application provides a computer program product that, when running on an indoor positioning system based on momentum acceleration optimization, enables the system to implement an indoor positioning method based on momentum acceleration optimization provided in the above embodiments, which will not be elaborated here.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. In the iterative optimization process of Bluetooth indoor positioning, a momentum vector determined by the accumulation of historical gradient information is introduced. This vector, along with the current gradient, participates in the update of the coordinate estimation value. Through the superposition of the decaying momentum term and the gradient step size, and a dimensional component update strategy, the coordinate update direction integrates the historical optimization trend with the real-time correction of the current gradient. Compared to methods that rely solely on the current single gradient for updates, this mechanism can smooth the optimization path and suppress zigzag oscillations when the gradient direction frequently changes due to multipath effects and environmental interference in the Bluetooth signal, thus improving the convergence speed and final positioning accuracy of the positioning iteration.
[0024] 2. The confidence factor is calculated using the time window variance of the measured beacon signal strength, and the learning rate is adaptively adjusted. When the current gradient deflection angle exceeds a threshold compared to the historical momentum direction, the cause of the deflection is further differentiated based on the beacon link stability, and targeted reduction penalties are applied to the momentum decay factor or learning rate accordingly. This mechanism enables the localization algorithm to dynamically adjust the response amplitude of the gradient step size according to the signal quality of different beacons, and to differentiate between spurious gradient deflections caused by noise and directional changes caused by real terrain, thereby improving the robustness and adaptability of iterative optimization in complex and variable signal environments.
[0025] 3. By assigning positive correlation weights to each beacon based on the measured signal strength, the probability of high-quality beacons being selected for gradient calculation is increased. During the iteration process, when a new batch of broadcast signals is detected, the observation set is updated in real time to reflect the latest signal state. Simultaneously, the momentum vector is centripetally contracted according to the unloading attenuation ratio to reduce historical inertia based on old signals. This mechanism enables the positioning system to respond promptly to environmental changes and suppress the misleading effects of outdated momentum when temporal abrupt changes occur in the signal observation space, improving the real-time performance and accuracy of positioning results in dynamic indoor environments. Attached Figure Description
[0026] Figure 1This is a flowchart illustrating an indoor positioning method based on momentum acceleration optimization in an embodiment of this application. Figure 2 This is a schematic diagram of a process in an embodiment of this application where the system updates the current coordinate estimate based on the momentum vector; Figure 3 This is an exemplary simulation trajectory diagram of the system performing momentum acceleration optimization in the embodiments of this application; Figure 4 This is a curvature diagram showing the decrease of the average error of the sampling points with the number of iterations in the embodiments of this application; Figure 5 This is a schematic diagram of the physical device structure of an indoor positioning system based on momentum acceleration optimization in the embodiments of this application. Detailed Implementation
[0027] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0028] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0029] In complex indoor environments, Bluetooth signals are susceptible to interference from multipath effects and dynamic environmental changes, leading to iterative oscillations, slow convergence, and low accuracy in traditional gradient descent-based positioning algorithms. To address this, this application provides an indoor positioning method based on momentum acceleration optimization. By introducing a momentum acceleration mechanism to fuse historical gradient information, it effectively suppresses iterative fluctuations and achieves accurate indoor positioning through iterative optimization. Throughout the process, the estimated coordinates are updated using momentum vectors combined with the current gradient, ensuring the estimated position continuously approximates the mobile terminal's true location. Please refer to [link to details]. Figure 1 This is a flowchart illustrating an indoor positioning method based on momentum acceleration optimization in an embodiment of this application.
[0030] S101. Obtain the broadcast signals received by the mobile terminal from multiple Bluetooth beacons during the current positioning period, and parse the beacon node and measured signal strength corresponding to each broadcast signal to obtain the current observation set.
[0031] Here, the current positioning period refers to the time interval within which the system performs a complete indoor positioning operation for the mobile terminal; Bluetooth beacon refers to a low-power wireless device deployed in a fixed indoor location that continuously broadcasts Bluetooth signals; broadcast signal refers to the wireless signal sent out by the Bluetooth beacon that includes its own identifier and signal-related information; beacon node refers to the unique identifier node corresponding to each Bluetooth beacon, used to distinguish different Bluetooth beacons; measured signal strength refers to the strength value of the Bluetooth beacon broadcast signal actually received by the mobile terminal, i.e., the RSSI value; and the current observation set refers to the dataset formed by the system within the current positioning period after integrating all beacon nodes corresponding to the received broadcast signals and measured signal strengths.
[0032] This step is executed after the system initiates the indoor positioning process for the mobile terminal but before entering the first positioning iteration loop. The execution scenario is in Bluetooth signal coverage scenarios requiring indoor positioning, such as shopping malls, factories, and airport terminals. Specifically, the system activates the signal receiving module to capture broadcast signals from all Bluetooth beacons that the mobile terminal can receive within the current positioning cycle, ensuring no valid signal sources are missed. Subsequently, the system parses each captured broadcast signal, extracting the corresponding beacon node information to distinguish signals from different Bluetooth beacons, and simultaneously extracting the actual signal strength received by the mobile terminal. Finally, the system associates and stores all the parsed beacon nodes with their corresponding measured signal strengths, forming a structured current observation set.
[0033] S102. In each positioning iteration loop, randomly select a target beacon node from the current observation set and extract the measured signal strength of the target broadcast signal corresponding to the target beacon node.
[0034] Among them, the positioning iteration loop refers to a complete positioning calculation process from selecting a beacon node to determining whether the coordinates have converged; the target beacon node refers to the beacon node randomly selected by the system from the current observation set for the calculation of this positioning iteration loop; the target broadcast signal refers to the broadcast signal sent out by the target beacon node.
[0035] This step is executed at the beginning of each positioning iteration loop after the system completes the construction of the current observation set. The execution scenario is during the iterative calculation of indoor positioning of the mobile terminal, and this step is executed in each iteration. Specifically, when starting each positioning iteration loop, the system randomly selects one beacon node from all beacon nodes in the current observation set based on a uniform random sampling strategy, and designates it as the target beacon node for this iteration. This ensures the randomness of the selection each time to avoid calculation bias caused by a single beacon. Subsequently, the system retrieves the associated data corresponding to the target beacon node in the current observation set, extracts the signal strength of the target broadcast signal of the target beacon node as measured by the mobile terminal, and provides specific signal strength data for error calculation and gradient solution in this iteration.
[0036] S103. Input the estimated current coordinates of the mobile terminal and the preset position coordinates of the target beacon node into the preset logarithmic distance path loss model to calculate the estimated signal strength corresponding to the target broadcast signal.
[0037] Among them, the current coordinate estimate refers to the current predicted coordinate value of the mobile terminal's location in the current positioning iteration cycle. The initial coordinates are randomly initialized by the system, and the subsequent coordinates are updated after the previous iteration. The preset location coordinates refer to the actual geographical location coordinates of the target beacon node that are pre-entered into the system because they are fixedly deployed. The logarithmic distance path loss model is a mathematical model preset by the system to calculate the signal strength based on the distance mapping between two points. This model can reflect the propagation loss law of wireless signals in indoor environments. The estimated signal strength refers to the theoretical signal strength value of the target broadcast signal that the mobile terminal should receive at the current coordinate estimate, calculated by the system through the logarithmic distance path loss model.
[0038] This step is executed after the system completes the selection of the target beacon node and the extraction of the measured signal strength for this iteration. It is used to calculate the estimated signal strength corresponding to the target broadcast signal. Specifically, the system retrieves the estimated current coordinates of the mobile terminal for this iteration, and simultaneously retrieves the preset location coordinates of the target beacon node from its own beacon node database. Subsequently, the system inputs these two sets of coordinate data into a pre-configured logarithmic distance path loss model. The model calculates the distance between the estimated current location of the mobile terminal and the target beacon node based on the two sets of coordinates. Then, combining preset parameters such as the loss factor of the indoor wireless transmission environment and the signal strength at the reference distance, the model calculates the corresponding signal strength value at that distance through the mapping relationship of the model. This value is the estimated signal strength of the target broadcast signal at the estimated coordinates of the mobile terminal.
[0039] Optionally, in one specific embodiment, the process of calculating the estimated signal strength using the logarithmic distance path loss model described above follows the formula: ,in, To estimate signal strength; n is a loss factor related to the wireless transmission environment; A is the distance between the currently estimated coordinates and the transmitter (target beacon node); A is the distance between the receiver (such as a terminal device) and the transmitter. The signal strength received at the location; For reference distance.
[0040] S104. Calculate the RSSI error function based on the measured signal strength and the estimated signal strength, and determine the current gradient at the current coordinate estimate based on the RSSI error function.
[0041] Among them, the RSSI error function is a mathematical function constructed by the system based on the difference between the measured signal strength and the estimated signal strength, used to quantify the degree of deviation between the current coordinate estimate of the mobile terminal and the actual position; the current gradient refers to the gradient direction and gradient value of the RSSI error function at the current coordinate estimate of the mobile terminal, reflecting the rate of change and direction of change of the error function at that position.
[0042] Specifically, the system performs a difference calculation between the extracted measured signal strength and the calculated estimated signal strength, and constructs an RSSI error function based on this difference. The value of this function directly reflects the degree of deviation between the current coordinate estimate and the true position; the larger the value, the greater the deviation. Subsequently, the system performs a derivative calculation on the constructed RSSI error function to solve for the gradient of the function at the current coordinate estimate of the mobile terminal. This gradient includes components in both the x-axis and y-axis directions, clarifying the direction and rate of change of the mobile terminal coordinates that need to be adjusted to reduce the error and make the estimated position closer to the true position. This gradient is the current gradient of this iteration.
[0043] In some embodiments, the calculation of the RSSI error function and the determination of the current gradient can be achieved in a variety of ways: Optionally, the system calculates the absolute difference between the measured signal strength and the estimated signal strength, constructs the RSSI error function with the square of the difference, and then calculates the first-order partial derivatives of the error function with respect to the x-coordinate and y-coordinate respectively. The values of the partial derivatives at the current coordinate estimate are combined into a two-dimensional gradient vector to obtain the current gradient, and the partial derivative results of the gradient calculation are recorded at the same time. Optionally, the system can first construct an RSSI error function using the direct difference between the measured signal strength and the estimated signal strength. This error function is then standardized to eliminate the influence of dimensions. The gradient of the processed error function at the current coordinate estimate is then calculated, and gradient normalization is applied to obtain the current gradient, ensuring the accuracy of the gradient direction and the reasonableness of the gradient value. It is understood that other methods can also be used to calculate the RSSI error function and determine the current gradient; this is not limited here.
[0044] In this embodiment of the application, the error can be defined as the difference between the estimated signal strength and the actual measured signal strength. The difference, i.e. Subsequently, the system performs derivative operations on the RSSI error function, calculating the partial derivatives of the error function with respect to the x-coordinate and y-coordinate of the current coordinate estimate. The vector formed by these two partial derivatives is the current gradient, and its direction points in the direction in which the error function increases. Based on the RSSI error function, the gradient direction with respect to position is calculated. The calculation formula is as follows: , Therefore, in subsequent coordinate updates, the coordinates need to be adjusted in the opposite direction of the gradient in order to gradually reduce the error and gradually approach the true position of the mobile terminal.
[0045] S105. Update the current coordinate estimate based on the current gradient and the momentum vector of the current positioning cycle to obtain the updated coordinate estimate.
[0046] Here, the momentum vector refers to the vector obtained by the system by fusing historical gradient information and the current gradient within a preset iteration period. It includes components in the x-axis and y-axis directions and is used to guide the update direction and magnitude of the coordinate estimate. The preset iteration period refers to the interval of iterations set by the system for extracting historical gradient information. The historical gradient information refers to the gradient direction and gradient value obtained by the system in each positioning iteration loop within the preset iteration period. The updated coordinate estimate refers to the new predicted coordinate value of the mobile terminal obtained by the system after adjusting the current coordinate estimate through the momentum vector.
[0047] Specifically, the system retrieves historical gradient information from pre-stored data within a preset iteration period, processes this information using an exponentially weighted moving average, and incorporates the inertial trend of the historical gradients. Then, it combines the processed historical gradient information with the current gradient obtained in the current iteration to generate a momentum vector for the current positioning period. This vector retains the coordinate adjustment inertia of previous iterations while incorporating the immediate adjustment requirements of the current gradient. Subsequently, based on this momentum vector, the system adjusts and calculates the current coordinate estimate of the mobile terminal along the direction indicated by the momentum vector, updating the coordinate values in the x-axis and y-axis directions respectively, ultimately obtaining the updated coordinate estimate for this iteration, making the estimated position closer to the actual position.
[0048] In the process of updating the current coordinate estimate based on the momentum vector of the current gradient and the current positioning cycle, in order to achieve a refined and structured update of the two-dimensional plane coordinates, the system can complete the coordinate iteration by decomposing the momentum vector dimensionally and updating the horizontal and vertical coordinates respectively.
[0049] Specifically, the system extracts the lateral component of the momentum vector in the horizontal direction and the longitudinal component in the vertical direction of the current positioning cycle. The lateral component of the momentum vector represents the adjustment magnitude and direction of the coordinate in the x-axis direction, and the longitudinal component represents the adjustment magnitude and direction of the coordinate in the y-axis direction. The independent control of the displacement correction amount in different spatial directions is achieved through component decomposition.
[0050] The system retrieves the current coordinate estimates from the mobile terminal and updates the horizontal and vertical coordinates independently. It calculates the difference between the horizontal coordinate of the current coordinate estimate and the horizontal component of the momentum vector to obtain the updated horizontal coordinate; similarly, it calculates the difference between the vertical coordinate of the current coordinate estimate and the vertical component of the momentum vector to obtain the updated vertical coordinate. Adjusting the coordinates in the opposite direction of the momentum vector allows the coordinate estimates to gradually move in the direction of decreasing error function, thus approximating the true position of the mobile terminal.
[0051] The system combines the updated horizontal and vertical coordinates obtained from the dimension-by-dimensional calculation into two-dimensional coordinates to form a new coordinate estimate for the mobile terminal after this iteration. This coordinate estimate integrates the inertial trend of the historical gradient with the real-time adjustment requirements of the current gradient, and improves the calculation clarity and accuracy of the coordinate adjustment through dimension-by-dimensional updates.
[0052] In some embodiments, the coordinate estimate can be updated in a variety of ways: Optionally, the system first calculates the weighted average of historical gradient information by exponential weighted moving average, uses the average as the historical momentum term, then combines the historical momentum term with the current gradient to obtain the momentum vector, extracts the x and y components of the momentum vector, and subtracts the corresponding components from the x and y coordinates of the current coordinate estimate to obtain the updated x and y coordinates, which are then combined to form the updated coordinate estimate. Optionally, the system can first set decay weights for historical gradient information, differentiate and weight historical gradients of different iteration numbers, fuse them to obtain a historical gradient fusion value, add it to the current gradient to generate a momentum vector, perform amplitude calibration on the momentum vector, and subtract the calibrated momentum vector from the current coordinate estimate to obtain the updated coordinate estimate. Simultaneously, boundary verification is performed on the updated coordinates to ensure they are within the effective range of indoor positioning. It is understood that other methods can also be used to update the coordinate estimate; this is not limited here.
[0053] The update process in this embodiment follows the following momentum acceleration and position update formula: , ,in, t Represents the number of iterations. The momentum decay factor, For learning rate, and Each is the previous iteration x andy The momentum term in the direction. and for t The momentum term after the next iteration update. and The coordinates are the coordinates after t iterations.
[0054] S106. Does the updated coordinate estimate meet the preset convergence condition?
[0055] The convergence condition refers to the system's preset criteria for determining whether the positioning iteration loop can be terminated, which includes two dimensions: the number of iterations and the coordinate error. The maximum number of iterations refers to the upper limit of the iteration loop set by the system for this positioning. Once this number is reached, the iteration is forcibly terminated. The coordinate error between two iterations refers to the distance difference between the coordinate estimate after the current iteration and the coordinate estimate of the previous iteration. The preset error threshold is the system's preset distance threshold for determining that the coordinate estimate tends to be stable. If it is less than this threshold, the coordinate estimate is considered to have approached the true position.
[0056] This step is executed after the system obtains the coordinate estimation value updated in this iteration. Specifically, the system counts the number of iterations completed from the start of this positioning process to the present, and determines whether this number has reached the preset maximum number of iterations. If it has, the convergence condition is directly met, and the process proceeds directly to step S107. If not, the system calculates the Euclidean distance between the coordinate estimation value updated in this iteration and the coordinate estimation value of the previous iteration, obtaining the coordinate error between the two iterations. This error is compared with a preset error threshold. If the error is less than the preset error threshold, the convergence condition is met, and the process proceeds directly to step S107. If the error is greater than or equal to the preset error threshold, the convergence condition is not met, and the process proceeds to step S102 to execute the next iteration loop.
[0057] S107. Set the current coordinate estimate as the positioning result of the mobile terminal and output it.
[0058] The new current coordinate estimate refers to the coordinate estimate updated in this iteration, which will be used as the current coordinate estimate of the mobile terminal in the next positioning iteration loop; the positioning result refers to the final indoor location coordinate value of the mobile terminal determined by the system after the convergence condition is met.
[0059] Specifically, the system performs subsequent processing based on the convergence condition judgment result of step S106: if the judgment result is that the convergence condition is not met, the system stores the coordinate estimation value updated in this iteration and sets it as the new current coordinate estimation value for the next positioning iteration cycle, and then starts the next positioning iteration cycle, repeating steps S102 to S106; if the judgment result is that the convergence condition is met, the system determines the coordinate estimation value updated in this iteration as the final positioning result of the mobile terminal in the current positioning cycle, organizes the positioning result according to the preset format, and outputs the positioning result to the mobile terminal or related positioning display device through the signal transmission module, thus completing the indoor positioning process.
[0060] In some embodiments, the continuation of the iterative loop or the output of the positioning result can be achieved in a variety of ways: Optionally, if the system determines that the convergence condition is not met, the updated coordinate estimate is written to the cache address of the iterative calculation, overwriting the original current coordinate estimate, and the cache address is used as the coordinate data source for the next iteration. Then, the start command for the next positioning iteration loop is automatically triggered. If the convergence condition is met, the updated coordinate estimate is converted into the actual location identifier of the indoor map, additional information such as positioning time and beacon reference is added, a positioning result report is generated, and it is sent to the mobile terminal via Bluetooth, local area network, or other means.
[0061] Optionally, if the system determines that the convergence condition is not met, it backs up the updated coordinate estimates and assigns them to the system variable for the current coordinate estimates, updates the parameter library for the system's iterative calculation, and then starts the next positioning iteration loop. If the convergence condition is met, the updated coordinate estimates are verified for accuracy. If the verification is successful, the result is used as the positioning result and output synchronously in the system backend and the positioning interface on the mobile terminal, while simultaneously ending the iterative calculation process for this positioning. It is understood that other methods can also be used to continue the iteration loop or output the positioning result; this is not limited here.
[0062] In the above embodiments, the system introduces a momentum vector determined by historical gradient information and the current gradient to jointly update the coordinate estimate during the iterative positioning process. This allows the update direction to incorporate the cumulative trend of historical gradients rather than relying solely on the current single gradient. When Bluetooth signal interference causes frequent abrupt changes in gradient direction, the system can smoothly optimize the path and suppress oscillations, thereby improving the positioning convergence speed and accuracy.
[0063] In the aforementioned steps S101 to S107, during the indoor positioning iteration based on momentum acceleration, although iterative oscillations can be suppressed by fusing historical gradients, in some specific embodiments, issues such as differences in beacon signal quality and the distinction between the causes of gradient and momentum direction conflicts may still exist. Low-quality signals participating in the calculation and a lack of targeted parameter adjustment may still affect positioning accuracy and efficiency. Therefore, the system of this application further optimizes the positioning iteration process by executing steps S201 to S215, assigning weights to beacons, specifically adjusting algorithm parameters, dynamically refreshing signal data, and correcting the momentum vector. This makes the algorithm more adaptable to the complex indoor signal environment, improving the adaptability and accuracy of positioning.
[0064] Please refer to details. Figure 2 This is a schematic diagram of a process in an embodiment of this application to update the current coordinate estimate based on the momentum vector.
[0065] S201. Sort each beacon node in the current observation set according to the measured signal strength and assign weight values to obtain the selection probability of each beacon node.
[0066] The weight value refers to the numerical value assigned by the system to the beacon node based on the measured signal strength, which is used to characterize the signal quality and reference value; the selection probability refers to the likelihood of each beacon node being selected as the target beacon node in the positioning iteration, which is calculated from the weight value.
[0067] This step is executed after the system completes the construction of the current observation set and before entering the single-location iteration loop to select the target beacon node. Specifically, the system extracts the measured signal strength data of all beacon nodes in the current observation set, sorts all beacon nodes in descending order of signal strength, with beacon nodes of higher signal strength ranked higher; then, it assigns a corresponding weight value to each beacon node according to the ranking result, following the rule that signal strength and weight value are positively correlated, that is, the beacon node ranked higher receives a larger weight value; finally, the system calculates the ratio of the weight value of each beacon node to the total weight value of all beacon nodes, converts the calculation result into a percentage form, and obtains the probability that each beacon node will be selected as the target beacon node in this iteration.
[0068] Optionally, the system extracts beacon node and measured signal strength data from the current observation set, and uses bubble sort to sort the beacon nodes in descending order of measured signal strength. The system assigns a base weight of 0.5 to the top 30% of the beacons, a base weight of 0.3 to the middle 40%, and a base weight of 0.2 to the bottom 30%. The system then divides the base weight of each beacon by the total weight to obtain the probability of it being selected. Optionally, the system can first sort the beacon nodes in descending order of measured signal strength using a quicksort algorithm, directly using the normalized value of the measured signal strength as the weight value of each beacon node, and then compare the normalized weight value of each beacon node with the sum of the normalized weight values of all beacons to obtain the selection probability of each beacon node, which is then stored in a probability mapping table. It is understood that other methods can also be used to implement the sorting, weight allocation, and selection probability calculation of beacon nodes; this is not limited here.
[0069] S202. Randomly select target beacon nodes from the current observation set according to the selection probability, and extract the measured signal strength of the target broadcast signal corresponding to the target beacon node.
[0070] Specifically, the system constructs a probability sampling space based on the selection probability of each beacon node, ensuring that the probability of each beacon being selected during the sampling process is consistent with the calculated selection probability. Then, a beacon node is selected from this probability sampling space using a random sampling algorithm, and this node is determined as the target beacon node for this iteration. Beacon nodes with high signal strength and large weight values are more likely to be selected due to their higher selection probability. Finally, the system performs precise retrieval in the current observation set based on the identifier of the target beacon node, and extracts the measured signal strength of the target broadcast signal corresponding to that node.
[0071] S203. After determining the current gradient at the current coordinate estimate based on the measured signal strength and the estimated signal strength, calculate the mathematical angle between the current gradient direction of the current iteration and the historical momentum vector direction corresponding to the previous iteration to obtain the gradient deflection angle.
[0072] The gradient deflection angle refers to the mathematical angle between the current gradient direction and the historical momentum vector direction, which is used to characterize the degree of deviation between the two directions; the historical momentum vector refers to the momentum vector calculated by the system in the previous positioning iteration loop, which reflects the coordinate update inertial direction of the previous iteration.
[0073] This step is executed after the system has calculated the current gradient at the current coordinate estimate. The execution scenario is within each positioning iteration of indoor Bluetooth positioning, after gradient calculation and before momentum vector construction. Specifically, the system extracts the direction vector of the current gradient calculated in the current iteration, and simultaneously retrieves the direction vector of the historical momentum vector corresponding to the previous iteration from the system's historical iteration parameter library, ensuring that the two direction vectors are in the same two-dimensional coordinate system. Then, using the vector angle calculation formula, the mathematical angle between the two direction vectors is calculated. This angle ranges from 0 to 180 degrees; a larger angle indicates a greater deviation between the current gradient direction and the historical momentum vector direction, and a stronger conflict. Finally, the system defines the calculated mathematical angle as the gradient deflection angle and stores its value in the temporary parameter storage area for this iteration.
[0074] S204. If the gradient deflection angle is greater than the preset conflict angle threshold, extract the historical measured signal strength sequence of the target beacon node within the preset time window and perform variance calculation to obtain the link stability characteristics.
[0075] Among them, the conflict angle threshold refers to the angle value preset by the system to determine whether there is a significant conflict between the current gradient direction and the historical momentum vector direction; the preset time window refers to the time range set by the system to extract historical signal data of the target beacon node; the historical measured signal strength sequence refers to the dataset composed of the signal strength actually received by the mobile terminal within the preset time window in chronological order; the link stability feature refers to the value obtained by performing variance calculation on the historical measured signal strength sequence, which is used to characterize the stability of the signal transmission link between the target beacon node and the mobile terminal. The smaller the value, the more stable the link.
[0076] Specifically, under the premise that the gradient deflection angle is greater than the preset conflict angle threshold, the system determines the time range of the preset time window, extracts all measured signal strength data of the target beacon node within this time range from the system's historical beacon signal database; then, the extracted historical signal strength data is arranged in the order of time acquisition to form an ordered historical measured signal strength sequence; finally, the variance of the processed historical measured signal strength sequence is calculated, and the calculated variance value is the link stability feature. This value directly reflects the fluctuation of the target beacon node's signal strength. The larger the variance, the more severe the signal fluctuation and the worse the link stability.
[0077] Optionally, when the gradient deflection angle exceeds the threshold, the system first extracts the historical measured signal strength data of the target beacon node within the past 30 seconds from the signal history database according to the timestamp. After removing abnormal data that exceeds the normal signal strength range, a sequence is formed. The sample variance calculation formula is used to calculate the sequence to obtain the link stability characteristics and retain multiple decimal places.
[0078] S205. Does the link stability characteristic exceed the preset fluctuation threshold?
[0079] The fluctuation threshold refers to the variance value preset by the system to determine whether the signal transmission link of the target beacon node is stable.
[0080] Specifically, the system compares the link stability feature value calculated in step S204 with the preset fluctuation threshold. If the link stability feature is greater than the fluctuation threshold, it indicates that the signal transmission link of the target beacon node fluctuates violently, and the directional conflict between the current gradient and the historical momentum is likely caused by signal noise. If the link stability feature is less than or equal to the fluctuation threshold, it indicates that the signal transmission link of the target beacon node is relatively stable, and the directional conflict between the current gradient and the historical momentum is likely caused by real terrain factors such as changes in the position of the mobile terminal.
[0081] S206. Multiply the preset momentum decay factor by the first penalty coefficient to perform numerical reduction processing to obtain the target momentum decay factor.
[0082] Here, the first penalty coefficient refers to a system-preset coefficient used to reduce the numerical value of the momentum decay factor, and its value is a positive number between 0 and 1; the target momentum decay factor is the value obtained by multiplying the preset momentum decay factor by the first penalty coefficient, and is used to replace the original preset momentum decay factor in subsequent calculations of the decay momentum term. This step is executed when the system determines that the link stability feature is less than or equal to the preset fluctuation threshold, and the execution scenario is in each positioning iteration loop of indoor Bluetooth positioning, and it is only executed under the dual premise that the gradient deflection angle exceeds the threshold and the link stability feature does not exceed the fluctuation threshold.
[0083] Specifically, when the link stability characteristic is less than or equal to the fluctuation threshold, the system retrieves the preset momentum decay factor and the first penalty coefficient set by the system from the algorithm parameter library, ensuring that both values are valid positive numbers. Then, the preset momentum decay factor and the first penalty coefficient are multiplied to reduce the original momentum decay factor. The reduced value is the target momentum decay factor. This factor reduces the degree of historical momentum decay, thereby suppressing excessive historical optimization inertia and resolving the problem of gradient and momentum direction conflict caused by real terrain factors. Finally, the system stores the calculated target momentum decay factor in the parameter temporary storage area of this iteration, which is used to replace the original preset momentum decay factor in subsequent calculations of decay momentum terms.
[0084] S207. Multiply the preset learning rate by the second penalty coefficient to reduce the value and obtain the target learning rate.
[0085] The second penalty coefficient is a system-preset coefficient used to reduce the learning rate, and its value is a positive number between 0 and 1. The target learning rate is the value obtained by multiplying the preset learning rate by the second penalty coefficient, and it is used to replace the original preset learning rate in subsequent gradient step size calculations. This step is executed when the system determines that the link stability feature is greater than the preset fluctuation threshold. The execution scenario is in each positioning iteration loop of indoor Bluetooth positioning, and it is only executed under the dual premises that the gradient deflection angle exceeds the threshold and the link stability feature exceeds the fluctuation threshold.
[0086] Specifically, under the condition that the link stability characteristic is greater than the fluctuation threshold, the system retrieves the preset learning rate and the system-set second penalty coefficient from the algorithm parameter library, ensuring that both values are valid positive numbers between 0 and 1. Then, the preset learning rate and the second penalty coefficient are multiplied to reduce the original learning rate. The reduced value is the target learning rate. This learning rate reduces the magnitude of the current gradient step, thereby reducing the impact of false gradients caused by signal noise on coordinate updates and resolving the problem of gradient and momentum direction conflicts caused by signal fluctuations. Finally, the system stores the calculated target learning rate in the parameter temporary storage area of this iteration, which is used to replace the original preset learning rate in subsequent gradient step calculations.
[0087] S208. Based on the preset momentum decay factor and the historical momentum vector corresponding to the previous iteration, calculate the decay momentum term.
[0088] The decaying momentum term refers to the vector obtained by weighting the historical momentum vector with a momentum decay factor. It is used to preserve the inertial trend of historical optimization and reduce its influence on the current iteration. This step is performed after the system has completed the gradient deflection angle determination and the correction of related parameters (momentum decay factor / learning rate).
[0089] Specifically, the system determines whether the momentum decay factor correction operation has been triggered. If it has been corrected, the target momentum decay factor obtained in step S206 is retrieved; otherwise, the original preset momentum decay factor is retrieved. Then, the historical momentum vector corresponding to the previous iteration cycle is extracted from the historical iteration parameter library. This vector contains components in both the horizontal and vertical directions. Subsequently, the momentum decay factor is multiplied by the horizontal and vertical components of the historical momentum vector respectively, and the historical momentum vector is weighted and decayed in each dimension. The decayed two-dimensional vector is the decayed momentum term. This vector retains the cumulative inertia of the historical gradient and reduces the excessive interference of outdated historical information on the current iteration through decay.
[0090] S209. Obtain the variance of the measured signal strength of the target beacon node within the past preset time window, and calculate the confidence factor that is negatively correlated with the variance value based on the preset inverse proportional function relationship.
[0091] The confidence factor is a coefficient calculated based on the variance of the signal strength of the target beacon node. It is used to characterize the reliability of the signal data of the beacon node and is negatively correlated with the variance of the signal strength. The smaller the variance, the larger the confidence factor and the more reliable the signal data.
[0092] Specifically, the system determines a preset time window for extracting signal data, retrieves all measured signal strength data of the target beacon node within that time window from the historical beacon signal database, and obtains a data sequence. Then, it performs variance calculation on the data sequence to obtain the variance value of the measured signal strength of the target beacon node, which reflects the degree of signal fluctuation. Subsequently, it calls the system's preset inverse proportional function relationship, substitutes the variance value into the function for calculation, and obtains the corresponding confidence factor, ensuring that the larger the variance value, the smaller the confidence factor, thereby quantifying the reliability of beacons with different signal quality.
[0093] Optionally, the system extracts the measured signal strength data of the target beacon node within the past 20 seconds, calculates the sample variance after deduplication and smoothing, and substitutes the variance value into the preset inverse proportional function y=k / x (k is a preset constant) to calculate the confidence factor, ensuring that the factor value is between 0 and 1; Optionally, the system can also first extract the measured signal strength data collected from the target beacon node in the first 40 times, calculate the overall variance, normalize the variance value, and then substitute it into a preset inverse proportional correction function to obtain the confidence factor. At the same time, the factor value is compared with the preset minimum value. If it is lower than the minimum value, the minimum value is taken as the final confidence factor.
[0094] S210. Calculate the confidence factor that is negatively correlated with the variance value using the preset inverse proportional function relationship, and multiply the preset learning rate by the confidence factor to obtain the corrected learning rate.
[0095] Specifically, the system first determines whether a learning rate correction operation has been triggered. If it has been corrected, the target learning rate obtained in step S207 is retrieved as the base learning rate; otherwise, the original preset learning rate is retrieved. Then, the confidence factor calculated in step S209 is extracted. Subsequently, the base learning rate and the confidence factor are multiplied to obtain the corrected learning rate. Beacons with small signal fluctuations and large confidence factors will correspond to a larger corrected learning rate, while beacons with large signal fluctuations and small confidence factors will correspond to a smaller corrected learning rate, thus realizing dynamic adjustment of the learning rate according to the beacon signal quality.
[0096] S211. Multiply the preset learning rate by the confidence factor to obtain the corrected learning rate, and calculate the gradient step size based on the current gradient and the corrected learning rate.
[0097] The gradient step size is a vector obtained by multiplying the current gradient by the corrected learning rate. It is used to characterize the magnitude and direction of the adjustment of the current gradient to the coordinate update and is an important component of the momentum vector construction.
[0098] Specifically, the system extracts the current gradient obtained in this iteration. This gradient is a two-dimensional vector containing horizontal and vertical components, reflecting the direction and rate of change of the error function at the current coordinates. Then, it retrieves the corrected learning rate obtained in step S210 and multiplies it with the horizontal and vertical components of the current gradient to adjust the magnitude of each dimension of the current gradient. The two-dimensional gradient vector after learning rate adjustment is the gradient step size. This vector retains the adjustment direction of the current gradient and adapts to the beacon signal quality through the learning rate, avoiding iterative oscillations caused by excessively large gradient step sizes due to signal noise.
[0099] Optionally, the system first extracts the x and y components of the current gradient and the corrected learning rate, multiplies the learning rate by the two components to obtain the corresponding components of the gradient step size, and then combines the two components into a two-dimensional gradient step size vector, which is stored in the same vector buffer as the decay momentum term. Optionally, the system can first normalize the current gradient to obtain a unit gradient vector, multiply the corrected learning rate by the unit gradient vector, and then restore the magnitude by combining it with the original gradient's magnitude to obtain the gradient step size. Simultaneously, the step size vector is checked for magnitude; if it exceeds a preset maximum value, it is scaled down proportionally. It is understood that other methods can also be used to calculate the gradient step size; this is not limited here.
[0100] S212. Add the decay momentum term and the gradient step size to obtain the momentum vector of the current positioning cycle. Update the current coordinate estimate based on the current gradient and the momentum vector of the current positioning cycle to obtain the updated coordinate estimate.
[0101] Specifically, the system performs vector addition on the decay momentum term and the gradient step size, that is, adds the horizontal and vertical components of the two two-dimensional vectors respectively to obtain the momentum vector of the current positioning cycle. This vector integrates the inertial trend of historical optimization and the real-time adjustment needs of the current gradient, achieving a balance between historical and current information. Then, the system extracts the current coordinate estimate of the mobile terminal, subtracts the horizontal and vertical components corresponding to the momentum vector from the horizontal and vertical coordinates of the current coordinate estimate respectively, and adjusts the coordinates in the opposite direction of the momentum vector to finally obtain the updated coordinate estimate, making the estimated position closer to the actual position of the mobile terminal.
[0102] S213. If the updated coordinate estimate does not meet the preset convergence condition, and the mobile terminal is detected to have received a new batch of broadcast signals, the current observation set is updated according to the latest measured signal strength corresponding to the new batch of broadcast signals to obtain a dynamically refreshed observation set.
[0103] Among them, the new batch of broadcast signals refers to the Bluetooth beacon broadcast signals newly received by the mobile terminal during the positioning iteration process, which are the latest signal data that are different from the initial observation set; the latest measured signal strength refers to the signal strength value of the new batch of broadcast signals actually received by the mobile terminal; the dynamically refreshed observation set refers to the dataset obtained after overwriting the corresponding data of the current observation set with the latest measured signal strength, which reflects the real-time status of the beacon signal.
[0104] This step is executed when the system determines that the updated coordinate estimate does not meet the convergence condition and a new batch of broadcast signals is detected. Specifically, the system completes the convergence condition determination for the updated coordinate estimate, confirming that it is not met. Simultaneously, the signal detection module detects that the mobile terminal has received a new batch of Bluetooth beacon broadcast signals. Subsequently, the new batch of broadcast signals is parsed, extracting the beacon node and the latest measured signal strength for each signal. The latest measured signal strength is then overwritten and updated with the measured signal strength of the corresponding beacon node in the current observation set. If the new batch of signals includes a beacon node outside the current observation set, the beacon node and its corresponding latest measured signal strength are added to the observation set, ultimately forming a dynamically refreshed observation set reflecting the real-time signal status.
[0105] S214. Perform centripetal contraction calculation on the momentum vector of the current positioning cycle according to the preset unloading attenuation ratio to obtain the transition momentum vector after force discharge and order reduction.
[0106] The unloading attenuation ratio refers to a system-preset coefficient used to centripetally shrink the current momentum vector, with a value between 0 and 1. The centripetal shrinkage calculation refers to the operation of weighting and shrinking each dimension component of the momentum vector according to the unloading attenuation ratio to reduce the vector amplitude. The transition momentum vector refers to the momentum vector after centripetal shrinkage, which is used to reduce the historical optimization inertia based on old signals and avoid the misleading effect of outdated momentum on subsequent iterations.
[0107] This step is executed after the system has built and obtained the dynamically refreshed observation set. Specifically, the system extracts the momentum vector of the current positioning cycle from the vector buffer of this iteration. This vector is the core vector guiding the coordinate update of this time. Then, the system retrieves the preset unloading attenuation ratio and multiplies this ratio with the horizontal and vertical components of the momentum vector respectively. The magnitude of each dimension of the momentum vector is centripetally contracted to reduce the overall adjustment magnitude of the vector. The two-dimensional vector after the contraction calculation is the transition momentum vector. This vector retains the directional trend of the original momentum vector, but significantly reduces its adjustment magnitude, realizing the deceleration and order reduction of the historical optimization inertia, and adapting to the latest signal observation data.
[0108] S215. Replace the momentum vector of the current positioning cycle with the transition momentum vector, and execute the remaining positioning iteration loop based on the dynamically refreshed observation set.
[0109] Specifically, the system replaces the momentum vector of the current positioning cycle with the transition momentum vector obtained in step S214, using it as the basis momentum vector for subsequent iterations, while clearing the cached data of the original momentum vector. Then, the dynamically refreshed observation set obtained in step S213 is determined as the signal data basis for subsequent iterations, replacing the original current observation set. Subsequently, the next positioning iteration cycle is started, and based on the dynamically refreshed observation set and the transition momentum vector, the entire process from beacon node selection to coordinate update and convergence determination is repeatedly executed until the coordinate estimate meets the preset convergence condition, ensuring that subsequent iterations are always based on the latest signal data and the adapted momentum vector, thereby improving the positioning accuracy in dynamic environments.
[0110] The effectiveness of the technical solutions provided in the embodiments of this application will be further illustrated below with simulation experiments. Please refer to [link / reference]. Figure 3 This is an exemplary simulation trajectory diagram of the system performing momentum acceleration optimization in the embodiments of this application.
[0111] The experimental map environment constructed in this embodiment is a U-shaped corridor within a two-dimensional 30m x 30m plane, where the corridor width is set to 3 meters and the total path length is 70 meters. Eighty path sampling points are evenly distributed along the corridor path, and a Bluetooth beacon is placed every 2 meters on the walls on both sides of the corridor. The system randomly initializes the starting position of mobile devices within the corridor based on the map's extent.
[0112] During the experiment, the tester held a mobile terminal device (positioning device) equipped with the positioning algorithm of this application in front of their chest and walked along a preset sampling path. At each sampling point, the system executed the aforementioned positioning iterative algorithm, with a maximum number of iterations set to 3000. In each iteration loop, the system could choose to randomly select Bluetooth beacon nodes in the environment using a uniform sampling strategy, and update the coordinates using a momentum acceleration mechanism. Figure 3 The comparison between the estimated location trajectory and the actual path in the final output is shown.
[0113] Please see Figure 4 , is a curvature diagram showing the decrease of the average error of the sampling points with the number of iterations in the embodiments of this application.
[0114] This figure primarily analyzes the mathematical relationship between the average error of the estimated position of the 80 sampling points after each iteration update and the number of iterations. As shown by the green curvature line in the figure, the positioning error generally shows a significant convergent decreasing trend as the number of iterations increases.
[0115] Specifically, in the initial iterations, the error decreases rapidly, and due to the introduction of a momentum acceleration mechanism, the fluctuations during the descent are small, demonstrating good stability. Experimental data shows that the algorithm's convergence rate reaches 99.3%. When the number of iterations reaches approximately 2000, the convergence rate enters a relatively stable state, and the error curve tends to flatten. At the upper limit of 3000 iterations, the calculated average positioning error is only 0.09 meters.
[0116] In summary, compared with traditional methods, the momentum acceleration optimization method provided in this application can not only effectively suppress oscillations during the iteration process, but also achieve high-precision indoor positioning, verifying the theoretical correctness and practical application value of the aforementioned technical solutions in steps S101 to S215. The momentum acceleration-optimized indoor positioning system of this invention is applied to electronic devices. Figure 5 A schematic diagram of the architecture of an electronic device suitable for implementing embodiments of the present invention is shown.
[0117] It should be noted that, Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0118] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions (computer programs), or by instructions (computer programs) controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. The electronic device of this embodiment includes a storage medium and a processor, wherein the storage medium stores multiple instructions that can be loaded by the processor to execute any step of the method provided in the embodiments of the present invention.
[0119] Specifically, the storage medium and the processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more signal lines. The storage medium stores computer-executable instructions that implement data access control methods, including at least one software functional module that can be stored in the storage medium in the form of software or firmware. The processor executes various functional applications and data processing by running the software program and module stored in the storage medium. The storage medium can be, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The storage medium stores the program, and the processor executes the program after receiving the execution instructions.
[0120] Furthermore, the software programs and modules within the aforementioned storage medium may also include an operating system, which may include various software components and / or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.) and can communicate with various hardware or software components to provide an operating environment for other software components. The processor may be an integrated circuit chip with signal processing capabilities. The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., which can implement or execute the methods, steps, and logic flowcharts disclosed in this embodiment. The general-purpose processor may be a microprocessor or any conventional processor.
[0121] Since the instructions stored in the storage medium can execute the steps in any of the methods provided in the embodiments of the present invention, the beneficial effects of any of the methods provided in the embodiments of the present invention can be achieved, as detailed in the preceding embodiments, and will not be repeated here.
[0122] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An indoor positioning method based on momentum acceleration optimization, applied to an indoor positioning system based on momentum acceleration optimization, characterized in that, The method includes: The mobile terminal receives broadcast signals from multiple Bluetooth beacons during the current positioning period, and analyzes the beacon node and measured signal strength corresponding to each broadcast signal to obtain the current observation set. In each positioning iteration loop, a target beacon node is randomly selected from the current observation set, and the measured signal strength of the target broadcast signal corresponding to the target beacon node is extracted; The estimated current coordinates of the mobile terminal and the preset position coordinates of the target beacon node are input into a preset logarithmic distance path loss model to calculate the estimated signal strength corresponding to the target broadcast signal. The RSSI error function is calculated based on the measured signal strength and the estimated signal strength, and the current gradient at the current coordinate estimate is determined based on the RSSI error function. The current coordinate estimate is updated based on the current gradient and the momentum vector of the current positioning cycle to obtain the updated coordinate estimate. The momentum vector is determined based on the historical gradient information of the preset iteration cycle. Determine whether the updated coordinate estimate meets the preset convergence condition, wherein the convergence condition is reached when the maximum number of iterations is reached or the coordinate error between two iterations is less than the preset error threshold. If not, set the updated coordinate estimate as the new current coordinate estimate and proceed to the next positioning iteration loop; If so, the updated coordinate estimate is set as the positioning result of the mobile terminal and output.
2. The method according to claim 1, characterized in that, Before the step of updating the current coordinate estimate based on the current gradient and the momentum vector of the current positioning period to obtain the updated coordinate estimate, the method further includes: Based on the preset momentum decay factor and the historical momentum vector corresponding to the previous iteration, the decay momentum term is calculated. The gradient step size is calculated based on the current gradient and the preset learning rate. The momentum vector for the current positioning cycle is obtained by adding the decay momentum term and the gradient step size.
3. The method according to claim 2, characterized in that, The step of calculating the gradient step size based on the current gradient and the preset learning rate specifically includes: Obtain the variance of the measured signal strength of the target beacon node within a preset time window in the past; A confidence factor that is negatively correlated with the variance value is calculated based on a preset inverse proportional function relationship; The corrected learning rate is obtained by multiplying the preset learning rate by the confidence factor. The gradient step size is calculated based on the current gradient and the corrected learning rate.
4. The method according to claim 2, characterized in that, Before the step of calculating the decay momentum term based on the preset momentum decay factor and the historical momentum vector corresponding to the previous iteration, the method further includes: Calculate the mathematical angle between the current gradient direction of the current iteration and the historical momentum vector direction corresponding to the previous iteration to obtain the gradient deflection angle; If the gradient deflection angle is greater than the preset conflict angle threshold, the historical measured signal strength sequence of the target beacon node within the preset time window is extracted and variance is calculated to obtain the link stability characteristics. If the link stability characteristic is less than or equal to the preset fluctuation threshold, the preset momentum decay factor is multiplied by the first penalty coefficient for numerical reduction processing to obtain the target momentum decay factor, which is used to replace the preset momentum decay factor. If the link stability characteristic is greater than the fluctuation threshold, the preset learning rate is multiplied by the second penalty coefficient to perform numerical reduction processing to obtain the target learning rate, which is used to replace the preset learning rate.
5. The method according to claim 1, characterized in that, The step of updating the current coordinate estimate based on the momentum vector of the current gradient and the current positioning period to obtain the updated coordinate estimate specifically includes: Extract the horizontal component of the momentum vector in the horizontal axis direction and the vertical component in the vertical axis direction of the current positioning cycle. Calculate the difference between the x-coordinate of the current coordinate estimate and the x-component to obtain the updated x-coordinate; Calculate the difference between the ordinate of the current coordinate estimate and the longitudinal component to obtain the updated ordinate; The updated x-coordinate and the updated y-coordinate are combined to obtain the updated coordinate estimate.
6. The method according to claim 1, characterized in that, The step of randomly selecting a target beacon node from the current observation set and extracting the measured signal strength of the target broadcast signal corresponding to the target beacon node specifically includes: Each beacon node in the current observation set is sorted according to its measured signal strength and assigned a weight value to obtain the selection probability of each beacon node. The weight value is positively correlated with the measured signal strength. Based on the selected probability, a target beacon node is randomly selected from the current observation set, and the measured signal strength of the target broadcast signal corresponding to the target beacon node is extracted.
7. The method according to claim 1, characterized in that, After the step of setting the updated coordinate estimate as the new current coordinate estimate and performing the next positioning iteration, the method further includes: If the mobile terminal detects that it has received a new batch of broadcast signals, the broadcast signals of the new batch are parsed to obtain the latest measured signal strength, and the latest measured signal strength is used to update the measured signal strength of the corresponding beacon node in the current observation set to obtain a dynamically refreshed observation set. According to the preset unloading attenuation ratio, the momentum vector of the current positioning cycle is calculated to achieve centripetal contraction, and the transition momentum vector after decompression and order reduction is obtained. The transition momentum vector is a penalty vector used to reduce historical optimization inertia when a temporal change occurs in the underlying signal observation space. The transition momentum vector is used to replace the momentum vector of the current positioning cycle, and the remaining positioning iteration loop is executed based on the dynamically refreshed observation set.
8. An indoor positioning system based on momentum acceleration optimization, characterized in that, The system includes: one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the system to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an indoor positioning system optimized for momentum acceleration, the system performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on an indoor positioning system based on momentum acceleration optimization, the system performs the method as described in any one of claims 1-7.