Calibration data acquisition method and device for magnetometer based on three-dimensional space coverage
By adopting a magnetometer calibration data acquisition method based on three-dimensional spatial coverage, and through coordinate transformation and data filtering operations, only valid data is retained, which solves the problems of low data coverage and excessive redundant data, and improves the accuracy and reliability of magnetometer calibration.
Patent Information
- Application Number
- CN202610791513.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-11-03
AI Technical Summary
Existing magnetometer calibration data acquisition methods suffer from problems such as low data coverage leading to decreased calibration accuracy, and excessive redundant data resulting in low calibration accuracy.
A magnetometer calibration data acquisition method based on three-dimensional spatial coverage is adopted. By performing coordinate transformation, spherical mapping and data filtering operations on the target three-dimensional data, only valid data that contributes to the calibration is retained, the spherical network coverage is updated in real time, and data acquisition is stopped when a preset threshold is reached.
It improves the accuracy and reliability of magnetometer calibration data, reduces the amount of data to be stored and processed, reduces computational complexity, ensures sufficient and evenly distributed data, and enhances calibration results.
Smart Images

Figure CN123029445A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and apparatus for acquiring magnetometer calibration data based on three-dimensional spatial coverage. Background Technology
[0002] Magnetometers, as core sensors for measuring magnetic field strength, are widely used in smart electronic devices. For example, the compass function of smartphones and smartwatches, and the heading determination of map navigation all rely on geomagnetic data output by magnetometers. However, the accuracy of geomagnetic data output by existing magnetometers is easily affected by external magnetic fields, thus requiring regular calibration of the magnetometers.
[0003] In the calibration process of a magnetometer, the quality of the calibration data used is the core factor determining the calibration accuracy. Current mainstream magnetometer calibration data acquisition methods include four-angle figure-eight acquisition and conventional around-axis rotation acquisition. These methods collect data through fixed actions and fixed durations, and their core idea is to improve calibration accuracy by increasing the amount of data. However, traditional data acquisition methods neglect the correlation between data coverage and calibration accuracy. Even if more than 1000 sets of data are collected, if the distribution / 3D coverage of these 1000 sets of data in the calibration model is too low, such as below 60%, the final magnetometer calibration accuracy will decrease, resulting in the contradiction of meeting the data volume requirements but failing to calibrate. Therefore, providing a corresponding solution to the problems of low accuracy, excessive redundant data, and low magnetometer calibration accuracy in existing magnetometer calibration data acquisition methods is particularly important. Summary of the Invention
[0004] This invention provides a method and apparatus for acquiring calibration data of a magnetometer based on three-dimensional spatial coverage. It can achieve accurate acquisition of calibration data and intelligent removal of redundant data by taking data coverage as the guide, thereby reducing the amount of calibration data that needs to be processed and improving the final calibration accuracy of the magnetometer.
[0005] The first aspect of this invention discloses a method for acquiring magnetometer calibration data based on three-dimensional spatial coverage, the method comprising: When a calibration operation for the magnetometer is triggered, target three-dimensional data acquired by the magnetometer is obtained, the target three-dimensional data including multiple pre-processed sub-data; The target 3D data is sequentially subjected to coordinate transformation, spherical mapping, and data filtering operations to obtain the target data processing result for the target 3D data. The grid coverage of the pre-constructed spherical network is updated based on the target data processing results, and it is determined whether the grid coverage has reached a preset target threshold. When it is determined that the grid coverage has reached the target threshold, a first control command is output. The first control command is used to control the magnetometer to stop acquiring new three-dimensional data and to trigger a calibration operation for the magnetometer.
[0006] As an optional implementation, in the first aspect of the present invention, the method further includes: When it is determined that the grid coverage rate has not reached the target threshold, a second control command is output; The second control command controls the magnetometer to continue acquiring new three-dimensional data and performs a data preprocessing process on the new three-dimensional data until the latest grid coverage reaches the target threshold, at which point the first control command is output; the first control command is also used to prompt the completion of the acquisition operation for the magnetometer calibration data; The data preprocessing process includes sequentially performing the coordinate transformation operation, the spherical mapping operation, the data filtering operation, and the update and judgment operation of the mesh coverage of the spherical network on the new three-dimensional data.
[0007] As an optional implementation, in the first aspect of the present invention, the step of sequentially performing coordinate transformation, spherical mapping, and data filtering operations on the target three-dimensional data to obtain target data processing results for the target three-dimensional data includes: According to a preset coordinate transformation formula, a coordinate transformation operation is performed on the target 3D data to obtain a coordinate transformation result for the target 3D data; the coordinate transformation result includes a sub-transformation result for each sub-data. A pre-constructed spherical network is determined and the state of each grid cell in the spherical network is obtained. The spherical network is divided into multiple grid cells. The grid cell state includes an active state or an inactive state. The coordinate transformation result is mapped onto the spherical network to obtain a mapping result for the coordinate transformation result, the mapping result including a sub-mapping result for each of the sub-transformation results; Based on the target states of all the mesh cells, a data filtering operation is performed on the mapping result to obtain a data filtering result for the mapping result, which serves as the target data processing result for all the target 3D data; the target state of each mesh cell is either the active state or the inactive state.
[0008] As an optional implementation, in the first aspect of the invention, the sub-mapping result of each sub-transformation result includes the target mesh cell corresponding to the sub-transformation result in the spherical network: The step of performing a data filtering operation on the mapping result based on the target state of all the grid cells to obtain a data filtering result for the mapping result includes: Determine the target grid cell state of the target grid cell corresponding to each of the sub-mapping results; For each sub-mapping result, when it is determined that the target mesh cell state corresponding to the sub-mapping result is the active state, the sub-mapping result is discarded. When the state of the target mesh cell corresponding to the sub-mapping result is determined to be the inactive state, the sub-mapping result and its corresponding target mesh cell are stored and bound. At the same time, the state of the target mesh cell corresponding to the sub-mapping result is updated, and the spherical network is updated. The updated spherical network is determined as the data filtering result for the mapping result; Specifically, for any target grid cell, when the amount of data bound to the target grid cell is less than a preset amount of data, the target grid cell state corresponding to the target grid cell is marked as the inactive state; when the amount of data bound to the target grid cell is equal to the preset amount of data, the target grid cell state corresponding to the target grid cell is marked as the active state.
[0009] As an optional implementation, in the first aspect of the present invention, the coordinate transformation formula is:
[0010] Where (x, y, z) are the coordinates of a sub-data after the preprocessing operation is performed. The polar angle has a range of values of 100. And it is used to indicate the angle between a certain sub-data and the Z-axis; The azimuth angle has a range of values. And it is used to indicate the projection direction of a certain sub-data in the XY plane; For each grid cell in the spherical network, when the grid cell state of the grid cell is the active state, the grid cell is not bound to new sampled data and indicates that the data sampling requirement for the grid cell has been completed; when the grid cell state of the grid cell is the inactive state, the grid cell is allowed to be bound to new sampled data.
[0011] As an optional implementation, in the first aspect of the invention, updating the grid coverage of the pre-constructed spherical network based on the target data processing result includes: Based on the target data processing results, determine the first number of all the grid cells in the pre-constructed spherical network and the second number of all the grid cells in the spherical network that are in the active state; Calculate the percentage of the second quantity to the first quantity, and use the corresponding percentage value as the new grid coverage of the spherical network; The original mesh coverage of the spherical network is updated to the new mesh coverage.
[0012] As an optional implementation, in the first aspect of the present invention, acquiring the target three-dimensional data collected by the magnetometer includes: A set of initial three-dimensional data collected by the magnetometer is acquired according to a preset sampling period; The initial set of 3D data is cached in real time to a pre-set data buffer. According to the preset normalization formula, the initial three-dimensional data is normalized to obtain the normalized result of the initial three-dimensional data, which is used as the target three-dimensional data. The normalization formula is as follows:
[0013] in, These are the coordinate values of a specific initial 3D data point within the set of initial 3D data. This is the normalized result of a certain initial three-dimensional data.
[0014] A second aspect of this invention discloses a magnetometer calibration data acquisition device based on three-dimensional spatial coverage, the device comprising: The data acquisition module is used to acquire target three-dimensional data collected by the magnetometer when it is determined that a calibration operation for the magnetometer is triggered. The target three-dimensional data includes multiple sub-data that have undergone preprocessing. The data processing module is used to sequentially perform coordinate transformation, spherical mapping, and data filtering operations on the target 3D data to obtain the target data processing result for the target 3D data; The update module is used to update the mesh coverage of the pre-built spherical network based on the target data processing results; The judgment module is used to determine whether the grid coverage rate has reached a preset target threshold. When it is determined that the grid coverage rate has reached the target threshold, a first control command is output. The first control command is used to control the magnetometer to stop collecting new three-dimensional data and to trigger a calibration operation for the magnetometer.
[0015] As an optional implementation, in a second aspect of the invention, the apparatus further includes: The instruction output module is used to output a second control instruction when the judgment module determines that the grid coverage rate has not reached the target threshold. The data preprocessing module is used to control the magnetometer to continue acquiring new three-dimensional data according to the second control command, and to perform a data preprocessing process on the new three-dimensional data until it is determined that the latest grid coverage reaches the target threshold, and then output the first control command; the first control command is also used to prompt the completion of the acquisition operation for the magnetometer calibration data; The data preprocessing process includes sequentially performing the coordinate transformation operation, the spherical mapping operation, the data filtering operation, and the update and judgment operation of the mesh coverage of the spherical network on the new three-dimensional data.
[0016] As an optional implementation, in the second aspect of the present invention, the data processing module sequentially performs coordinate transformation, spherical mapping, and data filtering operations on the target three-dimensional data to obtain the target data processing result for the target three-dimensional data. Specifically, this includes: According to a preset coordinate transformation formula, a coordinate transformation operation is performed on the target 3D data to obtain a coordinate transformation result for the target 3D data; the coordinate transformation result includes a sub-transformation result for each sub-data. A pre-constructed spherical network is determined and the state of each grid cell in the spherical network is obtained. The spherical network is divided into multiple grid cells. The grid cell state includes an active state or an inactive state. The coordinate transformation result is mapped onto the spherical network to obtain a mapping result for the coordinate transformation result, the mapping result including a sub-mapping result for each of the sub-transformation results; Based on the target states of all the mesh cells, a data filtering operation is performed on the mapping result to obtain a data filtering result for the mapping result, which serves as the target data processing result for all the target 3D data; the target state of each mesh cell is either the active state or the inactive state.
[0017] As an optional implementation, in a second aspect of the invention, the sub-mapping result of each sub-transformation result includes the target mesh cell corresponding to the sub-transformation result mapped in the spherical network: The data processing module performs a data filtering operation on the mapping result based on the target state of all the grid cells, and the specific methods for obtaining the data filtering result for the mapping result include: Determine the target grid cell state of the target grid cell corresponding to each of the sub-mapping results; For each sub-mapping result, when it is determined that the target mesh cell state corresponding to the sub-mapping result is the active state, the sub-mapping result is discarded. When the state of the target mesh cell corresponding to the sub-mapping result is determined to be the inactive state, the sub-mapping result and its corresponding target mesh cell are stored and bound. At the same time, the state of the target mesh cell corresponding to the sub-mapping result is updated, and the spherical network is updated. The updated spherical network is determined as the data filtering result for the mapping result; Specifically, for any target grid cell, when the amount of data bound to the target grid cell is less than a preset amount of data, the target grid cell state corresponding to the target grid cell is marked as the inactive state; when the amount of data bound to the target grid cell is equal to the preset amount of data, the target grid cell state corresponding to the target grid cell is marked as the active state.
[0018] As an optional implementation, in a second aspect of the present invention, the coordinate transformation formula is:
[0019] Where (x, y, z) are the coordinates of a sub-data after the preprocessing operation is performed. The polar angle has a range of values of 100. And it is used to indicate the angle between a certain sub-data and the Z-axis; The azimuth angle has a range of values. And it is used to indicate the projection direction of a certain sub-data in the XY plane; For each grid cell in the spherical network, when the grid cell state of the grid cell is the active state, the grid cell is not bound to new sampled data and indicates that the data sampling requirement for the grid cell has been completed; when the grid cell state of the grid cell is the inactive state, the grid cell is allowed to be bound to new sampled data.
[0020] As an optional implementation, in a second aspect of the invention, the method by which the updating module updates the mesh coverage of the pre-constructed spherical network according to the target data processing result specifically includes: Based on the target data processing results, determine the first number of all the grid cells in the pre-constructed spherical network and the second number of all the grid cells in the spherical network that are in the active state; Calculate the percentage of the second quantity to the first quantity, and use the corresponding percentage value as the new grid coverage of the spherical network; The original mesh coverage of the spherical network is updated to the new mesh coverage.
[0021] As an optional implementation, in a second aspect of the present invention, the data acquisition module acquires the target three-dimensional data collected by the magnetometer in a specific manner including: A set of initial three-dimensional data collected by the magnetometer is acquired according to a preset sampling period; The initial set of 3D data is cached in real time to a pre-set data buffer. According to the preset normalization formula, the initial three-dimensional data is normalized to obtain the normalized result of the initial three-dimensional data, which is used as the target three-dimensional data. The normalization formula is as follows:
[0022] in, These are the coordinate values of a specific initial 3D data point within the set of initial 3D data. This is the normalized result of a certain initial three-dimensional data.
[0023] A third aspect of the present invention discloses another magnetometer calibration data acquisition device based on three-dimensional spatial coverage, the device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute some or all of the steps in the magnetometer calibration data acquisition method based on three-dimensional spatial coverage according to any of the first aspects of the present invention.
[0024] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps in the magnetometer calibration data acquisition method based on three-dimensional spatial coverage as described in any of the first aspects of the present invention.
[0025] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a method for acquiring magnetometer calibration data based on three-dimensional spatial coverage. The method includes: when a calibration operation for the magnetometer is triggered, acquiring target three-dimensional data collected by the magnetometer, the target three-dimensional data including multiple pre-processed sub-data; sequentially performing coordinate transformation, spherical mapping, and data filtering operations on the target three-dimensional data to obtain target data processing results; updating the mesh coverage of a pre-constructed spherical network based on the target data processing results, and determining whether the mesh coverage has reached a preset target threshold; when it is determined that the mesh coverage has reached the target threshold, outputting a first control command, which is used to control the magnetometer to stop acquiring new three-dimensional data and also to trigger the calibration operation for the magnetometer. It is evident that by implementing this invention, through a series of pre-processing operations such as pre-processing, coordinate transformation, spherical mapping, and data filtering on the acquired target three-dimensional data, only valid data contributing to the calibration is retained and the spherical network coverage is updated, rather than storing all original sampling points. This effectively reduces the amount of stored and unprocessed data, which is beneficial for reducing the computational complexity of subsequent magnetometer calibration. In particular, by judging in real time whether the coverage of the spherical network constructed based on the collected data has reached the preset threshold, the acquisition can be automatically stopped and the calibration can be triggered as soon as the amount of data meets the calibration requirements. This spherical network coverage judgment mechanism ensures that the actual calibration data of the magnetometer is sufficient and the data distribution is relatively uniform, which can greatly improve the accuracy and reliability of the data collected for magnetometer calibration, and ultimately improve the calibration effect of the magnetometer. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a flowchart illustrating a magnetometer calibration data acquisition method based on three-dimensional spatial coverage disclosed in an embodiment of the present invention. Figure 2 This is a flowchart illustrating another magnetometer calibration data acquisition method based on three-dimensional spatial coverage disclosed in an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of a magnetometer calibration data acquisition device based on three-dimensional spatial coverage, as disclosed in an embodiment of the present invention. Figure 4 This is a schematic diagram of another magnetometer calibration data acquisition device based on three-dimensional spatial coverage disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of another magnetometer calibration data acquisition device based on three-dimensional spatial coverage disclosed in an embodiment of the present invention; Figure 6 This is a comparison diagram of the three-dimensional scatter point distribution before and after magnetometer calibration, as disclosed in an embodiment of the present invention. Figure 7 This is another comparison diagram of the three-dimensional scatter distribution before and after magnetometer calibration disclosed in an embodiment of the present invention. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0030] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] This invention discloses a method and apparatus for acquiring magnetometer calibration data based on three-dimensional spatial coverage. By performing a series of preprocessing operations on the acquired target three-dimensional data, including preprocessing, coordinate transformation, spherical mapping, and data filtering, only valid data contributing to calibration is retained and the spherical network coverage is updated, rather than storing all original sampling points. This effectively reduces the amount of data to be stored and processed, thus reducing the computational complexity of subsequent magnetometer calibration. Specifically, by judging in real time whether the spherical network coverage constructed based on the acquired data reaches a preset threshold, acquisition can be automatically stopped and calibration triggered as soon as the data volume meets the calibration requirements. This spherical network coverage judgment mechanism ensures that the actual calibration data of the magnetometer is sufficient and relatively uniformly distributed, thereby greatly improving the accuracy and reliability of the data acquired for magnetometer calibration, ultimately improving the calibration effect of the magnetometer. Detailed explanations follow.
[0032] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a magnetometer calibration data acquisition method based on three-dimensional spatial coverage, as disclosed in an embodiment of the present invention. Figure 1 The described method for acquiring magnetometer calibration data based on three-dimensional spatial coverage can be applied to magnetometer calibration data acquisition devices based on three-dimensional spatial coverage, and the embodiments of the present invention are not limited thereto. Figure 1 As shown, the magnetometer calibration data acquisition method based on three-dimensional spatial coverage may include the following operations: 101. When it is determined that a calibration operation for the magnetometer is triggered, acquire the target three-dimensional data collected by the magnetometer. The target three-dimensional data includes multiple sub-data that have undergone preprocessing.
[0033] In this embodiment of the invention, the preprocessing operation can specifically be a normalization operation.
[0034] 102. Perform coordinate transformation, spherical mapping, and data filtering operations sequentially on the target 3D data to obtain the target data processing results for the target 3D data.
[0035] 103. Update the grid coverage of the pre-built spherical network based on the target data processing results.
[0036] In this embodiment of the invention, the grid coverage of the spherical network is calculated and updated based on the target data processing results. Based on this grid coverage, it is possible to quantitatively assess whether the collected calibration data (corresponding to the target three-dimensional data) has covered a sufficient number of directional distributions, thereby achieving real-time quantitative assessment of data distribution. This avoids the problem of unstable ellipsoid fitting caused by insufficient data collection, thus helping to improve the accuracy and reliability of calibration parameters.
[0037] 104. Determine whether the grid coverage rate has reached the preset target threshold.
[0038] 105. When it is determined that the grid coverage has reached the target threshold, output the first control command.
[0039] In this embodiment of the invention, the first control command is used to control the magnetometer to stop acquiring new three-dimensional data, and is also used to trigger a calibration operation for the magnetometer.
[0040] It is evident that implementation Figure 1 The described magnetometer calibration data acquisition method based on 3D spatial coverage performs a series of preprocessing operations on the acquired target 3D data, including preprocessing, coordinate transformation, spherical mapping, and data filtering. It retains only the valid data contributing to calibration and updates the spherical network coverage, rather than storing all original sampling points. This effectively reduces the amount of data to be stored and processed, thus reducing the computational complexity of subsequent magnetometer calibration. Specifically, by judging in real time whether the spherical network coverage constructed based on the acquired data reaches a preset threshold, it can automatically stop acquisition and trigger calibration as soon as the data volume meets the calibration requirements. This spherical network coverage judgment mechanism ensures that the actual calibration data of the magnetometer is sufficient and relatively uniformly distributed, thereby greatly improving the accuracy and reliability of the data acquired for magnetometer calibration, ultimately improving the calibration effect of the magnetometer.
[0041] In an optional embodiment, the method for obtaining the target three-dimensional data collected by the magnetometer in step 102 specifically includes: Acquire a set of initial three-dimensional data collected by the magnetometer according to a preset sampling period; The initial set of 3D data is cached in real time to a pre-set data buffer. According to the preset normalization formula, the initial three-dimensional data is normalized to obtain the normalized result of the initial three-dimensional data, which is used as the target three-dimensional data. The normalization formula is as follows:
[0042] in, These are the coordinate values of a specific initial 3D data point within the set of initial 3D data. This is the normalized result of a certain initial three-dimensional data.
[0043] In this optional embodiment, the preset sampling period can be set to 20ms. In practical applications, the magnetometer can detect that it has entered the calibration data acquisition mode and detects a change in gravity (such as when the user shakes the magnetometer). Then, the magnetometer collects data from all directions in real time to obtain multiple initial three-dimensional data. Subsequently, the data acquisition module of the magnetometer reads a set of initial three-dimensional data according to the fixed sampling period of 20ms.
[0044] In this optional embodiment, since the acquired raw magnetometer data (the multiple sets of initial three-dimensional data) typically includes hard iron bias and soft iron interference, these interferences mainly cause translation and stretching of the magnetic field distribution, but do not change the directional topology of the data in three-dimensional space. Therefore, even in an uncalibrated state, the magnetometer data can still be used to calculate the true spatial distribution, thereby enabling coverage analysis without prior calibration, simplifying the preconditions for data acquisition, and improving the universality and portability of the overall data acquisition process.
[0045] In this optional embodiment, in order to avoid spatial deviations caused by changes in magnetic field amplitude or interference, and to ensure that the subsequent coverage calculation results can reflect the directional integrity of the acquisition action, it is necessary to perform normalization processing on each set of initial three-dimensional data acquired.
[0046] As can be seen, in this optional embodiment, the initial three-dimensional data can be automatically normalized, thereby effectively reducing the spatial deviation caused by changes in magnetic field amplitude or interference, improving the accuracy and reliability of the acquired target three-dimensional data, and thus helping to improve the accuracy of the calculation results obtained by performing coverage calculation based on the accurate and reliable target three-dimensional data.
[0047] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating another magnetometer calibration data acquisition method based on three-dimensional spatial coverage, as disclosed in an embodiment of the present invention. Figure 2 The described method for acquiring magnetometer calibration data based on three-dimensional spatial coverage can be applied to magnetometer calibration data acquisition devices based on three-dimensional spatial coverage, and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the magnetometer calibration data acquisition method based on three-dimensional spatial coverage may include the following operations: 201. When it is determined that a calibration operation for the magnetometer is triggered, acquire the target three-dimensional data collected by the magnetometer. The target three-dimensional data includes multiple sub-data that have undergone preprocessing.
[0048] 202. Perform coordinate transformation, spherical mapping, and data filtering operations sequentially on the target 3D data to obtain the target data processing results for the target 3D data.
[0049] 203. Update the grid coverage of the pre-built spherical network based on the target data processing results.
[0050] 204. Determine whether the grid coverage rate has reached the preset target threshold.
[0051] 205. When it is determined that the grid coverage has reached the target threshold, output the first control command.
[0052] For further descriptions of steps 201-205 in this embodiment of the invention, please refer to the other specific descriptions of steps 101-105 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.
[0053] 206. When it is determined that the grid coverage has not reached the target threshold, output the second control command.
[0054] 207. According to the second control command, control the magnetometer to continue to collect new three-dimensional data and perform data preprocessing on the new three-dimensional data until it is determined that the latest grid coverage reaches the target threshold, and then output the first control command.
[0055] In this embodiment of the invention, the first control command is also used to prompt the completion of the acquisition operation for the magnetometer calibration data.
[0056] In this embodiment of the invention, the first control command can also be used to generate a first prompt message, such as "data acquisition is sufficient," and display the first prompt message on the display interface of the magnetometer to prompt the user to stop rotating the magnetometer.
[0057] In this embodiment of the invention, similarly, the second control command can also be used to generate a second prompt message, such as "insufficient rotation", and display the second prompt message on the display interface of the magnetometer to prompt the user to continue rotating the magnetometer.
[0058] In this embodiment of the invention, the data preprocessing process includes sequentially performing coordinate transformation, spherical mapping, data filtering, and updating and judging the mesh coverage of the spherical network on the new three-dimensional data.
[0059] In this embodiment of the invention, the data preprocessing process refers to the operation steps of steps 201-205. The data filtering and grid coverage update and judgment operations set therein can ensure that each iteration only processes newly added and valid data, rather than processing all the collected data. This helps to reduce the cumulative computation of multiple collection cycles and speeds up the convergence speed to meet the target.
[0060] It is evident that implementation Figure 2 The described magnetometer calibration data acquisition method based on three-dimensional spatial coverage sets up a closed-loop control mechanism for calibration data. When it is determined that the grid coverage has not reached the target threshold, a second control command is output, and the magnetometer continues to acquire new data and execute the data preprocessing process. This ensures that the calibration data can be adaptively and continuously acquired until the calibration requirements are met, thus guaranteeing the integrity and self-termination of the data acquisition process and improving the integrity of the overall calibration data acquisition process.
[0061] In an optional embodiment, step 202 above sequentially performs coordinate transformation, spherical mapping, and data filtering operations on the target 3D data to obtain the target data processing result for the target 3D data. Specifically, this includes: According to the preset coordinate transformation formula, coordinate transformation operation is performed on the target 3D data to obtain the coordinate transformation result for the target 3D data; the coordinate transformation result includes the sub-transformation result for each sub-data. A pre-constructed spherical network is determined and the state of each grid cell in the spherical network is obtained. The spherical network is divided into multiple grid cells; the grid cell state includes an active state or an inactive state. The coordinate transformation results are mapped onto a spherical network to obtain a mapping result for the coordinate transformation results. The mapping result includes a sub-mapping result for each sub-transformation result. Based on the target state of all grid cells, a data filtering operation is performed on the mapping results to obtain the data filtering results for the mapping results, which serve as the target data processing results for all target 3D data; the target state of each grid cell is either active or inactive.
[0062] In this optional embodiment, the coordinate transformation formula is as follows:
[0063] Where (x, y, z) are the coordinates of a sub-data after the preprocessing operation. The polar angle has a range of values of 100. And it is used to indicate the angle between a certain sub-data and the Z-axis; The azimuth angle has a range of values. And it is used to indicate the projection direction of a certain sub-data in the XY plane; For each grid cell in the spherical network, when the grid cell state is active, the grid cell is not bound to new sampled data and indicates that the data sampling requirement for the grid cell has been completed; when the grid cell state is inactive, the grid cell is allowed to be bound to new sampled data.
[0064] In this optional embodiment, to quantify the coverage of the collected calibration data distribution, the spherical surface of the calibration model (typically a sphere / ellipsoid) corresponding to the magnetometer can be divided into sections according to a fixed angular resolution. Each grid cell represents a unique directional interval; for example, the sphere can be oriented along the polar angle. The direction is divided into 9 intervals every 20°; similarly, along the azimuth angle... The direction can be divided into 18 intervals, and the spherical network is ultimately divided into 9 × 18 = 162 intervals. Each grid cell on this spherical network is:
[0065] in, Each corresponds to one grid cell.
[0066] In this optional embodiment, a spherical coordinate transformation formula is used, which can uniquely map any original three-dimensional data of a magnetometer to the polar angle and azimuth angle on a unit sphere. This coordinate transformation operation eliminates the interference of differences in the original data modulus on spatial orientation determination, making subsequent coverage assessment only related to orientation distribution and independent of geomagnetic field strength or sensor range, thus improving the versatility and applicability of subsequent coverage assessment.
[0067] In this optional embodiment, grid cells in the active state no longer receive new sampled data (considered to have met the requirements), while inactive states allow the binding of new data. This binary state-based data filtering mechanism transforms the specific implementation of data filtering into a simple judgment of "whether an inactive cell matches," eliminating the need for complex distance calculations or weight allocations, and significantly reducing the computational complexity of a single filtering operation.
[0068] In this optional embodiment, data bound only to inactive grid cells in the mapping result is used as the target data processing result. This ensures that each iteration retains only effective sampling points that can actually improve coverage, while discarding redundant data that falls into activated cells. This processing mechanism can fundamentally avoid the negative impact of duplicate and redundant data on coverage updates and subsequent calibration accuracy. In other words, it can effectively reduce the amount of data required for subsequent coverage calculations and improve calculation accuracy.
[0069] As can be seen, in this optional embodiment, the direction uniqueness mapping of magnetometer data is achieved by performing spherical coordinate normalization transformation; and low-complexity incremental filtering is achieved by intelligent filtering of grid cell activation / deactivation binary states, retaining only new data falling into deactivation grids as effective coverage increments, thereby significantly reducing the computational overhead of data filtering and eliminating interference from redundant data while ensuring accurate improvement in coverage.
[0070] In another optional embodiment, the sub-mapping result of each sub-transformation result includes the target mesh cell corresponding to the sub-transformation result in the spherical network: The above-mentioned method of performing data filtering operations on the mapping results based on the target states of all grid cells to obtain the data filtering results for the mapping results specifically includes: Determine the target grid cell state of the target grid cell corresponding to each sub-mapping result; For each sub-mapping result, when the target mesh cell state corresponding to the sub-mapping result is determined to be active, the sub-mapping result is discarded. When the target mesh cell state corresponding to the sub-mapping result is determined to be inactive, the sub-mapping result and its corresponding target mesh cell are stored and bound. At the same time, the target mesh cell state of the target mesh cell corresponding to the sub-mapping result is updated, and the spherical network is updated. The updated spherical network is used as the data filtering result for the mapping results; Specifically, for any target grid cell, when the amount of data bound to the target grid cell is less than the preset amount of data, the target grid cell corresponding to the target grid cell is marked as inactive; when the amount of data bound to the target grid cell is equal to the preset amount of data, the target grid cell corresponding to the target grid cell is marked as active.
[0071] In this optional embodiment, the state of each grid cell is determined by whether the amount of data it has bound has reached a preset amount: when the amount has not been reached, it is inactive (allowing continued binding), and when the amount has been reached, it automatically switches to active (rejecting new data). This binary state setting can, to a certain extent, ensure that the number of sampling points in each spatial direction is neither missing nor redundant, avoiding the problem of excessive repeated sampling in the same direction while other directions are still insufficiently covered in traditional methods.
[0072] In this optional embodiment, for each sub-mapping result, the operations of judgment, elimination or binding, storage, and status update are performed in the order of single data points (in practical applications, this can be based on the acquisition sequence of each sub-data point). Furthermore, the status of the corresponding grid cell and the entire spherical network are updated immediately after each binding. This data mapping process eliminates the need to wait for all data to be mapped before unified filtering, reducing memory usage and enabling subsequent data filtering to be performed in real-time based on the latest network status. This improves the overall efficiency of the data filtering process and the accuracy of the obtained data filtering results to a certain extent.
[0073] In this optional embodiment, the preset data volume can be set to at least two data entries (actually, two three-dimensional coordinate vectors). That is, each grid cell is used to bind at least two data entries, and once a grid cell reaches the preset data volume (active state), all subsequent sub-data mapped to that grid are directly removed, and storage and subsequent coverage update judgments are no longer performed. This binary setting and timely update of the grid cell state achieves accurate removal of redundant data and eliminates the storage overhead of redundant data, effectively avoiding invalid calculations for duplicate data in subsequent calibration algorithms.
[0074] As can be seen, in this optional embodiment, the single-grid saturation triggering mechanism based on a preset data volume and the real-time state update in a data-stream manner achieve precise control over the number of samples in each spatial direction: unsaturated grids allow new data to be bound, and after saturation, they are automatically activated and all subsequent data in the same direction are removed, which improves the sampling accuracy and sampling saturation of the calibration data required by the magnetometer, and enables the early removal of redundant data, which helps to reduce storage and computing overhead.
[0075] In yet another optional embodiment, the method of updating the mesh coverage of the pre-built spherical network based on the target data processing results specifically includes: Based on the target data processing results, determine the first number of all grid cells in the pre-constructed spherical network and the second number of all grid cells in the spherical network that are in an active state; Calculate the percentage of the second quantity to the first quantity, and use the corresponding percentage value as the new mesh coverage of the spherical network; Update the original grid coverage of the spherical network to the new grid coverage.
[0076] In this optional embodiment, the formula for calculating grid coverage is:
[0077] in, N total This is the first number of all grid cells in the spherical network; This is the second number of all active grid cells in the spherical network; This represents the grid coverage rate.
[0078] In this optional embodiment, the grid coverage can be used to quantify the distribution integrity of the magnetometer sampling direction.
[0079] In this optional embodiment, since a grid is only switched to an active state and its count incremented (active grid count) when new data falls into an inactive grid, and there is never a situation where an active grid degenerates into an inactive one, the coverage rate strictly monotonically does not decrease during the iteration process. The grid cell state switching and update mechanism ensures that, with a finite total number of grids, the set target threshold will inevitably be reached after a finite number of data acquisitions, which helps to accelerate the convergence speed and ensure the determinism of the termination conditions for the magnetometer calibration data acquisition.
[0080] In this optional embodiment, a new grid coverage is calculated each time. Then, compare it with the set target threshold. If a comparison is made, The system prompts the user to continue collecting data and guides the rotation direction; if The system automatically triggers the calibration algorithm module to perform ellipsoid fitting. In practical applications, this target threshold can be set between 65% and 85%, for example, 80% can be selected.
[0081] In this optional embodiment, since the overall acquisition process is constrained by the coverage, it ensures that the final acquired data is relatively fully and uniformly distributed in three-dimensional space, effectively avoiding the situation where data is concentrated in local areas.
[0082] In this optional embodiment, for the target threshold The settings need to be adaptively adjusted based on the data acquisition duration and ellipsoid fitting stability. Specifically, when the grid coverage is low, it indicates that the acquired calibration data is not sufficiently distributed in three-dimensional space, leading to poor ellipsoid fitting stability and a large RMSE (Root Mean Square Error). As the coverage increases, the data distribution gradually becomes more uniform, and the RMSE decreases significantly. After the coverage increases to a certain extent, the decrease in RMSE tends to plateau. At this point, further increasing the amount of data acquired has limited effect on improving fitting stability but will significantly increase acquisition time and user operation costs. Therefore, a trade-off needs to be struck between the amount of data and RMSE to determine a reasonable coverage threshold.
[0083] In this optional embodiment, the process for evaluating the stability of the ellipsoid fitting is as follows: First, the original magnetometer data used in the fitting process are corrected using calibration parameters obtained from ellipsoid fitting. Second, the modulus of the corrected triaxial data is calculated, and the mean modulus is taken as the expected magnetic field strength. Finally, the root mean square error (RMSE) of the modulus at each sampling point relative to this expected value is calculated. A smaller RMSE indicates better consistency of the calibrated magnetic field, conformity to geomagnetic laws, and stability of the ellipsoid fitting results.
[0084] In this optional embodiment, specifically, please refer to... Figure 6 as well as Figure 7 , Figure 6 This is a comparison diagram of the three-dimensional scatter point distribution before and after magnetometer calibration, as disclosed in an embodiment of the present invention. Figure 7 This is another comparison diagram of the three-dimensional scatter point distribution before and after magnetometer calibration disclosed in an embodiment of the present invention. Figure 6 As shown, Figure 6 The left figure shows that when the data volume is 3000, the scatter distribution of the magnetometer before and after calibration tends to be a standard sphere. At this time, the grid coverage is 88%, and the RMSE after calibration is 0.0020. Figure 6 The right-hand figure shows that when the data volume is 1000, a relatively stable ellipsoid can still be formed. At this time, the grid coverage is 70%, and the RMSE after calibration is 0.0076, indicating good fitting accuracy.
[0085] In this optional embodiment, such as Figure 7 As shown, Figure 7 The left figure shows that when the data volume is 750, the scatter distribution of the magnetometer before and after calibration tends to be distributed in a local dense area. At this time, the grid coverage is 57%, and the RMSE after calibration is 0.0127. After the coverage is less than 60%, even if the amount of data collected reaches 750, the calibration error RMSE still increases sharply. Figure 7 The right-hand figure shows that when the data volume is 500, the scatter distribution of the magnetometer before and after calibration is concentrated. At this time, the grid coverage is 30%, and the RMSE after calibration is 0.0342. The fitting is distorted after calibration, and the error is significant.
[0086] In this optional embodiment, it is clear that when the spatial coverage is below 60%, even with a sampling count of 750 points, the calibration error (RMSE) still rises sharply, indicating that sufficient data but insufficient coverage will lead to calibration failure. However, when the coverage reaches above 70%, the RMSE drops below 0.0076 Gauss, indicating that the coverage index can effectively reflect data quality. It is evident that grid coverage has a significant impact on calibration error and ellipse fitting stability. The above scheme, by setting an accurate and reliable grid coverage threshold (corresponding to the target threshold), achieves data sufficiency determination and redundancy control, thereby significantly improving the efficiency and accuracy of subsequent magnetometer calibration.
[0087] As can be seen, in this optional embodiment, the coverage rate is defined based on the proportion of active grids and is linked to the data filtering results. The data filtering process enables precise incremental updates and monotonically non-decreasing progression of the coverage rate. Furthermore, the binary state judgment of active / inactive can greatly reduce the computational complexity of the overall coverage rate and improve the accuracy of updates.
[0088] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of a magnetometer calibration data acquisition device based on three-dimensional spatial coverage, as disclosed in an embodiment of the present invention. The magnetometer calibration data acquisition device based on three-dimensional spatial coverage can be a magnetometer calibration data acquisition terminal, device, system, or server based on three-dimensional spatial coverage. The server can be a local server, a remote server, or a cloud server (also known as a cloud server). When the server is not a cloud server, it can communicate with the cloud server; this embodiment of the present invention does not impose limitations. Figure 3 As shown, the magnetometer calibration data acquisition device based on three-dimensional spatial coverage may include a data acquisition module 301, a data processing module 302, an update module 303, and a judgment module 304, wherein: The data acquisition module 301 is used to acquire target three-dimensional data collected by the magnetometer when it is determined that a calibration operation for the magnetometer is triggered. The target three-dimensional data includes multiple sub-data that have undergone preprocessing.
[0089] The data processing module 302 is used to sequentially perform coordinate transformation, spherical mapping and data filtering operations on the target 3D data to obtain the target data processing results for the target 3D data.
[0090] Update module 303 is used to update the mesh coverage of the pre-built spherical network based on the target data processing results.
[0091] The judgment module 304 is used to determine whether the grid coverage has reached the preset target threshold. When it is determined that the grid coverage has reached the target threshold, the first control command is output. The first control command is used to control the magnetometer to stop collecting new three-dimensional data and to trigger the calibration operation for the magnetometer.
[0092] It is evident that implementation Figure 3 The described magnetometer calibration data acquisition device based on 3D spatial coverage performs a series of preprocessing operations on the acquired target 3D data, including preprocessing, coordinate transformation, spherical mapping, and data filtering. It retains only the valid data contributing to calibration and updates the spherical network coverage, rather than storing all original sampling points. This effectively reduces the amount of data to be stored and processed, thus reducing the computational complexity of subsequent magnetometer calibration. Specifically, by judging in real time whether the spherical network coverage constructed based on the acquired data reaches a preset threshold, it can automatically stop acquisition and trigger calibration as soon as the data volume meets the calibration requirements. This spherical network coverage judgment mechanism ensures that the actual calibration data of the magnetometer is sufficient and relatively uniformly distributed, thereby greatly improving the accuracy and reliability of the data acquired for magnetometer calibration, ultimately improving the calibration effect of the magnetometer.
[0093] In an optional embodiment, please refer to Figure 4 , Figure 4 This is a schematic diagram of another magnetometer calibration data acquisition device based on three-dimensional spatial coverage disclosed in an embodiment of the present invention. Figure 4 As shown, the device also includes: The instruction output module 305 is used to output a second control instruction when the judgment module 304 determines that the grid coverage rate has not reached the target threshold. The data preprocessing module 306 is used to control the magnetometer to continue acquiring new three-dimensional data according to the second control command, and to perform a data preprocessing process on the new three-dimensional data until it is determined that the latest grid coverage reaches the target threshold, and then outputs the first control command; the first control command is also used to prompt the completion of the acquisition operation for the magnetometer calibration data. The data preprocessing process includes performing coordinate transformation, spherical mapping, data filtering, and updating and judging the mesh coverage of the spherical network on the new 3D data in sequence.
[0094] As can be seen, in this optional embodiment, a closed-loop control mechanism for calibration data is set up. When it is determined that the grid coverage has not reached the target threshold, a second control command is output, and the magnetometer is driven to continue to collect new data and execute the data preprocessing process. This ensures that the calibration data can be adaptively and continuously collected until the calibration requirements are met, thus guaranteeing the integrity and self-termination of the data acquisition process and improving the integrity of the overall calibration data acquisition process.
[0095] In another optional embodiment, the data processing module 302 sequentially performs coordinate transformation, spherical mapping, and data filtering operations on the target 3D data to obtain the target data processing result for the target 3D data. Specifically, this includes: According to the preset coordinate transformation formula, coordinate transformation operation is performed on the target 3D data to obtain the coordinate transformation result for the target 3D data; the coordinate transformation result includes the sub-transformation result for each sub-data. A pre-constructed spherical network is determined and the state of each grid cell in the spherical network is obtained. The spherical network is divided into multiple grid cells; the grid cell state includes an active state or an inactive state. The coordinate transformation results are mapped onto a spherical network to obtain a mapping result for the coordinate transformation results. The mapping result includes a sub-mapping result for each sub-transformation result. Based on the target state of all grid cells, a data filtering operation is performed on the mapping results to obtain the data filtering results for the mapping results, which serve as the target data processing results for all target 3D data; the target state of each grid cell is either active or inactive.
[0096] In this optional embodiment, the coordinate transformation formula is:
[0097] Where (x, y, z) are the coordinates of a sub-data after the preprocessing operation. The polar angle has a range of values of 100. And it is used to indicate the angle between a certain sub-data and the Z-axis; The azimuth angle has a range of values. And it is used to indicate the projection direction of a certain sub-data in the XY plane; For each grid cell in the spherical network, when the grid cell state is active, the grid cell is not bound to new sampled data and indicates that the data sampling requirement for the grid cell has been completed; when the grid cell state is inactive, the grid cell is allowed to be bound to new sampled data.
[0098] As can be seen, in this optional embodiment, the direction uniqueness mapping of magnetometer data is achieved by performing spherical coordinate normalization transformation; and low-complexity incremental filtering is achieved by intelligent filtering of grid cell activation / deactivation binary states, retaining only new data falling into deactivation grids as effective coverage increments, thereby significantly reducing the computational overhead of data filtering and eliminating interference from redundant data while ensuring accurate improvement in coverage.
[0099] In yet another optional embodiment, the sub-mapping result of each sub-transformation result includes the target mesh cell corresponding to the sub-transformation result in the spherical network: The data processing module 302 performs a data filtering operation on the mapping results based on the target state of all grid cells. The specific methods for obtaining the data filtering results for the mapping results include: Determine the target grid cell state of the target grid cell corresponding to each sub-mapping result; For each sub-mapping result, when the target mesh cell state corresponding to the sub-mapping result is determined to be active, the sub-mapping result is discarded. When the target mesh cell state corresponding to the sub-mapping result is determined to be inactive, the sub-mapping result and its corresponding target mesh cell are stored and bound. At the same time, the target mesh cell state of the target mesh cell corresponding to the sub-mapping result is updated, and the spherical network is updated. The updated spherical network is used as the data filtering result for the mapping results; Specifically, for any target grid cell, when the amount of data bound to the target grid cell is less than the preset amount of data, the target grid cell corresponding to the target grid cell is marked as inactive; when the amount of data bound to the target grid cell is equal to the preset amount of data, the target grid cell corresponding to the target grid cell is marked as active.
[0100] As can be seen, in this optional embodiment, the single-grid saturation triggering mechanism based on a preset data volume and the real-time state update in a data-stream manner achieve precise control over the number of samples in each spatial direction: unsaturated grids allow new data to be bound, and after saturation, they are automatically activated and all subsequent data in the same direction are removed, which improves the sampling accuracy and sampling saturation of the calibration data required by the magnetometer, and enables the early removal of redundant data, which helps to reduce storage and computing overhead.
[0101] In another optional embodiment, the update module 303 updates the mesh coverage of the pre-built spherical network according to the target data processing result in the following ways: Based on the target data processing results, determine the first number of all grid cells in the pre-constructed spherical network and the second number of all grid cells in the spherical network that are in an active state; Calculate the percentage of the second quantity to the first quantity, and use the corresponding percentage value as the new mesh coverage of the spherical network; Update the original grid coverage of the spherical network to the new grid coverage.
[0102] As can be seen, in this optional embodiment, the coverage rate is defined based on the proportion of active grids and is linked to the data filtering results. The data filtering process enables precise incremental updates and monotonically non-decreasing progression of the coverage rate. Furthermore, the binary state judgment of active / inactive can greatly reduce the computational complexity of the overall coverage rate and improve the accuracy of the update.
[0103] In yet another optional embodiment, the data acquisition module 301 acquires the target three-dimensional data collected by the magnetometer in the following specific ways: Acquire a set of initial three-dimensional data collected by the magnetometer according to a preset sampling period; The initial set of 3D data is cached in real time to a pre-set data buffer. According to the preset normalization formula, the initial three-dimensional data is normalized to obtain the normalized result of the initial three-dimensional data, which is used as the target three-dimensional data. The normalization formula is as follows:
[0104] in, These are the coordinate values of a specific initial 3D data point within the set of initial 3D data. This is the normalized result of a certain initial three-dimensional data.
[0105] As can be seen, in this optional embodiment, the initial three-dimensional data can be automatically normalized, thereby effectively reducing the spatial deviation caused by changes in magnetic field amplitude or interference, improving the accuracy and reliability of the acquired target three-dimensional data, and thus helping to improve the accuracy of the calculation results obtained by performing coverage calculation based on the accurate and reliable target three-dimensional data.
[0106] Example 4 Please see Figure 5 , Figure 5 This is a schematic diagram of another magnetometer calibration data acquisition device based on three-dimensional spatial coverage disclosed in an embodiment of the present invention. Figure 5 As shown, the magnetometer calibration data acquisition device based on three-dimensional spatial coverage may include: Memory 401 storing executable program code; Processor 402 coupled to memory 401; The processor 402 calls the executable program code stored in the memory 401 to execute some or all of the steps in any of the magnetometer calibration data acquisition methods based on three-dimensional spatial coverage described in Embodiment 1 or Embodiment 2 of the present invention.
[0107] Example 5 This invention discloses a computer storage medium storing computer instructions. When these computer instructions are invoked, they are used to execute some or all of the steps in any of the magnetometer calibration data acquisition methods based on three-dimensional spatial coverage described in Embodiment 1 or Embodiment 2 of this invention.
[0108] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0109] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0110] Finally, it should be noted that the above embodiments are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for acquiring magnetometer calibration data based on three-dimensional spatial coverage, characterized in that, The method includes: When a calibration operation for the magnetometer is triggered, target three-dimensional data acquired by the magnetometer is obtained, the target three-dimensional data including multiple pre-processed sub-data; The target 3D data is sequentially subjected to coordinate transformation, spherical mapping, and data filtering operations to obtain the target data processing result for the target 3D data. The grid coverage of the pre-constructed spherical network is updated based on the target data processing results, and it is determined whether the grid coverage has reached a preset target threshold. When it is determined that the grid coverage has reached the target threshold, a first control command is output. The first control command is used to control the magnetometer to stop acquiring new three-dimensional data and to trigger a calibration operation for the magnetometer.
2. The magnetometer calibration data acquisition method based on three-dimensional spatial coverage according to claim 1, characterized in that, The method further includes: When it is determined that the grid coverage rate has not reached the target threshold, a second control command is output; The second control command controls the magnetometer to continue acquiring new three-dimensional data and performs a data preprocessing process on the new three-dimensional data until the latest grid coverage reaches the target threshold, at which point the first control command is output; the first control command is also used to prompt the completion of the acquisition operation for the magnetometer calibration data; The data preprocessing process includes sequentially performing the coordinate transformation operation, the spherical mapping operation, the data filtering operation, and the update and judgment operation of the mesh coverage of the spherical network on the new three-dimensional data.
3. The magnetometer calibration data acquisition method based on three-dimensional spatial coverage according to claim 1 or 2, characterized in that, The process of sequentially performing coordinate transformation, spherical mapping, and data filtering operations on the target 3D data yields target data processing results, including: According to a preset coordinate transformation formula, a coordinate transformation operation is performed on the target 3D data to obtain a coordinate transformation result for the target 3D data; the coordinate transformation result includes a sub-transformation result for each sub-data. A pre-constructed spherical network is determined and the state of each grid cell in the spherical network is obtained. The spherical network is divided into multiple grid cells. The grid cell state includes an active state or an inactive state. The coordinate transformation result is mapped onto the spherical network to obtain a mapping result for the coordinate transformation result, the mapping result including a sub-mapping result for each of the sub-transformation results; Based on the target states of all the mesh cells, a data filtering operation is performed on the mapping result to obtain a data filtering result for the mapping result, which serves as the target data processing result for all the target 3D data; the target state of each mesh cell is either the active state or the inactive state.
4. The magnetometer calibration data acquisition method based on three-dimensional spatial coverage according to claim 3, characterized in that, Each of the sub-transformation results includes a sub-mapping result that maps the sub-transformation result to the target mesh cell in the spherical network: The step of performing a data filtering operation on the mapping result based on the target state of all the grid cells to obtain a data filtering result for the mapping result includes: Determine the target grid cell state of the target grid cell corresponding to each of the sub-mapping results; For each sub-mapping result, when it is determined that the target mesh cell state corresponding to the sub-mapping result is the active state, the sub-mapping result is discarded. When the state of the target mesh cell corresponding to the sub-mapping result is determined to be the inactive state, the sub-mapping result and its corresponding target mesh cell are stored and bound. At the same time, the state of the target mesh cell corresponding to the sub-mapping result is updated, and the spherical network is updated. The updated spherical network is determined as the data filtering result for the mapping result; Specifically, for any target grid cell, when the amount of data bound to the target grid cell is less than a preset amount of data, the target grid cell state corresponding to the target grid cell is marked as the inactive state; when the amount of data bound to the target grid cell is equal to the preset amount of data, the target grid cell state corresponding to the target grid cell is marked as the active state.
5. The magnetometer calibration data acquisition method based on three-dimensional spatial coverage according to claim 3, characterized in that, The coordinate transformation formula is: Where (x, y, z) are the coordinates of a sub-data after the preprocessing operation is performed. The polar angle has a range of values of 100. And it is used to indicate the angle between a certain sub-data and the Z-axis; The azimuth angle has a range of values. And it is used to indicate the projection direction of a certain sub-data in the XY plane; For each grid cell in the spherical network, when the grid cell state of the grid cell is the active state, the grid cell is not bound to new sampled data and indicates that the data sampling requirement for the grid cell has been completed; when the grid cell state of the grid cell is the inactive state, the grid cell is allowed to be bound to new sampled data.
6. The magnetometer calibration data acquisition method based on three-dimensional spatial coverage according to claim 4, characterized in that, The step of updating the grid coverage of the pre-built spherical network based on the target data processing result includes: Based on the target data processing results, determine the first number of all the grid cells in the pre-constructed spherical network and the second number of all the grid cells in the spherical network that are in the active state; Calculate the percentage of the second quantity to the first quantity, and use the corresponding percentage value as the new grid coverage of the spherical network; The original mesh coverage of the spherical network is updated to the new mesh coverage.
7. The magnetometer calibration data acquisition method based on three-dimensional spatial coverage according to claim 1, characterized in that, The acquisition of the target three-dimensional data collected by the magnetometer includes: A set of initial three-dimensional data collected by the magnetometer is acquired according to a preset sampling period; The initial set of 3D data is cached in real time to a pre-set data buffer. According to the preset normalization formula, the initial three-dimensional data is normalized to obtain the normalized result of the initial three-dimensional data, which is used as the target three-dimensional data. The normalization formula is as follows: in, These are the coordinate values of a specific initial 3D data point within the set of initial 3D data. This is the normalized result of a certain initial three-dimensional data.
8. A magnetometer calibration data acquisition device based on three-dimensional spatial coverage, characterized in that, The device includes: The data acquisition module is used to acquire target three-dimensional data collected by the magnetometer when it is determined that a calibration operation for the magnetometer is triggered. The target three-dimensional data includes multiple sub-data that have undergone preprocessing. The data processing module is used to sequentially perform coordinate transformation, spherical mapping, and data filtering operations on the target 3D data to obtain the target data processing result for the target 3D data; The update module is used to update the mesh coverage of the pre-built spherical network based on the target data processing results; The judgment module is used to determine whether the grid coverage rate has reached a preset target threshold. When it is determined that the grid coverage rate has reached the target threshold, a first control command is output. The first control command is used to control the magnetometer to stop collecting new three-dimensional data and to trigger a calibration operation for the magnetometer.
9. A magnetometer calibration data acquisition device based on three-dimensional spatial coverage, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the magnetometer calibration data acquisition method based on three-dimensional spatial coverage as described in any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the magnetometer calibration data acquisition method based on three-dimensional spatial coverage as described in any one of claims 1-7.
