Method for determining position of stylus pen and electronic device

The magnetic field intensity and direction are detected by magnetometer, which solves the problem that users find the correct adsorption position of the stylus, and accurately judges the adsorption position of the stylus and offset prompts, improving charging efficiency and user experience.

CN117707348BActive Publication Date: 2025-03-18HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310854650.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-12
Publication Date
2025-03-18
Estimated Expiration
2043-07-12

AI Technical Summary

Technical Problem

It is difficult for users to find the correct adsorption position of the stylus on electronic devices, resulting in the offset of the adsorption position of the stylus, affecting charging efficiency and user experience.

Method used

A magnetometer is used to detect the magnetic field strength and direction, determine the adsorption position of the stylus through the output signal, determine whether there is an offset, and prompt the user to adjust the position through a pop-up window.

Benefits of technology

Effectively determine whether the adsorption position of the stylus is offset, improves charging efficiency and user experience, and ensures the correct adsorption of the stylus on electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707348B_ABST
    Figure CN117707348B_ABST
Patent Text Reader

Abstract

The method for determining the position of a stylus pen and the electronic device provided in the present application can be applied to the field of electronic technology, including: a magnetic field detection device can be used to detect the magnetic field strength and direction of the position of a magnetometer, and a first signal can be outputted; then a processor can determine the adsorption position of the stylus pen on the electronic device according to the first signal, and then determine whether the adsorption position of the stylus pen is offset relative to a preset adsorption position according to the adsorption position. In this way, since different adsorption positions correspond to different magnetic field strengths, the adsorption position of the stylus pen on the electronic device can be determined by the magnetic field strength, and then whether the stylus pen is offset can be determined by the adsorption position of the stylus pen on the electronic device, so that the user can adjust the adsorption position of the stylus pen in case of offset, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a method for determining the position of a stylus pen and an electronic device. Background Art

[0002] Currently, some electronic devices are equipped with styluses, such as tablet computers, and users can use the styluses to input information such as text and graphics into the tablet computers in a touch-control manner.

[0003] A stylus pen can generally be attached to an electronic device via a magnet. When the stylus pen is attached to the correct position on the electronic device, electrical energy can be transmitted between the wireless output coil in the electronic device and the wireless receiving coil in the stylus pen, thereby enabling the electronic device to charge the stylus pen. However, since it is generally not easy for users to find the correct attachment position of the stylus pen on the electronic device, that is, the facing position of the wireless output coil and the wireless receiving coil, when the user attaches the stylus pen to the electronic device, the attachment position of the stylus pen on the electronic device may shift, which will affect the electronic device's charging of the stylus pen, thereby reducing the user experience. Summary of the invention

[0004] The method for determining the position of a stylus pen provided in the present application can detect whether the adsorption position of the stylus pen on the electronic device is offset. The present application adopts the following technical solutions:

[0005] In a first aspect, the present application provides a charging method, which can be applied to an electronic device, and the electronic device may include a magnetic field detection device, and the method includes:

[0006] The magnetometer can detect the magnetic field strength and direction at the location of the magnetometer and output a first signal. Since different adsorption positions correspond to different magnetic field strengths, the adsorption position of the stylus on the electronic device can be determined according to the first signal. In this way, it can be determined whether the stylus is offset according to the adsorption position of the stylus on the electronic device.

[0007] Specifically, the magnetic field strength of the magnetic field detection device in a preset direction among the three directions can be determined based on the first signal. Since the magnetic field strengths corresponding to different adsorption positions are different, the adsorption position of the stylus on the electronic device can be determined by the preset magnetic field strength range of the magnetic field strength in the preset direction, wherein the three directions may include an X-axis, a Y-axis, and a Z-axis, wherein the X-axis is the axis of the magnetometer along a direction perpendicular to the adsorption plane, wherein the adsorption plane refers to the surface on which the stylus and the electronic device are in contact with each other when the stylus and the electronic device are adsorbed, the Y-axis is the axis of the magnetometer along the stylus adsorption direction, wherein the stylus adsorption direction refers to the axial direction of the stylus when the stylus and the electronic device are adsorbed, and the Z-axis is the axis of the magnetometer pointing in the direction of the electronic device display screen, that is, the axis perpendicular to the electronic device screen.

[0008] Furthermore, the preset direction can be set to the direction of the X-axis, that is, the direction perpendicular to the adsorption plane. When it is determined that the magnetic field strength in the X-axis direction is greater than the sum of the initial magnetic field strength and the first magnetic field strength threshold, it can be considered that the adsorption position of the stylus is on the left side of the preset adsorption position. When it is determined that the magnetic field strength in the X-axis direction is less than the difference between the initial magnetic field strength and the first magnetic field strength threshold, it can be considered that the adsorption position of the stylus is at the preset adsorption position, wherein the initial magnetic field strength is the magnetic field strength measured by the magnetometer when the electronic device does not adsorb the stylus, which can be -942, and the negative sign represents that the direction is opposite to the X-axis direction. The first magnetic field strength can be set according to actual needs, for example, it can be set to 500.

[0009] When the stylus adsorption position is at the preset adsorption position, it can be determined that the stylus is at the correct adsorption position and its adsorption position has not shifted. When the stylus adsorption position is to the left of the preset adsorption position, it is determined that the stylus is shifted to the left relative to the preset adsorption position.

[0010] In some possible implementations, when it is determined that the stylus is offset, a first pop-up window may be presented, and prompt information may be displayed on the first pop-up window to prompt the user to adsorb the stylus to a preset position.

[0011] In some possible implementation methods, in certain specific scenarios, for example, the presence of magnets around electronic devices may affect the magnetic field strength measured by the magnetometer, thereby reducing the accuracy of determining the offset of the stylus. In order to further improve the accuracy of determining the offset of the stylus, after determining that the stylus is offset, it is further determined whether the wireless charging coil has an overcurrent OCP or an overvoltage OVP.

[0012] When it is determined that the wireless charging Tx chip has overcurrent OCP or overvoltage OVP, it can be determined that the change in magnetic field strength is caused by the misalignment of the stylus adsorption, that is, it can be determined that the adsorption position of the stylus is offset to the left relative to the preset adsorption position, and the first pop-up window is presented.

[0013] In some possible implementations, when it is determined that the stylus adsorption position is at a preset adsorption position, that is, the stylus adsorption position is correct, it can be determined whether the wireless coil interaction between the electronic device and the stylus is normal. When it is determined that the wireless coil interaction is normal, the stylus can be charged.

[0014] Furthermore, when the electronic device can wirelessly charge the stylus, the electronic device can present a second pop-up window on the display screen, and display the connection status between the stylus and the electronic device and the remaining power of the stylus on the second pop-up window, wherein the connection status can include successful connection and failed connection.

[0015] In a second aspect, the present application provides an electronic device, including: a magnetic field detection device and a processor;

[0016] The magnetic field detection device is connected to the processor;

[0017] The magnetic field detection device is used to obtain a first signal, and the first signal is used to characterize the magnetic field strength and direction of the position where the magnetic field detection device is located. Different adsorption positions correspond to different magnetic field strengths.

[0018] The processor can determine the adsorption position of the stylus on the electronic device according to the first signal output by the magnetic field detection device, so that it can be determined whether the stylus is offset according to the adsorption position of the stylus on the electronic device.

[0019] Specifically, the processor is used to determine the magnetic field strength of the stylus in a preset direction among the three directions according to the first signal. Since different adsorption positions correspond to different magnetic field strengths, the adsorption position of the stylus on the electronic device can be determined by the preset magnetic field strength range of the magnetic field strength in the preset direction, wherein the three directions may include an X-axis, a Y-axis, and a Z-axis, wherein the X-axis is the axis of the magnetometer vertically upward along the paper surface, the Y-axis is the axis of the magnetometer vertically to the left along the paper surface, and the Z-axis is the axis of the magnetometer pointing in the direction of the electronic device display screen, that is, the axis perpendicular to the screen of the electronic device.

[0020] The preset direction can be set to the direction of the X-axis, that is, the direction pointing vertically to the stylus. When it is determined that the magnetic field strength in the X-axis direction is greater than the sum of the initial magnetic field strength and the first magnetic field strength threshold, it can be considered that the adsorption position of the stylus is on the left side of the preset adsorption position. When it is determined that the magnetic field strength in the X-axis direction is less than the difference between the initial magnetic field strength and the first magnetic field strength threshold, it can be considered that the adsorption position of the stylus is at the preset adsorption position, wherein the initial magnetic field strength is the magnetic field strength measured by the magnetometer when the electronic device does not adsorb the stylus, which can be -942, and the negative sign represents that the direction is opposite to the X-axis direction. The first magnetic field strength can be set according to actual needs, for example, it can be set to 500.

[0021] The processor is also specifically used to, when it is determined that the stylus adsorption position is at a preset adsorption position, determine that the stylus is at a correct adsorption position and that its adsorption position has not been offset; and when it is determined that the stylus adsorption position is to the left of the preset adsorption position, determine that the stylus is offset to the left relative to the preset adsorption position.

[0022] In some possible implementations, when it is determined that the stylus is offset, the processor is further used to control the electronic device to present a first pop-up window and display prompt information on the first pop-up window to prompt the user to adsorb the stylus to a preset position.

[0023] In certain specific scenarios, for example, the presence of magnets around electronic devices may affect the magnetic field strength measured by the magnetometer, thereby reducing the accuracy of determining the offset of the stylus. In order to further improve the accuracy of determining the offset of the stylus, after determining that the stylus has offset, it is further determined whether the wireless charging coil has overcurrent OCP or overvoltage OVP.

[0024] The processor can also be specifically used to, when it is determined that the wireless charging Tx chip has overcurrent OCP or overvoltage OVP, determine that the change in magnetic field strength is caused by the misalignment of the stylus adsorption, that is, it can be determined that the adsorption position of the stylus is offset to the left relative to the preset adsorption position, and present the first pop-up window.

[0025] In some possible implementations, when it is determined that the stylus adsorption position is at a preset adsorption position, that is, the stylus adsorption position is correct, the processing is also used to determine whether the wireless coil interaction between the electronic device and the stylus is normal. When it is determined that the wireless coil interaction is normal, the stylus can be charged.

[0026] Specifically, when the electronic device can wirelessly charge the stylus, the controller can control the electronic device to present a second pop-up window on the display screen, and display the connection status between the stylus and the electronic device and the remaining power of the stylus on the second pop-up window, where the connection status can include successful connection and failed connection.

[0027] In a third aspect, the present application further provides a device system, comprising the electronic device and a stylus as described in any one of the second aspects;

[0028] The electronic device also includes a first adsorption magnet and a second adsorption magnet;

[0029] The stylus includes a third adsorption magnet and a fourth adsorption magnet, the first adsorption magnet is used to attract the third adsorption magnet, and the second adsorption magnet is used to attract the fourth adsorption magnet, so that the stylus is adsorbed on the electronic device in a first orientation; or, the first adsorption magnet is used to attract the fourth adsorption magnet, and the second adsorption magnet is used to attract the third adsorption magnet, so that the stylus is adsorbed on the electronic device in a second orientation.

[0030] In a fourth aspect, the present application provides a computer storage medium, comprising computer instructions, which, when executed on a mobile terminal, enables the electronic device to execute the method described in any one of the first aspects.

[0031] It can be seen from the above technical solution that the present application has the following beneficial effects:

[0032] In the present application, the magnetic field strength and direction of the magnetometer can be detected by a magnetic field detection device to output a first signal. Then, the processor can determine the adsorption position of the stylus on the electronic device according to the first signal, and then determine whether the adsorption position of the stylus is offset relative to the preset adsorption position according to the adsorption position. In this way, since different adsorption positions correspond to different magnetic field strengths, the adsorption position of the stylus on the electronic device can be determined by the magnetic field strength, and then it can be determined whether the stylus is offset by the adsorption position of the stylus on the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a schematic diagram of an application scenario of an electronic device and a stylus provided in an embodiment of the present application;

[0034] Figure 2 is a structural diagram of an electronic device provided in an embodiment of the present application;

[0035] Figure 3 is a structural diagram of a stylus provided in an embodiment of the present application;

[0036] Figure 4 is a schematic diagram of an adsorption scenario of an electronic device and a stylus provided in an embodiment of the present application;

[0037] Figure 5 This is a schematic diagram of the position relationship between the first electronic device and the stylus when they are correctly adsorbed provided by an embodiment of the present application;

[0038] Figure 6 This is a schematic diagram of the relationship between the positions of the components of the first electronic device and the stylus when they are correctly adsorbed, provided by an embodiment of the present application;

[0039] Figure 7 This is a schematic diagram of the position relationship between the second electronic device and the stylus when they are correctly adsorbed according to an embodiment of the present application;

[0040] Figure 8 This is a schematic diagram of the relationship between the positions of the components of the second electronic device and the stylus when they are correctly adsorbed according to an embodiment of the present application;

[0041] Fig. 9 This is a schematic diagram of the positional relationship between the first electronic device and the stylus provided in an embodiment of the present application;

[0042] Fig.10 This is a schematic diagram of the relationship between the positions of the components of the first electronic device and the stylus during adsorption provided by an embodiment of the present application;

[0043] Fig.11 is a schematic diagram of the positional relationship between a second electronic device and a stylus provided in an embodiment of the present application;

[0044] Fig.12 is a schematic diagram of the position relationship of components when the second electronic device and the stylus are adsorbed, provided in an embodiment of the present application;

[0045] Fig.13 is a schematic diagram of the positional relationship between a third electronic device and a stylus provided in an embodiment of the present application;

[0046] Fig.14 is a schematic diagram of the position relationship of components when a third electronic device and a stylus are adsorbed, provided in an embodiment of the present application;

[0047] Fig.15 is a schematic diagram of the positional relationship between a fourth electronic device and a stylus provided in an embodiment of the present application;

[0048] Fig.16 is a schematic diagram of the relationship between the positions of components of a fourth electronic device and a stylus pen when being adsorbed, provided by an embodiment of the present application;

[0049] Fig.17 is a schematic diagram of the positional relationship between a fifth electronic device and a stylus provided in an embodiment of the present application;

[0050] Fig.18 is a schematic diagram of the position relationship of components when a fifth electronic device and a stylus are adsorbed, provided by an embodiment of the present application;

[0051] Fig.19 is a schematic diagram of the positional relationship between a sixth electronic device and a stylus provided in an embodiment of the present application;

[0052] Fig. 20 is a schematic diagram of the relationship between the device positions of the sixth electronic device and the stylus during adsorption provided by an embodiment of the present application;

[0053] Fig.21 is a schematic diagram of the positional relationship between a seventh electronic device and a stylus provided in an embodiment of the present application;

[0054] Fig. 22 is a schematic diagram of the relationship between the positions of components of a seventh electronic device and a stylus during adsorption provided by an embodiment of the present application;

[0055] Fig.23 is a schematic diagram of the positional relationship between an eighth electronic device and a stylus provided in an embodiment of the present application;

[0056] Fig.24 is a schematic diagram of the position relationship of components when the eighth electronic device and the stylus are adsorbed, provided by an embodiment of the present application;

[0057] Fig.25 is a schematic diagram of the positional relationship between a ninth electronic device and a stylus provided in an embodiment of the present application;

[0058] Fig.26 is a schematic diagram of the relationship between the positions of the components of the ninth electronic device and the stylus during adsorption provided by an embodiment of the present application;

[0059] Fig. 27 is a schematic diagram of the positional relationship between a tenth electronic device and a stylus provided in an embodiment of the present application;

[0060] Fig.28 is a schematic diagram of the position relationship of components of a tenth electronic device and a stylus during adsorption provided by an embodiment of the present application;

[0061] Fig.29 is a schematic diagram of the positional relationship between an eleventh electronic device and a stylus provided in an embodiment of the present application;

[0062] Fig.30 is a schematic diagram of the position relationship of components when the eleventh electronic device and the stylus are adsorbed, provided by an embodiment of the present application;

[0063] Fig.31 is a schematic diagram of the positional relationship between a twelfth electronic device and a stylus provided in an embodiment of the present application;

[0064] Fig.32 is a schematic diagram of the position relationship of components when a twelfth electronic device and a stylus are adsorbed, provided in an embodiment of the present application;

[0065] Fig.33 is a schematic diagram of the positional relationship between a thirteenth electronic device and a stylus provided in an embodiment of the present application;

[0066] Fig.34 is a schematic diagram of the position relationship of components when the thirteenth electronic device and the stylus are adsorbed, provided in an embodiment of the present application;

[0067] Fig.35 is a schematic diagram of the positional relationship between a fourteenth electronic device and a stylus provided in an embodiment of the present application;

[0068] Fig.36 is a schematic diagram of the relationship between the positions of components of a fourteenth electronic device and a stylus during adsorption provided by an embodiment of the present application;

[0069] Fig.37 is a module structure diagram of an electronic device provided in an embodiment of the present application;

[0070] Fig.38A is a plan view of an electronic device provided by an embodiment of the present application;

[0071] Fig.38B is a side schematic diagram of an electronic device provided in an embodiment of the present application;

[0072] Fig.39 is a flow chart of a method for determining a position of a stylus pen provided in an embodiment of the present application;

[0073] Fig.40 is a schematic diagram of presenting a first pop-up window provided in an embodiment of the present application;

[0074] Fig.41 It is a schematic diagram of presenting a second pop-up window provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.

[0076] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0077] The following introduces the application scenarios of the method for determining the position of the stylus pen of the present application.

[0078] like Figure 1 As shown, Figure 1 A schematic diagram of an application scenario of a method for determining a position of a stylus pen provided in an embodiment of the present application includes: an electronic device 10 and a stylus pen 20 .

[0079] The electronic device 10 may be provided with a stylus 20. The user may use the stylus 20 to input information such as text and graphics on the electronic device 10 by touch. In some possible implementations, the electronic device 10 may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, and the like. The present application does not impose any special restrictions on the specific forms of the above electronic devices. In this embodiment, the structure of the electronic device 10 may be as follows: Figure 2 As shown, Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0080] like Figure 2The electronic device 10 shown may include a wireless output coil 132, a wireless output control module 133, a processor 134, a memory 135, a touch screen 11, a first charging interface 131, a first charging management module 138, a first wireless communication module 136 and a sensor module 16, etc. It should be noted that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0081] Specifically, the memory 135 may be used to store program codes, such as program codes for wirelessly charging the stylus pen, etc. The memory 135 may also store a Bluetooth address for uniquely identifying the electronic device.

[0082] The processor 134 can be used to execute the above-mentioned application code and call related modules to implement the functions of the electronic device 10 in the embodiment of the present application. For example, the electronic device 10 is used to perform wireless charging functions for other electronic devices, wireless communication functions, etc. The processor 134 may include one or more processing units, for example: the processor 134 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Exemplarily, the processor 134 of the electronic device can be a microprocessor.

[0083] The first wireless communication module 136 can be used to support data exchange between the electronic device 10 and other electronic devices, including wireless communications such as Bluetooth (BT), global navigation satellite system (GNSS), wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.

[0084] In some embodiments, the first wireless communication module 136 may be a Bluetooth chip. The electronic device 10 may pair with a Bluetooth chip of another electronic device through the Bluetooth chip and establish a wireless connection to achieve wireless communication between the electronic device and the other electronic device through the wireless connection.

[0085] In addition, the first wireless communication module 136 may also include an antenna. The first wireless communication module 136 receives electromagnetic waves via the antenna, modulates the frequency of the electromagnetic wave signal, performs filtering, and sends the processed signal to the processor 134. The first wireless communication module 136 may also receive a signal to be sent from the processor 134, modulate the frequency of the signal, amplify the signal, and convert it into an electromagnetic wave for radiation through the antenna.

[0086] In some possible implementations, the electronic device 10 may have the function of wirelessly charging other electronic devices such as a stylus. At this time, the first charging management module 138 may also receive input from the first charging interface 131 or the first battery 14, and convert the DC signal input from the first charging interface 131 or the first battery 14 into an AC signal. The AC signal is transmitted to the wireless output coil 132 of the electronic device through a matching circuit. The wireless output coil 132 can generate an alternating electromagnetic field when receiving the AC signal. The wireless receiving coil of other electronic devices such as a stylus can sense the alternating electromagnetic field and perform wireless charging.

[0087] It should be noted that the above-mentioned matching circuit can be integrated into the first charging management module 138, and the matching circuit can also be independent of the first charging management module 138, which is not limited in the embodiment of the present application.

[0088] Taking the example that the matching circuit can be integrated in the first charging management module 138 , a connection diagram of various functional components in the electronic device 10 is shown.

[0089] The first charging management module 138 manages external wireless charging and can also power the electronic device 10. The first charging management module 138 receives input from the first battery 14 and powers the processor 134, the memory 135, the external storage, and the first wireless communication module 136. The first charging management module 138 can also be used to monitor the battery capacity, battery cycle number, battery health status (leakage, impedance) and other parameters of the first battery 14. Figure 1 In the example shown, the first charging management module 138 is independent of the processor 134 and is electrically connected to the processor 134, and the processor 134 can control the first charging management module 138. In some other examples, the first charging management module 138 can be integrated into the processor 134.

[0090] In some possible implementations, the electronic device may further include a wireless output control module 133. The wireless output control module 133 may be connected to the first battery 14. In some other possible implementations, the wireless output control module 133 may also be connected to the first charging interface 131. The wireless output control module 133 may also be connected to the first battery 14 and the first charging interface 131, and the wireless output coil 132 may be connected to the wireless output control module 133, wherein the wireless output coil 132 may be a transmitting (Tx) coil. The wireless output control module 133 may receive a direct current signal input from the first battery 14. The wireless output control module 133 converts the direct current signal it receives into an alternating current signal, and then inputs the alternating current signal into the wireless output coil 132. In response to the alternating current signal, the wireless output coil 132 generates an alternating electromagnetic field to wirelessly charge the stylus.

[0091] The touch screen 11 is used to display images, videos, etc. The touch screen 11 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N touch screens 11, where N is a positive integer greater than 1.

[0092] The sensor module 16 may include a magnetic sensor and a touch sensor, etc. The magnetic sensor may include a magnetometer. In some examples, the electronic device may use a magnetometer to detect the adsorption state of the stylus.

[0093] The touch sensor is also called a "touch panel". The touch sensor can be disposed on the touch screen 11. The touch sensor is used to detect a touch operation applied thereto or thereabout. The touch sensor can transmit the detected touch operation to the processor 134 to determine the type of touch event. A visual output related to the touch operation can be provided through the touch screen 11. In other embodiments, the touch sensor can also be disposed on the surface of the tablet computer, which is different from the location of the touch screen 11.

[0094] Figure 3 This is a schematic diagram of the structure of a stylus provided in an embodiment of the present application. Figure 3 The stylus 20 may include:

[0095] The second battery 22 , the wireless receiving coil 210 , the wireless receiving control module 233 and the charging control module 2331 , wherein the wireless receiving coil 210 may be referred to as a receiving (Rx) coil.

[0096] The wireless receiving coil 210 is used to couple with the wireless output coil 132 on the electronic device. The wireless receiving coil 210 senses the alternating electromagnetic field emitted by the wireless output coil 132, and can generate an AC signal, and then send the AC signal to the wireless receiving control module 233. The wireless receiving control module 233 can rectify the AC signal into a DC signal, and then input the DC signal to the charging control module 2331. The charging control module 2331 can manage the DC signal, for example, manage the input current and voltage, and then input the DC signal to the second battery 24 to charge the second battery 24.

[0097] The stylus pen 20 may be an inductive pen or a capacitive pen.

[0098] When the stylus 20 is an inductive pen, an electromagnetic induction board needs to be integrated on the touch screen of the electronic device that interacts with the stylus 20. Coils are distributed on the electromagnetic induction board, and coils are integrated in the stylus. Based on the principle of electromagnetic induction, within the magnetic field generated by the electromagnetic induction board, as the stylus 20 moves, the stylus 20 can accumulate electrical energy. The stylus 20 can transmit the accumulated electrical energy to the electromagnetic induction board through free oscillation via the hand coil. The electromagnetic induction board can scan the coil on the electromagnetic induction board based on the electrical energy from the stylus 20 and calculate the position of the inductive pen on the touch screen.

[0099] When the stylus 20 is a capacitive stylus, an electrode array needs to be integrated on the touch screen 11 of the electronic device that interacts with the stylus 20. In one embodiment, the electrode array may be a capacitive electrode array. One or more electrodes may be integrated in the stylus 20, and the stylus 20 may transmit signals through the electrodes. The tablet computer may receive the signals from the stylus 20 through the electrode array, and then, upon receiving the signals, the position of the stylus 20 on the touch screen may be identified based on the change in the capacitance value on the touch screen 11.

[0100] When the user does not need to use the stylus pen 20 , the user can adsorb the stylus pen 20 onto the electronic device 10 .

[0101] like Figure 4 As shown, Figure 4 1 is a schematic diagram of an adsorption scene of an electronic device 10 and a stylus pen 20 provided in an embodiment of the present application. The stylus pen 20 can be adsorbed on the electronic device 10.

[0102] In some possible implementations, the electronic device 10 is a tablet computer, for example, and the tablet computer and the stylus pen 20 can be mutually adsorbed by magnets, for example, Figure 5 As shown, Figure 5 1 is a schematic diagram of the positional relationship between the first electronic device 10 and the stylus pen 20 provided in the embodiment of the present application when they are correctly adsorbed. Figure 6 1 is a schematic diagram of the device position relationship when the first electronic device 10 and the stylus 20 are correctly adsorbed according to an embodiment of the present application. Figure 6 The devices shown in the figure are Figure 5 Devices in region A.

[0103] like Figure 5 and Figure 6As shown, the electronic device 10 includes a wireless output coil 132, a first adsorption magnet 110 and a second adsorption magnet 120. The first adsorption magnet 110 includes a first sub-magnet 111 and a second sub-magnet 112. The second adsorption magnet 120 includes a third sub-magnet 121 and a fourth sub-magnet 122. The stylus 20 includes a wireless receiving coil 210, a detection magnet 220, a third adsorption magnet 230 and a fourth adsorption magnet 240. The third adsorption magnet 230 includes a fifth sub-magnet 232 and a sixth sub-magnet 234. The fourth adsorption magnet 240 includes a seventh sub-magnet 242 and an eighth sub-magnet 244. The first adsorption magnet 110, the second adsorption magnet 120, the third adsorption magnet 230 and the fourth adsorption magnet 240 all adopt a Halbach Array, which can gather magnetic lines of force on one side of the magnet to obtain a stronger unilateral magnetic field to enhance the attraction. A transverse magnet is also arranged between the two sub-magnets in each adsorption magnet. The detection magnet 220 in the stylus 20 is a separate magnet. In the following description, the relative position of the first adsorption magnet 110 and the wireless output coil 132 is defined as the first adsorption magnet 110 is located on the left side of the wireless output coil 132, and the relative position of the third adsorption magnet 230 and the wireless receiving coil 210 is defined as the third adsorption magnet 230 is located on the left side of the wireless receiving coil 210. At the same time, in the embodiment of the present application, for ease of understanding, the "left" in the text description is the same direction as the left direction along the paper direction in the accompanying drawings, and the "right" in the text description is the same direction as the right direction along the paper direction in the accompanying drawings.

[0104] After the stylus pen 20 is adsorbed at the correct position on the electronic device 10, the wireless output coil 132 in the electronic device 10 and the wireless receiving coil 210 in the stylus pen 20 can transmit electric energy, so that the electronic device 10 can charge the stylus pen 20. The correct position here refers to the preset adsorption position of the stylus pen 20 adsorbed on the electronic device 10. At the preset adsorption position, the adsorption positions of the electronic device 10 and the stylus pen 20 are not offset. In the embodiment of the present application, the preset adsorption position includes the following two different situations.

[0105] (A) In the first case, if Figure 5 and Figure 6 As shown, when the tip of the stylus pen 20 faces left, the S level of the first sub-magnet 111 and the N level of the fifth sub-magnet 232 are attracted to each other, the N level of the second sub-magnet 112 and the S level of the sixth sub-magnet 234 are attracted to each other, the N level of the third sub-magnet 121 and the S level of the seventh sub-magnet 242 are attracted to each other, and the S level of the fourth sub-magnet 122 and the N level of the eighth sub-magnet 244 are attracted to each other. When the adsorption relationship between the electronic device 10 and the stylus pen 20 is as shown in FIG. Figure 5As shown, the wireless output coil 132 and the wireless receiving coil 210 are located at corresponding positions. In this case, the wireless output coil 132 in the electronic device 10 can output power, and the wireless receiving coil 210 in the stylus 20 can receive power, so that the electronic device 10 can wirelessly charge the stylus 20.

[0106] (B) In the second case, Figure 7 is a schematic diagram of the positions of the second electronic device 10 and the stylus pen 20 when they are correctly adsorbed according to an embodiment of the present application, Figure 8 Schematic diagram of the position relationship of components when the second electronic device and the stylus are correctly adsorbed provided by the embodiment of the present application. Figure 7 and Figure 8 As shown, when the tip of the stylus pen 20 is facing rightward, the S level of the first sub-magnet 111 is attracted to the N level of the eighth sub-magnet 244, the N level of the second sub-magnet 112 is attracted to the S level of the seventh sub-magnet 242, the N level of the third sub-magnet 121 is attracted to the S level of the sixth sub-magnet 234, and the S level of the fourth sub-magnet 122 is attracted to the N level of the fifth sub-magnet 232. When the adsorption relationship between the electronic device 10 and the stylus pen 20 is as shown in FIG. Figure 6 As shown, the wireless output coil 132 and the wireless receiving coil 210 are located at corresponding positions. At this time, the wireless output coil 132 in the electronic device 10 outputs electrical energy, and the wireless receiving coil 210 in the stylus 20 can receive electrical energy, so that the electronic device 10 can wirelessly charge the stylus 20.

[0107] Specifically, when the stylus 20 is adsorbed on the correct position of the electronic device 10, the electronic device 10 can wirelessly charge the stylus 20. During the wireless charging process, the first battery 14 of the electronic device 10 can be used as a power source to power the second battery 24, or the wired charging input of the first charging interface 131 of the electronic device 10 can be used as a power source to power the second battery 24. The following is an example of the first battery 14 of the electronic device 10 being used as a power source to power the second battery 24. The wireless output control module 133 on the electronic device 10 can receive a DC signal input by the first battery 14. The wireless output control module 133 converts the DC signal it receives into an AC signal, and then inputs the AC signal into the wireless output coil 132. The wireless output coil 132 generates an alternating electromagnetic field in response to the AC signal. The wireless receiving coil 210 on the stylus 20 is coupled with the wireless output coil 132 on the tablet computer. The wireless receiving coil 210 senses the alternating electromagnetic field emitted by the wireless output coil 132, and can generate an AC signal, and then send the AC signal to the wireless receiving control module 233. The wireless receiving control module 233 can rectify the AC signal into a DC signal, and then input the DC signal to the charging control module 2331. The charging control module 2331 can manage the DC signal, for example, manage the input current and voltage, and then input the DC signal to the second battery 24 to charge the second battery 24. It should be noted that the wireless charging coil may include the wireless output coil 132 and the wireless receiving coil 210. In the electronic device 10, the wireless charging coil is the wireless output coil 132, and in the stylus 20, the wireless charging coil is the wireless receiving coil 210.

[0108] Since the user cannot know the specific positions of the wireless output coil 132 and the wireless receiving coil 210, when the user attaches the stylus pen 20 to the electronic device 10, the user will subconsciously place the stylus pen 20 in the middle of the electronic device 10 based on general usage habits. Figure 5 and Figure 7 As shown, since the camera 102 is disposed in the middle of the electronic device 10, the wireless output coil 132, the first adsorption magnet 110 and the second adsorption magnet 120 are usually disposed at the left or right position in the electronic device 10. In this case, the adsorption position of the stylus pen 20 on the electronic device 10 will shift to the left or right. In addition, even if the user knows that the stylus pen 20 should be adsorbed on the left or right position of the electronic device 10, the user usually cannot directly determine the correct adsorption position of the stylus pen 20 due to the lack of clear position prompts, which can easily cause the adsorption position of the stylus pen 20 on the electronic device 10 to shift.

[0109] Fourteen possible situations where the adsorption position of the stylus pen 20 may be offset when adsorbed onto the electronic device 10 are described below.

[0110] (1) In the first case, if Fig. 9 and Fig.10 As shown, the tip of the stylus pen 20 faces left, the wireless receiving coil 210 of the stylus pen 20 and the first adsorption magnet 110 of the electronic device 10 are directly attracted to each other and generate attraction, and the fourth adsorption magnet 240 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 are directly attracted to each other. At this time, the attraction generated is relatively large, and the stylus pen 20 can be adsorbed on the electronic device 10.

[0111] (2) In the second case, if Fig.11 and Fig.12 As shown, the tip of the stylus pen 20 faces left, the wireless receiving coil 210 of the stylus pen 20 and the first adsorption magnet 110 of the electronic device 10 generate attraction, the wireless output coil 132 of the electronic device 10 and the fourth adsorption magnet 240 of the stylus pen generate attraction, and the fourth adsorption magnet 240 of the stylus pen and the first adsorption magnet 110 generate attraction. In this case, the attraction is weak and cannot be adsorbed on the tablet.

[0112] (3) In the third case, if Fig.13 and Fig.14 As shown, the tip of the stylus pen 20 faces left, and the eighth sub-magnet 244 of the stylus pen 20 and the first sub-magnet 111 of the electronic device 10 generate an attractive force, but the attractive force is weak and cannot be adsorbed onto the electronic device 10 .

[0113] (4) In the fourth case, if Fig.15 and Fig.16 As shown, the tip of the stylus pen 20 faces left, the detection magnet 220 of the stylus pen 20 and the first sub-magnet 111 of the electronic device 10 generate attraction, the third adsorption magnet 230 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 generate attraction, and the wireless receiving coil 210 of the stylus pen 20 and the second adsorption magnet 120 of the electronic device 10 generate attraction. The attraction is strong and the stylus pen 20 can be adsorbed on the electronic device 10.

[0114] (5) In the fifth case, if Fig.17 and Fig.18 As shown, the tip of the stylus pen 20 faces left, the detection magnet 220 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 generate attraction, the third adsorption magnet 230 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 generate attraction, and the second adsorption magnet 120 of the electronic device 10 and the wireless receiving coil 210 of the stylus pen 20 generate attraction. The attraction is strong and the stylus pen can be adsorbed on the tablet.

[0115] (6) In the sixth case, if Fig.19 and Fig. 20 As shown, the tip of the stylus pen 20 faces left, the detection magnet 220 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 generate attraction, and the fifth sub-magnet 232 of the stylus pen 20 and the fourth sub-magnet 122 of the electronic device 10 generate attraction, which is weak and cannot be adsorbed on the tablet.

[0116] (7) In the seventh case, if Fig.21 and Fig. 22 As shown, the tip of the stylus pen 20 faces left, and the detection magnet 220 of the stylus pen 20 and the second adsorption magnet 120 of the electronic device 10 generate an attraction force, but the attraction force is weak and cannot be adsorbed on the tablet.

[0117] (8) In the eighth case, if Fig.23 and Fig.24 As shown, the tip of the stylus pen 20 faces right, and the wireless receiving coil 210 of the stylus pen 20 and the fourth adsorption magnet 240 of the electronic device 10, as well as the wireless output coil 132 of the stylus pen 20 and the second adsorption magnet 120 of the electronic device 10 face each other to generate an attractive force, which is strong and can be adsorbed on the tablet.

[0118] (9) In the ninth case, if Fig.25 and Fig.26 As shown, the tip of the stylus pen 20 faces right, the wireless receiving coil 210 of the stylus pen 20 and the second adsorption magnet 120 of the electronic device 10 generate attraction, the wireless output coil 132 of the electronic device 10 and the fourth adsorption magnet 240 of the stylus pen 20 generate attraction, and the seventh sub-magnet 242 and the third sub-magnet 121 generate attraction, but the attraction is weak and cannot be adsorbed on the tablet.

[0119] (10) In the tenth case, if Fig. 27 and Fig.28 As shown, the tip of the stylus pen 20 faces rightward, and the eighth sub-magnet 244 of the stylus pen 20 and the fourth sub-magnet 122 of the electronic device 10 generate an attractive force, but the attractive force is weak and cannot be adsorbed on the tablet.

[0120] (11) In the eleventh case, if Fig.29 and Fig.30 As shown, the tip of the stylus pen 20 faces right, the detection magnet 220 of the stylus pen 20 and the second adsorption magnet 120 of the electronic device 10, the third adsorption magnet 230 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 generate attraction, and the wireless receiving coil 210 of the stylus pen 20 and the first adsorption magnet 110 of the electronic device 10 generate attraction, and the attraction is strong, so the stylus pen 20 can be adsorbed on the tablet.

[0121] (12) In the twelfth case, if Fig.31 and Fig.32 As shown, the tip of the stylus pen 20 faces right, the detection magnet 220 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 generate attraction, the third adsorption magnet 230 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10 generate attraction, and the first adsorption magnet 110 of the electronic device 10 and the wireless receiving coil 210 of the stylus pen 20 generate attraction. The suction force is strong and the stylus pen can be adsorbed on the tablet.

[0122] (13) In the thirteenth case, if Fig.33 and Fig.34 As shown, the tip of the stylus pen 20 faces right, and the detection magnet 220 of the stylus pen 20 and the wireless output coil 132 of the electronic device 10, the fifth sub-magnet 232 and the first sub-magnet 111 generate an attractive force, which is weak and cannot be adsorbed on the tablet.

[0123] (14) In the fourteenth case, if Fig.35 and Fig.36 As shown, the tip of the stylus pen 20 faces right, and the detection magnet 220 of the stylus pen 20 and the first adsorption magnet 110 of the electronic device 10 generate an attraction force, which is weak and cannot be adsorbed on the tablet.

[0124] See also Figures 9 to 36 It can be seen that when the adsorption position of the stylus pen 20 on the electronic device 10 is offset, the wireless output coil 132 and the wireless receiving coil 210 are not in opposite positions, which will affect the electronic device 10 charging the stylus pen 20. Based on this, the present application provides a method for determining the position of the stylus pen 20 and an electronic device 10, which can detect whether the adsorption position of the stylus pen 20 on the electronic device 10 is offset.

[0125] In the eight cases (2), (3), (6), (7), (9), (10), (13) and (14), since the adsorption position deviation between the electronic device 10 and the stylus 20 is the most serious, the attraction between the electronic device 10 and the stylus 20 is also small, resulting in the stylus 20 being unable to be adsorbed on the electronic device 10. Therefore, the user can perceive that the stylus 20 is not adsorbed on the correct position (preset position) of the electronic device 10. Based on this, the method for determining the position of the stylus 20 provided in the embodiment of the present application mainly performs adsorption position detection for the seven cases (1), (4), (5), (8), (11) and (12).

[0126] The electrical structure of the electronic device 10 to which the stylus 20 offset detection method provided in the embodiment of the present application is applied is described. In the embodiment of the present application, the connection between the two electronic devices is an electrical connection, where the electrical connection refers to the transmission of electrical signals between the two electronic devices through the connection. The electrical connection between the two electronic devices can be a direct connection through a wire or an indirect connection through other electronic devices.

[0127] Fig.37 1 is a module structure diagram of an electronic device 10 provided in an embodiment of the present application. Fig.37 As shown, the electronics in the electronic device 10 may include a wireless output coil 132 , a processor 150 , and a magnetometer 16 .

[0128] The magnetometer 16 is an instrument for measuring the strength and direction of the magnetic field at a location. When working, it can output an electrical signal to the processor 150 so that the processor 150 can perform the next step of processing according to the electrical signal. Its position in the electronic device 10 can be set according to actual needs. The magnetometer 16 is located at 4.19mm on the X axis, -6.88mm on the Y axis, and 2.59mm on the Z axis. For example, Fig.38A As shown, Fig.38A A schematic diagram of a plan view of an electronic device is shown, wherein the X-axis is the axis of the magnetometer perpendicular to the adsorption plane, and the X-axis 4.19 mm represents the distance from the upper surface of the current position of the magnetometer along the X-axis to the lower surface of the first sub-magnet 111, that is, the surface distance closest to the magnetometer along the X-axis is 4.19 mm, and the Y-axis is the axis of the magnetometer along the adsorption direction of the stylus, and the Y-axis -6.88 mm represents the distance from the right surface of the magnetometer along the current position along the opposite direction of the Y-axis to the left surface of the first sub-magnet 111 is 6.88 mm, wherein, Fig.38A The position relationship between the magnetometer 16 and the magnet is that the magnetometer 16 is on the left side of the magnet. The Z axis can be as follows Fig.38B As shown, Fig.38B A schematic diagram of a side view of an electronic device is shown. Fig.38B The middle Z axis is the axis of the magnetometer pointing in the direction of the electronic device display screen, that is, the axis perpendicular to the screen of the electronic device. The Z axis of 2.59 mm represents the distance from the front surface of the magnetometer at the current position, that is, the surface close to the first sub-magnet 111, along the Z axis to the rear surface of the first sub-magnet 111, that is, the surface of the first sub-magnet 111 close to the magnetometer, and the distance is 2.59 mm. It should be noted that the magnetometer is only used as an example here, and it is not limited to a magnetometer, and it can also be other magnetic field detection devices that can measure the strength and direction of the magnetic field.

[0129] The processor 150 may include a first sub-processor and a second sub-processor connected to each other. The first sub-processor may be a transmission (transport, Tx) chip. The second sub-processor may be a system-on-chip (SOC) in the electronic device 10. The SOC includes a central processing unit 150 (CPU), a graphics processing unit 150 (GPU), a baseband, etc. Fig.35 The embodiment shown is not intended to limit the position of each electronic device. The system and chip can receive the electrical signal output by the magnetometer 16, and then control the transmitting chip to emit energy according to the electrical signal. The energy emitted by the transmitting chip can be transmitted to the stylus in the form of an electrical signal through the wireless output coil 132.

[0130] The wireless output coil 132 may include ferrite and a metal wire wound around the ferrite. The electronic device 10 may output an electrical signal through the wireless output coil 132 , thereby charging the stylus pen 20 or / and communicating with the stylus pen 20 .

[0131] The principle of the method for determining the position of the stylus pen 20 provided in the embodiment of the present application is described below.

[0132] Specifically, the magnetometer device can convert the magnetic field strength into voltage, thereby detecting the magnitude of the magnetic field strength in three directions. When the stylus is correctly adsorbed or misaligned, the magnetic field strength generated at the magnetometer position is different, and then a threshold can be set to distinguish whether the stylus is correctly adsorbed or misaligned.

[0133] Specifically, taking the case where the magnetometer is located at 4.19 mm on the X axis, -6.88 mm on the Y axis, and 2.59 mm on the Z axis in the electronic device as an example, the magnetic field strength and direction of the above-mentioned various situations are measured by the magnetometer, as shown in Table 1:

[0134] Table 1:

[0135] Scenario X(ut) Y(ut) Z(ut) Scenario (1) -942 1929 1927 Not adsorbed (2) -3450 1972 417 Directly opposite (3) -2806 2757 450 Directly opposite (4) 1389 444 407 Offset Left (5) × × × Unable to hold (6) × × × Unable to hold (7) -1530 2907 384 Offset Right (8) -1051 2384 194 Offset Right (9) × × × Unable to hold (10) × × × Unable to hold (11) -1025 2139 179 Offset Right (12) × × × Unable to hold (13) × × × Unable to hold (14) 1346 348 558 Offset Left (15) 116 2743 313 Offset Left (16) × × × Unable to hold (17) × × × Unable to hold

[0136] It should be noted that X(ut) in Table 1 is the magnetic field strength in the X-axis direction measured by the magnetometer, Y(ut) is the magnetic field strength in the Y-axis direction measured by the magnetometer, and Z(ut) is the magnetic field strength in the Z-axis direction measured by the magnetometer, and the unit is Tesla T, where "positive" can indicate that the stylus is correctly adsorbed.

[0137] From the table above, we can see that when the stylus is correctly adsorbed, the minimum magnetic field strength measured by the X-axis is -2806, which is -1864 compared to -942. When it is offset to the left, the minimum magnetic field strength measured by the X-axis is 116, which is 1058. (X-Xi). The variables can clearly distinguish between correct adsorption and left offset. Therefore, the magnetometer can select the X-axis to distinguish different adsorption scenarios of the stylus in the current position.

[0138] In some possible implementations, it can be considered that when the X value measured by the magnetometer is greater than Xi+the first magnetic field strength threshold, the adsorption scene of the stylus is offset to the left relative to the preset adsorption position. When the X value measured by the magnetometer is less than Xi+the first magnetic field strength threshold, the adsorption scene of the stylus is adsorbed at the preset position, that is, correctly adsorbed. Among them, Xi is the magnetic field strength of the X axis measured by the magnetometer when the electronic device does not adsorb the stylus, and the first magnetic field strength threshold can be set according to demand, for example, 500.

[0139] Therefore, by measuring the magnetic field strength of the current position X axis by the magnetometer, different adsorption states of the stylus can be distinguished. Of course, those skilled in the art can set the position of the magnetometer according to actual needs, and select a suitable axis to distinguish different adsorption states of the stylus according to the position of the magnetometer, which is not limited here.

[0140] In order to solve the above-mentioned problem that it is generally difficult for users to find the correct adsorption position of the stylus pen on the electronic device, that is, the facing position of the wireless output coil and the wireless receiving coil, when the user adsorbs the stylus pen to the electronic device, the adsorption position of the stylus pen on the electronic device may be offset, resulting in a poor user experience.

[0141] The present application embodiment provides a method for determining the position of a stylus pen 20. The following describes the method for determining the position of a stylus pen provided in the present application embodiment in combination with the above embodiment and the corresponding drawings. Fig.39 A flow chart of a method for determining the position of a stylus is shown in FIG. Fig.37 The electronic device in the example is taken as the execution subject to introduce. Fig.39 As shown, the method may include but is not limited to the following:

[0142] S201: Detecting the adsorption status of the stylus pen.

[0143] In some possible implementations, the electronic device may detect the adsorption state of the stylus pen through a sensor, wherein the adsorption state of the stylus pen may be divided into adsorption and non-adsorption.

[0144] Specifically, when the processor in the electronic device determines through the sensor that the stylus is adsorbed on the electronic device, it can send a processing signal to the magnetic field detection device to enable the magnetic field detection device to work and execute step S202, wherein the magnetic field detection device can be a magnetometer. Here, a magnetometer is used as an example. Of course, it can also be other devices that can detect magnetic field strength and direction, such as a Hall device.

[0145] S202: The magnetometer detects the strength and direction of the magnetic field at the location and outputs a first signal.

[0146] In some possible implementations, the magnetometer does not need to respond to a processing signal sent by a processor, but can detect the strength and direction of the magnetic field at the electronic device in real time after the electronic device is turned on.

[0147] Specifically, the magnetic field strength at the location of the magnetometer can be divided into three directions, namely, the X-axis, the Y-axis, and the Z-axis, wherein the X-axis is the axis from the magnetometer perpendicular to the adsorption plane, the Y-axis is the axis from the magnetometer along the stylus adsorption direction, and the Z-axis is the axis of the magnetometer pointing to the electronic device display screen, that is, the axis perpendicular to the electronic device screen. For example, the magnetometer can be set at 4.19 mm on the X-axis, -6.88 mm on the Y-axis, and 2.59 mm on the Z-axis. Fig.38A A schematic diagram of a plan view of an electronic device is shown, wherein the X-axis is the axis of the magnetometer perpendicular to the adsorption plane, and the X-axis 4.19 mm represents the distance from the upper surface of the current position of the magnetometer along the X-axis to the lower surface of the first sub-magnet 111, that is, the surface distance closest to the magnetometer along the X-axis is 4.19 mm, and the Y-axis is the axis of the magnetometer along the adsorption direction of the stylus, and the Y-axis -6.88 mm represents the distance from the right surface of the magnetometer along the current position along the opposite direction of the Y-axis to the left surface of the first sub-magnet 111 is 6.88 mm, wherein, Fig.38A The positional relationship between the magnetometer 16 and the magnet is that the magnetometer 16 is on the left side of the magnet.

[0148] The Z axis can be Fig.38B As shown, Fig.38B A schematic diagram of a side view of an electronic device is shown. Fig.38B The middle Z axis is the axis of the magnetometer pointing in the direction of the electronic device display screen, that is, the axis perpendicular to the electronic device screen. The Z axis 2.59 mm represents the distance from the magnetometer along the front surface of the current position along the Z axis to the rear surface of the first sub-magnet 111, that is, the surface of the first sub-magnet 111 close to the magnetometer, and the distance is 2.59 mm. It should be noted that the magnetometer is only used as an example here, and it is not limited to a magnetometer, and it can also be other magnetic field detection devices that can measure the strength and direction of the magnetic field.

[0149] Of course, this is just an example and does not limit the location of the magnetometer.

[0150] After the magnetometer measures the magnetic field strength of the X-axis, Y-axis and Z-axis at the location, it can send it to the processor in the form of a signal, which can also be called a first signal, and then execute step S203.

[0151] S203: The processor determines the adsorption position of the stylus on the electronic device according to the first signal.

[0152] The processor may determine the adsorption position of the stylus on the electronic device according to the first signal.

[0153] Specifically, the processor can determine the magnetic field strength of the magnetometer in a preset direction in three directions according to the first signal, wherein the preset direction can be set according to demand. For example, taking the position of the magnetometer at 4.19mm on the X axis, -6.88mm on the Y axis, and 2.59mm on the Z axis as an example, when the stylus is correctly adsorbed, the minimum magnetic field strength measured on the X axis is -2806, which is a change of -1864 relative to -942. When offset to the left, the minimum magnetic field strength measured on the X axis is 116, which is a change of 1058. (The correct adsorption and the left offset can be clearly distinguished from the variables. Therefore, the magnetometer can select the X axis to distinguish whether the stylus is correctly adsorbed or offset to the left at the current position. Therefore, the preset direction of the magnetometer at the current position can be selected as the X axis. It can be understood that the specific axis to be selected to distinguish the adsorption scenario of the stylus can be set by technical personnel in this field according to demand, and is not limited here.

[0154] After determining the magnetic field strength in the X-axis direction, the processor can determine the adsorption position of the stylus on the electronic device according to the magnetic field strength range in the X-axis direction, wherein the magnetic field strength range can be preset according to demand.

[0155] Further, when it is determined that the magnetic field strength in the X-axis direction is greater than the sum of the initial magnetic field strength and the first magnetic field strength threshold, it can be considered that the adsorption position of the stylus is on the left side of the preset adsorption position; when it is determined that the magnetic field strength in the X-axis direction is less than the difference between the initial magnetic field strength and the first magnetic field strength threshold, it can be considered that the adsorption position of the stylus is at the preset adsorption position, wherein the initial magnetic field strength is the magnetic field strength measured by the magnetometer when the electronic device does not adsorb the stylus, which can be -942, and the negative sign represents that the direction is opposite to the X-axis direction. The first magnetic field strength can be set according to actual needs, for example, it can be set to 500.

[0156] For example, when the magnetometer is at the position of 4.19 mm on the X axis, -6.88 mm on the Y axis, and 2.59 mm on the Z axis, the magnetic field strength in the X axis direction is measured to be -3450. If -3450 is less than the initial magnetic field strength -942 plus the first magnetic field strength threshold of 500, it can be determined that at this time, the stylus adsorption position is at the preset adsorption position. The magnetic field strength in the X axis direction is measured to be 1389. If 1389 is greater than the initial magnetic field strength -942 plus the first magnetic field strength threshold of 500, it can be determined that at this time, the stylus adsorption position is to the left of the preset adsorption position. Then, step S204 is executed.

[0157] S204: Determine whether the stylus is offset according to the adsorption position.

[0158] When the stylus adsorption position is at the preset adsorption position, it can be determined that the stylus is at the correct adsorption position and its adsorption position has not shifted. When the stylus adsorption position is to the left of the preset adsorption position, it is determined that the stylus is shifted to the left relative to the preset adsorption position.

[0159] In the present application, a magnetometer can be used to detect the magnetic field strength and direction of the position where the magnetometer is located, and a first signal can be output, wherein the first signal is used to characterize the magnetic field strength and direction of the position where the magnetometer is located. Then, the processor can determine the magnetic field strength of the stylus in a preset direction among the three directions based on the first signal. Since different adsorption positions correspond to different magnetic field strengths, the adsorption position of the stylus on the electronic device can be determined by the preset magnetic field strength range of the magnetic field strength in the preset direction. In this way, it can be determined whether the stylus is offset by the adsorption position of the stylus on the electronic device.

[0160] When it is determined that the stylus adsorption position is to the left of the preset adsorption position, that is, the stylus is offset to the left relative to the preset adsorption position, step S207 may be executed to present the first pop-up window 400, such as Fig.40 As shown, prompt information can be displayed on the first pop-up window 400 to prompt the user to adsorb the stylus to a preset position, that is, a correct position.

[0161] In certain specific scenarios, for example, when there are magnets around the electronic device, the magnetic field strength measured by the magnetometer may be affected. That is to say, in this case, the actual situation may be that the adsorption position of the stylus pen has not shifted or is not adsorbed. However, since the magnetometer is affected by the surrounding magnets, the final result of the processor's judgment is that the adsorption position of the stylus pen is offset, which leads to a decrease in the accuracy of judging the offset of the stylus pen. In order to further improve the accuracy of judging the offset of the stylus pen, step S205 may be executed to determine whether the wireless charging coil has an overcurrent OCP or an overvoltage OVP.

[0162] When it is determined that the stylus adsorption position is at the preset adsorption position, that is, the stylus adsorption position is correct, step S206 may be executed to determine whether the wireless coil interaction is normal, and then the stylus is charged if the wireless coil interaction is normal.

[0163] S205: Determine whether the wireless charging Tx chip has an overcurrent OCP or an overvoltage OVP.

[0164] When the stylus is offset to the left relative to the preset adsorption position, the magnet of the stylus is directly opposite to the wireless charging coil of the electronic device, and the inductance of the wireless charging coil changes, resulting in an overcurrent OCP or overvoltage OVP prompt in the wireless charging Tx chip. In this way, when it is determined that the wireless charging Tx chip has an overcurrent OCP or an overvoltage OVP, it can be determined that the offset of the adsorption position of the stylus determined by the processor is caused by the actual stylus adsorption position being offset relative to the preset position, rather than being caused by the presence of magnets around the electronic device, thereby improving the accuracy of judging the offset of the stylus.

[0165] Among them, overcurrent protection OCP refers to a measure of protection that performs corresponding protection actions (such as tripping the circuit breaker) when the current of the high-power DC regulated power supply under test increases beyond the allowable value. It can cut off the circuit when the current flowing through the circuit exceeds the safety limit to protect the circuit and equipment from damage.

[0166] Overvoltage protection OVP is an extremely important feature of voltage, which is designed to prevent the power supply from inputting too high a voltage to sensitive devices. If the voltage on the power supply output terminal exceeds the OVP setting, the power supply output will be shut down, thus protecting the device from damage due to excessive voltage.

[0167] When it is determined that the wireless charging Tx chip has overcurrent OCP or overvoltage OVP, it can be determined that the change in magnetic field strength is caused by the misalignment of the stylus adsorption, that is, it can be determined that the adsorption position of the stylus is offset to the left relative to the preset adsorption position. At this time, step S207 can be executed to present the first pop-up window.

[0168] S206: Determine whether the wireless coil interaction is normal.

[0169] The processor in the electronic device can determine whether the wireless coil interaction between the electronic device and the stylus is normal.

[0170] When it is determined that the wireless coil interaction is normal, the stylus can be charged.

[0171] Specifically, the wireless charging coil in the electronic device is a wireless output coil, and the wireless charging coil in the stylus is a wireless receiving coil, wherein the wireless output coil may be a transmitting (Tx) coil, and the wireless receiving coil may be a receiving (Rx) coil, and the wireless output coil may generate an alternating electromagnetic field, and the stylus is wirelessly charged through the wireless receiving coil. Then step S208 may be executed.

[0172] S207: Presenting the first pop-up window.

[0173] When it is determined that the adsorption position of the stylus pen is offset to the left relative to the preset adsorption position, a first pop-up window 400 may be presented on the display screen of the electronic device, such as Fig.40 As shown, prompt information can be displayed on the first pop-up window 400 to prompt the user to adsorb the stylus to a preset position, that is, a correct position.

[0174] S208: Presenting a second pop-up window.

[0175] When the electronic device can wirelessly charge the stylus, the electronic device can present a second pop-up window 410 on the display screen, such as Fig.41 As shown, the connection status between the stylus pen and the electronic device and the remaining power of the stylus pen are displayed on the second pop-up window 410, wherein the connection status may include connection success and connection failure.

[0176] The technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, etc., various media that can store program codes.

[0177] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining a position of a stylus pen, characterized in that: Applied to an electronic device, the electronic device includes a magnetic field detection device, and the method for determining the position of a stylus pen includes: Acquire a first signal output by a magnetic field detection device, wherein the first signal is used to characterize the magnetic field strength and direction at a location where the magnetic field detection device is located; determining a suction position of the stylus on the electronic device according to the first signal; Determining the adsorption position of the stylus on the electronic device according to the first signal includes: determining the magnetic field strength of the magnetic field detection device in a preset direction according to the first signal, and determining the adsorption position of the stylus on the electronic device according to the magnetic field strength range of the magnetic field strength in the corresponding direction; the preset direction is a direction perpendicular to the adsorption plane; The step of determining the adsorption position of the stylus on the electronic device according to the magnetic field strength range of the magnetic field strength in the corresponding direction includes: When it is determined that the magnetic field intensity of the magnetic field detection device in the direction perpendicular to the adsorption plane is greater than the sum of the initial magnetic field intensity and the first magnetic field intensity threshold, determining that the adsorption position of the stylus pen is to the left of the preset adsorption position; When it is determined that the magnetic field strength of the magnetic field detection device in the direction perpendicular to the adsorption plane is less than the difference between the initial magnetic field strength and the first magnetic field strength threshold, it is determined that the adsorption position of the stylus pen is at a preset adsorption position, and the initial magnetic field strength is the magnetic field strength measured by the magnetic field detection device when the electronic device does not adsorb the stylus pen; according to the adsorption position, it is determined whether the stylus pen is offset, and the offset is that the adsorption position of the stylus pen adsorbed on the electronic device is offset relative to the preset adsorption position; The step of determining whether the stylus is offset according to the adsorption position includes: When it is determined that the adsorption position of the stylus pen is on the left side of the preset adsorption position, determining that the stylus pen is offset to the left relative to the preset adsorption position; When it is determined that the adsorption position of the stylus pen is at the preset adsorption position, it is determined that the stylus pen is not offset; When it is determined that the stylus is offset, the method further includes: When it is determined that the wireless charging transmitter Tx chip has overcurrent OCP or overvoltage OVP, a first pop-up window is presented, and prompt information is displayed on the first pop-up window, and the prompt information is used to prompt the user to adsorb the stylus to a preset position.

2. The method according to claim 1, characterized in that: When it is determined that the adsorption position of the stylus pen is at a preset adsorption position, the method further includes: Determine the interaction status of the wireless charging coil; When it is determined that the interaction state of the wireless charging coil is normal, the stylus is charged.

3. The method according to claim 2, characterized in that The method further comprises: A second pop-up window is presented, and the connection status between the stylus pen and the electronic device and the remaining power of the stylus pen are displayed on the second pop-up window, wherein the connection status includes a successful connection and a failed connection.

4. An electronic device, characterized in that: include: A magnetic field detection device and a processor; The magnetic field detection device is connected to the processor; The magnetic field detection device is used to output a first signal, and the first signal is used to represent the magnetic field strength and direction of the position where the magnetic field detection device is located; The processor is used to determine the adsorption position of the stylus on the electronic device according to the first signal, and determine whether the stylus is offset according to the adsorption position, wherein the offset is that the adsorption position of the stylus adsorbed on the electronic device is offset relative to a preset adsorption position; The processor is specifically used for: determining the magnetic field strength of the magnetic field detection device in a preset direction according to the first signal; Determining the adsorption position of the stylus on the electronic device according to the magnetic field strength range of the magnetic field strength in the corresponding direction; The processor is specifically used for: When it is determined that the magnetic field intensity of the magnetic field detection device in the direction perpendicular to the adsorption plane is greater than the sum of the initial magnetic field intensity and the first magnetic field intensity threshold, determining that the adsorption position of the stylus pen is to the left of the preset adsorption position; When it is determined that the magnetic field strength of the magnetic field detection device in the direction perpendicular to the adsorption plane is less than the difference between the initial magnetic field strength and the first magnetic field strength threshold, it is determined that the adsorption position of the stylus pen is at a preset adsorption position, and the initial magnetic field strength is the magnetic field strength measured by the magnetic field detection device when the electronic device does not adsorb the stylus pen; The processor is specifically used for: When it is determined that the adsorption position of the stylus pen is on the left side of the preset adsorption position, determining that the stylus pen is offset to the left relative to the preset adsorption position; When it is determined that the adsorption position of the stylus pen is at the preset adsorption position, it is determined that the stylus pen is not offset; When it is determined that the stylus is offset, the processor is further configured to: When it is determined that the wireless charging transmitter Tx chip has overcurrent OCP or overvoltage OVP, the electronic device is controlled to present a first pop-up window, and prompt information is displayed on the first pop-up window, where the prompt information is used to prompt the user to adsorb the stylus to a preset position.

5. The electronic device according to claim 4, characterized in that: When it is determined that the adsorption position of the stylus pen is at a preset adsorption position, the processor is further configured to: Determine the interaction status of the wireless charging coil; When it is determined that the interaction state of the wireless charging coil is normal, the wireless charging coil is controlled to charge the stylus.

6. The electronic device according to claim 5, characterized in that: The processor is further configured to: The electronic device is controlled to present a second pop-up window, and the connection status between the stylus pen and the electronic device and the remaining power of the stylus pen are displayed on the second pop-up window, wherein the connection status includes connection success and connection failure.

7. A stylus adsorption system, characterized in that: An electronic device and a stylus pen comprising any one of claims 4 to 6; The electronic device further comprises a first adsorption magnet and a second adsorption magnet; The stylus pen comprises a third adsorption magnet and a fourth adsorption magnet, the first adsorption magnet is used to attract the third adsorption magnet, and the second adsorption magnet is used to attract the fourth adsorption magnet, so that the stylus pen is adsorbed on the electronic device in a first orientation; or the first adsorption magnet is used to attract the fourth adsorption magnet, and the second adsorption magnet is used to attract the third adsorption magnet, so that the stylus pen is adsorbed on the electronic device in a second orientation; The first orientation is opposite to the second orientation.

Citation Information

Patent Citations

  • Tips and portable devices

    CN110121878B

  • Adsorption detection system of handwriting pen

    CN115543106A