WO2023169422A1 - Electronic compass calibration method and apparatus, electronic device, and storage medium - Google Patents

Electronic compass calibration method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023169422A1
WO2023169422A1 PCT/CN2023/080101 CN2023080101W WO2023169422A1 WO 2023169422 A1 WO2023169422 A1 WO 2023169422A1 CN 2023080101 W CN2023080101 W CN 2023080101W WO 2023169422 A1 WO2023169422 A1 WO 2023169422A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
electronic compass
position information
calibration
hall sensor
Prior art date
Application number
PCT/CN2023/080101
Other languages
French (fr)
Chinese (zh)
Inventor
张云波
罗春晖
Original Assignee
维沃移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2023169422A1 publication Critical patent/WO2023169422A1/en

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C17/00Compasses; Devices for ascertaining true or magnetic north for navigation or surveying purposes
    • G01C17/38Testing, calibrating, or compensating of compasses
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/30Assessment of water resources

Definitions

  • This application belongs to the field of communication technology, and specifically relates to an electronic compass calibration method, device, electronic equipment and storage medium.
  • an electronic compass is provided in the electronic device, so that when the user wants to know the direction of the geomagnetic field, the user can trigger the electronic device to detect the geomagnetic field through the electronic compass and display the detected geomagnetic field direction, so that the user can view the geomagnetic field. Magnetic field direction.
  • the interference magnetic field may interfere with the detection of the geomagnetic field by the electronic compass. Therefore, it may cause errors detected by the electronic compass. The direction of the geomagnetic field is deflected.
  • the purpose of the embodiments of the present application is to provide an electronic compass calibration method, device, electronic equipment and storage medium, which can solve the problem of poor accuracy of the electronic compass.
  • inventions of the present application provide an electronic compass calibration method.
  • the electronic compass calibration method includes: obtaining target position information of a target button of the electronic device through at least one Hall sensor, and the target position information is used to indicate the target.
  • the key position of the key on the electronic device according to the target position information, the target calibration parameters are determined through the electronic compass; the target calibration parameters are used to calibrate the magnetic field parameters output by the electronic compass.
  • inventions of the present application provide an electronic compass calibration device.
  • the electronic compass calibration device includes: a target button, at least one Hall sensor, and an electronic compass.
  • the electronic compass calibration device further includes: an acquisition module, a determination module, and a compass calibration device.
  • Calibration module is configured to acquire the target position information of the target button of the electronic compass calibration device through at least one Hall sensor.
  • the target position information is used to indicate the button position of the target button on the electronic compass calibration device.
  • the determination module is used to determine the target calibration parameters through the electronic compass based on the target position information obtained by the acquisition module.
  • the calibration module is used to use the target calibration parameters determined by the determination module to calculate the magnetic field output by the electronic compass. Parameters are calibrated.
  • inventions of the present application provide an electronic device.
  • the electronic device includes: a printed circuit board (PCB) of the electronic device provided with: a target button; and at least one Hall sensor, the at least one Hall sensor being opposite to the target button. It is set that the at least one Hall sensor is used to obtain the target position information of the target button, and the target position information is used to indicate the button position of the target button on the electronic device; an electronic compass is arranged on the PCB away from the target button. one end; wherein, the electronic compass is used to determine the target calibration parameters based on the target position information, so that the electronic device can use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
  • PCB printed circuit board
  • inventions of the present application provide an electronic device.
  • the electronic device includes a processor and a memory.
  • the memory stores programs or instructions that can be run on the processor.
  • the programs or instructions are processed by the processor.
  • the processor is executed, the steps of the method described in the first aspect are implemented.
  • embodiments of the present application provide a readable storage medium.
  • Programs or instructions are stored on the readable storage medium.
  • the steps of the method described in the first aspect are implemented. .
  • inventions of the present application provide a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the first aspect. the method described.
  • embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method as described in the first aspect.
  • the electronic device can obtain the target position information of the target key through at least one Hall sensor (the target position information is used to indicate the key position of the target key on the electronic compass calibration device), and according to the The target position information determines the target calibration parameters through the electronic compass, so that the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the target calibration parameters.
  • the target position information is used to indicate the key position of the target key on the electronic compass calibration device
  • the electronic device can obtain the target position information of the target button that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information, that is, the target calibration parameters It is related to the target position information, so the magnetic field of the target button can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
  • Figure 1 is one of the flow charts of an electronic compass calibration method provided by an embodiment of the present application
  • Figure 2 is the second flow chart of an electronic compass calibration method provided by an embodiment of the present application.
  • Figure 3 is the third flow chart of an electronic compass calibration method provided by an embodiment of the present application.
  • Figure 4 is one of the structural schematic diagrams of an electronic compass calibration device provided by an embodiment of the present application.
  • Figure 5 is the fourth flow chart of an electronic compass calibration method provided by an embodiment of the present application.
  • Figure 6 is a second structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application.
  • Figure 7 is the third structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application.
  • Figure 8 is the fourth structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application.
  • Figure 9 is a fifth structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application.
  • Figure 10 is the sixth structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application.
  • Figure 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
  • first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first,” “second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited.
  • the first Hall sensor may be one or multiple.
  • “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
  • the electronic compass is usually arranged together with the mute button Hall, so that when the user needs to know the geomagnetic direction (i.e. current positioning), the electronic device can detect the current geomagnetic field environment through the electronic compass and display the detected geomagnetic field direction, so that the user can View current location and direction.
  • both the electronic compass and the mute key Hall are magnetic sensors. Since the judgment of the mute key Hall function requires an external magnet to provide a certain magnetic field, the position of the mute key can be determined by detecting the size of the magnetic field. When the external magnetic field set by the mute key When changes occur, the magnetic field detected by the electronic compass may be misjudged.
  • the layout of the electronic compass and the mute key magnet can be larger than the preset distance (for example, 15MM), thereby reducing the interference of the mute key magnet on the electronic compass. , however, if the distance between the electronic compass and the mute key is too large, it will make the stacking layout of the entire electronic device more difficult.
  • the electronic device provided by the present application includes: a target button, at least one Hall sensor, and an electronic compass, so that the electronic device can obtain the current position information (the target button) of the mute button (ie, the target button) through at least one Hall sensor.
  • the current position information is used to indicate the current key position of the mute key on the electronic device), and is based on
  • the calibration parameters are determined through the electronic compass, so that the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the determined calibration parameters.
  • the electronic device can obtain the current position information of the mute key that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the calibration parameters determined by the current position information, that is, the determined calibration parameters It is related to the current position information, so the magnetic field of the mute key can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
  • FIG. 1 shows a flow chart of an electronic compass calibration method provided by an embodiment of the present application.
  • the electronic compass calibration method provided by the embodiment of the present application may include the following steps 201 to 203.
  • Step 201 The electronic device obtains the target position information of the target button through at least one Hall sensor.
  • the above target position information is used to indicate the key position of the target key on the electronic device.
  • a magnetic component may be provided in the above target button.
  • the target button may be any of the following: a mute button, a volume button, a button corresponding to a preset position in the electronic device, or any button that is less than a preset distance (for example, 2CM) from the electronic compass.
  • the above-mentioned magnetic components may include at least one of the following: magnets, electromagnets, etc.
  • the above target position information may specifically be the coordinate information of the target button in a preset coordinate system in the electronic device.
  • the electronic device when the electronic device is powered on, the electronic device can obtain the target location information of the target key.
  • the power-on state may include any of the following: a power-on state, a standby state (such as a screen-off standby state), a working state (such as a screen-on state), and so on.
  • the electronic device when the electronic device runs a navigation application, the electronic device can obtain the target location information of the target key in real time.
  • the electronic device when the electronic device receives the user's first input to the target key, the electronic device may obtain the target location information of the target key in real time. Wherein, the first input is used to move the target key, so that the key position of the target key on the electronic device changes.
  • the electronic device can obtain the target position information in real time.
  • the above-mentioned first input may be any of the following: press input (such as click input), toggle input, sliding input, or preset trajectory input, etc.
  • press input such as click input
  • toggle input such as toggle input
  • sliding input sliding input
  • preset trajectory input etc.
  • the electronic device may also be provided with at least one Hall sensor, and the at least one Hall sensor
  • the two Hall sensors are arranged in a position within the preset range of the target button, so that the at least one Hall sensor can respectively output corresponding Hall parameters to output at least one Hall parameter, and then the electronic device can output the corresponding Hall parameters according to the at least one Hall sensor. parameter to determine the target location information of the target button.
  • Step 202 The electronic device determines the target calibration parameters through the electronic compass based on the target location information.
  • the above target calibration parameters are used to calibrate the magnetic field parameters output by the electronic compass of the electronic device.
  • the above-mentioned target calibration parameters may include at least one of the following: angle relationship parameters, magnetic field distribution parameters, magnetic field direction parameters or acceleration parameters.
  • multiple preset calibration parameters are pre-stored in the electronic device, and the multiple preset calibration parameters are one by one.
  • the electronic device can determine the target calibration parameters corresponding to the target position information.
  • the electronic device can determine a piece of position information that matches the target position information from a plurality of position information, and determine a preset calibration parameter corresponding to the piece of position information as the target. Calibration parameters.
  • matching the target location information can be understood as: being the same as the target location information; or the difference from the target location information is less than or equal to the preset threshold.
  • Step 203 The electronic device uses the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
  • the above-mentioned magnetic field parameters may include magnetic field direction parameters.
  • the electronic device can use a preset calibration algorithm to perform calculations based on the target calibration parameters and the magnetic field parameters output by the electronic compass to obtain the calibrated magnetic field parameters. It can be understood that the calibrated magnetic field parameters are accurate magnetic field parameters.
  • the electronic device when the electronic device does not calibrate the magnetic field parameters output by the electronic compass of the electronic device, the electronic device can directly use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass of the electronic device.
  • the electronic device when the electronic device uses other calibration parameters (such as the initial calibration parameters in the following embodiments) to calibrate the magnetic field parameters output by the electronic compass of the electronic device, the electronic device can first calibrate the other calibration parameters. The parameters are updated to the target calibration parameters, and then the target calibration parameters are used to calibrate the magnetic field parameters output by the electronic compass of the electronic device.
  • other calibration parameters such as the initial calibration parameters in the following embodiments
  • the electronic device determines the target calibration parameters, it may happen that the electronic device is using other calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
  • the other calibration parameters are not related to the target position information, so the target may appear.
  • the magnetic field of the key interferes with the electronic compass's detection of the geomagnetic field. Therefore, the electronic device can update the other calibration parameters to the target calibration parameters.
  • the present application implements
  • the electronic compass calibration method provided by the embodiment also includes the following step 301.
  • Step 301 When the initial calibration parameters are used to calibrate the magnetic field parameters, the electronic device updates the initial calibration parameters to the target calibration parameters.
  • the electronic compass performs magnetic field calibration processing in real time.
  • the electronic device can update the initial calibration parameters to the target calibration parameters, thereby using the updated target calibration parameters. Recalibrate the magnetic field parameters output by the electronic compass to obtain the magnetic field parameters output based on the target calibration parameters.
  • the specific process of obtaining the target calibration parameters can be referred to the above embodiments and will not be described again here.
  • the electronic device may receive the user's second input to the target key to trigger a change in the position information of the target key (such as the second position described below), so that the electronic device may obtain the second
  • the target calibration parameters corresponding to the position information are used to calibrate the magnetic field parameters output by the electronic compass through the target calibration parameters corresponding to the second position information.
  • the above-mentioned second input may be any of the following: click input, toggle input, sliding input or preset trajectory input.
  • click input toggle input
  • sliding input sliding input
  • preset trajectory input The details can be determined according to actual usage requirements, and are not limited by the embodiments of the present invention.
  • the electronic device can update the stored initial calibration parameters to the target calibration parameters related to the target position information, thereby calibrating the magnetic field parameters output by the electronic compass through the target calibration parameters. In this way, the performance of the electronic compass is improved. Accuracy.
  • the electronic device can perform the above steps 201 to 203 again to calibrate the magnetic field parameters output by the electronic compass again.
  • the electronic device may perform the above steps 201 to 203 again after a preset period of time after calibrating the magnetic field parameters output by the electronic compass. It can be understood that the electronic device can calibrate the magnetic field parameters output by the electronic compass again every once in a while.
  • the electronic device may perform the above-mentioned steps 201 to 203 again according to the user's input to the electronic device. It can be understood that the electronic device can also calibrate the magnetic field parameters output by the electronic compass again according to the user's needs.
  • a magnet is provided in the target button, so that when the button position of the target button on the electronic device changes, the magnetic field near the target button may change, causing the magnetic field output by the electronic compass to change.
  • the parameters are inaccurate. Therefore, the electronic device can obtain the target position information of the target button, and determine the target calibration parameters based on the target position information, so as to use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass of the electronic device. Obtain accurate magnetic field parameters.
  • Embodiments of the present application provide an electronic compass calibration method.
  • the electronic device can obtain the target position information of the target key (the target position information is used to indicate the key position of the target key on the electronic device), and according to the target The position information determines the target calibration parameters, so that the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the target calibration parameters.
  • the electronic device can obtain the target position information of the target button that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information, that is, the target calibration parameters It is related to the target position information, so the magnetic field of the target button can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
  • the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the target calibration parameters determined by the target position information, the electronic compass and the target buttons can be arranged in adjacent areas, thus reducing the overall cost of the electronic device.
  • the stacking difficulty of the machine since the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the target calibration parameters determined by the target position information, the electronic compass and the target buttons can be arranged in adjacent areas, thus reducing the overall cost of the electronic device. The stacking difficulty of the machine.
  • the above-mentioned electronic device further includes a first Hall sensor and a second Hall sensor.
  • the above step 201 can be specifically implemented through the following steps 201a and 201b.
  • Step 201a The electronic device obtains the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor.
  • the first Hall sensor and the second Hall sensor may be linear Hall sensors (such as open-loop Hall sensors or closed-loop Hall sensors), or switch-type Hall sensors. .
  • first Hall sensor and the second Hall sensor have opposite polarities, and both the first Hall sensor and the second Hall sensor are perpendicular to the button magnet.
  • the first Hall parameter and the second Hall parameter may both be Hall voltage values.
  • the first Hall sensor can detect the target button according to the According to the magnetic field size of the magnet, a Hall voltage value (i.e., the first Hall parameter) is obtained, and the second Hall sensor can obtain another Hall voltage value (i.e., the third Hall parameter) based on the detected magnetic field size of the magnet of the target button. (two Hall parameters), so that the electronic device can determine the acquired target position information of the target button according to the first Hall parameter and the second Hall parameter.
  • the moving position of the magnet is limited and fixed by the structure of the target button.
  • the magnetic field generated by the magnet is also Change up and down, so that when the size, shape, and brand of the magnet are determined, the surface magnetism and magnetic field range of the magnet can also be determined accordingly. Therefore, the electronic device can determine the target of the target button through the first Hall parameter and the second Hall parameter. location information. The same applies to moving left and right, so I won’t go into details here.
  • Step 201b The electronic device determines the target position information based on the first Hall parameter and the second Hall parameter.
  • the electronic device can determine whether the first Hall parameter is greater than (or less than) the first preset voltage value, and whether the second Hall parameter is less than (or greater than) the second preset voltage value. , determine the target location information.
  • the magnet in the target button is close to the first Hall sensor (that is, the target button is in the first position, and the first position is the upper half area of the target button), at this time, the magnet detected by the first Hall sensor
  • the magnetic field of the magnet is larger, and the magnetic field of the magnet detected by the second Hall sensor is smaller, so the Hall voltage value (i.e., the first Hall parameter) obtained by the first Hall sensor is larger, and the second Hall sensor obtains The Hall voltage value (i.e., the second Hall parameter) is small. Therefore, when the first Hall parameter is greater than the first preset voltage value, and the second Hall parameter is less than the second preset voltage value, the electronic The device may determine the first location information as the target location information.
  • the first position information is used to indicate that the key position of the target key on the electronic device is the first position.
  • the electronic device can determine the first position information as the target position information.
  • the first Hall sensor detects The magnetic field of the magnet is small, and the magnetic field of the magnet detected by the second Hall sensor is large, so the Hall voltage value (i.e., the first Hall parameter) obtained by the first Hall sensor is small, and the second Hall sensor The obtained Hall voltage value (i.e., the second Hall parameter) is larger. Therefore, when the first Hall parameter is smaller than the first preset voltage value and the second Hall parameter is larger than the second preset voltage value, The electronic device may determine the second location information as the target location information.
  • the second position information is used to indicate that the key position of the target key on the electronic device is the second position.
  • the electronic device can be provided with two Hall sensors, the electronic device can directly determine the target position information based on the two Hall parameters detected by the two Hall sensors. Therefore, the electronic device can be improved. The accuracy with which the device determines target location information.
  • a magnetic isolation component can be provided on the target button.
  • step 202 can be specifically implemented through the following step 202a.
  • Step 202a The electronic device determines the target calibration parameter corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass.
  • the above-mentioned at least two preset calibration parameters correspond to at least two pieces of position information in a one-to-one manner, and the at least two pieces of position information include target position information.
  • the target button can be moved to a button position first, and the magnetic field parameters and accurate magnetic field output by the electronic compass are obtained. Deviation value between parameters, and then determine a preset calibration parameter based on the deviation value to obtain one preset calibration parameter, so that at least two preset calibration parameters can be obtained.
  • the above-mentioned accurate magnetic field parameters may be magnetic field parameters detected using other equipment (such as a compass).
  • the electronic compass is in a complex magnetic field environment.
  • at least two preset calibration parameters can be predetermined according to the different key positions of the target keys, so that the electronic device can be based on the target keys. button position to determine the corresponding preset calibration parameters.
  • At least two hard magnetic databases are preset in the electronic compass, and each hard magnetic database stores a preset calibration parameter, so that the electronic device can calculate the calibration parameters according to at least two corresponding relationships. , determine a hard magnetic database corresponding to the target position information, and determine the preset calibration parameters in the hard magnetic database as the target calibration parameters.
  • Each of the at least two corresponding relationships is a corresponding relationship between a position information and a hard magnetic database.
  • the electronic device can determine a piece of position information that matches the target position information from at least two pieces of position information in at least two corresponding relationships, and then store the piece of position information corresponding to a preset in the hard magnetic library. Set the calibration parameters and determine them as target calibration parameters.
  • the electronic device can adjust the magnetic field parameters output by the electronic compass through the target calibration parameter corresponding to the target button position, thereby avoiding that the target button may interfere with the electronic compass detection when the target button is close to the electronic compass.
  • the geomagnetism causes the direction of the geomagnetic field detected by the electronic compass to deviate, thus improving the accuracy of the electronic compass.
  • FIG. 6 shows a possible structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device may include: PCB 11, target button 12, at least one Hall sensor and electronic compass 15 , the at least one Hall sensor includes a first Hall sensor 13 and a second Hall sensor 14 .
  • the PCB is provided with: a first Hall sensor 13 and a second Hall sensor 14, the first Hall sensor 13 and the second Hall sensor 14 are arranged opposite to the target button 12; an electronic compass 15, the electronic compass 15 15 is arranged at one end of PCB 11 away from the target button 12 .
  • the above-mentioned at least one Hall sensor is used to obtain the target position information of the target key, and the target position information is used to indicate the key position of the target key on the electronic device; the above-mentioned electronic compass is used to obtain the target position information according to the target position information. , determine the target calibration parameters, so that the electronic device can use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
  • Embodiments of the present application provide an electronic device that can obtain a target button through at least one Hall sensor.
  • the target position information of the key (the target position information is used to indicate the key position of the target key on the electronic device), and based on the target position information, the target calibration parameters are determined through the electronic compass, so that the electronic device can calibrate the parameters according to the target Calibrate the magnetic field parameters output by the electronic compass.
  • the electronic device can obtain the target position information of the target button that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information, that is, the target calibration parameters It is related to the target position information, so the magnetic field of the target button can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
  • the key positions of the target key 12 include: a first key position 121 and a second key position 122; the at least one Hall sensor 13 includes: The first Hall sensor 13 and the second Hall sensor 14 .
  • the first button position 121 faces the first Hall sensor 13
  • the second button position 122 faces the second Hall sensor 14 .
  • the first Hall sensor 13 and the second Hall sensor 14 are both located on the same plane and are perpendicular to the target button 12 .
  • the electronic compass 15 is located above the first Hall sensor 131 and is in contact with the first Hall sensor 131 .
  • the distance between 13 is less than 15MM.
  • the electronic device can be provided with two Hall sensors, so that the electronic device can directly determine the key position of the target key based on the two Hall sensors. Therefore, the electronic device can improve the accuracy of determining the key position of the target key. accuracy.
  • the above-mentioned electronic device further includes a magnetic isolation component 15 .
  • the above-mentioned magnetic isolation component 16 can be disposed on the PCB 11 , and the magnetic isolation component 16 can be any of the following: a magnetic isolation sheet, a silicon steel sheet, or any component with magnetic isolation capabilities.
  • the above-mentioned magnetic isolation sheet is a soft magnetic material sintered at a constant high temperature, and has high magnetic permeability and low magnetic loss factor. It uses the electron scattering caused by the thermal movement of the functional component lattice electric field and the interaction between electrons to absorb electromagnetic wave energy and convert it into thermal energy, thereby achieving the purpose of attenuating electromagnetic waves.
  • the target button, the first Hall sensor and the second Hall sensor are all arranged in the space formed by the magnetic isolation component 16 .
  • FIG. 8 is a top view of the electronic device.
  • the space formed by the magnetic isolation component 16 may specifically be: the space enclosed by the magnetic isolation component 16 and the PCB 11 , or the space enclosed by the magnetic isolation component 16 .
  • the magnetic isolation component 16 may be provided with a groove, and the notch of the groove is connected to the PCB (for example, fixedly connected), so that the target button, the first Hall sensor, and the second Hall sensor are all disposed on the PCB. It is located in the groove so as to be disposed in the space formed by the magnetic isolation component 16 .
  • the magnetic isolation component 16 may be provided with a groove, and the notch of the groove is fixedly connected to the PCB 11, so that the target button 12, the first Hall sensor 13 and the second Hall sensor 14 are They are all arranged at the position where PCB11 is located in the groove.
  • a magnetic isolation component is provided on the target button, the first Hall sensor, and the second Hall sensor, so that the magnetic isolation component guides the magnetic field generated by the magnet of the target button and does not radiate outward. Therefore, It can prevent the magnetic field of the target button from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
  • the execution subject of the electronic compass calibration method provided by the embodiment of the present application may be an electronic device.
  • an electronic device performing an electronic compass calibration method is used as an example to illustrate the electronic device provided by the embodiment of the present application.
  • FIG. 10 shows a possible structural schematic diagram of the electronic compass calibration device involved in the embodiment of the present application.
  • the electronic compass calibration device includes: a target button, at least one Hall sensor, and an electronic compass.
  • the electronic compass calibration device 70 may include: an acquisition module 71 , a determination module 72 , and a calibration module 73 .
  • the acquisition module 71 is used to acquire the target position information of the target button of the electronic compass calibration device through at least one Hall sensor.
  • the target position information is used to indicate the button position of the target button on the electronic compass calibration device 70 .
  • the determination module 72 is configured to determine the target calibration parameters through the electronic compass according to the target position information obtained by the acquisition module 71 .
  • the calibration module 73 is used to calibrate the magnetic field parameters output by the electronic compass using the target calibration parameters determined by the determination module 72 .
  • the above-mentioned determination module 72 is specifically configured to determine the target calibration parameters corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass; wherein the at least two preset calibration parameters are It is assumed that the calibration parameter corresponds to at least two pieces of position information one-to-one, and the at least two pieces of position information include target position information.
  • the electronic compass calibration device provided by the embodiment of the present application further includes an update module.
  • Update module used to update the initial calibration parameters to the target calibration before the calibration module 73 uses the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass, and when the calibration module 73 uses the initial calibration parameters to calibrate the magnetic field parameters. parameter.
  • the electronic compass calibration device further includes a first Hall sensor and a second Hall sensor.
  • the above-mentioned acquisition module 71 is specifically used to acquire the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor; and according to the first Hall parameter and the second Hall parameter , determine the target location information.
  • Embodiments of the present application provide an electronic compass calibration device.
  • the electronic compass calibration device can obtain target position information of a target button that may interfere with the electronic compass's detection of the geomagnetic field, and output the electronic compass based on the target calibration parameters determined by the target position information.
  • Calibrate the magnetic field parameters, that is, the target calibration parameters are related to the target position information, so it can avoid the magnetic field of the target button from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding the deviation of the geomagnetic field direction detected by the electronic compass. In this way, it can Improve the accuracy of electronic compass.
  • the electronic compass calibration device in the embodiment of the present application may be a device, or may be a component, integrated circuit, or chip in an electronic device.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or an augmented reality (AR)/virtual reality (VR).
  • MID mobile Internet device
  • AR augmented reality
  • VR virtual reality
  • VR VR
  • robots wearable devices
  • ultra-mobile personal computers UMPC
  • netbooks netbooks
  • personal digital assistants etc.
  • servers can also be servers, network attached storage (Network Attached Storage) , NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc.
  • Network Attached Storage Network Attached Storage
  • NAS network Attached Storage
  • personal computer personal computer, PC
  • television television
  • teller machine or self-service machine etc.
  • the electronic compass calibration device in the embodiment of the present application may be a device with an operating system.
  • the operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
  • the electronic compass calibration device provided by the embodiment of the present application can implement various processes implemented by the method embodiments of Figures 1 to 8. To avoid duplication, they will not be described again here.
  • this embodiment of the present application also provides an electronic device 90, including a processor 91 and a memory 92.
  • the memory 92 stores programs or instructions that can be run on the processor 91.
  • each step of the above electronic compass calibration method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, the details will not be described here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • Figure 12 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
  • the electronic device 100 includes but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, etc. part.
  • the electronic device 100 may also include a power supply (such as a battery) that supplies power to various components.
  • the power supply may be logically connected to the processor 110 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions.
  • the structure of the electronic device shown in Figure 12 does not constitute a limitation of the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or some components may be combined, or different components may be used. The layout of the components will not be described in detail here.
  • the processor 110 is used to obtain the target position information of the target key of the electronic device through at least one Hall sensor.
  • the target position information is used to indicate the key position of the target key on the electronic device; and according to the target position information , determine the target calibration parameters through the electronic compass; and use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
  • Embodiments of the present application provide an electronic device, because the electronic device can obtain target position information of a target button that may interfere with the electronic compass's detection of the geomagnetic field, and perform calibration on the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information.
  • Calibration that is, the target calibration parameters are related to the target position information, so it can avoid the magnetic field of the target button from interfering with the geomagnetic field detected by the electronic compass, thus avoiding the deviation of the geomagnetic field direction detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved. Accuracy.
  • the processor 110 is specifically configured to determine the target calibration parameters corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass; wherein the at least two preset calibration parameters are It is assumed that the calibration parameter corresponds to at least two pieces of position information one-to-one, and the at least two pieces of position information include target position information.
  • the electronic device can adjust the magnetic field parameters output by the electronic compass through the target calibration parameter corresponding to the target button position, thereby avoiding that the target button may interfere with the electronic compass detection when the target button is close to the electronic compass.
  • the geomagnetism causes the direction of the geomagnetic field detected by the electronic compass to deviate, thus improving the accuracy of the electronic compass.
  • the processor 110 is also configured to, before using the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass, when using the initial calibration parameters to calibrate the magnetic field parameters, set the initial The calibration parameters are updated to the target calibration parameters.
  • the electronic device can update the stored initial calibration parameters to the target calibration parameters related to the target position information, thereby calibrating the magnetic field parameters output by the electronic compass through the target calibration parameters. In this way, the performance of the electronic compass is improved. Accuracy.
  • the above-mentioned electronic device further includes a first Hall sensor and a second Hall sensor.
  • the processor 110 is specifically configured to obtain the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor; and based on the first Hall parameter and the second Hall parameter, Determine target location information.
  • the electronic device can be provided with two Hall sensors, the electronic device can directly determine the target position information based on the two Hall parameters detected by the two Hall sensors. Therefore, the electronic device can be improved. The accuracy with which the device determines target location information.
  • the electronic device provided by the embodiments of the present application can implement each process implemented by the above method embodiments, and can achieve the same technical effect. To avoid duplication, the details will not be described here.
  • the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042.
  • the graphics processor 1041 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras).
  • the display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072 .
  • Touch panel 1071 is also called a touch screen.
  • the touch panel 1071 may include two parts: a touch detection device and a touch controller.
  • Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
  • Memory 109 may be used to store software programs as well as various data.
  • the memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc.
  • memory 109 may include volatile memory or nonvolatile memory, or memory 109 may include both volatile and nonvolatile memory.
  • non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory.
  • Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).
  • RAM Random Access Memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM Double Data Rate SDRAM
  • DDRSDRAM double data rate synchronous dynamic random access memory
  • Enhanced SDRAM, ESDRAM synchronous dynamic random access memory
  • Synch link DRAM synchronous link dynamic random access memory
  • SLDRAM direct memory
  • the processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 110 .
  • Embodiments of the present application also provide a readable storage medium.
  • Programs or instructions are stored on the readable storage medium.
  • the program or instructions are executed by a processor, each process of the above method embodiments is implemented and the same technology can be achieved. The effect will not be described here in order to avoid repetition.
  • the processor is the processor in the electronic device described in the above embodiment.
  • the readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or CD etc.
  • An embodiment of the present application further provides a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement various processes of the above method embodiments. , and can achieve the same technical effect, so to avoid repetition, they will not be described again here.
  • chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
  • Embodiments of the present application provide a computer program product.
  • the program product is stored in a storage medium.
  • the program product is executed by at least one processor to implement each process of the above electronic compass calibration method embodiment, and can achieve the same technology. The effect will not be described here in order to avoid repetition.
  • the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
  • the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.

Abstract

An electronic compass calibration method and apparatus, an electronic device (90, 100), and a storage medium, which relate to the technical field of communications. The electronic device (90, 100) comprises: a target key (12), at least one Hall sensor (13, 14), and an electronic compass (15). The calibration method comprises: acquiring target position information of the target key (12) by means of the at least one Hall sensor (13, 14), wherein the target position information is used for indicating the key position of the target key (12) on the electronic device (90, 100); determining a target calibration parameter by means of the electronic compass (15) according to the target position information; and calibrating a magnetic field parameter output by the electronic compass (15) by using the target calibration parameter.

Description

电子罗盘校准方法、装置、电子设备及存储介质Electronic compass calibration method, device, electronic equipment and storage medium
相关申请的交叉引用Cross-references to related applications
本申请主张在2022年03月08日在中国提交的中国专利申请号202210220956.7的优先权,其全部内容通过引用包含于此。This application claims priority to Chinese Patent Application No. 202210220956.7 filed in China on March 8, 2022, the entire content of which is incorporated herein by reference.
技术领域Technical field
本申请属于通信技术领域,具体涉及一种电子罗盘校准方法、装置、电子设备及存储介质。This application belongs to the field of communication technology, and specifically relates to an electronic compass calibration method, device, electronic equipment and storage medium.
背景技术Background technique
通常,在电子设备中设置有电子罗盘,这样当用户想要获知地磁场方向时,用户可以触发电子设备通过该电子罗盘检测地磁场,并显示检测得到的地磁场方向,从而用户可以查看该地磁场方向。Usually, an electronic compass is provided in the electronic device, so that when the user wants to know the direction of the geomagnetic field, the user can trigger the electronic device to detect the geomagnetic field through the electronic compass and display the detected geomagnetic field direction, so that the user can view the geomagnetic field. Magnetic field direction.
然而,由于电子设备中可能存在干扰磁场,例如,电子设备中的静音键和霍尔传感器形成的磁场,这样该干扰磁场可能会干扰电子罗盘检测地磁场,因此,可能会导致电子罗盘检测得到的地磁场方向发生偏差。However, since there may be interference magnetic fields in electronic equipment, such as the magnetic fields formed by mute keys and Hall sensors in electronic equipment, the interference magnetic field may interfere with the detection of the geomagnetic field by the electronic compass. Therefore, it may cause errors detected by the electronic compass. The direction of the geomagnetic field is deflected.
如此,导致电子罗盘的准确度较差。This results in poor accuracy of the electronic compass.
发明内容Contents of the invention
本申请实施例的目的是提供一种电子罗盘校准方法、装置、电子设备及存储介质,能够解决电子罗盘的准确度较差的问题。The purpose of the embodiments of the present application is to provide an electronic compass calibration method, device, electronic equipment and storage medium, which can solve the problem of poor accuracy of the electronic compass.
第一方面,本申请实施例提供了一种电子罗盘校准方法,该电子罗盘校准方法包括:通过至少一个霍尔传感器,获取电子设备的目标按键的目标位置信息,该目标位置信息用于指示目标按键在电子设备上所处的按键位置;根据目标位置信息,通过电子罗盘确定目标校准参数;采用目标校准参数,对电子罗盘输出的磁场参数进行校准。In a first aspect, embodiments of the present application provide an electronic compass calibration method. The electronic compass calibration method includes: obtaining target position information of a target button of the electronic device through at least one Hall sensor, and the target position information is used to indicate the target. The key position of the key on the electronic device; according to the target position information, the target calibration parameters are determined through the electronic compass; the target calibration parameters are used to calibrate the magnetic field parameters output by the electronic compass.
第二方面,本申请实施例提供了一种电子罗盘校准装置,该电子罗盘校准装置包括:目标按键、至少一个霍尔传感器以及电子罗盘,该电子罗盘校准装置还包括:获取模块、确定模块和校准模块。获取模块,用于通过至少一个霍尔传感器,获取电子罗盘校准装置的目标按键的目标位置信息,该目标位置信息用于指示目标按键在电子罗盘校准装置上所处的按键位置。确定模块,用于根据获取模块获取的目标位置信息,通过电子罗盘确定目标校准参数。校准模块,用于采用确定模块确定的目标校准参数,对电子罗盘输出的磁场 参数进行校准。In a second aspect, embodiments of the present application provide an electronic compass calibration device. The electronic compass calibration device includes: a target button, at least one Hall sensor, and an electronic compass. The electronic compass calibration device further includes: an acquisition module, a determination module, and a compass calibration device. Calibration module. The acquisition module is configured to acquire the target position information of the target button of the electronic compass calibration device through at least one Hall sensor. The target position information is used to indicate the button position of the target button on the electronic compass calibration device. The determination module is used to determine the target calibration parameters through the electronic compass based on the target position information obtained by the acquisition module. The calibration module is used to use the target calibration parameters determined by the determination module to calculate the magnetic field output by the electronic compass. Parameters are calibrated.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括:电子设备的印刷电路板PCB上设置有:目标按键;至少一个霍尔传感器,该至少一个霍尔传感器与目标按键相对设置,该至少一个霍尔传感器用于获取目标按键的目标位置信息,该目标位置信息用于指示目标按键在电子设备上所处的按键位置;电子罗盘,该电子罗盘设置于PCB的远离目标按键的一端;其中,电子罗盘用于根据目标位置信息,确定目标校准参数,以使得电子设备可以采用目标校准参数,对电子罗盘输出的磁场参数进行校准。In a third aspect, embodiments of the present application provide an electronic device. The electronic device includes: a printed circuit board (PCB) of the electronic device provided with: a target button; and at least one Hall sensor, the at least one Hall sensor being opposite to the target button. It is set that the at least one Hall sensor is used to obtain the target position information of the target button, and the target position information is used to indicate the button position of the target button on the electronic device; an electronic compass is arranged on the PCB away from the target button. one end; wherein, the electronic compass is used to determine the target calibration parameters based on the target position information, so that the electronic device can use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
第四方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, embodiments of the present application provide an electronic device. The electronic device includes a processor and a memory. The memory stores programs or instructions that can be run on the processor. The programs or instructions are processed by the processor. When the processor is executed, the steps of the method described in the first aspect are implemented.
第五方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In a fifth aspect, embodiments of the present application provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the steps of the method described in the first aspect are implemented. .
第六方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。In a sixth aspect, embodiments of the present application provide a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the first aspect. the method described.
第七方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。In a seventh aspect, embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method as described in the first aspect.
在本申请实施例中,电子设备可以通过至少一个霍尔传感器获取目标按键的目标位置信息(该目标位置信息用于指示该目标按键在电子罗盘校准装置上所处的按键位置),并根据该目标位置信息,通过电子罗盘确定目标校准参数,从而电子设备可以根据目标校准参数对电子罗盘输出的磁场参数进行校准。本方案中,由于电子设备可以获取可能干扰电子罗盘检测地磁场的目标按键的目标位置信息,并根据该目标位置信息确定的目标校准参数,对电子罗盘输出的磁场参数进行校准,即目标校准参数与目标位置信息相关,因此可以避免该目标按键的磁场干扰电子罗盘检测地磁场的情况,从而可以避免电子罗盘检测得到的地磁场方向发生偏差,如此,可以提高电子罗盘的准确度。In the embodiment of the present application, the electronic device can obtain the target position information of the target key through at least one Hall sensor (the target position information is used to indicate the key position of the target key on the electronic compass calibration device), and according to the The target position information determines the target calibration parameters through the electronic compass, so that the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the target calibration parameters. In this solution, because the electronic device can obtain the target position information of the target button that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information, that is, the target calibration parameters It is related to the target position information, so the magnetic field of the target button can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
附图说明Description of the drawings
图1是本申请实施例提供的一种电子罗盘校准方法的流程图之一;Figure 1 is one of the flow charts of an electronic compass calibration method provided by an embodiment of the present application;
图2是本申请实施例提供的一种电子罗盘校准方法的流程图之二;Figure 2 is the second flow chart of an electronic compass calibration method provided by an embodiment of the present application;
图3是本申请实施例提供的一种电子罗盘校准方法的流程图之三;Figure 3 is the third flow chart of an electronic compass calibration method provided by an embodiment of the present application;
图4是本申请实施例提供的一种电子罗盘校准装置的结构示意图之一;Figure 4 is one of the structural schematic diagrams of an electronic compass calibration device provided by an embodiment of the present application;
图5是本申请实施例提供的一种电子罗盘校准方法的流程图之四;Figure 5 is the fourth flow chart of an electronic compass calibration method provided by an embodiment of the present application;
图6是本申请实施例提供的一种电子罗盘校准装置的结构示意图之二;Figure 6 is a second structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application;
图7是本申请实施例提供的一种电子罗盘校准装置的结构示意图之三; Figure 7 is the third structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application;
图8是本申请实施例提供的一种电子罗盘校准装置的结构示意图之四;Figure 8 is the fourth structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application;
图9是本申请实施例提供的一种电子罗盘校准装置的结构示意图之五;Figure 9 is a fifth structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application;
图10是本申请实施例提供的一种电子罗盘校准装置的结构示意图之六;Figure 10 is the sixth structural schematic diagram of an electronic compass calibration device provided by an embodiment of the present application;
图11是本申请实施例提供的一种电子设备的结构示意图;Figure 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图12是本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 12 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一霍尔传感器可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first Hall sensor may be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的电子罗盘校准方法进行详细地说明。The electronic compass calibration method provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios.
随着通信技术的发展,电子设备附带的功能也越来越丰富,从而电子设备中集成的部件也逐渐增多,例如,电子设备中可以增加电子罗盘,且在当前电子设备的整机堆叠中,电子罗盘通常和静音键霍尔布局在一起,这样当用户需求获知地磁方向(即当前定位)时,电子设备可以通过电子罗盘检测当前地磁场环境,并显示检测得到的地磁场方向,从而用户可以查看到当前的位置以及方向。With the development of communication technology, the functions attached to electronic equipment are becoming more and more abundant, so the components integrated in electronic equipment are gradually increasing. For example, electronic compasses can be added to electronic equipment, and in the current stack of electronic equipment, The electronic compass is usually arranged together with the mute button Hall, so that when the user needs to know the geomagnetic direction (i.e. current positioning), the electronic device can detect the current geomagnetic field environment through the electronic compass and display the detected geomagnetic field direction, so that the user can View current location and direction.
然而,电子罗盘和静音键霍尔都属于磁传感器,由于静音键霍尔功能判断需要外部磁铁提供一定的磁场,从而可以通过检测磁场的大小来确定静音键的位置,当静音键设置的外部磁场发生变化时,可能会使得电子罗盘检测的磁场发生误判,相关技术中,可以通过电子罗盘和静音键磁铁布局大于预设距离(例如15MM),从而可以减小静音键磁铁对电子罗盘的干扰,但是,若电子罗盘和静音键间距过大,则会导致电子设备整机堆叠布局难度增大。However, both the electronic compass and the mute key Hall are magnetic sensors. Since the judgment of the mute key Hall function requires an external magnet to provide a certain magnetic field, the position of the mute key can be determined by detecting the size of the magnetic field. When the external magnetic field set by the mute key When changes occur, the magnetic field detected by the electronic compass may be misjudged. In related technology, the layout of the electronic compass and the mute key magnet can be larger than the preset distance (for example, 15MM), thereby reducing the interference of the mute key magnet on the electronic compass. , however, if the distance between the electronic compass and the mute key is too large, it will make the stacking layout of the entire electronic device more difficult.
本申请实施例中,本申请提供的电子设备包括:目标按键、至少一个霍尔传感器以及电子罗盘,从而电子设备可以通过至少一个霍尔传感器获取静音键(即目标按键)的当前位置信息(该当前位置信息用于指示该静音键当前在电子设备上所处的按键位置),并根 据该当前位置信息,通过电子罗盘确定校准参数,从而电子设备可以根据确定的校准参数对电子罗盘输出的磁场参数进行校准。本方案中,由于电子设备可以获取可能干扰电子罗盘检测地磁场的静音键的当前位置信息,并根据该当前位置信息确定的校准参数,对电子罗盘输出的磁场参数进行校准,即确定的校准参数与当前位置信息相关,因此可以避免该静音键的磁场干扰电子罗盘检测地磁场的情况,从而可以避免电子罗盘检测得到的地磁场方向发生偏差,如此,可以提高电子罗盘的准确度。In the embodiment of the present application, the electronic device provided by the present application includes: a target button, at least one Hall sensor, and an electronic compass, so that the electronic device can obtain the current position information (the target button) of the mute button (ie, the target button) through at least one Hall sensor. The current position information is used to indicate the current key position of the mute key on the electronic device), and is based on According to the current position information, the calibration parameters are determined through the electronic compass, so that the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the determined calibration parameters. In this solution, because the electronic device can obtain the current position information of the mute key that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the calibration parameters determined by the current position information, that is, the determined calibration parameters It is related to the current position information, so the magnetic field of the mute key can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
本申请实施例提供一种电子罗盘校准方法,图1示出了本申请实施例提供的一种电子罗盘校准方法的流程图。如图1所示,本申请实施例提供的电子罗盘校准方法可以包括下述的步骤201至步骤203。An embodiment of the present application provides an electronic compass calibration method. FIG. 1 shows a flow chart of an electronic compass calibration method provided by an embodiment of the present application. As shown in Figure 1, the electronic compass calibration method provided by the embodiment of the present application may include the following steps 201 to 203.
步骤201、电子设备通过至少一个霍尔传感器,获取目标按键的目标位置信息。Step 201: The electronic device obtains the target position information of the target button through at least one Hall sensor.
本申请实施例中,上述目标位置信息用于指示目标按键在电子设备上所处的按键位置。In this embodiment of the present application, the above target position information is used to indicate the key position of the target key on the electronic device.
可选地,本申请实施例中,上述目标按键中可以设置有磁性件。Optionally, in this embodiment of the present application, a magnetic component may be provided in the above target button.
其中,该目标按键可以为以下任一项:静音键、音量键、电子设备中的预设位置对应的按键或任何与电子罗盘小于预设距离(例如2CM)的按键。上述磁性件可以包括以下至少一项:磁铁、电磁铁等。The target button may be any of the following: a mute button, a volume button, a button corresponding to a preset position in the electronic device, or any button that is less than a preset distance (for example, 2CM) from the electronic compass. The above-mentioned magnetic components may include at least one of the following: magnets, electromagnets, etc.
可选地,本申请实施例中,上述目标位置信息具体可以为目标按键在电子设备中的预设坐标系中的坐标信息。Optionally, in this embodiment of the present application, the above target position information may specifically be the coordinate information of the target button in a preset coordinate system in the electronic device.
可选地,本申请实施例中,在电子设备处于开机状态的情况下,电子设备可以获取目标按键的目标位置信息。其中,开机状态可以包括以下任一项:开机启动状态、待机状态(例如灭屏待机状态)和工作状态(例如亮屏状态)等。Optionally, in this embodiment of the present application, when the electronic device is powered on, the electronic device can obtain the target location information of the target key. The power-on state may include any of the following: a power-on state, a standby state (such as a screen-off standby state), a working state (such as a screen-on state), and so on.
在一种示例中,在电子设备运行导航类应用的情况下,电子设备可以实时获取目标按键的目标位置信息。In one example, when the electronic device runs a navigation application, the electronic device can obtain the target location information of the target key in real time.
在另一种示例中,在电子设备接收到用户对目标按键的第一输入的情况下,电子设备可以实时获取目标按键的目标位置信息。其中,该第一输入用于移动目标按键,以使得目标按键在电子设备上所处的按键位置发生改变。In another example, when the electronic device receives the user's first input to the target key, the electronic device may obtain the target location information of the target key in real time. Wherein, the first input is used to move the target key, so that the key position of the target key on the electronic device changes.
可以理解,若目标按键在电子设备上所处的按键位置发生改变,则可以认为该目标按键附近的磁场可能会发生改变,因此,电子设备可以实时获取目标位置信息。It can be understood that if the key position of the target button on the electronic device changes, it can be considered that the magnetic field near the target button may change. Therefore, the electronic device can obtain the target position information in real time.
进一步可选地,本申请实施例中,上述第一输入可以为以下任一项:按压输入(例如点击输入)、拨动输入、滑动输入或预设轨迹输入等。具体的可以根据实际使用需求确定,本申请实施例不作限制。Further optionally, in the embodiment of the present application, the above-mentioned first input may be any of the following: press input (such as click input), toggle input, sliding input, or preset trajectory input, etc. The details can be determined according to actual usage requirements, and are not limited by the embodiments of this application.
可选地,本申请实施例中,电子设备中还可以设置有至少一个霍尔传感器,该至少一 个霍尔传感器设置于目标按键的预设范围内的位置中,从而该至少一个霍尔传感器可以分别输出对应的霍尔参数,以输出至少一个霍尔参数,进而电子设备可以根据该至少一个霍尔参数,确定目标按键的目标位置信息。Optionally, in the embodiment of the present application, the electronic device may also be provided with at least one Hall sensor, and the at least one Hall sensor The two Hall sensors are arranged in a position within the preset range of the target button, so that the at least one Hall sensor can respectively output corresponding Hall parameters to output at least one Hall parameter, and then the electronic device can output the corresponding Hall parameters according to the at least one Hall sensor. parameter to determine the target location information of the target button.
步骤202、电子设备根据目标位置信息,通过电子罗盘确定目标校准参数。Step 202: The electronic device determines the target calibration parameters through the electronic compass based on the target location information.
本申请实施例中,上述目标校准参数用于校准电子设备的电子罗盘输出的磁场参数。In the embodiment of the present application, the above target calibration parameters are used to calibrate the magnetic field parameters output by the electronic compass of the electronic device.
可选地,本申请实施例中,上述目标校准参数可以包括以下至少一项:夹角关系参数、磁场分布参数、磁场方向参数或加速度参数。Optionally, in this embodiment of the present application, the above-mentioned target calibration parameters may include at least one of the following: angle relationship parameters, magnetic field distribution parameters, magnetic field direction parameters or acceleration parameters.
可选地,本申请实施例中,在电子设备中预先存储有多个预设校准参数(例如下述实施例中的至少两个预设校准参数),该多个预设校准参数一一对应多个位置信息,从而电子设备可以确定与目标位置信息对应的目标校准参数。Optionally, in the embodiment of the present application, multiple preset calibration parameters (such as at least two preset calibration parameters in the following embodiments) are pre-stored in the electronic device, and the multiple preset calibration parameters are one by one. Corresponding to multiple position information, the electronic device can determine the target calibration parameters corresponding to the target position information.
进一步可选地,本申请实施例中,电子设备可以从多个位置信息中,确定与目标位置信息相匹配的一个位置信息,并将该一个位置信息对应的一个预设校准参数,确定为目标校准参数。Further optionally, in this embodiment of the present application, the electronic device can determine a piece of position information that matches the target position information from a plurality of position information, and determine a preset calibration parameter corresponding to the piece of position information as the target. Calibration parameters.
需要说明的是,上述“与目标位置信息相匹配”可以理解为:与目标位置信息相同;或者,与目标位置信息间的差值小于或等于预设阈值。It should be noted that the above "matching the target location information" can be understood as: being the same as the target location information; or the difference from the target location information is less than or equal to the preset threshold.
步骤203、电子设备采用目标校准参数,对电子罗盘输出的磁场参数进行校准。Step 203: The electronic device uses the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
可选地,本申请实施例中,上述磁场参数可以包括磁场方向参数。Optionally, in this embodiment of the present application, the above-mentioned magnetic field parameters may include magnetic field direction parameters.
可选地,本申请实施例中,电子设备可以采用预设校准算法,根据目标校准参数和电子罗盘输出的磁场参数进行计算,以得到校准后的磁场参数。可以理解,校准后的磁场参数为准确的磁场参数。Optionally, in this embodiment of the present application, the electronic device can use a preset calibration algorithm to perform calculations based on the target calibration parameters and the magnetic field parameters output by the electronic compass to obtain the calibrated magnetic field parameters. It can be understood that the calibrated magnetic field parameters are accurate magnetic field parameters.
在一种示例中,在电子设备未对电子设备的电子罗盘输出的磁场参数进行校准的情况下,电子设备可以直接采用目标校准参数,对电子设备的电子罗盘输出的磁场参数进行校准。In one example, when the electronic device does not calibrate the magnetic field parameters output by the electronic compass of the electronic device, the electronic device can directly use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass of the electronic device.
在另一种示例中,在电子设备采用其他校准参数(例如下述实施例中的初始校准参数)对电子设备的电子罗盘输出的磁场参数进行校准的情况下,电子设备可以先将该其他校准参数更新为目标校准参数,然后再采用目标校准参数,对电子设备的电子罗盘输出的磁场参数进行校准。In another example, when the electronic device uses other calibration parameters (such as the initial calibration parameters in the following embodiments) to calibrate the magnetic field parameters output by the electronic compass of the electronic device, the electronic device can first calibrate the other calibration parameters. The parameters are updated to the target calibration parameters, and then the target calibration parameters are used to calibrate the magnetic field parameters output by the electronic compass of the electronic device.
可以理解,在电子设备确定目标校准参数之后,可能会出现电子设备正在采用其他校准参数对电子罗盘输出的磁场参数进行校准的情况,该其他校准参数不与目标位置信息相关,这样可能会出现目标按键的磁场干扰电子罗盘检测地磁场的情况,因此,电子设备可以将该其他校准参数更新为目标校准参数。It can be understood that after the electronic device determines the target calibration parameters, it may happen that the electronic device is using other calibration parameters to calibrate the magnetic field parameters output by the electronic compass. The other calibration parameters are not related to the target position information, so the target may appear. The magnetic field of the key interferes with the electronic compass's detection of the geomagnetic field. Therefore, the electronic device can update the other calibration parameters to the target calibration parameters.
可选地,本申请实施例中,结合图1,如图2所示,在上述步骤203之前,本申请实 施例提供的电子罗盘校准方法还包括下述的步骤301。Optionally, in the embodiment of the present application, as shown in Figure 2 in conjunction with Figure 1, before the above step 203, the present application implements The electronic compass calibration method provided by the embodiment also includes the following step 301.
步骤301、在采用初始校准参数对磁场参数进行校准的情况下,电子设备将初始校准参数更新为目标校准参数。Step 301: When the initial calibration parameters are used to calibrate the magnetic field parameters, the electronic device updates the initial calibration parameters to the target calibration parameters.
进一步可选地,本申请实施例中,电子罗盘在实时进行磁场校准处理,当目标按键的位置发生变化时,电子设备可以将初始校准参数更新为目标校准参数,从而通过更新后的目标校准参数对电子罗盘输出的磁场参数重新进行校准,以得到基于目标校准参数输出的磁场参数。获取目标校准参数的具体过程可以参见上述实施例,此处不在赘述。Further optionally, in the embodiment of the present application, the electronic compass performs magnetic field calibration processing in real time. When the position of the target button changes, the electronic device can update the initial calibration parameters to the target calibration parameters, thereby using the updated target calibration parameters. Recalibrate the magnetic field parameters output by the electronic compass to obtain the magnetic field parameters output based on the target calibration parameters. The specific process of obtaining the target calibration parameters can be referred to the above embodiments and will not be described again here.
进一步可选地,本申请实施例中,电子设备可以接收用户对目标按键的第二输入,以触发目标按键的位置信息发生改变(例如下述第二位置),从而电子设备可以获取得第二位置信息对应的目标校准参数,以通过第二位置信息对应的目标校准参数对电子罗盘输出的磁场参数进行校准。Further optionally, in this embodiment of the present application, the electronic device may receive the user's second input to the target key to trigger a change in the position information of the target key (such as the second position described below), so that the electronic device may obtain the second The target calibration parameters corresponding to the position information are used to calibrate the magnetic field parameters output by the electronic compass through the target calibration parameters corresponding to the second position information.
进一步可选地,本申请实施例中,上述第二输入可以为以下任一项:点击输入、拨动输入、滑动输入或者预设轨迹输入。具体的可以根据实际使用需求确定,本发明实施例不作限制。Further optionally, in this embodiment of the present application, the above-mentioned second input may be any of the following: click input, toggle input, sliding input or preset trajectory input. The details can be determined according to actual usage requirements, and are not limited by the embodiments of the present invention.
本申请实施例中,电子设备可以将储存的初始校准参数更新为与目标位置信息相关的目标校准参数,从而通过该目标校准参数对电子罗盘输出的磁场参数进行校准,如此,提高了电子罗盘的准确度。In the embodiment of the present application, the electronic device can update the stored initial calibration parameters to the target calibration parameters related to the target position information, thereby calibrating the magnetic field parameters output by the electronic compass through the target calibration parameters. In this way, the performance of the electronic compass is improved. Accuracy.
可选地,本申请实施例中,在对电子罗盘输出的磁场参数进行校准之后,电子设备可以再次执行上述的步骤201至步骤203,以再次对电子罗盘输出的磁场参数进行校准。Optionally, in this embodiment of the present application, after calibrating the magnetic field parameters output by the electronic compass, the electronic device can perform the above steps 201 to 203 again to calibrate the magnetic field parameters output by the electronic compass again.
在一种示例中,电子设备可以在对电子罗盘输出的磁场参数进行校准后的预设时长之后,再次执行上述的步骤201至步骤203。可以理解,电子设备可以每隔一段时间,便再次对电子罗盘输出的磁场参数进行校准。In one example, the electronic device may perform the above steps 201 to 203 again after a preset period of time after calibrating the magnetic field parameters output by the electronic compass. It can be understood that the electronic device can calibrate the magnetic field parameters output by the electronic compass again every once in a while.
在另一种示例中,电子设备可以根据用户对电子设备的输入,再次执行上述的步骤201至步骤203。可以理解,电子设备还可以根据用户的需求,再次对电子罗盘输出的磁场参数进行校准。In another example, the electronic device may perform the above-mentioned steps 201 to 203 again according to the user's input to the electronic device. It can be understood that the electronic device can also calibrate the magnetic field parameters output by the electronic compass again according to the user's needs.
本申请实施例中,在目标按键中设置有磁铁,这样在目标按键在电子设备上所处的按键位置发生改变时,可能会导致该目标按键附近的磁场发生改变,以导致电子罗盘输出的磁场参数不准确,因此,电子设备可以获取目标按键的目标位置信息,并根据该目标位置信息,确定目标校准参数,以采用该目标校准参数,对电子设备的电子罗盘输出的磁场参数进行校准,以得到准确的磁场参数。In the embodiment of the present application, a magnet is provided in the target button, so that when the button position of the target button on the electronic device changes, the magnetic field near the target button may change, causing the magnetic field output by the electronic compass to change. The parameters are inaccurate. Therefore, the electronic device can obtain the target position information of the target button, and determine the target calibration parameters based on the target position information, so as to use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass of the electronic device. Obtain accurate magnetic field parameters.
本申请实施例提供一种电子罗盘校准方法,电子设备可以获取目标按键的目标位置信息(该目标位置信息用于指示该目标按键在电子设备上所处的按键位置),并根据该目标 位置信息确定目标校准参数,从而电子设备可以根据目标校准参数对电子罗盘输出的磁场参数进行校准。本方案中,由于电子设备可以获取可能干扰电子罗盘检测地磁场的目标按键的目标位置信息,并根据该目标位置信息确定的目标校准参数,对电子罗盘输出的磁场参数进行校准,即目标校准参数与目标位置信息相关,因此可以避免该目标按键的磁场干扰电子罗盘检测地磁场的情况,从而可以避免电子罗盘检测得到的地磁场方向发生偏差,如此,可以提高电子罗盘的准确度。Embodiments of the present application provide an electronic compass calibration method. The electronic device can obtain the target position information of the target key (the target position information is used to indicate the key position of the target key on the electronic device), and according to the target The position information determines the target calibration parameters, so that the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the target calibration parameters. In this solution, because the electronic device can obtain the target position information of the target button that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information, that is, the target calibration parameters It is related to the target position information, so the magnetic field of the target button can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
并且地,由于电子设备可以根据目标位置信息确定的目标校准参数,对电子罗盘输出的磁场参数进行校准,因此,可以将电子罗盘与目标按键布局在相邻区域内,如此,可以降低电子设备整机的堆叠难度。Moreover, since the electronic device can calibrate the magnetic field parameters output by the electronic compass according to the target calibration parameters determined by the target position information, the electronic compass and the target buttons can be arranged in adjacent areas, thus reducing the overall cost of the electronic device. The stacking difficulty of the machine.
以下将以电子设备中设置有两个霍尔传感器为例,举例说明电子设备是如何获取目标位置信息的。The following will take two Hall sensors installed in an electronic device as an example to illustrate how the electronic device obtains target position information.
可选地,本申请实施例中,结合图1,如图3所示,上述电子设备还包括第一霍尔传感器和第二霍尔传感器。上述步骤201具体可以通过下述的步骤201a和步骤201b实现。Optionally, in this embodiment of the present application, as shown in FIG. 3 in conjunction with FIG. 1 , the above-mentioned electronic device further includes a first Hall sensor and a second Hall sensor. The above step 201 can be specifically implemented through the following steps 201a and 201b.
步骤201a、电子设备获取第一霍尔传感器检测得到的第一霍尔参数和第二霍尔传感器检测得到的第二霍尔参数。Step 201a: The electronic device obtains the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor.
可选地,本申请实施例中,上述第一霍尔传感器和第二霍尔传感器可以为线性霍尔传感器(例如开环式霍尔传感器或者闭环式霍尔传感器),或者开关型霍尔传感器。Optionally, in the embodiment of the present application, the first Hall sensor and the second Hall sensor may be linear Hall sensors (such as open-loop Hall sensors or closed-loop Hall sensors), or switch-type Hall sensors. .
需要说明的是,上述第一霍尔传感器与第二霍尔传感器极性相反,且该第一霍尔传感器与第二霍尔传感器均与按键磁铁垂直。It should be noted that the first Hall sensor and the second Hall sensor have opposite polarities, and both the first Hall sensor and the second Hall sensor are perpendicular to the button magnet.
可选地,本申请实施例中,上述第一霍尔参数和第二霍尔参数具体可以均为霍尔电压值。Optionally, in the embodiment of the present application, the first Hall parameter and the second Hall parameter may both be Hall voltage values.
第一霍尔传感器和第二霍尔传感器中均存在有霍尔电压,磁场越强,电压越高,反之,磁场越弱,电压越低,从而第一霍尔传感器可以根据检测到的目标按键的磁铁的磁场大小,得到一个霍尔电压值(即第一霍尔参数),且第二霍尔传感器可以根据检测到的目标按键的磁铁的磁场大小,得到另一个霍尔电压值(即第二霍尔参数),以使得电子设备可以根据该第一霍尔参数和第二霍尔参数,来确定获取的目标按键的目标位置信息。There is a Hall voltage in both the first Hall sensor and the second Hall sensor. The stronger the magnetic field, the higher the voltage. On the contrary, the weaker the magnetic field, the lower the voltage. Therefore, the first Hall sensor can detect the target button according to the According to the magnetic field size of the magnet, a Hall voltage value (i.e., the first Hall parameter) is obtained, and the second Hall sensor can obtain another Hall voltage value (i.e., the third Hall parameter) based on the detected magnetic field size of the magnet of the target button. (two Hall parameters), so that the electronic device can determine the acquired target position information of the target button according to the first Hall parameter and the second Hall parameter.
可以理解,在目标按键中的磁铁发生移动(例如上下移动,或左右移动)时,该磁铁的移动位置受到目标按键的结构限位而固定,当按键磁铁上下移动时,磁铁产生的磁场也在上下变化,这样当磁铁的大小、形状、牌号确定后,磁铁的表磁和磁场范围也可以随之确定,因此电子设备可以通过第一霍尔参数和第二霍尔参数,确定目标按键的目标位置信息。左右移动同理,此处不在赘述。It can be understood that when the magnet in the target button moves (for example, up and down, or left and right), the moving position of the magnet is limited and fixed by the structure of the target button. When the button magnet moves up and down, the magnetic field generated by the magnet is also Change up and down, so that when the size, shape, and brand of the magnet are determined, the surface magnetism and magnetic field range of the magnet can also be determined accordingly. Therefore, the electronic device can determine the target of the target button through the first Hall parameter and the second Hall parameter. location information. The same applies to moving left and right, so I won’t go into details here.
步骤201b、电子设备根据第一霍尔参数和第二霍尔参数,确定目标位置信息。 Step 201b: The electronic device determines the target position information based on the first Hall parameter and the second Hall parameter.
可选地,本申请实施例中,电子设备可以根据第一霍尔参数是否大于(或小于)第一预设电压值,且第二霍尔参数是否小于(或大于)第二预设电压值,确定目标位置信息。Optionally, in the embodiment of the present application, the electronic device can determine whether the first Hall parameter is greater than (or less than) the first preset voltage value, and whether the second Hall parameter is less than (or greater than) the second preset voltage value. , determine the target location information.
示例性地,假设目标按键中的磁铁靠近第一霍尔传感器(即目标按键处于第一位置,该第一位置为目标按键的上半部分区域),此时第一霍尔传感器检测到的磁铁的磁场较大,且第二霍尔传感器检测到的磁铁的磁场较小,从而第一霍尔传感器得到的霍尔电压值(即第一霍尔参数)较大,且第二霍尔传感器得到的霍尔电压值(即第二霍尔参数)较小,因此,在第一霍尔参数大于第一预设电压值,且第二霍尔参数小于第二预设电压值的情况下,电子设备可以将第一位置信息确定为目标位置信息。其中,该第一位置信息用于指示目标按键在电子设备上所处的按键位置为第一位置。For example, assuming that the magnet in the target button is close to the first Hall sensor (that is, the target button is in the first position, and the first position is the upper half area of the target button), at this time, the magnet detected by the first Hall sensor The magnetic field of the magnet is larger, and the magnetic field of the magnet detected by the second Hall sensor is smaller, so the Hall voltage value (i.e., the first Hall parameter) obtained by the first Hall sensor is larger, and the second Hall sensor obtains The Hall voltage value (i.e., the second Hall parameter) is small. Therefore, when the first Hall parameter is greater than the first preset voltage value, and the second Hall parameter is less than the second preset voltage value, the electronic The device may determine the first location information as the target location information. The first position information is used to indicate that the key position of the target key on the electronic device is the first position.
举例说明,如图4所示,目标按键中的磁铁靠近第一霍尔传感器13,第一霍尔传感器14检测到的磁铁的磁场较大,且第二霍尔传感器13检测到的磁铁的磁场较小,此时在第一霍尔参数大于第一预设电压值,且第二霍尔参数小于第二预设电压值的情况下,电子设备可以将第一位置信息确定为目标位置信息。For example, as shown in Figure 4, the magnet in the target button is close to the first Hall sensor 13, the magnetic field of the magnet detected by the first Hall sensor 14 is relatively large, and the magnetic field of the magnet detected by the second Hall sensor 13 is is smaller, in this case, when the first Hall parameter is greater than the first preset voltage value and the second Hall parameter is less than the second preset voltage value, the electronic device can determine the first position information as the target position information.
又示例性地,假设目标按键中的磁铁靠近第二霍尔传感器(即目标按键处于第二位置,该第二位置为目标按键的下半部分区域),此时第一霍尔传感器检测到的磁铁的磁场较小,且第二霍尔传感器检测到的磁铁的磁场较大,从而第一霍尔传感器得到的霍尔电压值(即第一霍尔参数)较小,且第二霍尔传感器得到的霍尔电压值(即第二霍尔参数)较大,因此,在第一霍尔参数小于第一预设电压值,且第二霍尔参数大于第二预设电压值的情况下,电子设备可以将第二位置信息确定为目标位置信息。其中,该第二位置信息用于指示目标按键在电子设备上所处的按键位置为第二位置。As another example, assume that the magnet in the target button is close to the second Hall sensor (that is, the target button is in the second position, and the second position is the lower half of the target button). At this time, the first Hall sensor detects The magnetic field of the magnet is small, and the magnetic field of the magnet detected by the second Hall sensor is large, so the Hall voltage value (i.e., the first Hall parameter) obtained by the first Hall sensor is small, and the second Hall sensor The obtained Hall voltage value (i.e., the second Hall parameter) is larger. Therefore, when the first Hall parameter is smaller than the first preset voltage value and the second Hall parameter is larger than the second preset voltage value, The electronic device may determine the second location information as the target location information. The second position information is used to indicate that the key position of the target key on the electronic device is the second position.
本申请实施例中,由于电子设备中可以设置有两个霍尔传感器,这样电子设备可以直接根据该两个霍尔传感器检测得到的两个霍尔参数,确定目标位置信息,因此,可以提高电子设备确定目标位置信息的准确性。In the embodiment of the present application, since the electronic device can be provided with two Hall sensors, the electronic device can directly determine the target position information based on the two Hall parameters detected by the two Hall sensors. Therefore, the electronic device can be improved. The accuracy with which the device determines target location information.
当然,为了进一步减小目标按键中的磁铁的磁场对电子罗盘检测地磁场的干扰,可以在目标按键上设置隔磁部件。Of course, in order to further reduce the interference of the magnetic field of the magnet in the target button on the geomagnetic field detected by the electronic compass, a magnetic isolation component can be provided on the target button.
下面将举例说明,电子设备是如何确定目标校准参数的。The following is an example of how electronic equipment determines target calibration parameters.
可选地,本申请实施例中,结合图1,如图5所示,上述步骤202具体可以通过下述的步骤202a实现。Optionally, in this embodiment of the present application, as shown in FIG. 5 in conjunction with FIG. 1 , the above step 202 can be specifically implemented through the following step 202a.
步骤202a、电子设备从电子罗盘中预存的至少两个预设校准参数中,确定与目标位置信息对应的目标校准参数。Step 202a: The electronic device determines the target calibration parameter corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass.
本申请实施例中,上述至少两个预设校准参数与至少两个位置信息一一对应,该至少两个位置信息中包括目标位置信息。 In the embodiment of the present application, the above-mentioned at least two preset calibration parameters correspond to at least two pieces of position information in a one-to-one manner, and the at least two pieces of position information include target position information.
进一步可选地,本申请实施例中,针对至少两个预设校准参数中的每个预设校准参数,可以先将目标按键移动至一个按键位置,并获取电子罗盘输出的磁场参数与准确磁场参数间的偏差值,再根据该偏差值确定一个预设校准参数,以得到一个预设校准参数,从而可以得到至少两个预设校准参数。其中,上述准确磁场参数可以为采用其他设备(例如指南针)检测得到的磁场参数。Further optionally, in the embodiment of the present application, for each of the at least two preset calibration parameters, the target button can be moved to a button position first, and the magnetic field parameters and accurate magnetic field output by the electronic compass are obtained. Deviation value between parameters, and then determine a preset calibration parameter based on the deviation value to obtain one preset calibration parameter, so that at least two preset calibration parameters can be obtained. The above-mentioned accurate magnetic field parameters may be magnetic field parameters detected using other equipment (such as a compass).
可以理解,在整机中,电子罗盘所处磁场环境复杂,为了更准确地测量地磁场,可以根据目标按键的不同按键位置,预先确定至少两个预设校准参数,从而电子设备可以根据目标按键的按键位置,确定对应的预设校准参数。It can be understood that in the whole machine, the electronic compass is in a complex magnetic field environment. In order to measure the geomagnetic field more accurately, at least two preset calibration parameters can be predetermined according to the different key positions of the target keys, so that the electronic device can be based on the target keys. button position to determine the corresponding preset calibration parameters.
进一步可选地,本申请实施例中,在电子罗盘中预先设置有至少两个硬磁数据库,每个硬磁数据库中分别存储有一个预设校准参数,从而电子设备可以根据至少两个对应关系,确定与目标位置信息对应的一个硬磁数据库,并将该一个硬磁数据库中的预设校准参数,确定为目标校准参数。其中,该至少两个对应关系中的每个对应关系分别为一个位置信息与一个硬磁数据库的对应关系。Further optionally, in the embodiment of the present application, at least two hard magnetic databases are preset in the electronic compass, and each hard magnetic database stores a preset calibration parameter, so that the electronic device can calculate the calibration parameters according to at least two corresponding relationships. , determine a hard magnetic database corresponding to the target position information, and determine the preset calibration parameters in the hard magnetic database as the target calibration parameters. Each of the at least two corresponding relationships is a corresponding relationship between a position information and a hard magnetic database.
具体地,电子设备可以从至少两个对应关系中的至少两个位置信息中,确定出与目标位置信息相匹配的一个位置信息,然后再将该一个位置信息对应的硬磁库中的一个预设校准参数,确定为目标校准参数。Specifically, the electronic device can determine a piece of position information that matches the target position information from at least two pieces of position information in at least two corresponding relationships, and then store the piece of position information corresponding to a preset in the hard magnetic library. Set the calibration parameters and determine them as target calibration parameters.
本申请实施例中,电子设备可以通过目标按键位置对应的目标校准参数,对电子罗盘输出的磁场参数进行调整,避免了当目标按键与电子罗盘距离较近时,目标按键可能会干扰电子罗盘检测地磁,从而导致电子罗盘检测得到的地磁场方向发生偏差,如此,提高了电子罗盘的准确度。In the embodiment of this application, the electronic device can adjust the magnetic field parameters output by the electronic compass through the target calibration parameter corresponding to the target button position, thereby avoiding that the target button may interfere with the electronic compass detection when the target button is close to the electronic compass. The geomagnetism causes the direction of the geomagnetic field detected by the electronic compass to deviate, thus improving the accuracy of the electronic compass.
本申请实施例提供一种电子设备,图6示出了本申请实施例提供的一种电子设备可能的结构示意图,如图6所示,该电子设备可以包括:PCB11、目标按键12、至少一个霍尔传感器和电子罗盘15,该至少一个霍尔传感器包括第一霍尔传感器13和第二霍尔传感器14。An embodiment of the present application provides an electronic device. Figure 6 shows a possible structural diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 6, the electronic device may include: PCB 11, target button 12, at least one Hall sensor and electronic compass 15 , the at least one Hall sensor includes a first Hall sensor 13 and a second Hall sensor 14 .
其中,该PCB上设置有:第一霍尔传感器13和第二霍尔传感器14,该第一霍尔传感器13和第二霍尔传感器14与目标按键12相对设置;电子罗盘15,该电子罗盘15设置于PCB11的远离目标按键12的一端。Among them, the PCB is provided with: a first Hall sensor 13 and a second Hall sensor 14, the first Hall sensor 13 and the second Hall sensor 14 are arranged opposite to the target button 12; an electronic compass 15, the electronic compass 15 15 is arranged at one end of PCB 11 away from the target button 12 .
本申请实施例中,上述至少一个霍尔传感器用于获取目标按键的目标位置信息,该目标位置信息用于指示目标按键在电子设备上所处的按键位置;上述电子罗盘用于根据目标位置信息,确定目标校准参数,以使得电子设备可以采用目标校准参数,对电子罗盘输出的磁场参数进行校准。In the embodiment of the present application, the above-mentioned at least one Hall sensor is used to obtain the target position information of the target key, and the target position information is used to indicate the key position of the target key on the electronic device; the above-mentioned electronic compass is used to obtain the target position information according to the target position information. , determine the target calibration parameters, so that the electronic device can use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
本申请实施例提供一种电子设备,电子设备可以通过至少一个霍尔传感器获取目标按 键的目标位置信息(该目标位置信息用于指示该目标按键在电子设备上所处的按键位置),并根据该目标位置信息,通过电子罗盘确定目标校准参数,从而电子设备可以根据目标校准参数对电子罗盘输出的磁场参数进行校准。本方案中,由于电子设备可以获取可能干扰电子罗盘检测地磁场的目标按键的目标位置信息,并根据该目标位置信息确定的目标校准参数,对电子罗盘输出的磁场参数进行校准,即目标校准参数与目标位置信息相关,因此可以避免该目标按键的磁场干扰电子罗盘检测地磁场的情况,从而可以避免电子罗盘检测得到的地磁场方向发生偏差,如此,可以提高电子罗盘的准确度。Embodiments of the present application provide an electronic device that can obtain a target button through at least one Hall sensor. The target position information of the key (the target position information is used to indicate the key position of the target key on the electronic device), and based on the target position information, the target calibration parameters are determined through the electronic compass, so that the electronic device can calibrate the parameters according to the target Calibrate the magnetic field parameters output by the electronic compass. In this solution, because the electronic device can obtain the target position information of the target button that may interfere with the electronic compass's detection of the geomagnetic field, and calibrate the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information, that is, the target calibration parameters It is related to the target position information, so the magnetic field of the target button can be prevented from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
可选地,本申请实施例中,结合图6,如图7所示,上述目标按键12的按键位置包括:第一按键位置121和第二按键位置122;上述至少一个霍尔传感器13包括:第一霍尔传感器13和第二霍尔传感器14。Optionally, in the embodiment of the present application, as shown in Figure 7 in conjunction with Figure 6, the key positions of the target key 12 include: a first key position 121 and a second key position 122; the at least one Hall sensor 13 includes: The first Hall sensor 13 and the second Hall sensor 14 .
其中,该第一按键位置121正对第一霍尔传感器13,该第二按键位置122正对第二霍尔传感器14。The first button position 121 faces the first Hall sensor 13 , and the second button position 122 faces the second Hall sensor 14 .
具体的,第一霍尔传感器13与第二霍尔传感器14均位于一个平面上,且均与目标按键12垂直,电子罗盘15位于第一霍尔传感器131的上方,且与第一霍尔传感器13之间的间距小于15MM。Specifically, the first Hall sensor 13 and the second Hall sensor 14 are both located on the same plane and are perpendicular to the target button 12 . The electronic compass 15 is located above the first Hall sensor 131 and is in contact with the first Hall sensor 131 . The distance between 13 is less than 15MM.
本申请实施例中,电子设备中可以设置有两个霍尔传感器,这样电子设备可以直接根据两个霍尔传感器,确定目标按键的按键位置,因此,可以提高电子设备确定目标按键的按键位置的准确性。In the embodiment of the present application, the electronic device can be provided with two Hall sensors, so that the electronic device can directly determine the key position of the target key based on the two Hall sensors. Therefore, the electronic device can improve the accuracy of determining the key position of the target key. accuracy.
可选地,本申请实施例中,结合图6,如图8所示,上述电子设备还包括隔磁部件15。Optionally, in the embodiment of the present application, as shown in FIG. 8 in conjunction with FIG. 6 , the above-mentioned electronic device further includes a magnetic isolation component 15 .
可选地,本申请实施例中,上述隔磁部件16可以设置于PCB11上,该隔磁部件16可以为以下任一项:隔磁片、硅钢片、或任何具有隔磁能力的部件。Optionally, in the embodiment of the present application, the above-mentioned magnetic isolation component 16 can be disposed on the PCB 11 , and the magnetic isolation component 16 can be any of the following: a magnetic isolation sheet, a silicon steel sheet, or any component with magnetic isolation capabilities.
可以理解,上述隔磁片,是经过恒高温烧结而成的软磁性材料,具有高磁导率低磁损因子。它利用功能成分晶格电场热运动引起的电子散射以及电子与电子之间的相互作用,吸收电磁波能量并将其转化为热能,从而达到衰减电磁波的目的。It can be understood that the above-mentioned magnetic isolation sheet is a soft magnetic material sintered at a constant high temperature, and has high magnetic permeability and low magnetic loss factor. It uses the electron scattering caused by the thermal movement of the functional component lattice electric field and the interaction between electrons to absorb electromagnetic wave energy and convert it into thermal energy, thereby achieving the purpose of attenuating electromagnetic waves.
本申请实施例中,上述目标按键、第一霍尔传感器以及第二霍尔传感器,均设置于隔磁部件16所形成的空间中。In the embodiment of the present application, the target button, the first Hall sensor and the second Hall sensor are all arranged in the space formed by the magnetic isolation component 16 .
需要说明的是,上述图8为电子设备的俯视图。It should be noted that the above-mentioned FIG. 8 is a top view of the electronic device.
进一步可选地,本申请实施例中,上述隔磁部件16所形成的空间具体可以为:该隔磁部件16与PCB11所合围成的空间,或者该隔磁部件16合围成的空间。Further optionally, in the embodiment of the present application, the space formed by the magnetic isolation component 16 may specifically be: the space enclosed by the magnetic isolation component 16 and the PCB 11 , or the space enclosed by the magnetic isolation component 16 .
具体地,隔磁部件16上可以设置有凹槽,且该凹槽的槽口与PCB连接(例如固定连接),从而目标按键、第一霍尔传感器以及第二霍尔传感器,均设置于PCB位于凹槽内的位置上,以设置于隔磁部件16所形成的空间中。 Specifically, the magnetic isolation component 16 may be provided with a groove, and the notch of the groove is connected to the PCB (for example, fixedly connected), so that the target button, the first Hall sensor, and the second Hall sensor are all disposed on the PCB. It is located in the groove so as to be disposed in the space formed by the magnetic isolation component 16 .
举例说明,如图9所示,隔磁部件16上可以设置有凹槽,该凹槽的槽口与PCB11固定连接,从而目标按键12、第一霍尔传感器13以及第二霍尔传感器14,均设置于PCB11位于凹槽内的位置上。For example, as shown in Figure 9, the magnetic isolation component 16 may be provided with a groove, and the notch of the groove is fixedly connected to the PCB 11, so that the target button 12, the first Hall sensor 13 and the second Hall sensor 14 are They are all arranged at the position where PCB11 is located in the groove.
可以理解,在电子设备整机堆叠时,在目标按键、第一霍尔传感器以及第二霍尔传感器上方单独留出一个隔磁片空间,从而目标按键中的磁铁产生的磁场将被确定在隔磁片空间内,不会向外界辐射。因此,电子罗盘检测地磁时将不再受到目标按键磁场的影响。It can be understood that when the electronic equipment is stacked, a separate magnetic isolation space is left above the target button, the first Hall sensor and the second Hall sensor, so that the magnetic field generated by the magnet in the target button will be determined in the isolation space. Within the magnetic space, there will be no radiation to the outside world. Therefore, the electronic compass will no longer be affected by the magnetic field of the target button when detecting geomagnetism.
本申请实施例中,通过给目标按键、第一霍尔传感器以及第二霍尔传感器上设置隔磁部件,以使得隔磁部件对目标按键的磁铁产生的磁场进行引导,不向外辐射,因此可以避免该目标按键的磁场干扰电子罗盘检测地磁场的情况,从而可以避免电子罗盘检测得到的地磁场方向发生偏差,如此,可以提高电子罗盘的准确度。In the embodiment of the present application, a magnetic isolation component is provided on the target button, the first Hall sensor, and the second Hall sensor, so that the magnetic isolation component guides the magnetic field generated by the magnet of the target button and does not radiate outward. Therefore, It can prevent the magnetic field of the target button from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding deviation in the direction of the geomagnetic field detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved.
需要说明的是,本申请实施例提供的电子罗盘校准方法,执行主体可以为电子设备。本申请实施例中以电子设备执行电子罗盘校准方法为例,说明本申请实施例提供的电子设备。It should be noted that the execution subject of the electronic compass calibration method provided by the embodiment of the present application may be an electronic device. In the embodiment of the present application, an electronic device performing an electronic compass calibration method is used as an example to illustrate the electronic device provided by the embodiment of the present application.
图10示出了本申请实施例中涉及的电子罗盘校准装置的一种可能的结构示意图。如图10所示,该电子罗盘校准装置包括:目标按键、至少一个霍尔传感器以及电子罗盘,该电子罗盘校准装置70可以包括:获取模块71、确定模块72和校准模块73。Figure 10 shows a possible structural schematic diagram of the electronic compass calibration device involved in the embodiment of the present application. As shown in FIG. 10 , the electronic compass calibration device includes: a target button, at least one Hall sensor, and an electronic compass. The electronic compass calibration device 70 may include: an acquisition module 71 , a determination module 72 , and a calibration module 73 .
其中,获取模块71,用于通过至少一个霍尔传感器,获取电子罗盘校准装置的目标按键的目标位置信息,该目标位置信息用于指示目标按键在电子罗盘校准装置70上所处的按键位置。确定模块72,用于根据获取模块71获取的目标位置信息,通过电子罗盘确定目标校准参数。校准模块73,用于采用确定模块72确定的目标校准参数,对电子罗盘输出的磁场参数进行校准。Among them, the acquisition module 71 is used to acquire the target position information of the target button of the electronic compass calibration device through at least one Hall sensor. The target position information is used to indicate the button position of the target button on the electronic compass calibration device 70 . The determination module 72 is configured to determine the target calibration parameters through the electronic compass according to the target position information obtained by the acquisition module 71 . The calibration module 73 is used to calibrate the magnetic field parameters output by the electronic compass using the target calibration parameters determined by the determination module 72 .
在一种可能的实现方式中,上述确定模块72,具体用于从电子罗盘中预存的至少两个预设校准参数中,确定与目标位置信息对应的目标校准参数;其中,该至少两个预设校准参数与至少两个位置信息一一对应,至少两个位置信息中包括目标位置信息。In a possible implementation, the above-mentioned determination module 72 is specifically configured to determine the target calibration parameters corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass; wherein the at least two preset calibration parameters are It is assumed that the calibration parameter corresponds to at least two pieces of position information one-to-one, and the at least two pieces of position information include target position information.
在一种可能的实现方式中,本申请实施例提供的电子罗盘校准装置还包括更新模块。更新模块,用于在校准模块73采用目标校准参数,对电子罗盘输出的磁场参数进行校准之前,在校准模块73采用初始校准参数对磁场参数进行校准的情况下,将初始校准参数更新为目标校准参数。In a possible implementation, the electronic compass calibration device provided by the embodiment of the present application further includes an update module. Update module, used to update the initial calibration parameters to the target calibration before the calibration module 73 uses the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass, and when the calibration module 73 uses the initial calibration parameters to calibrate the magnetic field parameters. parameter.
在一种可能的实现方式中,上述电子罗盘校准装置还包括第一霍尔传感器和第二霍尔传感器。上述获取模块71,具体用于获取第一霍尔传感器检测得到的第一霍尔参数和第二霍尔传感器检测得到的第二霍尔参数;并根据第一霍尔参数和第二霍尔参数,确定目标位置信息。 In a possible implementation, the electronic compass calibration device further includes a first Hall sensor and a second Hall sensor. The above-mentioned acquisition module 71 is specifically used to acquire the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor; and according to the first Hall parameter and the second Hall parameter , determine the target location information.
本申请实施例提供一种电子罗盘校准装置,由于电子罗盘校准装置可以获取可能干扰电子罗盘检测地磁场的目标按键的目标位置信息,并根据该目标位置信息确定的目标校准参数,对电子罗盘输出的磁场参数进行校准,即目标校准参数与目标位置信息相关,因此可以避免该目标按键的磁场干扰电子罗盘检测地磁场的情况,从而可以避免电子罗盘检测得到的地磁场方向发生偏差,如此,可以提高电子罗盘的准确度。Embodiments of the present application provide an electronic compass calibration device. The electronic compass calibration device can obtain target position information of a target button that may interfere with the electronic compass's detection of the geomagnetic field, and output the electronic compass based on the target calibration parameters determined by the target position information. Calibrate the magnetic field parameters, that is, the target calibration parameters are related to the target position information, so it can avoid the magnetic field of the target button from interfering with the geomagnetic field detected by the electronic compass, thereby avoiding the deviation of the geomagnetic field direction detected by the electronic compass. In this way, it can Improve the accuracy of electronic compass.
本申请实施例中的电子罗盘校准装置可以是装置,也可以是电子设备中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The electronic compass calibration device in the embodiment of the present application may be a device, or may be a component, integrated circuit, or chip in an electronic device. The device may be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or an augmented reality (AR)/virtual reality (VR). VR) equipment, robots, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (PDA), etc., and can also be servers, network attached storage (Network Attached Storage) , NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
本申请实施例中的电子罗盘校准装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The electronic compass calibration device in the embodiment of the present application may be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的电子罗盘校准装置能够实现图1至图8的方法实施例实现的各个过程,为避免重复,这里不再赘述。The electronic compass calibration device provided by the embodiment of the present application can implement various processes implemented by the method embodiments of Figures 1 to 8. To avoid duplication, they will not be described again here.
可选地,如图11所示,本申请实施例还提供一种电子设备90,包括处理器91和存储器92,存储器92上存储有可在所述处理器91上运行的程序或指令,该程序或指令被处理器91执行时实现上述电子罗盘校准方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in Figure 11, this embodiment of the present application also provides an electronic device 90, including a processor 91 and a memory 92. The memory 92 stores programs or instructions that can be run on the processor 91. When the program or instruction is executed by the processor 91, each step of the above electronic compass calibration method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, the details will not be described here.
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图12为实现本申请实施例的一种电子设备的硬件结构示意图。Figure 12 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
该电子设备100包括但不限于:射频单元101、网络模块102、音频输出单元103、输入单元104、传感器105、显示单元106、用户输入单元107、接口单元108、存储器109、以及处理器110等部件。The electronic device 100 includes but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, etc. part.
本领域技术人员可以理解,电子设备100还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器110逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图12中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部 件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 100 may also include a power supply (such as a battery) that supplies power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions. The structure of the electronic device shown in Figure 12 does not constitute a limitation of the electronic device. The electronic device may include more or fewer components than shown in the figure, or some components may be combined, or different components may be used. The layout of the components will not be described in detail here.
其中,处理器110,用于通过至少一个霍尔传感器,获取电子设备的目标按键的目标位置信息,该目标位置信息用于指示目标按键在电子设备上所处的按键位置;并根据目标位置信息,通过电子罗盘确定目标校准参数;以及采用目标校准参数,对电子罗盘输出的磁场参数进行校准。Among them, the processor 110 is used to obtain the target position information of the target key of the electronic device through at least one Hall sensor. The target position information is used to indicate the key position of the target key on the electronic device; and according to the target position information , determine the target calibration parameters through the electronic compass; and use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
本申请实施例提供一种电子设备,由于电子设备可以获取可能干扰电子罗盘检测地磁场的目标按键的目标位置信息,并根据该目标位置信息确定的目标校准参数,对电子罗盘输出的磁场参数进行校准,即目标校准参数与目标位置信息相关,因此可以避免该目标按键的磁场干扰电子罗盘检测地磁场的情况,从而可以避免电子罗盘检测得到的地磁场方向发生偏差,如此,可以提高电子罗盘的准确度。Embodiments of the present application provide an electronic device, because the electronic device can obtain target position information of a target button that may interfere with the electronic compass's detection of the geomagnetic field, and perform calibration on the magnetic field parameters output by the electronic compass based on the target calibration parameters determined by the target position information. Calibration, that is, the target calibration parameters are related to the target position information, so it can avoid the magnetic field of the target button from interfering with the geomagnetic field detected by the electronic compass, thus avoiding the deviation of the geomagnetic field direction detected by the electronic compass. In this way, the accuracy of the electronic compass can be improved. Accuracy.
可选地,本申请实施例中,处理器110,具体用于从电子罗盘中预存的至少两个预设校准参数中,确定与目标位置信息对应的目标校准参数;其中,该至少两个预设校准参数与至少两个位置信息一一对应,至少两个位置信息中包括目标位置信息。Optionally, in this embodiment of the present application, the processor 110 is specifically configured to determine the target calibration parameters corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass; wherein the at least two preset calibration parameters are It is assumed that the calibration parameter corresponds to at least two pieces of position information one-to-one, and the at least two pieces of position information include target position information.
本申请实施例中,电子设备可以通过目标按键位置对应的目标校准参数,对电子罗盘输出的磁场参数进行调整,避免了当目标按键与电子罗盘距离较近时,目标按键可能会干扰电子罗盘检测地磁,从而导致电子罗盘检测得到的地磁场方向发生偏差,如此,提高了电子罗盘的准确度。In the embodiment of this application, the electronic device can adjust the magnetic field parameters output by the electronic compass through the target calibration parameter corresponding to the target button position, thereby avoiding that the target button may interfere with the electronic compass detection when the target button is close to the electronic compass. The geomagnetism causes the direction of the geomagnetic field detected by the electronic compass to deviate, thus improving the accuracy of the electronic compass.
可选地,本申请实施例中,处理器110,还用于在采用目标校准参数,对电子罗盘输出的磁场参数进行校准之前,在采用初始校准参数对磁场参数进行校准的情况下,将初始校准参数更新为目标校准参数。Optionally, in this embodiment of the present application, the processor 110 is also configured to, before using the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass, when using the initial calibration parameters to calibrate the magnetic field parameters, set the initial The calibration parameters are updated to the target calibration parameters.
本申请实施例中,电子设备可以将储存的初始校准参数更新为与目标位置信息相关的目标校准参数,从而通过该目标校准参数对电子罗盘输出的磁场参数进行校准,如此,提高了电子罗盘的准确度。In the embodiment of the present application, the electronic device can update the stored initial calibration parameters to the target calibration parameters related to the target position information, thereby calibrating the magnetic field parameters output by the electronic compass through the target calibration parameters. In this way, the performance of the electronic compass is improved. Accuracy.
可选地,本申请实施例中,上述电子设备还包括第一霍尔传感器和第二霍尔传感器。处理器110,具体用于获取第一霍尔传感器检测得到的第一霍尔参数和第二霍尔传感器检测得到的第二霍尔参数;并根据第一霍尔参数和第二霍尔参数,确定目标位置信息。Optionally, in this embodiment of the present application, the above-mentioned electronic device further includes a first Hall sensor and a second Hall sensor. The processor 110 is specifically configured to obtain the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor; and based on the first Hall parameter and the second Hall parameter, Determine target location information.
本申请实施例中,由于电子设备中可以设置有两个霍尔传感器,这样电子设备可以直接根据该两个霍尔传感器检测得到的两个霍尔参数,确定目标位置信息,因此,可以提高电子设备确定目标位置信息的准确性。In the embodiment of the present application, since the electronic device can be provided with two Hall sensors, the electronic device can directly determine the target position information based on the two Hall parameters detected by the two Hall sensors. Therefore, the electronic device can be improved. The accuracy with which the device determines target location information.
本申请实施例提供的电子设备能够实现上述方法实施例实现的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The electronic device provided by the embodiments of the present application can implement each process implemented by the above method embodiments, and can achieve the same technical effect. To avoid duplication, the details will not be described here.
本实施例中各种实现方式具有的有益效果具体可以参见上述方法实施例中相应实现 方式所具有的有益效果,为避免重复,此处不再赘述。For specific beneficial effects of various implementation methods in this embodiment, please refer to the corresponding implementations in the above method embodiments. The beneficial effects of this method will not be repeated here to avoid repetition.
应理解的是,本申请实施例中,输入单元104可以包括图形处理器(Graphics Processing Unit,GPU)1041和麦克风1042,图形处理器1041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元106可包括显示面板1061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板1061。用户输入单元107包括触控面板1071以及其他输入设备1072中的至少一种。触控面板1071,也称为触摸屏。触控面板1071可包括触摸检测装置和触摸控制器两个部分。其他输入设备1072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042. The graphics processor 1041 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras). The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072 . Touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
存储器109可用于存储软件程序以及各种数据。存储器109可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器109可以包括易失性存储器或非易失性存储器,或者,存储器109可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器109包括但不限于这些和任意其它适合类型的存储器。Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc. Additionally, memory 109 may include volatile memory or nonvolatile memory, or memory 109 may include both volatile and nonvolatile memory. Among them, non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). Memory 109 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
处理器110可包括一个或多个处理单元;可选的,处理器110集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器110中。The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 110 .
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above method embodiments is implemented and the same technology can be achieved. The effect will not be described here in order to avoid repetition.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者 光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or CD etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement various processes of the above method embodiments. , and can achieve the same technical effect, so to avoid repetition, they will not be described again here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述电子罗盘校准方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application provide a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above electronic compass calibration method embodiment, and can achieve the same technology. The effect will not be described here in order to avoid repetition.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions may be performed, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。 The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.

Claims (15)

  1. 一种电子罗盘校准方法,应用于电子设备,所述电子设备包括目标按键、至少一个霍尔传感器以及电子罗盘,所述方法包括:An electronic compass calibration method, applied to electronic equipment, the electronic equipment includes a target button, at least one Hall sensor and an electronic compass, the method includes:
    通过所述至少一个霍尔传感器,获取所述目标按键的目标位置信息,所述目标位置信息用于指示所述目标按键在所述电子设备上所处的按键位置;Obtain the target position information of the target button through the at least one Hall sensor, and the target position information is used to indicate the button position of the target button on the electronic device;
    根据所述目标位置信息,通过所述电子罗盘确定目标校准参数;Determine target calibration parameters through the electronic compass according to the target position information;
    采用所述目标校准参数,对所述电子罗盘输出的磁场参数进行校准。The target calibration parameters are used to calibrate the magnetic field parameters output by the electronic compass.
  2. 根据权利要求1所述的方法,其中,所述根据所述目标位置信息,通过所述电子罗盘确定目标校准参数,包括:The method according to claim 1, wherein determining target calibration parameters through the electronic compass according to the target location information includes:
    从所述电子罗盘中预存的至少两个预设校准参数中,确定与所述目标位置信息对应的所述目标校准参数;Determine the target calibration parameter corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass;
    其中,所述至少两个预设校准参数与至少两个位置信息一一对应,所述至少两个位置信息中包括所述目标位置信息。Wherein, the at least two preset calibration parameters correspond to at least two pieces of position information in a one-to-one manner, and the at least two pieces of position information include the target position information.
  3. 根据权利要求1所述的方法,其中,在所述采用所述目标校准参数,对所述电子罗盘输出的磁场参数进行校准之前,所述方法还包括:The method according to claim 1, wherein before calibrating the magnetic field parameters output by the electronic compass using the target calibration parameters, the method further includes:
    在采用初始校准参数对所述磁场参数进行校准的情况下,将所述初始校准参数更新为所述目标校准参数。When the magnetic field parameters are calibrated using initial calibration parameters, the initial calibration parameters are updated to the target calibration parameters.
  4. 根据权利要求1所述的方法,其中,所述至少一个霍尔传感器包括第一霍尔传感器和第二霍尔传感器;The method of claim 1, wherein the at least one Hall sensor includes a first Hall sensor and a second Hall sensor;
    所述通过所述至少一个霍尔传感器,获取所述目标按键的目标位置信息,包括:Obtaining the target position information of the target button through the at least one Hall sensor includes:
    获取所述第一霍尔传感器检测得到的第一霍尔参数和所述第二霍尔传感器检测得到的第二霍尔参数;Obtaining the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor;
    根据所述第一霍尔参数和所述第二霍尔参数,确定所述目标位置信息。The target position information is determined according to the first Hall parameter and the second Hall parameter.
  5. 一种电子罗盘校准装置,所述电子罗盘校准装置包括:目标按键、至少一个霍尔传感器以及电子罗盘,所述电子罗盘校准装置还包括:获取模块、确定模块和校准模块;An electronic compass calibration device, the electronic compass calibration device includes: a target button, at least one Hall sensor and an electronic compass, the electronic compass calibration device also includes: an acquisition module, a determination module and a calibration module;
    所述获取模块,用于通过所述至少一个霍尔传感器,获取所述目标按键的目标位置信息,所述目标位置信息用于指示所述目标按键在所述电子罗盘校准装置上所处的按键位置;The acquisition module is configured to acquire the target position information of the target button through the at least one Hall sensor. The target position information is used to indicate the button where the target button is located on the electronic compass calibration device. Location;
    所述确定模块,用于根据所述获取模块获取的所述目标位置信息,通过所述电子罗盘确定目标校准参数;The determination module is configured to determine target calibration parameters through the electronic compass according to the target position information obtained by the acquisition module;
    所述校准模块,用于采用所述确定模块确定的所述目标校准参数,对所述电子罗 盘输出的磁场参数进行校准。The calibration module is configured to use the target calibration parameters determined by the determination module to calibrate the electronic compass. The magnetic field parameters output by the disk are calibrated.
  6. 根据权利要求5所述的装置,其中,所述确定模块,具体用于从所述电子罗盘中预存的至少两个预设校准参数中,确定与所述目标位置信息对应的所述目标校准参数;其中,所述至少两个预设校准参数与至少两个位置信息一一对应,所述至少两个位置信息中包括所述目标位置信息。The device according to claim 5, wherein the determination module is specifically configured to determine the target calibration parameter corresponding to the target position information from at least two preset calibration parameters prestored in the electronic compass. ; Wherein, the at least two preset calibration parameters correspond to at least two pieces of position information, and the at least two pieces of position information include the target position information.
  7. 根据权利要求5所述的装置,其中,所述电子罗盘校准装置还包括更新模块;The device according to claim 5, wherein the electronic compass calibration device further includes an update module;
    所述更新模块,用于在所述校准模块所述采用所述目标校准参数,对所述电子罗盘输出的磁场参数进行校准之前,在采用初始校准参数对所述磁场参数进行校准的情况下,将所述初始校准参数更新为所述目标校准参数。The update module is configured to calibrate the magnetic field parameters output by the electronic compass using the target calibration parameters before the calibration module uses the initial calibration parameters to calibrate the magnetic field parameters, The initial calibration parameters are updated to the target calibration parameters.
  8. 根据权利要求5所述的装置,其中,所述至少一个霍尔传感器包括第一霍尔传感器和第二霍尔传感器;The device of claim 5, wherein the at least one Hall sensor includes a first Hall sensor and a second Hall sensor;
    所述获取模块,具体用于获取所述第一霍尔传感器检测得到的第一霍尔参数和所述第二霍尔传感器检测得到的第二霍尔参数;The acquisition module is specifically used to acquire the first Hall parameter detected by the first Hall sensor and the second Hall parameter detected by the second Hall sensor;
    所述确定模块,具体用于根据所述第一霍尔参数和所述第二霍尔参数,确定所述目标位置信息。The determination module is specifically configured to determine the target position information according to the first Hall parameter and the second Hall parameter.
  9. 一种电子设备,其特征在于,所述电子设备的印刷电路板PCB上设置有:An electronic device, characterized in that the printed circuit board (PCB) of the electronic device is provided with:
    目标按键;target button;
    至少一个霍尔传感器,所述至少一个霍尔传感器与所述目标按键相对设置,所述至少一个霍尔传感器用于获取所述目标按键的目标位置信息,所述目标位置信息用于指示所述目标按键在所述电子设备上所处的按键位置;At least one Hall sensor, the at least one Hall sensor is arranged opposite to the target button, the at least one Hall sensor is used to obtain the target position information of the target button, the target position information is used to indicate the The key position of the target key on the electronic device;
    电子罗盘,所述电子罗盘设置于所述PCB的远离所述目标按键的一端;An electronic compass, the electronic compass is provided at one end of the PCB away from the target button;
    其中,所述电子罗盘用于根据所述目标位置信息,确定目标校准参数,以使得电子设备可以采用所述目标校准参数,对所述电子罗盘输出的磁场参数进行校准。Wherein, the electronic compass is used to determine target calibration parameters according to the target position information, so that the electronic device can use the target calibration parameters to calibrate the magnetic field parameters output by the electronic compass.
  10. 根据权利要求9所述的电子设备,其特征在于,所述目标按键的按键位置包括:第一按键位置和第二按键位置;所述至少一个霍尔传感器包括:第一霍尔传感器和第二霍尔传感器;The electronic device according to claim 9, wherein the key position of the target key includes: a first key position and a second key position; and the at least one Hall sensor includes: a first Hall sensor and a second Hall sensor;
    其中,所述第一按键位置正对所述第一霍尔传感器,所述第二按键位置正对所述第二霍尔传感器。Wherein, the first button position faces the first Hall sensor, and the second button position faces the second Hall sensor.
  11. 根据权利要求9所述的电子设备,其特征在于,所述电子设备的PCB上还设置有:The electronic device according to claim 9, characterized in that the PCB of the electronic device is further provided with:
    隔磁部件,所述隔磁部件与所述PCB形成隔磁空间;Magnetic isolation component, the magnetic isolation component and the PCB form a magnetic isolation space;
    其中,所述目标按键和所述至少一个霍尔传感器均设置于所述隔磁空间中。 Wherein, the target button and the at least one Hall sensor are both arranged in the magnetic isolation space.
  12. 一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至4中任一项所述的电子罗盘校准方法的步骤。An electronic device, including a processor, a memory and a program or instructions stored on the memory and executable on the processor. When the program or instructions are executed by the processor, the implementation of claims 1 to 4 is achieved. The steps of the electronic compass calibration method described in any one of the above.
  13. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至4中任一项所述的电子罗盘校准方法的步骤。A readable storage medium on which a program or instructions are stored. When the program or instructions are executed by a processor, the steps of the electronic compass calibration method according to any one of claims 1 to 4 are implemented.
  14. 一种计算机程序产品,所述程序产品被至少一个处理器执行以实现如权利要求1至4中任一项所述的电子罗盘校准方法。A computer program product, which is executed by at least one processor to implement the electronic compass calibration method according to any one of claims 1 to 4.
  15. 一种电子设备,包括所述UE被配置成用于执行如权利要求1至4中任一项所述的电子罗盘校准方法。 An electronic device, including the UE configured to perform the electronic compass calibration method according to any one of claims 1 to 4.
PCT/CN2023/080101 2022-03-08 2023-03-07 Electronic compass calibration method and apparatus, electronic device, and storage medium WO2023169422A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210220956.7 2022-03-08
CN202210220956.7A CN114777755A (en) 2022-03-08 2022-03-08 Electronic compass calibration method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023169422A1 true WO2023169422A1 (en) 2023-09-14

Family

ID=82424301

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/080101 WO2023169422A1 (en) 2022-03-08 2023-03-07 Electronic compass calibration method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114777755A (en)
WO (1) WO2023169422A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114777755A (en) * 2022-03-08 2022-07-22 维沃移动通信有限公司 Electronic compass calibration method and device, electronic equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050283988A1 (en) * 2004-06-11 2005-12-29 Yamaha Corporation Method and apparatus for measuring magnetic offset of geomagnetic sensor and portable electronic apparatus
JP2006078474A (en) * 2004-08-10 2006-03-23 Yamaha Corp Azimuth data generation method, azimuth sensor unit, storage medium, and portable electronic equipment
JP2008241675A (en) * 2007-03-23 2008-10-09 Aichi Micro Intelligent Corp Electronic compass
CN102612637A (en) * 2009-11-04 2012-07-25 高通股份有限公司 Accurate magnetic compass in mobile electronic device
CN103884325A (en) * 2012-12-21 2014-06-25 西安合众思壮导航技术有限公司 Electronic compass and device with the same
CN107631722A (en) * 2017-09-08 2018-01-26 维沃移动通信有限公司 The calibration method and mobile terminal of a kind of electronic compass
CN108426571A (en) * 2018-03-08 2018-08-21 北京诺亦腾科技有限公司 A kind of electronic compass local real-time calibration method and device
CN112421712A (en) * 2020-11-02 2021-02-26 深圳市闻耀电子科技有限公司 Method and device for eliminating compass charging interference, storage medium and terminal
CN112762915A (en) * 2020-12-21 2021-05-07 深圳酷派技术有限公司 Compass precision optimization method and device, storage medium and electronic equipment
CN114777755A (en) * 2022-03-08 2022-07-22 维沃移动通信有限公司 Electronic compass calibration method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100964406B1 (en) * 2005-12-16 2010-06-15 아사히 가세이 일렉트로닉스 가부시끼가이샤 Position detection apparatus
CN108989492A (en) * 2018-06-08 2018-12-11 Oppo广东移动通信有限公司 Electronic device and driving detection method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050283988A1 (en) * 2004-06-11 2005-12-29 Yamaha Corporation Method and apparatus for measuring magnetic offset of geomagnetic sensor and portable electronic apparatus
JP2006078474A (en) * 2004-08-10 2006-03-23 Yamaha Corp Azimuth data generation method, azimuth sensor unit, storage medium, and portable electronic equipment
JP2008241675A (en) * 2007-03-23 2008-10-09 Aichi Micro Intelligent Corp Electronic compass
CN102612637A (en) * 2009-11-04 2012-07-25 高通股份有限公司 Accurate magnetic compass in mobile electronic device
CN103884325A (en) * 2012-12-21 2014-06-25 西安合众思壮导航技术有限公司 Electronic compass and device with the same
CN107631722A (en) * 2017-09-08 2018-01-26 维沃移动通信有限公司 The calibration method and mobile terminal of a kind of electronic compass
CN108426571A (en) * 2018-03-08 2018-08-21 北京诺亦腾科技有限公司 A kind of electronic compass local real-time calibration method and device
CN112421712A (en) * 2020-11-02 2021-02-26 深圳市闻耀电子科技有限公司 Method and device for eliminating compass charging interference, storage medium and terminal
CN112762915A (en) * 2020-12-21 2021-05-07 深圳酷派技术有限公司 Compass precision optimization method and device, storage medium and electronic equipment
CN114777755A (en) * 2022-03-08 2022-07-22 维沃移动通信有限公司 Electronic compass calibration method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114777755A (en) 2022-07-22

Similar Documents

Publication Publication Date Title
US10268302B2 (en) Method and apparatus for recognizing grip state in electronic device
US8466934B2 (en) Touchscreen interface
US9871544B2 (en) Specific absorption rate mitigation
EP2575013B1 (en) Pen system and method for performing input operations to mobile device via the same
US20080024454A1 (en) Three-dimensional touch pad input device
WO2023169422A1 (en) Electronic compass calibration method and apparatus, electronic device, and storage medium
US20130300670A1 (en) Computer input stylus with multiple antennas
US10963100B2 (en) Interactive object control method and apparatus, terminal, and computer-readable storage medium
US20150141080A1 (en) Object Detection and Characterization
KR20180035606A (en) electronic device including input module
US20140240233A1 (en) Apparatus for providing a cursor in electronic devices and a method thereof
CN112738886B (en) Positioning method, positioning device, storage medium and electronic equipment
US20140327659A1 (en) Electronic Apparatus
US9760189B2 (en) Method and apparatus for controlling touch-key operation
WO2024012446A1 (en) Magnetic attraction function management method for electronic device, and electronic device
WO2014112132A1 (en) Information apparatus and information processing method
KR20140067334A (en) Touch input method and mobile device
WO2018177156A1 (en) Method for operating mobile terminal, and mobile terminal
JP2000231446A (en) Display integrated type tablet device and storage medium stored with automatic tablet correction program
WO2023143380A1 (en) Input methods and apparatus, electronic device, and readable storage medium
KR20140068585A (en) Method and apparatus for distinction of finger touch and pen touch on touch screen
CN105335118A (en) Control display method and apparatus for electronic device
US9223499B2 (en) Communication device having a user interaction arrangement
KR101901234B1 (en) Method and device for inputting of mobile terminal using a pen
US11923842B1 (en) System and method for obtaining user input with keyboard integrated magnetic sensing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23766000

Country of ref document: EP

Kind code of ref document: A1