Positioning method based on geomagnetic signal, medium and equipment
Through the positioning method based on geomagnetic signals, the velocity compensation factor is calculated using the initial velocity and linear acceleration, and the geomagnetic signal data is adjusted, the problem of limited accuracy in harsh environments of traditional positioning technology is solved, and higher positioning accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510027422.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing positioning technology is prone to signal blockage in scenarios such as high-rise buildings, tunnels, and severe weather, and is limited in accuracy, making it difficult to meet the specific scenario requirements with high requirements for positioning accuracy.
The positioning method based on the geomagnetic signal is adopted, by obtaining the user's initial velocity and multiple linear accelerations, the discrete time velocity is calculated, and the speed compensation factor is calculated based on the preset constant speed, and the geomagnetic signal data can be adjusted so that it can simulate the changes when moving at the preset constant speed, and the preset bit model is input to obtain the user's position information.
It improves the reliability and accuracy of positioning technology and can output more accurate user location information in scenarios where traditional positioning technology is difficult to work.
Smart Images

Figure CN119714263A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of geomagnetic positioning, and in particular to a positioning method, medium and device based on geomagnetic signals. Background Art
[0002] In modern society, positioning technology has been deeply integrated into people's lives and many industries. Transportation relies on positioning to achieve accurate navigation, logistics and distribution use it to track the trajectory of goods, and smart city construction is inseparable from the support of positioning for resource, environmental and safety management. However, the commonly used GPS and Beidou systems are easily blocked in scenes such as high-rise buildings, tunnels, and bad weather, and the accuracy is limited. Differential enhancement technology cannot completely solve the problem. Although multi-sensor fusion has emerged, it faces challenges such as complex data fusion, high cost, and stability and compatibility.
[0003] Positioning is particularly difficult in special environments. In large indoor places such as shopping malls and airports, the GPS signal is weak, making it difficult to meet the needs of personnel navigation and precision marketing for businesses; in underground mines, the GPS signal is missing, making it impossible to monitor the safety of personnel and equipment in real time; in large buildings such as hospitals and factories, the internal structure is complex and highly shielded, making it difficult to accurately locate staff and equipment.
[0004] Therefore, how to improve the reliability of positioning technology has become a problem that needs to be solved.
[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of this application is to provide a positioning method, medium and device based on geomagnetic signals, aiming to solve the technical problem of low reliability of positioning technology.
[0007] To achieve the above-mentioned purpose, the present application provides a positioning method based on geomagnetic signals, which obtains the user's initial velocity and multiple linear accelerations; calculates the initial velocity and multiple linear accelerations based on a velocity calculation formula to obtain a discrete time velocity; calculates multiple velocity compensation factors corresponding to the discrete velocity based on a preset constant velocity, wherein the preset constant velocity is the velocity of geomagnetic information used to train a preset positioning model; obtains geomagnetic signal data at the same time as the multiple linear accelerations, adjusts the geomagnetic signal data according to the multiple velocity compensation factors, and obtains standard geomagnetic signal data; inputs the standard geomagnetic signal data into the preset positioning model to obtain user location information.
[0008] Optionally, before inputting the standard geomagnetic signal data into a preset positioning model to obtain the user location information, the method also includes: obtaining geomagnetic information, the geomagnetic information including three-dimensional geomagnetic data and geomagnetic coordinate data; calculating the modulus of the three-dimensional geomagnetic data, and incorporating the modulus into a feature set to generate four-dimensional geomagnetic data; preprocessing the four-dimensional geomagnetic data to obtain standard four-dimensional geomagnetic data, the preprocessing at least including sliding window processing; inputting the standard four-dimensional geomagnetic data into an initial positioning model for training to obtain a preset positioning model, so as to obtain the user location information through the preset positioning model.
[0009] Optionally, before inputting the standard four-dimensional geomagnetic data into the initial positioning model for training to obtain a preset positioning model, the method also includes: setting an initial positioning model structure, the initial positioning model structure including a first GRU unit, an Attention unit, a second GRU unit, and a fully connected layer; wherein the first GRU unit is used to output a first geomagnetic hidden state sequence according to the dependency relationship of the standard four-dimensional geomagnetic data; the Attention unit is used to perform weighted sum calculation on the first geomagnetic hidden state sequence to obtain a context vector; the second GRU unit is used to combine the context vector and the first geomagnetic hidden state sequence, and process the combined context vector and the first geomagnetic hidden state sequence to obtain a second geomagnetic hidden state sequence; the fully connected layer is used to output user location information according to the second geomagnetic hidden state sequence.
[0010] Optionally, the first GRU unit and the second GRU unit both include a reset gate and an update gate.
[0011] Optionally, before obtaining geomagnetic information, the method also includes: obtaining position coordinate information of a preset path, the position coordinate information including path key point information and path distance information; collecting three-dimensional geomagnetic data on the preset path at a preset constant speed; storing data according to the correspondence between three-dimensional geomagnetic data and geomagnetic coordinate data to obtain geomagnetic information.
[0012] Optionally, before inputting the standard geomagnetic signal data into a preset positioning model to obtain user location information, the method also includes: calculating the module length of the standard geomagnetic signal data and expanding the standard geomagnetic signal data into four-dimensional geomagnetic signal data; processing the four-dimensional geomagnetic signal data according to a preset window value to obtain a four-dimensional geomagnetic signal matrix, and using the four-dimensional geomagnetic signal matrix as standard geomagnetic signal data, inputting the preset positioning model to obtain user location information.
[0013] Optionally, before obtaining the user's initial velocity and linear acceleration, the method also includes: obtaining multiple three-dimensional acceleration data of the user within a preset time integral through an accelerometer; inputting the multiple three-dimensional acceleration data into a preset linear acceleration model for calculation to obtain multiple linear accelerations, and the preset linear acceleration model is used to delete error data in the three-dimensional acceleration data.
[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a terminal device, which includes: an acquisition module, used to obtain the user's initial velocity and multiple linear accelerations; a first calculation module, used to calculate the initial velocity and multiple linear accelerations based on the velocity calculation formula to obtain a discrete time velocity; a second calculation module, used to calculate multiple velocity compensation factors corresponding to the discrete velocity based on a preset constant velocity, the preset constant velocity is the velocity of the geomagnetic information used to train a preset positioning model; an adjustment module, used to obtain geomagnetic signal data at the same time as the multiple linear accelerations, and adjust the geomagnetic signal data according to multiple velocity compensation factors to obtain standard geomagnetic signal data; a positioning module, used to input the standard geomagnetic signal data into a preset positioning model to obtain user location information.
[0015] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as in the first aspect.
[0016] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, a method as described in any one of the first aspects is executed.
[0017] The positioning method based on geomagnetic signals provided in the embodiment of the present application calculates the user's discrete time speed according to the user's initial speed and multiple linear accelerations, and then calculates multiple speed compensation factors of the discrete time speed and the preset constant speed. The geomagnetic signal data is adjusted according to the multiple speed compensation factors so that the adjusted standard geomagnetic data can simulate the changes when moving at a preset constant speed, which can improve the reliability of the positioning results of the preset positioning model, thereby outputting more accurate user location information. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The embodiment of the present application provides a data interaction flow chart; Figure 2 is a flow chart of positioning based on geomagnetic signals disclosed in an embodiment of the present application; Figure 3 It is a comparison diagram of the actual and preset coordinates disclosed in the embodiment of the present application; Figure 4 It is a structural schematic diagram of a terminal device disclosed in an embodiment of the present application; Figure 5 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0022] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0023] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "and / or" appearing in the full text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme that satisfies both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0024] In today's digital age, positioning technology plays an indispensable and key role in many fields, and has a profound impact on people's lives and the development of various industries. In daily life, positioning technology has greatly facilitated people's travel. Whether it is using map navigation software to find the best route to the destination, or conveniently calling a car through online car-hailing services, or the logistics industry's precise positioning and tracking of goods during transportation, positioning technology has been deeply integrated into it.
[0025] However, existing mainstream positioning technologies, such as the Global Positioning System (GPS) and the BeiDou system, play an important role in a wide range of application scenarios. However, they often experience signal obstruction in urban environments with tall buildings, tunnels where signals are difficult to penetrate, and in severe weather conditions, resulting in a significant decrease in positioning accuracy. Even with the use of differential enhancement technology, it is still difficult to break through the bottleneck of limited accuracy and cannot meet the needs of some specific scenarios that require extremely high positioning accuracy. For example, in the field of autonomous driving, vehicles require positioning accuracy to the centimeter or even millimeter level to ensure driving safety and accurate path planning; in precision agriculture, precise fertilization and irrigation of crops in farmland also require high-precision positioning to determine the specific location.
[0026] In order to overcome these limitations, multi-sensor fusion technology came into being. This technology integrates various types of positioning methods such as wireless networks, visual positioning, inertial navigation, etc., gives full play to their respective advantages, and is committed to achieving high-precision and high-reliability positioning under diverse environmental conditions. However, multi-sensor fusion technology also faces many challenges, such as complex data fusion algorithms between different sensors, high costs, and system stability and compatibility.
[0027] Therefore, seeking a new positioning method to achieve high-precision positioning in a wider range of environments, reduce costs and improve system stability has become a key issue that needs to be urgently addressed in the field of positioning technology.
[0028] To this end, this application proposes a positioning method based on geomagnetic signals, which can be applied to the positioning scenario based on geomagnetic signals. Figure 1 , Figure 1 This is a flow chart provided by the embodiment of the present application. Figure 1In the process shown, after pre-configuring the path information, the collector moves along the path at a constant speed through the first terminal device, and the device magnetic sensor collects the three-axis intensity amplitude (x, y, z axis) of the geomagnetic signal. According to the path information, a two-dimensional spatial location label is added to the geomagnetic data, and the data is associated with the geographic location. The sorted data is packaged in JSON format and sent to the server. The server receives and saves the JSON format data packet sent by the first terminal device, and pre-processes the collected geomagnetic data through Kalman filtering, dimension expansion, normalization, and sliding window processing to prepare suitable data for model training. A two-layer GRU model based on the Attention mechanism is used. The first GRU layer learns the basic time pattern and short-term dependency, the Attention layer highlights the key information, and the second GRU extracts the long-term dependency and high-level pattern. Finally, the fully connected layer outputs the spatial position coordinates to form a preset positioning model. The second terminal device collects geomagnetic signals and motion status data, performs speed compensation based on the collector's speed, and then obtains data consistent with the preset positioning model training data format through Kalman filtering, dimensionality expansion, normalization, and sliding window processing. The processed data is then sent to the server. The server processes the data sent by the second terminal device through the preset positioning model, obtains user location information, and sends the user location information to the second terminal device.
[0029] It should be understood that the first terminal device and the second terminal device include devices capable of collecting geomagnetic information and motion status, such as magnetic sensors and inertial sensors. In addition, the operations performed by the first terminal device, the server, and the second terminal device can also be completed by any one of the devices, and this application does not make specific limitations on this.
[0030] based on Figure 1 Please continue to refer to the application scenarios shown in Figure 2 , Figure 2 This is a process of a positioning method based on geomagnetic signals provided in an embodiment of the present application. The positioning method based on geomagnetic signals can be applied to any terminal device that can run a program.
[0031] The following, combined Figure 2 A positioning method based on geomagnetic signals in an embodiment of the present application is described in detail.
[0032] Step S201: Obtain the user's initial velocity and multiple linear accelerations.
[0033] The multiple linear accelerations are used to represent the linear acceleration data acquired at a set frequency within a preset time period.
[0034] In an optional embodiment, before obtaining the user's initial velocity and linear acceleration, the method also includes: obtaining multiple three-dimensional acceleration data of the user within a preset time integral through an accelerometer; inputting the multiple three-dimensional acceleration data into a preset linear acceleration model for calculation to obtain multiple linear accelerations, and the preset linear acceleration model is used to delete error data in the three-dimensional acceleration data.
[0035] For example, the accelerometer collects the user's three-dimensional acceleration data within a preset time integration (for example, 2 seconds), and collects the user's acceleration values in three directions (such as: 0.1, 0.05, -9.85). The acceleration data in each direction contains information such as the acceleration generated by the user's movement, gravity acceleration, accelerometer's own zero bias and noise. The collected three-dimensional acceleration data is input into the preset linear acceleration model For processing. is the measured linear acceleration, is the actual linear acceleration, is the acceleration due to gravity, is the zero bias of the accelerometer, The gravity component is noise. The real user linear acceleration can be obtained by removing the gravity component. When removing the gravity component to obtain the real user linear acceleration, take the Z direction as an example, subtract the gravity acceleration 9.81 from the Z direction acceleration value. , get the initial acceleration value after removing gravity. Then, consider the zero bias and noise of the accelerometer. The zero bias of the accelerometer is estimated by measuring the average value of acceleration multiple times when the terminal device is stationary; for noise, a filtering algorithm is used to remove it. After the above processing, the linear acceleration value is obtained (such as 0.1).
[0036] In this embodiment, by presetting the linear acceleration model, the gravity component can be removed to avoid the interference of gravity on the acceleration measurement; and by zero bias compensation, the constant deviation of the accelerometer can be eliminated, making the calculated linear acceleration closer to the true value, thereby improving the stability and reliability of the data.
[0037] The initial speed refers to the speed at the first moment of the time period represented by the preset time integral. In the embodiment of the present application, the speed of the user at the first moment is 0.
[0038] Step S202: Calculate the initial velocity and multiple linear accelerations based on the velocity calculation formula to obtain discrete time velocity.
[0039] Discrete time speed is used to represent multiple speeds within a preset time integral by the user.
[0040] Combined with the above example, the calculation formula , = 0.1 seconds as an example, calculate the time step The speed at which =0+0.1 0.1=0.01 Using the same calculation method, calculate the velocity corresponding to the linear acceleration of other time steps to obtain the discrete time velocity.
[0041] Step S203: Calculate multiple speed compensation factors corresponding to discrete speeds based on a preset constant speed, where the preset constant speed is the speed of geomagnetic information used to train a preset positioning model, and the geomagnetic information includes three-dimensional geomagnetic data and geomagnetic coordinate data.
[0042] The preset constant speed can be the speed at which the collector collects geomagnetic information at a constant speed along the preset path, and the preset positioning model is trained based on the collected geomagnetic information. =0.05 Example.
[0043] According to the speed compensation factor calculation formula , when the calculation time step is k=1, the speed compensation factor is = 5. Similarly, the compensation factors corresponding to other speeds are calculated using the same calculation method to obtain multiple speed compensation factors.
[0044] Step S204: obtaining geomagnetic signal data at the same time as the multiple linear accelerations, adjusting the geomagnetic signal data according to multiple speed compensation factors, and obtaining standard geomagnetic signal data.
[0045] The geomagnetic signal data is data used to represent the strength of geomagnetic information. Optionally, when collecting the user's acceleration through the terminal device, the geomagnetic signal data can also be collected through the magnetic sensor. After the geomagnetic signal data is collected through the magnetic sensor, the geomagnetic signal data is processed through Kalman filtering to reduce interference data in the geomagnetic signal.
[0046] Combined with the above example, when the time step is k=1, the collected geomagnetic signal data is (10.0, 20.0, 30.0), and the corresponding velocity compensation factor is 5. Adjust the geomagnetic data when the time step is k=1 to obtain standard geomagnetic signal data (50.0, 100.0, 150.0). These standard geomagnetic signal data are the results after speed compensation, and their change pattern is closer to the situation when moving at a preset constant speed.
[0047] Step S205: input the standard geomagnetic signal data into a preset positioning model to obtain user location information.
[0048] The preset positioning model is a machine learning model that can determine location information based on standard geomagnetic signal data.
[0049] The positioning method based on geomagnetic signals provided in the embodiment of the present application calculates the user's discrete time speed according to the user's initial speed and multiple linear accelerations, and then calculates multiple speed compensation factors of the discrete time speed and the preset constant speed. The geomagnetic signal data is adjusted according to the multiple speed compensation factors so that the adjusted standard geomagnetic data can simulate the changes when moving at a preset constant speed, which can improve the reliability of the positioning results of the preset positioning model, thereby outputting more accurate user location information.
[0050] In an optional embodiment, before inputting the standard geomagnetic signal data into a preset positioning model to obtain user location information, the method also includes: calculating the module length of the standard geomagnetic signal data and expanding the standard geomagnetic signal data into four-dimensional geomagnetic signal data; processing the four-dimensional geomagnetic signal data according to a preset window value to obtain a four-dimensional geomagnetic signal matrix, and using the four-dimensional geomagnetic signal matrix as standard geomagnetic signal data, inputting the preset positioning model to obtain user location information.
[0051] Combined with the above example, when the time step is k=1, the geomagnetic signal data is (10.0, 20.0, 30.0), based on the vector modulus Calculate the modulus when k=1 and get 180.28, incorporated into the feature set to form a four-dimensional vector (50.0, 100.0, 150.0, 180.28).
[0052] In this embodiment, by calculating the module length of the standard geomagnetic signal data and expanding it into four-dimensional data, the geomagnetic signal characteristics can be more comprehensively characterized, the expressiveness of the geomagnetic data can be enhanced, and the preset positioning model can learn the relationship between the geomagnetic signal and the position from more dimensions, thereby improving the accuracy of the positioning results.
[0053] In an optional embodiment, before inputting the standard geomagnetic signal data into a preset positioning model to obtain the user location information, the method also includes: obtaining geomagnetic information, the geomagnetic information including three-dimensional geomagnetic data and geomagnetic coordinate data; calculating the modulus of the three-dimensional geomagnetic data, and incorporating the modulus into a feature set to generate four-dimensional geomagnetic data; preprocessing the four-dimensional geomagnetic data to obtain standard four-dimensional geomagnetic data, the preprocessing at least including sliding window processing; inputting the standard four-dimensional geomagnetic data into an initial positioning model for training to obtain a preset positioning model, so as to obtain the user location information through the preset positioning model.
[0054] The initial positioning model is any untrained machine learning model, and this application does not make any specific limitations on this.
[0055] It is easy to understand that the geomagnetic information is data collected based on the above-mentioned preset constant speed, including three-dimensional geomagnetic data and geomagnetic coordinate data, and the three-dimensional geomagnetic data and geomagnetic coordinate data have a one-to-one correspondence.
[0056] Optionally, the preprocessing may also include normalization processing. For example, according to the normalization formula and The above four-dimensional vector The component values of are scaled to the range of [0, 1] to balance the weights of each feature dimension and improve the training effect and positioning accuracy of the subsequent positioning model. , It is used to indicate the geomagnetic signal strength of the collected three-dimensional geomagnetic data on the x-axis, y-axis and z-axis respectively; , They are used to represent the normalized values of the geomagnetic signal strengths of the x-axis, y-axis, and z-axis respectively; It is used to represent the normalized value of the vector modulus of the three-dimensional geomagnetic signal; The minimum value of the vector modulus used to represent the three-dimensional geomagnetic signal; The maximum value of the vector modulus used to represent the three-dimensional geomagnetic signal.
[0057] Exemplarily, the acquired geomagnetic information is shown in Table 1:
[0058] The modulus of the three-dimensional geomagnetic data was calculated, and the four-dimensional geomagnetic data were obtained [(6.1875, -27.0563, -45.15, 38.64), (6.1875, -27.0563, -45.15, 38.64), (5.8875, -29.7, -43.9688, 42.01), (6.2063, -31.7438, -42.8813, 45.02), (6.2063, -31.7438, -42.8813, 45.02)]. According to the above normalization method, normalization processing is performed to obtain [(0.94, -0.13, -0.12, 0.00), (0.94, -0.13, -0.12, 0.00), (0.00, -1.00, -0.90, 0.73), (1.00, -0.10, -0.00, 1.00), (1.00, -0.10, -0.00, 1.00)]. Assuming that the sliding window W = 4, starting from the 4th row of data, the normalized four-dimensional geomagnetic data is processed by sliding window, and the results are [(1.00, -0.10, -0.00, 1.00), (1.00, -0.10, - The sliding window is [(0.94, -0.13, -0.12, 0.00), (0.00, -1.00, -0.90, 0.73), (1.00, -0.10, -0.00, 1.00)], and so on, until all the data are processed and the standard four-dimensional geomagnetic data is obtained, the standard four-dimensional geomagnetic data is input into the initial positioning model for training to obtain the preset positioning model, and the user location information is obtained through the preset positioning model.
[0059] In this implementation, sliding window processing allows the model to effectively capture the time dependence and periodic characteristics of geomagnetic signals during training, which helps to learn complex signal change patterns, thereby improving the preset positioning model's understanding and positioning capabilities of geomagnetic signals in various actual scenarios, making the user location information obtained by the preset positioning model more accurate and reliable.
[0060] In an optional embodiment, before inputting the standard four-dimensional geomagnetic data into the initial positioning model for training to obtain a preset positioning model, the method also includes: constructing an initial positioning model, the initial positioning model structure including a first GRU unit, an Attention unit, a second GRU unit, and a fully connected layer; wherein the first GRU unit is used to output a first geomagnetic hidden state sequence according to the dependency relationship of the standard four-dimensional geomagnetic data; the Attention unit is used to perform weighted sum calculation on the first geomagnetic hidden state sequence to obtain a context vector; the second GRU unit is used to combine the context vector and the first geomagnetic hidden state sequence, and process the combined context vector and the first geomagnetic hidden state sequence to obtain a second geomagnetic hidden state sequence; the fully connected layer is used to output user location information according to the second geomagnetic hidden state sequence.
[0061] Combined with the above example, there is already normalized four-dimensional geomagnetic data (assuming sliding window W=4), and sliding window processing starts from the 4th row of data. The four-dimensional geomagnetic signal matrix corresponding to the first window is: [(1.00, -0.10, -0.00, 1.00), (1.00, -0.10, -0.00, 1.00), (0.00, -1.00, -0.90, 0.73), (0.94, -0.13, -0.12, 0.00)], this matrix will be used as the first GRU The first GRU unit receives the four-dimensional geomagnetic signal matrix after sliding window processing. At the initial moment, the hidden state of GRU can be initialized to a full zero tensor or a random tensor. For each time step, the GRU unit calculates the hidden state at the current moment based on the normalized four-dimensional geomagnetic data corresponding to each time step in the window and the hidden state at the previous moment. The calculation process involves the weight matrix and bias vector of the GRU unit. After processing the entire window, the first GRU unit outputs the first geomagnetic hidden state sequence. This hidden state sequence contains the short-term dependency relationship and basic time pattern learning results of the input geomagnetic signal sequence. Each hidden state vector encodes the geomagnetic signal information from the beginning of the window to the current time step. The Attention unit linearly transforms the hidden sequence through the weight matrix and bias vector, calculates the weight based on the linear transformation result, and then weights the first hidden state sequence according to the calculated weight value to obtain the context vector. The context vector reflects the most influential part of the geomagnetic information on the user's location information. The second GRU unit takes the context vector generated by the Attention unit and the first geomagnetic hidden state sequence output by the first GRU unit as input, and obtains the second geomagnetic hidden state sequence in a similar manner to the processing steps of the first GRU unit (with the context vector added). The fully connected layer receives the second geomagnetic hidden state sequence output by the second GRU unit, converts the hidden state sequence into user location information through the learned weight matrix, and generates a preset positioning model.
[0062] In this implementation, the first GRU unit can effectively learn the short-term dependencies in the standard four-dimensional geomagnetic data, providing basic feature information for subsequent processing; the Attention unit highlights key information, allowing the model to focus on the signal features that are most important for positioning, thereby enhancing the effectiveness of the features; under the guidance of the Attention unit, the second GRU unit further mines long-term dependency features and high-level patterns, thereby improving the model's ability to understand the changing laws of complex geomagnetic signals; finally, the extracted deep features are transformed through the fully connected layer to determine the user's location information, so that the preset positioning model can meet a variety of positioning demand scenarios.
[0063] In an optional implementation, the first GRU unit and the second GRU unit both include a reset gate and an update gate.
[0064] The reset gate is responsible for determining whether the current information should affect the previous state. Its value is between 0 and 1, which is determined by the current input. and the previous hidden state pass The function is calculated. It can be obtained by the formula Indicates that yes function, and They are the weight matrix and bias term of the reset gate respectively.
[0065] Update Gate ): The update gate determines to what extent the newly generated hidden state should retain the old state information and to what extent it should be replaced by new information. It can be obtained by the formula Indicates that yes Function, used to generate a gating signal between 0 and 1. Candidate Hidden State, ): The candidate hidden state is a new temporary hidden state, which is calculated based on the current input and the previous hidden state adjusted by the reset gate. It can be obtained by the formula Represents, where tanh is a nonlinear activation function, and are the corresponding weights and biases. The final hidden state (Hidden State, ): Final hidden state is by passing the old hidden state and candidate hidden states Follow the update gate The formula is: express.
[0066] In this embodiment, the reset gate and the update gate respectively control the influence of the current moment information on the previous state and the fusion ratio of the old state information and the new information in the new hidden state, so that the model can effectively learn the time dependence and periodic characteristics in the geomagnetic signal and improve the accuracy of the positioning results of the predictive positioning model.
[0067] Optionally, after obtaining the preset positioning model, the positioning effect of the preset positioning model can also be tested. By collecting multiple test data, the test data is input into the preset positioning model to obtain Figure 3 The results are shown. By calculating the Euclidean distance between the predicted points and the true points, the average absolute error is within 1m.
[0068] In an optional embodiment, before obtaining geomagnetic information, the method also includes: obtaining position coordinate information of a preset path, the position coordinate information including path key point information and path distance information; collecting three-dimensional geomagnetic data on the preset path at a preset constant speed; storing data according to the correspondence between three-dimensional geomagnetic data and geomagnetic coordinate data to obtain geomagnetic information.
[0069] The key point information of a path is used to represent the characteristics of the path. For example, the key point information of a path includes the coordinates of important locations such as the starting point, turning point, and end point.
[0070] Path distance information is used to represent the distance between key points. For example, the starting point coordinates are (0,0), the first turning point coordinates are (10,5), 12 meters away from the starting point, the end point coordinates are (20,10), and the distance from the first turning point to the end point is 15 meters, etc.
[0071] For example, the user follows a preset constant speed (such as 0.05 ) Move the collection device (such as a mobile phone) on a preset path to collect three-dimensional geomagnetic data. During the movement, the device's geomagnetic sensor continuously collects geomagnetic intensity data on the x-axis, y-axis, and z-axis. For example, the data collected at a certain moment is (6.1875, -27.0563, -45.15, 38.64). During the collection process, the location coordinates of the device at the time of collection are determined through positioning technology (such as based on Wi-Fi or other indoor positioning auxiliary means), and the collected three-dimensional geomagnetic data is associated with the corresponding location coordinates and stored. For example, when the above-mentioned (6.1875, -27.0563, -45.15) data is collected, it is determined that the device location coordinates at this time are (205.5115, 110.6925), then this set of data is stored as part of the geomagnetic information for subsequent training and positioning calculation of the preset positioning model.
[0072] In this embodiment, data is collected at a preset constant speed, which ensures the consistency and regularity of data collection, facilitates the preset positioning model to learn the changing characteristics of geomagnetic signals under a stable moving state, and avoids interference with model training caused by abnormal changes in geomagnetic signals due to speed fluctuations.
[0073] It is understandable that the terminal device is required to achieve Figure 2 The functions described include hardware and / or software modules that perform the corresponding functions. In combination with the steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware 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 in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0074] In this embodiment, the terminal device can be divided into functional modules according to the above method example. For example, different functional modules can be divided according to different functions, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0075] In the case of dividing each functional module into corresponding functional modules, Figure 4 A possible schematic diagram of a terminal device 400 involved in the above embodiment is shown, and the terminal device 400 includes: an acquisition module 401, used to obtain the user's initial speed and multiple linear accelerations; a first calculation module 402, used to calculate the initial speed and multiple linear accelerations based on the speed calculation formula to obtain a discrete time speed; a second calculation module 403, used to calculate multiple speed compensation factors corresponding to the discrete speed based on a preset constant speed, and the preset constant speed is the speed of the geomagnetic information used to train a preset positioning model; an adjustment module 404, used to obtain geomagnetic signal data at the same time as the multiple linear accelerations, and adjust the geomagnetic signal data according to the multiple speed compensation factors to obtain standard geomagnetic signal data; a positioning module 405, used to input the standard geomagnetic signal data into the preset positioning model to obtain user location information.
[0076] In an optional implementation method of the embodiment of the present application, the positioning module 405 is also used to obtain geomagnetic information, which includes three-dimensional geomagnetic data and geomagnetic coordinate data; calculate the modulus of the three-dimensional geomagnetic data, and incorporate the modulus into the feature set to generate four-dimensional geomagnetic data; pre-process the four-dimensional geomagnetic data to obtain standard four-dimensional geomagnetic data, and the pre-processing at least includes sliding window processing; input the standard four-dimensional geomagnetic data into the initial positioning model for training to obtain a preset positioning model, so as to obtain user location information through the preset positioning model.
[0077] In an optional implementation method of the embodiment of the present application, the positioning module 405 is also used to set an initial positioning model structure, which includes a first GRU unit, an Attention unit, a second GRU unit, and a fully connected layer; wherein the first GRU unit is used to output a first geomagnetic hidden state sequence according to the dependency relationship of standard four-dimensional geomagnetic data; the Attention unit is used to perform weighted sum calculation on the first geomagnetic hidden state sequence to obtain a context vector; the second GRU unit is used to combine the context vector and the first geomagnetic hidden state sequence, and process the combined context vector and the first geomagnetic hidden state sequence to obtain a second geomagnetic hidden state sequence; the fully connected layer is used to output user location information according to the second geomagnetic hidden state sequence.
[0078] In an optional implementation of the embodiment of the present application, the first GRU unit and the second GRU unit include a reset gate and an update gate, respectively.
[0079] In an optional implementation method of the embodiment of the present application, the positioning module 405 is also used to obtain position coordinate information of a preset path, the position coordinate information including path key point information and path distance information; collect three-dimensional geomagnetic data on the preset path at a preset constant speed; store data according to the correspondence between the three-dimensional geomagnetic data and the geomagnetic coordinate data to obtain geomagnetic information.
[0080] In an optional implementation method of the embodiment of the present application, the positioning module 405 is also used to calculate the module length of the standard geomagnetic signal data, expand the standard geomagnetic signal data into four-dimensional geomagnetic signal data; process the four-dimensional geomagnetic signal data according to a preset window value to obtain a four-dimensional geomagnetic signal matrix, and use the four-dimensional geomagnetic signal matrix as the standard geomagnetic signal data, input it into a preset positioning model, and obtain user location information.
[0081] In an optional implementation of the embodiment of the present application, the acquisition module 401 is also used to obtain the user's initial velocity and linear acceleration before the method further includes: obtaining multiple three-dimensional acceleration data of the user within a preset time integral through an accelerometer; inputting the multiple three-dimensional acceleration data into a preset linear acceleration model for calculation to obtain multiple linear accelerations, and the preset linear acceleration model is used to delete error data in the three-dimensional acceleration data.
[0082] The present application also discloses an electronic device. Figure 5 , Figure 5 The electronic device 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0083] The communication bus 502 is used to realize the connection and communication between these components.
[0084] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0085] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0086] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.
[0087] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. Refer to Figure 5 , the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of a positioning method based on geomagnetic signals.
[0088] exist Figure 5 In the electronic device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call the application program storing the positioning method based on the geomagnetic signal in the memory 505, and when executed by one or more processors 501, the electronic device 500 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0090] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0091] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0092] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0094] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
[0095] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A positioning method based on geomagnetic signals, characterized in that: include: Get the user's initial velocity and multiple linear accelerations; Calculating the initial velocity and the plurality of linear accelerations based on a velocity calculation formula to obtain a discrete time velocity; Calculating a plurality of speed compensation factors corresponding to the discrete speed based on a preset constant speed, wherein the preset constant speed is a speed of geomagnetic information used to train a preset positioning model, wherein the geomagnetic information includes three-dimensional geomagnetic data and geomagnetic coordinate data; Acquire geomagnetic signal data at the same time as the multiple linear accelerations, and adjust the geomagnetic signal data according to the multiple speed compensation factors to obtain standard geomagnetic signal data; The standard geomagnetic signal data is input into the preset positioning model to obtain user location information.
2. The method according to claim 1, characterized in that Before inputting the standard geomagnetic signal data into the preset positioning model to obtain the user location information, the method further includes: Acquiring the geomagnetic information; Calculating the modulus of the three-dimensional geomagnetic data, and incorporating the modulus into a feature set to generate four-dimensional geomagnetic data; Preprocessing the four-dimensional geomagnetic data to obtain standard four-dimensional geomagnetic data, wherein the preprocessing at least includes sliding window processing; The standard four-dimensional geomagnetic data is input into an initial positioning model for training to obtain the preset positioning model, so as to obtain the user location information through the preset positioning model.
3. The method according to claim 2, characterized in that Before inputting the standard four-dimensional geomagnetic data into the initial positioning model for training to obtain the preset positioning model, the method further includes: Construct the initial positioning model, wherein the initial positioning model structure includes a first GRU unit, an Attention unit, a second GRU unit, and a fully connected layer; wherein, The first GRU unit is used to output a first geomagnetic hidden state sequence according to the dependency relationship of the standard four-dimensional geomagnetic data; The Attention unit is used to perform weighted sum calculation on the first geomagnetic hidden state sequence to obtain a context vector; The second GRU unit combines the context vector and the first geomagnetic hidden state sequence, processes the combined context vector and the first geomagnetic hidden state sequence, and obtains a second geomagnetic hidden state sequence; The fully connected layer is used to output the user location information according to the second geomagnetic hidden state sequence.
4. The method according to claim 3, characterized in that The first GRU unit and the second GRU unit each include a reset gate and an update gate.
5. The method according to claim 2, characterized in that Before acquiring the geomagnetic information, the method further includes: Obtaining location coordinate information of a preset path, wherein the location coordinate information includes path key point information and path distance information; Collecting the three-dimensional geomagnetic data on the preset path at the preset constant speed; The data is stored according to the correspondence between the three-dimensional geomagnetic data and the geomagnetic coordinate data to obtain the geomagnetic information.
6. The method according to claim 1, characterized in that Before inputting the standard geomagnetic signal data into the preset positioning model to obtain the user location information, the method further includes: Calculating the module length of the standard geomagnetic signal data, and expanding the standard geomagnetic signal data into four-dimensional geomagnetic signal data; The four-dimensional geomagnetic signal data is processed according to a preset window value to obtain a four-dimensional geomagnetic signal matrix, and the four-dimensional geomagnetic signal matrix is used as the standard geomagnetic signal data and input into the preset positioning model to obtain the user location information.
7. The method according to claim 1, characterized in that Before obtaining the initial velocity and linear acceleration of the user, the method further includes: Acquire multiple three-dimensional acceleration data of the user within a preset time integral through an accelerometer; The plurality of three-dimensional acceleration data are input into a preset linear acceleration model for calculation to obtain the plurality of linear accelerations, and the preset linear acceleration model is used to delete error data in the three-dimensional acceleration data.
8. A terminal device, characterized in that: The terminal device comprises: An acquisition module, used to obtain the user's initial velocity and multiple linear accelerations; A first calculation module, configured to calculate the initial velocity and the plurality of linear accelerations based on a velocity calculation formula to obtain a discrete time velocity; A second calculation module, used for calculating a plurality of speed compensation factors corresponding to the discrete speeds based on a preset constant speed, wherein the preset constant speed is a speed of geomagnetic information used for training a preset positioning model; An adjustment module, configured to obtain geomagnetic signal data at the same time as the multiple linear accelerations, and adjust the geomagnetic signal data according to the multiple speed compensation factors to obtain standard geomagnetic signal data; The positioning module is used to input the standard geomagnetic signal data into the preset positioning model to obtain user location information.
9. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Indoor positioning algorithm capable of combining inertial navigation with terrestrial magnetism on the basis of credibility
CN110081888A
Magnetic field positioning method and system
CN113739792A
Indoor positioning method and device based on sequence grouping sliding window
CN114440888A
Pedestrian location estimation system with magnetic disturbance compensation
KR102212333B1
Electronic device for detecting location by using geomagnetic data, and control method therefor
WO2023140656A1