Capacitive pen frame interpolation method, device and computer readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-15
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]本申请实施例通过提供电容笔补帧方法、设备及计算机可读存储介质,解决了电容笔使用过程中,和屏幕之间的通信会受到外界电磁环境干扰,导致屏幕发给电容笔的上行数据被干扰,进而出现书写断线的问题,使电容笔在丢失部分上行数据时也能正确发送下行数据,保证书写不断线
[0039]When the capacitive pen is connected and has not received uplink data from the screen, the system acquires historical writing data from the pen within a preset time period. Based on the time points associated with the uplink data in the historical writing data, it predicts the transmission time of the downlink data frame to be sent. Then, based on the data content in the historical writing data, it predicts the target data content of the downlink data frame to be sent, generates the downlink data frame to be sent based on the target data content, and sends the downlink data frame to be sent to the capacitive screen when the transmission time is reached. This frame interpolation method allows the capacitive pen to continue writing even when some uplink data is lost.
Smart Images

Figure CN115421602B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart devices, and more particularly to a capacitive pen frame interpolation method, device, and computer-readable storage medium. Background Technology
[0002] With the advancement of technology, electronic products with touch input capabilities, such as mobile phones, computers, tablets, and car navigation systems, are becoming increasingly widespread. These products feature capacitive touch panels on their displays, allowing users to operate them using their fingers.
[0003] Touchscreen operation with fingers could not meet people's needs for fine writing and drawing, so capacitive pens were developed to replace fingers in operating the screen. Most active capacitive pens interact bidirectionally with the capacitive screen, meaning that the pen and screen send downlink and uplink data according to agreed-upon parameters during operation. The data sent by the pen to the screen is called downlink data, and the data sent by the screen to the pen is called uplink data.
[0004] However, in actual working scenarios, the communication between the capacitive pen and the screen can be interfered with by the external electromagnetic environment, causing the writing lines to break when using the capacitive pen. Summary of the Invention
[0005] This application provides a capacitive pen frame interpolation method, device, and computer-readable storage medium, which solves the problem that communication between the capacitive pen and the screen is affected by external electromagnetic interference during use, causing interference with the uplink data sent from the screen to the capacitive pen and resulting in writing interruptions. This ensures that the capacitive pen can correctly send downlink data even when some uplink data is lost, guaranteeing uninterrupted writing.
[0006] This application provides a method, device, and computer-readable storage medium for frame interpolation with a capacitive pen, applicable to a capacitive pen. The frame interpolation method for the capacitive pen includes:
[0007] When the capacitive pen is connected and no uplink data is received, acquire the historical writing data of the capacitive pen within a preset time period;
[0008] Based on the time points associated with the uplink data in the historical data, predict the transmission time of the downlink data frame to be sent; and / or
[0009] Based on the data content corresponding to the historical writing data, predict the target data content of the downlink data frame to be sent.
[0010] The downlink data frame to be sent is generated based on the target data content, and the downlink data frame to be sent is sent to the capacitive screen when the sending time is reached.
[0011] Optionally, before the step of acquiring the historical writing data of the capacitive pen within a preset time period when the capacitive pen is in a connected state and no uplink data is received, the method includes:
[0012] Determine whether the latest uplink data frame in the database has been paired, and whether the time associated with the latest uplink data frame is within a preset time.
[0013] If so, confirm that the capacitive stylus is in a connected state; or
[0014] The capacitive pen is determined to be in a connected state based on its protocol state machine.
[0015] Optionally, the step of predicting the transmission time of the downlink data frame to be sent based on the time points associated with the uplink data in the historical writing data includes:
[0016] Obtain the first upload time and the second upload time of the historical writing data;
[0017] The time interval between adjacent uplink data is determined based on the first uplink time and the second uplink time.
[0018] The transmission time is predicted based on the time interval.
[0019] Optionally, the step of determining the time interval between adjacent uplink data based on the first uplink time and the second uplink time includes:
[0020] Obtain the end time of the first uplink time and the start time of the second uplink time;
[0021] The time interval is determined based on the end time and the start time.
[0022] Optionally, the step of predicting the target data content of the downlink data frame to be sent based on the data content corresponding to the historical writing data includes:
[0023] Based on the data content corresponding to the historical writing data and the changing patterns of the data content, the uplink data to be received is determined;
[0024] Based on the uplink data to be received, predict the content of the target data.
[0025] Optionally, after the step of predicting the target data content of the downlink data frame to be sent based on the data content corresponding to the historical writing data, the method further includes:
[0026] If the data content cannot be detected in the historical writing data, the downlink data in the preset database is obtained;
[0027] The downlink data is used as the target data content.
[0028] Optionally, after the step of generating the downlink data frame to be sent based on the target data content, and sending the downlink data frame to be sent to the capacitive screen when the sending time is reached, the method further includes:
[0029] The capacitive touchscreen sends the downlink data frame to be sent, wherein after receiving the downlink data frame to be sent, the capacitive touchscreen determines whether the downlink data frame to be sent contains written data;
[0030] If included, perform frame interpolation.
[0031] Otherwise, control the capacitive stylus to initiate the pairing process.
[0032] Optionally, after the step of generating the downlink data frame to be sent based on the target data content, and sending the downlink data frame to be sent to the capacitive screen when the sending time is reached, the method further includes:
[0033] Determine whether the number of interpolated frames is less than the maximum value of the preset number of interpolated frames, or greater than or equal to the minimum value of the preset number of interpolated frames;
[0034] If so, the capacitive pen performs a frame interpolation operation;
[0035] Otherwise, the writing action of the capacitive pen is terminated.
[0036] In addition, to achieve the above objectives, embodiments of the present invention also provide a terminal device, including a memory, a processor, and a capacitive pen frame interpolation program stored in the memory and executable on the processor. When the processor executes the capacitive pen frame interpolation program, it implements the method described above.
[0037] In addition, to achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium storing a capacitive pen frame interpolation program, which, when executed by a processor, implements the method described above.
[0038] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0039] When the capacitive pen is connected and has not received uplink data from the screen, the system acquires historical writing data from the pen within a preset time period. Based on the time points associated with the uplink data in the historical writing data, it predicts the transmission time of the downlink data frame to be sent. Then, based on the data content in the historical writing data, it predicts the target data content of the downlink data frame to be sent, generates the downlink data frame to be sent based on the target data content, and sends the downlink data frame to be sent to the capacitive screen when the transmission time is reached. This frame interpolation method allows the capacitive pen to continue writing even when some uplink data is lost. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating Embodiment 1 of the capacitive pen frame interpolation method of this application;
[0041] Figure 2 This is a schematic diagram of uplink and downlink data within a single cycle according to an embodiment of this application;
[0042] Figure 3 This is a flowchart illustrating Embodiment 2 of the capacitive pen frame interpolation method of this application;
[0043] Figure 4 This is a flowchart illustrating Embodiment 3 of the capacitive pen frame interpolation method of this application;
[0044] Figure 5 This is a flowchart illustrating Embodiment 4 of the capacitive pen frame interpolation method of this application;
[0045] Figure 6 This is a flowchart illustrating Embodiment 5 of the capacitive pen frame interpolation method of this application;
[0046] Figure 7 This is a flowchart illustrating Embodiment Six of the capacitive pen frame interpolation method of this application;
[0047] Figure 8 This is a schematic diagram of the terminal structure of the hardware operating environment involved in one embodiment of this application. Detailed Implementation
[0048] To address the issue of writing line interruptions caused by electromagnetic interference in capacitive pens, this application determines the connection status of the capacitive pen. If no uplink data is received within a preset time, it predicts the transmission time of the downlink data to be sent based on the time points associated with the uplink data in the historical writing data of the capacitive pen. It also predicts the target data content of the downlink data frame to be sent based on the data content in the historical writing data of the capacitive pen, and then generates the downlink data frame to be sent based on the target data content. When the transmission time is reached, the downlink data frame to be sent is sent to the capacitive screen to perform frame interpolation, ensuring that the writing line of the capacitive pen remains uninterrupted.
[0049] 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.
[0050] 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.
[0051] Example 1
[0052] In this embodiment, a frame interpolation method for a capacitive pen is provided.
[0053] Reference Figure 1 The capacitive pen frame interpolation method in this embodiment includes the following steps:
[0054] Step S100: When the capacitive pen is in a connected state and no uplink data is received, acquire the historical writing data of the capacitive pen within a preset time period;
[0055] In this embodiment, "connection state" refers to the state where the capacitive pen and the capacitive screen are already connected and communicating. Uplink data refers to the data sent from the capacitive screen to the capacitive pen. The capacitive pen can only determine the time and content of the downlink data transmission after receiving it. Downlink data refers to the data sent from the capacitive pen to the capacitive screen. Both uplink and downlink data are stored in the memory to generate historical writing data.
[0056] As an optional implementation, the capacitive pen and the capacitive screen can connect via Bluetooth. Once successfully paired, the pen can perform writing or drawing operations on the screen. During drawing or writing, interference from the surrounding electromagnetic environment may prevent the screen from sending uplink data to the pen. When the pen is connected to the screen but no uplink data is received, the system retrieves historical writing data from the pen within a preset time period.
[0057] For example, the preset time can be the time for sending one frame of data. If the capacitive pen does not receive the uplink data sent by the capacitive screen within the time of one frame of data after completing a writing action, it is determined that a frame interpolation action is needed to obtain the historical writing data.
[0058] As another alternative implementation, refer to Figure 2The response times of uplink and downlink data constitute a cycle, with a cycle response time of 4-25 milliseconds. After uplink data is paired with downlink data, an identifier is generated and stored in Beacon N. There is a certain time difference (Turnaround Gap) between the uplink and downlink data response times. The Stylus ACK processor is used to preprocess the uplink data to calculate the corresponding downlink data.
[0059] For example, each upstream data point and its corresponding downstream data point are stored in the database as a period, serving as historical writing data. There is a fixed time interval between the upstream and downstream data points. That is, in the historical writing data, a period consists of the upstream data transmission time, the fixed time interval, and the downstream data transmission time. The data stored in the historical writing data is bubble-sorted in ascending order according to its generation time, with the most recently generated data placed at the top of the sequence.
[0060] As another alternative implementation, if the capacitive pen is connected to the capacitive screen and does not receive uplink data for a certain period of time, it is determined that the uplink data has been lost.
[0061] For example, the time interval between two adjacent uplink times is obtained and denoted as the first time interval; then the time interval between the uplink time and the corresponding downlink time is obtained and denoted as the second time interval. The value obtained by adding the first time interval and the second time interval is denoted as the timeout time, which is the time interval corresponding to the period during which no uplink data is received. When the capacitive pen is in a connected state and the time since the last reception of uplink data is greater than the timeout time, it is determined that the capacitive pen needs to perform frame interpolation.
[0062] Step S200: Based on the time points associated with the uplink data in the historical writing data, predict the transmission time of the downlink data frame to be sent;
[0063] In this embodiment, the time points associated with uplink data include the start and end times of uplink data transmission. The transmission time of downlink data is determined by the time interval between adjacent uplink data in historical data, thereby predicting the transmission time of the downlink data frame to be transmitted.
[0064] As an optional implementation, a timer is used to record the transmission time of each uplink data frame. After recording multiple uplink data transmission times, an algorithm is used to calculate the transmission time of the downlink data frame. When the stylus does not receive uplink data, a timer can be used to obtain the transmission time of the downlink data frame.
[0065] For example, since the transmission times of uplink and downlink data follow a certain pattern, the Lagrange interpolation method can be used to infer the time when the capacitive pen receives the next uplink data from multiple uplink data transmission times, thereby predicting the transmission time of the downlink data frame to be sent.
[0066] Step S300: Based on the data content corresponding to the historical writing data, predict the target data content of the downlink data frame to be sent;
[0067] In this embodiment, the data content corresponding to historical writing data refers to the data content of the latest uplink data frame in the historical writing data. The target data content refers to the writing content that is about to be transmitted to the capacitive screen.
[0068] As an alternative implementation, there is a certain pattern between adjacent frames of uplink data. Therefore, the uplink data of the next frame can be deduced from the uplink data in the historical data. Downlink data is a response to uplink data, so the downlink data can be determined by the deduced uplink data.
[0069] For example, in order to improve the accuracy of predicting the target data content of downlink data frames, the content of the unreceived uplink data can be inferred from the latest uplink data content in the historical writing content, thereby predicting the target data content of the downlink data frame to be sent.
[0070] As an alternative implementation, historical writing data in the memory is periodically cleared to reduce the load on the capacitive pen, save memory space, and thus improve the response speed of the capacitive pen, making writing smoother.
[0071] For example, two modes for clearing historical writing data can be set. One is timed clearing, where the time point can be set according to actual usage. This embodiment does not limit this setting. For instance, it can be set to clear the first matched uplink and downlink data after two matching operations are completed, retaining only the last matched uplink and downlink data. In addition to timed clearing, it can also be set to automatically clear the current writing record, i.e., clear the historical writing data, after the capacitive pen and capacitive screen disconnect.
[0072] Step S400: Generate the downlink data frame to be sent according to the target data content, and send the downlink data frame to be sent to the capacitive screen when the sending time is reached.
[0073] In this embodiment, the target data content includes written data, and the downlink data frame to be sent is the data sent from the capacitive pen to the capacitive screen. After generating the downlink data frame to be sent, the downlink data frame to be sent is sent to the capacitive screen when the predicted transmission time of the downlink data frame is reached.
[0074] As an optional implementation, when the capacitive pen is detected to be connected to the capacitive screen but no uplink data is received, the uplink data time interval and uplink data content from historical writing data are obtained. The transmission time of the downlink data to be sent is inferred from the uplink data time interval. The data content of the downlink data to be sent is inferred from the uplink data content. Based on the transmission time and data content of the downlink data to be sent, the relevant data for frame interpolation is determined and performed to ensure smooth writing.
[0075] As another optional implementation, the downlink data frame to be transmitted includes real-time pressure data in addition to the target data content. This avoids excessive pressure, which could result in redundant handwriting, and insufficient pressure, which could lead to faint handwriting. It ensures that the handwriting after frame interpolation blends seamlessly with the original handwriting, so that the user will not perceive any difference between the interpolated and uninterpolated handwriting.
[0076] In this embodiment, when the capacitive pen is connected and no uplink data is received, the transmission time of the downlink data frame to be sent is predicted based on the uplink data association time points in the historical writing data within a preset time period. The target data content of the downlink data frame to be sent is predicted based on the data content in the historical writing data within the preset time period, and thus the downlink data frame to be sent is generated. When the predicted transmission time is reached, the downlink data frame to be sent is sent to the capacitive screen. This ensures that the capacitive pen can maintain continuous writing without interruption even when it does not receive uplink data from the screen within the preset time period.
[0077] Example 2
[0078] Based on Embodiment 1, another embodiment of this application is proposed, with reference to... Figure 3 Before step S100, the following steps are included:
[0079] Step S010: Determine whether the latest uplink data frame in the database has been paired, and whether the time associated with the latest uplink data frame is within a preset time.
[0080] Step S020: If yes, determine that the capacitive pen is in a connected state; or
[0081] Step S030: Determine that the capacitive pen is in a connected state according to the protocol state machine of the capacitive pen.
[0082] In this embodiment, since the paired and unpaired states of uplink data are different, the paired uplink data carries an identifier. The capacitive pen can detect whether the uplink data in the historical writing data contains the identifier to determine whether the uplink data has been paired. The capacitive pen's protocol state machine refers to the ability of the capacitive pen to predict the connection state of the next moment based on the connection state of the pen at the first and second moments.
[0083] As an optional implementation, if the latest frame of uplink data in the database is detected to have an identifier, and the time corresponding to the latest frame of uplink data is within a preset time, it is determined that the capacitive pen and the capacitive screen are connected and writing continues.
[0084] For example, in order to ensure that the capacitive pen is still connected, it is necessary to check whether there is an identifier in the uplink data of the previous frame in the database. It is not necessary to check whether there is an identifier in all the uplink data in the database. If there is an identifier in the uplink data of the previous frame, it means that the capacitive pen is connected at this time.
[0085] As an alternative implementation, the connection status of the capacitive pen is determined by its protocol state machine. This state machine can include three states: not connected, connecting, and successfully connected. The state machine accurately determines the pen's connection status, from the not connected state to the execution of the connection action and successful connection. If no uplink data is received next time, the state machine restarts the connection process from the beginning until a successful connection is established.
[0086] In this embodiment, before performing frame interpolation on the capacitive pen, it is necessary to determine whether the capacitive pen and the capacitive screen are in a connected and matched state. If the latest uplink data frame stored in the database is paired, and the associated time of the latest uplink data frame is within a preset range, the capacitive pen is determined to be in a connected state. Alternatively, the connection state can be determined based on the protocol state machine within the capacitive pen. Frame interpolation is only required when the capacitive pen is in a connected state, avoiding unnecessary work, saving power, and reducing unnecessary wear and tear.
[0087] Example 3
[0088] Based on the above embodiments, another embodiment of this application is proposed, with reference to... Figure 4 The steps for predicting the transmission time of the downlink data frame to be sent based on the time points associated with the uplink data in the historical data include:
[0089] Step S210: Obtain the first upload time and the second upload time of the historical writing data;
[0090] Step S220: Determine the time interval between adjacent uplink data based on the first uplink time and the second uplink time;
[0091] Step S230: Predict the transmission time based on the time interval.
[0092] In this embodiment, the transmission time of the downlink data to be sent is predicted by the time interval of the uplink data in the historical writing data. The two adjacent uplink data obtained are the data at the top of the historical writing database.
[0093] As an optional implementation, the first uplink time refers to the time when the first uplink data was sent, and the second uplink time refers to the time when the second uplink data was sent. The first uplink time is shorter than the second uplink time. By comparing the second time with the first time, the time interval between two adjacent uplink data can be obtained.
[0094] For example, the time interval between two adjacent uplink data is the transmission time of downlink data. The transmission time of downlink data includes the start transmission time and the end transmission time, which is the transmission time of the downlink data frame to be transmitted.
[0095] As another optional implementation, in order to further improve the accuracy of the transmission time of the downlink data to be transmitted, the end time of the first uplink time and the start time of the second uplink time can be obtained, and the time interval can be determined based on the end time and the start time.
[0096] For example, the end time of the first uplink time is t1, and the start time of the second uplink time is t2. The time interval t is the value obtained by subtracting t2 from t1. The end time of the second uplink time is t3, so the transmission time of the downlink data frame to be transmitted at this time is t3+t. Therefore, the transmission time of the downlink data frame to be transmitted is a point in time after t3 and before t3+t.
[0097] As another alternative implementation, multiple uplink times can be obtained, the time interval between each adjacent uplink time can be calculated, and then the average of the calculated uplink times can be taken to obtain a more accurate time interval. Based on this more accurate time interval, the transmission time can be predicted.
[0098] For example, n uplink times in historical uplink data are obtained, where n is greater than 2, and n-1 uplink time intervals are calculated. The n-1 time intervals are added together and then divided by n-1 to obtain the average value of the n-1 uplink time intervals.
[0099] In this embodiment, since the time base of each downlink data is determined by the start time of the uplink data, this embodiment determines the time interval between two adjacent uplink times by the end time of the first uplink time and the start time of the second uplink time, thereby predicting the transmission time of the downlink data to be sent. Only when the transmission time of the downlink data to be sent is accurate can the capacitive pen accurately perform frame interpolation, ensuring uninterrupted writing.
[0100] Example 4
[0101] Based on the above embodiments, another embodiment of this application is proposed, with reference to... Figure 5The step of predicting the target data content of the downlink data frame to be sent based on the data content corresponding to the historical writing data includes:
[0102] Step S310: Determine the uplink data to be received based on the data content corresponding to the historical written data and the change pattern of the data content;
[0103] Step S320: Predict the target data content based on the uplink data to be received.
[0104] In this embodiment, the upstream data consists of 16-bit numbers, and the composition of each upstream data point can be deduced from the value of the previous upstream data point. The target data content refers to the data content containing the written data.
[0105] As an optional implementation, the second uplink data content can be predicted from the first uplink data content in the historical writing data. Therefore, when no uplink data content is received, the capacitive pen can calculate the content of the unreceived uplink data based on the known change patterns of the latest uplink data in the historical writing data. Since the downlink data content itself needs to be determined from the uplink data, the target data content can be predicted as long as the uplink data content is calculated correctly.
[0106] For example, the pattern of change is pre-trained through model training and stored in the control module of the capacitive pen. The capacitive pen can accurately determine the content of the next frame of uplink data based on the historical writing data within a preset time period.
[0107] As another optional implementation, if the data content cannot be detected in the historical writing data, the downlink data in the preset database is obtained and the downlink data is used as the target data content.
[0108] For example, signal transmission between the capacitive stylus and the capacitive screen may be affected by electromagnetic interference, preventing the stylus from receiving upstream data. Simultaneously, another interference factor may exist, preventing the stylus from acquiring the upstream data content at the top of the historical database, or the current writing might be the first writing after power-on, resulting in an empty historical writing record. To ensure the stylus can continue writing smoothly in such cases, downstream data from a preset database can be directly acquired, using the downstream data content as the target data content.
[0109] As another optional implementation, the uplink data to be received is determined based on the data content corresponding to the historical writing data and the changing patterns of the data content. Since different capacitive pen models have different writing protocols, such as the data expression format of the data content and the changing patterns of uplink data in adjacent frames, the changing patterns of the data content will vary depending on the capacitive pen model.
[0110] In this embodiment, since the uplink data exhibits a pattern of change, unreceived uplink data can be predicted based on this pattern, thereby predicting the target data content of the downlink data frame to be sent. When the historical data content is affected by electromagnetic interference, making it impossible to accurately detect historical uplink data content, downlink data from a preset database can be obtained and used as the target data content. This ensures that when the transmission time of the downlink data frame to be sent arrives, there is sufficient data to fill in the gaps, guaranteeing uninterrupted writing.
[0111] Example 5
[0112] Based on the above embodiments, another embodiment of this application is proposed, with reference to... Figure 6 After the steps of generating the downlink data frame to be sent based on the target data content, and sending the downlink data frame to be sent to the capacitive screen when the sending time is reached, the method includes:
[0113] Step S700: Send the downlink data frame to be sent to the capacitive screen, wherein after receiving the downlink data frame to be sent, the capacitive screen determines whether the downlink data frame to be sent contains written data;
[0114] Step S800: If included, perform frame interpolation.
[0115] Step S900: Otherwise, control the capacitive pen to start the pairing process.
[0116] In this embodiment, the content of the downlink data is determined based on the content of the uplink data, meaning there is a certain mapping relationship between the uplink and downlink data. If the uplink data needs to query certain information, but the downlink data returned to the capacitive screen does not provide feedback on querying this information, the capacitive screen may determine that it is connected to the capacitive pen port, and thus restart the pairing process, resulting in writing obstruction and failing to meet the user's needs.
[0117] As an optional implementation, the uplink data sent by the capacitive screen to the stylus may include not only writing or drawing data, but also commands such as querying the stylus's battery level or ID. Typically, when the stylus receives the uplink data for battery level, it needs to send downlink data containing its current battery level back to the screen. If the screen does not receive this downlink data, it may determine that the stylus is no longer writing on the screen, thus initiating a re-pairing process and resulting in short writing lines, impacting the user experience. In this implementation, however, the screen can ignore the query command. As long as the received downlink data contains writing data, it assumes the stylus is still writing on the screen, avoiding a re-pairing process and ensuring continuous writing.
[0118] For example, the uplink data sent from the capacitive screen to the capacitive pen includes writing data and a query ID command. However, due to electromagnetic interference, the capacitive pen cannot receive the uplink data and therefore cannot send corresponding information back to the capacitive screen based on this uplink data containing the query ID command. However, the capacitive pen frame-filling method of this application can be used to provide the transmission time and content of the downlink data frame to be sent, thus improving the downlink data frame containing writing data and ensuring the writing process.
[0119] In this embodiment, since the uplink data sent by the screen to the capacitive pen may contain more than just writing data, it may also include commands such as battery level queries. In this case, the capacitive pen needs to send downlink data containing battery level information back to the screen. If the capacitive pen does not receive uplink data, it cannot return downlink data containing battery level information. However, the method provided in this application can return downlink data containing writing data even without receiving uplink data. As long as the downlink data received by the screen contains writing data, it is assumed that the capacitive pen is still writing on the screen, and the pairing process will not be rewritten, ensuring uninterrupted writing by the capacitive pen.
[0120] Example 6
[0121] Based on the above embodiments, another embodiment of this application is proposed, with reference to... Figure 7 After the steps of generating the downlink data frame to be sent based on the target data content, and sending the downlink data frame to be sent to the capacitive screen when the sending time is reached, the method further includes:
[0122] Step S1000: Determine whether the number of interpolated frames is less than the maximum value of the preset number of interpolated frames, or greater than or equal to the minimum value of the preset number of interpolated frames;
[0123] Step S1100: If yes, the capacitive pen performs a frame interpolation operation;
[0124] Step S1200: Otherwise, determine that the capacitive pen has terminated its writing action.
[0125] In this embodiment, the number of frames added can be reasonably controlled, thereby reducing the power consumption of the capacitive pen and improving its performance. The number of frames added refers to the number of frames that the capacitive pen needs to actively add when uplink data is not received.
[0126] As an alternative implementation, if no uplink data is received for a long time, it can be determined that the writing action has ended. There is no need to control the capacitive pen to continue frame interpolation, which would cause unnecessary functional loss and generate extra writing marks, which does not meet the user's operation needs.
[0127] For example, the capacitive pen can be configured to continuously perform frame interpolation during the two frames when no uplink data is received. For instance, after interpolating based on historical writing data in the first frame, it can perform interpolation again based on the first interpolated data in the second frame. By the third frame, the number of frames requiring interpolation has exceeded a preset limit, at which point the capacitive pen is no longer controlled to perform interpolation, and there is no need to actively generate writing marks. At this point, although the capacitive pen may still be connected to the capacitive screen, it may no longer be on the screen, thus eliminating the need for further frame interpolation.
[0128] As another optional implementation, if no uplink data is received within a preset time, the capacitive pen can start to perform frame interpolation operations. If the number of downlink data frames to be sent is too small at this time, it may result in insufficient frame interpolation and short lines still appear when writing.
[0129] For example, the minimum number of frames to be padded each time can be set to 1 frame. If the capacitive pen can only generate 0.5 frames at this time, it will cause the writing to be interrupted. When it is detected that the number of downlink data frames to be sent is less than the preset minimum number of padded frames, the insufficient frames can be actively padded according to the protocol state machine of the capacitive pen to ensure continuous writing.
[0130] As another optional implementation, the preset number of interpolated frames can be adjusted according to the compatibility between the capacitive pen and the capacitive screen. When the pen and screen work well together, the maximum value of the preset number of interpolated frames can be reduced to avoid excessive interpolation and increased power consumption of the capacitive pen. When there is a lot of interference in the usage scenario, the maximum value of the preset number of interpolated frames can be increased to ensure uninterrupted writing.
[0131] For example, when a user is writing content using a capacitive pen in an electrical control room, due to the large electromagnetic interference in the room, the maximum preset frame interpolation value of the capacitive pen can be increased. This allows the capacitive pen to perform frame interpolation even if complete uplink data is not continuously received in an environment with large electromagnetic interference, ensuring smooth writing without interruption.
[0132] In this embodiment, the number of frame interpolation is controlled within a preset range. When the number of frame interpolation exceeds the maximum value of the preset range, that is, when no uplink data is received from the screen to the capacitive pen for a long time, it indicates that the user has stopped writing. If frame interpolation continues, it will cause unnecessary functional loss, and the generated redundant frame data does not meet the user's needs. When the number of frame interpolation is less than the minimum value of the preset range, it may also cause writing interruption. Therefore, reasonably controlling the number of frame interpolation can reduce unnecessary functional loss and ensure uninterrupted writing.
[0133] Example 7
[0134] In the embodiments of this application, a capacitive pen frame interpolation device is proposed.
[0135] Reference Figure 8 , Figure 8 This is a schematic diagram of the terminal structure of the hardware operating environment involved in one embodiment of this application.
[0136] like Figure 8 As shown, the control terminal may include: a processor 1001, such as a CPU, a network interface 1003, a memory 1004, and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The network interface 1003 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1004 may be high-speed RAM or stable non-volatile memory, such as a disk drive. Alternatively, the memory 1004 may be a storage device independent of the aforementioned processor 1001.
[0137] Those skilled in the art will understand that Figure 8 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0138] like Figure 8 As shown, the memory 1004, which serves as a computer storage medium, may include an operating system, a network communication module, and a capacitive pen frame interpolation program.
[0139] exist Figure 8 In the hardware structure of the capacitive pen frame interpolation device shown, the processor 1001 can call the capacitive pen frame interpolation program stored in the memory 1004 and perform the following operations:
[0140] When the capacitive pen is connected and no uplink data is received, acquire the historical writing data of the capacitive pen within a preset time period;
[0141] Based on the time points associated with the uplink data in the historical data, predict the transmission time of the downlink data frame to be sent; and / or
[0142] Based on the data content corresponding to the historical writing data, predict the target data content of the downlink data frame to be sent.
[0143] The downlink data frame to be sent is generated based on the target data content, and the downlink data frame to be sent is sent to the capacitive screen when the sending time is reached.
[0144] Optionally, the processor 1001 may call the capacitive pen frame interpolation program stored in the memory 1004 and also perform the following operations:
[0145] Determine whether the latest uplink data frame in the database has been paired, and whether the time associated with the latest uplink data frame is within a preset time.
[0146] If so, confirm that the capacitive stylus is in a connected state; or
[0147] The capacitive pen is determined to be in a connected state based on its protocol state machine.
[0148] Optionally, the processor 1001 may call the capacitive pen frame interpolation program stored in the memory 1004 and also perform the following operations:
[0149] Obtain the first upload time and the second upload time of the historical writing data;
[0150] The time interval between adjacent uplink data is determined based on the first uplink time and the second uplink time.
[0151] The transmission time is predicted based on the time interval.
[0152] Optionally, the processor 1001 may call the capacitive pen frame interpolation program stored in the memory 1004 and also perform the following operations:
[0153] Obtain the end time of the first uplink time and the start time of the second uplink time;
[0154] The time interval is determined based on the end time and the start time.
[0155] Optionally, the processor 1001 may call the capacitive pen frame interpolation program stored in the memory 1004 and also perform the following operations:
[0156] Based on the data content and the changing patterns of the data content, determine the uplink data to be received;
[0157] Based on the uplink data to be received, predict the content of the target data.
[0158] Optionally, the processor 1001 may call the capacitive pen frame interpolation program stored in the memory 1004 and also perform the following operations:
[0159] If the data content cannot be detected in the historical writing data, the downlink data in the preset database is obtained;
[0160] The downlink data is used as the target data content.
[0161] Optionally, the processor 1001 may call the capacitive pen frame interpolation program stored in the memory 1004 and also perform the following operations:
[0162] The capacitive touchscreen sends the downlink data frame to be sent, wherein after receiving the downlink data frame to be sent, the capacitive touchscreen determines whether the downlink data frame to be sent contains written data;
[0163] If included, perform frame interpolation.
[0164] Otherwise, control the capacitive stylus to initiate the pairing process.
[0165] Optionally, the processor 1001 may call the capacitive pen frame interpolation program stored in the memory 1004 and also perform the following operations:
[0166] Determine whether the number of interpolated frames is less than the maximum value of the preset number of interpolated frames, or greater than or equal to the minimum value of the preset number of interpolated frames;
[0167] If so, the capacitive pen performs a frame interpolation operation;
[0168] Otherwise, the writing action of the capacitive pen is terminated.
[0169] In addition, to achieve the above objectives, embodiments of the present invention also provide a terminal device, including a memory, a processor, and a capacitive pen frame interpolation program stored in the memory and executable on the processor. When the processor executes the capacitive pen frame interpolation program, it implements the capacitive pen frame interpolation method as described above.
[0170] In addition, to achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium storing a capacitive pen frame interpolation program, which, when executed by a processor, implements the capacitive pen frame interpolation method as described above.
[0171] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0172] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0173] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0174] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0175] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. This application can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0176] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0177] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of the invention. Therefore, if these modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. A capacitive pen frame interpolation method, characterized in that, Applied to a capacitive pen, the method includes: When the capacitive pen is connected and no uplink data is received, the historical writing data of the capacitive pen within a preset time period is obtained. The historical writing data is stored in the database with each uplink data and its corresponding downlink data as a cycle. Obtain the first upload time and the second upload time of the historical writing data; The time interval between adjacent uplink data is determined based on the first uplink time and the second uplink time. Based on the time interval, predict the transmission time; Based on the data content corresponding to the historical writing data and the change pattern of the data content, the uplink data to be received is determined, wherein the data content corresponding to the historical writing data refers to the data content of the latest frame of uplink data in the historical writing data; Based on the uplink data to be received, predict the target data content; If the data content cannot be detected in the historical writing data, the downlink data in the preset database is obtained; The downlink data is used as the target data content; A downlink data frame to be sent is generated based on the target data content, and the downlink data frame to be sent is sent to the capacitive screen when the sending time is reached.
2. The frame-interpolation method of claim 1, wherein, Before the step of acquiring the historical writing data of the capacitive pen within a preset time period when the capacitive pen is in a connected state and no uplink data is received, the method includes: Determine whether the latest uplink data frame in the database has been paired, and whether the time associated with the latest uplink data frame is within a preset time. If so, confirm that the capacitive stylus is in a connected state; or The capacitive pen is determined to be in a connected state based on its protocol state machine.
3. The frame-interpolation method of claim 1, wherein, The step of determining the time interval between adjacent uplink data based on the first uplink time and the second uplink time includes: Obtain the end time of the first uplink time and the start time of the second uplink time; The time interval is determined based on the end time and the start time.
4. The frame-interpolation method of claim 1, wherein, After the step of generating the downlink data frame to be sent based on the target data content, and sending the downlink data frame to be sent to the capacitive screen when the sending time is reached, the method includes: The capacitive touchscreen sends the downlink data frame to be sent, wherein after receiving the downlink data frame to be sent, the capacitive touchscreen determines whether the downlink data frame to be sent contains written data; If included, perform frame interpolation. Otherwise, control the capacitive stylus to initiate the pairing process.
5. The frame-interpolation method of claim 1, wherein, After the step of generating the downlink data frame to be sent based on the target data content, and sending the downlink data frame to be sent to the capacitive screen when the sending time is reached, the method includes: Determine whether the number of interpolated frames is less than the maximum value of the preset number of interpolated frames, or greater than or equal to the minimum value of the preset number of interpolated frames; If so, the capacitive pen performs a frame interpolation operation; Otherwise, the writing action of the capacitive pen is terminated.
6. A terminal device, characterized by comprising: The device includes a memory, a processor, and a capacitive pen frame interpolation program stored in the memory and executable on the processor. When the processor executes the capacitive pen frame interpolation program, it implements the method described in any one of claims 1-5.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a capacitive pen frame interpolation program, which, when executed by a processor, implements the method described in any one of claims 1-5.
Citation Information
Patent Citations
Touch point loss prevention method, electronic equipment and storage medium
CN108196708A
Pen and sensor controller
CN113874820A