Capacitance pen writing data recovery method, terminal device and readable storage medium
By retrieving historical writing data to determine the hardware information of the capacitive pen during the writing process if the capacitive screen does not receive downlink data, the problem of long reconnection time after the capacitive pen communication is interrupted is solved, and the technical effect of rapid reconnection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-03-27
AI Technical Summary
When a capacitive stylus is paired with a capacitive screen, communication is interrupted, and the reconnection process takes a long time, resulting in broken writing lines.
If the capacitive screen does not receive downlink data for more than a preset time during the writing process of the capacitive pen, the connection is determined to be interrupted. Historical writing data is obtained to determine the last downlink data, and the hardware information of the capacitive pen is determined based on the data to quickly re-establish the connection.
It enables rapid reconnection after capacitive pen communication is interrupted, reducing waiting time and latency, and improving connection efficiency.
Smart Images

Figure CN116185222B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent devices, in particular to a capacitive pen writing data recovery method, a terminal device and a computer readable storage medium. BACKGROUND
[0002] With the progress of the times, electronic products with touch input functions such as mobile phones, computers, tablets, and car navigation systems are becoming increasingly widespread. Such products are provided with a capacitive touch panel on the display screen, and users can use the touch panel to operate such electronic products using their fingers. However, when fine writing or fine drawing is required, a capacitive pen is needed to operate the screen.
[0003] However, during the pairing use of the capacitive pen and the capacitive screen, there is a communication interruption. If the communication is interrupted and then reconnected, the capacitive screen needs to send a connection frequency to the capacitive pen, obtain the hardware information of the capacitive pen, and reestablish a communication connection with the capacitive pen. This process takes a long time, which will cause the capacitive pen writing to be disconnected. SUMMARY
[0004] The embodiments of the present application provide a capacitive pen writing data recovery method, a terminal device and a computer readable storage medium, which solve the technical problem of long waiting time and high delay when reconnecting after communication interruption of the capacitive pen in the prior art, and achieve the technical effect of quickly reconnecting after communication interruption of the capacitive pen.
[0005] The embodiments of the present application provide a capacitive pen writing data recovery method, which comprises:
[0006] In the capacitive pen writing process, if the capacitive screen end does not receive downlink data for more than a first preset time, it is determined that the capacitive pen connection is interrupted;
[0007] Obtain historical writing data, and determine the last downlink data received by the capacitive screen end according to the historical writing data;
[0008] Determine the hardware information of the capacitive pen according to the last downlink data;
[0009] Reconnect the capacitive pen according to the hardware information.
[0010] Optionally, the step of determining the last downlink data received by the capacitive screen end according to the historical writing data comprises:
[0011] Obtain the current system time of the capacitive screen end;
[0012] Determine the last downlink data according to the current system time, the first preset time and the associated time node of the downlink data in the historical writing data.
[0013] Optionally, the step of determining the last downlink data according to the current system time, the first preset time and the associated time node of downlink data in the historical writing data comprises:
[0014] acquiring the last downlink data and detecting whether the last downlink data contains writing data;
[0015] if the last downlink data contains writing data, performing the step of determining the hardware information of the capacitive pen according to the last downlink data;
[0016] otherwise, taking the last downlink data adjacent to the last downlink data as new last downlink data and performing the step of detecting whether the last downlink data contains writing data.
[0017] Optionally, the step of determining that the connection of the capacitive pen is interrupted when the capacitive screen end does not receive downlink data within the first preset time during the writing process of the capacitive pen comprises:
[0018] the step of determining that the connection of the capacitive pen is interrupted when the capacitive screen end does not receive downlink data within the first preset time during the writing process of the capacitive pen comprises:
[0019] determining the first preset time according to the time difference, the first preset time being twice the time difference.
[0020] Optionally, the step of determining that the connection of the capacitive pen is interrupted when the capacitive screen end does not receive downlink data within the first preset time during the writing process of the capacitive pen comprises:
[0021] the step of determining that the connection of the capacitive pen is interrupted when the capacitive screen end does not receive downlink data within the first preset time during the writing process of the capacitive pen further comprises:
[0022] Optionally, the step of re-connecting the capacitive pen according to the hardware information comprises:
[0023] when receiving downlink data corresponding to the uplink data, completing communication with the capacitive pen.
[0024] Optionally, after the step of sending uplink data to the capacitive pen corresponding to the hardware information, the method further comprises:
[0025] if the downlink data corresponding to the uplink data is not received within a third preset time, determining that the connection with the capacitive pen is interrupted;
[0026] Start the matching mode, and reconnect with the capacitive pen when a capacitive pen matching request is received or a matchable capacitive pen is found.
[0027] Optionally, after the step of determining that the capacitive pen connection is interrupted when the capacitive screen end does not receive the downlink data within the first preset time during the capacitive pen writing process, the method comprises the following steps of:
[0028] According to the corresponding data content in the historical writing data and the change trend of the data content, the downlink data to be received is determined.
[0029] According to the downlink data to be received, writing data is generated.
[0030] In addition, the application also provides a terminal device, which comprises a memory, a processor, and a capacitive pen writing data recovery program stored in the memory and executable on the processor, and the processor implements the steps of the capacitive pen writing data recovery method when executing the capacitive pen writing data recovery program.
[0031] In addition, the application also provides a computer readable storage medium, which stores a capacitive pen writing data recovery program, and the capacitive pen writing data recovery program implements the steps of the capacitive pen writing data recovery method when executed by a processor.
[0032] The one or more technical solutions provided in the embodiments of the application have at least the following technical effects or advantages:
[0033] 1. Since the step of determining that the capacitive pen connection is interrupted when the capacitive screen end does not receive the downlink data within the first preset time during the capacitive pen writing process, obtaining historical writing data, determining the last downlink data received by the capacitive screen end according to the historical writing data, determining the hardware information of the capacitive pen according to the last downlink data, and reconnecting with the capacitive pen according to the hardware information are adopted, the technical problem of long waiting time and high delay when reconnecting after the communication of the capacitive pen is interrupted in the prior art is effectively solved, and the technical effect of quickly reconnecting after the communication of the capacitive pen is interrupted is achieved.
[0034] 2. By employing the method of acquiring the last downlink data and detecting whether it contains writing data; if writing data is included, the step of determining the hardware information of the capacitive pen based on the last downlink data is executed; otherwise, the downlink data of the previous frame adjacent to the last downlink data is used as the new last downlink data, and the step of detecting whether it contains writing data is executed. Therefore, the technical problem of high latency caused by the need to reacquire a large amount of data after the communication between the capacitive pen and the capacitive screen is interrupted in the prior art is effectively solved, thereby achieving the technical effect of reconnection by exchanging only a small amount of data. Attached Figure Description
[0035] Figure 1 This is a flowchart illustrating Embodiment 1 of the capacitive pen writing data recovery method of this application;
[0036] Figure 2 This is a flowchart illustrating Embodiment 2 of the capacitive pen writing data recovery method of this application;
[0037] Figure 3 This is a schematic diagram of the terminal structure of the hardware operating environment involved in one embodiment of this application. Detailed Implementation
[0038] In related technologies, communication interruptions can occur during the pairing of a capacitive pen and a capacitive screen. If reconnection is required after an interruption, the capacitive screen needs to send a connection frequency to the pen, obtain the pen's hardware information, and re-establish the communication connection. This process is time-consuming. This application, however, determines the last downlink data received by the capacitive screen based on historical writing data after a communication interruption is detected; it then determines the pen's hardware information based on the downlink data and reconnects the pen to the screen. This achieves the technical effect of rapid reconnection after a communication interruption.
[0039] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0040] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0041] Example 1
[0042] This embodiment provides a method for recovering data written with a capacitive pen. (Refer to...) Figure 1The method for recovering writing data of the capacitive pen comprises the following steps:
[0043] In step S110, if the capacitive screen does not receive the downlink data within the first preset time during the writing process of the capacitive pen, it is determined that the connection of the capacitive pen is interrupted.
[0044] In the embodiment, the writing process refers to the state in which the capacitive pen and the capacitive screen still exchange data related to the writing state; and the downlink data refers to the data sent by the capacitive pen to the capacitive screen.
[0045] Optionally, step S110 comprises the following steps:
[0046] In step S111, the time difference between the adjacent two frames of downlink data is determined according to the historical writing data.
[0047] In step S112, the first preset time is determined according to the time difference, and the first preset time is twice the time difference.
[0048] As an optional real-time method, the historical time difference between the adjacent two frames of downlink data in the historical data is determined, and the time difference is calculated according to a preset algorithm combined with the historical time difference; and twice the calculated time difference is taken as the first preset time.
[0049] For example, the average value of the historical time difference is taken as the calculated time difference.
[0050] Optionally, step S110 further comprises the following steps:
[0051] In step S113, if the capacitive screen does not receive the first downlink data fed back by the capacitive pen within the second preset time after sending the first uplink data to the capacitive pen, the first uplink data is sent to the capacitive pen again, and if the first downlink data is still not received within the second preset time, it is determined that the writing is interrupted.
[0052] As an optional embodiment, the capacitive screen and the capacitive pen have data interaction with each other, and if the first downlink data fed back by the capacitive pen to the first uplink data is not received within the second preset time after the capacitive screen sends the first uplink data to the capacitive pen, the capacitive screen sends the first uplink data again, and if the first downlink data is still not received within the second preset time, it is determined that the writing is interrupted.
[0053] Optionally, after step S110, the method further comprises the following steps:
[0054] In step S114, the to-be-received downlink data is determined according to the corresponding data content in the historical writing data and the change trend of the data content.
[0055] Step S115, generating writing data according to the to-be-received downlink data.
[0056] In the embodiment, since the data interaction mode and content between the capacitive pen and the capacitive screen are predetermined, the change trend of the data content can be predicted.
[0057] As an optional implementation, the corresponding data content and the change trend of the data content are determined according to the obtained historical writing data, the to-be-received downlink data is determined according to the change trend, and the writing data is generated according to the to-be-received downlink data.
[0058] For example, the to-be-received downlink data is determined according to the determined change trend of the data content and the uplink data sent by the capacitive screen to the capacitive pen in the last frame.
[0059] Step S120, obtaining historical writing data, and determining the last downlink data received by the capacitive screen according to the historical writing data.
[0060] As an optional implementation, the historical writing data between the capacitive pen and the capacitive screen is obtained, and the last frame of downlink data received by the capacitive screen is determined according to the historical writing data.
[0061] Step S130, determining the hardware information of the capacitive pen according to the last downlink data.
[0062] Step S140, re-connecting the capacitive pen according to the hardware information.
[0063] Optionally, step S140 includes:
[0064] Step S141, sending uplink data to the capacitive pen corresponding to the hardware information.
[0065] Step S142, when receiving downlink data corresponding to the uplink data, completing communication with the capacitive pen.
[0066] In the embodiment, compared with the related art, when the capacitive pen and the capacitive screen are disconnected and then want to be connected, at least the frequency of the capacitive pen is determined according to environmental signal noise, and the product number, size, color, and tilt angle of the capacitive pen are determined, and then the capacitive pen is connected, which leads to high delay. In the embodiment, the complicated information is removed, the connection is completed first, and then the information of other handwriting pens is obtained, so the hardware information is selected, and the hardware information is determined according to the last downlink data, that is, the hardware information is determined according to the historical writing data, so that the data interaction time is further reduced, and the matching efficiency is further improved.
[0067] As an optional implementation, the hardware information of the capacitive pen is determined according to the last downlink data, the uplink data is sent to the capacitive pen corresponding to the hardware information, and the capacitive pen feeds back the corresponding downlink data to the capacitive screen in response to the data content of the uplink data after receiving the uplink data. The capacitive screen completes the communication with the capacitive pen when receiving the downlink data.
[0068] For example, the hardware information includes but is not limited to product identification, number of keys, production date, structure size, color, etc. of the capacitive pen.
[0069] Optionally, after step S141, the method further includes:
[0070] In step S143, if the downlink data corresponding to the uplink data is not received within a third preset time, it is determined that the capacitive pen is disconnected.
[0071] In step S144, the matching mode is started, and when the capacitive pen matching request is received or the matching capacitive pen is found, the connection with the capacitive pen is re-established.
[0072] As an optional implementation, if the downlink data fed back by the capacitive pen is not received within the third preset time, it is determined that the capacitive pen is disconnected from the capacitive screen. At this time, the matching mode is started, and when the capacitive pen matching request is received or the matching capacitive pen is found, the connection with the capacitive pen is re-established.
[0073] The technical solutions in the embodiments of the present application have at least the following technical effects or advantages:
[0074] Since the connection of the capacitive pen is determined to be interrupted when the downlink data is not received by the capacitive screen within a first preset time during the writing of the capacitive pen, the last downlink data received by the capacitive screen is determined according to the historical writing data, the hardware information of the capacitive pen is determined according to the last downlink data, and the connection with the capacitive pen is re-established according to the hardware information, the technical problem of long waiting time and high delay in the prior art when the capacitive pen is reconnected after the communication interruption is effectively solved, and the technical effect of quickly reconnecting the capacitive pen after the communication interruption is achieved.
[0075] Embodiment two
[0076] Based on embodiment one, the capacitive pen writing data recovery method according to the embodiment two of the present application includes the following steps:
[0077] In step S210, the current system time of the capacitive screen is obtained.
[0078] Step S220, determining the last downlink data according to the current system time, the first preset time and the associated time node of the downlink data in the historical writing data.
[0079] In the embodiment, the capacitive screen end can be a capacitive screen with time display function, so the system time of the capacitive screen end can be acquired; when the capacitive screen end is only a handwriting board, the system time of the terminal connected with the handwriting board is acquired.
[0080] Optionally, referring to Figure 2 , step S220 comprises:
[0081] Step S221, acquiring the last downlink data and detecting whether the last downlink data contains writing data;
[0082] Step S222, if the last downlink data contains writing data, executing the step of determining the hardware information of the capacitive pen according to the last downlink data;
[0083] Step S223, otherwise, taking the last downlink data adjacent to the last downlink data as new last downlink data and executing the step of detecting whether the last downlink data contains writing data.
[0084] As an optional embodiment, the system time of the capacitive screen end is acquired, the first preset time is reversely deduced according to the system time, the historical writing data at the time point is acquired, the last downlink data corresponding to the historical writing data is taken as the last downlink data, whether the last downlink data contains writing data is determined, when the last downlink data contains writing data, the hardware information of the capacitive pen is determined according to the last downlink data and the subsequent steps are executed. If the last downlink data does not contain writing data, the last downlink data adjacent to the last downlink data is taken as new last downlink data, and the step of detecting whether the last downlink data contains writing data is repeatedly executed.
[0085] Exemplarily, when the last downlink data contains writing data, the current last downlink data is taken as the last downlink data for acquiring the hardware information; if the last downlink data does not contain writing data, whether the last downlink data contains writing data is detected, and the downlink data containing writing data is taken as the last downlink data by frame by frame.
[0086] The technical solutions in the embodiments of the present application have at least the following technical effects or advantages:
[0087] The last downlink data is acquired, and it is detected whether the last downlink data contains writing data; if the last downlink data contains writing data, the step of determining the hardware information of the capacitive pen according to the last downlink data is performed; otherwise, the last downlink data is adjacent to the previous frame downlink data, the previous frame downlink data is taken as new last downlink data, and the step of detecting whether the last downlink data contains writing data is performed. Therefore, the technical problem that a large amount of data needs to be reacquired after the capacitive pen and the capacitive screen are disconnected in the prior art, resulting in high delay, is effectively solved, and the technical effect that reconnection can be completed through a small amount of data exchange is achieved.
[0088] The application also provides a terminal device, which refers to Figure 3 , Figure 3 The terminal device structure diagram of the 5 hardware running environment involved in the embodiment of the application is shown.
[0089] As shown in Figure 3 , the terminal device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 can also include a standard wired interface and a wireless interface. The network interface 1004 can include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface).
[0090] The network interface 1004 can include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, and can also be a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0091] The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0092] The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0093] Those skilled in the art can understand that the structure shown in the embodiment is not a limitation on the terminal device, and can include more or fewer components than the diagram, or combine certain components, or different component deployment. Figure 3
[0094] Optionally, the memory 1005 is electrically connected with the processor 1001, and the processor 1001 can be used to control
[0095] The operation of the memory 1005 can also read data in the memory 1005 to realize the capacitive pen writing data 0 recovery.
[0096] Optionally, as shown in Figure 3 , the memory 1005 as a storage medium can include an operating system, a data storage module, a network communication module, a user interface module, and a capacitive pen writing data recovery program.
[0097] Optionally, in Figure 3 the terminal device, the network interface 1004 is mainly used for data communication with other devices 5; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the terminal device of the present application can be arranged in the terminal device.
[0098] As shown in Figure 3 , the terminal device calls the capacitive pen writing data recovery program stored in the memory 1005 through the processor 1001, and executes the related step operation of the capacitive pen writing data recovery method provided by the present application
[0099] : 0 In the capacitive pen writing process, if the capacitive screen end does not receive downlink data within the first preset time
[0100] , it is determined that the capacitive pen connection is interrupted;
[0101] acquire historical writing data, and determine the last downlink data received by the capacitive screen end according to the historical writing data;
[0102] determine the hardware information of the capacitive pen according to the last downlink data;
[0103] According to the hardware information and the capacitive pen, the connection is re-established.
[0104] Optionally, the processor 1001 can call the capacitive pen writing data recovery program stored in the memory 1005, and also perform the following operations:
[0105] acquire the current system time of the capacitive screen end;
[0106] According to the current system time, the first preset time and the associated time node of the downlink data in the historical writing data, determine the last downlink data.
[0107] Optionally, the processor 1001 can call the capacitive pen writing data recovery program stored in the memory 1005, and also perform the following operations:
[0108] acquire the last downlink data, and detect whether the last downlink data contains writing data;
[0109] If the last downlink data contains writing data, the step of determining the hardware information of the capacitive pen according to the last downlink data is performed.
[0110] Otherwise, the last downlink data is replaced by the downlink data of the frame adjacent to the last downlink data, and the step of detecting whether the last downlink data contains writing data is performed.
[0111] Optionally, the processor 1001 can call the capacitive pen writing data recovery program stored in the memory 1005, and further perform the following operations:
[0112] According to the historical writing data, the time difference between the adjacent two frames of downlink data is determined.
[0113] According to the time difference, the first preset time is determined, which is twice the time difference.
[0114] Optionally, the processor 1001 can call the capacitive pen writing data recovery program stored in the memory 1005, and further perform the following operations:
[0115] If the capacitive screen sends the first uplink data to the capacitive pen, and does not receive the first downlink data fed back by the capacitive pen within a second preset time, the first uplink data is sent to the capacitive pen again. If the first downlink data is still not received within the second preset time, it is determined that the writing is interrupted.
[0116] Optionally, the processor 1001 can call the capacitive pen writing data recovery program stored in the memory 1005, and further perform the following operations:
[0117] The uplink data is sent to the capacitive pen corresponding to the hardware information.
[0118] When the downlink data corresponding to the uplink data is received, the communication with the capacitive pen is completed.
[0119] Optionally, the processor 1001 can call the capacitive pen writing data recovery program stored in the memory 1005, and further perform the following operations:
[0120] If the downlink data corresponding to the uplink data is not received within a third preset time, it is determined that the connection with the capacitive pen is disconnected.
[0121] The matching mode is started, and when the capacitive pen matching request is received or the matching capacitive pen is found, the connection with the capacitive pen is re-established.
[0122] Optionally, the processor 1001 can call the capacitive pen writing data recovery program stored in the memory 1005, and further perform the following operations:
[0123] According to the corresponding data content in the historical writing data and the change trend of the data content, determine to-be-received downlink data;
[0124] According to the to-be-received downlink data, generate writing data.
[0125] In addition, the embodiment of the present application also provides a computer readable storage medium, and the computer readable storage medium stores a capacitive pen writing data recovery program. The capacitive pen writing data recovery program is executed by a processor to realize the related steps of any one of the capacitive pen writing data recovery methods.
[0126] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product in the form of being implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0127] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices generate a device that realizes the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.
[0128] These computer program instructions can also be stored in a computer readable memory that can guide the computer or other programmable data processing devices to work in a specific way, so that the instructions stored in the computer readable memory produce a manufactured product including instruction apparatus, which realizes the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.
[0129] These computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operation steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for realizing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocksFigure 1 the steps of the function specified in the block or blocks.
[0130] It is noted that in the claims the word "comprising" does not exclude not having other parts than those specified in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. It is further noted that claims which include an element having a predefined property can also include other elements without the predefined property. The application can be implemented by means of both hardware and software, and any combination thereof. In a unitary claim, several devices or means can be listed having the same function. The terms "first", "second", "third", and the like, do not denote any order. The terms "first", "second", "third", and the like, are to be interpreted as names.
[0131] While the application has been described with respect to preferred embodiments, those skilled in the art will readily appreciate that various changes and modifications can be made to the application without departing from the spirit and scope of the application. It is intended, therefore, to cover all such modifications and variations as fall within the scope of the application, including the scope of the claims and their equivalents.
[0132] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A method for recovering data written with a capacitive stylus, characterized in that, Applied to capacitive touchscreens, the method includes: During the writing process of the capacitive pen, if the capacitive screen does not receive downlink data for more than a first preset time, it is determined that the connection of the capacitive pen is interrupted. The downlink data refers to the data sent by the capacitive pen to the capacitive screen. Acquire historical writing data, and determine the last downlink data received by the capacitive touchscreen based on the historical writing data, wherein the current system time of the capacitive touchscreen is acquired; and the last downlink data is determined based on the current system time, the first preset time, and the associated time node of the downlink data in the historical writing data. The hardware information of the capacitive pen is determined based on the last downlink data; Reconnect the capacitive pen according to the hardware information; The step of determining the last downlink data based on the current system time, the first preset time, and the associated time node of the downlink data in the historical writing data includes: Obtain the last downlink data and detect whether the last downlink data contains written data; If the data contains writing data, perform the step of determining the hardware information of the capacitive pen based on the last downlink data; Otherwise, the previous frame of downlink data adjacent to the last downlink data is taken as the new last downlink data, and the step of detecting whether the last downlink data contains written data is performed.
2. The method as described in claim 1, characterized in that, The step of determining that the capacitive pen connection is interrupted if the capacitive screen does not receive downlink data for more than a first preset time during the capacitive pen writing process includes: Based on historical writing data, determine the time difference between two adjacent frames of downlink data; The first preset time is determined based on the time difference, and the first preset time is twice the time difference.
3. The method as described in claim 1, characterized in that, The step of determining that the capacitive pen connection is interrupted if the capacitive screen does not receive downlink data for more than a first preset time during the capacitive pen writing process further includes: If the capacitive screen sends the first uplink data to the capacitive pen and does not receive the first downlink data from the capacitive pen within a second preset time, it sends the first uplink data to the capacitive pen again. If it still does not receive the first downlink data within the second preset time, it determines that writing is interrupted.
4. The method as described in claim 1, characterized in that, The step of reconnecting the capacitive stylus based on the hardware information includes: Send uplink data to the capacitive pen corresponding to the hardware information; When the downlink data corresponding to the uplink data is received, communication with the capacitive pen is completed.
5. The method as described in claim 4, characterized in that, After the step of sending uplink data to the capacitive pen corresponding to the hardware information, the following steps are included: If no downlink data corresponding to the uplink data is received within the third preset time period, it is determined that the connection with the capacitive pen is lost. Initiate pairing mode. When a pairing request for a capacitive pen is received or a pairable capacitive pen is found, reconnect to the capacitive pen.
6. The method as described in claim 1, characterized in that, After determining that the capacitive pen connection is interrupted if the capacitive screen does not receive downlink data for more than a first preset time during the capacitive pen writing process, the following steps are included: Based on the corresponding data content in the historical writing data and the changing trend of the data content, the downlink data to be received is determined; Based on the downlink data to be received, generate the writing data.
7. A terminal device, characterized in that, The method includes a memory, a processor, and a capacitive pen writing data recovery program stored in the memory and executable on the processor. When the processor executes the capacitive pen writing data recovery program, it implements the method according to any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a capacitive pen writing data recovery program, which, when executed by a processor, implements the method described in any one of claims 1-6.
Citation Information
Patent Citations
Bluetooth module, display device and Bluetooth abnormity recovery method
CN115190648A
Capacitance pen frame compensation method and device and computer readable storage medium
CN115421602A