Configuration method and device, interaction system, electronic device, stylus and medium
By obtaining the original serial number of the stylus and generating the target serial number based on the instruction delay offset, the signal mismatch problem in the synchronization configuration between the stylus and the touch screen is solved, realizing data time synchronization between the stylus and the touch screen and ensuring the continuity of the writing process.
Patent Information
- Application Number
- CN202611199990.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-07
- Publication Date
- 2026-11-03
AI Technical Summary
During the synchronization configuration of the stylus and touch screen, the signal demodulation rules are mismatched due to differences in the transmission link, causing writing disconnection failure.
By obtaining the original serial number generated by the stylus, the serial number is offset according to the instruction delay offset between the stylus and the touch screen to generate the target serial number. Under the condition of meeting the synchronization configuration, configuration data is sent to the touch screen and the stylus to ensure that the two use the configuration data synchronously.
It achieves data and time synchronization between the stylus and the touchscreen, avoiding the problem of line breaks during writing and ensuring the synchronization of subsequent writing processes.
Smart Images

Figure CN123030246A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of styluses, and in particular to a configuration method, apparatus, interactive system, electronic device, stylus, medium, and program product. Background Technology
[0002] With the development of technology, styluses are now commonly found in various electronic devices. Taking tablets as an example, when users need to use a stylus, they turn on the tablet's Bluetooth function, search for available devices nearby, and complete the pairing and connection between the tablet and the stylus.
[0003] During the interaction between the electronic device and the stylus, the signals are modulated to generate a coding signal based on the electronic device's configuration data. After receiving the signal, the touchscreen and stylus also demodulate the signal using the configuration data. If the configuration data needs to be updated, the processor inside the electronic device will send new configuration data to both the touchscreen and the stylus, synchronously updating the configuration data stored on both.
[0004] However, the processor transmits configuration data to the touchscreen via the device's internal bus, while transmitting configuration data to the stylus is done via an radio frequency link. This difference in transmission links means that the touchscreen receives the new configuration information earlier than the stylus. The touchscreen switches to the new coding configuration first, while the stylus continues to send signals using the old coding configuration. The two sets of signal demodulation rules are mismatched, ultimately causing writing line interruption failures. Summary of the Invention
[0005] Therefore, it is necessary to provide a configuration method, device, interactive system, electronic device, stylus, medium, and program product that can improve the synchronization between the stylus and the touch screen, addressing the aforementioned technical problems.
[0006] In a first aspect, this application provides a configuration method applied to an electronic device, the method comprising:
[0007] Obtain the original serial number generated by the stylus;
[0008] In response to a configuration command, the original serial number is offset based on the command delay offset between the stylus and the touchscreen of the electronic device to obtain a target serial number, and configuration data containing the target serial number is determined; and
[0009] The configuration data is sent to the touch screen and the stylus, so that the touch screen and the stylus can respectively use the configuration data to configure themselves when the synchronization configuration conditions corresponding to the target serial number are met.
[0010] In one embodiment, the step of offsetting the original serial number based on the instruction delay offset between the stylus and the touchscreen of the electronic device includes:
[0011] Based on the instruction delay duration between the stylus and the touchscreen of the electronic device, determine the instruction delay offset; and
[0012] Based on the serial number generation order corresponding to the original serial number, the original serial number is offset using the instruction delay offset to obtain the target serial number; the original serial number is generated by the stylus according to the serial number generation order.
[0013] In one embodiment, determining the instruction delay offset based on the instruction delay duration between the stylus and the touchscreen of the electronic device includes:
[0014] Determine the number of interaction cycles contained in the instruction transmission delay between the stylus and the touch screen of the electronic device, and determine the instruction delay offset based on the number of interaction cycles;
[0015] The number of interaction cycles is positively correlated with the instruction delay offset, and the instruction delay offset is greater than the number of interaction cycles.
[0016] In one embodiment, obtaining the original serial number generated by the stylus includes:
[0017] Obtain the serial number generated by the stylus; the serial number indicates the time when the data packet was generated;
[0018] The original sequence number is determined based on the sequence number with the smallest difference between the generated time and the current time.
[0019] In one embodiment, before configuring using the configuration data respectively, the method further includes:
[0020] After the stylus generates subsequent serial numbers of the original serial number according to the serial number generation order, if the subsequent serial number matches the target serial number, then the stylus satisfies the synchronization configuration condition.
[0021] If the subsequent serial number received by the touch screen matches the target serial number, then the touch screen satisfies the synchronization configuration condition.
[0022] In one embodiment, before the touch screen and the stylus respectively meet the synchronization configuration conditions corresponding to the target serial number, the following are also included:
[0023] The stylus and the electronic device, upon receiving the configuration data, respectively parse the configuration data to obtain the parsing result.
[0024] The configuration using the configuration data includes: the touch screen and the stylus respectively using the parsing results for configuration.
[0025] In one embodiment, it further includes:
[0026] The original sequence number belongs to at least one of the sequence numbers; the pressure data packet marked by the same sequence number has multiple pressure data sets, and the multiple pressure data sets are arranged sequentially according to a preset order; and / or,
[0027] The location data packet marked with the same sequence number has multiple location data, and the multiple location data are arranged in a preset order.
[0028] Secondly, this application also provides a configuration device for use in an electronic device, the device comprising:
[0029] The acquisition module is used to obtain the original serial number generated by the stylus;
[0030] An offset module, in response to a configuration command, offsets the original serial number based on the command delay offset between the stylus and the touchscreen of the electronic device to obtain a target serial number, and determines configuration data containing the target serial number; and
[0031] The sending module is used to send the configuration data to the touch screen and the stylus, so that the touch screen and the stylus can respectively use the configuration data to configure themselves when the synchronization configuration conditions corresponding to the target serial number are met.
[0032] Thirdly, this application also provides an interactive system, which includes a stylus and an electronic device, wherein the electronic device includes a processor and a touch screen;
[0033] The processor is used to obtain the original serial number generated by the stylus; in response to a configuration command, it performs offset processing on the original serial number according to the instruction delay offset between the stylus and the touch screen of the electronic device to obtain a target serial number, and determines configuration data containing the target serial number; it sends the configuration data to the touch screen and the stylus, so that the touch screen and the stylus can respectively use the configuration data to configure themselves when the synchronization configuration conditions corresponding to the target serial number are met.
[0034] Fourthly, this application also provides an electronic device. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the configuration method in any of the above embodiments.
[0035] Fifthly, this application also provides a stylus. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the configuration method performed by the stylus in any of the above embodiments.
[0036] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the configuration method in any of the above embodiments.
[0037] Seventhly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the configuration method in any of the above embodiments.
[0038] The aforementioned configuration method, device, interactive system, electronic device, stylus, medium, and program product acquire the original serial number generated by the stylus to determine the order of data sent by the stylus and clarify the signal generation situation of the stylus. Then, in response to a configuration command, the original serial number is offset according to the command delay offset between the stylus and the touchscreen of the electronic device to obtain a target serial number. This target serial number is used to estimate the data generated by the stylus and the touchscreen without interaction between the electronic device and the stylus, reducing the impact of delay. Furthermore, configuration data containing the target serial number is determined and sent to the touchscreen and the stylus. When the touchscreen and the stylus meet the synchronization configuration conditions corresponding to the target serial number, they respectively use the configuration data for synchronization configuration, ensuring synchronization during the configuration phase and subsequent writing processes, thus forming bidirectional data time synchronization. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0040] Figure 1 This is an application environment diagram of the configuration method in one embodiment;
[0041] Figure 2 This is a schematic diagram illustrating the interaction principle in one embodiment;
[0042] Figure 3 This is a flowchart illustrating the configuration method in one embodiment;
[0043] Figure 4 This is a flowchart illustrating the original sequence number offset in one embodiment;
[0044] Figure 5 This is a timing interaction diagram for generating written information in one embodiment;
[0045] Figure 6 This is a schematic diagram illustrating the specific process of the configuration method in one embodiment;
[0046] Figure 7 A structural block diagram of the configuration device in one embodiment; and
[0047] Figure 8 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0049] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various types of data, but these data are not limited by these terms. These terms are only used to distinguish between the first type of data and the second type of data. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the solutions, or any combination of multiple solutions.
[0050] The configuration method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown. For example... Figure 1As shown, the stylus and the processor in the electronic device communicate via an RF link, which can be, for example, Bluetooth Low Energy (BLE), 2.4GHz Private RF, or UltraWide Band (UWB). The processor in the electronic device can send configuration data to the stylus via the RF link. The stylus and the touchscreen in the electronic device communicate via a network; the touchscreen sends uplink data to the stylus, and the stylus sends downlink data to the touchscreen. The touchscreen and the processor in the electronic device communicate via an internal bus.
[0051] like Figure 2 As shown, the touchscreen sends uplink data for the stylus to synchronize timing, while the stylus sends downlink data at a specified time configured by the electronic device, allowing the touchscreen to detect information such as the stylus's coordinates and tip pressure. After the tablet informs the pen of the downlink data rules via the RF link, the screen-pen system enters the working state. At this time, the touchscreen sends uplink data for the pen to synchronize timing, the stylus sends downlink data at the appropriate time for the touchscreen to detect the pen's coordinates, and the pen sends the pressure level to the tablet via RF. The tablet can send configuration data via the RF link or via the internal bus to the touchscreen for the pen and touchscreen to modify the downlink data, thus completing the configuration process.
[0052] In this case, the processor in the electronic device directly sends configuration data to the touchscreen via an internal bus, such as I2C (Inter-Integrated Circuit), SPI (Serial Peripheral Interface), or USB (Universal Serial Bus), allowing the touchscreen to receive the configuration data immediately. However, the processor in the electronic device sends configuration data to the stylus via a radio frequency (RF) link. This process involves the RF protocol stack, the host HCI (Host Controller Interface), RF transmission, RF reception, the slave HCI interface, and the slave protocol stack. Furthermore, the presence of RF interference can lead to packet loss and retransmission. Therefore, the touchscreen and stylus receive the configuration data at different times. In this situation, the touchscreen receives the configuration data first, followed by the stylus, meaning the stylus receives the configuration data later than the touchscreen. This causes them to use asynchronous downlink configuration data for a portion of the time, resulting in the inability to write. Therefore, it is necessary to propose effective technical means to enable the stylus and touch screen to use matching configuration data synchronously, and to enable the subsequent writing process to be synchronized, so as to form two-way data time synchronization.
[0053] In one exemplary embodiment, such as Figure 3 As shown, a configuration method is provided, which is applied to Figure 1 The application of this method in electronic devices includes steps 302 to 306. Wherein:
[0054] Step 302: Obtain the original serial number generated by the stylus.
[0055] The original serial number is a number generated by the stylus to mark the data sent by the stylus, indicating the order in which the data is sent. The original serial number is generated sequentially according to the serial number generation order. For example, the stylus generates serial numbers in descending or ascending order. One or more of these serial numbers can characterize the time when the stylus processes the data. In this case, one or more serial numbers that can characterize the generation time include the original serial number.
[0056] When a stylus generates multiple downlink messages containing serial numbers, and the electronic device receives these multiple downlink messages, the original serial number can be the serial number contained in the most recently received downlink message. Optionally, the original serial number can be a string or a number.
[0057] In some embodiments, the stylus generates serial numbers based on a serial number generation sequence and uses these serial numbers to mark downlink information generated by the stylus. After the downlink information generated by the stylus is sent to the electronic device, the electronic device extracts the original serial number from the downlink information generated by the stylus. Each serial number is used to identify one or more downlink information items generated by the stylus. The downlink information can be a data packet or a data frame.
[0058] In one embodiment, the original serial number is used to mark pressure data packets sent from the stylus to the electronic device, and the original serial number is also used to mark location data packets sent from the touchscreen to the electronic device; the electronic device obtains the original serial number from the location data packets.
[0059] Step 304: In response to the configuration command, the original serial number is offset according to the command delay offset between the stylus and the touch screen of the electronic device to obtain the target serial number, and the configuration data containing the target serial number is determined.
[0060] Configuration commands are used to instruct electronic devices to update the configuration data of the stylus and touchscreen. Optionally, the configuration command can be triggered by the stylus, the touchscreen of the electronic device, or a button on the electronic device.
[0061] The instruction latency offset includes the delay in instruction transmission during uplink. It represents the difference in latency between the arrival of the same instruction at the stylus and the touchscreen when the electronic device's processor sends instructions to its touchscreen and stylus. Optionally, the instruction latency offset may include at least the uplink transmission delay, and may also include the transmission delay between the time the stylus generates the subsequent sequence number and the time the subsequent sequence number arrives at the touchscreen, as well as the latency incurred by the stylus and touchscreen processing the same instruction.
[0062] The target sequence number is the sequence number that follows the original sequence number. The target sequence number and the original sequence number can be of the same data type. For example, if the original sequence number is a string and represents 1, and the instruction delay offset is 10, then the target sequence number is a string and represents 11. If the original sequence number is a numeric type and is 1, and the instruction delay offset is 9, then the target sequence number is a numeric type and is 10.
[0063] Configuration data is used to configure the downlink data transmission process of the stylus. Configuration data includes, but is not limited to, communication configuration data and signal sensing configuration data. Communication configuration data includes, but is not limited to, the coding frequency representing the interaction cycle, the number of coding segments for signal segments within the interaction cycle, the coding waveform representing the interaction signal pattern, and the modulation method, which can be Frequency-Shift Keying (FSK), Phase-Shift Keying (PSK), etc. Signal sensing configuration data includes, but is not limited to, the data used by the touchscreen to parse downlink data.
[0064] In some embodiments, the original serial number is offset based on the instruction delay offset between the stylus and the electronic device as a preset offset value, and the target serial number is obtained by offsetting the original serial number based on the preset offset value.
[0065] In some embodiments, a target sequence number can be added to the data indicated by the configuration instruction to obtain configuration data. For example, the request header and request body can be determined based on the data indicated by the configuration instruction, and the target sequence number can be added to the request header to obtain a request header containing the target sequence number. The request header containing the target sequence number and the request body can be combined to obtain configuration data.
[0066] Because the time it takes for the instructions sent by the stylus to reach the touchscreen and the electronic device are different, and the time it takes for the instructions sent by the electronic device's own processor to reach the touchscreen and the stylus are also different, configuration data containing a target serial number is used to estimate the data generated by the stylus and the touchscreen when the electronic device is not interacting with the stylus, thereby reducing the impact of latency.
[0067] Step 306: Send configuration data to the touch screen and stylus, so that the touch screen and stylus can use the configuration data to configure themselves respectively, provided that the synchronization configuration conditions corresponding to the target serial number are met.
[0068] The synchronization configuration conditions are dynamically adjusted based on the target serial number. Since the data generated or received by the stylus and touchscreen changes dynamically, and the time when the touchscreen receives data differs from the time the stylus generates data, the synchronization configuration conditions corresponding to the target serial number enable the touchscreen and stylus to establish a temporal correspondence, thus achieving a synchronized configuration.
[0069] In some embodiments, both the touchscreen and the stylus are equipped with timers. When the timing results of the touchscreen and the stylus match the target serial number, the synchronization configuration condition corresponding to the target serial number is satisfied. Here, "matching" can be a value, where the timing result can be mapped to the target serial number; "matching" can also mean that the serial number corresponding to the timing result is the same as the target serial number.
[0070] In the above configuration method, the original serial number generated by the stylus is obtained to determine the order of data sent by the stylus and clarify the signal generation situation of the stylus; then, in response to the configuration command, the original serial number is offset according to the command delay offset between the stylus and the touch screen of the electronic device to obtain the target serial number. This target serial number is used to estimate the data generated by the stylus and the touch screen when the electronic device does not interact with the stylus, thereby reducing the impact of delay; then, configuration data containing the target serial number is determined and sent to the touch screen and the stylus. When the touch screen and the stylus meet the synchronization configuration conditions corresponding to the target serial number, they respectively use the configuration data to perform synchronous configuration, so that the configuration stage is synchronized and the subsequent writing process can also be synchronized, thus forming bidirectional data time synchronization.
[0071] In some embodiments, such as Figure 4 As shown, the original serial number is offset based on the instruction delay offset between the stylus and the touchscreen of the electronic device, including:
[0072] Step 402: Determine the instruction delay offset based on the instruction delay duration between the stylus and the touchscreen of the electronic device.
[0073] Command delay duration is the time difference between the arrival of configuration data at the touchscreen and the arrival of configuration data at the electronic device. Command delay duration can be a preset static time, dynamically calculated based on timestamps, or mapped from a serial number used to represent sequence. Command delay duration is different from command delay offset; command delay offset is an offset value set for the serial number, while command delay duration is a specific time length.
[0074] In one embodiment, a first serial number and a second serial number are generated sequentially by a stylus. After the downlink data containing the first serial number arrives at the touch screen, the second serial number is generated by the stylus. The instruction delay offset can be determined based on the time difference represented by the first serial number and the second serial number.
[0075] In some embodiments, determining the instruction delay offset based on the instruction delay duration between the stylus and the touch screen of the electronic device includes: determining the number of interaction cycles contained in the instruction transmission delay duration between the stylus and the touch screen of the electronic device, and determining the instruction delay offset based on the number of interaction cycles; wherein the number of interaction cycles is positively correlated with the instruction delay offset, and the instruction delay offset is greater than the number of interaction cycles.
[0076] The interaction cycle represents the duration of one interaction between the stylus and the touchscreen. The interaction cycle can be set per frame, in which case the ratio of command transmission latency to the number of frames is the number of interaction cycles; the interaction cycle can also be a preset value. Alternatively, the interaction cycle can be set based on the stylus sampling duration, in which case the ratio of command transmission latency to the stylus sampling duration is the number of interaction cycles. The number of interaction cycles is the total number of interaction cycles. Optionally, one interaction cycle may include one downlink data transmission and one uplink data transmission process.
[0077] In some embodiments, the instruction delay offset can be determined based on a preset number of interaction cycles, or the number of interaction cycles can be determined based on the ratio of the instruction transmission delay duration calculated by the electronic device to the configured interaction cycle.
[0078] In one embodiment, the instruction transmission delay is 100ms and one frame is 10ms. The number of interaction cycles is the ratio of 100ms to 10ms, which is 10 frames. In this case, the instruction delay offset is greater than 10 frames.
[0079] In this embodiment, the electronic device decomposes the command transmission delay time according to the interaction cycle between itself and the capacitive stylus. On the one hand, the number of interaction cycles is positively correlated with the command delay offset, making the command delay offset dynamically change according to the interaction cycle. On the other hand, the number of interaction cycles provides a threshold range to prevent the command delay offset from being too small. Therefore, the offset process of the original serial number can be controlled more accurately, so that the command delay offset can closely match the subsequent changes in the data generated by the stylus. This allows the stylus to more easily meet the synchronization conditions corresponding to the target serial number without excessive interaction, ensuring processing efficiency.
[0080] Step 404: Based on the serial number generation order corresponding to the original serial number, offset the original serial number using the instruction delay offset to obtain the target serial number; the original serial number is generated by the stylus according to the serial number generation order.
[0081] The serial number generation order follows a set of rules governing serial number changes. The initial serial number is at least one serial number. Each serial number can be used to execute a configuration method once to synchronize the stylus with the electronic device's data. Optionally, the serial number generation order can be from largest to smallest or smallest to largest, and the change can be incremental or decremental. The serial number generation order can have a largest serial number, which is less than or equal to the timestamp. The next serial number after the largest serial number is the smallest serial number, thus completing a cyclical process to save computation. For example, when the serial numbers are in descending order, the next serial number after the smallest serial number is the largest serial number, thus completing the cyclical process.
[0082] Since the electronic device has a defined serial number generation order, there is no need for interaction between the electronic device and the stylus, and the subsequent serial numbers generated by the stylus can be predicted; the subsequent serial numbers are generated after the original serial numbers.
[0083] The sequence number generation order indicates the offset direction of the sequence number, while the instruction delay offset indicates the magnitude of the offset of the original sequence number, thus quantifying the adjustment method of the target sequence number. Optionally, when the sequence number generation order is decreasing, the original sequence number is calculated by decreasing according to the instruction delay offset to obtain the target sequence number; when the sequence number generation order is increasing, the original sequence number is calculated by increasing according to the instruction delay offset to obtain the target sequence number. For example, if the original sequence number is 13 and the instruction delay offset is 10, then the target sequence number is 13.
[0084] In one embodiment, the stylus outputs serial numbers sequentially according to the serial number generation order, and each serial number includes the original serial number; for example, the stylus generates serial numbers in ascending order, and if the electronic device obtains one or more of the serial numbers, then one or more serial numbers are the original serial numbers.
[0085] In one embodiment, the stylus packages multiple pressure sampling points into a frame. The original sequence number carried within this frame is used to mark data at at least one granularity, both at the frame level and among the sampling points. Based on the sequence number generation order of the data at at least one granularity, the original sequence number is offset to obtain a target sequence number for that granularity. Thus, when the original sequence number belongs to the frame level, offsetting the frame-level sequence number yields a frame-level target sequence number, ensuring processing efficiency; when the original sequence number belongs to the sampling point level, offsetting the sampling point-level sequence number forms a target sequence number at the corresponding granularity, ensuring accuracy.
[0086] In this embodiment, the electronic device determines the instruction delay offset based on the instruction delay duration so that the delay duration is adapted to the offset process of the serial number; the electronic device determines the serial number generation order corresponding to the original serial number, and offsets the original serial number using the instruction delay offset according to the serial number generation order, so that the electronic device can estimate the data generation situation of the stylus without interaction between the electronic device and the stylus, thereby avoiding delay.
[0087] In some embodiments, obtaining the original serial number generated by the stylus includes: obtaining the serial number generated by the stylus; the serial number represents the generation time of the data packet; and determining the original serial number based on the serial number with the smallest difference between the generation time and the current time.
[0088] Data packets are generated by the stylus, and the electronic device generates writing information based on these data packets. Different data packets are generated by the stylus and sent to the touchscreen. The touchscreen then parses the data to extract serial numbers and pressure data, and sends this parsing result, along with the position data of the stylus's action, to the electronic device, enabling the device to parse the writing information. When the stylus generates multiple data packets at the same time, they can be labeled using the same serial number, allowing them to be associated. For example, if the stylus generates a first pressure data packet and a first position data packet at a first moment, they can use the same serial number; if the stylus generates a second pressure data packet and a second position data packet at a second moment, they can also use the same serial number.
[0089] For example, the stylus generates a sequence number in each frame (within each interaction cycle of uplink and downlink data) according to a certain pattern (e.g., incrementing or decrementing). The stylus modulates the sequence number into the downlink data and sends it to the touch screen. The stylus merges the sequence number into the pressure data packet and uploads it to the electronic device. The touch screen merges the received sequence number into the position data packet and uploads it to the electronic device. After receiving the pressure data and position data, the electronic device establishes the correspondence between the pressure data and position data through the sequence number and synthesizes the writing information.
[0090] In one embodiment, the sequence numbers are compared, and based on the comparison results, the sequence number with the smallest difference between the generation time and the current time is determined. This determined sequence number can be the original sequence number or can be used to map the original sequence number. For example, the sequence numbers are generated in descending order, representing the chronological order of generation. In this case, the larger the sequence number, the closer the data packet generation time is to the current time.
[0091] In this embodiment, the electronic device not only uses data packets to generate writing information, but also uses serial numbers to filter the original serial number closest to the current time, so that the instruction delay offset is offset by the latest serial number. Therefore, the instruction delay offset can be relatively small, which helps to make the target serial number closer to the subsequent serial number generated by the stylus, reducing the probability that the subsequent serial number generated by the stylus cannot meet the conditions corresponding to the target serial number, thereby improving the configuration success rate.
[0092] In some embodiments, before configuring using configuration data separately, the method further includes: after the stylus generates a subsequent serial number according to the serial number, if the subsequent serial number matches the target serial number, the stylus meets the synchronization configuration condition; in the serial number generation order, the subsequent serial number is arranged after the original serial number; if the subsequent serial number received by the touch screen matches the target serial number, the touch screen meets the synchronization configuration condition.
[0093] The subsequent serial number is generated by the stylus, and the time indicated by the subsequent serial number is after the time indicated by the original serial number. Optionally, the stylus and the electronic device interact according to an interaction cycle. The stylus generates a serial number for each interaction cycle to mark each interaction cycle, and the interaction cycle marked by the subsequent serial number is before the interaction cycle marked by the original serial number.
[0094] In one embodiment, after the stylus generates a subsequent serial number, it adds the subsequent serial number to the pressure data packet and transmits it to the touchscreen. The touchscreen meets the synchronization configuration conditions when a subsequent serial number matches the target serial number. The subsequent serial number can be a serial number based on handwriting input, so that handwriting can be used not only for data input but also for synchronization configuration.
[0095] In some embodiments, matching the subsequent serial number with the target serial number includes: the subsequent serial number being the same as the target serial number, or the subsequent serial number being the same as the target serial number and mapping to the same data.
[0096] In this embodiment, both the original serial number and the subsequent serial number are generated by the stylus, which makes the differences in the generation process of the original serial number and the subsequent serial number caused by the processor or other circuits smaller. Therefore, the stylus and the touch screen are matched based on the same subsequent serial number and the target serial number, which can make the synchronization accuracy between the stylus and the touch screen higher.
[0097] In some embodiments, before the touchscreen and stylus respectively meet the synchronization configuration conditions corresponding to the target serial number, the method further includes: the stylus and the electronic device respectively parse the configuration data based on the configuration data at the moment of receiving the configuration data to obtain the parsing result. Correspondingly, the touchscreen and stylus respectively use the configuration data for configuration, including: the touchscreen and stylus respectively use the parsing result for configuration.
[0098] The device receives the configuration data before it determines that it meets the conditions for synchronous configuration. Therefore, the parsing process of the configuration data is synchronized with the subsequent serial number generation, so that the configuration of the touch screen and stylus can be more synchronized.
[0099] In one embodiment, when the touch screen receives configuration data, it parses the configuration data and caches the parsing result until the touch screen meets the synchronization configuration conditions, at which point the touch screen performs configuration based on the cached parsing result; when the stylus receives configuration data, it caches the parsing result until the stylus meets the synchronization configuration conditions, at which point the stylus performs configuration based on the cached parsing result.
[0100] In this embodiment, the data parsing process precedes the moment when the device determines that it meets the synchronization configuration conditions. Therefore, when the touch screen and stylus determine that they meet the synchronization configuration conditions, the parsing results can be used directly for configuration, thereby making the synchronization more accurate.
[0101] In some embodiments, the method further includes: the original sequence number belongs to at least one of the sequence numbers; the pressure data packet marked with the same sequence number has multiple pressure data, and the multiple pressure data are arranged in a preset order; and / or, the location data packet marked with the same sequence number has multiple location data, and the multiple location data are arranged in a preset order.
[0102] Pressure data packets are data packets generated during a single interaction between a stylus and an electronic device. Each pressure data packet contains pressure data generated by the stylus and touchscreen at different times. Similarly, location data packets are data packets generated during a single interaction between a stylus and an electronic device. Each location data packet contains location data generated by the stylus and touchscreen at different times.
[0103] Optionally, the serial number most recent to the current time includes an original serial number. Therefore, when this original serial number is determined, the steps corresponding to the subsequent configuration method can be executed to synchronize the touchscreen and the stylus. Alternatively, the serial number most recent to the current time includes multiple original serial numbers. Therefore, when these original serial numbers are determined, the steps corresponding to the subsequent configuration method can be executed to synchronize the touchscreen and the stylus. Optionally, whenever a configuration command is received, the original serial number is obtained based on the time of the configuration command.
[0104] Both pressure data and location data can be arranged in a preset order; optionally, the preset order can be the same as the sequence number generation order, or it can be an order with other parsing rules, for example, it can be the order obtained by encrypting the sequence number generation order.
[0105] In one embodiment of the arrangement order, a first pressure data packet is marked with a first serial number. This first pressure data packet contains first pressure data and second pressure data. The first pressure data is generated at the first moment the stylus applies pressure to the touchscreen, and the second pressure data is generated at the second moment the stylus applies pressure to the touchscreen. Correspondingly, in the body of the pressure data packet, the first pressure data is arranged before the second pressure data. This arrangement order within the pressure data packet replaces the serial number arrangement process, thereby saving serial numbers. Optionally, the position data in the position data packet can also be arranged in the same manner as the pressure data packet.
[0106] In one embodiment, the stylus generates multiple pressure data at the same location, and a serial number is used to mark the multiple pressure data at the same location, as well as to mark one location data; the stylus generates multiple identical or similar pressure data at different locations, and a serial number is used to mark the multiple location data, as well as to mark one pressure data.
[0107] In this embodiment, the sequence number and the data packet are in one-to-one correspondence, and the data packet can contain multiple copies of data of the corresponding type. By encoding in a preset order, multiple copies of data can be transmitted with fewer data packets and sequence numbers, thereby ensuring the transmission efficiency of the data packet.
[0108] In one embodiment, such as Figure 5 As shown, before the configuration method is executed, steps 501 to 505 are included, wherein:
[0109] Step 501: The stylus generates the sequence number of each frame of data according to the sequence number generation order.
[0110] Step 502: The stylus modulates the serial number into the downlink data and sends the downlink data containing the serial number to the touch screen.
[0111] Step 503: The stylus sends a pressure data packet containing the serial number to the electronic device.
[0112] Step 504: The touchscreen merges the serial number into the location data packet and sends the location data packet containing the serial number to the electronic device.
[0113] Step 505: The electronic device extracts the pressure data from the pressure data packet and the position data from the position data packet. Then, it parses the pressure data and position data that match the serial number to obtain the writing information.
[0114] In one embodiment, after step 505, as Figure 6 As shown, the configuration method executed by the processor of the electronic device includes:
[0115] Step 602: Determine the original serial number based on the latest serial number generated by the stylus.
[0116] Step 604: In response to the configuration instruction indicating that an update is required, determine the instruction delay offset based on the number of interaction cycles contained in the instruction transmission delay duration; offset the original sequence number according to the instruction delay offset to obtain the target sequence number.
[0117] Step 606: Merge the target sequence number into the data packet used for configuration to obtain the configuration data.
[0118] Step 608: Send the configuration data to the touch screen and the stylus.
[0119] After step 608, after the stylus generates subsequent serial numbers of the original serial number according to the serial number generation order, if the subsequent serial number matches the target serial number, the stylus meets the synchronization configuration condition; if the subsequent serial number received by the touch screen matches the target serial number, the touch screen meets the synchronization configuration condition; when both the stylus and the touch screen meet the synchronization configuration condition, the touch screen and the stylus use the configuration data to perform configuration respectively.
[0120] Therefore, after completing the configuration steps, the synchronization between the touch screen and the stylus is relatively high. Based on the configured touch screen and stylus, steps 501-505 can be executed again to perform subsequent writing information generation steps through the highly synchronized touch screen and stylus.
[0121] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0122] In one exemplary embodiment, an interactive system is provided, the interactive system as follows: Figure 1 As shown, the processor obtains the original serial number generated by the stylus; in response to a configuration command, it offsets the original serial number according to the command delay offset between the stylus and the touchscreen of the electronic device to obtain a target serial number, and determines the configuration data containing the target serial number; it sends the configuration data to the touchscreen and the stylus, so that the touchscreen and the stylus can respectively use the configuration data for configuration if the synchronization configuration conditions corresponding to the target serial number are met. The specific implementation method in this embodiment can be found in the above method embodiment, and will not be repeated here.
[0123] Based on the same inventive concept, this application also provides a configuration apparatus for implementing the configuration method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more configuration apparatus embodiments provided below can be found in the limitations of the configuration method described above, and will not be repeated here.
[0124] In one exemplary embodiment, such as Figure 7As shown, a configuration device is provided, including:
[0125] Module 702 is used to obtain the original serial number generated by the stylus;
[0126] Offset module 704 is used to respond to configuration instructions, offset the original serial number according to the instruction delay offset between the stylus and the touch screen of the electronic device, obtain the target serial number, and determine the configuration data containing the target serial number;
[0127] The sending module 706 is used to send the configuration data to the touch screen and the stylus, so that the touch screen and the stylus can respectively use the configuration data to configure themselves when the synchronization configuration conditions corresponding to the target serial number are met.
[0128] In one embodiment, the offset module 704 is used for:
[0129] Based on the instruction delay duration between the stylus and the touchscreen of the electronic device, determine the instruction delay offset; and
[0130] Based on the serial number generation order corresponding to the original serial number, the original serial number is offset using the instruction delay offset to obtain the target serial number; the original serial number is generated by the stylus according to the serial number generation order.
[0131] In one embodiment, the offset module 704 is used for:
[0132] Determine the number of interaction cycles contained in the instruction transmission delay between the stylus and the touch screen of the electronic device, and determine the instruction delay offset based on the number of interaction cycles;
[0133] The number of interaction cycles is positively correlated with the instruction delay offset, and the instruction delay offset is greater than the number of interaction cycles.
[0134] In one embodiment, the acquisition module 702 is configured to:
[0135] Obtain the serial number generated by the stylus; the serial number indicates the time when the data packet was generated;
[0136] The original sequence number is determined based on the sequence number with the smallest difference between the generated time and the current time.
[0137] In one embodiment, before configuring using the configuration data respectively, the configuration device further includes a stylus configuration module and a touch screen configuration module;
[0138] The stylus configuration module is used to ensure that, after the stylus generates subsequent serial numbers of the original serial number according to the serial number generation order, if the subsequent serial number matches the target serial number, then the stylus satisfies the synchronization configuration condition.
[0139] The configuration module of the touch screen is configured to ensure that if the subsequent serial number received by the touch screen matches the target serial number, then the touch screen satisfies the synchronization configuration condition.
[0140] In one embodiment, before the touch screen and the stylus respectively meet the synchronization configuration conditions corresponding to the target serial number, at the moment when the stylus and the electronic device respectively receive the configuration data, the parsing result is determined based on the configuration data; the configuration module of the stylus and the configuration module of the touch screen respectively use the parsing result to perform configuration.
[0141] In one embodiment, the original sequence number belongs to at least one of the sequence numbers; the pressure data packet marked by the same sequence number has multiple pressure data sets, and the multiple pressure data sets are arranged sequentially according to a preset order; and / or,
[0142] The location data packet marked with the same sequence number has multiple location data, and the multiple location data are arranged in a preset order.
[0143] Each module in the above-described configuration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0144] In one exemplary embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a configuration switching method. The display unit of the electronic device forms a visually visible image and can be a touchscreen, which can be an LCD touchscreen or an e-ink touchscreen.
[0145] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0146] In one embodiment, a stylus is also provided, including a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the stylus-related steps in the above method embodiments.
[0147] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0148] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0149] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0151] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0152] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A configuration method, characterized in that, Applied to electronic devices, the method includes: Obtain the original serial number generated by the stylus; In response to a configuration command, the original serial number is offset based on the command delay offset between the stylus and the touchscreen of the electronic device to obtain a target serial number, and configuration data containing the target serial number is determined; and The configuration data is sent to the touch screen and the stylus, so that the touch screen and the stylus can respectively use the configuration data to configure themselves when the synchronization configuration conditions corresponding to the target serial number are met.
2. The method according to claim 1, characterized in that, The step of offsetting the original serial number based on the instruction delay offset between the stylus and the touchscreen of the electronic device includes: Based on the instruction delay duration between the stylus and the touchscreen of the electronic device, determine the instruction delay offset; and Based on the serial number generation order corresponding to the original serial number, the original serial number is offset using the instruction delay offset to obtain the target serial number; the original serial number is generated by the stylus according to the serial number generation order.
3. The method according to claim 2, characterized in that, The step of determining the instruction delay offset based on the instruction delay duration between the stylus and the touchscreen of the electronic device includes: Determine the number of interaction cycles contained in the instruction transmission delay between the stylus and the touch screen of the electronic device, and determine the instruction delay offset based on the number of interaction cycles; The number of interaction cycles is positively correlated with the instruction delay offset, and the instruction delay offset is greater than the number of interaction cycles.
4. The method according to claim 1, characterized in that, The step of obtaining the original serial number generated by the stylus includes: Obtain the serial number generated by the stylus; the serial number indicates the time when the data packet was generated; The original sequence number is determined based on the sequence number with the smallest difference between the generated time and the current time.
5. The method according to claim 1, characterized in that, Before configuring using the configuration data respectively, the method further includes: After the stylus generates a subsequent serial number, if the subsequent serial number matches the target serial number, then the stylus satisfies the synchronization configuration condition; in the serial number generation order, the subsequent serial number is arranged after the original serial number; If the subsequent serial number received by the touch screen matches the target serial number, then the touch screen satisfies the synchronization configuration condition.
6. The method according to claim 1, characterized in that, Before the touchscreen and the stylus respectively meet the synchronization configuration conditions corresponding to the target serial number, the method further includes: The stylus and the electronic device, upon receiving the configuration data, respectively parse the configuration data to obtain the parsing result. The configuration using the configuration data includes: the touch screen and the stylus respectively using the parsing results for configuration.
7. The method according to claim 1, characterized in that, Also includes: The original sequence number belongs to at least one of the sequence numbers; the pressure data packet marked by the same sequence number has multiple pressure data sets, and the multiple pressure data sets are arranged sequentially according to a preset order; and / or, The location data packet marked with the same sequence number has multiple location data, and the multiple location data are arranged in a preset order.
8. A configuration device, characterized in that, Applied to electronic devices, the device includes: The acquisition module is used to obtain the original serial number generated by the stylus; An offset module, in response to a configuration command, offsets the original serial number based on the command delay offset between the stylus and the touchscreen of the electronic device to obtain a target serial number, and determines configuration data containing the target serial number; and The sending module is used to send the configuration data to the touch screen and the stylus, so that the touch screen and the stylus can respectively use the configuration data to configure themselves when the synchronization configuration conditions corresponding to the target serial number are met.
9. An interactive system, characterized in that, The interactive system includes a stylus and an electronic device, the electronic device including a processor and a touch screen; The processor is used to obtain the original serial number generated by the stylus; in response to a configuration command, it performs offset processing on the original serial number according to the instruction delay offset between the stylus and the touch screen of the electronic device to obtain a target serial number, and determines configuration data containing the target serial number; it sends the configuration data to the touch screen and the stylus, so that the touch screen and the stylus can respectively use the configuration data to configure themselves when the synchronization configuration conditions corresponding to the target serial number are met.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
11. A stylus, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When executed by the processor, the computer program is used to implement the method performed by the stylus according to any one of claims 1-7.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
