Active pen state determination method, device and storage medium
By calculating the coordinate difference and speed of the active pen and combining it with a preset threshold to determine the active pen state, the problem of high misjudgment rate in the existing technology is solved, and the accurate identification and stable switching of the active pen state are achieved, thus improving the user interaction experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MAXEYE SMART TECH CO LTD
- Filing Date
- 2026-04-20
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies struggle to accurately and in real-time determine the writing status of an active pen, leading to a high misjudgment rate and impacting the user experience.
By detecting the communication connection between the active pen and the terminal, the current coordinate difference information and speed are calculated. Combined with preset speed thresholds and displacement thresholds, the static state or writing state of the active pen is determined, and a haptic feedback module is used to provide matching haptic feedback.
It improves the accuracy and anti-interference ability of active pen status recognition, ensures stable switching between static and writing states, and enhances the user's writing experience.
Smart Images

Figure CN122308632A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication technology, and in particular to an active pen state determination method, apparatus and storage medium. Background Technology
[0002] Active styluses (active pens) are widely used in touch display devices such as tablets, smartphones, and electronic whiteboards due to their advantages such as smooth writing, sensitive pressure sensitivity, and precise positioning. They have become an important interactive tool for users to perform handwriting input, note-taking, drawing, and electronic signatures. In the actual use of active pens, it is necessary to accurately distinguish between the static state and the writing state in order to reasonably control the touch reporting frequency, reduce power consumption, avoid accidental triggering, and accurately provide tactile feedback.
[0003] Currently, the working status of an active pen is typically determined by simply relying on whether a single coordinate offset exceeds a threshold, directly classifying it as moving or stationary. However, this approach struggles to simultaneously meet the requirements for interference resistance and low misjudgment, failing to accurately and in real-time determine the pen's writing state, thus hindering further improvements in the active pen's interactive experience. Summary of the Invention
[0004] Therefore, it is necessary to provide a method for determining the state of an active pen and an active pen to address the aforementioned technical problems.
[0005] Firstly, this application provides a method for determining the state of an active pen, applied to an active pen, comprising:
[0006] When the active pen has established a communication connection with the terminal and movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period.
[0007] Based on the current coordinate difference information, determine the current speed of the active pen within the current time period;
[0008] If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen during the preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period, and the preset time period includes the current moment; and
[0009] The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
[0010] In one embodiment, determining the total displacement of the active pen during the preset time period based on the current coordinate difference information and the preset time period includes:
[0011] Integrating the coordinate differences between the position coordinates of two adjacent moments within a preset time period yields the total coordinate difference of the active pen within that preset time period; and
[0012] The total displacement of the active pen during the preset time period is determined based on the total coordinate difference of the active pen during the preset time period.
[0013] In one embodiment, the method further includes:
[0014] When the current speed is greater than the preset speed threshold, tactile feedback matching the current speed is executed by the tactile feedback module in the active pen.
[0015] In one embodiment, determining the target pen state of the active pen based on the total displacement and a preset displacement threshold includes:
[0016] If the total displacement is less than or equal to a preset displacement threshold, the target pen state of the active pen is determined to be a stationary state; and
[0017] If the total displacement is greater than the preset displacement threshold, the target pen state of the active pen is determined to be the writing state.
[0018] In one embodiment, when the total displacement is greater than the preset displacement threshold, the method further includes:
[0019] The tactile feedback module in the active pen performs tactile feedback that matches the preset speed threshold.
[0020] In one embodiment, the method further includes:
[0021] Acquire historical speed data of the active pen when it is in a static state;
[0022] Statistical analysis is performed on the historical speed data to obtain speed distribution information of the historical speed data; and
[0023] The upper limit of speed in the speed distribution information is used as the preset speed threshold.
[0024] In one embodiment, the method further includes:
[0025] Acquire historical drift displacement data of the active pen when it is in a static state; wherein, the historical drift displacement data includes the drift displacement value corresponding to each historical moment;
[0026] Determine the average drift displacement value corresponding to each historical moment; and
[0027] The preset displacement threshold is determined by multiplying the average value by the preset safety factor.
[0028] In one embodiment, the duration of the preset time period is determined based on at least one of the following: the sampling rate of the touch integrated circuit IC of the active pen, the communication cycle between the active pen and the terminal, and the processing delay of the active pen.
[0029] Secondly, this application also provides an active pen state determination device, configured in an active pen, comprising:
[0030] The information acquisition module is used to determine the current coordinate difference information of the active pen in the current time period when the active pen and the terminal have established a communication connection and the active pen is detected to have moved; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period;
[0031] The speed determination module is used to determine the current speed of the active pen in the current time period based on the current coordinate difference information.
[0032] The displacement determination module is used to determine the total displacement of the active pen in the preset time period based on the current coordinate difference information and the preset time period when the current speed is less than or equal to a preset speed threshold; wherein the preset time period is located within the current time period and the preset time period includes the current moment;
[0033] The state determination module is used to determine the target pen state of the active pen based on the total displacement and the preset displacement threshold.
[0034] Thirdly, this application also provides an active pen, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0035] When the active pen has established a communication connection with the terminal and movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period.
[0036] Based on the current coordinate difference information, determine the current speed of the active pen within the current time period;
[0037] If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen during the preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period, and the preset time period includes the current moment; and
[0038] The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
[0039] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0040] When the active pen has established a communication connection with the terminal and movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period.
[0041] Based on the current coordinate difference information, determine the current speed of the active pen within the current time period;
[0042] If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen during the preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period, and the preset time period includes the current moment; and
[0043] The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
[0044] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0045] When the active pen has established a communication connection with the terminal and movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period.
[0046] Based on the current coordinate difference information, determine the current speed of the active pen within the current time period;
[0047] If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen during the preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period, and the preset time period includes the current moment; and
[0048] The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
[0049] The aforementioned active pen state determination method, device, and storage medium detect the movement state of the active pen in real time, calculate the current speed of the active pen based on the coordinate difference information of adjacent moments, and further calculate the total displacement within a preset time period when the speed is low. By combining a preset speed threshold and a preset displacement threshold to make a dual judgment on the target pen state of the active pen, it can accurately and stably distinguish between the static state and the writing state of the active pen. Compared with schemes that rely solely on instantaneous speed or single displacement judgment, this application effectively avoids misjudgment of the state caused by slight shaking, accidental touch, or slow movement of the active pen, improves the anti-interference ability and recognition accuracy of active pen state recognition, ensures the stability and reliability of the active pen during the switching process between static and writing, and optimizes the user's writing experience. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0051] Figure 1 This is an application environment diagram of the active pen state determination method in one embodiment;
[0052] Figure 2 This is a flowchart illustrating an active pen state determination method in one embodiment;
[0053] Figure 3 This is a flowchart illustrating the process of determining the total displacement of the active pen during a preset time period in one embodiment.
[0054] Figure 4 This is a schematic diagram of the process for determining a preset speed threshold in one embodiment;
[0055] Figure 5 This is a flowchart illustrating the process of determining a preset displacement threshold in one embodiment;
[0056] Figure 6 This is a flowchart illustrating the active pen state determination method in another embodiment;
[0057] Figure 7 A structural block diagram of an active pen state determination device in one embodiment; and
[0058] Figure 8 This is a diagram of the internal structure of a stylus in one embodiment. Detailed Implementation
[0059] 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.
[0060] The active pen state determination method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the active pen 101 features capacitive sensing, coordinate detection, and haptic feedback. It can communicate with the terminal 102 (tablet, touchscreen, etc.) via a touch IC and screen-pen protocol, serving as an electronic writing tool for writing, drawing, and other operations on the terminal screen. The terminal 102, used in conjunction with the active pen, is a touch device with a built-in touch IC that detects the active pen's position coordinates and movement trajectory, transmitting the relevant data to the active pen and providing it with a coordinate data source.
[0061] In one exemplary embodiment, such as Figure 2 As shown, an active pen state determination method is provided, which is applied to... Figure 1 Taking the active pen 101 as an example, the explanation includes the following steps:
[0062] S201, when the active pen and the terminal have established a communication connection and the active pen is detected to have moved, determine the current coordinate difference information of the active pen in the current time period.
[0063] The current time period is a continuous time interval from the moment the active pen movement is detected to the current real-time moment. The duration can be dynamically adjusted according to the sampling rate of the touch IC and is used to collect coordinate data during the current movement process.
[0064] The current coordinate difference information is the set of differences between the position coordinates of two adjacent sampling times of the active pen within the current time period; in one embodiment, the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent times within the current time period, and the coordinate difference includes the difference between the horizontal coordinate and the difference between the vertical coordinate; wherein, the two adjacent times are the consecutive sampling times of the touch IC, and the position coordinates are the two-dimensional coordinates of the active pen on the terminal screen, which are detected by the touch IC and transmitted to the active pen.
[0065] In one embodiment, the active pen establishes a communication connection with the terminal, the terminal's touch IC is in normal working condition, the pen tip is in contact with the terminal screen, and the active pen's own sensor is working normally. The terminal's touch IC collects the position coordinates of the active pen in real time. The sampling frequency is determined by the touch IC's sampling rate, and coordinate data is collected once at fixed intervals. The active pen receives this coordinate data in real time through the screen-pen protocol. It compares the coordinate data from two adjacent collections. If the absolute value of the coordinate difference is greater than a preset small threshold, it is determined that "movement of the active pen has been detected," triggering subsequent processes. If it is less than the small threshold, it is determined that there has been no movement, and subsequent steps are not executed.
[0066] The current time period is defined by starting at the moment when "movement of the active pen is detected" and ending at the moment when the coordinates are currently being collected in real time. For example, if the starting time is t0 and the current time is t1, the current time period is [t0, t1], and the duration is t1-t0, ensuring that enough coordinate data is collected to calculate the coordinate difference. Within the current time period, coordinate data for all two adjacent moments are extracted, and the coordinate difference between the two adjacent moments is calculated. All coordinate differences are then summarized to form the current coordinate difference information, which is stored in the built-in storage module.
[0067] It should be noted that during the coordinate difference calculation process, abnormal coordinate data needs to be initially filtered by using median filtering to remove coordinate differences that exceed the normal drift range, thus avoiding abnormal data from affecting the calculation accuracy.
[0068] S202, Based on the current coordinate difference information, determine the current speed of the active pen in the current time period.
[0069] The current speed is the real-time movement speed of the active pen within the current time period, used to determine the current movement status of the active pen.
[0070] Optionally, the real-time displacement between each pair of adjacent sampling times can be calculated using the Euclidean distance formula based on each set of coordinate differences in the current coordinate difference information. For example, the real-time displacement between each pair of adjacent sampling times can be calculated using the following formula:
[0071]
[0072] in, For real-time displacement; The difference is the x-axis coordinate. The difference is represented by the vertical axis.
[0073] In one embodiment, the current velocity can be calculated using an average velocity method, balancing computational accuracy and real-time performance. For example, the ratio of the sum of all real-time displacements within the current time period to the total duration of the current time period is taken as the current velocity of the active pen within that time period. Here, the total duration of the current time period is the product of the sampling interval and the number of samples taken within the current time period.
[0074] S203, when the current speed is less than or equal to the preset speed threshold, determine the total displacement of the active pen in the preset time period based on the current coordinate difference information and the preset time period.
[0075] The preset time period is located within the current time period and includes the current moment. This preset time period serves as a window for verifying whether the active pen is in a static state. This period is entirely within the current time period and includes the current moment, thus avoiding short-term noise interference and preventing haptic feedback lag. The duration of the preset time period is determined based on at least one of the following: the sampling rate of the active pen's touch integrated circuit (IC), the communication cycle between the active pen and the terminal, and the processing latency of the active pen.
[0076] The preset speed threshold is a critical speed value used to distinguish between the active pen's "stationary / minor drift" and "effective writing". The total displacement is the cumulative distance the active pen moves within a preset time period, calculated based on the coordinate difference information of all adjacent moments within the preset time period, and is used to accurately determine whether the active pen is "minor drifting in a stationary state" or "slow writing".
[0077] Optionally, the active pen stores the calculated current speed in its built-in cache and simultaneously calls a preset speed threshold, comparing the current speed with the preset speed threshold. If the current speed is less than or equal to the preset speed threshold, it indicates that the active pen may be in a stationary state or writing slowly. To further determine the state of the active pen, it is necessary to determine it based on the total displacement of the active pen over a preset time period.
[0078] In one embodiment, the preset time period is a sub-time period within the current time period, and includes the current time; that is, the end time of the preset time period is the current time. For example, suppose the current time is... The preset time period duration is The preset time period is The preset time period can be within the current time period or overlap with the current time period.
[0079] Optionally, the total displacement of the active pen within a preset time period can be determined based on a pre-defined calculation process, the current coordinate difference information, and the preset time period. It should be noted that the duration of the preset time period must strictly match the sampling rate of the touch IC to ensure that the number of samples within the preset time period is no less than 3, avoiding deviations in the total displacement calculation due to insufficient sampling data.
[0080] S204, determine the target pen state of the active pen based on the total displacement and the preset displacement threshold.
[0081] The preset displacement threshold is a critical displacement value used to distinguish between "static drift" and "slow writing" of the active pen, and it is calibrated by the active pen through historical drift displacement data.
[0082] The target pen state refers to the current working state of the active pen. In one embodiment, the target pen state is either a static state or a writing state. In the static state, the pen tip is in contact with the terminal screen, but there is no valid writing intention; only minor drift occurs due to touch IC detection errors or user hand instability. In this state, haptic feedback is not required, and the corresponding writing speed is a preset writing speed (usually 0). In the writing state, the active pen has a clear writing intention, and the movement trajectory is a continuous and valid trajectory (including fast writing and slow writing). In this state, haptic feedback needs to be triggered, and the corresponding writing speed is a non-zero speed.
[0083] Optionally, the calculated total displacement can be compared with a preset displacement threshold, and the target pen state of the active pen can be determined based on the comparison result.
[0084] In an exemplary embodiment, when the total displacement is less than or equal to a preset displacement threshold, the target pen state of the active pen is determined to be a stationary state. At this time, the slight movement of the active pen is considered to be drift in the stationary state (caused by touch IC detection error or unstable user hand position), with no effective writing intention, and the writing speed of the active pen is determined to be 0.
[0085] If the total displacement is greater than the preset displacement threshold, the target pen state of the active pen is determined to be the writing state. At this time, the movement of the active pen is considered to be a slow and effective writing action of the user with a clear writing intention, and the writing speed of the active pen is determined to be the preset speed threshold.
[0086] The active pen stores the determined target pen state and writing speed in the built-in storage module, and sends the control signal to the haptic feedback module to complete one state judgment and feedback control; then repeats steps S201-S204 to achieve real-time dynamic judgment.
[0087] In the above-mentioned method for determining the state of an active pen, the movement state of the active pen is detected in real time, the current speed of the active pen is calculated based on the coordinate difference information of adjacent moments, and the total displacement within a preset time period is further calculated when the speed is low. The target pen state of the active pen is judged by combining the preset speed threshold and the preset displacement threshold. This method can accurately and stably distinguish between the static state and the writing state of the active pen. Compared with the scheme that relies solely on instantaneous speed or single displacement judgment, this application effectively avoids misjudgment of the state caused by slight shaking, accidental touch or slow movement of the active pen, improves the anti-interference ability and recognition accuracy of the active pen state recognition, ensures the stability and reliability of the active pen during the switching process between static and writing, and optimizes the user's writing experience.
[0088] Optionally, in an exemplary embodiment, such as Figure 3 As shown, a method for determining the total displacement of an active pen over a preset time period is provided, specifically including the following steps:
[0089] S301, Integrate the coordinate difference between the position coordinates of two adjacent times within the preset time period to obtain the total coordinate difference of the active pen within the preset time period.
[0090] The position coordinates are the two-dimensional coordinates of the pen tip on the terminal screen, obtained by the terminal's touch IC. The coordinate difference includes the horizontal coordinate difference and the vertical coordinate difference; correspondingly, the total coordinate difference includes the total horizontal coordinate difference and the total vertical coordinate difference. Integrating the coordinate differences between two adjacent moments within a preset time period is equivalent to accumulating the coordinate differences across multiple consecutive frames within the time window. In this embodiment, the total horizontal coordinate difference is obtained by sequentially accumulating the horizontal coordinate difference of each moment relative to the previous moment, and the total vertical coordinate difference is obtained by sequentially accumulating the vertical coordinate difference of each moment relative to the previous moment. The total horizontal coordinate difference and the total vertical coordinate difference together constitute the total coordinate difference of the active pen within the preset time period.
[0091] In one embodiment, all coordinate difference data within a preset time period are extracted from the current coordinate difference information. For example, the preset time period includes sampling times of... , , , Then, the coordinate difference extracted from the current coordinate difference information is: , , , , , , , First, the coordinate differences within the preset time period are summed to obtain the total x-coordinate difference. Difference between total ordinate and total coordinate .
[0092] S302, determine the total displacement of the active pen within the preset time period based on the total coordinate difference of the active pen within the preset time period.
[0093] The total displacement refers to the straight-line distance between the position coordinates corresponding to the start time and the position coordinates corresponding to the end time of the preset time period. In this embodiment, the total displacement is determined by the two-dimensional Euclidean distance formula based on the total difference in the horizontal and vertical coordinates of the active pen within the preset time period. It is a scalar quantity that only reflects the magnitude of the movement and does not include information on the direction of movement.
[0094] Optionally, the total displacement can be calculated using the Euclidean distance formula; if there is slight noise in the coordinate difference data within the preset time period, a moving average filtering process can be performed first, and then the total displacement can be calculated to further improve the accuracy.
[0095] In this embodiment, the total coordinate difference of the active pen within a preset time period is obtained by integrating the coordinate differences between adjacent moments. Based on this, the total displacement is calculated. This fully utilizes the position change information of multiple consecutive frames to achieve a cumulative and holistic judgment of the active pen's movement amplitude. It avoids judgment errors caused by single coordinate jitter, noise interference, or minor false triggers, thus improving the stability and accuracy of the total displacement calculation.
[0096] Optionally, in one embodiment, to improve the user's writing experience and make the writing feel of the active pen closer to the real feel of traditional pen and paper writing, a haptic feedback module is integrated into the active pen. The haptic feedback module typically consists of a vibration motor and a drive circuit. It can receive control signals and execute corresponding vibration feedback (such as vibrations of different intensities and frequencies) according to the writing speed and writing state (resting / writing) of the active pen. Its core function is to simulate the friction and pressure sensation of traditional pen and paper writing, thereby enhancing the realism and immersion of writing.
[0097] The triggering and deactivation of the haptic feedback module are directly determined by the writing speed of the active pen and the state of the target pen. When the active pen is in an effective writing state (fast or slow writing), the haptic feedback module needs to be activated and execute the corresponding vibration feedback; when the active pen is in a static state (no effective writing action, only slight drift), the haptic feedback module needs to remain deactivated to avoid accidental vibration triggering that could affect the user experience. Based on this, in one embodiment, different haptic feedback execution methods are provided for different target pen states of the active pen.
[0098] In one optional embodiment, when the current speed exceeds a preset speed threshold, tactile feedback matching the current speed is executed by the tactile feedback module in the active pen. Optionally, the active pen calls the calculated current speed and compares it with the preset speed threshold in real time. When the current speed is detected to be greater than the preset speed threshold, it is determined that the active pen is in a fast and effective writing state, triggering the tactile feedback execution process. The active pen determines the corresponding tactile feedback parameters based on the specific value of the current speed; above the preset speed threshold, the current speed is positively correlated with vibration intensity and vibration frequency (i.e., the faster the speed, the higher the vibration intensity and frequency). Based on the tactile feedback parameters, the tactile feedback module inside the active pen is called. The tactile feedback module is driven by a drive circuit to drive a vibration motor and execute vibration operations according to the tactile feedback parameters. The above optional embodiment, through the control logic linking the current speed and tactile feedback parameters, makes the tactile feedback of the active pen during fast writing more closely resemble the real writing scenario, solving the problem of stiff writing feel caused by fixed tactile feedback intensity and frequency that do not match the writing speed in the prior art, further improving the realism and comfort of the user's writing.
[0099] In another optional embodiment, when the total displacement exceeds a preset displacement threshold, tactile feedback matching a preset speed threshold is executed by the tactile feedback module in the active pen. When the total displacement of the active pen within a preset time period exceeds the preset displacement threshold, it is determined that the active pen is currently in a slow, effective writing state. At this time, although the real-time calculated current speed is less than or equal to the preset speed threshold, tactile feedback still needs to be triggered because the accumulated displacement has reached the determination condition for effective writing. The active pen determines the corresponding tactile feedback parameters based on the specific value of the preset speed threshold; based on the tactile feedback parameters, it calls the tactile feedback module inside the active pen. The tactile feedback module is driven by a drive circuit to drive a vibration motor and perform vibration operations according to the tactile feedback parameters. For example, a fixed low-intensity, low-frequency vibration is used to simulate the frictional feel between the pen tip and the paper during slow writing, ensuring that the tactile feedback is continuous and natural during slow writing without interruption or lag.
[0100] In another alternative embodiment, if the current speed is less than or equal to a preset speed threshold and the total displacement is less than or equal to a preset displacement threshold, the active target pen is determined to be in a stationary state. In this case, there is no need to trigger the haptic feedback module.
[0101] Optionally, in one embodiment, the preset speed threshold is obtained by the active pen through historical speed data, based on which, such as... Figure 4 As shown, a method for determining a preset speed threshold is provided, which specifically includes the following steps:
[0102] S401, acquire historical speed data of the active pen when it is stationary.
[0103] Among them, the historical speed data is a set of speed data collected and transmitted by the terminal touch IC through multiple static states of the active pen, and calculated by the active pen, which includes instantaneous speed values in multiple static scenarios.
[0104] Optionally, the active pen uses the terminal's touch IC to collect its position coordinates in real time, continuously monitoring for 10-30 seconds. If the coordinate changes during this period are all less than a preset micro-displacement, the active pen is determined to be in a stationary state, and the historical speed data collection process is initiated. If a significant coordinate change is detected (exceeding the micro-displacement), it is determined to be in a non-stationary state, and data collection stops. The collection period and number of collections are set, with the collection period consistent with the terminal's touch IC sampling rate. 1000-2000 sets of speed data are collected in a single stationary scenario to ensure statistical representativeness. At the same time, the collection scenarios cover different environments, different screen materials, and different handheld postures to avoid data deviation caused by a single scenario.
[0105] The terminal touch IC collects the coordinate differences between adjacent moments of the active pen in real time and transmits the coordinate difference data to the active pen via the screen-pen protocol. The active pen calculates the instantaneous speed based on the coordinate differences using the Euclidean distance formula, obtaining the instantaneous speed value for a single set of stationary states. All instantaneous speed values collected in a single stationary scenario are marked with the collection scenario information and stored in the active pen's built-in storage module. The above steps are repeated to collect speed data in 5-10 different stationary scenarios, which are then aggregated to form a historical speed data set, ensuring the comprehensiveness and representativeness of the data.
[0106] It should be noted that during the data collection process, abnormal speed data needs to be filtered in real time to avoid abnormal data affecting the accuracy of subsequent statistical analysis; at the same time, the pen tip should be kept in stable contact with the screen during the data collection process to avoid misjudgment caused by human touch due to non-static state.
[0107] S402, perform statistical analysis on historical speed data to obtain speed distribution information of historical speed data.
[0108] Among them, speed distribution information is a set of characteristic parameters obtained from historical speed data through statistical analysis, which includes at least the upper limit of speed, the lower limit of speed, the average value, the standard deviation, the distribution interval, and the quantiles.
[0109] Optionally, the historical speed data set can be filtered first. For example, outlier analysis can be used to remove outliers. This involves calculating the upper and lower quartiles of the historical speed data to determine the range of outliers, and then removing speed values that exceed this range. At the same time, a moving average filter can be used to smooth the remaining data and filter out the minor fluctuations caused by the touch IC detection noise, thus obtaining the pre-processed valid historical speed data.
[0110] For the preprocessed valid historical velocity data, core statistical parameters are calculated, including but not limited to the upper and lower limits of velocity, mean, standard deviation, distribution interval, and quantiles. Furthermore, a normal distribution fitting method can be used to fit the valid historical velocity data to obtain a velocity distribution curve, clarifying the distribution pattern of the noise velocity—the historical velocity data under static conditions exhibits a normal distribution, concentrated around the mean, with relatively low dispersion. Combining the fitting results, the rationality of the basic statistical parameters is further verified, ensuring that the statistical results accurately reflect the noise velocity characteristics under static conditions.
[0111] The core statistical parameters and distribution fitting results obtained from the above calculations are summarized to form speed distribution information, which is then stored in the active pen data processing module for subsequent determination of preset speed thresholds; the speed distribution information must clearly label key parameters.
[0112] S403, use the upper limit value of speed in the speed distribution information as the preset speed threshold.
[0113] Among them, the upper limit of speed is the maximum value of noise speed in the speed distribution information that can cover most of the static states. It is the critical dividing point of speed between static states and effective writing states. Using it as a preset speed threshold can ensure that the noise speed in static states is lower than the threshold and the effective writing speed is higher than the threshold.
[0114] Optionally, the upper limit of speed can be selected from the speed distribution information as a preset speed threshold and stored in the built-in storage module of the active pen. At the same time, the calibration process of the preset speed threshold is recorded to facilitate subsequent threshold updates and maintenance.
[0115] In this embodiment, by collecting historical speed data of the active pen in its stationary state, a speed upper limit value that conforms to the actual noise characteristics is obtained through statistical analysis. This upper limit value is used as a preset speed threshold, which can accurately cover all stationary noise speeds and form a clear boundary with the user's effective writing speed (even slow writing). This fundamentally solves the defects of false triggering when stationary and no triggering when writing slowly, and improves the accuracy of tactile feedback.
[0116] In one embodiment, the preset displacement threshold is obtained by the active pen through historical drift displacement data. Based on this, such as... Figure 5 As shown, a method for determining a preset displacement threshold is provided, which specifically includes the following steps:
[0117] S501, acquire historical drift displacement data when the active pen is in a static state.
[0118] The historical drift displacement data is a collection of drift displacements at multiple moments collected by the terminal touch IC during multiple periods of stationary operation of the active pen, used to reflect the natural noise displacement during stationary operation. In one embodiment, the historical drift displacement data includes the drift displacement value corresponding to each historical moment; the drift displacement value is the minute movement distance generated by the active pen at a single sampling moment during stationary operation, calculated from the coordinate difference.
[0119] Optionally, after the active pen establishes a connection with the terminal, the pen tip touches the terminal's screen and remains stationary. The terminal's touch IC collects the pen tip coordinates at a fixed sampling rate. The active pen calculates the drift displacement value based on the coordinates of adjacent moments; it continuously collects a large number of sampling points (e.g., 1000-5000) in a stationary state to form historical drift displacement data. The data collection covers different environments to ensure data representativeness.
[0120] S502, determine the average value of the drift displacement corresponding to each historical moment.
[0121] Optionally, an arithmetic mean can be calculated for all collected drift displacement values. Significantly abnormal abrupt changes can be removed to avoid interfering with the accuracy of the average. The average value represents the typical drift amplitude under static conditions.
[0122] S503, determine the preset displacement threshold based on the product of the average value and the preset safety factor.
[0123] The preset safety factor is a constant greater than 1, which is used to increase the safety margin of each threshold and avoid misjudgment caused by extreme noise.
[0124] In one embodiment, the product of the average value and the preset safety factor is used as the preset displacement threshold and stored in the built-in storage module of the active pen. At the same time, the calibration process of the preset displacement threshold is recorded to facilitate subsequent threshold updates and maintenance.
[0125] In one embodiment, by collecting historical drift displacement data of the active pen in its stationary state, calculating the average drift displacement and determining the preset displacement threshold in combination with a preset safety factor, it can accurately match the actual noise drift characteristics of the active pen, effectively cover all the tiny drifts in the stationary state, and form a clear boundary with the user's slow and effective writing, solving the defects of false vibration triggered when stationary and no feedback triggered when writing slowly, and greatly improving the accuracy of tactile feedback and the consistency of writing experience.
[0126] Figure 6 This is a flowchart illustrating the active pen state determination method in another embodiment. Based on the above embodiments, this embodiment provides an optional example of the active pen state determination method. (Combined with...) Figure 6 The specific implementation process is as follows:
[0127] S601, when the active pen and the terminal have established a communication connection and the active pen is detected to have moved, determine the current coordinate difference information of the active pen in the current time period.
[0128] The current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent times within the current time period.
[0129] S602, based on the current coordinate difference information, determine the current speed of the active pen in the current time period.
[0130] S603, determine whether the current speed is greater than the preset speed threshold; if yes, execute S610; if no, execute S604.
[0131] S604, integrate the coordinate difference between the position coordinates of two adjacent times within the preset time period to obtain the total coordinate difference of the active pen within the preset time period.
[0132] The preset time period is located within the current time period, and the preset time period includes the current moment.
[0133] S605, determine the total displacement of the active pen within the preset time period based on the total coordinate difference of the active pen within the preset time period.
[0134] S606, determine whether the total displacement is greater than the preset displacement threshold; if yes, execute S607; if no, execute S608.
[0135] S607, determine that the target pen state of the active pen is the writing state, and execute S609.
[0136] S608, determine that the target pen state of the active pen is a stationary state.
[0137] S609 executes tactile feedback matching a preset speed threshold through the tactile feedback module in the active pen.
[0138] S610, determine that the target pen state of the active pen is the writing state, and execute S611.
[0139] S611 performs tactile feedback that matches the current speed through the tactile feedback module in the active pen.
[0140] The specific processes of S601-S611 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0141] It should be understood that although the steps in the flowcharts of the embodiments described above 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 embodiments described above 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.
[0142] Based on the same inventive concept, this application also provides an active pen state determination device for implementing the active pen state determination method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more active pen state determination device embodiments provided below can be found in the limitations of the active pen state determination method described above, and will not be repeated here.
[0143] In one exemplary embodiment, such as Figure 7 As shown, an active pen state determination device 700 is provided, configured on an active pen, including: an information acquisition module 710, a speed determination module 720, a displacement determination module 730, and a state determination module 740, wherein:
[0144] The information acquisition module 710 is used to determine the current coordinate difference information of the active pen in the current time period when the active pen and the terminal have established a communication connection and the active pen is detected to have moved; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period;
[0145] The speed determination module 720 is used to determine the current speed of the active pen in the current time period based on the current coordinate difference information;
[0146] The displacement determination module 730 is used to determine the total displacement of the active pen in a preset time period based on the current coordinate difference information and the preset time period when the current speed is less than or equal to a preset speed threshold; wherein the preset time period is located within the current time period and includes the current moment.
[0147] The state determination module 740 is used to determine the target pen state of the active pen based on the total displacement and the preset displacement threshold.
[0148] In one embodiment, the displacement determination module 730 is specifically used for:
[0149] Integrate the coordinate difference between the position coordinates of two adjacent moments within the preset time period to obtain the total coordinate difference of the active pen within the preset time period; determine the total displacement of the active pen within the preset time period based on the total coordinate difference of the active pen within the preset time period.
[0150] In one embodiment, the active pen state determination device 700 further includes a haptic feedback module for:
[0151] When the current speed is greater than a preset speed threshold, tactile feedback matching the current speed is executed through the tactile feedback module in the active pen.
[0152] In one embodiment, the state determination module 740 is used for:
[0153] If the total displacement is less than or equal to the preset displacement threshold, the target pen state of the active pen is determined to be a stationary state; if the total displacement is greater than the preset displacement threshold, the target pen state of the active pen is determined to be a writing state.
[0154] In one embodiment, the haptic feedback module is also used for:
[0155] The haptic feedback module in the active pen performs haptic feedback that matches a preset speed threshold.
[0156] In one embodiment, the active pen state determination device 700 further includes a threshold determination module, used for:
[0157] Acquire historical speed data of the active pen when it is stationary; perform statistical analysis on the historical speed data to obtain speed distribution information of the historical speed data; use the upper limit value of the speed distribution information as the preset speed threshold.
[0158] In one embodiment, the threshold determination module is further configured to:
[0159] Acquire historical drift displacement data of the active pen when it is stationary; the historical drift displacement data includes the drift displacement value corresponding to each historical moment; determine the average value of the drift displacement value corresponding to each historical moment; determine the preset displacement threshold based on the product of the average value and the preset safety factor.
[0160] In one embodiment, the duration of the preset time period is determined based on at least one of the following: the sampling rate of the active pen's touch integrated circuit IC, the communication cycle between the active pen and the terminal, and the processing latency of the active pen.
[0161] The modules in the aforementioned active pen status determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0162] In one exemplary embodiment, an active pen is provided, the internal structure of which can be shown in the diagram below. Figure 8 As shown, the active pen includes a processor, memory, input / output (I / O) interface, and communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The I / O interface is used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an active pen state determination method.
[0163] 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 active pen to which the present application is applied. A specific active pen may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0164] In one exemplary embodiment, an active pen is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0165] When the active pen and the terminal have established a communication connection and the movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period.
[0166] Based on the current coordinate difference information, determine the current speed of the active pen within the current time period;
[0167] If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen within a preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period and includes the current moment; and
[0168] The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
[0169] In one embodiment, when the processor executes a computer program to determine the total displacement of the active pen during a preset time period based on the current coordinate difference information and the preset time period, it also performs the following steps:
[0170] Integrate the coordinate difference between the position coordinates of two adjacent moments within a preset time period to obtain the total coordinate difference of the active pen within the preset time period; and determine the total displacement of the active pen within the preset time period based on the total coordinate difference of the active pen within the preset time period.
[0171] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0172] When the current speed is greater than a preset speed threshold, tactile feedback matching the current speed is executed through the tactile feedback module in the active pen.
[0173] In one embodiment, when the processor executes a computer program to determine the target pen state of the active pen based on the total displacement and a preset displacement threshold, it also performs the following steps:
[0174] When the total displacement is less than or equal to a preset displacement threshold, the target pen state of the active pen is determined to be a stationary state; and when the total displacement is greater than the preset displacement threshold, the target pen state of the active pen is determined to be a writing state.
[0175] In one embodiment, when the total displacement is greater than a preset displacement threshold, the processor further performs the following steps when executing the computer program:
[0176] The haptic feedback module in the active pen performs haptic feedback that matches a preset speed threshold.
[0177] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0178] Acquire historical speed data of the active pen when it is stationary; perform statistical analysis on the historical speed data to obtain speed distribution information of the historical speed data; and use the upper limit value of the speed distribution information as a preset speed threshold.
[0179] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0180] Acquire historical drift displacement data of the active pen when it is stationary; wherein, the historical drift displacement data includes the drift displacement value corresponding to each historical moment; determine the average value of the drift displacement value corresponding to each historical moment; and determine the preset displacement threshold based on the product of the average value and the preset safety factor.
[0181] In one embodiment, the duration of the preset time period is determined based on at least one of the following: the sampling rate of the active pen's touch integrated circuit IC, the communication cycle between the active pen and the terminal, and the processing latency of the active pen.
[0182] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0183] When the active pen and the terminal have established a communication connection and the movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period.
[0184] Based on the current coordinate difference information, determine the current speed of the active pen within the current time period;
[0185] If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen within a preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period and includes the current moment; and
[0186] The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
[0187] In one embodiment, when the processor executes a computer program to determine the total displacement of the active pen during a preset time period based on the current coordinate difference information and the preset time period, it also performs the following steps:
[0188] Integrate the coordinate difference between the position coordinates of two adjacent moments within a preset time period to obtain the total coordinate difference of the active pen within the preset time period; and determine the total displacement of the active pen within the preset time period based on the total coordinate difference of the active pen within the preset time period.
[0189] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0190] When the current speed is greater than a preset speed threshold, tactile feedback matching the current speed is executed through the tactile feedback module in the active pen.
[0191] In one embodiment, when the processor executes a computer program to determine the target pen state of the active pen based on the total displacement and a preset displacement threshold, it also performs the following steps:
[0192] When the total displacement is less than or equal to a preset displacement threshold, the target pen state of the active pen is determined to be a stationary state; and when the total displacement is greater than the preset displacement threshold, the target pen state of the active pen is determined to be a writing state.
[0193] In one embodiment, when the total displacement is greater than a preset displacement threshold, the processor further performs the following steps when executing the computer program:
[0194] The haptic feedback module in the active pen performs haptic feedback that matches a preset speed threshold.
[0195] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0196] Acquire historical speed data of the active pen when it is stationary; perform statistical analysis on the historical speed data to obtain speed distribution information of the historical speed data; and use the upper limit value of the speed distribution information as a preset speed threshold.
[0197] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0198] Acquire historical drift displacement data of the active pen when it is stationary; wherein, the historical drift displacement data includes the drift displacement value corresponding to each historical moment; determine the average value of the drift displacement value corresponding to each historical moment; and determine the preset displacement threshold based on the product of the average value and the preset safety factor.
[0199] In one embodiment, the duration of the preset time period is determined based on at least one of the following: the sampling rate of the active pen's touch integrated circuit IC, the communication cycle between the active pen and the terminal, and the processing latency of the active pen.
[0200] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0201] When the active pen and the terminal have established a communication connection and the movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period.
[0202] Based on the current coordinate difference information, determine the current speed of the active pen within the current time period;
[0203] If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen within a preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period and includes the current moment; and
[0204] The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
[0205] In one embodiment, when the processor executes a computer program to determine the total displacement of the active pen during a preset time period based on the current coordinate difference information and the preset time period, it also performs the following steps:
[0206] Integrate the coordinate difference between the position coordinates of two adjacent moments within a preset time period to obtain the total coordinate difference of the active pen within the preset time period; and determine the total displacement of the active pen within the preset time period based on the total coordinate difference of the active pen within the preset time period.
[0207] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0208] When the current speed is greater than a preset speed threshold, tactile feedback matching the current speed is executed through the tactile feedback module in the active pen.
[0209] In one embodiment, when the processor executes a computer program to determine the target pen state of the active pen based on the total displacement and a preset displacement threshold, it also performs the following steps:
[0210] When the total displacement is less than or equal to a preset displacement threshold, the target pen state of the active pen is determined to be a stationary state; and when the total displacement is greater than the preset displacement threshold, the target pen state of the active pen is determined to be a writing state.
[0211] In one embodiment, when the total displacement is greater than a preset displacement threshold, the processor further performs the following steps when executing the computer program:
[0212] The haptic feedback module in the active pen performs haptic feedback that matches a preset speed threshold.
[0213] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0214] Acquire historical speed data of the active pen when it is stationary; perform statistical analysis on the historical speed data to obtain speed distribution information of the historical speed data; and use the upper limit value of the speed distribution information as a preset speed threshold.
[0215] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0216] Acquire historical drift displacement data of the active pen when it is stationary; wherein, the historical drift displacement data includes the drift displacement value corresponding to each historical moment; determine the average value of the drift displacement value corresponding to each historical moment; and determine the preset displacement threshold based on the product of the average value and the preset safety factor.
[0217] In one embodiment, the duration of the preset time period is determined based on at least one of the following: the sampling rate of the active pen's touch integrated circuit IC, the communication cycle between the active pen and the terminal, and the processing latency of the active pen.
[0218] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) 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.
[0219] Those skilled in the art will understand that all or part of the processes in 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. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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, etc., and are not limited to these.
[0220] 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 specification.
[0221] 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 method for determining the state of an active pen, characterized in that, Applied to an active pen, the method includes: When the active pen has established a communication connection with the terminal and movement of the active pen is detected, the current coordinate difference information of the active pen in the current time period is determined; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period. Based on the current coordinate difference information, determine the current speed of the active pen within the current time period; If the current speed is less than or equal to a preset speed threshold, the total displacement of the active pen during the preset time period is determined based on the current coordinate difference information and the preset time period; wherein the preset time period is located within the current time period, and the preset time period includes the current moment; and The target pen state of the active pen is determined based on the total displacement and the preset displacement threshold.
2. The method according to claim 1, characterized in that, The step of determining the total displacement of the active pen during the preset time period based on the current coordinate difference information and the preset time period includes: Integrating the coordinate differences between the position coordinates of two adjacent moments within a preset time period yields the total coordinate difference of the active pen within that preset time period; and The total displacement of the active pen during the preset time period is determined based on the total coordinate difference of the active pen during the preset time period.
3. The method according to claim 1, characterized in that, Also includes: When the current speed is greater than the preset speed threshold, tactile feedback matching the current speed is executed by the tactile feedback module in the active pen.
4. The method according to claim 1, characterized in that, Determining the target pen state of the active pen based on the total displacement and a preset displacement threshold includes: If the total displacement is less than or equal to a preset displacement threshold, the target pen state of the active pen is determined to be a stationary state; and If the total displacement is greater than the preset displacement threshold, the target pen state of the active pen is determined to be the writing state.
5. The method according to claim 4, characterized in that, If the total displacement is greater than the preset displacement threshold, the method further includes: The tactile feedback module in the active pen performs tactile feedback that matches the preset speed threshold.
6. The method according to any one of claims 1 to 5, characterized in that, Also includes: Acquire historical speed data of the active pen when it is in a static state; Statistical analysis is performed on the historical speed data to obtain the speed distribution information of the historical speed data; as well as The upper limit of speed in the speed distribution information is used as the preset speed threshold.
7. The method according to any one of claims 1 to 5, characterized in that, Also includes: Acquire historical drift displacement data of the active pen when it is in a static state; wherein, the historical drift displacement data includes the drift displacement value corresponding to each historical moment; Determine the average drift displacement value corresponding to each historical moment; and The preset displacement threshold is determined by multiplying the average value by the preset safety factor.
8. The method according to any one of claims 1 to 5, characterized in that, The duration of the preset time period is determined based on at least one of the following: the sampling rate of the touch integrated circuit IC of the active pen, the communication cycle between the active pen and the terminal, and the processing delay of the active pen.
9. An active pen state determination device, characterized in that, Configured in an active pen, the device includes: The information acquisition module is used to determine the current coordinate difference information of the active pen in the current time period when the active pen and the terminal have established a communication connection and the active pen is detected to have moved; the current coordinate difference information includes the coordinate difference between the position coordinates of two adjacent moments in the current time period; The speed determination module is used to determine the current speed of the active pen in the current time period based on the current coordinate difference information. A displacement determination module is used to determine the total displacement of the active pen during a preset time period, based on the current coordinate difference information and a preset time period, when the current speed is less than or equal to a preset speed threshold; wherein the preset time period is located within the current time period and includes the current moment; and The state determination module is used to determine the target pen state of the active pen based on the total displacement and the preset displacement threshold.
10. A readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 8.