Extended Kalman filtering inertial navigation method based on magnetic semantics and related equipment
By introducing magnetic semantic information and extended Kalman filters into the inertial navigation system, meaningful magnetic field changes are identified to correct inertial navigation errors, the problem of difficult to maintain positioning accuracy in the inertial navigation system is solved, and higher accuracy and stable indoor positioning are achieved.
Patent Information
- Application Number
- CN202510763164.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-09
AI Technical Summary
The existing inertial navigation systems rely on their own sensors and lack external environment perception, making positioning accuracy difficult to maintain, especially in long-term use, which greatly accumulates errors, affecting the stability and accuracy of the system.
Magnetic semantic information is introduced, and through the extended Kalman filter combining acceleration, angular velocity and magnetic field intensity measurements, it can identify meaningful and meaningless magnetic field semantic information, dynamically adjust the observation model and noise covariance, and achieve more accurate trajectory estimation and robust error correction.
The positioning accuracy and environmental space perception ability of the inertial navigation system are improved, the system error accumulation is reduced, and long-term stability is enhanced.
Smart Images

Figure CN120576745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of indoor navigation technology, and more particularly to an extended Kalman filter inertial navigation method based on magnetic semantics and related equipment. Background Art
[0002] In existing technologies, inertial navigation systems use gyroscopes to measure angular velocity and calculate attitude changes. Accelerometer measurements are then projected into a navigation coordinate system, and changes in velocity and position are calculated through integration. The entire process primarily involves attitude updates, velocity updates, and position updates, ultimately achieving a navigation solution. However, current pure inertial navigation systems provide position information through continuous integration, and system errors accumulate over time. This makes it difficult to maintain positioning accuracy, especially under the influence of initial state errors and long-term drift. Because inertial navigation systems rely solely on their own sensors and lack a mechanism for sensing and correcting the external environment, the estimated trajectory can gradually deviate from the actual path, impacting the system's long-term stability and accuracy. Summary of the Invention
[0003] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide an extended Kalman filter inertial navigation method based on magnetic semantics and related equipment to overcome the shortcomings of existing indoor navigation.
[0004] The above technical objectives of the present invention are achieved through the following technical solutions: First, an extended Kalman filter inertial navigation method based on magnetic semantics includes: Obtain acceleration measurements, angular velocity measurements, 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 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 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 action, and the meaningless magnetic field semantic information is not associated with the user action; Based on the magnetic field semantic information and the second positioning data, current positioning data is generated, wherein when the magnetic field semantic information is meaningless magnetic field semantic information, the second positioning data is used as the current positioning data; when the magnetic field semantic information is meaningful magnetic field semantic information, 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] The second aspect is the extended Kalman filter inertial navigation device based on magnetic semantics, including: an acquisition unit, configured to acquire acceleration measurement values, angular velocity measurement values, and magnetic field strength measurement values; an updating unit, configured to update the first positioning data using an extended Kalman filter based on the acceleration measurement value and the angular velocity measurement value to obtain second positioning data; wherein the first positioning data is positioning data of a previous unit time; a prediction unit, configured to extract magnetic field semantic information based on the angular velocity measurement value and the magnetic field intensity measurement value, wherein the magnetic field semantic information includes meaningful magnetic field semantic information and meaningless magnetic field semantic information, wherein the meaningful magnetic field semantic information is associated with a user action, and the meaningless magnetic field semantic information is not associated with the user action; A correction unit is used to generate current positioning data based on the magnetic field semantic information and the second positioning data, wherein when the magnetic field semantic information is meaningless magnetic field semantic information, the second positioning data is used as the current positioning data; when the magnetic field semantic information is meaningful magnetic field semantic information, 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 stores a computer program, which implements the steps of the above method when executed by a processor.
[0007] A computer device includes a memory and a processor, wherein the memory stores a computer program and the processor implements the steps of the above method when executing the computer program.
[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 the semantic events of magnetic field information and introducing the 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 This is a flow chart of the extended Kalman filter inertial navigation method based on magnetic semantics of the present invention; Figure 2 4 is a structural diagram of an extended Kalman filter inertial navigation device based on magnetic semantics in an embodiment of the present invention; Figure 3 This is a diagram of the internal structure of a computer device according to an embodiment of the present invention; Figure 4 Schematic diagram of the projection of the magnetic field vector on the carrier coordinate system in an embodiment of the present invention; Figure 5Schematic diagram of projection of magnetic field vectors in different trajectory directions onto the carrier coordinate system in an embodiment of the present invention; Figure 6 Detection diagram of peak values, valley values, and changes of three-axis magnetic field measurement values in an embodiment of the present invention; Figure 7 Schematic diagram of the membership function of angular velocity in an embodiment of the present invention; Figure 8 Schematic diagram of the Gaussian membership function of the peak-to-valley difference in an embodiment of the present invention; Figure 9 A plan view of a test site in an embodiment of the present invention; Figure 10 This is a comprehensive analysis diagram of magnetic field semantics in an embodiment of the present invention; Figure 11 This is a comparison diagram of the positioning trajectory experiment in an embodiment of the present invention; Figure 12 is a schematic diagram of the cumulative distribution function of the error in an embodiment of the present invention; In the figure, 1, acquisition unit; 2, update unit; 3, prediction unit; 4, correction unit. DETAILED DESCRIPTION
[0010] To make the objectives, features, and advantages of the present invention more readily apparent, the following detailed description of the present invention is provided with reference to the accompanying drawings. The accompanying drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein.
[0011] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated 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 be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0012] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented using a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians 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 clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0014] The present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0015] Example 1 First, this application describes the inertial navigation method based on the inertial measurement unit (IMU): the inertial navigation system uses a gyroscope to measure angular velocity and calculate attitude changes, then projects the accelerometer measurements into the navigation coordinate system and calculates the changes in velocity and position through integration. The entire process mainly includes attitude updates, velocity updates, and position updates, ultimately achieving navigation solution. Define the navigation state of the inertial navigation system and inertial measurement data for: , ; in, Indicates The location at the time point; Indicates Speed at a given moment; Indicates Quaternion at a time point; Indicates The deviation of the accelerometer at that moment; Indicates The deviation of the gyroscope at a given moment; Indicates The accelerometer measurement value at the time point; Indicates The gyroscope measurement value at a given moment.
[0016] The magnetic field, acceleration, and angular velocity data measured by the IMU sensor are 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 usually requires expressing this data in the navigation coordinate system. Attitude updates rely 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 achieved using quaternion differential equations: ; ; ; ; in, 、 、 represents a unit vector, is a quaternion; is the scalar of the quaternion; 、 、 are three vectors of quaternion, Indicates the posture of the carrier coordinate system b relative to the navigation coordinate system n; Representing quaternions derivatives in the time dimension; Quaternion matrix representing angular velocity; 、 、 Represents the angular velocity on the three axes.
[0017] Update the quaternion using the first-order Euler integration method: ; Then normalize the quaternion: ; The acceleration in the carrier coordinate system needs to be converted to the value in the navigation coordinate system through the rotation matrix, which is calculated by quaternion: ; The update process of position, velocity and attitude in the inertial navigation system is defined as: ; ; in, Represents the position in the navigation coordinate system, represents the speed in the navigation coordinate system, Represents the gravitational acceleration in the navigation coordinate system; represents the Gaussian noise process of the acceleration measurement; represents the Gaussian noise process of the angular velocity measurement; represents the time sampling rate, Represents quaternion multiplication.
[0018] From the analysis of the above inertial navigation update formula, it can be seen that a pure inertial navigation system provides position information through continuous integral calculation. However, system errors will accumulate over time, especially under the influence of initial state errors and long-term drift, and positioning accuracy is difficult to maintain. Since the inertial navigation system relies only on its own sensors and lacks a perception and correction mechanism for the external environment, the estimated trajectory may gradually deviate from the actual path, thereby affecting the long-term stability and accuracy of the system. To address these problems, this embodiment introduces magnetic field environment semantic information as an effective external compensation mechanism to enhance environmental perception and improve positioning accuracy.
[0019] Furthermore, this embodiment first explains magnetic field semantic information: With the rapid development of mobile computing, coupled with the popularization of mobile devices and Internet of Things technologies, indoor positioning systems have been widely used in intelligent navigation, health monitoring, emergency response, and other fields. Although the Global Positioning System (GPS) and various wireless signal technologies are widely used for positioning, their performance in indoor environments is significantly reduced due to factors such as signal shielding, multipath interference, and complex building structures. Indoor positioning algorithms based on IMUs have attracted considerable attention in academic research, with the aforementioned inertial navigation system (INS) being one of the most representative algorithms. As the demand for indoor positioning accuracy continues to increase, relying solely on inertial navigation systems can no longer meet the high-precision requirements in complex environments. Therefore, researchers have begun exploring ways to improve the performance and reliability of inertial navigation systems by integrating external auxiliary information, using algorithms such as Kalman filtering (KF), extended Kalman filtering (EKF), and particle filtering (PF) to integrate auxiliary information with system state estimation. As a naturally occurring physical phenomenon in indoor environments, the magnetic field has unique spatial distribution characteristics and does not require additional infrastructure, making it an important source of information to assist in inertial navigation system positioning. The environmental characteristics of the magnetic field provide rich information for indoor positioning. By sensing and leveraging 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 offers inherent advantages, it also faces uncertainties such as signal interference and environmental changes. Indoor magnetic fields are significantly affected by factors such as building materials (such as reinforced concrete) and electronic equipment (such as power lines), resulting in sudden 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 collected by the sensor is primarily affected by two factors. First, electrical equipment, such as building materials, can cause dramatic changes in magnetic field components. Second, the measured data is actually a projection of the magnetic field in the carrier coordinate system. Changes in the carrier coordinate system can cause significant changes in the magnetic field projection, thus affecting the changes in each component. This application refers to these two types of magnetic field changes as mutations and filters them using experimental thresholds.
[0021] In existing technologies, there are three main methods for utilizing magnetic field information for indoor pedestrian trajectory localization: magnetic field fingerprinting, modeling combined with deep learning, and magnetic field feature extraction. While the first two methods have improved indoor positioning accuracy to a certain extent, their reliance on high-density sampling and complex models often leads to high deployment costs and poor adaptability. In recent years, with the deepening of understanding of the spatial variation characteristics of magnetic fields, magnetic field feature extraction methods have attracted increasing attention due to their strong interpretability.
[0022] Magnetic field fingerprint matching is one of the earliest magnetic field positioning technologies. It relies on building a magnetic field database covering the target area and matching it with real-time data to estimate location. However, this method typically requires extensive offline sampling and manual annotation. Furthermore, magnetic field fingerprint databases are susceptible to environmental changes and are expensive to maintain, limiting their applicability in dynamic environments.
[0023] To reduce manual labor and enhance model expressiveness, researchers have introduced deep learning methods into magnetic field modeling, using end-to-end models to achieve a nonlinear mapping from magnetic field data to position. Although these methods have improved accuracy, they are highly sensitive to the quality and quantity of training data, and the computational overhead of training and deployment is high, making them difficult to deploy quickly in resource-constrained environments.
[0024] In contrast, magnetic field feature extraction methods attempt to extract key spatially identifiable features from changes in the spatial distribution of the magnetic field, and use these features to constrain the positioning process without having to build a complete magnetic field map or rely on complex models. Existing technologies point out that by utilizing the different magnetic field distribution characteristics in indoor buildings, pillars, doors and other landmarks can be semantically identified and marked when constructing a magnetic field map. Studies have shown that combining environmental semantic information can effectively improve the robustness and accuracy of magnetic field positioning systems. This method based on physical characteristics and environmental structure greatly simplifies the system deployment and maintenance process, while enhancing the adaptability of the algorithm in environments with limited computing power and resources, providing a new solution for achieving efficient and convenient indoor positioning.
[0025] Although a lot of research in the prior art has focused on the relationship between magnetic field characteristics and indoor environment, most of them focus on local magnetic field changes caused by different building materials in the environment. Existing literature has not yet studied the relationship between magnetic field change characteristics and user dynamic behavior. Traditional magnetic field positioning methods mainly emphasize the impact of environmental factors on the magnetic field, while ignoring the impact of user behavior on magnetic field data. In fact, the collected magnetic field measurements are not only affected by environmental factors such as building materials, but also reflect the changes in the spatial structure of the environment caused by the user's behavior during the data collection process. This application reveals the interactive relationship between users and the environment, that is, exploring the intrinsic connection between magnetic field changes and user behavior, and provides a new perspective for extracting favorable positioning information from the environment.
[0026] In summary, most existing studies rely on building a magnetic field fingerprint database, achieving positioning through dense sampling and matching of magnetic field features, or using deep learning to model magnetic field characteristics. However, these methods usually have problems such as high cost, large data requirements and complex processes. To overcome these difficulties, this application does not rely on a magnetic field database, but instead starts from the physical distribution law of the magnetic field, studies its changing characteristics in indoor environments, and combines the semantic information of the magnetic field environment to assist the inertial navigation system. This method aims to reduce the sampling cost while improving the positioning accuracy and environmental space perception capabilities of the inertial navigation system.
[0027] Distinguishing meaningful magnetic field changes from those caused by noise is a crucial task in magnetic field positioning, as not all changes are useless. Some magnetic field changes can actually reflect the correlation between user behavior and the spatial environment. This application distinguishes magnetic field changes, retaining valuable magnetic field information and using it as auxiliary information for positioning.
[0028] Based on the above, it can be seen that according to Kalman filter theory, a discrete-time method must be defined to describe the evolution of system states. At discrete moments in time, state prediction requires inferring the second positioning data corresponding to the current unit time based on the first positioning data corresponding to the previous unit time and the measurement values corresponding to the current unit time. The measurement values corresponding to the current unit time include acceleration measurements and angular velocity measurements. Therefore, during the positioning process, the first step is to obtain acceleration and angular velocity measurements, and then update the first positioning data based on these acceleration and angular velocity measurements to generate the second positioning data. Secondly, to improve positioning accuracy, the second positioning data needs to be further corrected by combining indoor magnetic field information.
[0029] Based on the above content, it can be known that when the person being located carries a positioning device and walks indoors, the magnetic field information measured by the device will be affected to a certain extent based on the user's behavior. In order to identify the correlation between the user's dynamic behavior and the 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 that reflects the user's behavior. The magnetic field is a fixed vector in the global coordinate system, usually referring to the geomagnetic field or the local magnetic field in the indoor environment. In a global coordinate system (such as a geographic or ground 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 the vector in the carrier coordinate system based on the current position of the sensor, such as Figure 4 As shown. The carrier coordinate system is defined by the X-axis, Y-axis, and Z-axis, with the Z-axis pointing vertically downward 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 in the carrier coordinate system to ensure that the acceleration, angular velocity, and magnetic field measurements are expressed in the same coordinate system. The sensor is fixed on the user's body to collect data synchronously. When the user's movement state changes (such as turning, rotating in place), the carrier coordinate system will also rotate, but because the magnetic field is the inherent magnetic field generated by the earth, its direction is fixed and will not change due to the movement of the carrier. Therefore, changes in the carrier coordinate system will cause the projection of the magnetic field vector on each axis to change. As shown Figure 5 As shown in the figure, when a vehicle turns, the projections of the magnetic field vector's X- and Y-axis components in the vehicle coordinate system change. Specifically, the projections of the magnetic field components may shift from the positive semi-axis to the negative semi-axis, or vice versa. This causes a sudden change in the magnitude of the magnetic field vector's projections on the X or Y axis during a turn. Notably, regardless of the rotation of the vehicle coordinate system, only the projections of the magnetic field vector on the horizontal plane are affected, while the Z-axis component of the magnetic field is generally unaffected because its projection direction aligns with the absolute reference axis of gravity. This pattern of change in the magnetic field vector projection directly reflects useful features that can indicate user behavior and environmental spatial location. The sudden changes in the magnetic field can be preserved as temporally consistent information related 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 process of transforming and projecting a fixed magnetic field vector in the global coordinate system into the vehicle coordinate system, the magnitude of the magnetic field vector's projections can undergo a sudden change due to changes in the orientation of the vehicle coordinate system.
[0030] In order to classify the sudden changes in magnetic field, the sudden changes in magnetic field can be divided into two types: ① Meaningful magnetic field changes: When a user performs a turn in an indoor environment, the rotation of the carrier coordinate system causes the projection of the magnetic field components to change in a specific pattern. These changes are closely related to the user's motion behavior (such as turning) and contain semantic clues that can be used to infer position changes. Therefore, they are considered meaningful semantic events.
[0031] ② Meaningless magnetic field changes: When a user walks, magnetic interference sources such as metal structures or electrical equipment in the environment can cause sudden changes in the magnetic field. These changes are often unstable and non-directional, lacking relevance to 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 recognition process.
[0032] like Figure 6 As shown, when people walk in a certain indoor space, the projections of the magnetic field strength measurements detected by the positioning device on the three axes can be statistically calculated as an intensity curve respectively; in order to improve the stability and reliability of the magnetic field data, smoothing and denoising techniques are applied in this application, and Gaussian kernel function is used for smoothing filtering to reduce the impact of random noise on the magnetic field data.
[0033] As shown in the following formula, it is the Gaussian kernel function definition: ; in, is the window size, is the standard deviation, which controls the degree of smoothing.
[0034] The magnetic field strength measurement value is subjected to noise reduction through a convolution operation to generate a smoothed magnetic field strength measurement value, including: ; ; ; in, represents the raw magnetic field strength measurement, represents the Gaussian kernel function, Represents the convolution operation; Represents the smoothed magnetic field strength measurement value after noise reduction processing; represents the normalized Gaussian kernel function, Indicates in The smoothed magnetic field strength measurement is generated by convolving the raw magnetic field strength measurement within a sliding window.
[0035] Next, the first-order forward difference method is used to detect local extreme points (peaks and valleys) of the smoothed magnetic field intensity measurement value, thereby accurately locating the characteristic points of the magnetic field signal fluctuation. After detecting the peaks and valleys of the three-axis magnetic field, the amplitude difference between the peaks and valleys on each axis is calculated to quantify the fluctuation of the three-axis magnetic field data: ; in, is the magnetic field value of the peak; is the magnetic field value at the trough. Figure 6 The results of peak and trough detection are shown, and which fluctuations have undergone abrupt changes are marked.
[0036] On the basis of the above-mentioned magnetic field detection, a magnetic field semantic information extraction method based on fuzzy logic is further proposed based on the magnetic field change situation. By modeling the combined relationship between angular velocity fluctuations and magnetic field changes, the algorithm can identify which magnetic field mutations are caused by actual motion or environmental changes, and which are caused by noise or other invalid factors. Ordinary 0 or 1 is non-discriminative logic has poor versatility and cannot describe the degree of change of variables, so it is not suitable for describing actual phenomena. The fuzzy logic system introduces different condition combinations to describe the fluctuation range of variables, thereby making more accurate state judgments. The fuzzy logic system describes the change rules of variables by mapping input variables to fuzzy sets. Therefore, this application needs to model the change rules of angular velocity and magnetic field changes separately to represent their respective fuzzy sets.
[0037] First, the change in angular velocity is closely related to the user's walking state. By analyzing the user's sensor data, especially the range of angular velocity changes, the fluctuation threshold can be set intuitively. Since the angular velocity changes relatively slowly in the normal walking state, while turning behavior in a short period of time will cause a sudden change in angular velocity, the angular velocity fluctuation shows obvious differences in these two states. Specifically, the angular velocity fluctuation is small during normal walking, showing a low fluctuation state; when turning quickly or turning sharply, the angular velocity fluctuation amplitude increases significantly, showing a high fluctuation state. Therefore, in order to more accurately describe this difference, a reasonable fluctuation threshold can be set, and the angular velocity can be divided into two fuzzy sets of "low fluctuation (LF)" and "high fluctuation (HF)", and each fuzzy set is represented by a trapezoidal membership function ( ) indicates that its expression is: ; in, represents the left boundary of the trapezoid, is the rising boundary of membership from 0 to 1, is the descending boundary where the membership degree drops from 1 to 0, is the right boundary of the trapezoid. 、 、 and Determined based on the angular velocity fluctuation range; Figure 7 As shown, use " "and" The two fuzzy sets represent the linguistic variables of angular velocity. Secondly, in the triaxial magnetic field data, noise usually manifests as small fluctuations, while mutations manifest as large fluctuations. The Gaussian distribution can naturally distinguish between small and large fluctuations, assigning a higher membership to normal fluctuations without mutations in the data and a lower membership to mutations or abnormal fluctuations, thereby effectively quantifying whether mutations occur. The formula of the Gaussian membership function is: ; in, represents the standard deviation, which determines the fluctuation range based on the difference between the peak and the trough; is the center position, corresponding to the average value of the unchanged state or the changed state. At the same time, the empirical threshold of whether a mutation occurs is set by observing the mean value.
[0038] like Figure 8 As shown in the figure, based on the empirical threshold, the fluctuations that have undergone mutations can be distinguished, providing stable and reliable data support for subsequent environmental semantic perception and pedestrian positioning. The change of the magnetic field vector is divided into two fuzzy sets: "change" and "no change", and each set is represented by a Gaussian membership function. The magnetic field intensity change value is set to , used to indicate whether the magnetic field vector has a sudden change, and the change threshold is recorded as Since the three-axis components of the magnetic field need to deal with both sudden changes and no changes, six fuzzy sets are used to represent the linguistic variable Diff: (NoChangeX, no mutation X), (NoChangeY, no mutation Y), (NoChangeZ, no mutation Z), (ChangeX, mutation X), (ChangeY, mutation Y), (ChangeZ, mutation Z).
[0039] A multiple-input single-output (MISO) fuzzy inference system was developed to distinguish which magnetic field changes are valid and determine whether a turning action has occurred. Each input variable (such as angular velocity 、 、 、 ) is mapped to a fuzzy set via a membership function, indicating the degree to which it belongs to the fuzzy set. Based on the patterns of angular velocity and magnetic field changes, rules are defined that link input conditions to corresponding output events, and the rules are applied using an If conditional structure. During the fuzzy inference process, each input variable is first fuzzified using a membership function, and its degree of membership to each membership function is calculated. The membership of the input variables is then evaluated according to fuzzy logic rules, and the activation level of each rule is calculated, determined by taking the minimum value of the membership conditional component.
[0040] The fuzzy logic system algorithm flow is as follows: Input: Angular velocity ( )、 .
[0041] Initialization: Angular velocity threshold ( )、 .
[0042] Membership function: 、 .
[0043] Modeling: 、 、 、 .
[0044] Classification: if ,but ; Note: When the angular velocity change is greater than the angular velocity threshold, the angular velocity belongs to the high-fluctuation fuzzy set; if ,but ; Note: When the angular velocity change 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 is greater than the change threshold , then the magnetic field fluctuation amplitude variable belongs to the change fuzzy set; if ,but ; Note: When the change in magnetic field strength is less than the change threshold , then the magnetic field fluctuation amplitude variable belongs to the no-change fuzzy set; Fuzzy rules: if : If any ( ,or, ), the event type is "meaningless"; If all ( ,and, ), the event type is "meaningless"; If all ( ,and, ,and, ), the event type is "elevator"; if : If any ( ,or, ), the event type is "turn"; If all ( ,and, ), the event type is "turn".
[0045] Output: Event type and special index sequence.
[0046] Based on the above, it can be seen that when the change in angular velocity is small, the changes in the magnetic fields along the X and Y axes are large, and the change in the magnetic field along the Z axis is small, it indicates that the sudden magnetic field change encountered by the user in the indoor space is caused by the environment. When the change in angular velocity is small, but the changes in the magnetic fields along the X, Y, and Z axes are all large, it indicates that the user may be experiencing interference from an elevator. When the change in angular velocity is large, and the changes in the magnetic fields along the X and Y axes are large, but the change in the magnetic field along the Z axis is small, it indicates that the user is turning. Those skilled in the art will appreciate that elevators (particularly car-type elevators) are metal structures, and their screen doors, lifting cables, and internal wiring all have a significant impact 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 large, a comprehensive assessment can be made based on whether an elevator is present in the environment. In this embodiment, experiments have shown that when a user approaches an elevator, their magnetic field sensing is subject to significant interference. Therefore, the elevator and turning scenarios can be classified as meaningful magnetic field semantic information, while the other two scenarios can be classified as meaningless magnetic field semantic information. To distinguish between elevator events and turning events, we can record elevator events as the first meaningful magnetic field semantic information and turning events as the 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 impact on the magnetic field. Other devices located on the positioning trajectory that may interfere with the magnetic field strength detected by the nearby positioning device can also be classified as 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 principle, this application combines the inertial navigation system, magnetic field data, accelerometer data, gyroscope data, and corrects the state estimation through magnetic field semantic information such as turning position and elevator interference. In this application, the predicted state model and observation model of the system are defined as: ; ; ; in, is the prediction state model, is the observation model, is the observation matrix, is the observation noise.
[0048] According to Kalman filter theory, a discrete-time method is needed to describe the evolution of the system state. The state prediction is based on the state at the previous moment and the current control input. The state prediction equation is: ; in, is the first state; is the Jacobian matrix; is the control input matrix; is the control input, represents the second positioning data predicted by the extended Kalman filter; ; in, is a 3*3 identity matrix; Represents the Jacobian matrix in state prediction, which is used to map the state at the previous moment to the current moment and serve the prediction (time state) update; ; Control Input Matrix Used to describe the effect of control input on the state; The above state prediction equation is calculated Positioning prediction based on Kalman filter is only necessary based on the previous event type. Make corrections, the specific correction formula is as follows: ; in, is the actual observed value; is the observation function, represents the observation value calculated according to the second state when the observation noise is 0; is the Kalman gain; The difference between the actual observation value and the expected measurement value is called the residual, which is obtained by The correction factor is obtained by weighting.
[0049] To calculate the Kalman gain, we first need to calculate the error covariance
[0050] ; in, is the error covariance matrix of the previous filtering process iteration; is the process noise covariance matrix; is a discrete time matrix; Based on the above quaternion formula, we can get: ; = .
[0051] The Kalman gain calculation formula is: ; in, The measurement noise covariance matrix represents the size and characteristics of the noise related to the observation process, reflects the reliability or accuracy of the measurement data, and is usually obtained through experiments. is the observation matrix, which describes the mapping relationship from the system state space to the observation space. is the noise matrix, which describes how the noise propagates in the system and is used to correlate the measurement noise matrix and the system noise matrix.
[0052] The error covariance matrix at the current moment is specifically: .
[0053] This paper identifies semantic index sequences of magnetic field environments and dynamically adjusts the entire system when utilizing magnetic field information. By extracting semantic information from environmental perception, the noise environment during target motion can be more accurately estimated. Specifically, when a target passes through an elevator area, walks normally, and turns, the system's measurement noise varies significantly, requiring a new definition of the measurement noise covariance matrix. ,include: ; That is, the measurement noise covariance matrix is dynamically adjusted, and the measurement noise covariance matrix Determines the effect of observation noise on the Kalman gain The Kalman gain further affects the influence of the correction parameters on the positioning system. is smaller, indicating that the uncertainty of the observation data is higher, and the Kalman filter relies more on the prediction of the system model; on the contrary, if the Kalman gain The larger the value, the more accurate the observation data is, and the Kalman filter pays more attention to the observation data when correcting the state estimate.
[0054] Correspondingly, the formula of Kalman gain changes to: ; By calculating the Jacobian matrix of the magnetometer observation quaternion, it is helpful to understand how the magnetic field changes affect the system attitude and correct the system state. Each variable in the state vector is mapped to the observation space through the Jacobian matrix. This paper calculates the mapping relationship of variables through the Jacobian matrix, so the influence of the magnetic field on the system direction estimation is modeled by the Jacobian matrix. The influence of the magnetic field on the quaternion is represented by the Jacobian matrix. Modeling.
[0055] ; Represents the Jacobian matrix acting on the observation model for calculating the magnetometer observation quaternion. It is used to describe the relationship between the magnetometer measurement and the system state and serves the observation (measurement) update.
[0056] When the event is the first meaningful magnetic field semantic information (that is, the elevator), the magnetic field is severely disturbed and becomes an interference factor for state estimation, so it is necessary to increase the measurement noise matrix , minimize the Kalman gain , reducing the correction of the observed value to the predicted value during the correction process, that is, making the final result closer to the second positioning data. Specifically: ; ; in, is the identity matrix; is the error covariance, is the observation matrix, represents the Kalman gain in the case of the elevator event.
[0057] When the event is the second meaningful magnetic field semantic information (i.e., turning), the magnetic field is not seriously disturbed, so the observation value can be used as reliable data to correct the second positioning data. The turning position observation value is: ; in, and is the horizontal two-dimensional coordinate position measured with millimeter-level accuracy in the experiment, is the column vector of the multidimensional matrix that reflects the real state of the system at the turning position; At the current moment, the state vector obtained by predicting the data measured by the accelerometer, gyroscope and magnetic field meter contains a total of 16 elements: a 3-element position vector, a 3-element velocity vector, a quaternion attitude, a 3-element acceleration deviation and a 3-element angular velocity deviation. Therefore, the state vector contains 16 variables. The system state vector is obtained through the observation matrix Mapped to the observation space, and the state estimate is corrected by calculating the difference between the predicted observation value and the actual observation value (such as the observation residual). Among them, the observation matrix corresponding to the turning event is Specifically: ; Among them, the observation matrix The number of elements in the horizontal direction is 16, corresponding to the number of state vectors.
[0058] Turn position pair measurement noise covariance matrix Specifically: ; In this embodiment, the measurement noise covariance matrix Used to adjust the reliability of observations; by reducing the measurement noise covariance matrix The value of makes the Kalman gain larger, which in turn makes the influence of the observation value on the prediction value larger.
[0059] During a turning event, the Kalman gain becomes: ; Based on the above Kalman gain, the second positioning data is corrected to obtain the third positioning data, the specific formula of which is: .
[0060] When the magnetic field semantic information of the magnetic field change is meaningless, it means that the change of the ambient magnetic field is caused by environmental factors and has nothing to do with the user's actions. Therefore, the inertial measurement unit is directly used 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 influence of magnetic field mutation on positioning accuracy.
[0061] Example 2 See also Figure 2 , an extended Kalman filter inertial navigation device based on magnetic semantics, the extended Kalman filter inertial navigation device based on magnetic semantics includes: Acquisition unit 1, used to obtain acceleration measurement values, angular velocity measurement values and magnetic field strength measurement values; An updating unit 2 is configured to update the first positioning data using an extended Kalman filter based on the acceleration measurement value and the angular velocity measurement value to obtain second positioning data; wherein the first positioning data is positioning data of a previous unit time; A prediction unit 3 is configured to extract magnetic field semantic information based on the angular velocity measurement value and the magnetic field intensity measurement value; the magnetic field semantic information includes meaningful magnetic field semantic information and meaningless magnetic field semantic information, wherein the meaningful magnetic field semantic information is associated with a user action, and the meaningless magnetic field semantic information is not associated with the user action; The correction unit 4 is used to generate current positioning data based on the magnetic field semantic information and the second positioning data, wherein when the magnetic field semantic information is meaningless magnetic field semantic information, the second positioning data is used as the current positioning data; when the magnetic field semantic information is meaningful magnetic field semantic information, 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] For the specific definition of the extended Kalman filter inertial navigation device based on magnetic semantics, please refer to the definition of the extended Kalman filter inertial navigation method based on magnetic semantics above, which will not be repeated here. The various modules in the above-mentioned extended Kalman filter inertial navigation device based on magnetic semantics can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0063] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation of the present application scheme. The specific extended Kalman filter inertial navigation device based on magnetic semantics may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. Example 3 A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the extended Kalman filter inertial navigation method based on magnetic semantics as described in Example 1.
[0064] Example 4 In one embodiment, a computer device is provided. The computer device 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 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program 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 example further provides an experimental verification process. This example uses an Xsens MTi-3 inertial sensor manufactured in the Netherlands, secured to the user's chest via a black elastic band, to collect acceleration, angular velocity, and magnetic field strength data. Table 1 lists the parameters associated with the Xsens MTi-3. A laptop computer is also provided to store the data. Figure 9 The user walks along a pre-planned 12m×34.2m path and collects data using a body-mounted Xsens MTi-3 sensor.
[0066]
[0067] Table 1: Sensor specifications This embodiment also performs a visual analysis of the user trajectory on the MATLAB 2023 simulation software. Figure 10As shown in the figure, the magnetic field environment semantic information of this application is analyzed and verified by combining angular velocity changes and magnetic field mutations. The first row shows the Z-axis angular velocity measurements, and the second, third, and fourth rows show the X-axis magnetic field components, Y-axis magnetic field components, and Z-axis magnetic field components, respectively. The high fluctuations in angular velocity, highlighted in the red box in the figure, indicate that the user is turning. During this period, a sudden change in the X-axis or Y-axis component of the magnetic field verifies that the carrier coordinate system has changed due to the user's turning, 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 sudden 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 turning. 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 associated with turning motion only occurs in the horizontal plane 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, it is indeed subject to strong external magnetic interference, which is consistent with the situation when the user walks past an elevator. Therefore, when the three-axis component vectors of the magnetic field undergo a sudden change, it can be determined that the user has passed through an elevator interference area. While walking, the magnetic field may also undergo some meaningless changes due to body sway or interference from ambient noise, such as the change in magnetic field intensity shown in the second pink box. Furthermore, these meaningless changes correspond to low fluctuations in angular velocity, indicating that the user is walking normally.
[0068] The root mean square error (RMSE) is a measure of the error between the predicted value and the true value and is used to evaluate the accuracy of the model.
[0069] ; For each sampling point, the error between the predicted value and the true value is calculated Finally, take the average of all square errors, that is, calculate the mean square error of all sampling points. Figure 11 As shown by the light blue trajectory line in , the classic IMU-based non-magnetic INS indoor positioning algorithm cannot eliminate the cumulative error caused by the introduction of reference information, resulting in a large trajectory drift. Figure 11As shown by the green trajectory line in the figure, the positioning algorithm based on the magnetic field assisted inertial navigation system has large errors in magnetic field information due to severe interference from the magnetic field, resulting in poor positioning results. Especially at the starting point, the elevator has a strong interference source, and the magnetic field information is severely interfered with, resulting in a large initial heading deviation. The inertial navigation positioning algorithm based on the assistance of magnetic field environment semantic information proposed in this paper eliminates the magnetic interference information well, and effectively eliminates the interference of cumulative errors in combination with angle information, 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, which is controlled within 1 meter. By Figure 12 From the analysis, it can be seen that the positioning algorithm proposed in this paper has smaller cumulative error and higher 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 embodiment. All technical solutions based on the concept of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. The extended Kalman filter inertial navigation method based on magnetic semantics is characterized by: include: Obtain acceleration measurements, angular velocity measurements, 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 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 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 action, and the meaningless magnetic field semantic information is not associated with the user action; Based on the magnetic field semantic information and the second positioning data, current positioning data is generated, wherein when the magnetic field semantic information is meaningless magnetic field semantic information, the second positioning data is used as the current positioning data; when the magnetic field semantic information is meaningful magnetic field semantic information, 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 acquiring the acceleration measurement value, the angular velocity measurement value, and the magnetic field strength measurement value, the method further includes: performing noise reduction processing on the magnetic field strength measurement value using a Gaussian kernel function to generate a smoothed magnetic field strength measurement value; The extracting of magnetic field semantic information based on the angular velocity measurement value and the magnetic field strength measurement value specifically includes: calculating a magnetic field strength change value based on the smoothed magnetic field strength measurement value; and extracting magnetic field semantic information based on the angular velocity measurement value and the magnetic field strength change value.
3. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 2, characterized in that: The extracting of magnetic field semantic information based on the angular velocity measurement value and the magnetic field intensity change value specifically includes: when ,or When , the magnetic field semantic information is meaningless magnetic field semantic information; when ,or ,or When , the magnetic field semantic information is meaningful magnetic field semantic information; in, represents the angular velocity measurement value, represents the angular velocity low fluctuation fuzzy set, represents the fuzzy set with high fluctuation of angular velocity, Represents the projection component of the magnetic field intensity change value on the X-axis; Represents the projection component of the magnetic field intensity change value on the Y axis; Represents the projection component of the magnetic field intensity change value on the Z axis; represents the fuzzy set of X-axis magnetic field variation; represents the fuzzy set of Y-axis magnetic field change; Represents the fuzzy set of Z-axis magnetic field change.
4. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 3, characterized in that: When ,or ,or , then the magnetic field semantic information is meaningful magnetic field semantic information, specifically including: when When , the magnetic field semantic information is the first meaningful magnetic field semantic information; when ,or When , the magnetic field semantic information is the second meaningful magnetic field semantic information.
5. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 4, characterized in that: The correcting the second positioning data based on the magnetic field semantic information to generate third positioning data specifically includes: The second positioning data is specifically: ; in, is the first state; is the Jacobian matrix; is the control input matrix; is the control input, represents the second positioning data predicted by the extended Kalman filter; Correcting the second positioning data to generate third positioning data includes: ; in, is the actual observed value; is the observation function, represents the observation value calculated according to the second state when the observation noise is 0; is the Kalman gain; It is the third positioning data.
6. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 5, characterized in that: When the magnetic field semantic information is the first meaningful magnetic field semantic information, the Kalman gain Specifically: ; ; in, is the identity matrix; is the error covariance, is the observation matrix.
7. The extended Kalman filter inertial navigation method based on magnetic semantics according to claim 5, characterized in that: When the magnetic field semantic information is second meaningful magnetic field semantic information, the 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, , is the identity matrix; is the error covariance, is the observation matrix.
8. An extended Kalman filter inertial navigation device based on magnetic semantics, characterized in that: The device comprises: an acquisition unit, configured to acquire acceleration measurement values, angular velocity measurement values, and magnetic field strength measurement values; an updating unit, configured to update the first positioning data using an extended Kalman filter based on the acceleration measurement value and the angular velocity measurement value to obtain second positioning data; wherein the first positioning data is positioning data of a previous unit time; a prediction unit, configured to extract magnetic field semantic information based on the angular velocity measurement value and the magnetic field intensity measurement value, wherein the magnetic field semantic information includes meaningful magnetic field semantic information and meaningless magnetic field semantic information, wherein the meaningful magnetic field semantic information is associated with a user action, and the meaningless magnetic field semantic information is not associated with the user action; A correction unit is used to generate current positioning data based on the magnetic field semantic information and the second positioning data, wherein when the magnetic field semantic information is meaningless magnetic field semantic information, the second positioning data is used as the current positioning data; when the magnetic field semantic information is meaningful magnetic field semantic information, 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.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the extended Kalman filter inertial navigation method based on magnetic semantics as described in any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the extended Kalman filter inertial navigation method based on magnetic semantics is implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Pedestrian navigation method based on inertia, magnetic heading and zero-speed correction
CN110553646A
Attitude and heading reference system algorithm based on improved adaptive Kalman filtering
CN112013836A
Target tracking method based on variable structure T-S fuzzy semantic model and related device
CN114445449A
Multi-source fusion positioning method and system based on multi-module BLE transmitting device
CN116678421A
Indoor positioning method based on pedestrian inertial navigation and map
CN118603085A