Electronic equipment, control method and related device
By setting the positions of the compensation unit and the compass in the electronic device, the magnetic induction intensity generated by using the current is opposite to the magnetic induction intensity at the compass, which solves the problem of users frequently calibrating the compass, improves the user experience and maintains the accuracy of the compass.
Patent Information
- Application Number
- CN202311428667.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2043-10-30
AI Technical Summary
When users use compass applications or map applications, they need to frequently calibrate the compass, which is cumbersome and is not conducive to user experience.
An electronic device is designed, including a first module, a first impedance unit, a first amplification unit, a first compensation unit and a compass. By setting the positions of the first compensation unit and the compass, the magnetic induction intensity direction generated by the current flowing through the first impedance unit is opposite to the magnetic induction intensity direction at the compass, and the magnetic induction intensity value is less than or equal to the magnetic induction intensity value generated by the original current, thereby reducing the number of times the compass calibration.
It effectively reduces the number of times the compass is calibrated, improves the user experience, and has no impact on the accuracy of the compass.
Smart Images

Figure CN119958515A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an electronic device, a control method and related devices. Background Art
[0002] With the development of smart terminals, some electronic devices are equipped with compasses, which can serve compass applications or map applications.
[0003] Currently, when a user uses a compass application or a map application, the electronic device may prompt the user to calibrate the compass. After the user calibrates the compass, the compass can be used normally. In this way, before using the compass, the user needs to calibrate the compass, which is cumbersome and not conducive to user experience. Summary of the invention
[0004] The present application provides an electronic device, a control method and related devices, which are applied in the field of terminal technology. In the present application, it is helpful to reduce the number of compass calibrations, thereby reducing user operations and improving user experience.
[0005] In a first aspect, the present application proposes an electronic device, which includes a first module, a first impedance unit, a first amplifying unit, a first compensation unit and a compass; the first impedance unit is connected in series in a working loop of the first module, and both ends of the first impedance unit are also connected to the input end of the first amplifying unit, and the output end of the first amplifying unit is connected to the first compensation unit; the first amplifying unit is used to amplify the voltage of the first impedance unit and output it when the first module is working; wherein the two ends of the first compensation unit are a first end and a second end, the distance between the compass and the first compensation unit is a first distance, the angle formed by the first compensation unit and the first line segment is a first angle, and the first line segment is a first end and the compass. needle, the angle formed by the first compensation unit and the second line segment is the second angle, and the second line segment is the line connecting the second end and the compass; the positions of the first compensation unit and the compass are set so that when the first module is working, the following relationship is satisfied: when the current flowing through the first impedance unit is the first current, the current flowing through the first compensation unit is the second current, the direction of the magnetic induction intensity generated by the second current at the compass is opposite to the direction of the magnetic induction intensity generated by the first current at the compass, the value of the magnetic induction intensity generated by the second current at the compass is inversely correlated with the first distance, and is positively correlated with the second current and the first difference, and the first difference is the difference between the cosine value of the first angle and the cosine value of the second angle.
[0006] When the first module is working, the current flowing through the first impedance unit is the current generated when the first module is working, and the first amplification unit can amplify the voltage of the first impedance unit and output it, so that the current flowing through the first compensation unit is the second current. The value of the magnetic induction intensity generated by the second current at the compass is related to the position where the compass is deployed and the value of the second current. The value of the magnetic induction intensity generated by the second current at the compass can be less than or equal to the value of the magnetic induction intensity generated by the first current at the compass. The direction of the magnetic induction intensity generated by the second current at the compass is opposite to the direction of the magnetic induction intensity generated by the first current at the compass. In this way, the influence of the first current on the magnetic field where the compass is located can be reduced, which is conducive to making the difference between two adjacent data obtained by the compass less than the preset difference, and then it is conducive to reducing the number of times the compass is calibrated, so as to reduce the user's operation and improve the user experience. In addition, by reducing the influence of the first current on the magnetic field where the compass is located by the second current flowing through the first compensation unit, the influence of the first current on the magnetic field where the compass is located can be quickly compensated, with less delay, higher real-time performance, and no impact on the accuracy of the compass.
[0007] In one possible implementation, when the current flowing through the first impedance unit is the first current, the output voltage of the first amplification unit is the first voltage, and the electronic device also includes a control unit, which is connected to the output end of the first amplification unit and is also connected to the first compensation unit; the control unit is used to obtain a second voltage corresponding to the first voltage from a first preset corresponding relationship, and control the output of the second voltage.
[0008] If the voltage output by the first amplifier unit is directly used to make the current flowing through the first compensation unit the second current, since the voltage output by the first amplifier unit is small, the resistance of the first compensation unit may be small. Therefore, the present application sets a first preset corresponding relationship. In the first preset corresponding relationship, the first voltage corresponds to the second voltage, and the second voltage can be the product of the resistance of the first compensation unit and the second current. In this way, the resistance of the first compensation unit can be set to an expected value. When the current flowing through the first impedance unit is the first current, the control unit controls the output of the second voltage. At this time, the current flowing through the first compensation unit is the second current. In this way, the setting of the resistance of the first compensation unit is relatively flexible.
[0009] In one possible implementation, the electronic device also includes a codec, which is connected to the control unit and is also connected to the first compensation unit; the control unit is used to transmit first indication information to the codec when a second voltage corresponding to the first voltage is obtained from a first preset correspondence, and the first indication information is used to instruct the codec to output the second voltage.
[0010] The codec may include one or more pins for outputting a voltage, and the control unit may instruct the codec to output the second voltage through the first indication information, so as to facilitate outputting the second voltage to realize that the current flowing through the first compensation unit is the second current.
[0011] In a possible implementation, the electronic device further includes a voltage regulating unit, which is connected to the control unit, and the voltage regulating unit is also connected to the first compensation unit; the control unit is used to control the voltage regulating unit to output the second voltage when a second voltage corresponding to the first voltage is obtained from the first preset corresponding relationship. The voltage regulating unit may include a charge pump and a switching device such as a MOS tube, and the control unit may adjust the duty cycle of the charge pump output voltage through the switching device so that it outputs the second voltage. In this way, it is beneficial to output the second voltage to realize that the current flowing through the first compensation unit is the second current.
[0012] In a possible implementation, the electronic device further includes a second module, a second impedance unit, a second amplifying unit and a second compensation unit; the second impedance unit is connected in series in the working loop of the second module, both ends of the second impedance unit are also connected to the input end of the second amplifying unit, the output end of the second amplifying unit is connected to the control unit, and the control unit is connected to the second compensation unit; the second amplifying unit is used to amplify the voltage of the second impedance unit and output it when the second module is working; wherein the two ends of the second compensation unit are the third end and the fourth end, the distance between the compass and the second compensation unit is the second distance, the angle formed by the second compensation unit and the third line segment is the third angle, and the third line segment is the angle between the third end and the compass The second compensation unit and the fourth line segment are connected to the compass needle, the angle formed by the second compensation unit and the fourth line segment is the fourth angle, and the fourth line segment is the connection line between the fourth end and the compass; the positions of the second compensation unit and the compass are set so that when the second module is working, the following relationship is satisfied: when the current flowing through the second impedance unit is the third current, the current flowing through the second compensation unit is the fourth current, the direction of the magnetic induction intensity generated by the fourth current at the compass is opposite to the direction of the magnetic induction intensity generated by the third current at the compass, and the value of the magnetic induction intensity generated by the fourth current at the compass is inversely correlated with the second distance, and is positively correlated with the fourth current and the second difference, and the second difference is the difference between the cosine value of the third angle and the cosine value of the fourth angle. In the electronic device, there is also the current generated by the second module affecting the magnetic field where the compass is located. In this case, the electronic device may further include a second compensation unit, so that the fourth current generated by the second compensation unit reduces the influence of the third current generated when the second module is working on the magnetic field where the compass is located.
[0013] In a possible implementation, the first module is a charging module of an electronic device, which is used to charge the battery of the electronic device; the second module is a communication module of the electronic device, which is used to realize wireless communication of the electronic device; or the first module is a communication module of the electronic device, which is used to realize wireless communication of the electronic device; the second module is a charging module of the electronic device, which is used to charge the battery of the electronic device. In this way, in the charging scenario and the communication scenario, it is helpful to reduce the number of times the compass is calibrated, thereby reducing the user's operations and improving the user experience.
[0014] In a possible implementation, the positions of the first compensation unit and the compass are set so that the relationship between the first distance, the first angle, and the second angle satisfies the following formula:
[0015]
[0016] B x21 =B p1 *sinθ 01 *cosθ 31 ≤B x1
[0017] B y21 =B p1 *sinθ 01 *cosθ 31 ≤B y1
[0018] B z21 =B p1 *cosθ 01 ≤B z1
[0019] Among them, B p1 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a1 is the first distance, θ 11 is the first angle, θ 21 is the second angle, μ0 is the vacuum permeability, B x21 For B p1 The component in the X direction in the three-dimensional coordinate system, B y21 For B p1 The component in the Y direction in the three-dimensional coordinate system, B z21 For B p1 The component in the Z direction in the three-dimensional coordinate system, θ 01 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ 31 is the angle formed by the first compensation unit and the long side of the circuit board. The circuit board is provided with the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass. B x1is the component of the magnetic induction intensity in the X direction generated by the first current at the compass, B y1 is the component of the magnetic induction intensity in the Y direction generated by the first current at the compass, B z1 is the component of the magnetic induction intensity in the Z direction generated by the first current at the compass.
[0020] The position setting of the first compensation unit and the compass can make the components of the magnetic induction intensity generated by the second current at the compass in each direction in the coordinate system equal to the value of the magnetic induction intensity generated by the first current at the compass, thereby offsetting the effect of the magnetic field generated by the first current at the compass; it can also make the value of the magnetic induction intensity generated by the second current at the compass smaller than the value of the magnetic induction intensity generated by the first current at the compass, thereby reducing the effect of the first current on the magnetic field in which the compass is located.
[0021] In one possible implementation, an electronic device is used to obtain a compass reading in response to a user's operation using a compass application or a map application, where the compass reading includes values of the compass in M directions in an M-dimensional coordinate system; the value of any one of the M directions is compensated to obtain compensated data, and the compensated data is used to represent data of the position of the electronic device; wherein the compensation amount corresponding to the value in any one direction is related to a first current, a compensation offset in any direction, and a compensation slope in any direction, and the compensation offset in any direction and the compensation slope in any direction are both constants.
[0022] The electronic device may be preset with a compensation offset in any direction and a compensation slope in any direction. In response to the user's operation using a compass application or a map application, the compensation amount in any direction may be calculated based on the first current, the compensation offset in any direction, and the compensation slope in any direction, and the compass reading in the corresponding direction may be compensated based on the compensation amount in any direction. In this way, further compensation is performed on the compass reading, which is conducive to further reducing the influence of the first current on the magnetic field in which the compass is located.
[0023] In a possible implementation, the relationship between the compensation amount corresponding to the value in any direction and the first current, the compensation offset in any direction, and the compensation slope in any direction satisfies the following relationship:
[0024] Y 1 =K 1 I+B 1
[0025] Among them, Y 1 is the compensation amount corresponding to the value in any direction, K 1 is the compensation slope in either direction, B 1 Compensation offset in either direction, I is the first current.
[0026] When the compensation offset in any direction and the compensation slope in any direction are constants, the compensation amount corresponding to the first current and the value in any direction is in a linear relationship, and the relationship is simple, which is conducive to improving the speed of calculating the compensation amount.
[0027] In one possible implementation, the compensation offset in any direction and the compensation slope in any direction are such that the sum of the compensation amount corresponding to the value in any direction and the component of the first magnetic induction intensity in any direction is less than or equal to the component of the second magnetic induction intensity in any direction, the first magnetic induction intensity is the magnetic induction intensity generated by the second current at the compass, and the second magnetic induction intensity is the magnetic induction intensity generated by the first current at the compass.
[0028] The compensation amount corresponding to the value in any direction calculated by the compensation offset in any direction and the compensation slope in any direction, and the sum of the component of the first magnetic induction intensity in any direction can be less than or equal to the component of the second magnetic induction intensity in any direction. This is helpful to reduce the influence of the first current on the magnetic field in which the compass is located.
[0029] In a possible implementation, the M-dimensional coordinate system is a three-dimensional coordinate system, and the compass reading includes the values of the compass in each direction in the three-dimensional coordinate system, the compensation corresponding to the values in each direction in the three-dimensional coordinate system, the components of the magnetic induction intensity generated by the first current at the compass in each direction in the three-dimensional coordinate system, and the components of the magnetic induction intensity generated by the second current at the compass in each direction in the three-dimensional coordinate system satisfy the following formula:
[0030]
[0031] B x22 =B p2 *sinθ 02 *cosθ 32 +Y x ≤B x1
[0032] B y22 =B p2 *sinθ 02 *cosθ 32 +Y y ≤B y1
[0033] B z22 =B p2 *cosθ 02 +Y z ≤B z1
[0034] Among them, B p2 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a is the first distance, θ 12 is the first angle, θ22 is the second angle, μ0 is the vacuum permeability, B x22 For B p2 The component in the X direction in the three-dimensional coordinate system, B y22 For B p2 The component in the Y direction in the three-dimensional coordinate system, B z22 For B p2 The component in the Z direction in the three-dimensional coordinate system, θ 02 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ 32 is the angle formed by the first compensation unit and the long side of the circuit board. The circuit board is provided with the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass. B x1 is the component of the magnetic induction intensity in the X direction generated by the first current at the compass, B y1 is the component of the magnetic induction intensity in the Y direction generated by the first current at the compass, B z1 is the component of the magnetic induction intensity in the Z direction generated by the first current at the compass, Y x is the compensation amount corresponding to the value in the X direction, y is the compensation amount corresponding to the value in the Y direction, Y z The compensation value corresponding to the Z direction value.
[0035] In this way, the components of the magnetic induction intensity in each direction generated by the second current at the compass, plus the compensation amount in each direction, can be smaller than the components of the magnetic induction intensity in each direction generated by the first current at the compass, which is beneficial to reducing the impact of the first current on the magnetic field in which the compass is located.
[0036] In a possible implementation, the first impedance unit is connected to the first module, and the first impedance unit is also grounded. In this way, the first impedance unit is deployed at the low voltage end of the loop where the first module is located, which can make the voltage at the input end of the first amplification unit smaller than that of the first impedance unit deployed at the high voltage end of the loop where the second module is located, which is conducive to preventing the first amplification unit from being burned out by excessive voltage.
[0037] In a second aspect, the present application provides a control method, which is applied to an electronic device, wherein the electronic device includes a first module, a first impedance unit, a first amplifying unit, a first compensation unit, a compass, and a control unit; the first impedance unit is connected in series in a working loop of the first module, and both ends of the first impedance unit are also connected to the input end of the first amplifying unit, and the output end of the first amplifying unit is connected to the first compensation unit; the first amplifying unit is used to amplify the voltage of the first impedance unit and output it when the first module is working; wherein the two ends of the first compensation unit are a first end and a second end, the distance between the compass and the first compensation unit is a first distance, and the angle formed by the first compensation unit and the first line segment is a first angle. an angle, the first line segment is a line connecting the first end and the compass, the angle formed by the first compensation unit and the second line segment is a second angle, and the second line segment is a line connecting the second end and the compass; the method comprises: when the current flowing through the first impedance unit is the first current, the current flowing through the first compensation unit is controlled by the control unit to be the second current, the direction of the magnetic induction intensity generated at the compass by the second current is opposite to the direction of the magnetic induction intensity generated at the compass by the first current, the value of the magnetic induction intensity generated at the compass by the second current is inversely correlated with the first distance, and is positively correlated with the second current and the first difference, and the first difference is the difference between the cosine value of the first angle and the cosine value of the second angle.
[0038] In a possible implementation, the positions of the first compensation unit and the compass are set so that the relationship between the first distance, the first angle, and the second angle satisfies the following formula:
[0039]
[0040] B x21 =B p1 *sinθ 01 *cosθ 31 ≤B x1
[0041] B y21 =B p1 *sinθ 01 *cosθ 31 ≤B y1
[0042] B z21 =B p1 *cosθ 01 ≤B z1
[0043] Among them, B p1 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a1 is the first distance, θ 11 is the first angle, θ 21 is the second angle, μ0 is the vacuum permeability, Bx21 For B p1 The component in the X direction in the three-dimensional coordinate system, B y21 For B p1 The component in the Y direction in the three-dimensional coordinate system, B z21 For B p1 The component in the Z direction in the three-dimensional coordinate system, θ 01 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ 31 is the angle formed by the first compensation unit and the long side of the circuit board. The circuit board is provided with the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass. B x1 is the component of the magnetic induction intensity in the X direction generated by the first current at the compass, B y1 is the component of the magnetic induction intensity in the Y direction generated by the first current at the compass, B z1 is the component of the magnetic induction intensity in the Z direction generated by the first current at the compass.
[0044] In one possible implementation, when the current flowing through the first impedance unit is the first current, the method further includes: in response to an operation of a user using a compass application or a map application, obtaining a compass reading, the compass reading including values of the compass in M directions in an M-dimensional coordinate system; compensating the value of any one of the M directions to obtain compensated data, the compensated data being used to represent data of the position of the electronic device; wherein the compensation amount corresponding to the value in any one direction is related to the first current, the compensation offset in any direction, and the compensation slope in any direction, and the compensation offset in any direction and the compensation slope in any direction are both constants.
[0045] In a possible implementation, the relationship between the compensation amount corresponding to the value in any direction and the first current, the compensation offset in any direction, and the compensation slope in any direction satisfies the following relationship:
[0046] Y 1 =K 1 I+B 1
[0047] Among them, Y 1 is the compensation amount corresponding to the value in any direction, K 1 is the compensation slope in either direction, B 1 Compensation offset in either direction, I is the first current.
[0048] In one possible implementation, the compensation offset in any direction and the compensation slope in any direction are such that the sum of the compensation amount corresponding to the value in any direction and the component of the first magnetic induction intensity in any direction is less than or equal to the component of the second magnetic induction intensity in any direction, the first magnetic induction intensity is the magnetic induction intensity generated by the second current at the compass, and the second magnetic induction intensity is the magnetic induction intensity generated by the first current at the compass.
[0049] In a possible implementation, the M-dimensional coordinate system is a three-dimensional coordinate system, and the compass reading includes the values of the compass in each direction in the three-dimensional coordinate system, the compensation corresponding to the values in each direction in the three-dimensional coordinate system, the components of the magnetic induction intensity generated by the first current at the compass in each direction in the three-dimensional coordinate system, and the components of the magnetic induction intensity generated by the second current at the compass in each direction in the three-dimensional coordinate system satisfy the following formula:
[0050]
[0051] B x22 =B p2 *sinθ 02 *cosθ 32 +Y x ≤B x1
[0052] B y22 =B p2 *sinθ 02 *cosθ 32 +Y y ≤B y1
[0053] B z22 =B p2 *cosθ 02 +Y z ≤B z1
[0054] Among them, B p2 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a is the first distance, θ 12 is the first angle, θ 22 is the second angle, μ0 is the vacuum permeability, B x22 For B p2 The component in the X direction in the three-dimensional coordinate system, B y22 For B p2 The component in the Y direction in the three-dimensional coordinate system, B z22 For B p2 The component in the Z direction in the three-dimensional coordinate system, θ 02 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ32 is the angle formed by the first compensation unit and the long side of the circuit board. The circuit board is provided with the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass. B x1 is the component of the magnetic induction intensity in the X direction generated by the first current at the compass, B y1 is the component of the magnetic induction intensity in the Y direction generated by the first current at the compass, B z1 is the component of the magnetic induction intensity in the Z direction generated by the first current at the compass, Y x is the compensation amount corresponding to the value in the X direction, y is the compensation amount corresponding to the value in the Y direction, Y z The compensation value corresponding to the Z direction value.
[0055] In a third aspect, an embodiment of the present application provides an electronic device, which may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
[0056] The structure of the electronic device may be as shown in any one of the first aspects above, and the electronic device may execute any one of the methods shown in any one of the second aspects above.
[0057] In a fourth aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store code instructions, and the processor is used to run the code instructions to execute the method executed by the electronic device in the first aspect, or to implement the method executed by the electronic device in the second aspect.
[0058] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method executed by the electronic device in the first aspect is implemented, or the method executed by the electronic device in the second aspect is implemented.
[0059] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, the computer executes the method executed by the electronic device in the first aspect, or implements the method executed by the electronic device in the second aspect.
[0060] In a seventh aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method executed by the electronic device in the first aspect, or to implement the method executed by the electronic device in the second aspect.
[0061] It should be understood that the third to seventh aspects of the present application correspond to the technical solution of the first aspect of the present application or the technical solution of the second aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A schematic diagram of the flow of current in an electronic device;
[0063] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0064] Figure 3 A schematic diagram of a first compensation unit and a compass deployment position provided in an embodiment of the present application;
[0065] Figure 4 A schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application;
[0066] Figure 5 A schematic diagram of a linear relationship provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to clearly describe the technical solution of the embodiment of the present application, the following description is first made:
[0068] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first compensation unit and the second compensation unit are only used to distinguish different compensation units, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0069] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0070] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0071] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or can be a period of time before or after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the display interface provided in the embodiment of the present application is only an example, and the display interface can also include more or less content.
[0072] When a user uses a compass application or a map application, the electronic device may prompt the user to calibrate the compass. After the user calibrates the compass, the compass can be used normally.
[0073] This is because an electronic device equipped with a compass can periodically use the compass to detect the orientation of the electronic device. If the difference between two consecutive data obtained using the compass is greater than a preset difference, such as 30 microseconds, when the application calls the compass data, the electronic device will prompt the user to calibrate the compass first.
[0074] The reason why the difference between two consecutive data is greater than the preset difference may be due to the interference of the surrounding magnetic field. For example, due to the size limitation of the electronic device, a charging module and / or a communication module is deployed near the compass. In the charging scenario, there is a charging current in the charging module, and the magnetic field generated by the charging current will affect the magnetic field where the compass is located; in the communication scenario, there is a working current in the communication module, and the magnetic field generated by the working current will affect the magnetic field where the compass is located.
[0075] That is to say, there is an electric current near the compass, and the magnetic field generated by the current will affect the magnetic field where the compass is located, causing the difference between two adjacent data to be greater than the preset difference.
[0076] For example, Figure 1 A schematic diagram showing the flow of current in an electronic device is shown. Figure 1 As shown, the electronic device is a mobile phone. The electronic device includes a charging interface 110, a battery 120, a compass 130, a charging module 140, a power amplifier (PA) 150, a communication module 160 and a middle frame 170. The middle frame 170 is used to transmit current.
[0077] In a wireless charging or wired charging scenario, when the electronic device is connected to the charger, the charger can charge the battery 120 of the electronic device, and the flow direction of the charging current may include: the positive pole of the charger -> the input end of the charging interface 110 -> the charging module 140 -> the battery 120 -> the middle frame 170 -> the input end of the charging interface 110 -> the negative pole of the charger. The charging current is close to the compass 130. When the charging current passes through the middle frame 170, the charging current will generate a magnetic field that affects the magnetic field where the compass 130 is located. If the difference between the data obtained by the electronic device using the compass 130 before charging and the data obtained by using the compass 130 after charging is greater than the preset difference, the compass 130 needs to be calibrated before it can work normally. Therefore, when the electronic device detects that the application calls the compass 130, the electronic device will prompt the user to calibrate the compass 130.
[0078] In some scenarios, the battery 120 includes a main battery and a sub-battery, and the charging current of the main battery and the sub-battery can be transmitted to the output end of the charging interface 110 through the middle frame 170, and then transmitted to the negative electrode of the charger. In this scenario, the difference between the data obtained by the electronic device using the compass 130 before charging and the data obtained by the compass 130 after charging may be greater than the preset difference, and the compass 130 needs to be calibrated before it can work normally.
[0079] In the communication scenario, the communication module 160 works, and the direction of the working current may include: battery 120->PA150->communication module 160->battery 120. The compass 130 is close to the loop, and the magnetic field generated by the working current will affect the magnetic field where the compass 130 is located. The difference between the data obtained by the electronic device using the compass 130 before communication and the data obtained by the compass 130 after communication is greater than the preset difference. When the electronic device detects that the application calls the compass 130, the electronic device prompts the user to calibrate the compass 130.
[0080] In view of this, an embodiment of the present application provides an electronic device, a control method and related devices, wherein a compensation unit is deployed near the compass. When a charging current (and / or working current) is generated near the compass, the electronic device can provide a compensation current through the compensation unit. The direction of the magnetic induction intensity generated by the compensation current is opposite to the direction of the magnetic induction intensity generated by the charging current (and / or working current). The value of the magnetic induction intensity generated by the compensation current is less than or equal to the value of the magnetic induction intensity generated by the charging current (and / or working current). This can reduce the impact of the charging current (and / or working current) on the magnetic field where the compass is located, which is beneficial for making the difference between two adjacent data obtained using the compass less than a preset difference, thereby helping to reduce the number of times the compass is calibrated, thereby reducing user operations and improving user experience.
[0081] It should be noted that the embodiments of the present application are described using charging scenarios and communication scenarios as examples, and the embodiments of the present application can be applied to any scenario where the current generated in the electronic device affects the magnetic field of the compass. It is understandable that in addition to the presence of a charging module in the charging scenario and / or a communication module in the communication scenario, there may be other scenarios where other modules generate a large current when working, which may interfere with the magnetic field of the compass. The embodiments of the present application do not limit the specific scenarios that cause interference and the modules that interfere.
[0082] In order to better understand the electronic device provided by the embodiments of the present application, the electronic device provided by the embodiments of the present application is described in detail below.
[0083] Figure 2 FIG. 1 shows a hardware structure diagram of an electronic device provided in an embodiment of the present application. Figure 2As shown, the electronic device includes a first module 210, a first impedance unit 220, a first amplifying unit 230, a first compensation unit 240 and a compass 250. The first impedance unit 220 is connected in series in the working loop of the first module 210, and both ends of the first impedance unit 220 are also connected to the input end of the first amplifying unit 230, and the output end of the first amplifying unit 230 is connected to the first compensation unit 240; the first amplifying unit 230 is used to amplify the voltage of the first impedance unit 220 and output it when the first module 210 is working; wherein, the two ends of the first compensation unit 240 are the first end and the second end, the distance between the compass 250 and the first compensation unit 240 is the first distance, the angle formed by the first compensation unit 240 and the first line segment is the first angle, the first line segment is the line connecting the first end and the compass 250, and the angle formed by the first compensation unit 240 and the second line segment is the first angle. The angle formed is the second angle, and the second line segment is the line connecting the second end and the compass 250; the positions of the first compensation unit 240 and the compass 250 are set so that when the first module 210 is working, the following relationship is satisfied: when the current flowing through the first impedance unit 220 is the first current, the current flowing through the first compensation unit 240 is the second current, the direction of the magnetic induction intensity generated by the second current at the compass 250 is opposite to the direction of the magnetic induction intensity generated by the first current at the compass 250, the value of the magnetic induction intensity generated by the second current at the compass 250 is inversely correlated with the first distance, and is positively correlated with the second current and the first difference, and the first difference is the difference between the cosine value of the first angle and the cosine value of the second angle.
[0084] The current generated by the first module 210 when working will have a great influence on the magnetic field where the compass 250 is located, so the first module 210 is a module that can have a great influence on the magnetic field where the compass 250 is located. Figure 1 The charging module 140 or the communication module 160 shown. The first impedance unit 220 is connected in series in the working loop of the first module 210, so that when the first module 210 is working, the current flowing through the first impedance unit 220 is the current generated when the first module 210 is working. The first impedance unit 220 can be a device with a resistance value, for example, the first impedance unit 220 can be a resistor. The voltage of the first compensation unit 240 can be the voltage output by the first amplification unit 230, and when the first amplification unit 230 outputs the voltage, the first compensation unit 240 can generate a current. In some implementations, the first compensation unit 240 can be a straight wire or a resistor. The first amplification unit 230 can amplify the voltage, for example, the first amplification unit 230 can be a voltage amplifier or an operational amplifier circuit. The embodiment of the present application does not limit the specific amplification factor of the first amplification unit 230.
[0085] When the first module 210 is working, the current flowing through the first impedance unit 220 is the current generated when the first module 210 is working, and the first amplification unit 230 can amplify the voltage of the first impedance unit 220 and output it, so that the current flowing through the first compensation unit 240 is the second current. The value of the magnetic induction intensity generated by the second current at the compass 250 is related to the location where the compass 250 is deployed and the value of the second current. The value of the magnetic induction intensity generated by the second current at the compass 250 can be less than or equal to the value of the magnetic induction intensity generated by the first current at the compass 250. The direction of the magnetic induction intensity generated by the second current at the compass 250 is opposite to the direction of the magnetic induction intensity generated by the first current at the compass 250. In this way, the influence of the first current on the magnetic field where the compass 250 is located can be reduced, which is conducive to making the difference between two adjacent data obtained by using the compass 250 less than the preset difference, and further conducive to reducing the number of times the compass 250 is calibrated, so as to reduce the user's operation and improve the user experience. In addition, by reducing the influence of the first current on the magnetic field in which the compass is located through the second current flowing through the first compensation unit, the influence of the first current on the magnetic field in which the compass is located can be quickly compensated for with less delay, higher real-time performance, and no impact on the accuracy of the compass.
[0086] The positions of the first compensation unit 240 and the compass 250 are set so that the value of the magnetic induction intensity generated by the second current at the compass 250 is inversely correlated with the first distance, and is positively correlated with the second current and the first difference, and the first difference is the difference between the cosine value of the first angle and the cosine value of the second angle. In some implementations, the relationship between the first distance, the first angle, and the second angle satisfies the following formula:
[0087]
[0088] B x21 =B p1 *sinθ 01 *cosθ 31 ≤B x1
[0089] B y21 =B p1 *sinθ 01 *cosθ 31 ≤B y1
[0090] B z21 =B p1 *cosθ 01 ≤B z1
[0091] Among them, B p1is the magnetic induction intensity generated by the second current at the compass 250, I is the second current, a1 is the first distance, θ 11 is the first angle, θ 21 is the second angle, μ0 is the vacuum permeability, B x21 For B p1 The component in the X direction in the three-dimensional coordinate system, B y21 For B p1 The component in the Y direction in the three-dimensional coordinate system, B z21 For B p1 The component in the Z direction in the three-dimensional coordinate system, θ 01 is the angle between the plane formed by the first compensation unit 240 and the magnetic sensor in the compass 250 and the plane where the circuit board of the electronic device is located, θ 31 is the angle formed by the first compensation unit 240 and the long side of the circuit board. The first module, the first impedance unit, the first amplification unit, the first compensation unit 240 and the compass 250 are arranged on the circuit board. x1 is the component of the magnetic induction intensity in the X direction generated by the first current at the compass 250, B y1 is the component of the magnetic induction intensity in the Y direction generated by the first current at the compass 250, B z1 is the component of the magnetic induction intensity in the Z direction generated by the first current at the compass 250.
[0092] The positions of the first compensation unit 240 and the compass 250 are set so that the component of the magnetic induction intensity generated by the second current at the compass 250 in the X direction is less than or equal to the component of the magnetic induction intensity generated by the first current at the compass 250 in the X direction, the component of the magnetic induction intensity generated by the second current at the compass 250 in the Y direction is less than or equal to the component of the magnetic induction intensity generated by the first current at the compass 250 in the Y direction, and the component of the magnetic induction intensity generated by the second current at the compass 250 in the Z direction is less than or equal to the component of the magnetic induction intensity generated by the first current at the compass 250 in the Z direction.
[0093] For example, Figure 3 A schematic diagram of a first compensation unit and a compass deployment position is shown. Figure 3 As shown, in the plane formed by the first compensation unit and the compass, the first distance between the compass 250 and the first compensation unit 240 is represented by a1, the line connecting the first end and the compass 250 is a first line segment, and the first angle formed by the first compensation unit 240 and the first line segment is θ 11 The line connecting the second end and the compass 250 is a second line segment, and the second angle formed by the first compensation unit 240 and the second line segment is θ 21The second current flowing through the first compensation unit 240 can be represented by I, and the value of the magnetic induction intensity generated by the second current I at the compass 250 is represented by B p1 Indicates that B p1 It can be expressed by the above formula.
[0094] In the stereogram of the first compensation unit and the compass, the circuit board is deployed with the first module 210, the first impedance unit 220, the first amplification unit 230, the first compensation unit 240 and the compass 250, wherein the first module 210, the first impedance unit 220 and the first amplification unit 230 are not shown. It should be noted that the circuit board has a certain height, so that the plane formed by the magnetic sensors in the first compensation unit 240 and the compass 250 has a certain angle with the plane where the circuit board is located. Figure 3 As shown, the angle between the plane formed by the first compensation unit 240 and the magnetic sensor in the compass 250 and the plane where the circuit board is located is θ 01 , the angle formed by the first compensation unit 240 and the long side of the circuit board is θ 31 It can be understood that when the deployment positions of the compass 250 and the first compensation unit 240 are determined, θ 01 and θ 31 The current flowing through the first compensation unit 240 is the second current, and the direction of the second current can be as follows: Figure 3 As shown, the direction of the magnetic induction intensity generated by the second current at the compass 250 is as follows Figure 3 The magnetic induction intensity B generated by the second current at the compass 250 is p1 The relationship between the components in various directions and the components of the magnetic induction intensity in various directions generated by the first current at the compass 250 can be shown as the above formula.
[0095] When the current flowing through the first impedance unit 220 is the first current, the current flowing through the first compensation unit 240 is the second current. The reason for this design will be described below.
[0096] When the current flowing through the first impedance unit 220 is the first current, the value and direction of the magnetic induction intensity generated by the first current at the compass 250 are both measurable. When the magnetic induction intensity generated by the first current at the compass 250 is known, the component of the magnetic induction intensity generated by the first current at the compass 250 on the X-axis, the component on the Y-axis, and the component on the Z-axis are known. p1 The component on the X-axis is equal to the component on the X-axis of the magnetic induction intensity generated by the first current at the compass 250, so that the magnetic induction intensity B generated by the second current at the compass 250 p1The component on the Y axis is equal to the component on the Y axis of the magnetic induction intensity generated by the first current at the compass 250, and the component on the Z axis of the second magnetic induction intensity is equal to the component on the Z axis of the magnetic induction intensity generated by the first current at the compass 250, then B can be obtained. p1 ,θ 01 and θ 31 When θ 01 and θ 31 When B is known, the distance between the compass 250 and the first compensation unit 240 is known, the angle formed by the first compensation unit 240 and the first line segment is known, and the angle formed by the first compensation unit 240 and the second line segment is known. p1 Substituting the distance and the two angles into the above formula, the second current can be obtained. It can be understood that at this time B p1 , distance and two angles are all expected values. When the deployment position of the first compensation unit 240 meets the expected value or has a certain error with the expected value, the influence of the first current on the magnetic field where the compass 250 is located can be reduced.
[0097] The following embodiment of the present application also provides a hardware structure diagram of an electronic device.
[0098] Figure 4 FIG. 1 shows a schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device includes a first module 210, a first impedance unit 220, a first amplifying unit 230, a first compensation unit 240, a compass 250, an analog to digital converter (ADC) 410, a control unit 420, a codec 430, a second module 440, a second impedance unit 450, a second amplifying unit 460 and a second compensation unit 470.
[0099] The connection relationship between the first module 210, the first impedance unit 220 and the first amplification unit 230 can be as described above. Figure 2As shown, the embodiments of the present application are not limited to this. The second impedance unit 450 is connected in series in the working loop of the second module 440, and both ends of the second impedance unit 450 are also connected to the input end of the second amplification unit 460. The output end of the first amplification unit 230 and the output end of the second amplification unit 460 are respectively connected to the ADC 410, and the ADC 410 is also connected to the control unit 420. The control unit 420 is also connected to the compass 250 and the codec 430, respectively. The codec 430 is also connected to the first compensation unit 240 and the second compensation unit 470, respectively. The second amplification unit 460 can be used to amplify the voltage of the second impedance unit 450 and output it when the second module 440 is working; wherein the control unit 420 can be connected to the compass 250 through a two-wire serial (Inter-Integrated Circuit, I2C) bus connection, two ends of the second compensation unit 470 are the third end and the fourth end, the distance between the compass 250 and the second compensation unit 470 is the second distance, the angle formed by the second compensation unit 470 and the third line segment is the third angle, the third line segment is the line connecting the third end and the compass 250, the angle formed by the second compensation unit 470 and the fourth line segment is the fourth angle, and the fourth line segment is the line connecting the fourth end and the compass 250; the positions of the second compensation unit 470 and the compass 250 are set so that when the When the second module 440 is working, the following relationship is satisfied: when the current flowing through the second impedance unit 450 is the third current, the current flowing through the second compensation unit 470 is the fourth current, the direction of the magnetic induction intensity generated by the fourth current at the compass 250 is opposite to the direction of the magnetic induction intensity generated by the third current at the compass 250, the value of the magnetic induction intensity generated by the fourth current at the compass 250 is inversely correlated with the second distance, and is positively correlated with the fourth current and the second difference, and the second difference is the difference between the cosine value of the third angle and the cosine value of the fourth angle.
[0100] The first module 210 may be a charging module for charging the battery. In some implementations, the first module 210 includes a fast charging chip and a battery. The resistance of the first impedance unit 220 is relatively small, for example, a few hundred milliohms, and the voltage across the two ends is relatively small, about tens of millivolts, which has little effect on the first module 210. The first impedance unit 220 is connected in series in the working loop of the first module 210, and may include a variety of possible implementations. In some implementations, as described above Figure 4As shown, one end of the first impedance unit 220 can be connected to the battery, and the other end can be connected to the ground. In this way, the voltage at one end of the first impedance unit 220 is the voltage of the first impedance unit 220, and there is no voltage at one end, which can make the voltage at the input end of the first amplification unit 230 smaller, which is beneficial to prevent excessive voltage from burning the first amplification unit 230. In other implementations, one end of the first impedance unit 220 is connected to the fast charging chip, and the other end is connected to the battery. In this way, the fast charging chip, the first impedance unit 220 and the battery are connected in series, which is beneficial to collect the working current of the first module 210. The first amplification unit 230 can be an operational amplifier circuit. In some implementations, the first amplification unit 230 can be composed of A1, R1, R2, R3 and R4.
[0101] The second module 440 can be used to implement communication of electronic devices such as 5G or WIFI communication. In some implementations, the second module 440 may include a power amplifier (PA) and a communication module of 5G or WIFI. The resistance of the second impedance unit 450 is also small, and the impact on the second module 440 is small. The second impedance unit 450 is connected in series in the working loop of the second module 440, and there are also a variety of possible implementations. Specifically, the first impedance unit 220 can be connected in series in the working loop of the first module 210, which will not be repeated here. The second amplification unit 460 can be an operational amplifier circuit. In some implementations, the second amplification unit 460 can be composed of A1, R5, R6, R7 and R8.
[0102] ADC 410 may be an ADC in any device in an electronic device, and the embodiments of the present application do not limit this. For example, ADC 410 may be an ADC included in a power management unit (PMU) in an electronic device, or ADC 410 may be an ADC included in a control unit in an electronic device. Codec 430 may be replaced by any device in an electronic device that can output an analog voltage, and the embodiments of the present application do not limit this. For example, codec 430 may be replaced by a voltage regulating unit in an electronic device, for example, the voltage regulating unit may be a MOS tube and a power supply (such as a charge pump) for outputting a voltage, and the electronic device controls the duty cycle of the power supply output voltage so that the power supply for outputting a voltage can output an analog voltage. Control unit 420 may be a central processing unit (CPU) chip, an application processor (AP) chip, or a system on chip (SOC) chip, etc., and the embodiments of the present application do not limit this.
[0103] ADC 410 can be used to convert the analog voltage output by the first amplifying unit 230 and / or the second amplifying unit 460 into a digital voltage and then output it. The control unit 420 can be used to obtain the first voltage from ADC 410 when the output voltage of the first amplifying unit 230 is the first voltage, and obtain the second voltage corresponding to the first voltage from the first preset corresponding relationship, and output the first indication information to the codec 430, and the first indication information is used to instruct the codec 430 to output the second voltage; and also used to obtain the fourth voltage corresponding to the third voltage from the second preset corresponding relationship when the output voltage of the second amplifying unit 460 is the third voltage, and output the second indication information to the codec 430, and the second indication information is used to instruct the codec 430 to output the fourth voltage. Among them, the first preset corresponding relationship and the second preset corresponding relationship are experimentally calibrated by the research and development personnel. The second voltage can be greater than or equal to the product of the resistance of the first compensation unit 240 and the second current. When the second voltage is equal to the product of the resistance of the first compensation unit 240 and the second current, the first compensation unit 240 can be connected to the codec 430 and can also be grounded. In this way, the circuit is simple. When the second voltage is greater than the product of the resistance of the first compensation unit 240 and the second current, other devices may be included in the path between the codec 430 and the first compensation unit 240, which is more flexible. The relationship between the fourth voltage and the fourth current is similar and will not be repeated here.
[0104] The codec 430 can be used to obtain first indication information from the control unit 420, and output a second voltage based on the first indication information, so that the current flowing through the first compensation unit 240 is a second current; it can also be used to obtain second indication information from the control unit 420, and output a fourth voltage based on the second indication information, so that the current flowing through the second compensation unit 470 is a fourth current.
[0105] It is understandable that when the first module 210 and the second module 440 work simultaneously, the ADC 410 can obtain two analog voltages, and convert the two analog voltages into digital voltages and transmit them to the control unit 420. After obtaining the two digital voltages, the control unit 420 can obtain the voltages corresponding to the two digital voltages from the first preset corresponding relationship and the second preset corresponding relationship, and control the output of the codec 430. At this time, there is current in both the first compensation unit 240 and the second compensation unit 470.
[0106] In the above Figure 4In the electronic device shown, the ADC 410, the control unit 420 and the codec 430 are all optional. The first amplifying unit 230 can provide a voltage for the first compensation unit 240. Since the voltage output by the first amplifying unit 230 is small, the resistance of the first compensation unit 240 may be small. Therefore, the present application sets a first preset correspondence in the control unit 420. In the first preset correspondence, the first voltage corresponds to the second voltage. The second voltage can be the product of the resistance of the first compensation unit 240 and the second current. In this way, the resistance of the first compensation unit 240 can be set to a desired value. When the current flowing through the first impedance unit 240 is the first current, the control unit 420 controls the output of the second voltage. At this time, the current flowing through the first compensation unit is the second current. In this way, the setting of the resistance of the first compensation unit is relatively flexible. Providing a voltage to the second compensation unit 470 through the control unit 420 has the same advantages, which will not be repeated here.
[0107] The codec 430 is used to output a second voltage, so that the current flowing through the first compensation unit 240 is the second current, or the current flowing through the second compensation unit 470 is the fourth current, which is conducive to reducing the influence of the first current on the magnetic field near the compass. In some implementations, the codec 430 can also process the audio of the electronic device. In this case, the embodiment of the present application can use the idle pins of the codec 430 to output a voltage for the first compensation unit 240 or the second compensation unit 470.
[0108] The ADC 410 converts the analog voltage output by the first amplifying unit 230 and / or the second amplifying unit 460 into a digital voltage, which can facilitate the subsequent determination of the voltage of the first compensation unit 240 or the second compensation unit 470 and help improve the calculation speed.
[0109] When there is a deviation between the deployed position of the first compensation unit 240 and the expected value, the embodiment of the present application can measure the difference between the magnetic induction intensity generated by the first current at the compass 250 and the magnetic induction intensity generated by the second current at the compass 250 when determining the deployed position of the first compensation unit 240 in the electronic device, determine the impact on the compass 250 reading through the difference, calculate the compensation amount for the compass 250 reading, and store the calculated relationship between the compensation amount and the first current in the electronic device, so that when the electronic device calls the compass 250, for example, when it is necessary to display the parameters obtained by using the compass 250, further compensation is performed on the data obtained by using the compass 250, and the compensated data is used as the final data obtained by using the compass 250, so as to further reduce the impact of the first current at the compass 250.
[0110] Exemplarily, the electronic device can be used to obtain the reading of the compass 250 in response to the user's operation of using a compass application or a map application, and the compass reading includes the values of the compass 250 in M directions in an M-dimensional coordinate system; compensate the value of any one of the M directions to obtain compensated data, and the compensated data is used to represent the data of the position of the electronic device; wherein the compensation amount corresponding to the value in any direction is related to the first current, the compensation offset in any direction, and the compensation slope in any direction, and the compensation offset in any direction and the compensation slope in any direction are both constants.
[0111] The electronic device may be preset with a compensation offset in any direction and a compensation slope in any direction. In response to the user's operation using a compass application or a map application, the compensation amount in any direction may be calculated based on the first current, the compensation offset in any direction, and the compensation slope in any direction, and the compass reading in the corresponding direction may be compensated based on the compensation amount in any direction. In this way, further compensation is performed on the compass reading, which is conducive to further reducing the influence of the first current on the magnetic field in which the compass is located.
[0112] Optionally, the compensation offset in any direction and the compensation slope in any direction can make the sum of the compensation amount corresponding to the value in any direction and the component of the first magnetic induction intensity in any direction less than or equal to the component of the second magnetic induction intensity in any direction, the first magnetic induction intensity is the magnetic induction intensity generated by the second current at the compass, and the second magnetic induction intensity is the magnetic induction intensity generated by the first current at the compass. In this way, the sum of the compensation amount corresponding to the value in any direction calculated by the compensation offset in any direction and the compensation slope in any direction and the component of the first magnetic induction intensity in any direction can be less than or equal to the component of the second magnetic induction intensity in any direction, which is conducive to reducing the influence of the first current on the magnetic field in which the compass is located.
[0113] In some implementations, the relationship between the compensation amount corresponding to the value in any one direction and the first current, the compensation offset in any direction, and the compensation slope in any direction satisfies the following relationship:
[0114] Y 1 =K 1 I+B 1
[0115] Among them, Y 1 is the compensation amount corresponding to the value in any direction, K 1 is the compensation slope in either direction, B 1 Compensation offset in either direction, I is the first current.
[0116] When the compensation offset in any direction and the compensation slope in any direction are constants, the compensation amount corresponding to the first current and the value in any direction is in a linear relationship, and the relationship is simple, which is conducive to improving the speed of calculating the compensation amount.
[0117] For example, Figure 5 A schematic diagram of a linear relationship is shown. Figure 5 As shown, the unit of the first current I is ampere (A), and the compensation amount Y 1 The unit is micro Tesla (μT), and the corresponding relationship between the first current and the compensation amount of at least one direction axis on each direction axis can be a linear relationship, such as Figure 5 As shown, when the first current is 4A, the compensation amount is 20μT, and when the first current is 8A, the compensation amount is 40μT. The relationship between the first current and the compensation amount can be Y 1 =K 1 I+B 1 , where Y 1 is 5, B 1 is 0.
[0118] It can be understood that if the M-dimensional coordinate system is a three-dimensional coordinate system, the three-dimensional coordinate system may include an X direction, a Y direction, and a Z direction. The compensation amount in the X direction may be related to the compensation slope in the X direction and the compensation offset in the X direction, the compensation amount in the Y direction may be related to the compensation slope in the Y direction and the compensation offset in the Y direction, the compensation amount in the Z direction may be related to the compensation slope in the Z direction and the compensation offset in the Z direction, the compensation slope in the X direction, the compensation offset in the X direction, the compensation slope in the Y direction, the compensation offset in the Y direction, the compensation slope in the Y direction, the compensation offset in the Y direction, the compensation slope in the Z direction, and the compensation offset in the Z direction are all constants, and the values may be the same or different, and the embodiments of the present application do not limit this.
[0119] It is understandable that the correspondence between the first current and the compensation amount in each direction is pre-established, that is, determined according to the compass 250 data in the charging scenario (each charging current) and the compass 250 data in the non-charging scenario during the test process. In this way, the electronic device can perform compensation in each direction of the coordinate system, which is more flexible.
[0120] Optionally, the above-mentioned M-dimensional coordinate system is a three-dimensional coordinate system, and the reading of the compass 250 includes the value of the compass 250 in each direction in the three-dimensional coordinate system, the compensation amount corresponding to the value in each direction in the three-dimensional coordinate system, the component of the magnetic induction intensity generated by the first current at the compass 250 in each direction in the three-dimensional coordinate system, and the component of the magnetic induction intensity generated by the second current at the compass 250 in each direction in the three-dimensional coordinate system satisfy the following formula:
[0121]
[0122] B x22 =B p2 *sinθ 02 *cosθ 32 +Y x ≤B x1
[0123] B y22 =B p2 *sinθ 02 *cosθ 32 +Y y ≤B y1
[0124] B z22 =B p2 *cosθ 02 +Y z ≤B z1
[0125] Among them, B p2 is the magnetic induction intensity generated by the second current at the compass 250, I is the second current, a is the first distance, θ 12 is the first angle, θ 22 is the second angle, μ0 is the vacuum permeability, B x22 For B p2 The component in the X direction in the three-dimensional coordinate system, B y22 For B p2 The component in the Y direction in the three-dimensional coordinate system, B z22 For B p2 The component in the Z direction in the three-dimensional coordinate system, θ 02 is the angle between the plane formed by the first compensation unit 240 and the magnetic sensor in the compass 250 and the plane where the circuit board of the electronic device is located, θ 32 is the angle formed by the first compensation unit 240 and the long side of the circuit board. The first module 210, the first impedance unit 220, the first amplification unit 230, the first compensation unit 240 and the compass 250 are arranged on the circuit board. x1 is the component of the magnetic induction intensity in the X direction generated by the first current at the compass 250, B y1 is the component of the magnetic induction intensity in the Y direction generated by the first current at the compass 250, B z1 is the component of the magnetic induction intensity in the Z direction generated by the first current at the compass 250, Y x is the compensation amount corresponding to the value in the X direction, y is the compensation amount corresponding to the value in the Y direction, Y z The compensation value corresponding to the Z direction value.
[0126] In this way, the components of the magnetic induction intensity in each direction generated by the second current at the compass 250, plus the compensation amount in each direction can be smaller than the components of the magnetic induction intensity in each direction generated by the first current at the compass 250, which is beneficial to reducing the influence of the first current on the magnetic field in which the compass 250 is located.
[0127] It is understandable that in the standby scenario of the electronic device, the electronic device does not call the compass, and the electronic device may not execute the method provided in the embodiment of the present application to save power consumption. When the application of the electronic device calls the compass (or in the scenario where the compass is registered), the electronic device may execute the method provided in the embodiment of the present application to obtain relatively accurate data using the compass.
[0128] The present application embodiment also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0129] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.
[0130] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.
[0131] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
Claims
1. An electronic device, characterized in that: The electronic device comprises a first module, a first impedance unit, a first amplifying unit, a first compensation unit and a compass; the first impedance unit is connected in series in a working loop of the first module, both ends of the first impedance unit are also connected to the input end of the first amplifying unit, and the output end of the first amplifying unit is connected to the first compensation unit; The first amplifying unit is used to amplify the voltage of the first impedance unit and then output it when the first module is working; The two ends of the first compensation unit are the first end and the second end, the distance between the compass and the first compensation unit is the first distance, the angle formed by the first compensation unit and the first line segment is the first angle, the first line segment is the line connecting the first end and the compass, the angle formed by the first compensation unit and the second line segment is the second angle, and the second line segment is the line connecting the second end and the compass; the positions of the first compensation unit and the compass are arranged so that when the first module is working, the following relationship is satisfied: When the current flowing through the first impedance unit is the first current, the current flowing through the first compensation unit is the second current, the direction of the magnetic induction intensity generated by the second current at the compass is opposite to the direction of the magnetic induction intensity generated by the first current at the compass, the value of the magnetic induction intensity generated by the second current at the compass is inversely correlated with the first distance, and is positively correlated with the second current and the first difference, and the first difference is the difference between the cosine value of the first angle and the cosine value of the second angle.
2. The electronic device according to claim 1, characterized in that: When the current flowing through the first impedance unit is a first current, the output voltage of the first amplifying unit is a first voltage, and the electronic device further includes a control unit, the control unit is connected to the output end of the first amplifying unit, and the control unit is also connected to the first compensation unit; The control unit is used to obtain a second voltage corresponding to the first voltage from a first preset corresponding relationship, and control the output of the second voltage.
3. The electronic device according to claim 2, characterized in that: The electronic device further comprises a codec, the codec is connected to the control unit, and the codec is also connected to the first compensation unit; The control unit is configured to transmit first indication information to the codec when obtaining the second voltage corresponding to the first voltage from the first preset corresponding relationship, wherein the first indication information is used to instruct the codec to output the second voltage.
4. The electronic device according to claim 2, characterized in that: The electronic device further comprises a voltage regulating unit, wherein the voltage regulating unit is connected to the control unit, and the voltage regulating unit is also connected to the first compensation unit; The control unit is used to control the voltage regulating unit to output the second voltage when the second voltage corresponding to the first voltage is obtained from the first preset corresponding relationship.
5. The electronic device according to any one of claims 1 to 4, characterized in that: The electronic device further includes a second module, a second impedance unit, a second amplifying unit and a second compensation unit; the second impedance unit is connected in series in the working loop of the second module, both ends of the second impedance unit are also connected to the input end of the second amplifying unit, and the output end of the second amplifying unit is connected to the second compensation unit; The second amplifying unit is used to amplify the voltage of the second impedance unit and output it when the second module is working; The two ends of the second compensation unit are the third end and the fourth end, the distance between the compass and the second compensation unit is the second distance, the angle formed by the second compensation unit and the third line segment is the third angle, the third line segment is the line connecting the third end and the compass, the angle formed by the second compensation unit and the fourth line segment is the fourth angle, and the fourth line segment is the line connecting the fourth end and the compass; the positions of the second compensation unit and the compass are arranged so that when the second module is working, the following relationship is satisfied: When the current flowing through the second impedance unit is the third current, the current flowing through the second compensation unit is the fourth current, the direction of the magnetic induction intensity generated by the fourth current at the compass is opposite to the direction of the magnetic induction intensity generated by the third current at the compass, and the value of the magnetic induction intensity generated by the fourth current at the compass is inversely correlated with the second distance and positively correlated with the fourth current and the second difference, and the second difference is the difference between the cosine value of the third angle and the cosine value of the fourth angle.
6. The electronic device according to claim 5, characterized in that: The first module is a charging module of the electronic device, used to charge a battery of the electronic device; the second module is a communication module of the electronic device, used to implement wireless communication of the electronic device; or, The first module is a communication module of the electronic device, and is used to realize wireless communication of the electronic device; the second module is a charging module of the electronic device, and is used to realize charging of a battery of the electronic device.
7. The electronic device according to any one of claims 1 to 6, characterized in that: The positions of the first compensation unit and the compass are arranged so that the relationship between the first distance, the first angle and the second angle satisfies the following formula: B x21 =B p1 *sinθ 01 *cosθ 31 ≤B x1 B y21 =B p1 *sinθ 01 *cosθ 31 ≤B y1 B z21 =B p1 *cosθ 01 ≤B z1 Among them, B p1 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a1 is the first distance, θ 11 is the first angle, θ 21 is the second angle, μ0 is the vacuum permeability, B x21 For the B p1 The component in the X direction in the three-dimensional coordinate system, B y21 For the B p1 The component in the Y direction in the three-dimensional coordinate system, B z21 For the B p1 The component in the Z direction in the three-dimensional coordinate system, θ 01 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ 31 is the angle formed by the first compensation unit and the long side of the circuit board, on which the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass are disposed, B x1 is the component of the magnetic induction intensity generated by the first current at the compass in the X direction, B y1 is the component of the magnetic induction intensity generated by the first current at the compass in the Y direction, B z1 is the component of the magnetic induction intensity generated by the first current at the compass in the Z direction.
8. The electronic device according to any one of claims 1 to 6, characterized in that: The electronic device is used to obtain the reading of the compass in response to the operation of the user using a compass application or a map application, and the reading of the compass includes the values of M directions of the compass in an M-dimensional coordinate system; The value of any one of the M directions is compensated to obtain compensated data, and the compensated data is used to represent the data of the position of the electronic device; wherein the compensation amount corresponding to the value of any one direction is related to the first current, the compensation offset of any one direction and the compensation slope of any one direction, and the compensation offset of any one direction and the compensation slope of any one direction are both constants.
9. The electronic device according to claim 8, characterized in that: The relationship between the compensation amount corresponding to the value in any one direction and the first current, the compensation offset in any one direction, and the compensation slope in any one direction satisfies the following relationship: Y 1 =K 1 I+B 1 Among them, Y 1 is the compensation amount corresponding to the value in any direction, K 1 is the compensation slope in either direction, B 1 The compensation offset in any direction, I is the first current.
10. The electronic device according to claim 8 or 9, characterized in that: The compensation offset in any direction and the compensation slope in any direction are such that the sum of the compensation amount corresponding to the value in any direction and the component of the first magnetic induction intensity in any direction is less than or equal to the component of the second magnetic induction intensity in any direction, the first magnetic induction intensity is the magnetic induction intensity generated by the second current at the compass, and the second magnetic induction intensity is the magnetic induction intensity generated by the first current at the compass.
11. The electronic device according to any one of claims 8 to 10, characterized in that: The M-dimensional coordinate system is a three-dimensional coordinate system, and the reading of the compass includes the value of the compass in each direction in the three-dimensional coordinate system, the compensation amount corresponding to the value in each direction in the three-dimensional coordinate system, the component of the magnetic induction intensity generated by the first current at the compass in each direction in the three-dimensional coordinate system, and the component of the magnetic induction intensity generated by the second current at the compass in each direction in the three-dimensional coordinate system satisfy the following formula: B x22 =B p2 *sinθ 02 *cosθ 32 +Y x ≤B x1 B y22 =B p2 *sinθ 02 *cosθ 32 +Y y ≤B y1 B z22 =B p2 *cosθ 02 +Y z ≤B z1 Among them, B p2 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a is the first distance, θ 12 is the first angle, θ 22 is the second angle, μ0 is the vacuum permeability, B x22 For the B p2 The component in the X direction in the three-dimensional coordinate system, B y22 For the B p2 The component in the Y direction in the three-dimensional coordinate system, B z22 For the B p2 The component in the Z direction in the three-dimensional coordinate system, θ 02 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ 32 is the angle formed by the first compensation unit and the long side of the circuit board, on which the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass are disposed, B x1 is the component of the magnetic induction intensity generated by the first current at the compass in the X direction, B y1 is the component of the magnetic induction intensity generated by the first current at the compass in the Y direction, B z1 is the component of the magnetic induction intensity generated by the first current at the compass in the Z direction, Y x is the compensation amount corresponding to the value in the X direction, Y y is the compensation amount corresponding to the value in the Y direction, Y z is the compensation amount corresponding to the value in the Z direction.
12. The electronic device according to any one of claims 1 to 11, characterized in that: The first impedance unit is connected to the first module, and the first impedance unit is also grounded.
13. A control method, characterized in that: Applied to electronic equipment, the electronic equipment comprises a first module, a first impedance unit, a first amplifying unit, a first compensation unit, a compass and a control unit; the first impedance unit is connected in series in the working loop of the first module, the two ends of the first impedance unit are also connected to the input end of the first amplifying unit, and the output end of the first amplifying unit is connected to the first compensation unit; the first amplifying unit is used to amplify the voltage of the first impedance unit and output it when the first module is working; wherein the two ends of the first compensation unit are the first end and the second end, the distance between the compass and the first compensation unit is the first distance, the angle formed by the first compensation unit and the first line segment is the first angle, the first line segment is the line connecting the first end and the compass, the angle formed by the first compensation unit and the second line segment is the second angle, and the second line segment is the line connecting the second end and the compass; The method comprises: When the current flowing through the first impedance unit is the first current, the current flowing through the first compensation unit is controlled by the control unit to be the second current, the direction of the magnetic induction intensity generated at the compass by the second current is opposite to the direction of the magnetic induction intensity generated at the compass by the first current, the value of the magnetic induction intensity generated at the compass by the second current is inversely correlated with the first distance, and is positively correlated with the second current and the first difference, and the first difference is the difference between the cosine value of the first angle and the cosine value of the second angle.
14. The method according to claim 13, characterized in that The positions of the first compensation unit and the compass are arranged so that the relationship between the first distance, the first angle and the second angle satisfies the following formula: B x21 =B p1 *sinθ 01 *cosθ 31 ≤B x1 B y21 =B p1 *sinθ 01 *cosθ 31 ≤B y1 B z21 =B p1 *cosθ 01 ≤B z1 Among them, B p1 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a1 is the first distance, θ 11 is the first angle, θ 21 is the second angle, μ0 is the vacuum permeability, B x21 For the B p1 The component in the X direction in the three-dimensional coordinate system, B y21 For the B p1 The component in the Y direction in the three-dimensional coordinate system, B z21 For the B p1 The component in the Z direction in the three-dimensional coordinate system, θ 01 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ 31 is the angle formed by the first compensation unit and the long side of the circuit board, on which the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass are disposed, B x1 is the component of the magnetic induction intensity generated by the first current at the compass in the X direction, B y1 is the component of the magnetic induction intensity generated by the first current at the compass in the Y direction, B z1 is the component of the magnetic induction intensity generated by the first current at the compass in the Z direction.
15. The method according to claim 13, characterized in that When the current flowing through the first impedance unit is a first current, the method further includes: In response to an operation of a user using a compass application or a map application, obtaining a reading of the compass, wherein the reading of the compass includes values of M directions of the compass in an M-dimensional coordinate system; The value of any one of the M directions is compensated to obtain compensated data, and the compensated data is used to represent the data of the position of the electronic device; wherein the compensation amount corresponding to the value of any one direction is related to the first current, the compensation offset of any one direction and the compensation slope of any one direction, and the compensation offset of any one direction and the compensation slope of any one direction are both constants.
16. The method according to claim 15, characterized in that The relationship between the compensation amount corresponding to the value in any one direction and the first current, the compensation offset in any one direction, and the compensation slope in any one direction satisfies the following relationship: Y 1 =K 1 I+B 1 Among them, Y 1 is the compensation amount corresponding to the value in any direction, K 1 is the compensation slope in either direction, B 1 The compensation offset in any direction, I is the first current.
17. The method according to claim 15 or 16, characterized in that The compensation offset in any direction and the compensation slope in any direction are such that the sum of the compensation amount corresponding to the value in any direction and the component of the first magnetic induction intensity in any direction is less than or equal to the component of the second magnetic induction intensity in any direction, the first magnetic induction intensity is the magnetic induction intensity generated by the second current at the compass, and the second magnetic induction intensity is the magnetic induction intensity generated by the first current at the compass.
18. The method according to any one of claims 15 to 17, characterized in that The M-dimensional coordinate system is a three-dimensional coordinate system, and the reading of the compass includes the value of the compass in each direction in the three-dimensional coordinate system, the compensation amount corresponding to the value in each direction in the three-dimensional coordinate system, the component of the magnetic induction intensity generated by the first current at the compass in each direction in the three-dimensional coordinate system, and the component of the magnetic induction intensity generated by the second current at the compass in each direction in the three-dimensional coordinate system satisfy the following formula: B x22 =B p2 *sinθ 02 *cosθ 32 +Y x ≤B x1 B y22 =B p2 *sinθ 02 *cosθ 32 +Y y ≤B y1 B z22 =B p2 *cosθ 02 +Y z ≤B z1 Among them, B p2 is the magnetic induction intensity generated by the second current at the compass, I is the second current, a is the first distance, θ 12 is the first angle, θ 22 is the second angle, μ0 is the vacuum permeability, B x22 For the B p2 The component in the X direction in the three-dimensional coordinate system, B y22 For the B p2 The component in the Y direction in the three-dimensional coordinate system, B z22 For the B p2 The component in the Z direction in the three-dimensional coordinate system, θ 02 is the angle between the plane formed by the first compensation unit and the magnetic sensor in the compass and the plane where the circuit board of the electronic device is located, θ 32 is the angle formed by the first compensation unit and the long side of the circuit board, on which the first module, the first impedance unit, the first amplification unit, the first compensation unit and the compass are disposed, B x1 is the component of the magnetic induction intensity generated by the first current at the compass in the X direction, B y1 is the component of the magnetic induction intensity generated by the first current at the compass in the Y direction, B z1 is the component of the magnetic induction intensity generated by the first current at the compass in the Z direction, Y x is the compensation amount corresponding to the value in the X direction, Y y is the compensation amount corresponding to the value in the Y direction, Y z is the compensation amount corresponding to the value in the Z direction.
19. An electronic device, characterized in that: include: A processor, a memory, a first module, a first impedance unit, a first amplifying unit, a first compensation unit and a compass, wherein the first impedance unit is connected in series in a working loop of the first module, both ends of the first impedance unit are also connected to the input end of the first amplifying unit, and the output end of the first amplifying unit is connected to the first compensation unit; The first amplifying unit is used to amplify the voltage of the first impedance unit and then output it when the first module is working; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 13 to 18.
20. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 13 to 18 is implemented.
21. A computer program product, characterized in that The method comprises a computer program which, when being executed, causes a computer to execute the method according to any one of claims 13 to 18.
Citation Information
Patent Citations
System and method for eliminating charging interference of electronic compass and electronic device
CN113155113A
Current sensor
CN115902369A
Azimuth meter
JP2003121154A
Method of automatic continuous calibration for an electronic compass
US20030023380A1
Method and system for electronic compass calibration and verification
US20060152217A1