Magnetic semantic based extended kalman filter inertial navigation method and related device

By introducing magnetic semantic information and an extended Kalman filter into the inertial navigation system, and combining acceleration, angular velocity and magnetic field strength measurements, the problem of maintaining positioning accuracy in indoor environments by the inertial navigation system is solved, and more accurate trajectory estimation and error correction are achieved.

CN120576745BActive Publication Date: 2026-07-24SHENZHEN ZHONGCHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN ZHONGCHENG TECH CO LTD
Filing Date
2025-06-09
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing inertial navigation systems lack external environment perception and correction mechanisms, making it difficult to maintain positioning accuracy. In particular, the stability and accuracy of the system are affected by long-term accumulated errors and initial state errors.

Method used

Magnetic semantic information is introduced as an external compensation mechanism. By combining acceleration, angular velocity and magnetic field strength measurements with an extended Kalman filter, meaningful magnetic semantic information is extracted to correct the positioning data of the inertial navigation system and dynamically adjust the observation model and noise covariance.

Benefits of technology

It achieves more accurate trajectory estimation and robust error correction, improving the positioning accuracy and stability of inertial navigation systems in indoor environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120576745B_ABST
    Figure CN120576745B_ABST
Patent Text Reader

Abstract

The application provides a magnetic semantic based extended Kalman filtering inertial navigation method and related equipment, and comprises the following steps: obtaining acceleration measurement values, angular velocity measurement values and magnetic field intensity measurement values; updating first positioning data based on the acceleration measurement values and the angular velocity measurement values by using an extended Kalman filter to obtain second positioning data; extracting magnetic field semantic information based on the angular velocity measurement values and the magnetic field intensity measurement values; when the magnetic field semantic information is meaningful magnetic field semantic information, correcting the second positioning data based on the magnetic field semantic information to generate third positioning data, and taking the third positioning data as current positioning data; by using the magnetic semantic based extended Kalman filtering inertial navigation method, the semantic events of the identified magnetic field information are recognized, and the semantic events are introduced into the filtering process, so that the algorithm dynamically adjusts the observation model and the noise covariance, and more accurate trajectory estimation and robust error correction are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of indoor navigation technology, and more specifically, to an extended Kalman filter inertial navigation method and related equipment based on magnetic semantics. Background Technology

[0002] In existing technologies, inertial navigation systems measure angular velocity and calculate attitude changes using gyroscopes, then project accelerometer measurements onto the navigation coordinate system and calculate velocity and position changes through integration. The entire process mainly includes attitude update, velocity update, and position update, ultimately achieving navigation solution. However, current pure inertial navigation systems provide position information through continuous integration calculations, and system errors accumulate over time. Especially under the influence of initial state errors and long-term drift, positioning accuracy is difficult to maintain. Because inertial navigation systems rely solely on their own sensors and lack mechanisms for sensing and correcting the external environment, the estimated trajectory may gradually deviate from the actual path, thus affecting the long-term stability and accuracy of the system. Summary of the Invention

[0003] In view of the shortcomings of the existing technology, the purpose of this invention is to provide an extended Kalman filter inertial navigation method and related equipment based on magnetic semantics, so as to overcome the shortcomings of existing indoor navigation.

[0004] The above-mentioned technical objective of the present invention is achieved through the following technical solution: Firstly, an extended Kalman filter inertial navigation method based on magnetic semantics, comprising: Acquire acceleration, angular velocity, and magnetic field strength measurements; Based on the acceleration measurement value and the angular velocity measurement value, the first positioning data is updated using an extended Kalman filter to obtain the second positioning data; wherein, the first positioning data is the positioning data of the previous unit time. Based on the measured angular velocity and the measured magnetic field strength, magnetic field semantic information is extracted. The magnetic field semantic information includes meaningful magnetic field semantic information and meaningless magnetic field semantic information. The meaningful magnetic field semantic information is associated with the user's actions, while the meaningless magnetic field semantic information is not associated with the user's actions. Based on the magnetic field semantic information and the second positioning data, current positioning data is generated. When the magnetic field semantic information is meaningless, the second positioning data is used as the current positioning data. When the magnetic field semantic information is meaningful, the second positioning data is corrected based on the magnetic field semantic information to generate third positioning data, and the third positioning data is used as the current positioning data.

[0005] Secondly, an extended Kalman filter inertial navigation device based on magnetic semantics includes: The acquisition unit is used to acquire acceleration measurement values, angular velocity measurement values, and magnetic field strength measurement values; The update unit is used to update the first positioning data based on the acceleration measurement value and the angular velocity measurement value using an extended Kalman filter to obtain the second positioning data; wherein, the first positioning data is the positioning data of the previous unit time. The prediction unit is used to extract magnetic field semantic information based on the angular velocity measurement value and the magnetic field strength measurement value; the magnetic field semantic information includes meaningful magnetic field semantic information and meaningless magnetic field semantic information, the meaningful magnetic field semantic information is associated with the user's action, and the meaningless magnetic field semantic information is not associated with the user's action. The correction unit is used to generate current positioning data based on the magnetic field semantic information and the second positioning data. When the magnetic field semantic information is meaningless, the second positioning data is used as the current positioning data. When the magnetic field semantic information is meaningful, the second positioning data is corrected based on the magnetic field semantic information to generate third positioning data, and the third positioning data is used as the current positioning data.

[0006] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0007] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.

[0008] In summary, the present invention has the following beneficial effects: by adopting the extended Kalman filter inertial navigation method based on magnetic semantics of the present invention, by identifying semantic events of magnetic field information and introducing semantic events into the filtering process, the algorithm can dynamically adjust the observation model and noise covariance, thereby achieving more accurate trajectory estimation and robust error correction. Attached Figure Description

[0009] Figure 1 This is a flowchart of the extended Kalman filter inertial navigation method based on magnetic semantics of the present invention; Figure 2 This is a structural diagram of the extended Kalman filter inertial navigation device based on magnetic semantics in an embodiment of the present invention; Figure 3 This is an internal structural diagram of the computer device in an embodiment of the present invention; Figure 4 This is a schematic diagram of the projection of the magnetic field vector onto the carrier coordinate system in an embodiment of the present invention; Figure 5This is a schematic diagram of the magnetic field vector projected onto the carrier coordinate system with different trajectory directions in an embodiment of the present invention; Figure 6 This is a detection graph showing the peak value, valley value, and variation of the triaxial magnetic field measurement values ​​in an embodiment of the present invention; Figure 7 This is a schematic diagram of the membership function of angular velocity in an embodiment of the present invention; Figure 8 This is a schematic diagram of the Gaussian membership function of the peak-valley difference in an embodiment of the present invention; Figure 9 This is a plan view of the test site in an embodiment of the present invention; Figure 10 This is a comprehensive analysis diagram of the magnetic field semantics in an embodiment of the present invention; Figure 11 This is a comparison diagram of the positioning trajectory experiments in the embodiments of the present invention; Figure 12 This is a schematic diagram of the cumulative distribution function of the error in an embodiment of the present invention; In the diagram, 1 is the acquisition unit; 2 is the update unit; 3 is the prediction unit; and 4 is the correction unit. Detailed Implementation

[0010] To make the objectives, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Several embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.

[0011] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0012] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0013] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0014] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0015] Example 1 First, this application describes an inertial navigation method based on an inertial measurement unit (IMU): the inertial navigation system measures angular velocity and calculates attitude changes using a gyroscope, then projects the accelerometer measurements onto the navigation coordinate system, and calculates the changes in velocity and position through integration. The entire process mainly includes attitude update, velocity update, and position update, ultimately achieving navigation solution. The navigation state of the inertial navigation system is defined. and inertial measurement data for: , ; in, Indicates in Location of the time point; Indicates in Speed ​​at any given moment; Indicates in Quaternions at a given time point; Indicates in Accelerometer deviation at any given moment; Indicates in The deviation of the gyroscope at a given moment; Indicates in The accelerometer reading at a given moment; Indicates in The gyroscope measurement at a given time point.

[0016] The magnetic field, acceleration, and angular velocity data measured by the IMU sensor are stored in the carrier coordinate system by default. The navigation coordinate system is a fixed reference coordinate system used to represent the absolute attitude and motion of an object. Attitude estimation typically requires representing this data in the navigation coordinate system. Attitude updates depend on the angular velocity data provided by the gyroscope; therefore, the parameters measured in the carrier coordinate system need to be transferred to the navigation coordinate system to achieve attitude updates. This is specifically implemented using quaternion differential equations: ; ; ; ; in, , , Represents a unit vector. It is a quaternion; It is a scalar of quaternions; , , Three vectors that are quaternions. This represents the attitude of the vehicle coordinate system b relative to the navigation coordinate system n; Representing quaternions The derivative in the time dimension; A quaternion matrix representing angular velocity; , , It represents the angular velocity on the three axes.

[0017] Update the quaternion using the first-order Euler integral method: ; Then, the quaternions are normalized: ; The acceleration in the vehicle coordinate system needs to be converted to a value in the navigation coordinate system using a rotation matrix, which is calculated using quaternions: ; The update process of position, velocity, and attitude in an inertial navigation system is defined as follows: ; ; in, Indicates the position in the navigation coordinate system. Represents the velocity in the navigation coordinate system. This represents the acceleration due to gravity in the navigation coordinate system; This represents the Gaussian noise process in acceleration measurements. The Gaussian noise process representing angular velocity measurement; Indicates the time sampling rate. This represents quaternion multiplication.

[0018] The analysis of the inertial navigation update formula above shows that pure inertial navigation systems provide position information through continuous integration calculations. However, system errors accumulate over time, especially under the influence of initial state errors and long-term drift, making it difficult to maintain positioning accuracy. Since inertial navigation systems rely solely on their own sensors and lack mechanisms for sensing and correcting the external environment, the estimated trajectory may gradually deviate from the actual path, thus affecting the long-term stability and accuracy of the system. To address these issues, this embodiment introduces semantic information about the magnetic field environment as an effective external compensation mechanism to enhance environmental perception and improve positioning accuracy.

[0019] Furthermore, this embodiment first explains the semantic information of the magnetic field: With the rapid development of mobile computing and the widespread adoption of mobile devices and IoT technology, indoor positioning systems have been widely used in fields such as intelligent navigation, health monitoring, and emergency response. Although the Global Positioning System (GPS) and various wireless signal technologies are widely used in positioning, their performance degrades significantly in indoor environments due to factors such as signal shielding, multipath interference, and complex building structures. Indoor positioning algorithms based on IMUs have received considerable attention in academic research, among which the aforementioned Inertial Navigation System (INS) is one of the most representative algorithms. With the continuous increase in the demand for indoor positioning accuracy, relying solely on the INS can no longer meet the high-precision requirements in complex environments. Therefore, researchers have begun to explore combining external auxiliary information to improve the performance and reliability of the INS, using algorithms such as Kalman Filter (KF), Extended Kalman Filter (EKF), and Particle Filter (PF) to achieve the fusion of auxiliary information and system state estimation. As a naturally occurring physical phenomenon in indoor environments, the magnetic field has unique spatial distribution characteristics and requires no additional infrastructure, making it an important source of information for assisting inertial navigation system positioning. The environmental characteristics of magnetic fields can provide rich information for indoor positioning. By sensing and utilizing the spatial characteristics of indoor magnetic field distribution, magnetic field-assisted positioning offers a new approach to improving the accuracy of inertial navigation systems. While magnetic field information has inherent advantages, it also faces interference from uncertainties such as signal interference and environmental changes. Indoor magnetic fields are significantly affected by factors such as building materials (e.g., reinforced concrete) and electronic equipment (e.g., power lines), leading to abrupt changes in the magnetic field at different locations. Therefore, identifying specific changes in the magnetic field and extracting semantic information from them has become a key issue in magnetic field-assisted positioning research.

[0020] The magnetic field measurement data acquired by the sensor is mainly affected by two factors. On the one hand, electrical equipment such as building materials may cause drastic changes in the magnetic field components; on the other hand, the measurement data is actually the projection of the magnetic field into the carrier coordinate system, and changes in the carrier coordinate system will cause significant changes in the magnetic field projection value, thus affecting the changes in each component. This application refers to these two types of magnetic field changes as abrupt changes and filters them through experimental thresholds.

[0021] In existing technologies, there are three main methods for indoor pedestrian trajectory localization using magnetic field information: magnetic field fingerprinting, deep learning-based modeling, and magnetic field feature extraction. While the first two methods improve indoor positioning accuracy to some extent, they often face problems such as high deployment costs and poor adaptability due to their reliance on high-density sampling and complex models. In recent years, with a deeper understanding of the spatial variation characteristics of magnetic fields, magnetic field feature extraction methods have received increasing attention due to their strong interpretability.

[0022] Magnetic fingerprint matching is one of the earliest proposed magnetic field localization techniques. It relies on constructing a magnetic field database covering the target area and estimating the location by matching it with real-time data. However, this method typically requires extensive offline sampling and manual annotation. Furthermore, magnetic fingerprint databases are susceptible to environmental changes and have high maintenance costs, limiting their applicability in dynamic environments.

[0023] To reduce manual labor and enhance model expressiveness, researchers introduced deep learning methods into magnetic field modeling, using end-to-end models to achieve a nonlinear mapping from magnetic field data to location. While this approach improves accuracy, it is highly sensitive to the quality and quantity of training data, and the computational overhead of training and deployment is significant, making rapid deployment difficult in resource-constrained environments.

[0024] In contrast, magnetic field feature extraction methods attempt to extract key spatially identifiable features from variations in the spatial distribution of magnetic fields and utilize these features to constrain the localization process, without constructing a complete magnetic field map or relying on complex models. Existing techniques indicate that by leveraging the different magnetic field distribution characteristics within indoor buildings, semantically identifying and marking landmarks such as pillars and doors during magnetic field map construction. Research shows that incorporating environmental semantic information can effectively improve the robustness and accuracy of magnetic field positioning systems. This method, based on physical characteristics and environmental structure, significantly simplifies system deployment and maintenance processes while enhancing the algorithm's adaptability in environments with limited computing power and resources, providing a new solution for achieving efficient and convenient indoor positioning.

[0025] While existing research has extensively focused on the relationship between magnetic field characteristics and the indoor environment, most studies concentrate on localized magnetic field variations caused by different building materials. Current literature has not investigated the relationship between magnetic field variation characteristics and user dynamic behavior. Traditional magnetic field positioning methods primarily emphasize the influence of environmental factors on the magnetic field, neglecting the impact of user behavior on magnetic field data. In reality, the collected magnetic field measurements are not only affected by environmental factors such as building materials but also reflect changes in the spatial structure of the environment caused by user behavior during data collection. This application reveals the interactive relationship between users and the environment, exploring the intrinsic link between magnetic field changes and user behavior, providing a new perspective for extracting valuable positioning information from the environment.

[0026] In summary, most existing studies rely on constructing magnetic field fingerprint databases to achieve localization through dense sampling and matching of magnetic field features, or on using deep learning to model magnetic field characteristics. However, these methods typically suffer from high costs, large data requirements, and complex processes. To overcome these difficulties, this application does not rely on magnetic field databases. Instead, it starts from the physical distribution laws of magnetic fields, studies their variation characteristics in indoor environments, and combines semantic information of the magnetic field environment to assist inertial navigation systems. This method aims to reduce sampling costs while improving the positioning accuracy and environmental spatial awareness capabilities of inertial navigation systems.

[0027] Distinguishing between meaningful abrupt changes in the magnetic field and those caused by noise is a crucial task in magnetic field localization, as not all abrupt changes are useless. Certain magnetic field variations can actually reflect the correlation between user behavior and the spatial environment. This application differentiates magnetic field variations, retains valuable magnetic field information, and uses it as auxiliary information for localization.

[0028] Based on the foregoing, according to Kalman filtering theory, a discrete-time method needs to be defined to describe the evolution of the system state. At discrete time points, state prediction requires using the first positioning data corresponding to the previous unit of time and the measurement values ​​corresponding to the current unit of time to deduce the second positioning data corresponding to the current unit of time. The measurement values ​​corresponding to the current unit of time include acceleration and angular velocity measurements. Therefore, during the positioning process, it is first necessary to acquire acceleration and angular velocity measurements, and update the first positioning data based on these measurements to generate the second positioning data. Secondly, to improve positioning accuracy, the second positioning data also needs to be further corrected by incorporating indoor magnetic field information.

[0029] Based on the foregoing, when a person being tracked walks indoors wearing a positioning device, the magnetic field information measured by the device is affected by the user's behavior. To identify the correlation between the user's dynamic behavior and magnetic field changes, it is first necessary to analyze the projection changes of the magnetic field vector in the carrier coordinate system to determine the magnetic field information reflecting the user's behavior. The magnetic field is a fixed vector in the global coordinate system, typically referring to the Earth's magnetic field or a local magnetic field in an indoor environment. In a global coordinate system (such as a geographic or terrestrial coordinate system), the magnetic field vector remains constant and does not change over time. However, the magnetic field data collected by the sensor is actually the projection of this vector onto the carrier coordinate system based on the sensor's current position, such as... Figure 4 As shown. The carrier coordinate system is defined by the X, Y, and Z axes, with the Z axis pointing vertically downwards as the absolute reference axis for gravitational acceleration. The gyroscope outputs three-axis angular velocity components (gyrox, gyroy, gyroz), and the accelerometer provides three-axis acceleration components (accx, accy, accz). Similarly, the magnetic field components Mx, My, and Mz are projected into the carrier coordinate system, ensuring that acceleration, angular velocity, and magnetic field measurements are expressed in the same coordinate system. Sensors are fixed to the user's body and collect data synchronously. When the user's movement changes (e.g., turning, rotating in place), the carrier coordinate system also rotates, but since the magnetic field is the Earth's inherent magnetic field, its direction is fixed and does not change with the carrier's movement. Therefore, changes in the carrier coordinate system will cause changes in the projection of the magnetic field vector on each axis. Figure 5 As shown, when the vehicle turns, the projections of the magnetic field vector onto the X and Y axes of the vehicle coordinate system change. Specifically, the projection of the magnetic field component may shift from the positive half-axis to the negative half-axis, and vice versa. This causes abrupt changes in the projection amplitude of the magnetic field vector onto the X or Y axis during turning. It is noteworthy that regardless of the rotation of the vehicle coordinate system, only the projection of the magnetic field vector onto the horizontal plane is affected; the Z-axis component is generally unaffected because its projection direction aligns with the absolute reference axis of gravitational acceleration. This pattern of magnetic field vector projection change directly reflects useful features that indicate user behavior and environmental spatial location. These abrupt changes in the magnetic field can be preserved as information that is temporally consistent and relevant to user behavior. By extracting these magnetic field changes, valuable auxiliary information can be provided to indoor positioning systems, thereby improving accuracy. In summary, during the transformation and projection of a fixed magnetic field vector in the global coordinate system onto the vehicle coordinate system, the projection amplitude of the magnetic field vector changes abruptly due to changes in the orientation of the vehicle coordinate system.

[0030] In order to categorize abrupt changes in magnetic fields, these changes can be divided into two types. ① Meaningful magnetic field changes: When a user performs a turning action in an indoor environment, the rotation of the carrier coordinate system causes a specific pattern of change in the projection of the magnetic field components. These changes are closely related to the user's movement behavior (such as turning) and contain semantic cues that can be used to infer changes in position, and are therefore considered meaningful semantic events.

[0031] ② Meaningless magnetic field changes: When a user walks, magnetic field interference sources in the environment, such as metal structures or electrical equipment, may cause sudden changes in the magnetic field. These changes are usually unstable and non-directional, lack correlation with user behavior, and may interfere with the positioning system. Therefore, they are defined as meaningless changes and need to be distinguished and suppressed during the identification process.

[0032] like Figure 6 As shown, when people walk in an indoor space, the projections of the magnetic field strength measurements detected by the positioning device onto the three axes can be statistically represented as intensity curves. To improve the stability and reliability of the magnetic field data, this application employs smoothing and denoising techniques, using a Gaussian kernel function for smoothing filtering to reduce the impact of random noise on the magnetic field data.

[0033] The formula below shows the Gaussian kernel function. definition: ; in, For window size, This represents the standard deviation, used to control the degree of smoothness.

[0034] The magnetic field strength measurements are denoised using convolution operations to generate smooth magnetic field strength measurements, including: ; ; ; in, This represents the original measured value of the magnetic field strength. Represents the Gaussian kernel function. Indicates the convolution operation; This represents the measured value of the smoothed magnetic field strength after noise reduction processing. This represents the normalized Gaussian kernel function. Indicates the first The smoothed magnetic field strength measurement value is generated by convolving the original magnetic field strength measurement value within a sliding window.

[0035] Next, the first-order forward difference method is used to detect local extrema (peaks and troughs) of the smoothed magnetic field strength measurements, thereby accurately locating the characteristic points of magnetic field signal fluctuations. After detecting the peaks and troughs of the triaxial magnetic field, the amplitude difference between the peaks and troughs on each axis is calculated to quantify the fluctuations of the triaxial magnetic field data. ; in, The magnetic field value at the wave crest; This represents the magnetic field value at the trough. Figure 6 The results of peak and trough detections were displayed, and which fluctuations abruptly occurred were marked.

[0036] Building upon the aforementioned magnetic field detection, this paper proposes a fuzzy logic-based method for extracting semantic information about the magnetic field based on its changes. By modeling the combined relationship between angular velocity fluctuations and magnetic field changes, the algorithm can identify which magnetic field abrupt changes are caused by actual motion or environmental changes, and which are caused by noise or other invalid factors. Ordinary 0 or 1 is non-discriminatory logic with poor universality and cannot describe the degree of change in variables, thus it is unsuitable for describing real-world phenomena. Fuzzy logic systems introduce different combinations of conditions to describe the fluctuation range of variables, thereby making more accurate state judgments. Fuzzy logic systems describe the rules of variable change by mapping input variables to fuzzy sets. Therefore, this application requires separate modeling of the rules of change in angular velocity and magnetic field to represent their respective fuzzy sets.

[0037] First, changes in angular velocity are closely related to the user's walking state. By analyzing the user's sensor data, especially the range of angular velocity changes, a fluctuation threshold can be intuitively set. Since angular velocity changes relatively smoothly during normal walking, while turning in a short period causes a sudden change in angular velocity, the fluctuations in angular velocity exhibit significant differences between these two states. Specifically, angular velocity fluctuations are small during normal walking, exhibiting a low-fluctuation state; during rapid turns or sharp changes in direction, the amplitude of angular velocity fluctuations increases significantly, exhibiting a high-fluctuation state. Therefore, to more accurately describe this difference, a reasonable fluctuation threshold can be set, dividing the angular velocity into two fuzzy sets: "low fluctuation (LF)" and "high fluctuation (HF)," with each fuzzy set using a trapezoidal membership function (…). ) indicates that its expression is: ; in, Indicates the left boundary of the trapezoid. This is the ascending boundary for membership degrees to increase from 0 to 1. This is the descent boundary where the membership degree decreases from 1 to 0. This represents the right boundary of the trapezoid. Boundary value. , , and Determined based on the range of angular velocity fluctuations; such as Figure 7 As shown, using " "and" "Two fuzzy sets represent the linguistic variables of angular velocity. Secondly, in triaxial magnetic field data, noise typically manifests as small fluctuations, while abrupt changes manifest as larger fluctuations. The Gaussian distribution can naturally distinguish between small and large fluctuations, assigning higher membership degrees to normal fluctuations without abrupt changes and lower membership degrees to abrupt or abnormal fluctuations, thus effectively quantifying whether an abrupt change has occurred. The formula for the Gaussian membership function is:" ; in, It represents the standard deviation, which determines the range of fluctuation based on the difference between the peaks and troughs; The mean is the central location, corresponding to either the unchanged state or the changed state. Simultaneously, an empirical threshold for determining whether a sudden change has occurred is set by observing the mean.

[0038] like Figure 8 As shown, based on empirical thresholds, fluctuations that undergo abrupt changes can be distinguished, providing stable and reliable data support for subsequent environmental semantic perception and pedestrian localization. The changes in the magnetic field vector are divided into two fuzzy sets: "change" and "no change," each represented by a Gaussian membership function. The change in magnetic field strength is set to... This is used to indicate whether the magnetic field vector has changed abruptly; the threshold for change is denoted as... Since the three-axis components of the magnetic field need to handle both abrupt changes and periods of inactivity, six fuzzy sets are used to represent the linguistic variable Diff: (NoChangeX, no mutation X) (NoChangeY, no mutation Y) (NoChangeZ, no mutation Z) (ChangeX) (ChangeY, mutation Y) (ChangeZ, mutation Z).

[0039] A multi-input single-output (MISO) fuzzy inference system was developed to distinguish which magnetic field changes are valid and to determine whether turning behavior has occurred. Each input variable (such as angular velocity)... , , , The degree to which an input variable belongs to a fuzzy set is represented by a membership function. Based on the patterns of angular velocity and magnetic field changes, rules are defined for the input conditions and corresponding output events, and these rules are applied using an If conditional structure. During fuzzy inference, each input variable is first fuzzified using membership functions, and its membership degree to each function is calculated. Then, the membership degree of the input variables is evaluated according to fuzzy logic rules, and the activation degree of each rule is calculated, determined by taking the minimum value of the membership conditional part.

[0040] The algorithm flow of the fuzzy logic system is as follows: Input: angular velocity ( ), .

[0041] Initialization: angular velocity threshold ( ), .

[0042] Membership function: , .

[0043] Modeling: , , , .

[0044] Classification: if ,but Note: When the change in angular velocity is greater than the angular velocity threshold, the angular velocity belongs to the high-fluctuation fuzzy set. if ,but Note: When the change in angular velocity is less than the angular velocity threshold, the angular velocity belongs to the low-fluctuation fuzzy set. if ,but Note: When the change in magnetic field strength exceeds the threshold value. Then the amplitude of the magnetic field fluctuation belongs to the fuzzy set of changes; if ,but Note: When the change in magnetic field strength is less than the threshold value. Then the amplitude variable of the magnetic field fluctuation belongs to the unchanging fuzzy set; Fuzzy rules: if : If any ( ,or, If the event type is "meaningless", then the event type is "meaningless". If all ( ,and, If the event type is "meaningless", then the event type is "meaningless". If all ( ,and, ,and, If the event type is "elevator", then the event type is "elevator". if : If any ( ,or, If the event type is "turning", then the event type is "turning". If all ( ,and, If the event type is "turning", then the event type is "turning".

[0045] Output: Event type and special index sequence.

[0046] Based on the above, when the change in angular velocity is small, the changes in the magnetic fields along the X and Y axes are relatively large, and the change in the magnetic field along the Z axis is small, it indicates that the sudden change in the magnetic field encountered by the user in the indoor space is caused by the environment. When the change in angular velocity is small, and the changes in the magnetic fields along the X, Y, and Z axes are all relatively large, it indicates that the user may be disturbed by the elevator. When the change in angular velocity is relatively large, and the changes in the magnetic fields along the X and Y axes are also relatively large, while the change in the magnetic field along the Z axis is small, it indicates that the user is in a turning position. Those skilled in the art know that elevators (especially car-type elevators) are metal structures, and their platform doors, lifting cables, and internal wiring all have a very strong influence on the magnetic field. Therefore, if the change in angular velocity is small, but the changes in the magnetic fields along the X, Y, and Z axes are all relatively large, a comprehensive judgment can be made based on whether an elevator is present in the environment. In this embodiment, experiments show that when a user approaches an elevator, their magnetic field induction is strongly disturbed. Therefore, the situations of elevators and turning can be classified as meaningful magnetic field semantic information, while the other two situations can be classified as meaningless magnetic field semantic information. To distinguish between elevator events and turning events, elevator events can be categorized as first meaningful magnetic field semantic information, and turning events as second meaningful magnetic field semantic information, based on two fuzzy sets. It should be noted that elevator events only refer to indoor devices that have a strong influence on the magnetic field. Other devices located along the positioning trajectory path that interfere with the magnetic field strength detected by nearby positioning devices can also be classified under the first meaningful magnetic field semantic information.

[0047] By extracting semantic information to classify events, navigation can be updated and corrected in subsequent steps. Based on the aforementioned inertial navigation principles, this application combines inertial navigation system data, magnetic field data, accelerometer data, and gyroscope data, and corrects state estimation using magnetic field semantic information such as turning position and elevator interference. In this application, the system's predicted state model and observation model are defined as follows: ; ; ; in, For predicting state models, For observation models, For the observation matrix, To observe noise.

[0048] According to Kalman filtering theory, a discrete-time method needs to be defined to describe the evolution of the system state. State prediction is based on the state at the previous time step and the current control input. The state prediction equation is: ; in, This is the first location data; It is a Jacobian matrix; To control the input matrix; To control the input, This represents the second localization data predicted by the extended Kalman filter; ; in, It is a 3x3 identity matrix; The Jacobian matrix represents the state prediction, used to map the state from the previous time step to the current time step, serving the prediction (time state) update; ; Control input matrix Used to describe the effect of control inputs on the state; The above state prediction equation is calculated as follows Localization prediction based solely on the Kalman filter requires further analysis of the event types mentioned earlier. The correction is made, and the specific correction formula is as follows: ; in, These are actual observed values; For the observation function, This represents the observation calculated based on the second state when the observation noise is 0. Kalman gain; This is the third set of location data. The difference between the actual observed value and the expected measured value is called the residual. The residual needs to be analyzed... The correction factor is obtained by weighting.

[0049] To calculate the Kalman gain, we first need to calculate the error covariance.

[0050] ; in, This is the error covariance matrix of the previous filtering iteration; The process noise covariance matrix; It is a discrete-time matrix; Based on the aforementioned quaternion formula, we can obtain... ; = .

[0051] The Kalman gain calculation formula is: ; in, The noise covariance matrix is ​​used to measure the magnitude and characteristics of noise associated with the observation process, reflecting the reliability or accuracy of the measurement data. It is usually obtained experimentally. The observation matrix describes the mapping relationship from the system state space to the observation space. This is a noise matrix that describes how noise propagates within the system and is used to correlate measurement noise matrices. With the system noise matrix.

[0052] The error covariance matrix at the current moment is as follows: .

[0053] This paper identifies the semantic index sequence of the magnetic field environment and dynamically adjusts the entire system when utilizing magnetic field information. By extracting semantic information from environmental perception, the noise environment during target movement can be estimated more accurately. Specifically, the measurement noise of the system differs significantly when the target passes through an elevator area, walks normally, and turns; therefore, it is necessary to redefine the measurement noise covariance matrix. ,include: ; In other words, the measurement noise covariance matrix is ​​dynamically adjusted, and the measurement noise covariance matrix... The effect of observation noise on Kalman gain is determined. The Kalman gain further affects the impact of the correction parameters on the positioning system. If the Kalman gain... A smaller Kalman gain indicates higher uncertainty in the observed data, meaning the Kalman filter relies more heavily on the predictions of the system model; conversely, a larger Kalman gain indicates higher uncertainty. A larger value indicates that the observation data is more accurate, and Kalman filtering places more emphasis on the observation data when correcting state estimation.

[0054] Accordingly, the formula for Kalman gain changes to: ; Calculating the Jacobian matrix of the magnetometer observation quaternion helps to understand how magnetic field changes affect the system attitude and correct the system state. (Kalman gain) The Jacobian matrix maps each variable in the state vector to the observation space. This paper calculates the mapping relationship of variables using the Jacobian matrix; therefore, the influence of the magnetic field on the system direction estimation is modeled using the Jacobian matrix to represent the transitive relationship. The influence of the magnetic field on the quaternion is also represented by the Jacobian matrix. Modeling.

[0055] ; This represents the Jacobian matrix that acts on the observation model to calculate the quaternions of magnetometer observations. It is used to describe the relationship between magnetometer measurements and system state, and serves to update observations (measurements).

[0056] When the event represents the first meaningful magnetic field semantic information (i.e., the elevator), the magnetic field is severely disturbed, becoming a factor interfering with state estimation. Therefore, it is necessary to increase the measurement noise matrix. Minimize Kalman gain This reduces the correction of predicted values ​​by observed values ​​during the correction process, meaning the final result is closer to the second location data. Specifically: ; ; in, It is the identity matrix; For error covariance, For the observation matrix, This represents the Kalman gain in the case of the elevator event.

[0057] When the event represents the second meaningful magnetic field semantic information (i.e., a turn), the magnetic field is not severely disturbed; therefore, the observations can be used as reliable data to correct the second positioning data. The observed turning position is: ; in, and The experimentally measured horizontal two-dimensional coordinate position with millimeter-level accuracy. A multidimensional matrix column vector that reflects the true state of the system at the turning position; At the current moment, the state vector, obtained after prediction from the data measured by the accelerometer, gyroscope, and magnetometer, contains a total of 16 elements: a 3-element position vector, a 3-element velocity vector, a quaternion attitude vector, a 3-element acceleration deviation, and a 3-element angular velocity deviation. Therefore, the state vector contains 16 variables. The system state vector is determined through the observation matrix. The state estimate is mapped to the observation space and corrected by calculating the difference between the predicted and actual observations (such as observation residuals). The observation matrix corresponding to the turning event is... Specifically: ; Among them, the observation matrix The number of horizontal elements is 16, which corresponds to the number of state vectors.

[0058] Turning position versus measurement noise covariance matrix Specifically: ; In this embodiment, the noise covariance matrix is ​​measured. Used to adjust the confidence of observations; by reducing the measurement noise covariance matrix. The value of increases the Kalman gain, which in turn increases the influence of the observed value on the predicted value.

[0059] During the turning event, the Kalman gain becomes: ; Based on the aforementioned Kalman gain, the second positioning data is corrected to obtain the third positioning data, and the specific formula is as follows: .

[0060] When the magnetic field semantic information of the magnetic field change is meaningless, it means that the change in the environmental magnetic field is caused by environmental factors and is unrelated to the user's actions. Therefore, the inertial measurement unit is used directly to predict and update the current state, and the predicted value is no longer corrected based on the magnetic field change information, so as to avoid the magnetic field change affecting the accuracy of positioning.

[0061] Example 2 Please see Figure 2 A magnetic semantics-based extended Kalman filter inertial navigation device, comprising: Acquisition unit 1 is used to acquire acceleration measurement values, angular velocity measurement values, and magnetic field strength measurement values; Update unit 2 is used to update the first positioning data based on the acceleration measurement value and the angular velocity measurement value using an extended Kalman filter to obtain the second positioning data; wherein, the first positioning data is the positioning data of the previous unit time. Prediction unit 3 is used to extract magnetic field semantic information based on the angular velocity measurement value and the magnetic field strength measurement value; the magnetic field semantic information includes meaningful magnetic field semantic information and meaningless magnetic field semantic information, the meaningful magnetic field semantic information is associated with the user's action, and the meaningless magnetic field semantic information is not associated with the user's action; The correction unit 4 is used to generate current positioning data based on the magnetic field semantic information and the second positioning data. When the magnetic field semantic information is meaningless, the second positioning data is used as the current positioning data. When the magnetic field semantic information is meaningful, the second positioning data is corrected based on the magnetic field semantic information to generate third positioning data, and the third positioning data is used as the current positioning data.

[0062] Specific limitations regarding the magnetic semantics-based extended Kalman filter inertial navigation device can be found in the limitations of the magnetic semantics-based extended Kalman filter inertial navigation method described above, and will not be repeated here. Each module in the aforementioned magnetic semantics-based extended Kalman filter inertial navigation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the corresponding operations of each module.

[0063] Those skilled in the art will understand that Figure 2 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the present application. Specific magnetic semantic-based extended Kalman filter inertial navigation devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. Example 3 A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the extended Kalman filter inertial navigation method based on magnetic semantics as described in Embodiment 1.

[0064] Example 4 In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. When executed by the processor, the computer program implements an extended Kalman filter inertial navigation method based on magnetic semantics.

[0065] Example 5 This embodiment further provides an experimental verification process. This embodiment uses an Xsens MTi-3 inertial sensor manufactured in the Netherlands, which is fixed to the user's chest with a black elastic band to collect the user's acceleration, angular velocity, and magnetic field strength data. The various parameters related to the Xsens MTi-3 are shown in Table 1. A laptop computer is also provided for data storage. Figure 9 The system guides users along a pre-planned 12m x 34.2m path and collects data using Xsens MTi-3 sensors mounted on the body.

[0066]

[0067] Table 1: Sensor Specifications This embodiment also performs visual analysis of the user trajectory using MATLAB 2023 simulation software. For example... Figure 10As shown, the semantic information of the magnetic field environment in this application is analyzed and verified by combining changes in angular velocity and abrupt changes in the magnetic field. The first row shows the measured Z-axis angular velocity, and the second, third, and fourth rows show the X-axis, Y-axis, and Z-axis magnetic field components, respectively. The high fluctuation in angular velocity highlighted in the red box in the figure indicates that the user is turning. During this period, the X-axis or Y-axis component of the magnetic field changes abruptly, which verifies that the carrier coordinate system has changed due to the user's rotation, resulting in a sudden change in the projection of the X-axis and Y-axis component vectors of the magnetic field in the carrier coordinate system. Otherwise, in the fourth row of the figure, it can be observed that, apart from the initial obvious abrupt change in the Z-axis component vector of the magnetic field, the Z-axis component vector of the magnetic field does not change abruptly regardless of the direction of the turn. This is because the Z-axis component vector of the magnetic field is projected onto the Z-axis of the carrier coordinate system. Therefore, this sudden change in the projection of the magnetic field component vector related to the turning motion only occurs in the horizontal coordinate system of the carrier. Counting from left to right, in the first magenta box, when the Z-axis component vector of the magnetic field changes, there is indeed a strong external magnetic disturbance, which is consistent with the situation when a user walks through an elevator. Therefore, when the three-axis component vector of the magnetic field undergoes a sudden change, it can be determined that the user has passed through the elevator interference zone. During the user's walking process, due to body swaying or environmental noise interference, the magnetic field may also undergo some meaningless changes, such as the magnetic field strength changes shown in the second pink box. In addition, these meaningless changes can be found to correspond to low fluctuations in angular velocity, which means that the user is in a normal walking state.

[0068] The root mean square error (RMSE) is a measure of the error between the predicted and the true values, used to evaluate the accuracy of a model.

[0069] ; For each sampling point, the error between the predicted value and the true value is calculated. Finally, the average of all squared errors is taken, which is the mean square error for all sampling points. For example... Figure 11 As shown by the light blue trajectory line, the classic IMU-based non-magnetic INS indoor positioning algorithm cannot eliminate the accumulated errors caused by the introduction of reference information, resulting in significant trajectory drift. Figure 11As shown by the green trajectory line, the positioning algorithm based on the magnetic field-assisted inertial navigation system suffers from significant errors in magnetic field information due to severe magnetic field interference, resulting in poor positioning results. Especially at the starting point, the elevator presents a strong interference source, severely disrupting the magnetic field information and causing a large initial heading deviation. The inertial navigation positioning algorithm based on magnetic field environment semantic information proposed in this paper effectively eliminates magnetic interference information and, combined with angle information, effectively eliminates the interference of accumulated errors, greatly reducing trajectory drift and achieving good detection results. The maximum error is 0.930 meters, and the root mean square error is 0.489 meters, both controlled within 1 meter. Through analysis of… Figure 12 The analysis shows that the positioning algorithm proposed in this paper has small cumulative error and high accuracy.

[0070] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. An extended Kalman filter inertial navigation method based on magnetic semantics, characterized in that, include: Acquire acceleration, angular velocity, and magnetic field strength measurements; Based on the acceleration measurement value and the angular velocity measurement value, the first positioning data is updated using an extended Kalman filter to obtain the second positioning data; wherein, the first positioning data is the positioning data of the previous unit time. Extracting magnetic field semantic information based on the measured angular velocity and the measured magnetic field strength specifically includes: calculating the change in magnetic field strength based on the smoothed magnetic field strength measurement; extracting magnetic field semantic information based on the measured angular velocity and the change in magnetic field strength; meaningful magnetic field semantic information is associated with user actions, while meaningless magnetic field semantic information is not associated with user actions. The extraction of magnetic field semantic information based on the measured angular velocity and the change in magnetic field strength specifically includes: when ,or In this case, the magnetic field semantic information is meaningless magnetic field semantic information; when At that time, the magnetic field semantic information is the first meaningful magnetic field semantic information; when ,or In this case, the magnetic field semantic information is the second meaningful magnetic field semantic information; in, This represents the measured angular velocity value. Represents a fuzzy set with low angular velocity fluctuations. Represents a fuzzy set with high angular velocity fluctuations. This represents the projected component of the change in magnetic field strength along the X-axis. This represents the projected component of the change in magnetic field strength along the Y-axis. This represents the projected component of the change in magnetic field strength along the Z-axis. Represents the fuzzy set of changes in the magnetic field along the X-axis; Represents the fuzzy set of changes in the Y-axis magnetic field; Represents the fuzzy set of changes in the Z-axis magnetic field; Based on the magnetic field semantic information and the second positioning data, current positioning data is generated. When the magnetic field semantic information is meaningless, the second positioning data is used as the current positioning data. When the magnetic field semantic information is meaningful, the second positioning data is corrected based on the magnetic field semantic information to generate third positioning data, and the third positioning data is used as the current positioning data.

2. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 1, characterized in that, After obtaining the acceleration measurement value, angular velocity measurement value, and magnetic field strength measurement value, the method further includes: using a Gaussian kernel function to perform noise reduction processing on the magnetic field strength measurement value to generate a smooth magnetic field strength measurement value.

3. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 1, characterized in that, The step of correcting the second positioning data based on the magnetic field semantic information to generate the third positioning data specifically includes: The second location data is specifically: ; in, This is the first location data; It is a Jacobian matrix; To control the input matrix; To control the input, This represents the second localization data predicted by the extended Kalman filter; The second positioning data is corrected to generate third positioning data, including: ; in, These are actual observed values; For the observation function, This represents the observation calculated based on the second state when the observation noise is 0. Kalman gain; This is the third location data.

4. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 3, characterized in that, When the magnetic field semantic information is the first meaningful magnetic field semantic information, the Kalman gain Specifically: ; ; in, It is the identity matrix; For error covariance, This is the observation matrix.

5. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 3, characterized in that, When the magnetic field semantic information is second meaningful magnetic field semantic information, the step of correcting the second positioning data based on the magnetic field semantic information to generate third positioning data includes: ; in: ; Specifically, it is a 16-dimensional matrix; The Kalman gain is specifically: ; in, , It is the identity matrix; For error covariance, This is the observation matrix.

6. An extended Kalman filter inertial navigation device based on magnetic semantics, characterized in that, The device includes: The acquisition unit is used to acquire acceleration measurement values, angular velocity measurement values, and magnetic field strength measurement values; The update unit is used to update the first positioning data based on the acceleration measurement value and the angular velocity measurement value using an extended Kalman filter to obtain the second positioning data; wherein, the first positioning data is the positioning data of the previous unit time. The prediction unit is used to extract magnetic field semantic information based on the angular velocity measurement value and the magnetic field strength measurement value, specifically including: calculating the magnetic field strength change value based on the smoothed magnetic field strength measurement value; extracting magnetic field semantic information based on the angular velocity measurement value and the magnetic field strength change value; meaningful magnetic field semantic information is associated with user actions, and meaningless magnetic field semantic information is not associated with user actions; The extraction of magnetic field semantic information based on the measured angular velocity and the change in magnetic field strength specifically includes: when ,or At that time, the magnetic field semantic information is meaningless magnetic field semantic information; when At that time, the magnetic field semantic information is the first meaningful magnetic field semantic information; when ,or In this case, the magnetic field semantic information is the second meaningful magnetic field semantic information; in, This represents the measured angular velocity value. Represents a fuzzy set with low angular velocity fluctuations. Represents a fuzzy set with high angular velocity fluctuations. This represents the projected component of the change in magnetic field strength along the X-axis. This represents the projected component of the change in magnetic field strength along the Y-axis. This represents the projected component of the change in magnetic field strength along the Z-axis. Represents the fuzzy set of changes in the magnetic field along the X-axis; Represents the fuzzy set of changes in the Y-axis magnetic field; Represents the fuzzy set of changes in the Z-axis magnetic field; The correction unit is used to generate current positioning data based on the magnetic field semantic information and the second positioning data. When the magnetic field semantic information is meaningless, the second positioning data is used as the current positioning data. When the magnetic field semantic information is meaningful, the second positioning data is corrected based on the magnetic field semantic information to generate third positioning data, and the third positioning data is used as the current positioning data.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the extended Kalman filter inertial navigation method based on magnetic semantics as described in any one of claims 1-5.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the extended Kalman filter inertial navigation method based on magnetic semantics as described in any one of claims 1-5.