Magnetic azimuth angle measurement method and device, electronic equipment and storage medium

By setting up multiple magnetometers in an electronic device, calculating fluctuation values ​​and confidence levels to select the target magnetometer, the measurement deviation problem of magnetometers in complex magnetic field environments is solved, and higher precision magnetic azimuth angle measurement is achieved.

CN121739968APending Publication Date: 2026-03-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Magnetometers in electronic devices are easily affected by external magnetic field interference when measuring magnetic azimuth, leading to serious deviations in the measurement results.

Method used

Multiple magnetometers are set up in the electronic device. The fluctuation value is calculated by collecting magnetic field strength data at each sample point. The magnetometer with the least magnetic field interference is selected as the target magnetometer for magnetic azimuth measurement. The target magnetometer is determined by the confidence level mapping relationship, and other magnetometers are switched or calibrated when necessary.

Benefits of technology

It improves the accuracy of magnetic azimuth measurement, reduces the error of magnetometer measurement results, and enhances measurement accuracy in complex magnetic field environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121739968A_ABST
    Figure CN121739968A_ABST
Patent Text Reader

Abstract

The invention provides a magnetic azimuth angle measurement method and device, electronic equipment and a storage medium, and relates to the technical field of measurement. The method comprises the following steps: for each magnetometer in a plurality of magnetometers, acquiring magnetic field intensity data of each sample point in a current environment based on the magnetometer so as to calibrate the magnetometer, and calculating a fluctuation value of the magnetic field intensity data corresponding to the magnetometer; wherein the fluctuation value is used for representing the dispersion degree of the magnetic field intensity data among the sample points; according to the fluctuation value corresponding to each magnetometer in the plurality of magnetometers, determining a target magnetometer in the plurality of magnetometers; and measuring a magnetic azimuth angle of the electronic equipment based on the target magnetometer. According to the embodiment of the invention, the magnetic field interference degree of the magnetometers can be measured through the fluctuation value, and the magnetometer with the minimum magnetic field interference is selected from the plurality of magnetometers as the target magnetometer, so that the magnetic azimuth angle of the electronic equipment can be measured, and the measurement accuracy of the magnetic azimuth angle is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of measurement technology, and in particular to a magnetic azimuth measurement method, apparatus, electronic device and storage medium. Background Technology

[0002] With the development of electronic devices, most electronic devices now include magnetometers. Magnetometers measure the Earth's magnetic field to indicate an accurate magnetic azimuth angle for the user, thus realizing the function of an electronic compass.

[0003] In related technologies, magnetometers in electronic devices may be affected by external magnetic field interference when measuring magnetic azimuth, which will lead to serious deviations in the measurement results. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a magnetic azimuth measurement method, device, electronic device, and storage medium.

[0005] According to a first aspect of the present disclosure, a magnetic azimuth measurement method is provided, applied to an electronic device, the electronic device including a plurality of magnetometers, the method comprising:

[0006] For each of the plurality of magnetometers, magnetic field strength data at various sample points in the current environment are collected based on the magnetometer to calibrate the magnetometer, and the fluctuation value of the magnetic field strength data corresponding to the magnetometer is calculated; wherein, the fluctuation value is used to characterize the degree of dispersion of the magnetic field strength data between various sample points;

[0007] Based on the fluctuation value corresponding to each of the plurality of magnetometers, the target magnetometer is determined among the plurality of magnetometers;

[0008] The magnetic azimuth angle of the electronic device is measured based on the target magnetometer.

[0009] In some embodiments, determining the target magnetometer among the plurality of magnetometers based on the fluctuation value corresponding to each magnetometer among the plurality of magnetometers includes:

[0010] For each of the plurality of magnetometers, the confidence level corresponding to the magnetometer is determined according to the fluctuation value range in which the corresponding fluctuation value of the magnetometer is located; wherein, a mapping relationship is pre-established between the fluctuation value range and the confidence level, and the smaller the fluctuation value covered within the fluctuation value range, the higher the confidence level;

[0011] The magnetometer with the highest confidence level among the plurality of magnetometers is selected as the target magnetometer.

[0012] In some embodiments, the magnetic field strength data includes multi-axis magnetic field strength data, and calculating the fluctuation value of the magnetic field strength data corresponding to the magnetometer includes:

[0013] Calculate the fluctuation value of the magnetic field strength data for each axis in the multi-axis magnetic field strength data collected by the magnetometer;

[0014] The largest fluctuation value among the fluctuation values ​​of the magnetic field strength data for each axis is taken as the fluctuation value corresponding to that magnetometer.

[0015] In some embodiments, selecting the magnetometer with the highest confidence level among the plurality of magnetometers as the target magnetometer includes:

[0016] If there are multiple magnetometers with the highest confidence level among the multiple magnetometers, then any magnetometer with the highest confidence level shall be selected as the target magnetometer.

[0017] In some embodiments, the method further includes:

[0018] If the confidence level of each of the plurality of magnetometers is lower than the target confidence level, an alarm message is displayed to alert the user that there is an interfering magnetic field in the current environment.

[0019] In some embodiments, the method further includes:

[0020] Based on the calibration data of the target magnetometer, calibrate the other magnetometers among the plurality of magnetometers besides the target magnetometer.

[0021] In some embodiments, the method further includes:

[0022] If the operating state of the hardware associated with the target magnetometer in the electronic device changes after the target magnetometer calibration is completed, then any magnetometer other than the current target magnetometer among the plurality of magnetometers will be determined as the new target magnetometer.

[0023] According to a second aspect of the present disclosure, a magnetic azimuth measuring device is provided, applied to an electronic device, the electronic device including a plurality of magnetometers, the device comprising:

[0024] The acquisition module is used to acquire magnetic field strength data at various sample points in the current environment for each of the plurality of magnetometers, in order to calibrate the magnetometer and calculate the fluctuation value of the magnetic field strength data corresponding to the magnetometer; wherein, the fluctuation value is used to characterize the degree of dispersion of the magnetic field strength data between various sample points;

[0025] The determining module is used to determine the target magnetometer among the plurality of magnetometers based on the fluctuation value corresponding to each magnetometer among the plurality of magnetometers;

[0026] The measurement module is used to measure the magnetic azimuth angle of the electronic device based on the target magnetometer.

[0027] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0028] Processor; and

[0029] Memory for storing the executable instructions of the processor;

[0030] The processor is configured to execute the method described in the first aspect by executing the executable instructions.

[0031] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0032] In the solution provided in this disclosure, the electronic device has multiple magnetometers. For each magnetometer, magnetic field strength data at various sample points in the current environment can be collected to calibrate the magnetometer and calculate the fluctuation value of the corresponding magnetic field strength data. The fluctuation value characterizes the dispersion of the magnetic field strength data between sample points. Based on the fluctuation value of each magnetometer, a target magnetometer can be determined among the multiple magnetometers. Subsequently, the magnetic azimuth angle can be measured based on the target magnetometer. This disclosure embodiment uses the fluctuation value to measure the degree of magnetic field interference to the magnetometer and selects the magnetometer with the least magnetic field interference as the target magnetometer to measure the magnetic azimuth angle of the electronic device, thereby improving the accuracy of the magnetic azimuth angle measurement. Attached Figure Description

[0033] Figure 1 This diagram illustrates the structure of an electronic device with multiple magnetometers according to an embodiment of the present disclosure.

[0034] Figure 2 A flowchart illustrating a magnetic azimuth measurement method according to an embodiment of this disclosure is shown.

[0035] Figure 3 A flowchart illustrating a method for determining a target magnetometer according to an embodiment of this disclosure is shown.

[0036] Figure 4 A schematic diagram of a magnetic azimuth measuring device according to an embodiment of the present disclosure is shown.

[0037] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0039] Magnetic azimuth is the angle between a certain direction and the north end of the Earth's magnetic field, which can be measured by a magnetometer.

[0040] In related technologies, when electronic devices measure magnetic azimuth using a magnetometer, they are often subject to interference from complex magnetic field environments, which can lead to significant errors in the measurement results.

[0041] The aforementioned complex magnetic field environment may be generated by the internal hardware of electronic devices. For example, some hardware components in electronic devices (e.g., cameras, speakers, etc.) have magnetic parts, which will cause a complex magnetic field environment. Alternatively, some hardware components in electronic devices (e.g., processors, charging circuits, etc.) may have large currents flowing through them, which will also cause electromagnetic interference. Of course, the aforementioned complex magnetic field environment may also be caused by external magnetic interference sources to the electronic devices.

[0042] However, regardless of the cause of the complex magnetic field environment, it will have a significant impact on the measurement results of the magnetometer.

[0043] In view of this, embodiments of the present disclosure include multiple magnetometers in an electronic device, and the magnetometer with the lowest degree of magnetic field interference among multiple magnetometers can be selected as the target magnetometer, thereby achieving accurate measurement of the magnetic azimuth angle through the target magnetometer.

[0044] Next, the application scenarios of the embodiments of this disclosure will be introduced.

[0045] The magnetic azimuth measurement method provided in this disclosure can be applied to any electronic device with multiple magnetometers.

[0046] Figure 1 A schematic diagram of an electronic device with multiple magnetometers is shown. As shown, the electronic device may include a motherboard, a small board, and a battery.

[0047] The mainboard includes a first magnetometer, a camera module, a processor, a power management integrated circuit (PMIC), a speaker, and a radio frequency power amplifier (RFPA). A smaller board, connected to the mainboard via a ribbon cable, contains a second magnetometer, a motor, and a speaker.

[0048] In other words, Figure 1 In the illustrated electronic device, there is a magnetometer on both the motherboard and the small board. From the perspective of the electronic device as a whole, the two magnetometers are positioned diagonally, meaning that the relative distance between the two magnetometers in the electronic device is maximized, thereby minimizing the possibility of the two magnetometers being subjected to the same interference at the same time.

[0049] Those skilled in the art will know that Figure 1 The electronic device structure shown is merely illustrative. Depending on actual needs, the electronic device can be designed with any structure, in which the number of magnetometers can be greater than two, and the position of the magnetometers can also be set arbitrarily. This disclosure does not impose any restrictions on this.

[0050] The exemplary embodiments of this disclosure will be described in detail below with reference to the above application scenarios.

[0051] First, this disclosure provides a magnetic azimuth measurement method, which can be executed by any electronic device, including multiple magnetometers.

[0052] For example, multiple magnetometers can be placed in different locations within an electronic device to minimize the possibility of multiple magnetometers receiving the same interference at the same time.

[0053] Figure 2 This diagram illustrates a flow chart of a magnetic azimuth measurement method according to an embodiment of the present disclosure. Figure 2 As shown, the magnetic azimuth measurement method provided in this embodiment includes the following steps S201 to S203.

[0054] S201, for each of the multiple magnetometers, based on the magnetic field strength data of each sample point in the current environment collected by the magnetometer, to calibrate the magnetometer, and to calculate the fluctuation value of the magnetic field strength data corresponding to the magnetometer.

[0055] In some embodiments, a prompt message can be displayed on the screen component of the electronic device, prompting the user to move the electronic device in the current environment according to a preset trajectory, so that multiple magnetometers in the electronic device can collect magnetic field strength data of each sample point in the current environment.

[0056] For example, each sample point in the current environment can be understood as a point used to form a preset trajectory. When the electronic device moves along the preset trajectory, the electronic device can collect magnetic field strength data of each sample point through multiple magnetometers.

[0057] For example, the preset trajectory can be a circular trajectory, a spherical trajectory, a three-dimensional figure-eight trajectory, etc. Depending on the preset trajectory, the method for calibrating the magnetometer can be a planar calibration method, a ten-sided calibration method, a three-dimensional figure-eight calibration method, etc.

[0058] Since calibrating a magnetometer by collecting magnetic field strength data is well known to those skilled in the art, this disclosure will not elaborate on it for the sake of brevity.

[0059] In some embodiments, the fluctuation value can be used to characterize the dispersion of magnetic field strength data among various sample points. For each magnetometer, the larger the fluctuation value, the greater the dispersion of the magnetic field strength data collected by the magnetometer at various sample points, that is, the greater the difference in magnetic field strength data between various sample points.

[0060] For example, the fluctuation value can be the variance or standard deviation of the magnetic field strength data for each sample point.

[0061] S202, Based on the fluctuation value corresponding to each of the multiple magnetometers, determine the target magnetometer among the multiple magnetometers.

[0062] In some embodiments, the fluctuation value can be used to measure the degree of magnetic field interference to the magnetometer. When the fluctuation value corresponding to a magnetometer is large, it indicates that the magnetometer is in a non-uniform magnetic field, that is, there is a relatively strong interfering magnetic field in at least one direction near the magnetometer, which may affect the measurement results of the magnetometer.

[0063] Based on the above principles, the smaller the fluctuation value of the magnetometer, the more uniform the magnetic field around the magnetometer, meaning there is no strong interfering magnetic field near the magnetometer. Therefore, among multiple magnetometers, the one with the smallest fluctuation value can be selected as the target magnetometer.

[0064] S203, based on a target magnetometer, measures the magnetic azimuth of electronic equipment.

[0065] Since each magnetometer has been calibrated individually in S201, regardless of which magnetometer is selected as the target magnetometer, it can be directly used to measure the magnetic azimuth angle of the electronic device and obtain relatively accurate measurement results.

[0066] This embodiment of the disclosure, by setting multiple magnetometers in an electronic device and measuring the degree of interference to each magnetometer by calculating fluctuation values, can determine the target magnetometer with the least interference among the multiple magnetometers. By measuring the magnetic azimuth angle using the target magnetometer, a more accurate measurement result can be obtained.

[0067] In some embodiments, Figure 3 This diagram illustrates a flowchart of a target magnetometer determination method according to an embodiment of the present disclosure, as shown below. Figure 3 As shown, the method includes the following steps.

[0068] S301, for each of the multiple magnetometers, determine the confidence level of the magnetometer based on the fluctuation range in which the corresponding fluctuation value of the magnetometer is located.

[0069] There is a pre-established mapping relationship between the fluctuation range and the confidence level. The smaller the fluctuation value covered within the fluctuation range, the higher the confidence level.

[0070] For example, the magnetic field strength data collected by the magnetometer at each sample point includes multi-axis magnetic field strength data. For instance, it could be triaxial magnetic field strength data.

[0071] When calculating the fluctuation value corresponding to the magnetometer, the fluctuation value of the magnetic field strength data for each axis in the multi-axis magnetic field strength data collected by the magnetometer can be calculated separately. Then, the largest fluctuation value among the fluctuation values ​​of each axis magnetic field strength data is taken as the fluctuation value corresponding to the magnetometer.

[0072] In other words, the degree of interference to the magnetometer can be measured by the magnetic field strength data of the axis with the largest fluctuation value. This avoids large errors in the final measurement results caused by significant interference in the magnetic field strength of a certain axis during magnetic azimuth measurement.

[0073] S302 selects the magnetometer with the highest confidence level among multiple magnetometers as the target magnetometer.

[0074] For example, if there are multiple magnetometers with the highest confidence level among multiple magnetometers, any magnetometer with the highest confidence level can be used as the target magnetometer.

[0075] Compared to directly determining the target magnetometer by comparing fluctuation values, mapping fluctuation values ​​to confidence levels can yield multiple candidate target magnetometers in certain situations. This allows for switching to other candidate target magnetometers for magnetic azimuth measurement when the measurement results of the current target magnetometer contain significant errors.

[0076] For example, a significant error could be that the magnetic azimuth angle measured by the current target magnetometer deviates considerably from the magnetic azimuth angles measured by other candidate target magnetometers, or other errors that can be perceived by the user. In this case, the electronic device can automatically switch the current target magnetometer to any of the candidate target magnetometers, or, upon receiving a magnetometer switching command, switch the current target magnetometer to any of the candidate target magnetometers.

[0077] To make it easier to understand, the following example illustrates the mapping relationship between fluctuation ranges and confidence levels.

[0078] For example, three different fluctuation value ranges can be preset.

[0079] The first fluctuation range is [0, 0.5), corresponding to the first level of confidence.

[0080] The second fluctuation range is [0.5, 1), corresponding to the second confidence level.

[0081] The third fluctuation range is [1, +∞), corresponding to the third confidence level.

[0082] The highest confidence level is Level 1, the second level is the medium confidence level, and the third level is the lowest confidence level.

[0083] If the confidence level of the magnetometer is Level 1, it is considered that the magnetometer is subject to low interference and the magnetic azimuth angle measured by the magnetometer is highly reliable. In this case, the measurement error of the magnetometer mainly comes from the magnetometer itself.

[0084] If the confidence level of the magnetometer is level 2, it is considered that the magnetometer is subject to a moderate level of interference, and the reliability of the magnetic azimuth angle measured by the magnetometer is moderate. In this case, the measurement results of the magnetometer may be affected by electromagnetic interference from other hardware in the electronic device.

[0085] If the confidence level of the magnetometer is level three, it is considered that the magnetometer is subject to a high degree of interference, and the reliability of the magnetic azimuth angle measured by the magnetometer is low. In this case, the measurement results of the magnetometer may be affected by magnetic field interference from the external environment.

[0086] In some embodiments, an alarm message is displayed when the confidence level of each of the plurality of magnetometers is lower than the target confidence level. The alarm message is used to alert the user to the presence of an interfering magnetic field in the current environment.

[0087] For example, in the above example, if the confidence levels of all magnetometers are below the second confidence level, it can be considered that there is a large interfering magnetic field in the current environment. At this time, an alarm message can be sent to prompt the user to move the electronic device to a new environment or eliminate the interference source in the current environment, and then the method provided in the embodiments of this disclosure can be re-executed.

[0088] In some embodiments, after determining the target magnetometer, other magnetometers among a plurality of magnetometers may be calibrated based on the calibration data of the target magnetometer.

[0089] Since all magnetometers are located in the same electronic device, their surrounding magnetic field environments are largely the same. Therefore, by reusing the calibration parameters of the target magnetometer to other magnetometers, the other magnetometers can also be made usable. In other words, all other magnetometers can be used as candidate target magnetometers, thus expanding the number of candidate target magnetometers.

[0090] In some embodiments, if the operating state of the hardware associated with the target magnetometer in the electronic device changes after the target magnetometer calibration is completed, then any magnetometer other than the current target magnetometer among the multiple magnetometers is determined as the new target magnetometer.

[0091] For example, the association between each magnetometer and the hardware in the electronic device can be pre-configured. For instance, hardware that is less than a preset distance threshold from the magnetometer can be associated with that magnetometer.

[0092] It is understandable that some hardware in electronic devices may cause changes in the strength of the nearby magnetic field during operation, which will cause new electromagnetic interference to the calibrated magnetometer, and this interference is uncalibrated.

[0093] For example, electronic devices may contain camera modules. When the camera module is in operation, the position of the magnetic components within it may change relative to the idle state, thereby altering the strength of the nearby magnetic field.

[0094] For example, the processor in an electronic device may adjust its operating current according to different loads. Based on the principle of electromagnetic induction, the change in the magnitude of the operating current will also cause a change in the strength of the nearby magnetic field.

[0095] In the previous embodiment, the calibration parameters of the target magnetometer were reused for all magnetometers in the electronic device, and all magnetometers in the electronic device were in a usable state. Therefore, at this time, the impact of the change in hardware operating state on the accuracy of the magnetometer can be mitigated by re-identifying any magnetometer other than the current target magnetometer as the new target magnetometer.

[0096] Based on the same inventive concept, this disclosure also provides a magnetic azimuth measuring device, as shown in the following embodiment. Since the principle of this magnetic azimuth measuring device embodiment in solving the problem is the same as that described above... Figure 2 The method embodiments shown are similar, therefore the implementation of this magnetic azimuth measuring device embodiment can be found above. Figure 2 The implementation of the method embodiments shown will not be repeated here.

[0097] Figure 4 A schematic diagram of a magnetic azimuth measuring device according to an embodiment of this disclosure is shown. This magnetic azimuth measuring device can be applied to an electronic device, which includes multiple magnetometers. Figure 4 As shown, the magnetic azimuth measuring device 400 includes: an acquisition module 401, a determination module 402, and a measurement module 403.

[0098] The acquisition module 401 is used to acquire magnetic field strength data of each sample point in the current environment for each of the multiple magnetometers, in order to calibrate the magnetometer and calculate the fluctuation value of the magnetic field strength data corresponding to the magnetometer; wherein the fluctuation value is used to characterize the degree of dispersion of the magnetic field strength data between each sample point.

[0099] The determination module 402 is used to determine the target magnetometer among the multiple magnetometers based on the fluctuation value corresponding to each magnetometer among the multiple magnetometers.

[0100] Measurement module 403 is used to measure the magnetic azimuth of electronic equipment based on a target magnetometer.

[0101] In some embodiments, the determining module 402 is specifically used to determine the confidence level of each of the multiple magnetometers based on the fluctuation value range in which the corresponding fluctuation value of the magnetometer is located; wherein, a mapping relationship is pre-established between the fluctuation value range and the confidence level, and the smaller the fluctuation value covered within the fluctuation value range, the higher the confidence level; and the magnetometer with the highest confidence level among the multiple magnetometers is selected as the target magnetometer.

[0102] In some embodiments, the magnetic field strength data includes multi-axis magnetic field strength data. The acquisition module 401 is further configured to calculate the fluctuation value of the magnetic field strength data of each axis in the multi-axis magnetic field strength data acquired by the magnetometer; and to take the largest fluctuation value among the fluctuation values ​​of each axis magnetic field strength data as the corresponding fluctuation value of the magnetometer.

[0103] In some embodiments, the determining module 402 is further configured to, in the case that there are multiple magnetometers with the highest confidence level among multiple magnetometers, select any magnetometer with the highest confidence level as the target magnetometer.

[0104] In some embodiments, the magnetic azimuth measuring device 400 further includes a display module (not shown) for displaying an alarm message when the confidence level of each of the plurality of magnetometers is lower than the target confidence level. The alarm message is used to alert the user that there is an interfering magnetic field in the current environment.

[0105] In some embodiments, the magnetic azimuth measuring device 400 further includes a calibration module (not shown) for calibrating other magnetometers among a plurality of magnetometers, excluding the target magnetometer, based on calibration data of the target magnetometer.

[0106] In some embodiments, the determining module 402 is further configured to determine any one of the multiple magnetometers other than the current target magnetometer as the new target magnetometer if the operating state of the hardware associated with the target magnetometer in the electronic device changes after the target magnetometer calibration is completed.

[0107] The following reference Figure 5 This describes an electronic device 500 capable of implementing embodiments of the present disclosure. Figure 5 The electronic device 500 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0108] like Figure 5 As shown, the electronic device 500 is presented in the form of a general-purpose computing device. The components of the electronic device 500 may include, but are not limited to: at least one processor 510, at least one memory 520, and a bus 530 connecting different system components (including memory 520 and processor 510).

[0109] The memory stores program code that can be executed by the processor 510, causing the processor 510 to perform the steps described in the "Exemplary Methods" section of this disclosure according to various exemplary embodiments of this disclosure.

[0110] In some embodiments, the processor 510 may also perform the following steps of the above method embodiments:

[0111] For each of the multiple magnetometers, magnetic field strength data at various sample points in the current environment are collected based on that magnetometer to calibrate the magnetometer and calculate the fluctuation value of the magnetic field strength data corresponding to that magnetometer; wherein, the fluctuation value is used to characterize the degree of dispersion of the magnetic field strength data between various sample points;

[0112] The target magnetometer is determined from among the multiple magnetometers based on the fluctuation value corresponding to each magnetometer.

[0113] The magnetic azimuth angle of electronic equipment is measured using a target magnetometer.

[0114] The memory 520 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 5201 and / or cache memory 5202, and may further include read-only memory (ROM) 5203.

[0115] The memory 520 may also include a program / utility 5204 having a set (at least one) of program modules 5205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0116] Bus 530 can represent one or more of several types of bus structures, including a memory bus or memory controller, peripheral bus, graphics acceleration port, processor, or a local bus using any of the various bus structures.

[0117] Electronic device 500 can also communicate with one or more external devices 540 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with the electronic device 500, and / or with any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 550. Furthermore, electronic device 500 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 560. Figure 5 As shown, network adapter 560 communicates with other modules of electronic device 500 via bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 500, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0118] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0119] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the methods described above is stored thereon. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this disclosure according to various exemplary embodiments of this disclosure.

[0120] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

Claims

1. A method for measuring magnetic azimuth, characterized in that, Applied to an electronic device, the electronic device including a plurality of magnetometers, the method includes: For each of the plurality of magnetometers, magnetic field strength data at various sample points in the current environment are collected based on the magnetometer to calibrate the magnetometer, and the fluctuation value of the magnetic field strength data corresponding to the magnetometer is calculated; wherein, the fluctuation value is used to characterize the degree of dispersion of the magnetic field strength data between various sample points; Based on the fluctuation value corresponding to each of the plurality of magnetometers, the target magnetometer is determined among the plurality of magnetometers; The magnetic azimuth angle of the electronic device is measured based on the target magnetometer.

2. The method according to claim 1, characterized in that, The step of determining the target magnetometer from the plurality of magnetometers based on the fluctuation value corresponding to each magnetometer includes: For each of the plurality of magnetometers, the confidence level corresponding to the magnetometer is determined according to the fluctuation value range in which the corresponding fluctuation value of the magnetometer is located; wherein, a mapping relationship is pre-established between the fluctuation value range and the confidence level, and the smaller the fluctuation value covered within the fluctuation value range, the higher the confidence level; The magnetometer with the highest confidence level among the plurality of magnetometers is selected as the target magnetometer.

3. The method according to claim 1 or 2, characterized in that, Magnetic field strength data includes multi-axis magnetic field strength data, and the calculation of the fluctuation value of the magnetic field strength data corresponding to the magnetometer includes: Calculate the fluctuation value of the magnetic field strength data for each axis in the multi-axis magnetic field strength data collected by the magnetometer; The largest fluctuation value among the fluctuation values ​​of the magnetic field strength data for each axis is taken as the fluctuation value corresponding to that magnetometer.

4. The method according to claim 2, characterized in that, The step of selecting the magnetometer with the highest confidence level among the plurality of magnetometers as the target magnetometer includes: If there are multiple magnetometers with the highest confidence level among the multiple magnetometers, then any magnetometer with the highest confidence level shall be selected as the target magnetometer.

5. The method according to claim 2, characterized in that, The method further includes: If the confidence level of each of the plurality of magnetometers is lower than the target confidence level, an alarm message is displayed to alert the user that there is an interfering magnetic field in the current environment.

6. The method according to claim 1, characterized in that, The method further includes: Based on the calibration data of the target magnetometer, calibrate the other magnetometers among the plurality of magnetometers besides the target magnetometer.

7. The method according to claim 6, characterized in that, The method further includes: If the operating state of the hardware associated with the target magnetometer in the electronic device changes after the target magnetometer calibration is completed, then any magnetometer other than the current target magnetometer among the plurality of magnetometers will be determined as the new target magnetometer.

8. A magnetic azimuth measuring device, characterized in that, Applied to an electronic device, the electronic device including a plurality of magnetometers, the device comprising: The acquisition module is used to acquire magnetic field strength data at various sample points in the current environment for each of the plurality of magnetometers, in order to calibrate the magnetometer and calculate the fluctuation value of the magnetic field strength data corresponding to the magnetometer; wherein, the fluctuation value is used to characterize the degree of dispersion of the magnetic field strength data between various sample points; The determining module is used to determine the target magnetometer among the plurality of magnetometers based on the fluctuation value corresponding to each magnetometer among the plurality of magnetometers; The measurement module is used to measure the magnetic azimuth angle of the electronic device based on the target magnetometer.

9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.