Communication method, terminal equipment and storage medium

By preserving multiple communication protocols and their signal characteristics in the terminal device and collecting and comparing the signal characteristics of the stylus, the terminal device can be compatible with the stylus of multiple communication protocols, solving the problem of poor compatibility in the prior art and improving interoperability and user experience.

CN119902627APending Publication Date: 2025-04-29HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311375913.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-20
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

Existing terminal devices usually only support stylus with one communication protocol and cannot be compatible with stylus with other communication protocols, resulting in poor compatibility.

Method used

By preserving multiple communication protocols and their corresponding signal characteristics in the terminal device, the sample signals sent by the stylus are collected, their signal characteristics are analyzed, and the target communication protocol is determined, thereby achieving compatibility with the stylus of various communication protocols.

Benefits of technology

Terminal devices can be compatible with stylus of multiple communication protocols, improving interoperability with stylus of different brands and types and enhancing user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902627A_ABST
    Figure CN119902627A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and provides a communication protocol switching method. According to the method provided by the embodiment of the invention, the plurality of communication protocols and the signal characteristics corresponding to the communication protocols can be stored in the terminal equipment in advance. The terminal equipment can collect the code printing signal sent by the touch pen and analyze and process the collected code printing signal so as to obtain time period information and frequency band information sent by the code printing signal. And then, the terminal equipment can determine a target communication protocol matched with the collected coding signal from a plurality of communication protocols built in the terminal equipment based on the time period information and the frequency band information. And when the terminal equipment currently uses no target communication protocol, switching to the target communication protocol. After the terminal equipment is switched to the target communication protocol, the target communication protocol is consistent with the communication protocol used by the stylus, and the operation of the stylus can be supported. Therefore, the terminal equipment provided by the embodiment of the invention can support the stylus with multiple protocols.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of communication technology, and in particular to a communication method, a terminal device, and a storage medium. Background Art

[0002] With the widespread use of mobile phones, tablets and other terminal devices, in order to write, draw, click and other operations on the touch screen of the terminal device more conveniently and accurately, users can use a stylus (or "stylus") instead of fingers to operate. Among them, the stylus needs to use the same communication protocol as the terminal device to interact with the touch screen of the terminal device. If the communication protocol used by the stylus and the terminal device is different, the stylus cannot interact with the touch screen of the terminal device.

[0003] At present, terminal devices usually only support styluses with one communication protocol and cannot support styluses using other communication protocols. For example, the tablet produced by Company X uses communication protocol a. The stylus produced by Company Y uses communication protocol b. Since the tablet produced by Company X and the stylus produced by Company Y use different communication protocols, the stylus produced by Company Y cannot interact with the touch screen of the tablet produced by Company X, that is, the tablet produced by Company X does not support the interaction of the stylus produced by Company Y, and has poor compatibility. Summary of the invention

[0004] Some embodiments of the present application provide a communication method, a terminal device, and a computer-readable storage medium. The present application is introduced from multiple aspects below, and the implementation methods and beneficial effects of the following aspects can be referenced to each other.

[0005] In a first aspect, the present application provides a communication method for a terminal device, comprising: collecting a first signal sent by a stylus; parsing signal characteristics of the first signal; comparing the signal characteristics of the first signal with signal characteristics corresponding to a plurality of stored communication protocols to determine a target communication protocol that matches the first signal from the plurality of communication protocols; and detecting a touch signal sent by the stylus through the target communication protocol.

[0006] The first signal may be the sample coding signal mentioned in the present application. The terminal device may be a tablet, mobile phone, computer, smart watch, smart bracelet or other terminal device with a touch screen. The touch signal may be a coding signal sent by a stylus.

[0007] The terminal device stores a plurality of communication protocols, for example, communication protocol a, communication protocol b, communication protocol c, communication protocol d, etc. The target communication protocol is the communication protocol currently used by the stylus pen.

[0008] The terminal device can pre-store multiple communication protocols and signal characteristics of coding signals sent by styluses using different communication protocols (such as coding cycle, coding time period, frequency of coding signals, amplitude of coding signals, etc.). When the terminal device detects the coding signal sent by the stylus, it can collect the sample coding signal sent by the stylus, and parse and process the collected sample coding signal to obtain the signal characteristics of the sample coding signal. Then, the terminal device can compare the signal characteristics of the sample coding signal with the signal characteristics of the coding signals corresponding to the stored multiple communication protocols to determine the target communication protocol that matches the sample coding signal. Finally, the terminal device can detect the touch signal sent by the stylus through the target communication protocol. In this way, the terminal device can be compatible with styluses of multiple communication protocols.

[0009] In some implementations, detecting a touch signal sent by the stylus through a target communication protocol includes: detecting the touch signal sent by the stylus based on a timing sequence corresponding to the target communication protocol.

[0010] Each communication protocol pre-stored in the terminal device corresponds to a working mode. When the terminal device uses a certain communication protocol, it can enter the working mode corresponding to the communication protocol. After the terminal device determines the communication protocol used by the stylus pen, that is, the target protocol, it can enter the working mode corresponding to the target communication protocol, and in this working mode, detect the coding signal sent by the stylus pen according to the timing corresponding to the target communication protocol.

[0011] For example, when the terminal device determines that the stylus pen uses communication protocol b, it can be determined that the stylus pen is stylus pen B using communication protocol b, and the terminal device uses communication protocol b to communicate with stylus pen B. At this time, stylus pen B sends a coding signal according to the timing corresponding to communication protocol b, and the terminal device detects the coding signal sent by stylus pen B according to the timing corresponding to communication protocol b. In this way, the way stylus pen B sends the coding signal is consistent with the way the terminal device receives the coding signal, and the terminal device can respond to the interaction of stylus pen B.

[0012] In some embodiments, detecting a touch signal sent by the stylus includes: detecting a first instruction, wherein the first instruction is used to instruct the terminal device to pair with the stylus; pairing with the stylus through a target communication protocol, and after pairing is completed, detecting the touch signal sent by the stylus.

[0013] The first instruction may be the pairing instruction mentioned in this application. The pairing instruction may include an operation instruction, a voice instruction, and the like.

[0014] After the terminal device determines the target communication protocol, that is, determines the communication protocol currently used by the stylus, when the terminal device receives a pairing instruction, the terminal device can pair with the stylus based on the target communication protocol, and after pairing, proceed to the target working mode corresponding to the target communication protocol to detect the touch signal sent by the stylus in the target working mode. Then, the terminal device can interact with the stylus based on the detected touch signal sent by the stylus.

[0015] In some embodiments, detecting the first instruction includes: detecting an operation of a user confirming pairing with the stylus on a display interface of a terminal device; or receiving a voice message from the user confirming pairing with the stylus.

[0016] The display interface may be the prompt interface mentioned in this application.

[0017] Exemplarily, when the terminal device confirms that the stylus currently uses the communication protocol B, the terminal device may display a prompt interface on the touch screen. The prompt interface may include prompt information, such as "whether to use stylus B" and other information. When the user clicks the confirmation button on the prompt interface, the terminal device generates a corresponding pairing instruction and sends the pairing instruction to itself. After receiving the pairing instruction, the terminal device pairs with stylus B in response to the pairing instruction.

[0018] For example, after the terminal device confirms the communication protocol B currently used by the stylus pen, when the terminal device receives a voice message such as "confirm pairing" from the user confirming pairing with the stylus pen, the terminal device can generate a corresponding pairing instruction based on the voice message and send the pairing instruction to itself. After receiving the pairing instruction, the terminal device pairs with stylus pen B in response to the pairing instruction.

[0019] In some embodiments, the signal characteristics include at least one of the following: period, frequency, time period, and amplitude.

[0020] Among them, the period can be the period of the coding signal, the frequency can be the frequency of the coding signal, the time period can be the time period of the coding signal, and the amplitude can be the amplitude of the coding signal.

[0021] In some embodiments, the terminal device includes a plurality of electrodes; and the method further includes: determining a touch position of the stylus on the touch screen of the terminal device based on the strength of the touch signals detected by the plurality of electrodes.

[0022] The touch screen of the terminal device is provided with multiple electrodes in the horizontal and vertical directions, and each electrode can detect the touch signal sent by the stylus. The terminal device can determine the touch position of the stylus on the touch screen of the terminal device according to the strength of the touch signal detected by each electrode. In this way, the terminal device can interact with the stylus.

[0023] In some implementations, analyzing the signal characteristics of the first signal includes: determining a first frequency point corresponding to at least one signal in a first time period of the first signal.

[0024] Exemplarily, it is assumed that the multiple communication protocols stored in the terminal device include communication protocol a, communication protocol b, communication protocol c and communication protocol d.

[0025] For communication protocol a, when the stylus uses communication protocol a, the stylus codes the signal of frequency F1 in time period TA1, codes the signal of frequency F2 in time period TA2, codes the signal of frequency F1 in time period TA3, and codes the signal of frequency F2 in time period TA4 in each coding cycle TA. The coding cycle TA is the working cycle when the stylus uses communication protocol a, that is, the stylus performs a coding task once every time period TA.

[0026] For communication protocol b, when the stylus uses communication protocol b, the stylus codes the signal of frequency F3 in period TB1, codes the signal of frequency F4 in period TB2, codes the signal of frequency F3 in period TB3, and codes the signal of frequency F4 in period TB4 in each coding cycle TB. The cycle time TB is the working cycle of the stylus when using communication protocol b, that is, the stylus performs a coding task once per time interval period TB.

[0027] For communication protocol c, when the stylus uses communication protocol c, the stylus sends a coding signal of frequency F5 in the TC1 period, sends a coding signal of frequency F6 in the TC2 period, sends a coding signal of frequency F5 in the TC3 period, and sends a coding signal of frequency F6 in the TC4 period in each coding cycle TC. The cycle time TC is the working cycle of the stylus when using communication protocol c, that is, the stylus performs a coding task once every time period TC.

[0028] For communication protocol d, when stylus D uses communication protocol d, in each coding period TD, a coding signal of frequency F1 is sent in period TD1, a coding signal of frequency F2 is sent in period TD2, a coding signal of frequency F1 is sent in period TD3, and a coding signal of frequency F2 is sent in period TD4. The coding period TD is the working period when stylus D uses communication protocol d, that is, stylus D performs a coding task once every time period TD.

[0029] The coding frequency of stylus A in the TA1 period is F1, and the coding frequency of stylus B in the TB1 period corresponding to the TA1 period is F3. The TA1 period of the coding signal of stylus A and the TB1 period of the coding signal of stylus B overlap in the T1 period.

[0030] The coding frequency of stylus A in the TA1 period is F1, and the coding frequency of stylus C in the TC1 period corresponding to the TA1 period is F5. The TC1 period of the coding signal of stylus C is between the interval period T2 of the TA1 period and the TA2 period of the coding signal of stylus A.

[0031] The coding frequency of stylus A in the TA1 period is F1, and the coding frequency of stylus D in the TD1 period corresponding to the TA1 period is also F1. The TA1 period of the coding signal of stylus A overlaps with the TD1 period of the coding signal of stylus D, where the TA1 period is T3 periods ahead of the TD1 period, and the TD1 period is T4 periods behind the TA1 period.

[0032] The T1 period, T2 period and T4 period of the first signal detected by the terminal device may be used as the first period, so as to compare the frequency points of the signals corresponding to the multiple communication protocols stored in the terminal device with the T1 period, T2 period and T4 period.

[0033] In some embodiments, the signal characteristics of the first signal are compared with the signal characteristics corresponding to the multiple stored communication protocols to determine the target communication protocol that matches the first signal from the multiple communication protocols, including: determining the communication protocol among the multiple communication protocols whose frequency in the first time period is the same as the first frequency as the target communication protocol.

[0034] Continuing with the example of the terminal device storing communication protocols a, b, c, and d, when the terminal device determines that the frequency of the first signal sent by the stylus during the T1 period is frequency F1, it can be determined that the stylus uses communication protocol a. When the terminal device determines that the frequency of the first signal sent by the stylus during the T1 period is frequency F3, it can be determined that the stylus uses communication protocol b. When the terminal device determines that the frequency of the first signal sent by the stylus during the T2 period is frequency F5, it can be determined that the stylus uses communication protocol c. When the terminal device determines that the frequency of the first signal sent by the stylus during the T4 period is frequency F1, it can be determined that the stylus uses communication protocol d. In this way, the terminal device can determine the communication protocol currently used by the stylus, that is, the target communication protocol.

[0035] In a second aspect, an embodiment of the present application provides a terminal device, including: a memory for storing instructions executed by one or more processors of the terminal device; a processor, when the processor executes the instructions in the memory, the terminal device can execute the method described in the first aspect of the present application. The beneficial effects that can be achieved in the second aspect can refer to the beneficial effects of the method provided by any embodiment of the first aspect, and will not be repeated here.

[0036] In a third aspect, the present application provides a computer-readable storage medium on which instructions are stored, and when the instructions are executed on a computer, the computer can execute the method described in any embodiment of the first aspect. The beneficial effects that can be achieved in the third aspect can refer to the beneficial effects of the method provided in any embodiment of the first aspect, and will not be repeated here.

[0037] In a fourth aspect, the embodiments of the present application provide a computer program product, wherein the computer program product includes a computer program code, and when the computer program code is executed on a computer, the computer implements the method described in any embodiment of the first aspect. The beneficial effects that can be achieved in the fourth aspect can refer to the beneficial effects of the method provided in any embodiment of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 Exemplary application scenarios of the embodiments of the present application;

[0039] Figure 2 This is an example diagram of the distribution of multiple electrodes on the touch screen of the tablet provided in an embodiment of the present application;

[0040] Figure 3 An example diagram of an interaction scene between a stylus pen and a touch screen of a tablet provided in an embodiment of the present application;

[0041] Figure 4 A timing diagram of the coding method corresponding to the communication protocol a provided in the embodiment of the present application;

[0042] Figure 5 A timing diagram of the coding method corresponding to the communication protocol b provided in the embodiment of the present application;

[0043] Figure 6 The timing of the tablet detecting the coding signal sent by the stylus provided in the embodiment of the present application Figure 1 ;

[0044] Figure 7 The timing of the tablet detecting the coding signal sent by the stylus provided in the embodiment of the present application Figure 2 ;

[0045] Figure 8 An example diagram of a sample coding signal provided in an embodiment of the present application;

[0046] Fig. 9 An example flow chart of a communication method provided in an embodiment of the present application;

[0047] Fig.10 An example diagram of communication protocol a, communication protocol b, communication protocol c and communication protocol d provided in an embodiment of the present application;

[0048] Fig.11 A comparison diagram of communication protocol a and communication protocol b provided in an embodiment of the present application;

[0049] Fig.12 A comparison diagram of communication protocol a and communication protocol c provided in an embodiment of the present application;

[0050] Fig.13 A comparison diagram of communication protocol a and communication protocol d provided in an embodiment of the present application;

[0051] Fig.14 A timing diagram of a terminal device provided in an embodiment of the present application detecting a coding signal sent by a stylus B;

[0052] Fig.15 An example diagram of a process for switching pen working modes of a terminal device provided in an embodiment of the present application;

[0053] Fig.16 An example diagram of a prompt interface of a terminal device provided in an embodiment of the present application;

[0054] Fig.17 A detection timing diagram of a terminal device in a non-pen working mode provided by an embodiment of the present application;

[0055] Fig.18 A detection timing diagram of a terminal device in a pen A working mode provided in an embodiment of the present application;

[0056] Fig.19 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0057] The embodiment of the present application is used to provide a communication method. Through the method provided by the present application, the terminal device can support stylus pens of multiple communication protocols.

[0058] Figure 1 An exemplary application scenario of an embodiment of the present application is shown.

[0059] like Figure 1 As shown, the stylus pen 100 and the tablet 200 use the same communication protocol. The user can use the stylus pen 100 to write, draw, click, and perform other operations on the touch screen 20 of the tablet 200.

[0060] It should be noted that the tablet 200 is only used as an example. In other embodiments, the tablet 200 may also be a mobile phone, a computer, a smart watch, a smart bracelet, or other terminal devices with a touch screen.

[0061] In the embodiment of the present application, the stylus 100 can be any stylus that supports interaction with the touch screen of the terminal device, such as a capacitive pen (for example, an active capacitive pen, also referred to as an "active capacitive pen" or "active pen"), an inductive pen, etc.

[0062] The working principle of the interaction between the stylus pen 100 and the touch screen 20 of the tablet 200 is introduced below.

[0063] In some embodiments, Figure 2 As shown, the touch screen 20 of the tablet 200 is provided with a plurality of electrodes in the horizontal direction and the vertical direction, respectively. For example, the plurality of electrodes provided in the horizontal direction include S1, S2, S3, S4, S5, S6, etc., and the plurality of electrodes provided in the vertical direction include D1, D2, D3, D4, D5, D6, etc. The surface of each electrode is made of insulating material, and the electrodes in the adjacent horizontal and vertical directions constitute a coupling capacitor. The tablet 200 can detect the high-frequency signal (herein, the "high-frequency signal sent by the stylus 100" is referred to as the "coding signal", which may also be referred to as the "downlink signal") sent by the tip electrode of the stylus 100 (the electrode built into the tip of the stylus 100) through the electrodes distributed on the touch screen 20, and determine the contact position of the tip of the stylus 100 on the touch screen 20 according to the detected coding signal. The coding signal may be a square wave signal, a triangular wave signal, a rectangular signal, or the like.

[0064] For example, when the tip of the stylus pen 100 approaches or contacts the touch screen 20 of the tablet 200, the tip electrode of the stylus pen 100 may form a coupling capacitor with the electrode near the contact point of the tip on the touch screen 20. At this time, when the tip electrode of the stylus pen 100 sends a coding signal, the electrode near the contact point of the tip on the touch screen 20 may detect (receive) the coding signal sent by the stylus pen 100 through the coupling capacitor. Then, the tablet 200 may determine the position of the contact point of the tip of the stylus pen 100 on the touch screen 20 based on the strength of the coding signal detected by each electrode on the touch screen 100. Since the coding signal sent by the tip electrode of the stylus pen 100 will change the capacitance value near the contact point of the tip on the touch screen 20 (coupling capacitance formed by adjacent electrodes in the horizontal and vertical directions), the tablet 200 may also determine the position of the contact point of the tip of the stylus pen 100 on the touch screen 20 based on the change in the capacitance value on the touch screen 20. In other embodiments, the tablet 200 may also determine the position of the contact point of the tip of the stylus pen 100 on the touch screen 20 based on other methods, which is not limited to this.

[0065] After the tablet 200 determines the position of the contact point of the tip of the stylus pen 100 on the touch screen 20, it can respond to the operation of the stylus pen 100 based on the position of the contact point. Figure 3As shown, when the user uses the stylus pen 100 to draw a curve L1 on the touch screen 20 of the tablet 200 , the tablet 200 can display the trace of the curve L1 according to the position change of the contact point of the tip of the stylus pen 100 on the touch screen 20 .

[0066] When the stylus pen 100 uses a different communication protocol (or referred to as a "pen protocol") (e.g., When the stylus pen 100 uses the Microsoft Pen Protocol (MPP) protocol, the Unified Standard Interface (USI) protocol, the Advanced Encryption Standard (AES) protocol, etc.), the coding method of the stylus pen 100 is different, that is, the way in which the stylus pen 100 sends the coding signal is different. The communication protocol in this application can be understood as the coding method of the stylus pen, for example, the stylus pen codes the signal of the set frequency point in at least one set time period within each set cycle. It should be noted that the set cycle, the set time period and the set frequency point are pre-set based on the agreed coding rules, and the embodiment of the present application does not impose any restrictions on the specific setting method. The frequency point refers to the identifier of a fixed frequency band, such as the center frequency. Taking the frequency interval [30KHz, 500KHz] of the coding signal sent by the stylus pen 100 as an example, the frequency interval [30KHz, 500KHz] can be divided into multiple (such as 6, 10, etc.) frequency intervals, and then the center frequency of each frequency interval is used as the frequency point.

[0067] For example, Figure 4 As shown, when the stylus pen 100 uses the communication protocol a, the stylus pen 100 needs to send a coding signal according to the coding method corresponding to the communication protocol a. For example, the stylus pen 100 codes the signal of the F1 frequency point in the TA1 period, codes the signal of the F2 frequency point in the TA2 period, codes the signal of the F1 frequency point in the TA3 period, and codes the signal of the F2 frequency point in the TA4 period in each coding cycle TA. Among them, the coding cycle TA is the working cycle of the stylus pen 100 when using the communication protocol a, that is, the stylus pen 100 performs a coding task once every interval period TA.

[0068] For example, Figure 5As shown, when the stylus 100 uses the communication protocol b, the stylus 100 needs to send a coding signal according to the coding method corresponding to the communication protocol b. For example, in each coding cycle TB, the stylus 100 codes the signal of the F3 frequency point in the TB1 period, codes the signal of the F4 frequency point in the TB2 period, codes the signal of the F3 frequency point in the TB3 period, and codes the signal of the F4 frequency point in the TB4 period. Among them, the cycle time TB is the working cycle of the stylus 100 when using the communication protocol b, that is, the stylus 100 performs a coding task once every time period TB. It should be noted that TB may be equal to TA or may not be equal to TA. Its specific numerical value is determined based on the corresponding communication protocol and is not limited to this.

[0069] It can be understood that the tablet 200 needs to detect the coding signal sent by the stylus 100 according to the coding method of the stylus 100, so that the tablet 200 can determine the contact position of the stylus 100 on the touch screen 20 of the tablet 200 based on the coding signal sent by the stylus 100, and then interact with the stylus 100.

[0070] For example, Figure 6 As shown, when the tablet 200 and the stylus 100 communicate using the communication protocol a, the tablet 200 needs to detect the signal of the F1 frequency point in the TA1 period, the signal of the F2 frequency point in the TA2 period, the signal of the F3 frequency point in the TA3 period, and the signal of the F4 frequency point in the TA4 period in each coding cycle TA. In this way, the time when the tablet 200 detects the signal can be consistent with the time when the stylus 100 sends the signal, so that the tablet 200 can detect the coding signal sent by the stylus 100 in each detection cycle, and respond to the operation of the stylus 100 based on the coding signal. However, in some scenarios, the tablet 200 only supports one communication protocol and cannot support styluses using other communication protocols, and the compatibility is poor.

[0071] For example, assume that tablet 200 only supports communication protocol a, and stylus pen B uses communication protocol b. In this case, Figure 7As shown, in each coding cycle TB, stylus B codes the signal of the F3 frequency point in the TB1 period, codes the signal of the F4 frequency point in the TB2 period, codes the signal of the F3 frequency point in the TB3 period, and codes the signal of the F4 frequency point in the TB4 period. In each coding cycle TA, the tablet 200 detects the signal of the F1 frequency point in the TA1 period, detects the signal of the F2 frequency point in the TA2 period, detects the signal of the F1 frequency point in the TA3 period, and detects the signal of the F2 frequency point in the TA4 period. Since the tablet 200 detects signals in the four periods of TA1, TA2, TA3 and TA4, and the stylus B sends signals in the four periods of TB1, TB2, TB3 and TB4. And TA1 does not correspond to TB1, TA2 does not correspond to TB2, TA3 does not correspond to TB3, and TA4 does not correspond to TB4, that is, the period of time when the tablet 200 detects the signal does not correspond to the period of time when the stylus B sends the signal. Therefore, the tablet 200 cannot detect the coding signal sent by the stylus B in the detection cycle. In addition, the frequency bands of the signal at the F3 frequency point are inconsistent with the signal at the F1 frequency point, and the frequency bands of the signal at the F4 frequency point are inconsistent with the signal at the F2 frequency point. The tablet 200 only supports the analysis of the signals at the F1 frequency point and the F2 frequency point, but does not support the analysis of the signals at the F3 frequency point and the F4 frequency point, and thus cannot determine the contact position between the stylus B and the touch screen 20 of the tablet 200 based on the signals at the F3 frequency point and the F4 frequency point. In this case, the tablet 200 cannot respond to the operation of the stylus B, and there is a problem that the stylus cannot be compatible with multiple communication protocols.

[0072] In order to solve the above problems, an embodiment of the present application provides a communication method. In the method provided in the embodiment of the present application, the terminal device can pre-store a plurality of communication protocols and signal characteristics of coding signals sent by styluses using different communication protocols (such as coding cycles, coding time periods, coding signal frequencies, coding signal amplitudes, etc.). When the terminal device detects the coding signal sent by the stylus, it can collect the sample coding signal sent by the stylus, and parse and process the collected sample coding signal to obtain the signal characteristics of the sample coding signal. Then, the terminal device can compare the signal characteristics of the sample coding signal with the signal characteristics of the coding signals corresponding to the stored multiple communication protocols to determine the communication protocol (hereinafter referred to as the target communication protocol) that matches the sample coding signal. Finally, the terminal device can communicate with the stylus through the target communication protocol. In this way, the terminal device can be compatible with styluses of multiple communication protocols.

[0073] For example, the signal characteristics of the coding signals corresponding to the multiple communication protocols stored in the tablet 200 include at least (such as Figure 5 When the tablet 200 collects the signal characteristics of the coding signal corresponding to the communication protocol b, Figure 8After the stylus pen 100 sends the sample coding signal, the tablet 200 can analyze the sample coding signal to determine the signal characteristics of the sample coding signal, such as the coding cycle TB, the coding time periods TB1, TB2, TB3 and TB4 in each coding cycle, and the frequency point F3 corresponding to the coding time period TB1, the frequency point F4 corresponding to the coding time period TB2, the frequency point F3 corresponding to the coding time period TB3 and the frequency point F4 corresponding to the coding time period TB4. Then the tablet 200 compares the signal characteristics of the sample coding signal with the signal characteristics of the coding signals corresponding to the stored multiple communication protocols. Since the signal characteristics of the sample coding signal are consistent with the signal characteristics of the coding signal corresponding to the communication protocol b, the communication protocol b used by the stylus pen 100 can be determined.

[0074] In some embodiments, the signal feature of the coding signal may be at least one of the coding cycle, coding time period, frequency of the coding signal, and amplitude of the coding signal, or may be a feature obtained by extracting features of the coding signal (e.g., extracting a signal feature vector of the coding signal, extracting time domain features / frequency domain features of the coding signal, etc.), or may be other signal features that can identify different coding signals. The specific form of the signal feature of the sample coding signal is not limited in the embodiments of the present application.

[0075] Fig. 9 An example flow chart of the communication method provided in an embodiment of the present application.

[0076] like Fig. 9 As shown, the communication method includes the following steps:

[0077] S101: The terminal device collects a first signal sent by the stylus pen.

[0078] The first signal may be a sample coding signal sent by the stylus. For ease of understanding, the sample coding signal is described below as the first signal.

[0079] The terminal device of the embodiment of the present application can be a terminal device with a touch screen, such as a tablet, a mobile phone, a computer, a smart watch, a smart bracelet, etc.

[0080] In some embodiments, the stylus pen can continuously send coding signals directly according to the coding method corresponding to the currently used communication protocol during the working state.

[0081] In other embodiments, the terminal device may continuously send signals to the stylus through multiple electrodes provided on the touch screen (the "signal sent by the terminal device to the stylus" is referred to as the "uplink signal" in this article). The closer the distance between the tip of the stylus and the touch screen, the stronger the signal strength of the uplink signal received by the stylus. Conversely. The farther the distance between the tip of the stylus and the touch screen, the weaker the signal strength of the uplink signal received by the stylus. Therefore, the signal strength of the uplink signal received by the stylus can reflect the distance between the stylus and the touch screen. When the signal strength of the received uplink signal is strong, for example, when the received uplink signal is greater than a set threshold, the stylus can continuously send coding signals according to the coding method corresponding to the currently used communication protocol.

[0082] In some embodiments, the terminal device can detect the coding signal sent by the stylus through multiple electrodes set on the touch screen, and when the coding signal sent by the stylus is detected, the coding signal of the set duration sent by the stylus is collected as a sample coding signal, so as to determine the communication protocol used by the stylus based on the signal characteristics of the sample coding signal. In order to determine the coding cycle of the stylus based on the sample coding signal, the set duration should be at least greater than 3 times the coding cycle.

[0083] S102: The terminal device parses the signal characteristics of the first signal.

[0084] The signal characteristics of the sample coding signal may include characteristics such as the coding cycle, the coding time period, the frequency of the coding signal, and the amplitude of the coding signal.

[0085] After the terminal device collects the sample coding signal sent by the stylus, it can parse and process the collected sample coding signal to obtain the signal characteristics of the sample coding signal, and then determine the communication protocol used by the stylus according to the signal characteristics of the sample coding signal.

[0086] S103: Compare the signal characteristics of the first signal with the signal characteristics corresponding to the plurality of stored communication protocols to determine a target communication protocol that matches the first signal from the plurality of communication protocols.

[0087] The terminal device of the embodiment of the present application pre-stores the signal characteristics of the coding signals corresponding to the communication protocols of multiple styluses. After the terminal device obtains the signal characteristics of the sample coding signal, it can compare the signal characteristics of the sample coding signal with the coding signals corresponding to the stored multiple communication protocols to determine the communication protocol that matches the sample coding signal as the target communication protocol.

[0088] For example, it is assumed that the terminal device pre-stores the signal characteristics of the coding signal corresponding to the communication protocol a used by stylus A, the communication protocol b used by stylus B, the communication protocol c used by stylus C, and the communication protocol d used by stylus D. Among them, the communication protocol a can refer to the above Figure 4 For the introduction of communication protocol b, please refer to the above Figure 5 The introduction of will not be repeated here.

[0089] For communication protocol c, such as Fig.10 As shown, when the stylus C uses the communication protocol c, the stylus C sends a coding signal of the F5 frequency in the TC1 period, sends a coding signal of the F6 frequency in the TC2 period, sends a coding signal of the F5 frequency in the TC3 period, and sends a coding signal of the F6 frequency in the TC4 period in each coding cycle TC. Among them, the cycle time TC is the working cycle when the stylus C uses the communication protocol c, that is, the stylus C performs a coding task every time the time period TC is exceeded.

[0090] For communication protocol d, such as Fig.10 As shown, when the stylus pen D uses the communication protocol d, in each coding period TD, a coding signal of the F1 frequency is sent in the TD1 period, a coding signal of the F2 frequency is sent in the TD2 period, a coding signal of the F1 frequency is sent in the TD3 period, and a coding signal of the F2 frequency is sent in the TD4 period. Among them, the coding period TD is the working period when the stylus pen D uses the communication protocol d, that is, the stylus pen D performs a coding task every time period TD.

[0091] If the signal characteristics of the sample coding signal collected by the terminal device are consistent with the signal characteristics corresponding to communication protocol a, it can be determined that the stylus pen uses communication protocol a. In other words, if the working cycle of the sample coding signal is TA, and the frequencies corresponding to the TA1 period, TA2 period, TA3 period, and TA4 period of the sample coding signal are F1 frequency point, F2 frequency point, F1 frequency point, and F2 frequency point, respectively, it can be determined that the stylus pen uses communication protocol a.

[0092] If the signal characteristics of the sample coding signal collected by the terminal device are consistent with the signal characteristics corresponding to communication protocol b, it can be determined that the stylus pen uses communication protocol b. In other words, if the working cycle of the sample coding signal is TB, and the frequencies corresponding to the TB1 period, TB2 period, TB3 period, and TB4 period of the sample coding signal are F3 frequency point, F4 frequency point, F3 frequency point, and F4 frequency point, respectively, it can be determined that the stylus pen uses communication protocol b.

[0093] If the signal characteristics of the sample coding signal collected by the terminal device are consistent with the signal characteristics corresponding to the communication protocol C, it can be determined that the stylus pen uses the communication protocol C. In other words, if the working cycle of the sample coding signal is TC, and the frequencies corresponding to the TC1 period, TC2 period, TC3 period, and TC4 period of the sample coding signal are F5 frequency point, F6 frequency point, F5 frequency point, and F6 frequency point, respectively, it can be determined that the stylus pen uses the communication protocol C.

[0094] If the signal characteristics of the sample coding signal collected by the terminal device are consistent with the signal characteristics corresponding to the communication protocol d, it can be determined that the stylus pen uses the communication protocol d. In other words, if the working cycle of the sample coding signal is TD, and the frequencies corresponding to the TD1 period, TD2 period, TD3 period, and TD4 period of the sample coding signal are F1 frequency point, F2 frequency point, F1 frequency point, and F2 frequency point, respectively, it can be determined that the stylus pen uses the communication protocol d.

[0095] exist Figure 6 Based on the above example, the terminal device can analyze multiple special time periods of the collected sample coding signal to obtain the frequency characteristics of each special time period, and then determine the communication protocol used by the stylus according to the analyzed frequency characteristics.

[0096] like Fig.11 As shown, stylus A and stylus B have different coding frequencies in the corresponding coding frequency bands. For example, the coding frequency of stylus A in the TA1 period is F1, while the coding frequency of stylus B in the TB1 period corresponding to the TA1 period is F3. In addition, the coding period of stylus A overlaps with the coding period of stylus B. For example, the TA1 period of the coding signal of stylus A overlaps with the TB1 period of the coding signal of stylus B in the T1 period. Based on this, the T1 period can be used as a special period to be analyzed.

[0097] like Fig.12 As shown, the coding frequency of stylus A and stylus C is different. For example, the coding frequency of stylus A in the TA1 period is F1, while the coding frequency of stylus C in the TC1 period corresponding to the TA1 period is F5. In addition, the coding period of stylus A does not overlap with the coding period of stylus C. For example, the TC1 period of the coding signal of stylus C is between the interval period T2 of the TA1 period and the TA2 period of the coding signal of stylus A. Based on this, the T2 period can be used as a special period to be analyzed.

[0098] like Fig.13As shown, the coding frequency of stylus A and stylus D is the same, for example, the coding frequency of stylus A in the TA1 period is F1, and the coding frequency of stylus D in the TD1 period corresponding to the TA1 period is also F1. The coding period of stylus A overlaps with the coding period of stylus D, for example, the TA1 period of the coding signal of stylus A overlaps with the TD1 period of the coding signal of stylus D, where the TA1 period is T3 periods ahead of the TD1 period, and the TD1 period is T4 periods behind the TA1 period. Based on this, the T4 period can be used as a special period to be analyzed.

[0099] In some embodiments, after the terminal device collects the sample coding signal of the stylus, the sample coding signal can be analyzed in the T1 period, T2 period, and T4 period respectively. When the terminal device analyzes the frequency point F1 in the T1 period, it can be determined that the stylus uses communication protocol a, that is, the stylus is stylus A. When the terminal device analyzes the frequency point F3 in the T1 period, it can be determined that the stylus uses communication protocol b, that is, the stylus is stylus B. When the terminal device analyzes the frequency point F5 in the T2 period, it can be determined that the stylus uses communication protocol c, that is, the stylus is stylus C. When the terminal device analyzes the frequency point F1 in the T4 period, it can be determined that the stylus uses communication protocol d, that is, the stylus is stylus D.

[0100] It should be noted that the communication protocol a, communication protocol b, communication protocol c and communication protocol d described in the embodiments of the present application are only for illustrative purposes and are not intended to limit the present application.

[0101] S104: The terminal device detects a touch signal sent by the stylus through a target communication protocol.

[0102] The touch signal may be a coding signal.

[0103] In the embodiment of the present application, the terminal device has pre-built-in communication protocols for multiple styluses, and can support the use of multiple communication protocols. Moreover, each communication protocol corresponds to a working mode. When the terminal device uses a certain communication protocol, it can enter the working mode corresponding to the communication protocol. After the terminal device determines the communication protocol used by the stylus, that is, the target protocol, it can enter the working mode corresponding to the target communication protocol to detect the coding signal sent by the stylus according to the timing corresponding to the target communication protocol, so that the stylus can interact with the touch screen of the terminal device.

[0104] For example, Fig.14 As shown, when the terminal device determines that the stylus pen uses communication protocol b, that is, the stylus pen is stylus pen B, the terminal device uses communication protocol b to communicate with stylus pen B. Fig.14As shown, the terminal device detects the coding signal sent by the stylus B according to the coding method corresponding to the communication protocol b, that is, the coding signal sent by the stylus is detected according to the timing corresponding to the communication protocol b. For example, in each time period TB, the F3 frequency point is detected in the TB1 period, the F4 frequency point is detected in the TB2 period, the F3 frequency point is detected in the TB3 period, and the F4 frequency point is detected in the TB4 period.

[0105] In an embodiment of the present application, a plurality of communication protocols and signal characteristics of coding signals corresponding to the plurality of communication protocols are pre-stored in the terminal device. The terminal device can collect a sample coding signal sent by the stylus, and then compare the signal characteristics of the sample coding signal with the signal characteristics of the coding signals corresponding to the plurality of stored communication protocols, so as to determine the communication protocol that matches the sample coding signal as the target communication protocol. Finally, the terminal device can communicate with the stylus through the target communication protocol. In this way, the terminal device can be compatible with styluses of a plurality of communication protocols.

[0106] In some embodiments, the terminal device and the stylus pen can also be wirelessly connected through Bluetooth, wireless local area network and other communication methods, and then the stylus pen can send information about the communication protocol it uses to the terminal device through the communication method. After the terminal device receives the information about the communication protocol sent by the stylus pen, it determines the communication protocol used by the stylus pen based on the communication protocol, and then uses the communication protocol to communicate with the stylus pen.

[0107] In order to match styluses with different communication protocols, the terminal device can switch to the corresponding pen working mode after determining the communication protocol of the stylus. Among them, the pen working mode is the working mode when the terminal device and the stylus use the same communication protocol. After the terminal device switches to the pen working mode corresponding to the stylus, it can respond to the stylus operation on the touch screen of the terminal device.

[0108] The following is an example of the terminal device analyzing the collected coding signal during the T1 period to illustrate the process of switching the pen working mode of the terminal device.

[0109] Fig.15 An example diagram of the process of switching the pen working mode of a terminal device provided in an embodiment of the present application.

[0110] like Fig.15 As shown, the terminal device switches the pen working mode including the following steps:

[0111] S201: The terminal device collects a first signal sent by the stylus pen.

[0112] The first signal may be a coding signal.

[0113] Step S201 is substantially the same as the above-mentioned step S101 and will not be described again here.

[0114] S202: The terminal device decodes the T1 period of the first signal.

[0115] For example, Fig.11 As shown, after the terminal device collects the coding signal sent by the stylus, it can decode (parse) the T1 period of the collected coding signal to determine the communication protocol used by the stylus based on the decoding result.

[0116] S203: The terminal device decodes to frequency point F1.

[0117] For example, Fig.11 As shown, if the communication protocol used by the stylus is communication protocol a, the stylus will send a signal at the F1 frequency point during the T1 period. In this case, the terminal device can resolve the T1 period of the coding signal sent by the stylus to the frequency point F1.

[0118] S204: The terminal device maintains the pen A working mode.

[0119] In some embodiments, when the terminal device resolves the frequency point F1 in the T1 period of the coding signal sent by the stylus pen, it can be determined that the stylus pen uses communication protocol a and the stylus pen is stylus pen A. If the terminal device is currently in pen A working mode, the terminal device maintains pen A working mode. It can be understood that the communication protocol used by the terminal device in pen A working mode is communication protocol a, which is consistent with the communication protocol used by stylus pen A, and stylus pen A can interact with the touch screen of the terminal device.

[0120] S205: The terminal device decodes to frequency point F3.

[0121] For example, Fig.11 As shown, if the communication protocol used by the stylus is communication protocol b, the stylus will send a signal at frequency F3 during period T1. In this case, the terminal device can resolve the coding signal sent by the stylus to frequency F3 during period T1.

[0122] S206: The terminal device switches to pen B working mode.

[0123] In some embodiments, when the terminal device resolves the signal of the F3 frequency point in the T1 period of the coding signal sent by the collected stylus, it can be determined that the stylus uses communication protocol b and the stylus is stylus A. If the terminal device is currently in pen A working mode, the terminal device can switch to pen B working mode. It can be understood that the communication protocol used by the terminal device in pen B working mode is communication protocol b, which is consistent with the communication protocol used by the stylus. At this time, stylus B can interact with the touch screen of the terminal device.

[0124] In order to enhance user perception, after determining the communication protocol used by the stylus, the terminal device may display corresponding prompt information on the touch screen to prompt the user to recognize the new stylus and whether to use the new stylus.

[0125] For example, Fig.16 As shown, the tablet 200 (as an example of a terminal device) is currently in the pen A working mode. When the tablet 200 recognizes that the communication protocol used by the stylus is the communication protocol b, it can be determined that the stylus is stylus B. At this time, when the tablet 200 receives the pairing instruction, the tablet 200 can pair with the stylus B, and after the pairing is completed, the current working mode is switched from the pen A working mode to the pen B working mode.

[0126] The pairing instruction may be an operation instruction, a voice instruction or the like.

[0127] For example, when the tablet 200 recognizes that the communication protocol used by the stylus pen is communication protocol b, a prompt interface 21 may be displayed on the touch screen 20 of the tablet 200. The prompt interface 21 may include prompt information, such as "whether to use stylus pen B" and other information. When the user clicks the confirmation button M1 on the prompt interface 21, the tablet 200 generates a pairing instruction (specifically, an operation instruction) and sends the pairing instruction to itself. After receiving the pairing instruction, the tablet 200 pairs with stylus pen B in response to the pairing instruction.

[0128] For another example, when the tablet 200 receives a voice message such as "confirm pairing" spoken by the user, the tablet 200 may generate a corresponding pairing instruction based on the voice message and send the pairing instruction to itself. After receiving the pairing instruction, the tablet 200 may pair with the stylus B. After the tablet 200 and the stylus B are paired, the tablet 200 may interact with the stylus B.

[0129] In other examples, the tablet 200 may also be paired with the stylus B in response to receiving other types of instructions, which is not limited to this.

[0130] In an embodiment of the present application, after the terminal device identifies the communication protocol used by the stylus pen, it can switch to a corresponding pen working mode to support the use of the stylus pen in the corresponding pen working mode.

[0131] In the embodiment of the present application, the terminal device may include multiple working modes, such as non-pen working mode (default working mode), pen working mode, hand working mode, noise detection working mode, etc. Among them, the pen working mode may include pen A working mode, pen B working mode, pen C working mode and other working modes of the stylus supported by the terminal device.

[0132] The non-pen working mode is introduced below.

[0133] Fig.17 This is an example diagram of a non-pen working mode provided in an embodiment of the present application.

[0134] like Fig.17 As shown, in the non-pen working mode, the working cycle of the terminal device is T. The terminal device can detect the pen signal, hand signal and noise once in each time period T. For example, in each cycle time T, the terminal device detects the pen signal in the t1 period, detects the hand signal in the t2 period and detects the noise in the t3 period. Among them, the pen signal is the coding signal sent by the stylus, and the hand signal is the signal generated by the electrode on the touch screen when the finger touches the touch screen of the terminal device. Noise is a signal generated by the external environment, for example, the signal generated by the electrode on the touch screen when the charger is connected to the terminal device.

[0135] In other examples, in the non-pen working mode, the terminal device may also detect the pen signal and hand signal only once in each time period T, and not detect noise. Alternatively, in order to save power consumption of the terminal device, the terminal device may not detect noise, and no longer detect the pen signal once in each time period T, but detect the pen signal once every N (for example, 1, 2, 3, etc.) time periods T. When the terminal device detects the pen signal in the non-pen working mode, the terminal device may enter the corresponding pen working mode. For example, Fig.18As shown, when the terminal device detects the pen signal (i.e., the coding signal) of the stylus pen A in the non-pen working mode, the terminal device can enter the pen A working mode, that is, the working mode corresponding to the communication protocol a. After the terminal device enters the pen A working mode, in each cycle time TA, the terminal device can detect the signal of the F1 frequency point in the TA1 period, the signal of the F2 frequency point in the TA2 period, the signal of the F1 frequency point in the TA3 period, and the signal of the F2 frequency point in the TA4 period. In addition, the terminal device can also detect hand signals between adjacent signal detection periods, for example, the terminal device can detect hand signals between the TA1 period and the TA2 period, between the TA2 period and the TA3 period, and between the TA3 and the TA4 period in each cycle time TA. Alternatively, the terminal device can also detect the hand signal only once in each time period TA, for example, the terminal device detects a hand signal once between the TA1 period and the TA2 period, or between the TA2 period and the TA3 period, or between the T3 period and the T4 period. Alternatively, the terminal device may also detect hand signals twice in each time period TA, for example, the terminal device detects a hand signal once between the TA1 period and the TA2 period, and once between the TA2 period and the TA3 period. Alternatively, the terminal device detects a hand signal once between the TA1 period and the TA2 period, and once between the TA3 period and the TA4 period. Alternatively, the terminal device detects a hand signal once between the TA2 period and the TA3 period, and once between the TA3 period and the TA4 period. In this way, when the user uses a finger to operate on the touch screen of the terminal device, the terminal device can detect the corresponding hand signal, and then respond to the user's operation based on the hand signal.

[0136] For another example, when the terminal device detects the pen signal of stylus B, the terminal device can enter the working mode corresponding to the communication protocol b used by stylus B, that is, the pen B working mode. When the terminal device detects the pen signal of stylus C, the terminal device can enter the working mode corresponding to the communication protocol c used by stylus C, that is, the pen C working mode. When the terminal device detects the pen signal of stylus D, the terminal device can enter the working mode corresponding to the communication protocol d used by stylus D, that is, the pen D working mode.

[0137] Fig.19The schematic diagram of the structure of the terminal device 1000 is shown. The terminal device 1000 may be a terminal device supporting touch operation such as a mobile phone, a tablet, a computer, a smart watch, a smart bracelet, etc. mentioned in the present application. The terminal device 1000 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0138] Among them, the internal memory 121 can be used to store communication protocols of multiple styluses, so that the terminal device 1000 can support multiple styluses, such as stylus A, stylus B, stylus C, stylus D, etc.

[0139] The wireless communication module 160 can be used to collect the coding signal sent by the stylus. When the internal circuit of the stylus sends a coding signal, the terminal device 1000 can collect the coding signal sent by the stylus through the wireless communication module 160 to determine the communication protocol used by the stylus according to the coding signal.

[0140] The display screen 194 may be the touch screen mentioned in the present application. The display screen 194 supports touch operations of a stylus and a finger. When a user uses a stylus to operate on the display screen 194, the display screen 194 may respond accordingly. For example, when a user uses a stylus to write or draw on the display screen 194, the display screen 194 may display corresponding sliding marks. Electrodes are provided on the display screen 194, and when a user touches the display screen 194 with a finger, the electrodes on the display screen 194 may generate corresponding signals, that is, hand signals. When the wireless communication module 160 of the terminal device 1000 collects hand signals generated by electrodes on the display screen 194, the terminal device 1000 may respond to the operation of the finger on the display screen 194 based on the collected hand signals.

[0141] The processor 110 is used to parse and process the coding signal collected by the wireless communication module 160 when executing the instructions stored in the internal memory 121, and determine the communication protocol used by the stylus based on the analysis result, and then control the terminal device 1000 to switch the current communication protocol to the same communication protocol as the stylus.

[0142] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 1000. In other embodiments of the present application, the terminal device 1000 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0143] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). In some embodiments, the processor 110 may include one or more interfaces. The interface 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, and a subscriber identity module (SIM) interface.

[0144] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB connector 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 1000. While the charging management module 140 is charging the battery 142, it may also power the terminal device through the power management module 141.

[0145] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0146] The wireless communication function of the terminal device 1000 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0147] Antenna 1 and antenna 2 are used to send and receive electromagnetic wave signals. Each antenna in terminal device 1000 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0148] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 1000. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, and filter, amplify and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0149] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0150] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 1000. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0151] In some embodiments, antenna 1 of terminal device 1000 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that terminal device 1000 can communicate with the network and other devices through wireless communication technology.

[0152] The terminal device 1000 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0153] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the terminal device 1000 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0154] The terminal device 1000 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0155] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 1000. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0156] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 1000 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, etc. The processor 110 executes various functional applications and data processing of the terminal device 1000 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0157] The various embodiments disclosed in the present application may be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application may be implemented as a computer program or program code executed on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0158] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application specific integrated circuit, or a microprocessor.

[0159] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0160] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, a floppy disk, an optical disk, an optical disk, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic card or an optical card, a flash memory, or a tangible machine-readable memory for transmitting information (e.g., a carrier wave, an infrared signal, a digital signal, etc.) using the Internet in an electrical, optical, acoustic, or other form of propagation signal. Accordingly, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).

[0161] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0162] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0163] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.

[0164] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0165] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.

Claims

1. A communication method, used for a terminal device, characterized in that: include: collecting a first signal sent by the stylus; parsing a signal feature of the first signal; Comparing the signal characteristics of the first signal with the signal characteristics corresponding to the plurality of stored communication protocols to determine a target communication protocol that matches the first signal from the plurality of communication protocols; The touch signal sent by the touch pen is detected through the target communication protocol.

2. The method according to claim 1, characterized in that The detecting the touch signal sent by the stylus through the target communication protocol includes: Based on the timing corresponding to the target communication protocol, a touch signal sent by the stylus is detected.

3. The method according to claim 2, characterized in that The detecting the touch signal sent by the stylus comprises: A first instruction is detected, wherein the first instruction is used to instruct the terminal device to pair with the stylus; Pairing with the stylus pen is performed through the target communication protocol, and after pairing is completed, detecting the touch signal sent by the stylus pen.

4. The method according to claim 3, characterized in that The detecting of the first instruction comprises: Detecting that a user confirms an operation of pairing with the stylus pen on a display interface of the terminal device; Or a voice message is received from the user confirming pairing with the stylus.

5. The method according to claim 1, characterized in that The signal characteristics include at least one of the following: period, frequency, time period, and amplitude.

6. The method according to claim 1, characterized in that The terminal device includes a plurality of electrodes; and the method further includes: Based on the strength of the touch signal detected by the multiple electrodes, the touch position of the stylus on the touch screen of the terminal device is determined.

7. The method according to claim 1, characterized in that The step of parsing the signal feature of the first signal includes: A first frequency point corresponding to at least one signal in a first time period in the first signal is determined.

8. The method according to claim 7, characterized in that The comparing the signal feature of the first signal with the signal features corresponding to the stored multiple communication protocols to determine a target communication protocol matching the first signal from the multiple communication protocols includes: A communication protocol among the multiple communication protocols, whose frequency in the first time period is the same as the first frequency, is determined as the target communication protocol.

9. A terminal device, characterized in that: include: a memory for storing instructions executed by one or more processors of the terminal device; A processor, when the processor executes the instructions in the memory, can enable the terminal device to execute the communication method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the communication method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Stylus pen with dynamic protocol selection for communication with digitizer

    CN108139820A

  • Noise detection method, active pen and screen

    CN112000248A

  • Anti-interference method, touch chip and active pen chip

    CN112905047A

  • Touch detection method and device, chip and electronic equipment

    CN113110763A

  • Signal processing method, device and system

    CN115047990A