Method for realizing indoor positioning by using autonomous inertia algorithm
By using an autonomous inertial algorithm combined with a dynamic threshold method and a Kalman filter, high-precision indoor positioning without the need for external facilities is achieved. This solves the problems of error accumulation and environmental dependence in traditional methods, adapts to different user and device conditions, and improves the practicality and robustness of positioning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN AUDE INFORMATION TECH
- Filing Date
- 2026-03-19
- Publication Date
- 2026-05-15
AI Technical Summary
Existing indoor positioning methods rely on external facilities in GPS signal blind spots, which are costly and easily affected by the environment. Inertial navigation methods suffer from error accumulation and high computational complexity, making it difficult to achieve long-term, high-precision autonomous positioning.
An autonomous inertial algorithm is adopted, which collects data in real time through an inertial measurement unit, identifies the user's state by combining a dynamic threshold method, calculates the spectral entropy value and adaptive step size, and uses zero-velocity correction and Kalman filter for error compensation to achieve autonomous inertial navigation.
It achieves high-precision indoor positioning without the need for external facilities, suppresses error accumulation, adapts to different user and device states, and improves the practicality and reliability of the algorithm in complex scenarios.
Smart Images

Figure CN122041901A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of [field name], specifically a method for achieving indoor positioning using an autonomous inertial algorithm. Background Technology
[0002] Achieving continuous and reliable positioning in indoor environments where GPS signals are unavailable has always been a technical challenge. Currently, common indoor positioning methods fall into two main categories: one is wireless signal-based positioning technology, which relies on pre-deployed infrastructure, resulting in high implementation costs and susceptibility to environmental changes and signal blockage. In complex indoor scenarios, it is prone to blind spots and accuracy degradation. The other is dead reckoning based on inertial measurement units (IMUs). While this method offers autonomy without relying on external signals, the inherent errors of IMU sensors, such as zero bias, noise, and temperature drift, lead to significant cumulative errors in the position information obtained through integration. This causes the positioning trajectory to diverge rapidly over time, failing to meet the requirements for long-term, high-precision positioning.
[0003] Furthermore, existing inertial navigation methods typically improve accuracy through gait detection and stride length estimation. However, their models often assume uniform user gait and fixed device posture, making it difficult to adapt to different user walking habits, speed variations, and diverse device carrying methods in real-world applications. These limitations lead to a significant performance degradation of traditional methods under irregular gait and posture changes, and their high computational complexity makes them unsuitable for real-time operation in embedded devices. Therefore, there is an urgent need for an autonomous inertial positioning method that can effectively suppress error accumulation, adapt to different user and device states, and is independent of external facilities. Summary of the Invention
[0004] To address the technical problems mentioned in the background section, this invention proposes a method for indoor positioning using an autonomous inertial algorithm.
[0005] Therefore, the technical solution adopted by the present invention is as follows: A method for achieving indoor positioning using an autonomous inertial algorithm includes: Step 1: Collect the user's raw inertial data in real time through the inertial measurement unit; preprocess the raw inertial data to obtain inertial data; the inertial data includes triaxial acceleration and triaxial angular velocity; Step 2: Based on the triaxial acceleration, the user's real-time state is identified using a preset dynamic threshold method. The real-time state includes a stationary state and a moving state. When the user is in a moving state, the user's gait cycle is identified using the inertial data. The gait cycle includes a moving phase and a zero-speed interval. Step 3: Calculate the spectral entropy value of the gait cycle based on the inertial data; perform inertial navigation calculation on the motion phase to obtain the navigation state of the gait cycle, and sequentially perform zero-speed correction and heading-specific optimization on the navigation state in the zero-speed interval to obtain a new navigation state and corresponding displacement vector; calculate the reference step length based on a preset adaptive step length model, and obtain the actual step length by weighting the reference step length with confidence using the spectral entropy value; perform scale normalization on the displacement vector based on the actual step length to obtain the final displacement estimate of the gait cycle; accumulate all final displacement estimates and the position in the stationary state to obtain the user positioning trajectory with timestamp and position coordinates.
[0006] Furthermore, the real-time status identification process is as follows: The variance of the triaxial acceleration modulus is calculated within a preset first sliding window and used as a motion intensity index. When the motion intensity index is less than the preset static threshold, the user is determined to be in a static state. When the exercise intensity index is greater than the preset exercise threshold, the user is determined to be in an exercise state; When the exercise intensity index is greater than or equal to the static threshold, or when the exercise intensity index is less than or equal to the exercise threshold, the previous judgment result is retained; The static threshold must be less than the motion threshold; The initial values of the static threshold and the motion threshold are set based on user test data and dynamically adjusted using a preset dynamic update mechanism.
[0007] Furthermore, the specific operation of the dynamic update mechanism is as follows:
[0008] Based on the statistical analysis of users' historical motion data, the distribution characteristics of acceleration variance are obtained. The 10th percentile of the distribution is set as the stationary threshold, and the 50th percentile is set as the motion threshold. The thresholds are continuously updated as new data accumulates.
[0009] Furthermore, the calculation process for the spectral entropy is as follows: A fast Fourier transform is performed on the triaxial acceleration magnitude sequence within the gait period to obtain the frequency domain signal; Calculate power spectral density based on frequency domain signals; The power spectral density at all frequency points is summed and normalized to obtain the frequency probability distribution. The original spectral entropy value is calculated based on the frequency probability distribution, using the following formula:
[0010] in, This is the original spectral entropy value. For signal length, This represents the frequency probability value of the k-th frequency point in the frequency domain.
[0011] The original spectral entropy value is normalized to obtain the spectral entropy value.
[0012] Furthermore, the specific process of the inertial navigation calculation is as follows: Quaternions are used to represent the carrier's attitude; The rotation matrix from the carrier coordinate system to the preset navigation coordinate system is constructed using the quaternion. The three-axis acceleration in the carrier coordinate system is converted into the three-axis acceleration in the navigation coordinate system using the matrix. After deducting the gravitational acceleration in the navigation coordinate system, the effective motion acceleration is obtained. The effective motion acceleration is then integrated over time to obtain the real-time motion speed of the user in the three directions of the navigation coordinate system. Based on the previous position and the real-time motion speed, and combined with the motion changes caused by the effective motion acceleration, the user's real-time spatial coordinates in the navigation coordinate system are obtained through integral calculation. Ultimately, the navigation status is obtained, which includes quaternions, real-time motion speed in three directions, and real-time spatial coordinates.
[0013] Furthermore, the zero-velocity correction is achieved through a Kalman filter, and the specific process is as follows: Constructing the state vector:
[0014] in, , and These represent the errors between the position, velocity, and quaternion values and the true values, respectively. and These are the zero-bias estimates of acceleration and angular velocity, respectively. Construct the observation equation:
[0015] in, For real-time motion velocity vectors, For the observation matrix, To observe noise; The gain of the Kalman filter is calculated using the following formula:
[0016] in, Here is the gain matrix. Let be the first covariance matrix. This is the second covariance matrix; The optimal state vector is obtained based on the gain matrix, as shown in the following formula:
[0017] in, This is the optimal state vector; The real-time motion velocity is set to zero, and the real-time spatial coordinates and quaternions are adjusted according to the error in the optimal state vector.
[0018] Furthermore, the formula for calculating the reference step size is as follows:
[0019] in, For reference step size, The peak acceleration during the gait cycle. , and These are the peak acceleration coefficient, step frequency coefficient, and constant term, respectively, where h is the step frequency.
[0020] Furthermore, the calculation steps for the actual step size are as follows: Define the confidence function:
[0021] in, The average spectral entropy value of multiple normal movements by the user. The standard deviation of the spectral entropy values from multiple normal movements of the user. It is a natural exponential function; The actual step size is calculated based on the confidence function and the reference step size, using the following formula:
[0022] in, This is the actual step size. Alternative step sizes; The process of obtaining the final displacement estimate is as follows: Calculate the magnitude of the displacement vector; The ratio of the actual step size to the displacement vector magnitude is defined as the normalization coefficient. The final displacement estimate is obtained by multiplying the magnitude of the displacement vector by the normalization coefficient.
[0023] Furthermore, the preprocessing includes filtering and noise reduction, error compensation, temperature drift compensation, and scale factor correction.
[0024] Compared with the prior art, the advantages of the present invention are as follows:
[0025] 1. This invention achieves positioning solely based on the device's built-in inertial sensors, without relying on external signals such as Wi-Fi or Bluetooth, or pre-deployed infrastructure, thus overcoming the limitations of signal blind spots and strong environmental dependence.
[0026] 2. This invention utilizes a dual correction mechanism that integrates zero-velocity correction and adaptive step size estimation to dynamically compensate for accumulated errors in the zero-velocity interval of each step. This suppresses the trajectory divergence problem caused by integration in traditional inertial navigation and achieves stable positioning over a long period of time.
[0027] 3. By adopting dynamic threshold judgment and personalized step size model, it can adapt to the gait characteristics, walking speed changes and device carrying methods of different users, which improves the practicality and reliability of the algorithm in real and complex scenarios. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a schematic diagram of the method execution flow of the present invention;
[0030] Figure 2 This is a schematic diagram of the process for obtaining spectral entropy values according to the present invention;
[0031] Figure 3 This is a schematic diagram of the execution flow of the zero-speed correction of the present invention. Detailed Implementation
[0032] To achieve the above objectives, the present invention provides a method for indoor positioning using an autonomous inertial algorithm. Please refer to [link to relevant documentation]. Figure 1 ,include:
[0033] Step 1: Collect the user's raw inertial data in real time through the inertial measurement unit; preprocess the raw inertial data to obtain inertial data; the inertial data includes triaxial acceleration and triaxial angular velocity;
[0034] In this embodiment, the inertial measurement unit is specifically a six-axis inertial measurement unit, including a three-axis accelerometer and a three-axis gyroscope, with the sampling frequency set to 100Hz to 200Hz to ensure that subtle changes during motion are captured;
[0035] Inertial measurement units can be worn on the user's feet, waist, or wrists, with the foot-wearing method being able to capture gait characteristics more accurately.
[0036] For acceleration data, a low-pass filter is used to remove high-frequency noise, with the filter cutoff frequency set to 20Hz to 30Hz;
[0037] For gyroscope data, Kalman filtering or complementary filtering algorithms are used to combine the short-term accuracy of the gyroscope with the long-term stability of the accelerometer.
[0038] During the filtering process, special attention should be paid to preserving the effective frequency components of the motion signal to avoid excessive smoothing that could lead to the loss of gait features.
[0039] The specific process of error compensation is as follows: During system initialization, the user is required to remain stationary for at least 3 seconds, and the user's baseline inertial data is collected. Zero-bias compensation is performed on the inertial data based on the collected baseline inertial data; The zero-bias compensation formula for triaxial acceleration is as follows:
[0040] in, For the first Acceleration after axis compensation For the first The acceleration value of the shaft. For the first The zero-bias estimation of the axis, specifically the first axis in the baseline inertial data. The mean acceleration of the axis; The zero-bias compensation formula for triaxial angular velocity is the same as the zero-bias compensation formula for triaxial acceleration. Temperature drift compensation is performed on the zero bias estimate based on preset trigger conditions. The specific operation is as follows: Temperature drift compensation is implemented in two stages: offline calibration and online compensation. During the offline calibration phase, the inertial measurement unit is placed in a constant temperature chamber, and static data is collected at multiple temperature points (e.g., from -10℃ to 60℃, every 5-10℃). The zero bias value at each temperature is statistically analyzed, and then the least squares method is used to perform linear fitting on the temperature-zero bias data to obtain the linear compensation model parameters (slope and intercept) for each axis and store them. During the online compensation phase, the system reads the temperature sensor values in real time, calculates the predicted zero bias at the current temperature based on the calibrated linear model, and subtracts the predicted zero bias from the original sensor output, thereby achieving dynamic compensation for temperature drift and effectively suppressing the accumulation of measurement errors caused by temperature changes.
[0041] The triggering conditions for temperature drift compensation are as follows: Temperature changes are typically slow, so temperature compensation doesn't need to be updated at every inertial data sampling point. Temperature can be read and temperature drift compensation performed at regular intervals (every second or every 0.5 seconds). Monitor the temperature change range and perform temperature drift compensation when the temperature change exceeds a certain threshold (0.5℃ or 1℃); Perform temperature drift compensation periodically (every 5-10 seconds); Acceleration and angular velocity are corrected based on scale factors, and the acceleration correction formula is as follows:
[0042] in, For the first Acceleration after axis correction For the first The acceleration scaling factor of the axis; The correction formula for angular velocity is the same as that for acceleration; The specific steps to obtain the acceleration scaling factor are as follows: The inertial measurement unit is placed stationary along the positive and negative axes of the three axes respectively. At this time, the accelerometer should measure a gravitational acceleration of ±9.81m / s² on the corresponding axis. By comparing the ratio of the actual measured value to the theoretical gravity value, the scale factor of each axis is calculated. The specific steps to obtain the angular velocity scaling factor are as follows: The inertial measurement unit is fixed on a turntable, and the turntable is controlled to rotate around a specific axis at a known constant angular velocity. At this time, the measurement value of the gyroscope on the corresponding axis should be consistent with the angular velocity set by the turntable. By comparing the ratio of the actual output value of the gyroscope to the real angular velocity value provided by the turntable, the scale factor of each axis is calculated.
[0043] Step 2: Based on the inertial data, identify the user's real-time state using a preset dynamic threshold method. The real-time state includes a stationary state and a moving state. When the user is in a moving state, identify the user's gait cycle using the inertial data. The gait cycle includes a movement phase and a zero-speed interval. When the user is in a stationary state, perform a zero-speed correction.
[0044] The process of identifying a user's real-time status is as follows: The variance of the triaxial acceleration modulus is calculated within a preset first sliding window as a motion intensity index. The window length of the first sliding window is set to 0.5 seconds to 1 second. When the activity intensity index is less than the preset static threshold, the user is determined to be in a static state. When the exercise intensity index exceeds the preset exercise threshold, the user is determined to be in an exercise state; When the exercise intensity index is greater than or equal to the resting threshold, or when the exercise intensity index is less than or equal to the exercise threshold, the previous judgment result is retained. The static threshold is always less than the dynamic threshold; To avoid frequent state transitions, the state transition is only confirmed to be effective if the new state lasts for more than 0.2 seconds. The initial values of the static threshold and the motion threshold are set based on user test data and dynamically adjusted using a preset dynamic update mechanism, as follows: Based on the distribution characteristics of acceleration variance obtained from the user's historical motion data, the 10th percentile of the distribution is set as the static threshold and the 50th percentile is set as the motion threshold. As the usage time increases, the thresholds are continuously updated according to newly collected data to achieve personalized adaptation.
[0045] Gait cycle refers to a complete movement cycle that begins when one foot strikes the ground and ends when the same foot strikes the ground again.
[0046] The movement phase refers to the period in the gait cycle from the moment the toes leave the ground to the moment the heel strikes the ground again.
[0047] The zero-speed zone refers to the period in the gait cycle from heel strike to the next toe lift-off.
[0048] Gait cycle recognition is based on peak detection of acceleration signals, and the specific operation is as follows:
[0049] Bandpass filtering is applied to the vertical acceleration signal to retain... to The frequency components of this band cover the stride frequency range of normal walking and running;
[0050] In the filtered signal, the time interval between the peak and the adjacent peak is one gait cycle;
[0051] To improve the accuracy of gait cycle recognition, a dynamic peak threshold is set;
[0052] The peak threshold is defined as the mean of the acceleration signal within a preset second sliding window plus 0.5 times the standard deviation. The window length of the second sliding window is the length of 2-3 gait cycles, approximately 1.5 to 3 seconds.
[0053] At the same time, the minimum time interval between adjacent peaks is limited to 0.3 seconds, corresponding to a maximum step frequency of approximately 200 steps per minute, in order to eliminate false peaks;
[0054] The identification of the zero-velocity region is based on a joint criterion of angular velocity magnitude and acceleration variance, specifically as follows:
[0055] in, angular velocity magnitude This is the angular velocity threshold, typically valued at... to , This is the acceleration variance threshold, typically valued at... to , The variance of the acceleration magnitude;
[0056] The remaining time period is the exercise phase.
[0057] Step 3: Calculate the spectral entropy value of the gait cycle based on the inertial data; perform inertial navigation calculation on the motion phase to obtain the navigation state of the gait cycle, and sequentially perform zero-speed correction and heading-specific optimization on the navigation state in the zero-speed interval to obtain a new navigation state and corresponding displacement vector; calculate the reference step length based on the triaxial acceleration and step frequency through a preset adaptive step length model, and obtain the actual step length by weighting the reference step length with confidence using the spectral entropy value; perform scale normalization on the displacement vector based on the actual step length to obtain the final displacement estimate of the gait cycle; accumulate all final displacement estimates and the position in the stationary state to obtain the user positioning trajectory with timestamp and position coordinates.
[0058] The calculation process for spectral entropy is as follows; please refer to [link / reference]. Figure 2 : The frequency domain signal is obtained by performing a Fast Fourier Transform on the sequence of triaxial acceleration magnitudes during the gait period, as shown in the following formula:
[0059] in, For the frequency domain signal at the k-th frequency point, The signal length is represented by the total number of sampling points for the acceleration magnitude within the complete gait cycle. The acceleration magnitude corresponding to the nth time-domain sampling point. It is a natural constant, approximately 2.71828. The imaginary unit, Pi; The power spectral density is calculated based on the frequency domain signal, using the following formula:
[0060] in, Let be the power spectral density at the k-th frequency point in the frequency domain; The power spectral density at all frequency points in the frequency domain is summed and normalized to obtain the frequency probability distribution. The calculation formula is as follows:
[0061] in, is the frequency probability value of the k-th frequency point in the frequency domain, specifically meaning the ratio of the power spectral density of a single frequency point to the power spectral density of all frequency points in the frequency domain; The spectral entropy value is calculated based on the frequency probability distribution, using the following formula:
[0062] in, This is the original spectral entropy value, in bits, and its range is related to the frequency resolution. The original spectral entropy value is normalized to obtain the spectral entropy value, as shown in the following formula:
[0063] in, This is the spectral entropy value, ranging from 0 to 1.
[0064] The specific process of inertial navigation calculation is as follows:
[0065] Quaternions are used to represent the attitude of the carrier to avoid the gimbal lock problem of Euler angles. The carrier refers to the inertial measurement unit and its attached components. Quaternions are defined as follows:
[0066] in, The real part represents the amplitude coefficient of the attitude rotation, reflecting the degree of dynamism of the carrier's rotation. , and The imaginary part corresponds to the component coefficients of the rotation of the carrier around its own coordinate system x, y and z axes, respectively, which are the integral contributions of the angular velocity during the motion phase. T is the vector transpose symbol, which converts the row vector into a column vector. The update equation for quaternions is as follows:
[0067] in, This is quaternion multiplication. To extend the angular velocity quaternion, specifically: , , and These are the angular velocities corresponding to the x, y, and z axes in the inertial data, respectively. In actual calculations, the fourth-order Runge-Kutta method is used to numerically integrate the differential equations. The update time step is consistent with the sampling period of the inertial measurement unit. After each update, the quaternion is normalized to ensure that its modulus is always 1. A rotation matrix from the carrier coordinate system to the preset navigation coordinate system is constructed using quaternions. The matrix is then used to convert the three-axis acceleration in the carrier coordinate system into the three-axis acceleration in the navigation coordinate system. After subtracting the gravitational acceleration in the navigation coordinate system, the effective motion acceleration is integrated over time to obtain the user's real-time motion speed in the three directions of the navigation coordinate system. Based on the previous position and real-time velocity, and combined with the motion changes caused by effective motion acceleration, the user's real-time spatial coordinates in the navigation coordinate system are obtained through integral calculation. Ultimately, the navigation status is obtained, which includes quaternions, real-time motion speed in three directions, and real-time spatial coordinates.
[0068] Zero-speed correction is performed when the user is stationary or in a zero-speed range. The core of zero-speed correction is to use zero-speed constraints to correct navigation state errors and sensor zero-bias errors. This is achieved using a Kalman filter. The specific process is as follows; please refer to [link / reference]. Figure 3 : Construct a state vector with 15 dimensions:
[0069] in, , and These represent the errors between the position, velocity, and quaternion values and the true values, respectively. and These are the zero-bias estimates of acceleration and angular velocity, respectively. The true position is an ideal constant position constructed based on the physical constraint that the carrier is stationary in the zero-velocity interval. It is usually based on the corrected position at the beginning of the zero-velocity interval. The true velocity is defined by the ideal zero velocity, which is the physical constraint that the carrier is stationary in the zero-velocity range. The true quaternion is based on the ideal constant attitude constructed by the physical constraint that the carrier has no rotation in the zero-velocity interval. It is usually based on the corrected attitude at the beginning of the zero-velocity interval. Construct the observation equation:
[0070] in, For real-time motion velocity vectors, The observation matrix is predefined based on the inherent mapping relationship between the state vector and the real-time motion velocity vector. The observation noise is defined as random noise transmitted or introduced during the inertial navigation solution process; The gain of the Kalman filter is calculated using the following formula:
[0071] in, Here is the gain matrix. Let be the first covariance matrix, specifically the set of variances and covariances of each component of the state vector. The second covariance matrix is specifically the set of variances and covariances of each component in the observation noise. The optimal state vector is obtained based on the gain matrix, as shown in the following formula:
[0072] in, This is the optimal state vector;
[0073] By setting the velocity directly to zero, the position and attitude are adjusted based on the error in the optimal state vector, effectively suppressing velocity drift and preventing the error from being propagated to the position integral.
[0074] The specific procedures for course optimization are as follows: Assuming the user's turning angle is limited during movement, establish a heading angle motion constraint; Set a sliding window with a window length of 5 to 10 gait cycles. Within the window, minimize the variance of the heading change between adjacent gait cycles to smooth the heading estimate. During the optimization process, maintain consistency with the zero-rate correction results to avoid introducing secondary errors.
[0075] The displacement vector is calculated based on the position at the start and end of the gait cycle in the new navigation state. The displacement vector includes direction and distance.
[0076] The formula for calculating the reference step size is as follows:
[0077] in, For reference step size, The peak acceleration during the gait cycle. , and These are the peak acceleration coefficient, step frequency coefficient, and constant term, derived from initial user calibration or online learning, with typical values of 0.35, 0.42, and 0.21, respectively. Step frequency is the reciprocal of the gait cycle duration.
[0078] The steps for calculating the actual step size are as follows: Define the confidence function:
[0079] in, This is the average spectral entropy value of multiple normal movements by the user, typically ranging from 0.3 to 0.4. This represents the standard deviation of the spectral entropy values from multiple normal user movements, typically ranging from 0.15 to 0.2. It is a natural exponential function; The actual step size is calculated based on the confidence function and the reference step size, using the following formula:
[0080] in, This is the actual step size. For alternative step sizes, robust estimates are used, such as average step size based on user height or moving average of historical step sizes.
[0081] The process of obtaining the final displacement estimate is as follows:
[0082] Calculate the magnitude of the displacement vector;
[0083] The ratio of the actual step size to the displacement vector magnitude is defined as the normalization coefficient.
[0084] The final displacement estimate is obtained by multiplying the magnitude of the displacement vector by the normalization coefficient.
[0085] Trajectory accumulation is calculated recursively, with the initial position set to the origin of the coordinate system or a user-specified starting position.
[0086] The user's location trajectory can be further matched with building maps to achieve location display on indoor maps.
[0087] This invention proposes a method for indoor positioning using an autonomous inertial algorithm. By integrating the core algorithms of zero-velocity correction and adaptive step size estimation, and combining dynamic motion state recognition and multi-dimensional error compensation mechanisms, it effectively solves the problems of traditional inertial indoor positioning methods, such as dependence on external signals, large cumulative errors, and sensitivity to user gait and device attitude. It achieves fully autonomous indoor positioning that is independent of infrastructure, has low drift, and is highly robust.
[0088] In summary, this invention effectively overcomes the problems of signal blind spots and deployment costs by providing a pure inertial solution that does not rely on any external facilities. By employing a dual correction mechanism that combines zero-speed correction and adaptive step size estimation, it suppresses the cumulative errors in traditional inertial navigation and achieves stable positioning over a long period of time. At the same time, dynamic threshold judgment and personalized models enable it to adapt to different user gaits, speed changes, and device carrying methods, demonstrating good practicality and robustness.
[0089] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for indoor positioning using an autonomous inertial algorithm, characterized in that, include: Step 1: Collect the user's raw inertial data in real time through the inertial measurement unit; preprocess the raw inertial data to obtain inertial data; the inertial data includes triaxial acceleration and triaxial angular velocity; Step 2: Based on the triaxial acceleration, the user's real-time state is identified using a preset dynamic threshold method. The real-time state includes a stationary state and a moving state. When the user is in a moving state, the user's gait cycle is identified using the inertial data. The gait cycle includes a moving phase and a zero-speed interval. Step 3: Calculate the spectral entropy value of the gait period based on the inertial data; Inertial navigation calculations are performed on the motion phase to obtain the navigation state of the gait cycle, and zero-speed correction and heading-specific optimization are performed sequentially on the navigation state in the zero-speed interval to obtain a new navigation state and the corresponding displacement vector; The reference step size is calculated based on a preset adaptive step size model, and the actual step size is obtained by weighting the reference step size with confidence using the spectral entropy value. The displacement vector is scaled and normalized based on the actual step length to obtain the final displacement estimate of the gait period; Accumulate all final displacement estimates and the position at rest to obtain the user positioning trajectory with timestamps and position coordinates.
2. The method according to claim 1, characterized in that, The process of identifying the real-time status is as follows: The variance of the triaxial acceleration modulus is calculated within a preset first sliding window and used as a motion intensity index. When the motion intensity index is less than the preset static threshold, the user is determined to be in a static state. When the exercise intensity index is greater than the preset exercise threshold, the user is determined to be in an exercise state; When the exercise intensity index is greater than or equal to the static threshold, or when the exercise intensity index is less than or equal to the exercise threshold, the previous judgment result is retained; The static threshold must be less than the motion threshold; The initial values of the static threshold and the motion threshold are set based on user test data and dynamically adjusted using a preset dynamic update mechanism.
3. The method according to claim 2, characterized in that, The specific operation of the dynamic update mechanism is as follows: Based on the statistical analysis of users' historical motion data, the distribution characteristics of acceleration variance are obtained. The 10th percentile of the distribution is set as the stationary threshold, and the 50th percentile is set as the motion threshold. The thresholds are continuously updated as new data accumulates.
4. The method according to claim 3, characterized in that, The calculation process for the spectral entropy is as follows: A fast Fourier transform is performed on the triaxial acceleration magnitude sequence within the gait period to obtain the frequency domain signal; Calculate power spectral density based on frequency domain signals; The power spectral density at all frequency points is summed and normalized to obtain the frequency probability distribution. The original spectral entropy value is calculated based on the frequency probability distribution, using the following formula: in, This is the original spectral entropy value. For signal length, This represents the frequency probability value of the k-th frequency point in the frequency domain. The original spectral entropy value is normalized to obtain the spectral entropy value.
5. The method according to claim 4, characterized in that, The specific process of the inertial navigation solution is as follows: Quaternions are used to represent the carrier's attitude; The rotation matrix from the carrier coordinate system to the preset navigation coordinate system is constructed using the quaternion, and the three-axis acceleration in the carrier coordinate system is converted into the three-axis acceleration in the navigation coordinate system using the matrix. After deducting the gravitational acceleration in the navigation coordinate system, the effective motion acceleration is obtained, and the effective motion acceleration is integrated over time to obtain the user's real-time motion speed in the three directions of the navigation coordinate system. Based on the previous position and the real-time motion speed, and combined with the motion changes caused by the effective motion acceleration, the user's real-time spatial coordinates in the navigation coordinate system are obtained through integral calculation. Ultimately, the navigation status is obtained, which includes quaternions, real-time motion speed in three directions, and real-time spatial coordinates.
6. The method according to claim 5, characterized in that, The zero-velocity correction is achieved through a Kalman filter, and the specific process is as follows: Constructing the state vector: in, , and These represent the errors between the position, velocity, and quaternion values and the true values, respectively. and These are the zero-bias estimates of acceleration and angular velocity, respectively, with T being the sign of the vector transpose; Construct the observation equation: in, For real-time motion velocity vectors, For the observation matrix, To observe noise; The gain of the Kalman filter is calculated using the following formula: in, Here is the gain matrix. Let be the first covariance matrix. This is the second covariance matrix; The optimal state vector is obtained based on the gain matrix, as shown in the following formula: in, This is the optimal state vector; The real-time motion velocity is set to zero, and the real-time spatial coordinates and quaternions are adjusted according to the error in the optimal state vector.
7. The method according to claim 6, characterized in that, The formula for calculating the reference step size is as follows: in, For reference step size, The peak acceleration during the gait cycle. , and These are the peak acceleration coefficient, step frequency coefficient, and constant term, respectively. This refers to the step frequency.
8. The method according to claim 7, characterized in that, The calculation steps for the actual step size are as follows: Define the confidence function: in, The average spectral entropy value of multiple normal movements by the user. The standard deviation of the spectral entropy values from multiple normal movements of the user. It is a natural exponential function; The actual step size is calculated based on the confidence function and the reference step size, using the following formula: in, This is the actual step size. Alternative step sizes; The process of obtaining the final displacement estimate is as follows: Calculate the magnitude of the displacement vector; The ratio of the actual step size to the displacement vector magnitude is defined as the normalization coefficient. The final displacement estimate is obtained by multiplying the magnitude of the displacement vector by the normalization coefficient.
9. The method according to claim 1, characterized in that, The preprocessing includes filtering and noise reduction, error compensation, temperature drift compensation, and scale factor correction.