Error coefficient calculation method and electronic equipment
Through sensor fusion technology of accelerometer and gyroscope data, combined with the eighth-part method and the angle invariant method, the error coefficient of the geomagnetic sensor is automatically calculated and calibration is performed, which solves the problem of cumbersome calibration of geomagnetic sensors and improves calibration speed and efficiency.
Patent Information
- Application Number
- CN202110386083.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-09
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-04-09
AI Technical Summary
The calibration process of existing geomagnetic sensors is cumbersome and slow, and requires manual operation by users, resulting in long calibration time and poor human-computer interaction performance.
The accelerometer and gyroscope data are used to obtain the Euler angle and rotation matrix through sensor fusion technology, and the ellipsoidal fit is combined with the octave method and the included angle invariant method to automatically calculate the error coefficient and calibrate it to realize automatic calibration of the geomagnetic sensor.
The calibration process is simplified, the amount of data is reduced, the calibration speed and human-computer interaction performance are improved, and automatic calibration is achieved without user participation.
Smart Images

Figure CN115200607B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of electronic equipment, and in particular to an error coefficient calculation method and electronic equipment. Background Art
[0002] With the popularization of electronic devices, its application is becoming more and more extensive. Geomagnetic sensors play a relatively important role in the monitoring of travel, sports and health by smart wearable devices.
[0003] Due to the small size, high integration, compact internal structure and circuit of electronic equipment, the geomagnetic sensor is easily affected by other structures in the electronic equipment. Therefore, the geomagnetic sensor needs to be calibrated when used.
[0004] However, currently, when in use, the user is required to manually calibrate the geomagnetic sensor, and the amount of geomagnetic data required for calibration is large, which makes the calibration process cumbersome and the calibration speed slow. Summary of the invention
[0005] The embodiments of the present application provide an error coefficient calculation method and an electronic device to solve the problem that the existing geomagnetic sensor calibration process is complicated and the calibration speed is slow.
[0006] In order to solve the above technical problems, the embodiments of the present application are implemented as follows:
[0007] In a first aspect, a method for calculating an error coefficient is provided, the method comprising: acquiring first data, the first data being geomagnetic data collected by a geomagnetic sensor; acquiring second data and third data, the second data being accelerometer data collected by an accelerometer, and the third data being gyroscope data collected by a gyroscope; obtaining Euler angles and a rotation matrix based on the second data and the third data through sensor fusion technology, the rotation matrix being a transformation matrix for transforming a carrier coordinate system into a world coordinate system; transforming the first data into fourth data and the second data into fifth data based on the rotation matrix; performing ellipsoid fitting on the fourth data and the fifth data based on Euler angles, the octave method and the angle invariance method, and calculating a target error coefficient, the target error coefficient being used to calibrate the geomagnetic data collected by the geomagnetic sensor.
[0008] As an optional implementation, in the first aspect of the embodiment of the present application, the fourth data and the fifth data are fitted with an ellipsoid based on the Euler angle, the octave method and the angle invariance method, and after the target error coefficient is calculated, the method further includes: calibrating the first data based on the target error coefficient to obtain the sixth data; and outputting the sixth data.
[0009] As an optional implementation, in the first aspect of the embodiment of the present application, the obtaining of the second data and the third data includes: obtaining the second data and the third data when the first data does not meet the target condition; wherein the target condition includes any one of the following: the absolute value of the difference between the first magnetic field strength and the second magnetic field strength is less than or equal to the first threshold; the target number is less than or equal to the second threshold; wherein the first magnetic field strength is the current reference geomagnetic field strength, and the second magnetic field strength is the geomagnetic field strength indicated by the first data; the target number is: the number of times the magnetic field strength indicated by the real-time geomagnetic data exceeds a preset range within a preset time period before obtaining the first data.
[0010] As an optional implementation, in the first aspect of the embodiment of the present application, after obtaining the first data, the method also includes: obtaining a previously saved first error coefficient; based on the first error coefficient, calibrating the first data to obtain seventh data; and outputting the seventh data when it is determined that the seventh data meets a predetermined condition; obtaining the second data and the third data includes: obtaining the second data and the third data when it is determined that the seventh data does not meet the predetermined condition; wherein the predetermined condition is used to determine whether the geomagnetic sensor needs to be calibrated.
[0011] As an optional implementation, in the first aspect of the embodiment of the present application, the predetermined condition includes: the absolute value of the difference between the first magnetic field strength and the third magnetic field strength is less than or equal to a third threshold; wherein the first magnetic field strength is the current reference geomagnetic field strength, and the third magnetic field strength is the geomagnetic field strength indicated by the seventh data.
[0012] As an optional implementation, in the first aspect of the embodiment of the present application, the fourth data and the fifth data are fitted with an ellipsoid based on the Euler angle, the octave method and the angle invariance method, and after the target error coefficient is calculated, the method further includes: updating the saved first error coefficient to the target error coefficient.
[0013] In a second aspect, an error coefficient calculation device is provided, which includes: an acquisition module, a sensor fusion module, a transformation module and a calculation module; the acquisition module is used to acquire first data, the first data being geomagnetic data collected by a geomagnetic sensor; and is also used to acquire second data and third data, the second data being accelerometer data collected by an accelerometer, and the third data being gyroscope data collected by a gyroscope; the sensor fusion module is used to obtain Euler angles and rotation matrices through sensor fusion technology based on the second data and the third data acquired by the acquisition module, the rotation matrix being a transformation matrix for transforming a carrier coordinate system into a world coordinate system; the transformation module is used to transform the first data acquired by the acquisition module into fourth data based on the rotation matrix obtained by the sensor fusion module, and to transform the second data acquired by the acquisition module into fifth data; the calculation module is used to perform ellipsoid fitting on the fourth data and the fifth data obtained by the transformation module based on the Euler angles, the octave method and the angle invariance method obtained by the sensor fusion module, and calculate a target error coefficient, and the target error coefficient is used to calibrate the geomagnetic data collected by the geomagnetic sensor.
[0014] As an optional implementation, in the second aspect of the embodiment of the present application, the device also includes: a calibration module and an output module; the calibration module is used to perform ellipsoid fitting on the fourth data and the fifth data based on the Euler angle, the octant method and the angle invariance method in the calculation module, and after calculating the target error coefficient, calibrate the first data based on the target error coefficient to obtain the sixth data; the output module is used to output the sixth data obtained by the calibration module.
[0015] As an optional implementation, in the second aspect of the embodiment of the present application, the acquisition module is specifically used to acquire the second data and the third data when the first data does not meet the target condition; wherein the target condition includes any one of the following: the absolute value of the difference between the first magnetic field strength and the second magnetic field strength is less than or equal to the first threshold; the target number is less than or equal to the second threshold; wherein the first magnetic field strength is the current reference geomagnetic field strength, and the second magnetic field strength is the geomagnetic field strength indicated by the first data; the target number is: the number of times the magnetic field strength indicated by the real-time geomagnetic data exceeds a preset range within a preset time period before acquiring the first data.
[0016] As an optional implementation, in the second aspect of the embodiment of the present application, the device also includes: a calibration module and an output module; the acquisition module is also used to acquire the first error coefficient saved previously after acquiring the first data; the calibration module is used to calibrate the first data based on the first error coefficient acquired by the acquisition module to obtain seventh data; the output module is used to output the seventh data when it is determined that the seventh data obtained by the calibration module meets a predetermined condition; the acquisition module is specifically used to acquire the second data and the third data when it is determined that the seventh data obtained by the calibration module does not meet the predetermined condition; wherein the predetermined condition is used to determine whether the geomagnetic sensor needs to be calibrated.
[0017] As an optional implementation, in the second aspect of the embodiment of the present application, the predetermined condition includes: the absolute value of the difference between the first magnetic field strength and the third magnetic field strength is less than or equal to a third threshold; wherein the first magnetic field strength is the current reference geomagnetic field strength, and the third magnetic field strength is the geomagnetic field strength indicated by the seventh data.
[0018] As an optional implementation, in the second aspect of the embodiment of the present application, the device also includes: an updating module; the updating module is used to update the saved first error coefficient to the target error coefficient after the calculation module performs ellipsoid fitting on the fourth data and the fifth data based on the Euler angle, the octant method and the angle invariance method, and calculates the target error coefficient.
[0019] In a third aspect, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements part or all of the steps of the error coefficient calculation method described in the first aspect.
[0020] In a fourth aspect, a computer-readable storage medium is provided, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, part or all of the steps of the error coefficient calculation method described in the first aspect are implemented.
[0021] In a fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute part or all of the steps of the error coefficient calculation method of the first aspect.
[0022] In a sixth aspect, an application publishing platform is provided, which is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes part or all of the steps of the error coefficient calculation method of the first aspect.
[0023] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0024] The error coefficient calculation method provided in the embodiment of the present application is based on the second data (accelerometer data collected by the accelerometer) and the third data (gyroscope data collected by the gyroscope), and the Euler angle and the rotation matrix (the transformation matrix that transforms the carrier coordinate system to the world coordinate system) are obtained through the sensor fusion technology; based on the rotation matrix, the first data (geomagnetic data collected by the geomagnetic sensor) is transformed into the fourth data, and the second data is transformed into the fifth data; based on the Euler angle, the octave method and the angle invariant method, the fourth data and the fifth data are ellipsoidally fitted to calculate the target error coefficient, and the target error coefficient is used to calibrate the geomagnetic data collected by the geomagnetic sensor. This scheme adopts an accelerometer, a gyroscope and combines the characteristics of gravity acceleration and the earth's magnetic field to design an automatic calibration algorithm, so as to realize the automatic calibration of the geomagnetic sensor. The calibration process is simple and does not require user participation; and through the octave method and the angle invariant method, the data distribution can be automatically determined, and the calibration can be completed only by satisfying the distribution of the spherical part, so that the calibration algorithm requires less data and the calibration speed is fast. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 This is one of the flow charts of the error coefficient calculation method provided in the embodiment of the present application;
[0027] Figure 2 This is a schematic diagram of the eighth division method provided in an embodiment of the present application;
[0028] Figure 3 This is a schematic diagram of an angle invariance method provided in an embodiment of the present application;
[0029] Figure 4 This is the second flow chart of the error coefficient calculation method provided in the embodiment of the present application;
[0030] Figure 5 This is the third flow chart of the error coefficient calculation method provided in the embodiment of the present application;
[0031] Figure 6 This is a fourth flow chart of the error coefficient calculation method provided in the embodiment of the present application;
[0032] Figure 7 is a structural schematic diagram of an error coefficient calculation device provided in an embodiment of the present application;
[0033] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0035] The terms "first" and "second" in the specification and claims of this application are used to distinguish different objects rather than to describe a specific order of objects. For example, first data and second data are used to distinguish different data rather than to describe a specific order of data.
[0036] The terms "including" and "having" and any variations thereof in the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0037] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0038] The following are some technical terms involved in the embodiments of this application:
[0039] Carrier coordinate system: The coordinate system of the device and sensor itself, which will change with the device and sensor.
[0040] World coordinate system: A reference coordinate system based on the earth, which is fixed and unchanging.
[0041] Geomagnetic sensor calibration: It is essentially the process of collecting geomagnetic data to solve the error coefficient of the geomagnetic sensor. Ideally, the geomagnetic field in space has a fixed direction and size. During the collection process, the data points will be distributed on a spherical surface with the magnetic field strength as the radius. However, due to factors of the device itself and environmental interference, the raw data collected by the geomagnetic sensor will be different and will become an ellipsoid. The calibration process is the process of collecting data distribution points and then calculating the error coefficient.
[0042] In the related technology, currently, during the calibration process of the geomagnetic sensor, the user is required to manually trigger the collection of geomagnetic data, control the geomagnetic sensor to collect data through specific actions, and determine whether the amount of geomagnetic data collected meets the standards. Then, when the user determines that the amount of geomagnetic data collected meets the standards, the calibration of the geomagnetic sensor is triggered. The calibration process is relatively cumbersome, and due to the large amount of geomagnetic data and the complexity of the calibration algorithm, the calibration speed is slow and the human-computer interaction performance is poor.
[0043] In order to solve the above-mentioned practical technical problems, the embodiments of the present application provide an error coefficient calculation method and an electronic device. By adopting an accelerometer and a gyroscope and combining the characteristics of gravity acceleration and the earth's magnetic field, an automatic calibration algorithm is designed to realize automatic calibration of the geomagnetic sensor. The calibration process is simple and does not require user participation. Through the octave method and the angle invariance method, the data distribution can be automatically determined, and the calibration can be completed only by satisfying the distribution of the spherical part. In this way, the calibration algorithm requires less data and the calibration speed is fast, which can improve the human-computer interaction performance.
[0044] The electronic devices involved in the embodiments of the present application may be mobile phones, tablet computers, laptop computers, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc. Among them, the wearable devices may be smart watches, smart bracelets, phone watches, smart anklets, smart earrings, smart necklaces, smart headphones, etc., which are not limited in the embodiments of the present application.
[0045] The execution subject of the error coefficient calculation method provided in the embodiment of the present application can be the above-mentioned electronic device, or it can be a functional module and / or functional entity in the electronic device that can implement the error coefficient calculation method. The specific one can be determined according to actual use requirements, and the embodiment of the present application is not limited. The following takes an electronic device as an example to exemplarily illustrate the error coefficient calculation method provided in the embodiment of the present application.
[0046] Exemplarily, the error coefficient calculation method provided in the embodiments of the present application can be applied to the scenario of calibrating the geomagnetic sensor of a small wearable electronic device.
[0047] like Figure 1 As shown, the embodiment of the present application provides a method for calculating an error coefficient, which may include the following steps:
[0048] S101: An electronic device obtains first data.
[0049] The first data is geomagnetic data collected by a geomagnetic sensor.
[0050] In the embodiment of the present application, the geomagnetic sensor collects geomagnetic data (first data). The method and process of collecting the first data can refer to the existing related technology, and the embodiment of the present application is not limited. After collecting the first data, the geomagnetic sensor can send the collected first data to the electronic device (which can be a processor of the electronic device).
[0051] Optionally, after acquiring the first data, the electronic device may determine whether the first data meets the target condition, that is, determine whether the first data needs to be calibrated, or determine whether the geomagnetic sensor needs to be calibrated. The target condition is used to determine whether the geomagnetic sensor needs to be calibrated (or the target condition is used to determine whether the first data needs to be calibrated). If it is determined that the first data meets the target condition (i.e., no calibration is required), the electronic device may output the first data; if it is determined that the first data does not meet the target condition (i.e., calibration is required), the electronic device may perform the following steps.
[0052] In the embodiment of the present application, calibration can reduce energy consumption when the first data needs to be calibrated.
[0053] S102: The electronic device obtains second data and third data.
[0054] The second data is accelerometer data collected by an accelerometer, and the third data is gyroscope data collected by a gyroscope.
[0055] In the embodiment of the present application, the accelerometer (sensor) collects accelerometer data (second data), and the method and process of collecting the second data can refer to the existing related technology, and the embodiment of the present application is not limited. After collecting the second data, the accelerometer can send the collected second data to the electronic device (which can be a processor of the electronic device).
[0056] In the embodiment of the present application, the gyroscope (sensor) collects gyroscope data (third data), and the method and process of collecting the third data can refer to the existing related technology, and the embodiment of the present application is not limited. After collecting the third data, the gyroscope can send the collected third data to the electronic device (which can be a processor of the electronic device).
[0057] Optionally, in an embodiment of the present application, the geomagnetic sensor can be a three-axis geomagnetic sensor, the accelerometer can be a three-axis accelerometer, and the gyroscope can be a three-axis gyroscope. Then, the first data, the second data, and the third data are all 3×1 vectors, including three-dimensional data of three axes (three directions) of x, y, and z.
[0058] Optionally, the above S102 can be specifically implemented by the following S102a.
[0059] S102a: When the first data does not meet the target condition, the electronic device obtains the second data and the third data.
[0060] The target condition includes any one of the following: the absolute value of the difference between the first magnetic field strength and the second magnetic field strength is less than or equal to the first threshold; the target number is less than or equal to the second threshold.
[0061] Among them, the first magnetic field strength is the current reference geomagnetic field strength, and the second magnetic field strength is the geomagnetic field strength indicated by the first data; the target number of times is: the number of times the magnetic field strength indicated by the real-time geomagnetic data exceeds the preset range within the preset time before obtaining the first data.
[0062] It can be understood that the first data does not meet the target condition, that is, the first data needs to be calibrated. S102a can be understood as the electronic device acquiring the second data and the third data when determining that the first data needs to be calibrated.
[0063] It is understandable that the first threshold and the second threshold can be set according to actual use requirements, and the embodiment of the present application does not limit this. The preset duration can be determined according to actual use requirements, and the embodiment of the present application does not limit this.
[0064] It can be understood that the first magnetic field strength can be the actual geomagnetic field strength of the current location calculated by a geomagnetic field model maintained by an organization, and specific reference is made to related technologies. The first magnetic field strength can change with the change of geographical location, and can also change with the passage of time, and can be specifically determined according to actual conditions, and the embodiments of this application do not limit it.
[0065] Optionally, in the embodiment of the present application, the first data is a three-dimensional vector, and the second magnetic field strength may be the modulus of the three-dimensional vector. The second magnetic field strength may also be other magnetic field strengths indicated by the first data, which is not limited in the embodiment of the present application.
[0066] Exemplarily, the first data is (x1, y1, z1), and the second magnetic field strength is
[0067] It can be understood that the understanding of the magnetic field strength indicated by the geomagnetic data can refer to the above description of the second magnetic field strength indicated by the first data, which will not be repeated here.
[0068] It can be understood that the preset range is the range of actual geomagnetic field strength (that is, the reference range of geomagnetic field strength), which can be determined based on actual conditions and is not limited in the embodiments of the present application.
[0069] Exemplarily, the preset range may be 30 amperes per meter to 60 amperes per meter.
[0070] In the embodiment of the present application, whether calibration is required is determined according to the target conditions, so that calibration can be performed when required and no calibration is required when not required, which can reduce the power consumption of the electronic device.
[0071] S103: The electronic device obtains Euler angles and a rotation matrix based on the second data and the third data through sensor fusion technology.
[0072] The rotation matrix is a transformation matrix used to transform the carrier coordinate system into the world coordinate system.
[0073] It can be understood that the sensor fusion technology can be determined according to actual usage requirements and is not limited in the embodiments of the present application.
[0074] Exemplarily, the sensor fusion technology may be any one of the following: an extended Kalman filter algorithm, a gradient filter algorithm, a complementary filter algorithm, and an artificial neural network method.
[0075] It can be understood that the extended Kalman filter algorithm can effectively overcome the impact of data processing errors and instability on the information fusion process. The artificial neural network method uses the data obtained by the sensor as the input of the network by imitating the structure and working principle of the human brain, and completes certain intelligent tasks on the corresponding machine or model through network training to eliminate the interference of non-target parameters. The neural network method is effective in eliminating the cross-influence of various factors in the collaborative work of multiple sensors, and it is easy to program and has stable output.
[0076] For any of the above sensor fusion technologies, reference may be made to the relevant technical description, and the embodiments of the present application are not limited thereto.
[0077] It is understandable that the accuracy of the Euler angles and rotation matrices obtained by using different sensor fusion technologies is different. The description of the Euler angles and rotation matrices can refer to the existing related technologies, and the embodiments of this application are not limited thereto.
[0078] S104: The electronic device transforms the first data into fourth data and transforms the second data into fifth data based on the rotation matrix.
[0079] It can be understood that S104 converts the geomagnetic data and acceleration data measured by the sensor in the carrier coordinate system into the world coordinate system. The specific conversion method can refer to the existing related technology, and the embodiment of the present application does not limit it.
[0080] S105: The electronic device performs ellipsoid fitting on the fourth data and the fifth data based on the Euler angle, the octave method and the angle invariance method, and calculates a target error coefficient.
[0081] The target error coefficient is used to calibrate the geomagnetic data collected by the geomagnetic sensor.
[0082] It can be understood that in the embodiment of the present application, an accelerometer and a gyroscope are used for sensor fusion to obtain Euler angles and a rotation matrix. The geomagnetic data and acceleration data measured by the sensor in the carrier coordinate system are converted to the world coordinate system through the rotation matrix. When the user uses the device, the error coefficient of the geomagnetic sensor is solved by combining the Euler angle, the octave method, the ellipsoid fitting algorithm and the unchanged angle.
[0083] In the embodiment of the present application, the geomagnetic sensor calibration algorithm can automatically determine the distribution range of the geomagnetic data collected during use on the spherical surface through the octave method, thereby deciding whether to perform fitting calculations. The octave method divides the sphere into 8 regions. The Euler angles obtained through sensor fusion can be used to know the posture of the current device. The posture and the collected original data points are matched to obtain the distribution of the collected data on the spherical surface. When the data point distribution satisfies at least 5 of the eight regions in the octave method, a fitting calculation can be performed to obtain the error coefficient. This process can be completed automatically without human intervention. Among them, the schematic diagram of the octave method is shown as follows: Figure 2 shown.
[0084] The angle invariance method means that in the world coordinate system, for a small area, the gravity acceleration and the direction of the earth's magnetic field remain unchanged. Based on this feature, it can be used for geomagnetic sensor calibration. The angle invariance method diagram is as follows Figure 3 As shown in the figure, the angle between gravity acceleration and the earth's magnetic field is θ. After the magnetic field of the carrier coordinate system is converted to the world coordinate system using the rotation matrix obtained by sensor fusion, the magnitude and direction of the magnetic field measured by the geomagnetic sensor should satisfy the characteristic that the angle of gravity acceleration remains unchanged, which can be used to calibrate the error coefficient of the geomagnetic sensor.
[0085] In the embodiment of the present application, the octave method can be used to automatically determine whether the distribution of the geomagnetic data meets the requirements (thus eliminating the need for human judgment), and the angle invariance method can be used to reduce the number of geomagnetic data points required for ellipsoid fitting (i.e., reduce the amount of data required for the calibration algorithm), thereby simplifying the calibration process and increasing the calibration speed.
[0086] Exemplarily, the target error coefficient is a 3×3 matrix and a 3×1 vector.
[0087] The error coefficient calculation method provided in the embodiment of the present application is based on the second data (accelerometer data collected by the accelerometer) and the third data (gyroscope data collected by the gyroscope), and the Euler angle and the rotation matrix (the transformation matrix that transforms the carrier coordinate system to the world coordinate system) are obtained through the sensor fusion technology; based on the rotation matrix, the first data (geomagnetic data collected by the geomagnetic sensor) is transformed into the fourth data, and the second data is transformed into the fifth data; based on the Euler angle, the octave method and the angle invariant method, the fourth data and the fifth data are ellipsoidally fitted to calculate the target error coefficient, and the target error coefficient is used to calibrate the geomagnetic data collected by the geomagnetic sensor. This scheme adopts an accelerometer, a gyroscope and combines the characteristics of gravity acceleration and the earth's magnetic field to design an automatic calibration algorithm, so as to realize the automatic calibration of the geomagnetic sensor. The calibration process is simple and does not require user participation; and through the octave method and the angle invariant method, the data distribution can be automatically determined, and the calibration can be completed only by satisfying the distribution of the spherical part, so that the calibration algorithm requires less data and the calibration speed is fast.
[0088] Optionally, combined Figure 1 ,like Figure 4 As shown, after S105, the error coefficient calculation method provided in the embodiment of the present application may further include the following S106 to S107.
[0089] S106. The electronic device calibrates the first data based on the target error coefficient to obtain sixth data.
[0090] It can be understood that the method for calibrating the first data according to the target error coefficient can refer to the existing related technology, and the embodiment of the present application is not limited thereto.
[0091] Exemplarily, assuming that the first data is a 3×1 vector X, the target error coefficient is a 3×3 matrix Y and a 3×1 vector Z, and the sixth data is a 3×1 vector M, then M=(XZ)×Y.
[0092] S107. The electronic device outputs sixth data.
[0093] In the embodiment of the present application, the sixth data calibrated based on the target error coefficient is geomagnetic data that meets predetermined requirements (the description of the predetermined requirements can refer to the following description).
[0094] Optionally, combined Figure 4 ,like Figure 5 As shown, after S101, the error coefficient calculation method provided in the embodiment of the present application may further include the following S108 to S111, and the above S102 or S102a may be specifically implemented by the following S102b.
[0095] S108. The electronic device obtains a previously saved first error coefficient.
[0096] It can be understood that the first error coefficient is the error coefficient obtained by the last calibration of the geomagnetic sensor. The first error coefficient is also a 3×3 matrix and a 3×1 vector. When the electronic device is started for the first time after leaving the factory, the 3×3 matrix and 3×1 vector in the first error coefficient can both be 0, or any preset value, which can be determined according to actual use requirements, and is not limited in the embodiments of the present application.
[0097] S109. The electronic device calibrates the first data based on the first error coefficient to obtain seventh data.
[0098] Among them, the method of calibrating the first data according to the first error coefficient can refer to the above-mentioned description of calibrating the first data according to the target error coefficient, which will not be repeated here.
[0099] S110: The electronic device determines whether the seventh data meets a predetermined condition.
[0100] S111. When determining that the seventh data meets a predetermined condition, the electronic device outputs the seventh data.
[0101] S102b: When determining that the seventh data does not satisfy the predetermined condition, the electronic device obtains the second data and the third data.
[0102] The predetermined condition is used to determine whether the geomagnetic sensor needs to be calibrated.
[0103] Optionally, the predetermined condition includes: the absolute value of the difference between the first magnetic field strength and the third magnetic field strength is less than or equal to a third threshold; wherein the first magnetic field strength is the current reference geomagnetic field strength, and the third magnetic field strength is the geomagnetic field strength indicated by the seventh data.
[0104] The description of the first magnetic field strength can refer to the description of the first magnetic field strength in S102a above, which will not be repeated here. The description of the third magnetic field strength can refer to the description of the second magnetic field strength in S102a above, which will not be repeated here.
[0105] In an embodiment of the present application, within a certain period of time, the electronic device can use the error coefficient obtained from the last calibration of the geomagnetic sensor to calibrate the collected geomagnetic data without recalibrating the geomagnetic sensor, thereby eliminating the need to calibrate the geomagnetic sensor every time, thereby reducing power consumption.
[0106] Optionally, combined Figure 5 ,like Figure 6 As shown, after S105, the error coefficient calculation method provided in the embodiment of the present application may further include the following S112.
[0107] S112: The electronic device updates the stored first error coefficient to the target error coefficient.
[0108] It can be understood that after the electronic device recalibrates the geomagnetic sensor, the error coefficient stored in the electronic device can be updated so that within a certain period of time, the electronic device can use the updated error coefficient to calibrate the geomagnetic data, thereby reducing the number of times the geomagnetic sensor is calibrated and reducing the power consumption of the electronic device.
[0109] like Figure 7 As shown, the embodiment of the present application provides an error coefficient calculation device 200, which includes: an acquisition module 201, a sensor fusion module 202, a transformation module 203 and a calculation module 204; the acquisition module 201 is used to acquire first data, the first data is geomagnetic data collected by a geomagnetic sensor; it is also used to acquire second data and third data, the second data is accelerometer data collected by an accelerometer, and the third data is gyroscope data collected by a gyroscope; the sensor fusion module 202 is used to obtain the Euler angle and the rotation angle through the sensor fusion technology based on the second data and the third data acquired by the acquisition module 301 A rotation matrix, which is a transformation matrix for transforming a carrier coordinate system into a world coordinate system; the transformation module 203, which is used to transform the first data acquired by the acquisition module 201 into fourth data, and to transform the second data acquired by the acquisition module 201 into fifth data based on the rotation matrix obtained by the sensor fusion module 202; the calculation module 204, which is used to perform ellipsoid fitting on the fourth data and the fifth data obtained by the transformation module 203 based on the Euler angle, the octave method and the angle invariance method obtained by the sensor fusion module 202, and calculate the target error coefficient, which is used to calibrate the geomagnetic data collected by the geomagnetic sensor.
[0110] As an optional implementation of the present application, Figure 7 As shown, the error coefficient calculation device 200 also includes: a calibration module 205 and an output module 206; the calibration module 205 is used to perform ellipsoid fitting on the fourth data and the fifth data based on the Euler angle, the octave method and the angle invariance method in the calculation module 204, and after calculating the target error coefficient, calibrate the first data based on the target error coefficient to obtain the sixth data; the output module 206 is used to output the sixth data obtained by the calibration module 205.
[0111] As an optional implementation of an embodiment of the present application, the acquisition module 201 is specifically used to acquire the second data and the third data when the first data does not meet the target condition; wherein the target condition includes any one of the following: the absolute value of the difference between the first magnetic field strength and the second magnetic field strength is less than or equal to the first threshold; the target number is less than or equal to the second threshold; wherein the first magnetic field strength is the current reference geomagnetic field strength, and the second magnetic field strength is the geomagnetic field strength indicated by the first data; the target number is: the number of times the magnetic field strength indicated by the real-time geomagnetic data exceeds a preset range within a preset time period before acquiring the first data.
[0112] As an optional implementation of the present application, Figure 7 As shown, the error coefficient calculation device 200 also includes: a calibration module 205 and an output module 206; the acquisition module 201 is also used to acquire the first error coefficient saved before after acquiring the first data; the calibration module 205 is used to calibrate the first data based on the first error coefficient acquired by the acquisition module 201 to obtain the seventh data; the output module 206 is used to output the seventh data when it is determined that the seventh data obtained by the calibration module 205 meets the predetermined condition; the acquisition module 201 is specifically used to acquire the second data and the third data when it is determined that the seventh data obtained by the calibration module 205 does not meet the predetermined condition; wherein the predetermined condition is used to determine whether the geomagnetic sensor needs to be calibrated.
[0113] As an optional implementation of an embodiment of the present application, the predetermined condition includes: the absolute value of the difference between the first magnetic field strength and the third magnetic field strength is less than or equal to a third threshold; wherein the first magnetic field strength is the current reference geomagnetic field strength, and the third magnetic field strength is the geomagnetic field strength indicated by the seventh data.
[0114] As an optional implementation of the present application, Figure 7 As shown, the error coefficient calculation device 200 also includes: an updating module 207; the updating module 207 is used to perform ellipsoid fitting on the fourth data and the fifth data based on the Euler angle, the octave method and the angle invariance method in the calculation module 204, and after calculating the target error coefficient, the saved first error coefficient is updated to the target error coefficient.
[0115] It should be noted that: Figure 7 As shown, the modules that must be included in the error coefficient calculation device 200 are indicated by solid-line boxes, such as the acquisition module 201, the sensor fusion module 202, the transformation module 203 and the calculation module 204; the modules that may or may not be included in the error coefficient calculation device 200 are indicated by dotted-line boxes, such as the calibration module 205, the output module 206 and the update module 207.
[0116] In the embodiments of the present application, each module can implement the error coefficient calculation method provided in the above method embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0117] Figure 8 A schematic diagram of the hardware structure of an electronic device for implementing each embodiment of the present application is shown in FIG. Figure 8 As shown, the electronic device includes but is not limited to: radio frequency (RF) circuit 301, memory 302, input unit 303, display unit 304, sensor 305, audio circuit 306, wireless communication (WiFi) module 307, processor 308, power supply 309, and camera 310. Among them, the RF circuit 301 includes a receiver 3011 and a transmitter 3012. Those skilled in the art can understand that Figure 8 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0118] The RF circuit 301 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 308 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 301 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 301 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
[0119] The memory 302 can be used to store software programs and modules. The processor 308 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 302. The memory 302 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 302 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0120] The input unit 303 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the input unit 303 may include a touch panel 3031 and other input devices 3032. The touch panel 3031, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 3031 or near the touch panel 3031 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 3031 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 308, and can receive and execute commands sent by the processor 308. In addition, the touch panel 3031 can be implemented in a variety of ways such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 3031, the input unit 303 may also include other input devices 3032. Specifically, other input devices 3032 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0121] The display unit 304 can be used to display information input by the user or information provided to the user and various menus of the electronic device. The display unit 304 may include a display panel 3041. Optionally, the display panel 3041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 3031 may cover the display panel 3041. When the touch panel 3031 detects a touch operation on or near it, it is transmitted to the processor 308 to determine the touch event. Subsequently, the processor 308 provides a corresponding visual output on the display panel 3041 according to the touch event. Although in Figure 8 In the embodiment, the touch panel 3031 and the display panel 3041 are used as two independent components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel 3031 and the display panel 3041 can be integrated to implement the input and output functions of the electronic device.
[0122] The electronic device may also include at least one sensor 305, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 3041 according to the brightness of the ambient light, and the proximity sensor may exit the display panel 3041 and / or the backlight when the electronic device is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used for applications that identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, geomagnetic sensors, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured in the electronic device, they will not be repeated here. In the embodiment of the present application, the electronic device may include an accelerometer, a depth sensor, or a distance sensor, etc.
[0123] The audio circuit 306, the speaker 3061, and the microphone 3062 can provide an audio interface between the user and the electronic device. The audio circuit 306 can transmit the received audio data to the speaker 3061 after converting the received audio data into an electrical signal, which is converted into a sound signal for output by the speaker 3061; on the other hand, the microphone 3062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 306 and converted into audio data, and then the audio data is output to the processor 308 for processing, and then sent to another electronic device through the RF circuit 301, or the audio data is output to the memory 302 for further processing.
[0124] WiFi is a short-range wireless transmission technology. Electronic devices can help users send and receive emails, browse web pages, and access streaming media through WiFi module 307. It provides users with wireless broadband Internet access. Figure 8 A WiFi module 307 is shown, but it is understandable that it is not an essential component of the electronic device and can be omitted as needed without changing the essence of the invention.
[0125] The processor 308 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, so as to monitor the electronic device as a whole. Optionally, the processor 308 may include one or more processing units; preferably, the processor 308 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 308.
[0126] The electronic device also includes a power supply 309 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 308 through a power management system, so that the power management system can manage charging, discharging, power consumption management and other functions. Although not shown, the electronic device can also include a Bluetooth module, etc., which will not be repeated here.
[0127] In an embodiment of the present application, the processor 308 is used to obtain first data, where the first data is geomagnetic data collected by a geomagnetic sensor; obtain second data and third data, where the second data is accelerometer data collected by an accelerometer, and the third data is gyroscope data collected by a gyroscope; based on the second data and the third data, obtain Euler angles and a rotation matrix through sensor fusion technology, and the rotation matrix is a transformation matrix used to transform a carrier coordinate system into a world coordinate system; based on the rotation matrix, transform the first data into fourth data, and transform the second data into fifth data; based on the Euler angle, the octave method and the angle invariance method, perform ellipsoid fitting on the fourth data and the fifth data, and calculate the target error coefficient, which is used to calibrate the geomagnetic data collected by the geomagnetic sensor.
[0128] Optionally, the processor 308 may also be used to implement other processes implemented by the electronic device in the method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be described here.
[0129] An embodiment of the present application also provides an electronic device, which may include: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the error coefficient calculation method provided in the above method embodiment can be implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0130] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the error coefficient calculation method provided in the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0131] An embodiment of the present application also provides a computer program product, wherein the computer program product includes computer instructions. When the computer program product runs on a processor, the processor executes the computer instructions to implement the error coefficient calculation method provided in the above method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0132] An embodiment of the present application also provides an application publishing platform, wherein the application publishing platform is used to publish a computer program product. When the computer program product runs on a computer, the computer executes part or all of the steps of the error coefficient calculation method in the above method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0133] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
[0134] The electronic device provided in the embodiment of the present application can implement each process shown in the above method embodiment, and will not be described again here to avoid repetition.
[0135] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0136] The units described above 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.
[0137] 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.
[0138] If the above-mentioned 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-accessible memory. Based on this understanding, the technical solution of the present application, in essence, 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 requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.
[0139] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
Claims
1. A method for calculating an error coefficient, characterized in that: The method comprises: Acquire first data, where the first data is geomagnetic data collected by a geomagnetic sensor; Acquire second data and third data, wherein the second data is accelerometer data collected by an accelerometer, and the third data is gyroscope data collected by a gyroscope; Based on the second data and the third data, obtaining Euler angles and a rotation matrix by using a sensor fusion technology, wherein the rotation matrix is a transformation matrix for transforming a carrier coordinate system into a world coordinate system; Based on the rotation matrix, transform the first data into fourth data, and transform the second data into fifth data; Based on the Euler angle, the octave method and the angle invariance method, the fourth data and the fifth data are fitted with an ellipsoid to calculate a target error coefficient, and the target error coefficient is used to calibrate the geomagnetic data collected by the geomagnetic sensor; The eight-point method automatically determines the distribution range of the first data collected on the spherical surface during use, thereby determining whether to perform ellipsoid fitting calculation on the fourth data and the fifth data; The octave method divides the spherical surface into eight regions, obtains the posture of the current device through the Euler angle obtained by the sensor fusion, matches the posture with the collected first data, obtains the data point distribution of the first data on the spherical surface, and when the data point distribution of the first data satisfies at least five of the eight regions in the octave method, performs ellipsoid fitting calculation on the fourth data and the fifth data to obtain the target error coefficient; The angle invariance method uses the rotation matrix obtained by the sensor fusion to convert the magnetic field of the carrier coordinate system to the world coordinate system. According to the magnetic field size and direction measured by the geomagnetic sensor, which should satisfy the characteristics that the gravitational acceleration and the direction of the earth's magnetic field are fixed and unchanged, it is used to calibrate the target error coefficient of the geomagnetic sensor.
2. The method according to claim 1, characterized in that After performing ellipsoid fitting on the fourth data and the fifth data based on the Euler angle, the octave method and the angle invariance method and calculating the target error coefficient, the method further includes: Based on the target error coefficient, calibrate the first data to obtain sixth data; The sixth data is output.
3. The method according to claim 1 or 2, characterized in that: The obtaining of the second data and the third data comprises: When the first data does not meet the target condition, acquiring second data and third data; The target condition includes any of the following: An absolute value of a difference between the first magnetic field strength and the second magnetic field strength is less than or equal to a first threshold; The target number is less than or equal to a second threshold; Among them, the first magnetic field strength is the current reference geomagnetic field strength, and the second magnetic field strength is the geomagnetic field strength indicated by the first data; the target number of times is: the number of times the magnetic field strength indicated by the real-time geomagnetic data exceeds a preset range within a preset time before obtaining the first data.
4. The method according to claim 1 or 2, characterized in that: After obtaining the first data, the method further includes: Get the first error coefficient saved previously; Based on the first error coefficient, calibrate the first data to obtain seventh data; When it is determined that the seventh data satisfies a predetermined condition, outputting the seventh data; The obtaining of the second data and the third data comprises: If it is determined that the seventh data does not satisfy the predetermined condition, acquiring the second data and the third data; The predetermined condition is used to determine whether the geomagnetic sensor needs to be calibrated.
5. The method according to claim 4, characterized in that The predetermined conditions include: An absolute value of a difference between the first magnetic field strength and the third magnetic field strength is less than or equal to a third threshold; The first magnetic field strength is the current reference geomagnetic field strength, and the third magnetic field strength is the geomagnetic field strength indicated by the seventh data.
6. The method according to claim 4, characterized in that After performing ellipsoid fitting on the fourth data and the fifth data based on the Euler angle, the octave method and the angle invariance method and calculating the target error coefficient, the method further includes: The saved first error coefficient is updated to the target error coefficient.
7. An error coefficient calculation device, characterized in that: The device comprises: an acquisition module, a sensor fusion module, a transformation module and a calculation module; The acquisition module is used to acquire first data, where the first data is geomagnetic data collected by a geomagnetic sensor; and is also used to acquire second data and third data, where the second data is accelerometer data collected by an accelerometer, and the third data is gyroscope data collected by a gyroscope; The sensor fusion module is used to obtain Euler angles and a rotation matrix through sensor fusion technology based on the second data and the third data acquired by the acquisition module, where the rotation matrix is a transformation matrix used to transform a carrier coordinate system into a world coordinate system; The transformation module is used to transform the first data acquired by the acquisition module into fourth data and transform the second data acquired by the acquisition module into fifth data based on the rotation matrix obtained by the sensor fusion module; The calculation module is used to perform ellipsoid fitting on the fourth data and the fifth data obtained by the transformation module based on the Euler angle, the octant method and the angle invariance method obtained by the sensor fusion module, and calculate a target error coefficient, wherein the target error coefficient is used to calibrate the geomagnetic data collected by the geomagnetic sensor; The eight-point method automatically determines the distribution range of the first data collected on the spherical surface during use, thereby determining whether to perform ellipsoid fitting calculation on the fourth data and the fifth data; The octave method divides the spherical surface into eight regions, obtains the posture of the current device through the Euler angle obtained by the sensor fusion, matches the posture with the collected first data, obtains the data point distribution of the first data on the spherical surface, and when the data point distribution of the first data satisfies at least five of the eight regions in the octave method, performs ellipsoid fitting calculation on the fourth data and the fifth data to obtain the target error coefficient; The angle invariance method uses the rotation matrix obtained by the sensor fusion to convert the magnetic field of the carrier coordinate system to the world coordinate system. According to the magnetic field size and direction measured by the geomagnetic sensor, which should satisfy the characteristics that the gravitational acceleration and the direction of the earth's magnetic field are fixed and unchanged, it is used to calibrate the target error coefficient of the geomagnetic sensor.
8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the error coefficient calculation method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the error coefficient calculation method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises computer instructions. When the computer program product is run on a processor, the processor is caused to execute the computer instructions to implement the steps of the error coefficient calculation method according to any one of claims 1 to 6.
