A handwriting pen detection method, system and related device

CN116909430BActive Publication Date: 2026-10-27HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211096904.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-04-15
Filing Date
2022-09-08
Publication Date
2026-10-27
Estimated Expiration
2042-09-08

AI Technical Summary

Technical Problem

[0003]目前,一只主动笔已经不能适应现有的应用场景,特别是大尺寸绘画板、亲子互动、会议讨论等场合

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116909430B_ABST
    Figure CN116909430B_ABST
Patent Text Reader

Abstract

The application provides a handwriting pen detection method, system and related device, which can realize the recognition of the touch positions of multiple handwriting pens on a touch screen by the phase of a TX1 signal with a first frequency emitted by the handwriting pen, or the phase of the TX1 signal with the first frequency emitted by the handwriting pen relative to the phase of a TX2 signal with a second frequency emitted by the handwriting pen, in combination with in-phase quadrature demodulation inside an analog front end of a touch module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, system and related device for detecting a stylus. Background Technology

[0002] With the widespread adoption of mobile devices such as smartphones and tablets, research on device input methods has become increasingly detailed. The explosive growth of large-screen drawing tablets and other similar devices has led to a surge in applications (e.g., drawing software) requiring higher precision touch input. Capacitive styluses offer a high-precision, low-cost, and superior user experience solution based on existing capacitive touchscreen systems. The active capacitive stylus itself acts as a signal transmitter, and the touchscreen uses the signals emitted by the stylus to calculate the stylus's touch coordinates.

[0003] Currently, a single active pen is no longer sufficient for existing applications, especially for large drawing tablets, parent-child interaction, and meeting discussions. The use of multiple pens is becoming increasingly common.

[0004] Therefore, how electronic devices can recognize multiple pens has become a research direction in the industry. Summary of the Invention

[0005] This application provides a stylus detection method, system, and related device, which enables electronic devices to identify the touch positions of multiple styluses on a touch screen by recognizing the phase of the signals emitted by each stylus.

[0006] In a first aspect, this application provides a stylus detection system, comprising: an electronic device, a first stylus, and a second stylus; the first stylus has a first transmitter, the second stylus has a second transmitter, and the electronic device has a touchscreen; wherein the electronic device is configured to transmit a first phase to the first stylus and a second phase to the second stylus; the first stylus is configured to transmit a first signal having a first frequency and a first phase via the first transmitter; the second stylus is configured to transmit a second signal having the first frequency and a second phase via the second transmitter; the electronic device is configured to receive signals having the first frequency at multiple locations on the touchscreen, the signals having the first frequency including the first signal and the second signal; the electronic device is further configured to determine the phase of the signals having the first frequency at the multiple locations; the electronic device is further configured to determine, based on the phase of the signals having the first frequency at the multiple locations, the first phase, and the second phase, a first location on the touchscreen where the first signal is received and a second location where the second signal is received from the multiple locations.

[0007] The stylus detection method provided in this application can recognize the touch positions of multiple styluses on a touch screen by combining the phase of the TX1 signal with a first frequency emitted by the stylus with the in-phase quadrature demodulation inside the analog front end of the touch module.

[0008] In one possible implementation, the touch screen includes a touch sensor, which includes a capacitor in a first direction and a capacitor in a second direction; receiving a signal with the first frequency at multiple locations on the touch screen specifically includes: simultaneously receiving a signal with the first frequency at the multiple locations on the touch screen through the capacitor in the first direction and the capacitor in the second direction.

[0009] The first phase is different from the second phase.

[0010] For example, the first phase can be θ1 and the second phase can be θ2.

[0011] Electronic devices can identify a first location and a second location from multiple locations, including cases 1 and 2 as follows:

[0012] Case 1: When there are two positions, namely the first position and the second position; wherein the first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the fifth phase.

[0013] or,

[0014] The first position and the second position have different coordinates in the first direction but the same coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase;

[0015] The fifth phase is the phase when the first signal and the second signal are superimposed.

[0016] For example, the fifth phase could be θs.

[0017] Case 2: When there are four positions, including the first position and the second position; the coordinates of the first position and the second position are different in the first direction and also different in the second direction; wherein, the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase.

[0018] In one possible implementation, the first stylus further includes a third transmitter; the second stylus further includes a fourth transmitter; the electronic device is further configured to send a third phase to the first stylus and a fourth phase to the second stylus; the first stylus is further configured to transmit a third signal having a second frequency and a third phase via the third transmitter; the second stylus is further configured to transmit a fourth signal having the second frequency and a fourth phase via the fourth transmitter; the electronic device is further configured to receive a signal having the second frequency at the plurality of locations on the touchscreen, wherein the signal having the second frequency... The signal includes the third signal and the fourth signal; the electronic device is further configured to determine the phase of the signal having the second frequency at the plurality of locations; specifically, the electronic device is configured to determine, based on the phase of the signal having the first frequency at the plurality of locations, the phase of the signal having the second frequency at the plurality of locations, the first phase, the second phase, the third phase, and the fourth phase, the first position where the touch screen receives the first signal and the second position where the touch screen receives the second signal from the plurality of locations; wherein, the difference between the first phase and the third phase is not equal to the difference between the second phase and the fourth phase.

[0019] In this way, by comparing the phase of the TX1 signal with the first frequency emitted by the stylus with the phase of the TX2 signal with the second frequency emitted by the stylus, and combining the in-phase quadrature demodulation inside the analog front end of the touch module, the electronic device can recognize the touch positions of multiple styluses on the touch screen.

[0020] The relationship between the first phase, the second phase, the third phase, and the fourth phase can include the following cases:

[0021] 1. The first phase is the same as the second phase, and the third phase is different from the fourth phase.

[0022] 2. The first phase is different from the second phase, and the third phase is the same as the fourth phase.

[0023] 3. The first phase is different from the second phase, and the third phase is different from the fourth phase.

[0024] For example, the first phase can be θ1, the second phase can be θ2, the third phase can be δ1, and the fourth phase can be δ2. The difference between the first phase and the third phase is a fixed value, and the difference between the second phase and the fourth phase is another fixed value. θ1-δ1≠θ2-δ2.

[0025] The situation where an electronic device identifies a first location and a second location from multiple locations can include the following cases 3 and 4:

[0026] Case 3: The multiple positions are actually two positions, namely the first position and the second position. Wherein:

[0027] 3.1 The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction... The phase of the signal having the first frequency is the fifth phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the second direction is the sixth phase; the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase; and the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the second direction is the sixth phase.

[0028] 3.2 The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction is the fifth phase. The phase of the signal having the first frequency is the second phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the first direction is the sixth phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the first direction is the sixth phase; and the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase.

[0029] The fifth phase is the phase when the first signal and the second signal are superimposed, and the sixth phase is the phase when the third signal and the fourth signal are superimposed.

[0030] For example, the fifth phase can be θs, and the sixth phase can be δs. The difference between the fifth and sixth phases is a fixed value.

[0031] Case 4: There are four positions in total, including the first position and the second position. The first position and the second position have different coordinates in the first direction and different coordinates in the second direction. Wherein:

[0032] The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase.

[0033] The phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase.

[0034] In one possible implementation, the first phase includes a seventh phase within a first time period and an eighth phase within a second time period, and the second phase includes a ninth phase within the first time period and a tenth phase within the second time period.

[0035] In this way, the electronic device can recognize the touch positions of multiple styluses on the touch screen by combining the phase of the TX1 signal with the first frequency emitted by the stylus in the first time period and the phase in the second time period with the in-phase quadrature demodulation inside the analog front end of the touch module.

[0036] The relationships between the seventh, eighth, ninth, and tenth phases are as follows:

[0037] 1. The seventh phase is different from the ninth phase, and the eighth phase is the same as the tenth phase.

[0038] 2. The seventh phase is the same as the ninth phase, and the eighth phase is different from the tenth phase.

[0039] 3. The seventh phase is different from the ninth phase, and the eighth phase is different from the tenth phase.

[0040] For example, the seventh phase can be θ11, the eighth phase can be θ12, the ninth phase can be θ21, and the tenth phase can be θ22.

[0041] The situation where an electronic device identifies a first location and a second location from multiple locations can include the following cases 5 and 6:

[0042] Case 5: The multiple positions are actually two positions, namely the first position and the second position; where:

[0043] 5.1 The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the seventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the eleventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the ninth phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction within the first time period is the ninth phase. The phase of the signal having the first frequency is the eleventh phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the twelfth phase.

[0044] 5.2 The coordinates of the first position and the second position are different in the first direction but the coordinates are the same in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction within the first time period is the eleventh phase. The phase of the signal having the first frequency is the ninth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the eighth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the tenth phase;

[0045] The eleventh phase is the phase when the first signal and the second signal are superimposed during the first time period, and the twelfth phase is the phase when the first signal and the second signal are superimposed during the second time period.

[0046] For example, the eleventh phase can be θsa, and the twelfth phase can be θsb.

[0047] Case 6: There are four positions, including the first position and the second position; the first position and the second position have different coordinates in the first direction and different coordinates in the second direction; where,

[0048] The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the first time period is the ninth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction during the first time period is the ninth phase.

[0049] The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the eighth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the tenth phase.

[0050] Secondly, this application provides a stylus detection method applied to an electronic device with a touch screen. The method includes: sending a first phase to a first stylus and sending a second phase to a second stylus; receiving signals with a first frequency at multiple locations on the touch screen, the signals with the first frequency including a first signal sent by the first stylus with the first frequency and a first phase, and a second signal sent by the second stylus with the first frequency and a second phase; determining the phase of the signals with the first frequency at the multiple locations; and determining, based on the phase of the signals with the first frequency at the multiple locations, the first phase, and the second phase, a first location on the touch screen where the first signal is received and a second location where the second signal is received.

[0051] In one possible implementation, the touch screen includes a touch sensor, which includes a capacitor in a first direction and a capacitor in a second direction; receiving a signal with the first frequency at multiple locations on the touch screen specifically includes: simultaneously receiving a signal with the first frequency at the multiple locations on the touch screen through the capacitor in the first direction and the capacitor in the second direction.

[0052] The first phase is different from the second phase.

[0053] For example, the first phase can be θ1 and the second phase can be θ2.

[0054] Electronic devices can identify a first location and a second location from multiple locations, including cases 1 and 2 as follows:

[0055] Case 1: When there are two positions, namely the first position and the second position; wherein the first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the fifth phase.

[0056] or,

[0057] The first position and the second position have different coordinates in the first direction but the same coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase;

[0058] The fifth phase is the phase when the first signal and the second signal are superimposed.

[0059] For example, the fifth phase could be θs.

[0060] Case 2: When there are four positions, including the first position and the second position; the coordinates of the first position and the second position are different in the first direction and also different in the second direction; wherein, the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase.

[0061] In one possible implementation, the first stylus further includes a third transmitter; the second stylus further includes a fourth transmitter; the electronic device is further configured to send a third phase to the first stylus and a fourth phase to the second stylus; the first stylus is further configured to transmit a third signal having a second frequency and a third phase via the third transmitter; the second stylus is further configured to transmit a fourth signal having the second frequency and a fourth phase via the fourth transmitter; the electronic device is further configured to receive a signal having the second frequency at the plurality of locations on the touchscreen, wherein the signal having the second frequency... The signal includes the third signal and the fourth signal; the electronic device is further configured to determine the phase of the signal having the second frequency at the plurality of locations; specifically, the electronic device is configured to determine, based on the phase of the signal having the first frequency at the plurality of locations, the phase of the signal having the second frequency at the plurality of locations, the first phase, the second phase, the third phase, and the fourth phase, the first position where the touch screen receives the first signal and the second position where the touch screen receives the second signal from the plurality of locations; wherein, the difference between the first phase and the third phase is not equal to the difference between the second phase and the fourth phase.

[0062] In this way, by comparing the phase of the TX1 signal with the first frequency emitted by the stylus with the phase of the TX2 signal with the second frequency emitted by the stylus, and combining the in-phase quadrature demodulation inside the analog front end of the touch module, the electronic device can recognize the touch positions of multiple styluses on the touch screen.

[0063] The relationship between the first phase, the second phase, the third phase, and the fourth phase can include the following cases:

[0064] 1. The first phase is the same as the second phase, and the third phase is different from the fourth phase.

[0065] 2. The first phase is different from the second phase, and the third phase is the same as the fourth phase.

[0066] 3. The first phase is different from the second phase, and the third phase is different from the fourth phase.

[0067] For example, the first phase can be θ1, the second phase can be θ2, the third phase can be δ1, and the fourth phase can be δ2. The difference between the first phase and the third phase is a fixed value, and the difference between the second phase and the fourth phase is another fixed value. θ1-δ1≠θ2-δ2.

[0068] The situation where an electronic device identifies a first location and a second location from multiple locations can include the following cases 3 and 4:

[0069] Case 3: The multiple positions are actually two positions, namely the first position and the second position. Wherein:

[0070] 3.1 The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction... The phase of the signal having the first frequency is the fifth phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the second direction is the sixth phase; the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase; and the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the second direction is the sixth phase.

[0071] 3.2 The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction is the fifth phase. The phase of the signal having the first frequency is the second phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the first direction is the sixth phase; the phase of the signal having the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the first direction is the sixth phase; and the phase of the signal having the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase.

[0072] The fifth phase is the phase when the first signal and the second signal are superimposed, and the sixth phase is the phase when the third signal and the fourth signal are superimposed.

[0073] For example, the fifth phase can be θs, and the sixth phase can be δs. The difference between the fifth and sixth phases is a fixed value.

[0074] Case 4: There are four positions in total, including the first position and the second position. The first position and the second position have different coordinates in the first direction and different coordinates in the second direction. Wherein:

[0075] The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase.

[0076] The phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase.

[0077] In one possible implementation, the first phase includes a seventh phase within a first time period and an eighth phase within a second time period, and the second phase includes a ninth phase within the first time period and a tenth phase within the second time period.

[0078] In this way, the electronic device can recognize the touch positions of multiple styluses on the touch screen by combining the phase of the TX1 signal with the first frequency emitted by the stylus in the first time period and the phase in the second time period with the in-phase quadrature demodulation inside the analog front end of the touch module.

[0079] The relationships between the seventh, eighth, ninth, and tenth phases are as follows:

[0080] 1. The seventh phase is different from the ninth phase, and the eighth phase is the same as the tenth phase.

[0081] 2. The seventh phase is the same as the ninth phase, and the eighth phase is different from the tenth phase.

[0082] 3. The seventh phase is different from the ninth phase, and the eighth phase is different from the tenth phase.

[0083] For example, the seventh phase can be θ11, the eighth phase can be θ12, the ninth phase can be θ21, and the tenth phase can be θ22.

[0084] The situation where an electronic device identifies a first location and a second location from multiple locations can include the following cases 5 and 6:

[0085] Case 5: The multiple positions are actually two positions, namely the first position and the second position; where:

[0086] 5.1 The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the seventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the eleventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the ninth phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction within the first time period is the ninth phase. The phase of the signal having the first frequency is the eleventh phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the twelfth phase.

[0087] 5.2 The coordinates of the first position and the second position are different in the first direction but the coordinates are the same in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction within the first time period is the eleventh phase. The phase of the signal having the first frequency is the ninth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the eighth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the tenth phase;

[0088] The eleventh phase is the phase when the first signal and the second signal are superimposed during the first time period, and the twelfth phase is the phase when the first signal and the second signal are superimposed during the second time period.

[0089] For example, the eleventh phase can be θsa, and the twelfth phase can be θsb.

[0090] Case 6: There are four positions, including the first position and the second position; the first position and the second position have different coordinates in the first direction and different coordinates in the second direction; where,

[0091] The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the first time period is the ninth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction during the first time period is the ninth phase.

[0092] The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the eighth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the tenth phase.

[0093] Thirdly, this application provides an electronic device including a touch screen, one or more processors, and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, which includes computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the stylus detection method in any possible implementation of any of the above aspects.

[0094] Fourthly, this application provides a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the stylus detection method in any of the possible implementations of any of the above aspects.

[0095] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to execute the handwriting detection method in any of the possible implementations of any of the above aspects.

[0096] In a sixth aspect, this application provides a chip or chip system for use in an electronic device with a touch screen, including a processing circuit and an interface circuit. The interface circuit is used to receive code instructions and transmit them to the processing circuit, and the processing circuit is used to execute the code instructions to perform the stylus detection method in any of the possible implementations of any of the above aspects. Attached Figure Description

[0097] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0098] Figure 2 A schematic diagram of the hardware structure of a stylus provided in an embodiment of this application;

[0099] Figure 3 This application provides a schematic diagram of the architecture of a communication system.

[0100] Figure 4A A phase diagram of TX1 and TX2 signals emitted by a stylus provided in an embodiment of this application;

[0101] Figure 4B A schematic diagram illustrating the principle of generating a TX1 signal emitted by a stylus, provided in an embodiment of this application;

[0102] Figure 4C A schematic diagram illustrating the principle of TX2 signal generation emitted by a stylus provided in this application embodiment;

[0103] Figure 5 A schematic diagram of an IQ demodulation principle provided in an embodiment of this application;

[0104] Figure 6A A phase diagram of a TX1 signal emitted by multiple styluses provided in an embodiment of this application;

[0105] Figures 6B-6H A schematic diagram illustrating a scenario where multiple styluses are used for touch control on a touchscreen, as provided in an embodiment of this application.

[0106] Figure 7A A phase diagram of TX1 and TX2 signals emitted by multiple styluses provided in an embodiment of this application;

[0107] Figures 7B-7D A schematic diagram illustrating a scenario where multiple styluses are used for touch control on a touchscreen, as provided in an embodiment of this application.

[0108] Figure 8 A phase diagram of a TX1 signal emitted by multiple styluses provided in an embodiment of this application;

[0109] Figure 9A A schematic diagram illustrating the transmission timing of TX1 signals emitted by multiple styluses, provided for an embodiment of this application;

[0110] Figure 9B A schematic diagram illustrating the transmission timing of TX1 signals emitted by multiple styluses, provided for an embodiment of this application;

[0111] Figure 10 This is a flowchart illustrating a stylus detection method provided in an embodiment of this application. Detailed Implementation

[0112] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0113] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0114] Figure 1 A schematic diagram of the hardware structure of the electronic device 100 is shown.

[0115] The following description uses electronic device 100 as an example to illustrate the embodiment. It should be understood that... Figure 1 The electronic device 100 shown is merely an example, and the electronic device 100 may have more than Figure 1 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0116] Electronic device 100 may include: processor 110, memory 120, Bluetooth communication module 130, power supply 140, power management module 150, touch screen 160, etc.

[0117] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0118] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0119] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0120] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0121] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0122] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0123] Memory 120 is coupled to processor 110 and is used to store various software programs and / or sets of instructions. In specific implementations, memory 120 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. Memory 120 may store an operating system, such as uCOS, VxWorks, RTLinux, or other embedded operating systems. Memory 120 may also store communication programs that can be used to communicate with stylus 200 or other devices.

[0124] The Bluetooth communication module 130 can support Bluetooth Low Energy (BLE) protocol communication. Optionally, the Bluetooth communication module 130 can also support classic Bluetooth protocol communication (also known as: basic rate / enhanced data rate (BR / EDR) technology).

[0125] The power supply 140 can be a rechargeable lithium battery or a replaceable standard battery. The power management module 150 may include an adaptive pulse width modulation (PWM) charging circuit compatible with Universal Serial Bus (USB-compatible), a Buck DC-DC converter, an LCD backlight driver circuit, etc. This power management module 150 can provide the power required by the processor 110, memory 120, Bluetooth communication module 130, touch screen 160, etc. of the electronic device 100.

[0126] Touchscreen 160 may include a display screen and a touch sensor. The display screen is used to display images, videos, etc. The display screen includes a display panel. The display panel may be a liquid crystal display (LCD). The display panel may also be manufactured using organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microled, micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc. In some embodiments, electronic device 100 may include one or N displays, where N is a positive integer greater than 1. The touch sensor, also called a "touch panel," is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen.

[0127] The hardware structure of a stylus 200 provided in the embodiments of this application is described below.

[0128] Figure 2 A schematic diagram of the hardware structure of a stylus 200 provided in an embodiment of this application is shown.

[0129] like Figure 2 As shown, the stylus 200 is a capacitive stylus. The stylus 200 may include: a processor 201, a memory 202, a Bluetooth communication module 203, a power supply 204, a power management module 205, a transmitter 206, a transmitter 207, and a pressure sensor 208, etc. Optionally, the stylus 200 may also include a receiver 209.

[0130] The processor 201 can be used to read and execute computer-readable instructions. Specifically, the processor 201 mainly includes a controller, an arithmetic logic unit (ALU), and registers. The controller is primarily responsible for instruction decoding and issuing control signals for the operations corresponding to the instructions. The ALU is primarily responsible for storing register operands and intermediate operation results temporarily stored during instruction execution. Specifically, the hardware architecture of the processor 201 can be an Application-Specific Integrated Circuit (ASIC), MIPS, ARM, or NP architecture, etc.

[0131] In some embodiments, the processor 201 can be used to parse the signals received by the Bluetooth communication module 203 and / or the transmitter 207. The processor 201 can respond according to the parsing results and perform corresponding operations, such as controlling the transmitter 206 and / or the transmitter 207 to transmit signals of a specified frequency and a specified phase, etc.

[0132] Memory 202 is coupled to processor 201 and is used to store various software programs and / or sets of instructions. In specific implementations, memory 202 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. Memory 202 may store an operating system, such as uCOS, VxWorks, RTLinux, or other embedded operating systems. Memory 202 may also store communication programs that can be used to communicate with electronic device 100 or other devices.

[0133] The Bluetooth communication module 203 supports Bluetooth Low Energy (BLE) protocol communication. Optionally, the Bluetooth communication module 203 can also support classic Bluetooth protocol communication (also known as Basic Rate / Enhanced Data Rate (BR / EDR) technology).

[0134] The power supply 204 can be a rechargeable lithium battery or a replaceable standard battery. The power management module 205 may include an adaptive pulse width modulation (PMW) charging circuit compatible with Universal Serial Bus (USB-compatible), a Buck DC-DC converter, etc. This power management module 205 can provide the power required by the processor 201, memory 202, Bluetooth communication module 203, transmitter 206, transmitter 207, pressure sensor 208, and other devices of the stylus 200.

[0135] The transmitter 206 can be used to output signals that can be detected by the touchscreen of the electronic device 100. The transmitter 206 can be positioned at the tip of the stylus 200. When the tip of the stylus 200 approaches the touchscreen of the electronic device 100, the touchscreen can detect the signal emitted by the transmitter 206. The touchscreen chip of the electronic device 100 can determine the position of the stylus tip on the touchscreen based on the signal emitted by the transmitter 206 detected by the touchscreen.

[0136] The pressure sensor 208 can be placed at the tip of the stylus 200, and can be used to receive the pressure felt by the pen tip. The pressure sensor 208 can send the detected pressure data to the processor 201. The processor 201 can control the transmitter 206, Bluetooth communication module 203, or transmitter 207 to send different signals based on the pressure data, thereby instructing the electronic device 100 to display strokes of different thicknesses at the locations where the stylus tip of the stylus 200 passes on the touch screen.

[0137] Transmitter 207 can be used to output signals detectable by the touchscreen of electronic device 100. Transmitter 207 is typically located at the pen ring of stylus 200. The signal emitted by transmitter 207 has a different frequency than the signal emitted by transmitter 206; for example, the frequency of the signal emitted by transmitter 206 may be 176.37 kHz, while the frequency of the signal emitted by transmitter 207 may be 252.46 kHz. When the touchscreen of electronic device 100 simultaneously receives signals from both transmitter 206 and transmitter 207, it can distinguish between the signals emitted by transmitter 206 and transmitter 207 by the frequency of the received signals. Electronic device 100 can use the signal emitted by transmitter 207 to detect the tilt angle and tilt direction of stylus 200.

[0138] Receiver 209 can be used to receive screen uplink signals sent by the electronic device 100 through the touch chip below the touch screen. The stylus 200 can synchronize TX1 and TX2 signals based on the screen uplink signals received by receiver 209. Receiver 209 can be located at the pen ring position of the stylus 200. Optionally, receiver 209 can also be located at other positions on the stylus 200, which is not limited here. In one example, receiver 209 can also be packaged with the transmitter 207 described above into a transceiver.

[0139] The architecture of a communication system 30 provided in the embodiments of this application is described below.

[0140] Figure 3 A schematic diagram of the architecture of a communication system 30 provided in an embodiment of this application is shown.

[0141] like Figure 3 As shown, the communication system 30 may include an electronic device 100 and one or more styluses 200. Each stylus 200 can communicate with the electronic device 100 via its respective Bluetooth communication module 203, transmitter 206, transmitter 207, and receiver 209.

[0142] The Bluetooth communication module 203 of the stylus 200 can communicate with the Bluetooth communication module of the electronic device 100 via the Bluetooth protocol.

[0143] The transmitter 206 of the stylus 200 can send a signal of a first frequency (hereinafter referred to as the TX1 signal). When the tip of the stylus 200 approaches the touchscreen of the electronic device 100, the electronic device 100 can receive the TX1 signal sent by the transmitter 206 of the stylus 200 on the touchscreen. Based on the TX1 signal sent by the transmitter 206, the electronic device 100 can determine the position of the stylus tip on the touchscreen. The transmitter 207 of the stylus 200 can send a signal of a second frequency (hereinafter referred to as the TX2 signal) to the touchscreen of the electronic device 100. Based on the signal strength distribution of the TX2 signal sent by the transmitter 207 of the stylus 200 on the touchscreen, the touchscreen of the electronic device 100 can determine the tilt angle and tilt direction of the stylus 200, thereby enabling the electronic device 100 to simulate different pen strokes, brush strokes, fountain pen strokes, etc. The first frequency and the second frequency are different; that is, the frequency of the TX1 signal is different from the frequency of the TX2 signal. For example, the first frequency can be 176.37KHz, and the second frequency can be 252.49KHz.

[0144] The electronic device 100 can send an uplink signal to the stylus 200 via a touch chip located beneath the touchscreen. Upon receiving the uplink signal via receiver 209, the stylus 200 can synchronize the TX1 and TX2 signals.

[0145] The electronic device 100 and the stylus 200 can complete pairing, registration, allocation of the stylus 200's transmit signal phase, and display of the stylus 200's battery level via Bluetooth communication. The Bluetooth communication can be either classic Bluetooth or Bluetooth Low Energy.

[0146] In a multi-pen touch scheme, time-division sampling can be used to achieve multi-pen touch. While this scheme enables dual-pen and multi-pen touch, it reduces touch accuracy and the reporting rate. For example, if the maximum touch reporting rate of an electronic device is 240Hz, when the device detects the input signal of only one stylus, the reporting rate of that stylus is 240Hz. However, when the device detects the input signals of two styluses, due to time-division sampling, the reporting rate of each stylus decreases from 240Hz to 120Hz. If the number of styluses increases, the reporting rate of each stylus becomes even lower. This negatively impacts the writing performance of the stylus on the touchscreen of the electronic device.

[0147] In another multi-pen touch scheme, multi-encoding technology can be used to achieve multi-pen touch. For example, the signal sent by the stylus can be divided into two segments based on time. One segment can be used to represent the stylus's position on the touchscreen, i.e., the position signal. The other segment can be used to represent the stylus's identifier (ID), i.e., the ID signal. In this way, the touch chip on the electronic device can sense the stylus's touch position and its ID. The ID can also be used to represent the pen's color, tip size, and type (e.g., pencil, ballpoint pen, marker), etc. However, because this method uses a large number of stylus IDs, the touch chip on the electronic device must detect not only the stylus's position signal but also its ID signal. This greatly increases the computational complexity of the touch chip, and the stylus ID signal also takes up a significant amount of time, affecting the stylus's writing performance.

[0148] This application embodiment provides a stylus detection method that uses integrated circuit (IC) sampling technology. It utilizes the phase of the TX1 signal emitted by the stylus 200 at a first frequency, or the phase of the TX1 signal emitted by the stylus 200 relative to the phase of the TX2 signal emitted by the stylus 200 at a second frequency, combined with in-phase / quadrature (IQ) demodulation within the analog frontend (AFE) of the touch module. This enables the electronic device 100 to detect multiple styluses 200, ensuring the performance of the multiple styluses 200 and achieving a high reporting rate and high performance capacitive pen solution for the multiple styluses 200.

[0149] The principle of a stylus detection method provided in the embodiments of this application is described below.

[0150] Figure 4A The diagram shows a phase diagram of the TX1 and TX2 signals of a stylus 200 provided in an embodiment of this application.

[0151] like Figure 4A As shown, the phase of the TX1 signal of the stylus 200 at the starting position can be θ, and the phase of the TX2 signal of the stylus 200 at the starting position can be δ. The frequency of the TX1 signal of the stylus 200 can be f1, and the frequency of the TX2 signal of the stylus 200 can be f2, where f1 and f2 are different.

[0152] In this embodiment of the application, different phases can be set for the TX1 signal and / or TX2 signal of different styluses 200, thereby enabling the electronic device 100 to distinguish the position of the pen tip of different styluses 200 on the touch screen of the electronic device 100 by the phase of the TX1 signal and / or TX2 signal of the styluse 200.

[0153] Figure 4B and Figure 4C The generation principle of TX1 and TX2 signals of a stylus 200 provided in the embodiments of this application is illustrated.

[0154] like Figure 4B , Figure 4C As shown, the stylus 200 can generate TX1 and TX2 signals respectively using two pulse-width modulation (PWM) timers. The PWM timers can output the waveforms of either the TX1 or TX2 signal using the clock (CLK) signal, the value of the time-based period register (TBPRD), the value of the comparator A main register (CMPA), and the value of the comparator B main register (CMPB).

[0155] The TBPRD value controls the frequency f1 of the TX1 signal or the frequency f2 of the TX2 signal, where f1 and f2 are different. The CMPA and CMPB values ​​control the phase of the TX1 or TX2 signal. For example, when the duty cycle is 50%, the sum of the CMPA and CMPB values ​​equals the TBPRD value, and the difference between the CMPA and CMPB values ​​represents the phase of the TX1 or TX2 signal. By adjusting the difference between the CMPA and CMPB values, the phase of the TX1 or TX2 signal can be adjusted.

[0156] Figure 5 This illustrates an IQ demodulation principle provided in an embodiment of this application.

[0157] like Figure 5As shown, the electronic device 100 may include a touch sensor 510, a local oscillator 511, a phase shifter 512, an I-channel processing module 520, a Q-channel processing module 530, an amplitude calculation module 540, and a phase calculation module 550. The touch sensor 510 can be used to acquire pen signals emitted by a stylus and send these signals to the I-channel processing module 520 and the Q-channel processing module 530 respectively. The pen signals emitted by the stylus can be signals emitted from the pen tip or the pen ring. The local oscillator 511 can be used to generate oscillation signals; for example, the oscillation signal can be a cosine signal cos(ωt). c The local oscillator 511 can input the generated oscillation signal to the mixer 521 in the I-channel processing module 520, and after shifting the generated oscillation signal by π / 2 phase through the phase shifter 512, it is input to the mixer 531 in the Q-channel processing module 530.

[0158] The I-channel processing module 520 may include a mixer 521, a low-pass filter (LPF) 522, and an analog-to-digital (AD) sampling module 523. The mixer 521 mixes the pen signal with an oscillation signal generated by a local oscillator to form a first mixed signal, which is then input to the low-pass filter 522. The low-pass filter 522 retains the low-frequency components of the first mixed signal while filtering out the non-low-frequency components, resulting in a first low-pass signal, which is then input to the AD sampling module 523. The AD sampling module 523 converts the first low-pass signal into a first digital signal and samples the I-channel signal from the first digital signal at a certain sampling frequency. The AD sampling module 523 inputs the I-channel signal to the amplitude calculation module 540 and the phase calculation module 550, respectively.

[0159] The Q-channel processing module 530 may include a mixer 531, a low-pass filter 532, and an AD sampling module 533. The mixer 531 mixes the pen signal and the oscillation signal shifted by π / 2 phase by the phase shifter 512 to form a second mixed signal, which is then input to the low-pass filter 532. The low-pass filter 532 retains the low-frequency components of the second mixed signal while filtering out the non-low-frequency components, resulting in a second low-pass signal, which is then input to the AD sampling module 533. The AD sampling module 533 converts the second low-pass signal into a second digital signal and samples the Q-channel signal from the second digital signal at a certain sampling frequency. The AD sampling module 533 inputs the Q-channel signal to the amplitude calculation module 540 and the phase calculation module 550, respectively.

[0160] The amplitude calculation module 540 can determine the amplitude of the output signal based on the I-channel signal and the Q-channel signal.

[0161] For example, the amplitude calculation module 540 can calculate the amplitude of the pen signal using the following formula (1):

[0162]

[0163] In the above formula (1), A is the amplitude of the pen signal, I is the amplitude of the I-channel signal, and Q is the amplitude of the Q-channel signal.

[0164] The phase calculation module 550 can determine the phase of the output signal based on the I-channel signal and the Q-channel signal.

[0165] For example, the phase calculation module 550 can calculate the phase of the pen signal using the following formula (2):

[0166] μ=arctan(I / Q) Formula (2)

[0167] In the above formula (2), μ is the phase of the pen signal, I is the amplitude of the I-channel signal, and Q is the amplitude of the Q-channel signal.

[0168] In the embodiments of this application, the I-channel processing module 520, Q-channel processing module 530, amplitude calculation module 540, and phase calculation module 550 can all be integrated into the touch chip (IC). Optionally, the I-channel processing module 520 and Q-channel processing module 530 can be integrated into the touch chip (IC), while the amplitude calculation module 540 and phase calculation module 550 can be located in other processing devices besides the touch chip. For example, the amplitude calculation module 540 and phase calculation module 550 can be located in an application processor.

[0169] In this embodiment, the phase of the pen signal can be represented by the angle μ, or the phase of the pen signal can be directly represented by the ratio of the amplitude of the I-channel signal to the amplitude of the Q-channel signal (i.e., I / Q). In subsequent embodiments, the phase of the pen signal is exemplarily represented by the angle μ.

[0170] Based on the above IQ demodulation principle, the following describes a handwriting pen detection method provided in the embodiments of this application.

[0171] In this embodiment, the electronic device 100 can pre-assign different phases to the TX1 signals of multiple styluses 200. When the electronic device 100 detects the TX1 signals of multiple styluses 200, the electronic device 100 can distinguish the position of the pen tips of the multiple styluses 200 on the touch screen by the phase of the TX1 signals.

[0172] like Figure 6AAs shown, multiple styluses 200 may include stylus A and stylus B. The phase of the TX1 signal of stylus A can be θ1, and the phase of the TX1 signal of stylus B can be θ2, where θ1 and θ2 are different. To ensure that the TX1 signals of the multiple styluses 200 do not cancel each other out when superimposed, the difference between the phase θ1 of the TX1 signal of stylus A and the phase θ2 of the TX1 signal of stylus B should not be equal to 180° (i.e., π). Therefore, θ1-θ2≠π. The positions of the stylus tip of stylus A and the stylus tip of stylus B on the touchscreen can be diagonally opposite or coaxially aligned.

[0173] When the tip of each stylus 200 touches the touchscreen of the electronic device 100, the TX1 signal of the stylus 200 is detected by the X-axis and Y-axis capacitors on the touchscreen. Therefore, the electronic device 100 can determine the X-axis and Y-axis signal data on the touchscreen when the TX1 signal of the stylus 200 is received. The X-axis signal data includes the X-axis coordinates of the TX1 signal of the stylus 200 on the touchscreen and its phase information. The Y-axis signal data includes the Y-axis coordinates of the stylus tip's emitted signal on the touchscreen and its phase information. The electronic device 100 can determine the X-axis and Y-axis coordinates of the stylus tip's emitted signal on the touchscreen as the position of the stylus tip on the touchscreen.

[0174] Taking multiple styluses 200, including stylus A and stylus B, as an example, the electronic device 100 can simultaneously detect the TX1 signal of stylus A and the TX1 signal of stylus B through the touch screen. The positions of the stylus tip A and the stylus tip B on the touch screen can be diagonally opposite each other.

[0175] like Figure 6BAs shown, the position coordinates of the stylus tip A on the touchscreen are (x1, y2), and the position coordinates of the stylus tip B on the touchscreen are (x2, y1), where x1 and x2 are different, and y1 and y2 are different. Since the position coordinates of the stylus tip A on the touchscreen are (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the linear position of x1 on the X-axis of the touchscreen and at the linear position of y2 on the Y-axis of the touchscreen. Similarly, since the position coordinates of the stylus tip B on the touchscreen are (x2, y1), the electronic device 100 can detect the TX1 signal of stylus B at the linear position of x2 on the X-axis of the touchscreen and at the linear position of y1 on the Y-axis of the touchscreen. Therefore, the electronic device 100 can detect the TX1 signal simultaneously in the X-axis and Y-axis directions at four locations on the touch screen. The coordinates of these four locations are (x1, y1), (x2, y1), (x1, y2), and (x2, y2).

[0176] Since the phase of the TX1 signal of stylus A can be θ1, and the phase of the TX1 signal of stylus B can be θ2, the phases of the TX1 signals at these four positions (x1, y1), (x2, y1), (x1, y2), and (x2, y2) in the X-axis direction and the Y-axis direction are shown in Table 1 below:

[0177] Table 1

[0178] (x1, y1) θ2 θ1 (x2, y1) θ2 θ2 (x1, y2) θ1 θ1 (x2, y2) θ1 θ2

[0179] As shown in Table 1 above, at position (x1, y1), the X-axis signal phase is the same as the TX1 signal phase θ2 of stylus B, and the Y-axis signal phase is the same as the TX1 signal phase θ1 of stylus A. Similarly, at position (x2, y1), both the X-axis and Y-axis signals are the same as the TX1 signal phase θ2 of stylus B. At position (x1, y2), both the X-axis and Y-axis signals are the same as the TX1 signal phase θ1 of stylus A. At position (x2, y2), both the X-axis and Y-axis signals are the same as the TX1 signal phase θ1 of stylus A.

[0180] Therefore, when the electronic device 100 can simultaneously acquire signal data of the pen tip emission signal at four locations on the touch screen in both the X-axis and Y-axis directions:

[0181] 1. Electronic device 100 can determine the position point (i.e., position point (x1, y2)) where the phase of the TX1 signal in both the X-axis and Y-axis directions is θ1 as the position of the pen tip of stylus A on the touch screen.

[0182] 2. Electronic device 100 can determine the position of the stylus tip B on the touch screen as the position point (i.e., position point (x2, y1)) where the phase of the TX1 signal in both the X-axis and Y-axis directions is θ2.

[0183] Taking multiple styluses, including stylus A and stylus B, as an example, the electronic device 100 can simultaneously detect the TX1 signal of stylus A and the TX1 signal of stylus B through the touchscreen. The positions of the stylus tip A and the stylus tip B on the touchscreen can be coaxial (including on the same X-axis or Y-axis). That is, the positions of the stylus tip A and the stylus tip B on the touchscreen have the same X-axis coordinate and different Y-axis coordinates; or, the positions of the stylus tip A and the stylus tip B on the touchscreen have the same Y-axis coordinate and different X-axis coordinates.

[0184] For example, such as Figure 6C As shown, the Y-axis coordinates of the stylus tip A and the stylus tip B on the touchscreen are the same. The coordinates of the stylus tip A on the touchscreen are (x1, y2), and the coordinates of the stylus tip B on the touchscreen are (x2, y2), where x1 and x2 are different. Since the coordinates of the stylus tip A on the touchscreen are (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at both the X-axis coordinate x1 and Y-axis coordinate y2 positions on the touchscreen. Since the tip of stylus B is positioned at (x2, y2) on the touchscreen, electronic device 100 can detect the TX1 signal of stylus B at both the x-axis coordinate (x2) and y-axis coordinate (y2) on the touchscreen. Therefore, electronic device 100 can simultaneously detect the TX1 signal at two points on the touchscreen, one at (x1, y2) and the other at (x2, y2).

[0185] In this context, the phase of the TX1 signal from stylus A is θ1, and the phase of the TX1 signal from stylus B is θ2. The phases of the TX1 signals at these two locations (x1, y2) along the X-axis and Y-axis are shown in Table 2 below.

[0186] Table 2

[0187] (x1, y2) θs (the superposition phase of θ1 and θ2) θ1 (x2, y2) θs (the superposition phase of θ1 and θ2) θ2

[0188] As shown in Table 2 above, the phase of the TX1 signal at position point (x1, y2) in the X-axis direction is the superimposed phase θs of the TX1 signals from stylus A and stylus B (referred to as the superimposed phase θs), and the phase of the TX1 signal in the Y-axis direction is the phase θ1 of the TX1 signal from stylus A. Similarly, the phase of the TX1 signal at position point (x2, y2) in the X-axis direction is the superimposed phase θs, and the phase of the TX1 signal in the Y-axis direction is the phase θ2 of the TX1 signal from stylus B.

[0189] The superposition phase θs of the TX1 signal from stylus A and the TX1 signal from stylus B can be determined by the following formula:

[0190] θs=arctan((IA+IB) / (QA+QB)) Formula (3)

[0191] In the above formula (3), IA is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus A, QA is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus A, IB is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus B, and QB is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus B.

[0192] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously at two locations on the touchscreen in both the X-axis and Y-axis directions, and these two locations have the same X-axis (Y-axis coordinates):

[0193] 1. Electronic device 100 can determine the position of the stylus tip A on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is the superimposed phase θs and the phase of the TX1 signal in the Y-axis direction is θ1.

[0194] 2. Electronic device 100 can determine the position of the stylus tip B on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is the superimposed phase θs and the phase of the TX1 signal in the Y-axis direction is θ2.

[0195] For example, such as Figure 6DAs shown, the positions of the stylus tip A and the stylus tip B on the touchscreen have the same X-axis coordinates. The coordinates of the stylus tip A's position on the touchscreen are (x1, y2), and the coordinates of the stylus tip B's position are (x1, y1), where y1 and y2 are different. Since the stylus tip A's position on the touchscreen is (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at both the X-axis coordinate x1 and Y-axis coordinate y2 positions on the touchscreen. Since the position of the stylus tip B on the touchscreen is at coordinates (x1, y1), the electronic device 100 can detect the TX1 signal of the stylus B at both the x-axis coordinate (x1) and y-axis coordinate (y1) positions on the touchscreen. Therefore, the electronic device 100 can simultaneously detect the TX1 signal at two points on the touchscreen, one at x1 and the other at y1.

[0196] In this context, the phase of the TX1 signal from stylus A is θ1, and the phase of the TX1 signal from stylus B is θ2. The phases of the TX1 signals at these two locations (x1, y1) and (x1, y2) along the X-axis and Y-axis are shown in Table 3 below.

[0197] Table 3

[0198] (x1, y1) θ2 θs (the superposition phase of θ1 and θ2) (x1, y2) θ1 θs (the superposition phase of θ1 and θ2)

[0199] As shown in Table 3 above, the phase of the TX1 signal at position (x1, y1) in the X-axis direction is the phase θ2 of the TX1 signal of stylus B, and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs of the TX1 signals of stylus A and stylus B (abbreviated as superimposed phase θs). At position (x1, y2), the phase of the TX1 signal in the X-axis direction is the phase θ1 of the TX1 signal of stylus A, and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs.

[0200] The superposition phase θs of the TX1 signal of stylus A and the TX1 signal of stylus B can be determined by the above formula (3), which will not be repeated here.

[0201] Therefore, when the electronic device 100 can detect the TX1 signal at two locations on the touchscreen in both the X-axis and Y-axis directions:

[0202] 1. Electronic device 100 can determine the position of the stylus tip A on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is θ1 and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs.

[0203] 2. Electronic device 100 can determine the position of the stylus tip B on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is θ2 and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs.

[0204] In this embodiment, the electronic device 100 simultaneously supports styluses 200 that can be touched on the touchscreen, not limited to two, but also three or more. Taking styluses A, B, and C as an example, the electronic device 100 identifies the position of each stylus tip on the touchscreen by the phase of the TX1 signal of these three styluses. The electronic device 100 can simultaneously detect the TX1 signals of styluses A, B, and C through the touchscreen. The phase of the TX1 signal of styluse A can be θ1, the phase of the TX1 signal of styluse B can be θ2, and the phase of the TX1 signal of styluse C can be θ3, where θ1, θ2, and θ3 are all different. The touch positions of the tips of styluses A, B, and C on the touchscreen can be as follows:

[0205] Scenario 1: The positions of the pen tips of stylus A, stylus B, and stylus C on the touchscreen can all be on different axes. That is, the X-axis coordinates and Y-axis coordinates of the pen tips of stylus A, stylus B, and stylus C on the touchscreen are all different.

[0206] For example, such as Figure 6EAs shown, the coordinates of the tip of stylus A on the touchscreen are (x1, y3), the coordinates of the tip of stylus B on the touchscreen are (x2, y1), and the coordinates of the tip of stylus C on the touchscreen are (x3, y2). Here, x1, x2, and x3 are all different, and y1, y2, and y3 are all different. Since the coordinates of the tip of stylus A on the touchscreen are (x1, y3), the electronic device 100 can detect the TX1 signal of stylus A at the linear position with X-axis coordinate x1 and the linear position with Y-axis coordinate y3 on the touchscreen. Since the coordinates of the stylus tip B on the touchscreen are (x2, y1), the electronic device 100 can detect the TX1 signal of the stylus B at the linear position of x2 on the X-axis and at the linear position of y1 on the Y-axis. Similarly, since the coordinates of the stylus tip C on the touchscreen are (x3, y2), the electronic device 100 can detect the TX1 signal of the stylus C at the linear position of x3 on the X-axis and at the linear position of y2 on the Y-axis. Therefore, the electronic device 100 can detect the TX1 signal simultaneously in the X-axis and Y-axis directions at 9 locations on the touch screen. The coordinates of these 9 locations are (x1, y1), (x1, y2), (x1, y3), (x2, y1), (x2, y2), (x2, y3), (x3, y1), (x3, y2) and (x3, y3).

[0207] Among them, the phase of the TX1 signal of stylus A can be θ1, the phase of the TX1 signal of stylus B can be θ2, and the phase of the TX1 signal of stylus C can be θ3. The phases of the TX1 signal of these 9 position points (x1, y1), (x1, y2), (x1, y3), (x2, y1), (x2, y2), (x2, y3), (x3, y1), (x3, y2), and (x3, y3) in the X-axis direction and the Y-axis direction are shown in Table 4 below:

[0208] Table 4

[0209] (x1, y1) θ2 θ1 (x1, y2) θ3 θ1 (x1, y3) θ1 θ1 (x2, y1) θ2 θ2 (x2, y2) θ3 θ2 (x2, y3) θ1 θ2 (x3, y1) θ2 θ3 (x3, y2) θ3 θ3 (x3, y3) θ1 θ3

[0210] As shown in Table 4 above, the phase of the TX1 signal at position (x1, y1) in the X-axis direction is the same as the phase θ2 of the TX1 signal from stylus B, and the phase of the TX1 signal in the Y-axis direction is the same as the phase θ1 of the TX1 signal from stylus A. The phase of the TX1 signal at position (x1, y2) in the X-axis direction is the same as the phase θ3 of the TX1 signal from stylus C, and the phase of the TX1 signal in the Y-axis direction is the same as the phase θ1 of the TX1 signal from stylus A. The phase of the TX1 signal at position (x1, y3) in the X-axis direction is the same as the phase θ1 of the TX1 signal from stylus A, and the phase of the TX1 signal in the Y-axis direction is also the same as the phase θ1 of the TX1 signal from stylus A. The phase of the TX1 signal at position (x2, y1) in the X-axis direction is the same as the phase θ2 of the TX1 signal from stylus B, and the phase of the TX1 signal in the Y-axis direction is also the same as the phase θ2 of the TX1 signal from stylus B. The phase of the TX1 signal at position (x2, y2) along the X-axis is the same as the phase θ3 of the TX1 signal from stylus C, and along the Y-axis is the same as the phase θ2 of the TX1 signal from stylus B. The phase of the TX1 signal at position (x2, y3) along the X-axis is the same as the phase θ1 of the TX1 signal from stylus A, and along the Y-axis is the same as the phase θ2 of the TX1 signal from stylus B. The phase of the TX1 signal at position (x3, y1) along the X-axis is the same as the phase θ2 of the TX1 signal from stylus B, and along the Y-axis is the same as the phase θ3 of the TX1 signal from stylus C. The phase of the TX1 signal at position (x3, y2) along the X-axis is the same as the phase θ3 of the TX1 signal from stylus C, and along the Y-axis is the same as the phase θ3 of the TX1 signal from stylus C. The phase of the TX1 signal at position point (x3, y3) in the X-axis direction is the phase θ1 of the TX1 signal of stylus A, and the phase of the TX1 signal in the Y-axis direction is the phase θ3 of the TX1 signal of stylus C.

[0211] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously in both the X-axis and Y-axis directions at all 9 locations on the touchscreen:

[0212] 1. Electronic device 100 can determine the position of the stylus tip A on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is θ1 and the phase of the TX1 signal in the Y-axis direction is θ1.

[0213] 2. Electronic device 100 can determine the position of the stylus tip B on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is θ2 and the phase of the TX1 signal in the Y-axis direction is θ2.

[0214] 3. Electronic device 100 can determine the position of the stylus C tip on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is θ3 and the phase of the TX1 signal in the Y-axis direction is θ3.

[0215] Scenario 2: The tips of stylus A and stylus B are coaxial on the touchscreen, while the tip of stylus C is not coaxial with the tip of stylus A, and the tip of stylus C is also not coaxial with the tip of stylus B.

[0216] For example, such as Figure 6F As shown, the coordinates of the tip of stylus A on the touchscreen are (x1, y3), the coordinates of the tip of stylus B on the touchscreen are (x1, y1), and the coordinates of the tip of stylus C on the touchscreen are (x3, y2). Here, x1 and x2 are different, and y1, y2, and y3 are all different. The positions of the tips of stylus A and stylus B on the touchscreen are on the same Y-axis (i.e., the same X-axis coordinates). The positions of the tips of stylus C on the touchscreen are on different axes (i.e., different X-axis and Y-axis coordinates) from those of stylus A and stylus B (i.e., different X-axis and Y-axis coordinates). Specifically, since the coordinates of the tip of stylus A on the touchscreen are (x1, y3), the electronic device 100 can detect the TX1 signal of stylus A at a straight line position with X-axis coordinate x1 and Y-axis coordinate y3 on the touchscreen. Similarly, since the coordinates of the tip of stylus B on the touchscreen are (x1, y1), the electronic device 100 can detect the TX1 signal of stylus B at a straight line position with X-axis coordinate x1 and Y-axis coordinate y1 on the touchscreen. Likewise, since the coordinates of the tip of stylus C on the touchscreen are (x2, y2), the electronic device 100 can detect the TX1 signal of stylus C at a straight line position with X-axis coordinate x2 and Y-axis coordinate y2 on the touchscreen. Therefore, the electronic device 100 can detect the TX1 signal simultaneously in the X-axis and Y-axis directions at 6 locations on the touch screen. The coordinates of these 6 locations are (x1, y1), (x1, y2), (x1, y3), (x2, y1), (x2, y2), and (x2, y3).

[0217] Among them, the phase of the TX1 signal of stylus A can be θ1, the phase of the TX1 signal of stylus B can be θ2, and the phase of the TX1 signal of stylus C can be θ3. The phases of the TX1 signals of these 6 positions (x1, y1), (x1, y2), (x1, y3), (x2, y1), (x2, y2), and (x2, y3) in the X-axis direction and the Y-axis direction are shown in Table 5 below:

[0218] Table 5

[0219] (x1, y1) θ2 θs1 (the superposition phase of θ1 and θ2) (x1, y2) θ3 θs1 (the superposition phase of θ1 and θ2) (x1, y3) θ1 θs1 (the superposition phase of θ1 and θ2) (x2, y1) θ2 θ3 (x2, y2) θ3 θ3 (x2, y3) θ1 θ3

[0220] As shown in Table 5 above, the phase of the TX1 signal at position (x1, y1) in the X-axis direction is the phase θ2 of the TX1 signal from stylus B, and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs1 of the TX1 signals from stylus A and stylus B (abbreviated as superimposed phase θs1). The phase of the TX1 signal at position (x1, y2) in the X-axis direction is the phase θ3 of the TX1 signal from stylus C, and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs1. The phase of the TX1 signal at position (x1, y3) in the X-axis direction is the phase θ1 of the TX1 signal from stylus A, and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs1. The phase of the TX1 signal at position (x2, y1) in the X-axis direction is the phase θ2 of the TX1 signal from stylus B, and the phase of the TX1 signal in the Y-axis direction is the phase θ3 of the TX1 signal from stylus C. The phase of the TX1 signal at position point (x2, y2) in the X-axis direction is the same as the phase θ3 of the TX1 signal from stylus C, and the phase of the TX1 signal in the Y-axis direction is the same as the phase θ3 of the TX1 signal from stylus C. The phase of the TX1 signal at position point (x2, y3) in the X-axis direction is the same as the phase θ1 of the TX1 signal from stylus A, and the phase of the TX1 signal in the Y-axis direction is the same as the phase θ3 of the TX1 signal from stylus C.

[0221] The superposition phase θs1 of the TX1 signal of stylus A and the TX1 signal of stylus B can be determined by the following formula:

[0222] θs1=arctan((IA+IB) / (QA+QB)) Formula (4)

[0223] In the above formula (4), IA is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus A, QA is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus A, IB is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus B, and QB is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus B.

[0224] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously at all six locations on the touchscreen in both the X and Y axes, and the positions of the stylus tip A and the stylus tip B on the touchscreen are coaxial with the Y axis, and the positions of the stylus tip C on the touchscreen are not coaxial with the positions of the stylus tip A and the stylus tip B respectively:

[0225] Electronic device 100 can determine the position of stylus tip A on the touchscreen by identifying the position point where the phase of the TX1 signal in the X-axis direction is θ1 and the phase of the TX1 signal in the Y-axis direction is a superimposed phase θs1. Electronic device 100 can determine the position of stylus tip B on the touchscreen by identifying the position point where the phase of the TX1 signal in the X-axis direction is θ2 and the phase of the TX1 signal in the Y-axis direction is a superimposed phase θs1. Electronic device 100 can determine the position of stylus tip C on the touchscreen by identifying the position point where the phase of the TX1 signal in the X-axis direction is θ3 and the phase of the TX1 signal in the Y-axis direction is θ3.

[0226] Similarly, when the electronic device 100 can detect the TX1 signal simultaneously at all 6 locations on the touchscreen in both the X and Y axes, and the positions of the stylus A tip and the stylus B tip on the touchscreen share the same X-axis:

[0227] Electronic device 100 can determine the position of the stylus tip A on the touchscreen by identifying the point where the phase of the TX1 signal in the X-axis direction is a superimposed phase θs1 and the phase of the TX1 signal in the Y-axis direction is θ1. Electronic device 100 can determine the position of the stylus tip B on the touchscreen by identifying the point where the phase of the TX1 signal in the X-axis direction is a superimposed phase θs1 and the phase of the TX1 signal in the Y-axis direction is θ2. Electronic device 100 can determine the position of the stylus tip C on the touchscreen by identifying the point where the phase of the TX1 signal in the X-axis direction is θ3 and the phase of the TX1 signal in the Y-axis direction is θ3.

[0228] Scenario 3: The position of the tip of stylus A on the touchscreen is the same as the position of the tip of stylus B on the touchscreen, and the position of the tip of stylus A on the touchscreen is the same as the position of the tip of stylus C on the touchscreen, along the same Y-axis.

[0229] For example, such as Figure 6GAs shown, the coordinates of the tip of stylus A on the touchscreen are (x1, y2), the coordinates of the tip of stylus B on the touchscreen are (x1, y1), and the coordinates of the tip of stylus C on the touchscreen are (x2, y2). Here, x1 and x2 are different, and y1 and y2 are different. The positions of the tips of stylus A and stylus B on the touchscreen are on the same Y-axis (i.e., the same X-axis coordinates), and the positions of the tips of stylus A and stylus C on the touchscreen are on the same X-axis (i.e., the same Y-axis coordinates). Specifically, since the coordinates of the tip of stylus A on the touchscreen are (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the linear position of x1 on the X-axis and at the linear position of y2 on the Y-axis of the touchscreen. Similarly, since the coordinates of the tip of stylus B on the touchscreen are (x1, y1), the electronic device 100 can detect the TX1 signal of stylus B at the linear position of x1 on the X-axis and at the linear position of y1 on the Y-axis of the touchscreen. Likewise, since the coordinates of the tip of stylus C on the touchscreen are (x2, y2), the electronic device 100 can detect the TX1 signal of stylus C at the linear position of x2 on the X-axis and at the linear position of y2 on the Y-axis of the touchscreen. Therefore, the electronic device 100 can detect the TX1 signal simultaneously in the X-axis and Y-axis directions at four locations on the touch screen, with the coordinates of these four locations being (x1, y1), (x1, y2), (x2, y1), and (x2, y2).

[0230] The phase of the TX1 signal for stylus A can be θ1, the phase of the TX1 signal for stylus B can be θ2, and the phase of the TX1 signal for stylus C can be θ3. The phases of the TX1 signals at these four locations (x1, y1), (x1, y2), (x2, y1), and (x2, y2) along the X-axis and Y-axis are shown in Table 6 below.

[0231] Table 6

[0232] (x1, y1) θ2 θs1 (the superposition phase of θ1 and θ2) (x1, y2) θs2 (the superposition phase of θ1 and θ3) θs1 (the superposition phase of θ1 and θ2) (x2, y1) θ2 θ3 (x2, y2) θs2 (the superposition phase of θ1 and θ3) θ3

[0233] As shown in Table 6 above, the phase of the TX1 signal at position (x1, y1) is θ2 in the X-axis direction, and the phase of the TX1 signal in the Y-axis direction is θs1, which is the superposition of the TX1 signals from stylus A and stylus B. At position (x1, y2), the phase of the TX1 signal in the X-axis direction is θs2, which is the superposition of the TX1 signals from stylus A and stylus C, and the phase of the TX1 signal in the Y-axis direction is θs1. At position (x2, y1), the phase of the TX1 signal in the X-axis direction is θ2, and the phase of the TX1 signal in the Y-axis direction is θ3. At position (x2, y2), the phase of the TX1 signal in the X-axis direction is θs2, which is the superposition of the TX1 signals from stylus A and stylus C, and the phase of the TX1 signal in the Y-axis direction is θ3.

[0234] The phase θs1 (abbreviated as superposition phase θs1) when the TX1 signal of stylus A and the TX1 signal of stylus B are superimposed can be determined by the above formula (4), which will not be repeated here.

[0235] The phase θs2 (abbreviated as superposition phase θs2) when the TX1 signals of stylus A and C are superimposed can be determined by the following formula:

[0236] θs2=arctan((IA+IC) / (QA+QC)) Formula (5)

[0237] In the above formula (5), IA is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus A, QA is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus A, IC is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus C, and QC is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus C.

[0238] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously at all four locations on the touchscreen in both the X-axis and Y-axis directions:

[0239] 1. Electronic device 100 can determine the position of the pen tip of stylus A on the touch screen by the position point where the phase of the TX1 signal in the X-axis direction is superimposed phase θs2 and the phase of the TX1 signal in the Y-axis direction is superimposed phase θs1.

[0240] 2. Electronic device 100 can determine the position of the stylus tip B on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is θ2 and the phase of TX1 in the Y-axis direction is the superimposed phase θs1.

[0241] 3. Electronic device 100 can determine the position of the stylus tip C on the touch screen by the position point where the phase of the TX1 signal in the X-axis direction is the superimposed phase θs2 and the phase of TX1 in the Y-axis direction is θ3.

[0242] Scenario 4: The tips of stylus A, stylus B, and stylus C are positioned on the same X-axis or Y-axis on the touchscreen.

[0243] For example, such as Figure 6H As shown, the coordinates of the tip of stylus A on the touchscreen are (x1, y1), the coordinates of the tip of stylus B on the touchscreen are (x2, y1), and the coordinates of the tip of stylus C on the touchscreen are (x3, y1), where x1, x2, and x3 are all different. The positions of the tips of stylus A, stylus B, and stylus C on the touchscreen are on the same X-axis (i.e., the Y-axis coordinates are the same). Since the coordinates of the tip of stylus A on the touchscreen are (x1, y1), the electronic device 100 can detect the TX1 signal of stylus A at any straight line position with X-axis coordinate x1 and Y-axis coordinate y1 on the touchscreen. Since the coordinates of the stylus tip B on the touchscreen are (x2, y1), the electronic device 100 can detect the TX1 signal of stylus B at the linear position with X-axis coordinate x2 and the linear position with Y-axis coordinate y1 on the touchscreen. Similarly, since the coordinates of the stylus tip C on the touchscreen are (x3, y1), the electronic device 100 can detect the TX1 signal of stylus C at the linear position with X-axis coordinate x3 and the linear position with Y-axis coordinate y1 on the touchscreen. Therefore, the electronic device 100 can simultaneously detect the TX1 signal at three points on the touchscreen, in both the X-axis and Y-axis directions. The coordinates of these three points are (x1, y1), (x2, y1), and (x3, y1), respectively.

[0244] The phase of the TX1 signal for stylus A can be θ1, the phase of the TX1 signal for stylus B can be θ2, and the phase of the TX1 signal for stylus C can be θ3. The phases of the TX1 signals at these three locations (x1, y1), (x2, y1), and (x3, y1) along the X-axis and Y-axis are shown in Table 7 below.

[0245] Table 7

[0246] (x1, y1) θs3 (the superposition phase of θ1, θ2 and θ3) θ1 (x2, y1) θs3 (the superposition phase of θ1, θ2 and θ3) θ2 (x3, y1) θs3 (the superposition phase of θ1, θ2 and θ3) θ3

[0247] As shown in Table 7 above, the phase of the TX1 signal at position (x1, y1) in the X-axis direction is the superposition phase θs3 of the TX1 signals from stylus A, stylus B, and stylus C (abbreviated as superposition phase θs3), and the phase of the TX1 signal in the Y-axis direction is θ1. The phase of the TX1 signal at position (x2, y1) in the X-axis direction is θs3, and the phase of the TX1 signal in the Y-axis direction is θ2. The phase of the TX1 signal at position (x3, y1) in the X-axis direction is θs3, and the phase of the TX1 signal in the Y-axis direction is θ3.

[0248] The superposition phase θs3 of the TX1 signals of stylus A, stylus B, and stylus C can be determined by the following formula:

[0249] θs3=arctan((IA+IB+IC) / (QA+QB+QC)) Formula (6)

[0250] In the above formula (6), IA is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus A, QA is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus A, IB is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus B, QB is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus B, IC is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus C, and QC is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus C.

[0251] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously at three locations on the touchscreen in both the X-axis and Y-axis directions, and the three locations are on the same X-axis (i.e., the same Y-axis coordinate):

[0252] 1. Electronic device 100 can determine the position of the stylus tip A on the touch screen by the position point where the phase of the TX1 signal in the X-axis direction is superimposed phase θs3 and the phase of the TX1 signal in the Y-axis direction is θ1.

[0253] 2. Electronic device 100 can determine the position of the stylus tip B on the touch screen by the position point where the phase of the TX1 signal in the X-axis direction is the superimposed phase θs3 and the phase of the TX1 signal in the Y-axis direction is θ2.

[0254] 3. Electronic device 100 can determine the position of the stylus tip C on the touch screen as the position point where the phase of the TX1 signal in the X-axis direction is the superimposed phase θs3 and the phase of the TX1 signal in the Y-axis direction is θ3.

[0255] Similarly, if the electronic device 100 can detect the TX1 signal simultaneously at three locations on the touchscreen in both the X and Y axes, and the three locations are aligned on the same Y axis (i.e., their X-axis coordinates are the same):

[0256] 1. Electronic device 100 can determine the position of the stylus tip A on the touch screen by taking the phase of the TX1 signal as θ1 in the X-axis direction and the phase of the TX1 signal as the superimposed phase θs3 in the Y-axis direction.

[0257] 2. Electronic device 100 can determine the position of the stylus tip B on the touch screen by the position point where the phase of the TX1 signal in the X-axis direction is θ2 and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs3.

[0258] 3. Electronic device 100 can determine the position of the stylus tip C on the touch screen by the position point where the phase of the TX1 signal in the X-axis direction is θ3 and the phase of the TX1 signal in the Y-axis direction is the superimposed phase θs3.

[0259] Based on the above IQ demodulation principle, another embodiment of this application provides a handwriting pen detection method.

[0260] In this embodiment, the electronic device 100 can pre-assign phases to the TX1 and TX2 signals of multiple styluses 200. The phase difference between the TX1 and TX2 signals of different styluses 200 is different. When the electronic device 100 detects the TX1 and TX2 signals of the multiple styluses 200, it can distinguish the position of the stylus tips on the touchscreen based on the phase difference between the TX1 and TX2 signals.

[0261] like Figure 7A As shown, the multiple styluses 200 may include stylus A and stylus B. The phase of the TX1 signal of stylus A can be θ1, the phase of the TX2 signal of stylus A can be δ1, the phase of the TX1 signal of stylus B can be θ1, and the phase of the TX2 signal of stylus B can be δ2. The positions of the stylus tip of stylus A and the stylus tip of stylus B on the touchscreen can be diagonally or coaxially positioned.

[0262] The phases θ1 and δ1 of the TX1 signal of stylus A, and the phases θ2 and δ2 of the TX1 and TX2 signals of stylus B can satisfy the following relationship:

[0263] θ1-δ1=α Formula (7)

[0264] θ²-δ²=β Formula (8)

[0265] α≠β formula (9)

[0266] θ1-θ2≠π formula (10)

[0267] In this case, the TX1 signals of stylus A and stylus B cannot cancel each other out. Therefore, the difference between the phase θ1 of the TX1 signal of stylus A and the phase θ2 of the TX1 signal of stylus B must not be equal to π. Similarly, the TX2 signals of stylus A and stylus B cannot cancel each other out. Therefore, the difference between the phase δ1 of the TX2 signal of stylus A and the phase δ2 of the TX2 signal of stylus B must not be equal to π.

[0268] In one possible implementation, under the premise of satisfying the above formulas (7), (8), (9) and (10), in order to facilitate the allocation of phases to multiple styluses 200, the phase of the TX1 signal of styluse A and the phase of the TX1 signal of styluse B can be set to be the same, but the phase of the TX1 signal of styluse A and the phase of the TX1 signal of styluse B can be set to be different, that is, θ1=θ2 and δ1≠δ2.

[0269] In one possible implementation, under the premise of satisfying the above formulas (7), (8), (9) and (10), in order to facilitate the allocation of phases to multiple styluses 200, the phase of the TX1 signal of styluse A and the phase of the TX1 signal of styluse B can be set to be different, but the phase of the TX1 signal of styluse A and the phase of the TX1 signal of styluse B can be set to be the same, that is, θ1≠θ2 and δ1=δ2.

[0270] When the tip of each stylus touches the touchscreen of the electronic device 100, the TX1 signal of the stylus 200 is detected by the X-axis and Y-axis capacitors on the touchscreen. Therefore, the electronic device 100 can determine the X-axis and Y-axis signal data on the touchscreen when the TX1 signal of the stylus 200 is received. Similarly, when each stylus approaches the touchscreen of the electronic device 100, the TX2 signal of the stylus 200 is detected by the X-axis and Y-axis capacitors on the touchscreen. Therefore, the electronic device 100 can determine the X-axis and Y-axis signal data on the touchscreen when the TX2 signal of the stylus 200 is received. The TX1 and TX2 signals have different frequencies. The X-axis signal data includes the X-axis coordinates and phase of the stylus 200's TX1 signal on the touchscreen, as well as the X-axis coordinates and phase of the stylus 200's TX1 signal on the touchscreen. The Y-axis signal data includes the Y-axis coordinates and phase of the stylus 200's TX1 signal on the touchscreen, as well as the Y-axis coordinates and phase of the stylus 200's TX2 signal on the touchscreen.

[0271] Taking multiple styluses 200, including stylus A and stylus B, as an example, the electronic device 100 can simultaneously detect the TX1 and TX2 signals of stylus A, as well as the TX1 and TX2 signals of stylus B, through a touchscreen. The positions of the stylus tip A and the stylus tip B on the touchscreen can be diagonally opposite each other.

[0272] For example, such as Figure 7BAs shown, the position of the stylus tip A on the touchscreen is at coordinates (x1, y2), and the position of the stylus tip B on the touchscreen is at coordinates (x2, y1), where x1 and x2 are different, and y1 and y2 are different. Since the position of the stylus tip A on the touchscreen is at coordinates (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the straight line position with X-axis coordinate x1 and the straight line position with Y-axis coordinate y2 on the touchscreen. Similarly, since the position of the stylus tip B on the touchscreen is at coordinates (x2, y1), the electronic device 100 can detect the TX1 signal of stylus B at the straight line position with X-axis coordinate x2 and the straight line position with Y-axis coordinate y1 on the touchscreen. Because the projection of the TX2 signal of stylus A onto the touchscreen is a circle or ellipse within the coordinate region (x1a~x1b, y2a~y2b), the electronic device 100 can detect the TX2 signal of stylus A at positions in the X-axis coordinate range x1a~x1b and the Y-axis coordinate range y2a~y2b on the touchscreen. Similarly, because the projection of the TX2 signal of stylus B onto the touchscreen is a circle or ellipse within the coordinate region (x2a~x2b, y1a~y1b), the electronic device 100 can detect the TX2 signal of stylus B at positions in the X-axis coordinate range x2a~x2b and the Y-axis coordinate range y1a~y1b on the touchscreen. Where x1a≤x1≤x1b, x2a≤x2≤x2b, y1a≤y1≤y1b, y2a≤y2≤y2b.

[0273] Therefore, the electronic device 100 can simultaneously detect the TX1 signal in both the X and Y axes at four locations on the touchscreen, with coordinates (x1, y1), (x2, y1), (x1, y2), and (x2, y2), respectively. The electronic device 100 can also simultaneously detect the TX2 signal in both the X and Y axes in four regions on the touchscreen, namely (x1a~x1b, y1a~y1b), (x2a~x2b, y1a~y1b), (x1a~x1b, y2a~y2b), and (x2a~x2b, y2a~y2b), respectively.

[0274] Since the phase of the TX1 signal of stylus A can be θ1, the phase of the TX2 signal of stylus A is δ1, the phase of the TX1 signal of stylus B can be θ1, and the phase of the TX2 signal of stylus B can be δ2, the phases of the TX1 and TX2 signals at these four positions (x1, y1), (x2, y1), (x1, y2), and (x2, y2) are shown in Table 8 below.

[0275] Table 8

[0276]

[0277] As shown in Table 8 above, for the location point (x1, y1), the phase of the TX1 signal is θ2 in the X-axis direction and θ1 in the Y-axis direction. The phase of the TX2 signal is δ2 in the X-axis direction and δ1 in the Y-axis direction. Similarly, for the location point (x2, y1), the phase of the TX1 signal is θ2 in the X-axis direction and θ2 in the Y-axis direction. The phase of the TX2 signal is δ2 in both directions. Finally, for the location point (x1, y2), the phase of the TX1 signal is θ1 in the X-axis direction and θ1 in the Y-axis direction. The phase of the TX2 signal is δ1 in both directions. At position point (x2, y2), the phase of the TX1 signal in the X-axis direction is θ1, the phase of the TX1 signal in the Y-axis direction is θ2, the phase of the TX2 signal in the X-axis direction is δ1, and the phase of the TX2 signal in the Y-axis direction is δ2.

[0278] Therefore, when the electronic device 100 can detect both TX1 and TX2 signals simultaneously at four locations on the touchscreen in both the X and Y axes:

[0279] 1. Electronic device 100 can determine the position point (x1, y2) of the stylus tip of pen A on the touch screen as the position point (i.e., position point (x1, y2)) where the phase difference between the TX1 signal and the TX2 signal in the X-axis direction is α (the difference between θ1 and δ1) and the phase difference between the TX1 signal and the TX2 signal in the Y-axis direction is α (the difference between θ1 and δ1).

[0280] 2. The electronic device 100 can determine the position of the stylus tip of the stylus B on the touch screen as the position point (i.e., position point (x2, y1)) where the phase difference between the TX1 signal and the TX2 signal in the X-axis direction is β (the difference between θ2 and δ2) and the phase difference between the TX1 signal and the TX2 signal in the Y-axis direction is β (the difference between θ2 and δ2).

[0281] Taking multiple styluses 200, including stylus A and stylus B, as an example, the electronic device 100 can simultaneously detect the TX1 and TX2 signals of stylus A and stylus B via a touchscreen. The positions of the stylus tip A and stylus tip B on the touchscreen can be coaxial (including on the same X-axis or Y-axis). That is, the positions of the stylus tip A and stylus tip B on the touchscreen have the same X-axis coordinates but different Y-axis coordinates; or, the positions of the stylus tip A and stylus tip B on the touchscreen have the same Y-axis coordinates but different X-axis coordinates.

[0282] For example, such as Figure 7C As shown, the Y-axis coordinates of the stylus tip A and the stylus tip B on the touchscreen are the same. The coordinates of the stylus tip A on the touchscreen are (x1, y2), and the coordinates of the stylus tip B on the touchscreen are (x2, y2), where x1 and x2 are different. Since the coordinates of the stylus tip A on the touchscreen are (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the linear position with X-axis coordinate x1 on the touchscreen, and at the linear position with Y-axis coordinate y2 on the touchscreen. Since the coordinates of the tip of stylus B on the touchscreen are (x2, y2), electronic device 100 can detect the TX1 signal of stylus B at the straight line position with X-axis coordinate x2 and the straight line position with Y-axis coordinate y2 on the touchscreen. Since the projection of the TX2 signal of stylus A on the touchscreen is a circle or ellipse in the coordinate region (x1a~x1b, y2a~y2b), electronic device 100 can detect the TX2 signal of stylus A at the position with X-axis coordinate interval x1a~x1b and the position with Y-axis coordinate interval y2a~y2b on the touchscreen. Since the projection of the TX2 signal of stylus B onto the touchscreen is a circle or ellipse within the coordinate region (x2a~x2b, y2a~y2b), the electronic device 100 can detect the TX2 signal of stylus B at positions on the touchscreen with X-axis coordinates of x2a~x2b and Y-axis coordinates of y2a~y2b. Where x1a≤x1≤x1b, x2a≤x2≤x2b, and y2a≤y2≤y2b.

[0283] Therefore, the electronic device 100 can simultaneously detect the TX1 signal in both the X-axis and Y-axis directions at two locations on the touchscreen, with coordinates (x1, y2) and (x2, y2) respectively. The electronic device 100 can also simultaneously detect the TX2 signal in both the X-axis and Y-axis directions in two regions on the touchscreen, with regions being (x1a~x1b, y2a~y2b) and (x2a~x2b, y2a~y2b) respectively.

[0284] Since the phase of the TX1 signal of stylus A can be θ1, and the phase of the TX2 signal of stylus A is δ1, the phase of the TX1 signal of stylus B can be θ1, and the phase of the TX2 signal of stylus B can be δ2. The phases of the TX1 and TX2 signals at these two positions (x1, y2) and (x2, y2) are shown in Table 9 below.

[0285] Table 9

[0286]

[0287] As shown in Table 9 above, the phase of the TX1 signal at position point (x1, y2) in the X-axis direction is θs, which is the superposition phase of the TX1 signals from stylus A and stylus B. The phase of the TX1 signal in the Y-axis direction is θ1. The phase of the TX2 signal in the X-axis direction is δs, which is the superposition phase of the TX2 signals from stylus A and stylus B. The phase of the TX2 signal in the Y-axis direction is δ1. For position point (x2, y2), the phase of the TX1 signal in the X-axis direction is θs, the phase of the TX1 signal in the Y-axis direction is θ2, the phase of the TX2 signal in the X-axis direction is δs, and the phase of the TX2 signal in the Y-axis direction is δ2.

[0288] The superposition phase θs of the TX1 signal of stylus A and the TX1 signal of stylus B can be determined by the above formula (3), which will not be repeated here.

[0289] The superposition phase δs of the TX2 signal of stylus A and the TX2 signal of stylus B can be determined by the following formula (11):

[0290] δs=arctan((ia+ib) / (qa+qb)) Formula (11)

[0291] In the above formula (11), ia is the amplitude of the I-channel signal demodulated from the TX2 signal of stylus A, qa is the amplitude of the Q-channel signal demodulated from the TX2 signal of stylus A, ib is the amplitude of the I-channel signal demodulated from the TX2 signal of stylus B, and qb is the amplitude of the Q-channel signal demodulated from the TX2 signal of stylus B.

[0292] Therefore, when the electronic device 100 can detect TX1 and TX2 signals simultaneously at two locations on the touchscreen in the X-axis and Y-axis directions, and these two locations are on the same X-axis (Y-axis coordinates):

[0293] 1. Electronic device 100 can determine the position of the pen tip of stylus A on the touch screen as the position point (i.e., position point (x1, y2)) where the phase difference between the TX1 signal and the TX2 signal in the X-axis direction is θs-δs and the phase difference between the TX1 signal and the TX2 signal in the Y-axis direction is α (the difference between θ1 and δ1).

[0294] 2. The electronic device 100 can determine the position of the stylus tip of the stylus B on the touch screen as the position point (i.e., position point (x2, y1)) where the phase difference between the TX1 signal and the TX2 signal in the X-axis direction is θs-δs and the phase difference between the TX1 signal and the TX2 signal in the Y-axis direction is β (the difference between θ2 and δ2).

[0295] For example, such as Figure 7DAs shown, the position of the tip of stylus A on the touchscreen is the same as the position of the tip of stylus B on the touchscreen along the Y-axis (i.e., the same X-axis coordinate). The coordinates of the tip of stylus A on the touchscreen are (x1, y2), and the coordinates of the tip of stylus B on the touchscreen are (x1, y1), where y1 and y2 are different. Since the coordinates of the tip of stylus A on the touchscreen are (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the linear position with X-axis coordinate x1 on the touchscreen, and at the linear position with Y-axis coordinate y2 on the touchscreen. Since the coordinates of the tip of stylus B on the touchscreen are (x1, y1), electronic device 100 can detect the TX1 signal of stylus B at any straight line position with X-axis coordinate x1 and Y-axis coordinate y1 on the touchscreen. Since the projection of the TX2 signal of stylus A on the touchscreen is a circle or ellipse within the coordinate region (x1a~x1b, y2a~y2b), electronic device 100 can detect the TX2 signal of stylus A at any position with X-axis coordinate range x1a~x1b and Y-axis coordinate range y2a~y2b on the touchscreen. Since the projection of the TX2 signal of stylus B onto the touchscreen is a circle or ellipse within the coordinate region (x1a~x1b, y1a~y1b), the electronic device 100 can detect the TX2 signal of stylus B at positions on the touchscreen with X-axis coordinates of x1a~x1b and Y-axis coordinates of y1a~y1b. Where x1a≤x1≤x1b, y1a≤y1≤y2b, and y2a≤y2≤y2b.

[0296] Therefore, the electronic device 100 can simultaneously detect the TX1 signal in both the X-axis and Y-axis directions at two locations on the touchscreen, with coordinates (x1, y2) and (x1, y1) respectively. The electronic device 100 can also simultaneously detect the TX2 signal in both the X-axis and Y-axis directions in two regions on the touchscreen, with regions being (x1a~x1b, y2a~y2b) and (x1a~x1b, y1a~y1b) respectively.

[0297] Since the phase of the TX1 signal of stylus A can be θ1, and the phase of the TX2 signal of stylus A is δ1, the phase of the TX1 signal of stylus B can be θ1, and the phase of the TX2 signal of stylus B can be δ2. The phases of the TX1 and TX2 signals at these two positions (x1, y1) and (x1, y2) are shown in Table 10 below.

[0298] Table 10

[0299]

[0300] As shown in Table 10 above, for the position point (x1, y1), the phase of the TX1 signal in the X-axis direction is θ2, and the phase of the TX1 signal in the Y-axis direction is θs. For the position point (x1, y2), the phase of the TX1 signal in the X-axis direction is θ1, and the phase of the TX1 signal in the Y-axis direction is θs. For the position point (x1, y2), the phase of the TX1 signal in the X-axis direction is δ1, and the phase of the TX2 signal in the Y-axis direction is δs.

[0301] The superposition phase θs of the TX1 signal of stylus A and the TX1 signal of stylus B can be determined by the above formula (3). The superposition phase δs of the TX2 signal of stylus A and the TX2 signal of stylus B can be determined by the above formula (11).

[0302] Therefore, when the electronic device 100 can detect TX1 and TX2 signals simultaneously at two locations on the touchscreen in both the X and Y axes, and these two locations are on the same Y axis (same X-axis coordinate):

[0303] 1. Electronic device 100 can determine the position of the pen tip of stylus A on the touch screen as the position point (i.e., position point (x1, y2)) where the phase difference between the TX1 signal and the TX2 signal in the X-axis direction is α (the difference between θ1 and δ1) and the phase difference between the TX1 signal and the TX2 signal in the Y-axis direction is θs-δs.

[0304] 2. The electronic device 100 can determine the position of the stylus tip of the stylus B on the touch screen as the position point (i.e., position point (x1, y1)) where the phase difference between the TX1 signal and the TX2 signal in the X-axis direction is β (the difference between θ2 and δ2) and the phase difference between the TX1 signal and the TX2 signal in the Y-axis direction is θs-δs.

[0305] In this embodiment of the application, the electronic device 100 simultaneously supports two styluses that can be used on the touch screen, which is not limited to two but can also be three, four or more.

[0306] Based on the above IQ demodulation principle, another embodiment of this application provides a handwriting pen detection method.

[0307] In this embodiment, the stylus 200 can periodically transmit pen tip emission signals. A transmission cycle of the pen tip emission signal can include multiple sub-cycles. The electronic device 100 can assign phases of the TX1 signal to each stylus 200 within the multiple sub-cycles of a transmission cycle. The phase combinations of the TX1 signals of different styluses 200 within the multiple sub-cycles of a transmission cycle are different. When the electronic device 100 detects the TX1 signals of multiple styluses 200, it can distinguish the positions of the pen tips of the multiple styluses 200 on the touchscreen by the phase combinations of the TX1 signals within the multiple sub-cycles of a transmission cycle.

[0308] like Figure 8 As shown, the multiple styluses 200 may include stylus A and stylus B. The transmission period of the TX1 signal may include two sub-cycles (e.g., sub-cycle 1 and sub-cycle 2). The phase of the TX1 signal of stylus A in sub-cycle 1 may be θ11, and the phase in sub-cycle 2 may be θ12. The phase of the TX1 signal of stylus B in sub-cycle 1 may be θ21, and the phase in sub-cycle 2 may be θ22. Wherein, θ11 is different from θ21 and θ12 is different from θ22, or θ11 is the same as θ21 and θ12 is different from θ22, or θ11 is different from θ21 and θ12 is the same as θ22. To ensure that the TX1 signals from multiple styluses 200 do not cancel each other out when superimposed, the phase difference between the TX1 signal of stylus A and the TX1 signal of stylus B should not be equal to 180° (i.e., π). Therefore, θ11-θ21≠π and θ12-θ22≠π. The positions of the stylus tip A and the stylus tip B on the touchscreen can be diagonally opposite or coaxially aligned.

[0309] When the tip of each stylus 200 touches the touchscreen of the electronic device 100, the TX1 signal of the stylus 200 is detected by the X-axis and Y-axis capacitors on the touchscreen. Therefore, the electronic device 100 can determine the X-axis and Y-axis signal data on the touchscreen when the TX1 signal of the stylus 200 is received. The X-axis signal data includes the X-axis coordinates and phase of the TX1 signal of the stylus 200 on the touchscreen. The Y-axis signal data includes the Y-axis coordinates and phase of the TX1 signal emitted by the stylus 200 on the touchscreen.

[0310] Taking multiple styluses 200, including stylus A and stylus B, as an example, the electronic device 100 can simultaneously detect the TX1 signal of stylus A and stylus B through the touch screen. The positions of the stylus tip A and the stylus tip B on the touch screen can be diagonally opposite each other.

[0311] For example, as described above Figure 6B As shown, the position of the stylus tip A on the touchscreen is at coordinates (x1, y2), and the position of the stylus tip B on the touchscreen is at coordinates (x2, y1), where x1 and x2 are different, and y1 and y2 are different. Since the position of the stylus tip A on the touchscreen is (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the linear position of x1 on the X-axis and at the linear position of y2 on the Y-axis of the touchscreen. Similarly, since the position of the stylus tip B on the touchscreen is (x2, y1), the electronic device 100 can detect the TX1 signal of stylus B at the linear position of x2 on the X-axis and at the linear position of y1 on the Y-axis of the touchscreen. Therefore, the electronic device 100 can detect the TX1 signal simultaneously in the X-axis and Y-axis directions at four locations on the touch screen. The coordinates of these four locations are (x1, y1), (x2, y1), (x1, y2), and (x2, y2).

[0312] Specifically, the phase of the TX1 signal of stylus A is θ11 in sub-cycle 1 and θ12 in sub-cycle 2. The phase of the TX1 signal of stylus B is θ21 in sub-cycle 1 and θ22 in sub-cycle 2. Therefore, the phases of the TX1 signals in the X-axis direction and the Y-axis direction for these four position points (x1, y1), (x2, y1), (x1, y2), and (x2, y2) within the two sub-cycles are shown in Table 11 below:

[0313] Table 11

[0314]

[0315] As shown in Table 11 above, for position point (x1, y1), the phase of the TX1 signal in the X-axis direction within sub-period 1 is θ21, and the phase of the TX1 signal in the Y-axis direction is θ11. For sub-period 2, the phase of the TX1 signal in the X-axis direction is θ22, and the phase of the TX1 signal in the Y-axis direction is θ12. For position point (x2, y1), the phase of the TX1 signal in the X-axis direction within sub-period 1 is θ21, and the phase of the TX1 signal in the Y-axis direction is θ21. For sub-period 2, the phase of the TX1 signal in the X-axis direction is θ12, and the phase of the TX1 signal in the Y-axis direction is θ12. For position point (x1, y2), the phase of the TX1 signal in the X-axis direction within sub-period 1 is θ11, and the phase of the TX1 signal in the Y-axis direction is θ11. For sub-period 2, the phase of the TX1 signal in the X-axis direction is θ12, and the phase of the TX1 signal in the Y-axis direction is θ12. At position point (x2, y2), the phase of the TX1 signal in the X-axis direction within sub-period 1 is θ11, and the phase of the TX1 signal in the Y-axis direction is θ21. In sub-period 2, the phase of the TX1 signal in the X-axis direction is θ12, and the phase of the TX1 signal in the Y-axis direction is θ22.

[0316] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously at all four locations on the touchscreen in both the X-axis and Y-axis directions:

[0317] 1. Electronic device 100 can determine the position of the stylus tip of pen A on the touch screen as the position point (i.e., position point (x1, y2)) where the phase of the TX1 signal in the X-axis direction and the phase of the TX1 signal in the Y-axis direction are both θ11 in sub-period 1 and the phase of the TX1 signal in the X-axis direction and the phase of the TX1 signal in the Y-axis direction are both θ11 in sub-period 2.

[0318] 2. The electronic device 100 can determine the position of the stylus tip of the stylus B on the touch screen as the position point (i.e., position point (x2, y1)) where the phase of the TX1 signal in the X-axis direction and the phase of the TX1 signal in the Y-axis direction are both θ21 in sub-period 1 and the phase of the TX1 signal in the X-axis direction and the phase of the TX1 signal in the Y-axis direction are both θ22 in sub-period 2.

[0319] Taking multiple styluses, including stylus A and stylus B, as an example, the electronic device 100 can simultaneously detect the TX1 signal of stylus A and the TX1 signal of stylus B through the touchscreen. The positions of the stylus tip A and the stylus tip B on the touchscreen can be coaxial (including the same X-axis or the same Y-axis). That is, the positions of the stylus tip A and the stylus tip B on the touchscreen have the same X-axis coordinate and different Y-axis coordinates; or, the positions of the stylus tip A and the stylus tip B on the touchscreen have the same Y-axis coordinate and different X-axis coordinates.

[0320] For example, as described above Figure 6C As shown, the Y-axis coordinates of the stylus tip A and the stylus tip B on the touchscreen are the same. The coordinates of the stylus tip A on the touchscreen are (x1, y2), and the coordinates of the stylus tip B on the touchscreen are (x2, y2), where x1 and x2 are different. Since the coordinates of the stylus tip A on the touchscreen are (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the linear position with X-axis coordinate x1 on the touchscreen, and at the linear position with Y-axis coordinate y2 on the touchscreen. Since the position of the stylus tip B on the touchscreen is at coordinates (x2, y2), the electronic device 100 can detect the TX1 signal of the stylus B at both the x-axis coordinate (x2) and y-axis coordinate (y2) of the touchscreen. Therefore, the electronic device 100 can simultaneously detect the TX1 signal at two points on the touchscreen, one at x1 and the other at y2.

[0321] Specifically, the TX1 signal of stylus A has a phase of θ11 in sub-period 1 and a phase of θ12 in sub-period 2. The TX1 signal of stylus B has a phase of θ21 in sub-period 1 and a phase of θ22 in sub-period 2. Therefore, the phases of the TX1 signals in the X-axis direction and the Y-axis direction for these two position points (x1, y2) and (x2, y2) within the two sub-periods are shown in Table 12 below:

[0322] Table 12

[0323]

[0324] As shown in Table 12 above, for position point (x1, y2), the X-axis signal phase within sub-period 1 is the superposition phase θsa of phases θ11 and θ21, and the Y-axis signal phase is θ11. Within sub-period 2, the X-axis signal phase is the superposition phase θsb of phases θ12 and θ22, and the Y-axis signal phase is θ12. Similarly, for position point (x2, y2), the X-axis signal phase within sub-period 1 is the superposition phase θsa of phases θ11 and θ21, and the Y-axis signal phase is θ21. Within sub-period 2, the X-axis signal phase is the superposition phase θsb of phases θ12 and θ22, and the Y-axis signal phase is θ22.

[0325] The superposition phase θsa of the TX1 signal of stylus A and the TX1 signal of stylus B within sub-period 1 can be determined by the following formula:

[0326] θsa=arctan((IA1+IB1) / (QA1+QB1)) Formula (12)

[0327] In the above formula (12), IA1 is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus A within sub-cycle 1, QA1 is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus A within sub-cycle 1, IB1 is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus B within sub-cycle 1, and QB1 is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus B within sub-cycle 1.

[0328] The superposition phase θsb of the TX1 signals of stylus A and stylus B within sub-period 2 can be determined by the following formula:

[0329] θsb=arctan((IA2+IB2) / (QA2+QB2)) Formula (13)

[0330] In the above formula (13), IA2 is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus A within sub-cycle 2, QA2 is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus A within sub-cycle 2, IB2 is the amplitude of the I-channel signal demodulated from the TX1 signal of stylus B within sub-cycle 2, and QB2 is the amplitude of the Q-channel signal demodulated from the TX1 signal of stylus B within sub-cycle 2.

[0331] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously at two locations on the touchscreen in both the X-axis and Y-axis directions, and these two locations are on the same X-axis (i.e., have the same Y-axis coordinate):

[0332] 1. The electronic device 100 can determine the position point (x1, y2) of the stylus A tip on the touch screen as the position of the stylus A tip, where the phase of the TX1 signal in the X-axis direction is θsa and the phase of the TX1 signal in the Y-axis direction is θ11, and the phase of the TX1 signal in the X-axis direction is θsb and the phase of the TX1 signal in the Y-axis direction is θ12 in the sub-period 2.

[0333] 2. The electronic device 100 can determine the position point (x2, y2) of the stylus tip B on the touch screen as the position of the stylus tip B. The position point is (x2, y2) of the TX1 signal with phase θsa in the X-axis direction and phase θ21 in the Y-axis direction in the X-axis direction and phase θsb in the X-axis direction and phase θ22 in the Y-axis direction in the sub-period 1.

[0334] For example, as mentioned above Figure 6D As shown, the X-axis coordinates of the stylus tip A and the stylus tip B on the touchscreen are the same. The coordinates of the stylus tip A on the touchscreen are (x1, y2), and the coordinates of the stylus tip B on the touchscreen are (x1, y1), where y1 and y2 are different. Since the coordinates of the stylus tip A on the touchscreen are (x1, y2), the electronic device 100 can detect the TX1 signal of stylus A at the linear position of the X-axis coordinate x1 on the touchscreen, and at the linear position of the Y-axis coordinate y2 on the touchscreen. Since the coordinates of the stylus tip B on the touchscreen are (x1, y1), the electronic device 100 can detect the TX1 signal of the stylus B at both the x-axis coordinate x1 and the y-axis coordinate y1 of the touchscreen. Therefore, the electronic device 100 can simultaneously detect the TX1 signal at two locations on the touchscreen, one at (x1, y1) and the other at (x1, y2).

[0335] Specifically, the phase of the TX1 signal of stylus A is θ11 in sub-period 1 and θ12 in sub-period 2. The phase of the TX1 signal of stylus B is θ21 in sub-period 1 and θ22 in sub-period 2. Therefore, the phases of the TX1 signals in the X-axis direction and the Y-axis direction for these two position points (x1, y1) and (x1, y2) within the two sub-periods are shown in Table 13 below:

[0336] Table 13

[0337]

[0338] As shown in Table 13 above, for position point (x1, y2), the phase of the TX1 signal in the X-axis direction within sub-period 1 is θ21, and the phase of the TX1 signal in the Y-axis direction is the superposition of phases θ11 and θ21, θsa. For position point (x2, y2), the phase of the TX1 signal in the X-axis direction within sub-period 1 is θ11, and the phase of the TX1 signal in the Y-axis direction is θsa. For sub-period 2, the phase of the TX1 signal in the X-axis direction is θ12, and the phase of the TX1 signal in the Y-axis direction is θsb.

[0339] The phase θsa of the superposition of the TX1 signal of stylus A and the TX1 signal of stylus B within sub-period 1 can be determined by the above formula (12). The phase θsb of the superposition of the TX1 signal of stylus A and the TX1 signal of stylus B within sub-period 2 can be determined by the above formula (13), and will not be repeated here.

[0340] Therefore, when the electronic device 100 can detect the TX1 signal simultaneously at two locations on the touchscreen in both the X-axis and Y-axis directions, and these two locations are on the same Y-axis (same X-axis coordinate):

[0341] 1. The electronic device 100 can determine the position point (x1, y2) of the stylus A tip on the touch screen as the position point of the stylus A, where the phase of the TX1 signal in the X-axis direction is θ11 and the phase of the TX1 signal in the Y-axis direction is θsa in sub-period 1, and the phase of the TX1 signal in the X-axis direction is θ12 and the phase of the TX1 signal in the Y-axis direction is θsb in sub-period 2.

[0342] 2. The electronic device 100 can determine the position point (x1, y1) of the stylus tip B on the touch screen as the position point of the stylus B, where the phase of the TX1 signal in the X-axis direction is θ21 and the phase of the TX1 signal in the Y-axis direction is θsa, and the phase of the TX1 signal in the X-axis direction is θ22 and the phase of the TX1 signal in the Y-axis direction is θsb in the sub-period 2.

[0343] In this embodiment, the electronic device 100 simultaneously supports styluses 200 that can be used on the touchscreen, which is not limited to two but can also include three or more. The transmission cycle of the stylus tip 200 transmitting a signal is not limited to two sub-cycles but can include more sub-cycles.

[0344] For example, such as Figure 9AAs shown, the multiple styluses 200 may include stylus A, stylus B, stylus C, and stylus D. The transmission period of the TX1 signal may include three sub-cycles (sub-cycle 1, sub-cycle 2, and sub-cycle 3). The duration of one transmission cycle can be 8333 µs, the duration of sub-cycle 1 can be 2778 µs, the duration of sub-cycle 2 can be 2778 µs, and the duration of sub-cycle 3 can be 2777 µs. Sub-cycle 1 includes a screen uplink signal transmission period and a pen signal detection period 1. For example, the screen uplink signal transmission period can be from 128 µs to 345 µs within sub-cycle 1, and the duration of the screen uplink signal transmission period can be 217 µs. The pen signal detection period 1 can be from 2578 µs to 2778 µs within sub-cycle 1, and the duration of the pen signal detection period 1 can be 200 µs. Sub-cycle 2 includes a touch detection time period 1 and a pen signal detection time period 2. The touch detection time period 1 can be from 0 to 2578 µs within sub-cycle 2, and the pen signal detection time period 2 can be from 2578 µs to 2778 µs within sub-cycle 2. Sub-cycle 3 includes a touch detection time period 2 and a pen signal detection time period 3. The touch detection time period 2 can be from 0 to 2577 µs within sub-cycle 3, and the pen signal detection time period 3 can be from 2577 µs to 2777 µs within sub-cycle 3.

[0345] Multiple styluses 200 can all attempt to receive the screen uplink signal sent by the electronic device 100 during the screen uplink signal transmission period. After receiving the screen uplink signal, the styluse 200 can determine the time position of multiple pen signal detection time periods based on the time of receiving the screen uplink signal and the division rules of multiple time periods within each sub-cycle. The styluse 200 can then send the TX1 signal at the time position of multiple pen signal detection time periods.

[0346] Specifically, the phase of the TX1 signal of stylus A can be k1 within sub-cycle 1, k2 within sub-cycle 2, and k3 within sub-cycle 3. The phase of the TX1 signal of stylus B can be k1 within sub-cycle 1, k3 within sub-cycle 2, and k2 within sub-cycle 3. The phase of the TX1 signal of stylus C can be k1 within sub-cycle 1, k2 within sub-cycle 2, and k2 within sub-cycle 3. The phase of the TX1 signal of stylus D can be k1 within sub-cycle 1, k3 within sub-cycle 2, and k3 within sub-cycle 3. Here, k1, k2, and k3 are all different.

[0347] For example, such as Figure 9B As shown, the multiple styluses 200 may include stylus A, stylus B, stylus C, and stylus D. The transmission period of the pen tip signal may include three sub-cycles (sub-cycle 1, sub-cycle 2, and sub-cycle 3). The duration of one transmission cycle can be 8333 µs, the duration of sub-cycle 1 can be 2778 µs, the duration of sub-cycle 2 can be 2778 µs, and the duration of sub-cycle 3 can be 2777 µs. Sub-cycle 1 includes a screen uplink signal transmission period and a pen signal detection period 1. For example, the screen uplink signal transmission period can transmit signals from 128 µs to 345 µs within sub-cycle 1, and the duration of the screen uplink signal transmission period can be 217 µs. The pen signal detection period 1 can transmit signals from 2578 µs to 2778 µs within sub-cycle 1, and the duration of the pen signal detection period 1 can be 200 µs. Sub-cycle 2 includes a touch detection time period 1 and a pen signal detection time period 2. The touch detection time period 1 can be from 0 to 2578 µs within sub-cycle 2, and the pen signal detection time period 2 can be from 2578 µs to 2778 µs within sub-cycle 2. Sub-cycle 3 includes a touch detection time period 2 and a pen signal detection time period 3. The touch detection time period 2 can be from 0 to 2577 µs within sub-cycle 3, and the pen signal detection time period 3 can be from 2577 µs to 2777 µs within sub-cycle 3.

[0348] Multiple styluses 200 can all attempt to receive the screen uplink signal transmitted by the electronic device 100 during the screen uplink signal transmission period. After receiving the screen uplink signal, the styluse 200 can determine the time position of multiple pen signal detection time periods based on the time of receiving the screen uplink signal and the division rules of multiple time periods within each sub-cycle. The styluse 200 can then transmit pen tip emission signals at the time positions of the multiple pen signal detection time periods.

[0349] Specifically, the phase of the TX1 signal of stylus A during the pen signal detection period can be k1 in sub-cycle 1, k1 in sub-cycle 2, and k1 in sub-cycle 3. The phase of the TX1 signal of stylus B during the pen signal detection period can be k1 in sub-cycle 1, k0 in sub-cycle 2, and k1 in sub-cycle 3. The phase of the TX1 signal of stylus C during the pen signal detection period can be k1 in sub-cycle 1, k0 in sub-cycle 2, and k0 in sub-cycle 3. Notably, k0 and k1 are different.

[0350] The following describes the flow of a handwriting pen detection method provided in the embodiments of this application.

[0351] Figure 10 A flowchart illustrating a stylus detection method provided in an embodiment of this application is shown. This stylus detection method is applied to a stylus detection system, which may include an electronic device 100 and multiple styluses 200. The stylus detection method in this embodiment is described below using stylus A and stylus B as an example.

[0352] like Figure 10 As shown, the stylus detection method includes the following steps:

[0353] S1001, electronic device 100, and stylus A are paired via Bluetooth.

[0354] S1002, Electronic device 100 and stylus B are paired via Bluetooth.

[0355] S1003, Electronic device 100 assigns the phase of the pen signal of stylus A to stylus A via Bluetooth.

[0356] S1004. Electronic device 100 assigns the phase of the pen signal of stylus B to stylus B via Bluetooth.

[0357] The phase of the pen signal allocated by the electronic device 100 to the multiple styluses 200 (including stylus A and stylus B) may include the phase of the TX1 signal. In some embodiments, the phase of the pen signal allocated by the electronic device 100 to the multiple styluses 200 (including stylus A and stylus B) may include the phase of the TX1 signal and the phase of the TX2 signal.

[0358] The phase of the pen signals from multiple styluses 200 can be referenced above. Figure 6A or Figure 7A or Figure 8 or Figure 9A or Figure 9B The embodiments shown are not described in detail here.

[0359] S1005, Electronic device 100 performs detection protocol alignment with stylus A via Bluetooth.

[0360] S1006, Electronic device 100 performs detection protocol alignment with stylus B via Bluetooth.

[0361] Among them, the detection protocol alignment includes the alignment of the pen signal detection time period between electronic device 100 and stylus A and stylus B, the pen signal transmission period, the pen signal transmission duration, and so on.

[0362] S1007, Stylus A sends the pen signal of Stylus A.

[0363] S1008, Stylus B sends the pen signal of Stylus B.

[0364] S1009, Electronic device 100 receives pen signals from stylus A and stylus B via a touchscreen.

[0365] Among them, in the above Figure 6A , Figure 8 In the illustrated embodiment, the pen signal of stylus A includes the TX1 signal, and the pen signal of stylus B also includes the TX1 signal. In the above... Figure 7A In the illustrated embodiment, the pen signal of stylus A includes TX1 signal and TX2 signal, and the pen signal of stylus B includes TX1 signal and TX2 signal.

[0366] S1010, Electronic device 100 demodulates the phases of multiple positions on the touchscreen where the pen signal was detected.

[0367] S1011, Electronic device 100 determines the position of the tip of stylus A and the position of the tip of stylus B on the touch screen based on the phase of multiple positions.

[0368] Among them, multiple locations can be the positions where the pen signal is detected simultaneously by the capacitors in the X-axis direction and the Y-axis direction on the touch screen.

[0369] The position of the stylus tip A on the touchscreen is also the position where the electronic device 100 receives the TX1 signal from the stylus A through the touchscreen.

[0370] Specifically, the process by which the electronic device 100 determines the position of the pen tips of multiple styluses 200 on the touch screen based on phase information at multiple locations can be referred to the aforementioned embodiments and will not be repeated here.

[0371] This application provides a stylus detection method that uses integrated circuit (IC) sampling technology to detect multiple styluses 200 by combining the phase of the stylus tip emitted (TX1) signal, or the phase of the stylus's TX1 signal relative to the TX2 signal, with in-phase / quadrature (IQ) demodulation within the analog frontend (AFE) of the touch module. This enables the electronic device 100 to detect multiple styluses 200, ensuring the performance of the multiple styluses 200 and achieving a high reporting rate and high performance capacitive pen solution for the multiple styluses 200.

[0372] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A stylus detection system, characterized in that, The device includes an electronic device, a first stylus, and a second stylus; the first stylus has a first transmitter, the second stylus has a second transmitter, the electronic device has a touchscreen, the touchscreen includes a touch sensor, and the touch sensor includes capacitance in a first direction and capacitance in a second direction; wherein... The electronic device is used to send a first phase to the first stylus and a second phase to the second stylus; The first stylus is used to transmit a first signal having a first frequency and a first phase via the first transmitter; The second stylus is used to transmit a second signal having the first frequency and the second phase via the second transmitter; The electronic device is configured to simultaneously receive signals having the first frequency at multiple locations on the touch screen via a capacitor in the first direction and a capacitor in the second direction, wherein the signals having the first frequency include the first signal and the second signal. The electronic device is further configured to determine the phase of the signal at the first frequency at the plurality of locations; The electronic device is further configured to determine, based on the phase of the signal having the first frequency at the plurality of locations, the first phase, and the second phase, a first location where the touch screen receives the first signal and a second location where the touch screen receives the second signal, wherein the first phase and the second phase are different.

2. The system according to claim 1, characterized in that, When the plurality of positions consists of two positions, the two positions are the first position and the second position; wherein, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the fifth phase; or, The first position and the second position have different coordinates in the first direction but the same coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase; The fifth phase is the phase when the first signal and the second signal are superimposed.

3. The system according to claim 1, characterized in that, When there are four positions, the four positions include the first position and the second position; the coordinates of the first position and the second position are different in the first direction and different in the second direction; wherein, The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase.

4. The system according to claim 1, characterized in that, The first stylus also has a third transmitter; the second stylus also has a fourth transmitter; The electronic device is also used to send a third phase to the first stylus and a fourth phase to the second stylus; The first stylus is also used to transmit a third signal having a second frequency and a third phase via the third transmitter; The second stylus is also used to transmit a fourth signal having the second frequency and the fourth phase via the fourth transmitter; The electronic device is further configured to receive a signal having the second frequency at the plurality of locations on the touch screen, the signal having the second frequency including the third signal and the fourth signal; The electronic device is further configured to determine the phase of the signal having the second frequency at the plurality of locations; The electronic device is specifically configured to determine, from the plurality of locations, the first location where the touch screen receives the first signal and the second location where the touch screen receives the second signal, based on the phase of the signal having the first frequency at the plurality of locations, the phase of the signal having the second frequency at the plurality of locations, the first phase, the second phase, the third phase, and the fourth phase; Wherein, the difference between the first phase and the third phase is not equal to the difference between the second phase and the fourth phase.

5. The system according to claim 4, characterized in that, The first phase is the same as the second phase, and the third phase is different from the fourth phase.

6. The system according to claim 4, characterized in that, The first phase is different from the second phase, and the third phase is the same as the fourth phase.

7. The system according to claim 4, characterized in that, The first phase is different from the second phase, and the third phase is different from the fourth phase.

8. The system according to any one of claims 5-7, characterized in that, The plurality of positions refers to two positions, namely the first position and the second position; wherein, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the fifth phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase, and the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the sixth phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase, and the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the sixth phase; or, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the sixth phase, and the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the sixth phase, and the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase; Wherein, the fifth phase is the phase when the first signal and the second signal are superimposed, and the sixth phase is the phase when the third signal and the fourth signal are superimposed.

9. The system according to any one of claims 5-7, characterized in that, The plurality of positions comprises four positions, including the first position and the second position; the first position and the second position have different coordinates in the first direction and different coordinates in the second direction; wherein, The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase. The phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase.

10. The system according to claim 1, characterized in that, The first phase includes the seventh phase within the first time period and the eighth phase within the second time period, and the second phase includes the ninth phase within the first time period and the tenth phase within the second time period.

11. The system according to claim 10, characterized in that, The seventh phase is different from the ninth phase, and the eighth phase is the same as the tenth phase.

12. The system according to claim 10, characterized in that, The seventh phase is the same as the ninth phase, and the eighth phase is different from the tenth phase.

13. The system according to claim 10, characterized in that, The seventh phase is different from the ninth phase, and the eighth phase is different from the tenth phase.

14. The system according to any one of claims 11-13, characterized in that, The plurality of positions refers to two positions, namely the first position and the second position; wherein, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the seventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the eleventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the ninth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction within the first time period is the eleventh phase. The phase of the signal with the first frequency is the eleventh phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the twelfth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the twelfth phase; or, The first position and the second position have different coordinates in the first direction but the same coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction within the first time period is the eleventh phase. The phase of the signal having the first frequency is the ninth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the eighth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the tenth phase; Wherein, the eleventh phase is the phase when the first signal and the second signal are superimposed during the first time period, and the twelfth phase is the phase when the first signal and the second signal are superimposed during the second time period.

15. The system according to any one of claims 11-13, characterized in that, The plurality of positions comprises four positions, including the first position and the second position; the first position and the second position have different coordinates in the first direction and different coordinates in the second direction; wherein, The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the ninth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction within the first time period is the ninth phase. The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the tenth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase.

16. A stylus detection method, applied to electronic devices with touchscreens, characterized in that, The touchscreen includes a touch sensor, which includes capacitance in a first direction and capacitance in a second direction; the method includes: Send the first phase to the first stylus and the second phase to the second stylus; At multiple locations on the touchscreen, signals with a first frequency are simultaneously received via capacitors in the first direction and capacitors in the second direction. The signals with the first frequency include a first signal transmitted by the first stylus with the first frequency and a first phase, and a second signal transmitted by the second stylus with the first frequency and a second phase. Determine the phase of the signal having the first frequency at the plurality of locations; Based on the phase of the signal with the first frequency at the plurality of locations, the first phase, and the second phase, a first location where the touch screen receives the first signal and a second location where the touch screen receives the second signal are determined from the plurality of locations, wherein the first phase and the second phase are different.

17. The method according to claim 16, characterized in that, When the plurality of positions consists of two positions, the two positions are the first position and the second position; wherein, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the fifth phase; or, The first position and the second position have different coordinates in the first direction but the same coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase; The fifth phase is the phase when the first signal and the second signal are superimposed.

18. The method according to claim 16, characterized in that, When there are four positions, the four positions include the first position and the second position; the coordinates of the first position and the second position are different in the first direction and different in the second direction; wherein, The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase.

19. The method according to claim 16, characterized in that, The first stylus also has a third transmitter; the second stylus also has a fourth transmitter; The electronic device is also used to send a third phase to the first stylus and a fourth phase to the second stylus; The first stylus is also used to transmit a third signal having a second frequency and a third phase via the third transmitter; The second stylus is also used to transmit a fourth signal having the second frequency and the fourth phase via the fourth transmitter; The electronic device is further configured to receive a signal having the second frequency at the plurality of locations on the touch screen, the signal having the second frequency including the third signal and the fourth signal; The electronic device is further configured to determine the phase of the signal at the second frequency at the plurality of locations; The electronic device is specifically configured to determine, from the plurality of locations, the first location where the touch screen receives the first signal and the second location where the touch screen receives the second signal, based on the phase of the first frequency signal at the plurality of locations, the phase of the second frequency signal at the plurality of locations, the first phase, the second phase, the third phase, and the fourth phase; Wherein, the difference between the first phase and the third phase is not equal to the difference between the second phase and the fourth phase.

20. The method according to claim 19, characterized in that, The first phase is the same as the second phase, and the third phase is different from the fourth phase.

21. The method according to claim 19, characterized in that, The first phase is different from the second phase, and the third phase is the same as the fourth phase.

22. The method according to claim 19, characterized in that, The first phase is different from the second phase, and the third phase is different from the fourth phase.

23. The method according to any one of claims 20-22, characterized in that, The plurality of positions refers to two positions, namely the first position and the second position; wherein, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the fifth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the fifth phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase, and the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the sixth phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase, and the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the sixth phase; or, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the fifth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the sixth phase, and the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the sixth phase, and the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase; Wherein, the fifth phase is the phase when the first signal and the second signal are superimposed, and the sixth phase is the phase when the third signal and the fourth signal are superimposed.

24. The method according to any one of claims 20-22, characterized in that, The plurality of positions comprises four positions, including the first position and the second position; the first position and the second position have different coordinates in the first direction and different coordinates in the second direction; wherein, The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction is the first phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction is the second phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction is the second phase. The phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the first direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the first position through the capacitor in the second direction is the third phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the first direction is the fourth phase; the phase of the signal with the second frequency received by the touch screen at the second position through the capacitor in the second direction is the fourth phase.

25. The method according to claim 16, characterized in that, The first phase includes the seventh phase within the first time period and the eighth phase within the second time period, and the second phase includes the ninth phase within the first time period and the tenth phase within the second time period.

26. The method according to claim 25, characterized in that, The seventh phase is different from the ninth phase, and the eighth phase is the same as the tenth phase.

27. The method according to claim 25, characterized in that, The seventh phase is the same as the ninth phase, and the eighth phase is different from the tenth phase.

28. The method according to claim 25, characterized in that, The seventh phase is different from the ninth phase, and the eighth phase is different from the tenth phase.

29. The method according to any one of claims 26-28, characterized in that, The plurality of positions refers to two positions, namely the first position and the second position; wherein, The first position and the second position have the same coordinates in the first direction but different coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the seventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the eleventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the ninth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction within the first time period is the eleventh phase. The phase of the signal with the first frequency is the eleventh phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the twelfth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase, and the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the twelfth phase; or, The first position and the second position have different coordinates in the first direction but the same coordinates in the second direction; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the eleventh phase, and the phase of the signal received by the touch screen at the second position through the capacitor in the second direction within the first time period is the eleventh phase. The phase of the signal having the first frequency is the ninth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the eighth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the twelfth phase; the phase of the signal having the first frequency received by the touch screen at the second position through the capacitor in the second direction during the second time period is the tenth phase; Wherein, the eleventh phase is the phase when the first signal and the second signal are superimposed during the first time period, and the twelfth phase is the phase when the first signal and the second signal are superimposed during the second time period.

30. The method according to any one of claims 26-28, characterized in that, The plurality of positions comprises four positions, including the first position and the second position; the first position and the second position have different coordinates in the first direction and different coordinates in the second direction; wherein, The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction within the first time period is the seventh phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction within the first time period is the ninth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the second direction within the first time period is the ninth phase. The phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the first direction during the second time period is the eighth phase; the phase of the signal with the first frequency received by the touch screen at the first position through the capacitor in the second direction during the second time period is the tenth phase; the phase of the signal with the first frequency received by the touch screen at the second position through the capacitor in the first direction during the second time period is the tenth phase.

31. An electronic device, characterized in that, include: The device includes a touchscreen, one or more processors, and one or more memories coupled to the one or more processors. The one or more memories are used to store computer program code, which includes computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any one of claims 16-30.

32. A computer storage medium, characterized in that, include: Computer instructions, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 16-30.

33. A chip or chip system for use in an electronic device with a touch screen, characterized in that, It includes a processing circuit and an interface circuit, the interface circuit being used to receive code instructions and transmit them to the processing circuit, the processing circuit being used to execute the code instructions to perform the method as described in any one of claims 16-30.

Citation Information

Patent Citations

  • Electromagnetic induction type multi-channel handwriting input system and method

    CN105607765A

  • Touch position determination method and device, electronic equipment and readable storage medium

    CN112860105A

  • Method, device and system for controlling information input equipment on terminal

    CN114003137A