Touch method and device, electronic equipment, readable storage medium and program product
By determining the locking and stationary conditions during touch operation and updating the position of the lock point reference point, the problem of click operations being misidentified as swipes is solved, improving the accuracy of touch recognition and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2026-03-27
AI Technical Summary
During touch operation, clicks are easily mistaken for swipes, resulting in low touch recognition accuracy.
By acquiring the touch data and movement reference point of the current touch frame during the touch process, it is determined whether the current touch position meets the locking and stationary conditions, and the position of the lock point reference point is updated to expand the lock point area to avoid misidentifying clicks as swipes.
It improves the accuracy of touch recognition, avoids the problem of clicks being misidentified as swipes, and optimizes the user's touch experience.
Smart Images

Figure CN121742679A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of touch technology, and in particular to a touch method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] With the increasing intelligence of electronic devices, touch technology is widely used in the field of human-computer interaction. Touch technology allows users to perform touch operations on the touch screen of electronic devices. The electronic device generates corresponding touch commands, processes them accordingly, and displays the results to the user, making operation convenient and providing a good user experience.
[0003] In practical applications, to prevent screen jitter during touch, a lock point is often set, which means that although the coordinates change within a certain range, the coordinates remain unchanged and are reported. This way, the coordinates will not jitter. However, during touch, even a click operation will cause the touch position to change constantly. It is easy to be identified as outside the lock point range, thus unlocking the touch position. This can easily lead to the problem of clicks being misidentified as swipes, resulting in low touch recognition accuracy. Summary of the Invention
[0004] This application provides a touch control method, apparatus, electronic device, and computer-readable storage medium that can improve touch recognition accuracy.
[0005] Firstly, this application provides a touch method, including:
[0006] Acquire the touch data and movement reference point corresponding to the current touch frame during the touch process;
[0007] Determine the current touch position corresponding to the touch data of the current touch frame;
[0008] Based on the current touch position and the movement reference point, determine whether the current touch position meets the locking condition;
[0009] If the current touch position meets the locking condition, then determine whether the current touch position meets the stationary condition;
[0010] If the current touch position satisfies the stationary condition, then update the position of the lock point reference point.
[0011] Secondly, this application also provides a touch device, comprising:
[0012] The touch data acquisition module is used to acquire the touch data and movement reference point corresponding to the current touch frame during the touch process;
[0013] The touch position determination module is used to determine the current touch position corresponding to the touch data of the current touch frame;
[0014] The locking condition determination module is used to determine whether the current touch position meets the locking condition based on the current touch position and the movement reference point;
[0015] A stationary condition determination module is used to determine whether the current touch position meets the stationary condition if the current touch position meets the locking condition.
[0016] The lock point position update module is used to update the position of the lock point reference point if the current touch position meets the stationary condition.
[0017] Thirdly, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the touch method provided in the first aspect.
[0018] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the touch method provided in the first aspect.
[0019] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the touch method provided in the first aspect.
[0020] The aforementioned touch control method, device, electronic device, computer-readable storage medium, and computer program product, by acquiring the touch data and movement reference point corresponding to the current touch frame during the touch process, determine the current touch position corresponding to the touch data of the current touch frame. Based on the current touch position and movement reference point, determine whether the current touch position meets the locking condition. If the current touch position does not meet the locking condition, but meets the stationary condition, then update the position of the lock point reference point. This allows the touch position to move to a stationary state within the lock point range and then update the position of the lock point reference point, maximizing the lock point area again. Compared to the case where the lock point reference point is not updated, the remaining lock point area becomes larger, making it less likely to be unlocked and thus less likely to be recognized as a swipe. This avoids the problem of misidentifying a click as a swipe, thereby improving the accuracy of touch recognition. Attached Figure Description
[0021] 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.
[0022] Figure 1 This is a schematic diagram illustrating the movement of a finger from pressing down to stabilizing the pressure in one embodiment;
[0023] Figure 2 This is a diagram illustrating the application environment of a touch method in one embodiment;
[0024] Figure 3 This is a flowchart illustrating a touch control method in one embodiment;
[0025] Figure 4 This is a schematic diagram of the touch position after the touch has stabilized in one embodiment;
[0026] Figure 5 This is a flowchart illustrating the touch method in another embodiment;
[0027] Figure 6 This is a structural block diagram of a touch device in one embodiment;
[0028] Figure 7 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0029] 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.
[0030] Locking the point means that even if the touch position changes within a certain range, it will still report the touch position as the first point of the touch, that is, keep the touch position unchanged.
[0031] In practical applications, even during the touch process corresponding to a click or long press operation, the touch position may change. For example... Figure 1 The diagram illustrates the movement of a finger from initial press to stable pressure. Assuming the initial press position is point A, the corresponding locking point range is a circular area centered at point A with a radius equal to a preset locking point distance. In other words, the coordinates of the touch position within this range are the coordinates of point A. Figure 1Point B represents a position after the finger has stabilized. Even after stabilizing, point B remains within the locking area corresponding to point A, meaning it's still in a locked state. Point C represents a position where the finger is about to leave the locking area after moving, indicating unlocking. Originally, the locking area was a circular area centered on point A, encompassing the area between points A and C. However, since the finger actually stabilizes at point B, the actual locking area for point B is now the area between points B and C within the circle. This reduction in the locking area makes unlocking more likely during continued finger pressure. If it's a click event, it's easily identified as a swipe event, leading to the device misinterpreting a click as a swipe, resulting in low touch recognition accuracy.
[0032] To address the aforementioned technical problem of low accuracy in touch recognition, this application provides a touch method that updates the lock point reference point when the press is stable within the lock point range, thereby maximizing the lock point area again. The touch position is less likely to be unlocked, thus less likely to be recognized as a swipe, avoiding misidentification of click as swipe and improving the accuracy of touch recognition.
[0033] The touch method provided in this application embodiment can be applied to, for example... Figure 2 In the application environment shown, users can interact with the screen of electronic device 200 using their fingers, gloved fingers, or touch tools. The touchscreen of electronic device 200 acquires touch data during the touch process by sensing corresponding touch operations. This touch data can be represented by the capacitance values of various capacitive nodes on the touchscreen. Electronic device 200 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Understandably, electronic devices can be either terminals or servers.
[0034] In one exemplary embodiment, such as Figure 3 As shown, a touch control method is provided, which includes steps 302 to 310. Wherein:
[0035] Step 302: Obtain the touch data and movement reference point corresponding to the current touch frame during the touch process.
[0036] A touch process refers to the process of interacting with the touchscreen of an electronic device. This can be done using fingers, gloves, or touch-sensitive tools. A touch process can encompass the entire process from the start of the touch to its end, where the touch completely leaves the screen. For example, the entire process from when a finger presses the screen, slides the finger, and lifts it constitutes one touch process. If the finger presses the screen again, a new touch operation is calculated; that is, if no lift-off event occurs within a touch process, a touch operation typically involves multiple touch frames. Since an electronic device screen comprises a capacitor array consisting of multiple capacitor nodes, when the screen is touched, the capacitance values of some or all of these nodes change. These capacitance values can be used to characterize the corresponding touch information. Therefore, each touch frame can be used to characterize the capacitance of the capacitor nodes on the screen at a given moment. Understandably, the touch information of the electronic device screen can be collected according to the touch sampling rate, that is, the capacitance value of the capacitor nodes of the capacitor array on the screen of the electronic device can be collected. The capacitance value of each capacitor node can be regarded as the gray value of the image pixel. Therefore, the capacitor nodes of the electronic device screen and the capacitance value of the capacitor nodes are collected each time as the corresponding touch frame.
[0037] Accordingly, the touch data corresponding to a touch frame includes the capacitance values of the capacitor nodes in the capacitor array of the touch screen. During the touch process, the touch data usually changes, and the touch data corresponding to different touch frames will also be different. The current touch frame refers to the capacitance value of the capacitor nodes in the current state, and the current touch frame can be any touch frame in the touch process.
[0038] A movement reference point is a reference position that indicates whether the touch position has changed. The movement reference point can be the first touch position in the touch process, and its position can be determined based on the touch data corresponding to the first touch frame. In essence, the distance between the current position and the movement reference point determines the corresponding movement distance; a movement distance greater than zero indicates that the current touch position has moved.
[0039] Step 304: Determine the current touch position corresponding to the touch data of the current touch frame.
[0040] Based on the touch data of the current touch frame, the corresponding current touch position can be determined. Optionally, the current touch position can be determined based on the capacitance value of the capacitive nodes in the current touch frame. For example, the coordinates of the current touch position can be calculated using a centroid algorithm based on the capacitance value of the touchscreen in the current touch frame. Understandably, the calculation method for determining the corresponding touch position based on touch data is not specifically limited here, and can be determined according to the calculation method in the prior art.
[0041] Step 306: Determine whether the current touch position meets the locking condition based on the current touch position and the movement reference point.
[0042] The locking condition refers to the criteria used to determine whether the current touch position is within the lock point range. If the current touch position meets the locking condition, it means that the current touch position is within the lock point range and will be locked. The current touch position is then reported according to the lock point reference point. If the current touch position does not meet the locking condition, it means that the current touch position is outside the lock point range and will not be locked. The current touch position is then reported accordingly. The lock point reference point is a reference point used to determine the lock point range. The lock point range can be a circular area with the lock point reference point as the center and a preset length as the radius. The preset length can be set according to the actual application scenario, such as 1.5mm, 2mm, or 2.5mm.
[0043] Optionally, the locking condition can be determined based on the distance between the current touch position and the moving reference point. For example, if the distance between the current touch position and the moving reference point is greater than a first distance threshold, then the current touch position is determined to meet the locking condition. Alternatively, if the cumulative movement distance from the moving reference point to the current touch position within a preset time period is greater than a second distance threshold, then the locking condition is met. Here, the cumulative movement distance refers to the distance accumulated in each movement direction; for example, on the xoy plane, the cumulative movement distance includes the distances accumulated in the x and y directions respectively.
[0044] Step 308: If the current touch position meets the locking condition, then determine whether the current touch position meets the stationary condition.
[0045] The stationary condition refers to the condition used to determine whether the current touch position is stationary. If the current touch position meets the locking condition, it is then determined whether the current touch position meets the stationary condition.
[0046] The current touch position can be judged to meet the stationary condition based on the straight-line distance or cumulative movement distance between it and the reference point. For example, if the straight-line distance between the current touch position and the reference point is less than a corresponding distance threshold, or if the straight-line distance between the current touch position and the reference point is the same as the straight-line distance between the touch position and the reference point in the previous touch frame, then the current touch position is judged to meet the stationary condition. Alternatively, the current touch position can be judged to meet the stationary condition based on its coordinates. For example, if the coordinates of the current touch position are the same as the coordinates of the touch position in the previous touch frame, then the current touch position is judged to meet the stationary condition.
[0047] Optionally, the stationary condition may include: the straight-line distance between the current touch position and the moving reference point is less than the corresponding distance threshold; or the straight-line distance between the current touch position and the moving reference point is the same as the straight-line distance between the touch position and the moving reference point in the previous touch frame; or the cumulative movement distance within a preset time period is less than a third distance threshold; or the first movement distance between the current touch position and the moving reference point is the same as the second movement distance between the touch position and the moving reference point in the previous touch frame; or the current touch position is the same as the touch position in the previous touch frame, etc.
[0048] Step 310: If the current touch position meets the stationary condition, then update the position of the lock point reference point.
[0049] Among them, the lock point reference point refers to the reference point used to determine the range of the lock point.
[0050] Optionally, if the current touch position meets the static condition, the lock point reference point can be updated to the current touch position, that is, the current touch position can be used as the updated reference point position. Alternatively, the lock point reference point can be updated to the average of the touch positions corresponding to a preset number of consecutive touch frames preceding the current touch frame.
[0051] The above-described touch method determines the current touch position based on the touch data of the current touch frame. Based on the current touch position and the movement reference point, it determines whether the current touch position meets the locking condition. If the current touch position meets the locking condition, it determines whether the current touch position meets the stationary condition. If the stationary condition is met, the position of the lock point reference point is updated, which can re-maximize the lock point area, making the current touch position less likely to be unlocked. Therefore, if a click operation is performed, it is not easy to be identified as a swipe operation, avoiding the problem of clicks being mistakenly identified as swipes, thereby improving the accuracy of touch recognition.
[0052] In some embodiments, step 306, which determines whether the current touch position meets the locking condition based on the current touch position and the movement reference point, includes:
[0053] Calculate the target distance between the current touch position and the moving reference point; if the target distance is not greater than the first distance threshold, then determine that the current touch position meets the locking condition.
[0054] The target distance refers to the straight-line distance calculated using the Euclidean distance formula. The first distance threshold can be a distance threshold used to indicate whether the target is locked. Simply put, if the distance is greater than the first distance threshold, the target will not be locked; if the distance is less than the first distance threshold, the target will be locked. The first distance threshold can be set according to the actual application scenario; for example, it can be 1.5mm, 2mm, or 2.5mm.
[0055] Optionally, after determining the current touch position, the target distance between the current touch position and the movement reference point is calculated. This target distance is compared to a first distance threshold. If the target distance is not greater than the first distance threshold, the current touch position meets the locking condition, meaning it is within the locking range. If the target distance is greater than the first distance threshold, the current touch position does not meet the locking condition, meaning it is outside the locking range and will be unlocked. In this case, the position of the movement reference point can be updated to the current touch position, and the statistical parameter value corresponding to the current touch frame can be cleared to zero. The next frame will then be used to re-determine whether the locking condition is met. The statistical parameter value can include the value of the directional movement distance and the value corresponding to the touch statistical duration.
[0056] In this embodiment, by calculating the target distance between the current touch position and the moving reference point, if the target distance is greater than the first distance threshold, it is determined that the current touch position meets the locking condition. This can conveniently and quickly determine whether the current touch position meets the locking condition, improve the efficiency of locking condition determination, and thus improve the update efficiency of the lock point reference point.
[0057] In some embodiments, the above method further includes:
[0058] If the current touch position does not meet the locking conditions, the position of the moving reference point is updated to the current touch position.
[0059] In this embodiment, if the current touch position does not meet the locking condition, for example, if the target distance between the current touch position and the moving reference point is greater than a first distance threshold, the position of the moving reference point is updated to the current touch position, that is, the determination of whether the locking condition is met is re-based on the current touch position. After updating the position of the moving reference point to the current touch position, the statistical parameter value corresponding to the current touch frame can be cleared to zero, and then the judgment of the next touch frame can continue.
[0060] By updating the position of the movement reference point to the current touch position when the current touch position does not meet the locking conditions, and continuing to make judgments based on the updated movement reference point, the accuracy of the judgment on the lock point reference point update can be improved.
[0061] In an exemplary embodiment, step 308, determining whether the current touch position meets the stationary condition, includes:
[0062] Calculate the cumulative directional movement distance between the current touch position and the movement reference point; if the cumulative directional movement distance meets the first movement distance condition, and the total directional movement distance within a preset time period meets the second movement distance condition, then determine that the current touch position meets the stationary condition.
[0063] The first movement distance condition indicates whether to exit the lock point reference point update. The second movement distance condition indicates whether the current touch position is stationary.
[0064] Optionally, the first movement distance condition may include the cumulative directional movement distance not exceeding a second distance threshold. If the cumulative directional movement distance is not greater than the second distance threshold, then the cumulative directional movement distance is determined to satisfy the first movement distance condition. The second distance threshold may be, for example, 0.8mm, 1mm, or 1.2mm. It should be noted that the cumulative directional movement distance between the current touch position and the movement reference point refers to the cumulative coordinate values of all touch positions during the movement from the movement reference point to the current touch position. These cumulative coordinate values may be, for example, the cumulative x-coordinate value and the cumulative y-coordinate value. The second distance threshold also includes distance thresholds in the x-direction and y-direction. The distance thresholds in the x-direction and y-direction can be equal. For example, if the second distance threshold is 1mm, then both the distance thresholds in the x-direction and y-direction are 1mm.
[0065] The second movement distance condition can include the total directional movement distance within a preset time period being less than a third distance threshold. That is, if the total directional movement distance within a preset time period is less than the third distance threshold, then the total directional movement distance within the preset time period is determined to meet the second movement distance condition. The third distance threshold can be, for example, 0.4mm or 0.5mm, etc. The calculation method for the third distance threshold and the second distance threshold is the same, both being cumulative values of corresponding coordinates, which will not be elaborated here. It is easy to understand that the first distance threshold and the second distance threshold can be set according to the actual application scenario.
[0066] The preset duration, for example, can be 2 seconds. The preset duration can be determined based on the number of touch frames. For example, based on the sampling frequency of the touch frames, the sampling duration corresponding to each touch frame can be determined. Based on the preset duration and the sampling duration corresponding to each touch frame, the corresponding number of touch frames can be determined, which is equivalent to counting whether the total movement distance corresponding to the corresponding number of touch frames meets the second movement distance condition.
[0067] In this embodiment, by calculating the cumulative directional movement distance between the current touch position and the moving reference point, if the cumulative directional movement distance meets the first movement distance condition and the total directional movement distance within a preset time period meets the second movement distance condition, then it is determined that the current touch position meets the stationary condition. That is, by jointly judging whether the stationary condition is met by the cumulative directional movement distance of the current touch position and the total directional movement distance within a preset time period, the accuracy of the stationary condition judgment can be improved.
[0068] In some embodiments, if the cumulative directional movement distance meets a first movement distance condition, and the total directional movement distance within a preset time period meets a second movement distance condition, then it is determined that the current touch position meets the stationary condition, including:
[0069] If the cumulative directional movement distance is not greater than the second distance threshold, the touch statistics duration corresponding to the current touch frame is determined. The touch statistics duration refers to the touch duration from the end of the previous statistics to the current touch frame. If the touch statistics duration corresponding to the current touch frame is greater than the preset duration, the total directional movement distance within the preset duration is determined. If the total directional movement distance within the preset duration is less than the third distance threshold, the current touch position is determined to meet the stationary condition.
[0070] The cumulative distance of directional movement is the distance obtained by summing the coordinate values of the movement direction from the movement reference point to the current touch position. That is, it includes the distance obtained by summing the coordinate values of the touch position of all touch frames between the movement reference point and the current touch position in the movement direction. It usually includes the distances obtained by summing the x-direction and y-direction respectively.
[0071] Touch duration statistics refer to the touch duration from the end of the previous statistics period to the current touch frame. In essence, we can calculate the total distance moved in the corresponding direction at preset intervals. When the first preset duration is reached, the total distance moved in the corresponding direction is determined, and timing restarts until the second preset duration is reached, at which point the total distance moved in the corresponding direction is determined again, and so on. Optionally, if the preset duration is not reached, the current touch frame is exited, and the next touch frame is considered. The electronic device can record the touch frame position corresponding to the arrival of the preset duration; the arrival of the preset duration is the end of the previous statistics period, and timing restarts from the next touch frame following the touch frame corresponding to the arrival of the preset duration.
[0072] Optionally, if the cumulative distance of directional movement is greater than the second distance threshold, the finger movement flag can be set to 1 to indicate that the finger is currently in a moving state and not in a stationary state. Then, all statistical parameter values in the current state are cleared. The statistical parameter values include the value of the directional movement distance and the value corresponding to the touch statistical duration, etc. At the same time, the position of the movement reference point can be updated to the current touch position. Then, the judgment of whether the touch statistical duration corresponding to the current touch frame is greater than the preset duration can be entered, or the judgment of the current touch frame can be ended and the judgment process of the next touch frame can be entered.
[0073] In one example, we'll use a second distance threshold of 1mm and a third distance threshold of 0.4mm as an illustration. If the cumulative directional movement distance is greater than 1mm, the touch statistics duration corresponding to the current touch frame is determined. If the touch statistics duration is greater than the preset duration of 2s, the total directional movement distance within 2s is determined. If the total directional movement distance within 2s is less than the third distance threshold, the current touch position is determined to meet the stationary condition. If the touch statistics duration is not greater than the preset duration of 2s, it means that the preset duration has not yet been reached since the end of the previous statistics, and the statistics and judgment of the next touch frame are then performed. If the total directional movement distance within 2s is not less than the third distance threshold, the statistics and judgment of the next touch frame are then performed.
[0074] In this embodiment, if the cumulative directional movement distance is not greater than the second distance threshold, the touch statistics duration corresponding to the current touch frame is determined. If the touch statistics duration is greater than the preset duration, the total directional movement distance within the preset duration is determined. If the total directional movement distance is less than the third distance threshold, the current touch position is determined to meet the stationary condition. The total directional movement distance within the preset duration is determined only when the touch statistics duration is greater than the preset duration. This can improve the efficiency of the stationary condition judgment, reduce the amount of data processing, and improve the processing efficiency of the electronic device.
[0075] In some embodiments, determining the touch statistics duration corresponding to the current touch frame includes:
[0076] Get the touch statistics duration corresponding to the previous touch frame of the current touch frame; sum the touch statistics duration corresponding to the previous touch frame and the touch duration corresponding to the current touch frame as the touch statistics duration corresponding to the current touch frame.
[0077] Understandably, electronic devices recalculate touch duration at preset intervals. Before the preset duration is reached, the touch duration consumed by the corresponding touch frame is recorded and accumulated. If the current touch frame is the first touch frame in the touch process, the statistics start directly from the duration of the current touch frame.
[0078] In this embodiment, by summing the statistical duration corresponding to the previous touch frame with the touch duration corresponding to the current touch frame, the efficiency of obtaining the touch duration of the current touch frame can be improved, thereby improving the efficiency of judging the static condition.
[0079] In some embodiments, the above method further includes:
[0080] If the total directional movement distance within the preset time period is not less than the third distance threshold, then the position of the movement reference point is updated to the current touch position.
[0081] If the total directional movement distance within the preset time period is greater than or equal to the third distance threshold, it indicates that the current touch position does not meet the stationary condition. Therefore, the position of the movement reference point is updated to the current touch position, and the judgment of the current touch frame ends, proceeding to the judgment of the next touch frame. Understandably, the judgment process for the next touch frame is the same as that for the current touch frame.
[0082] In this embodiment, if the current touch position does not meet the stationary condition, the position of the moving reference point is updated, and the judgment is continued based on the updated moving reference point, which can improve the accuracy of the judgment on the update of the lock point reference point.
[0083] In some embodiments, determining whether the current touch position meets the stationary condition in step 308 includes:
[0084] Calculate the first moving distance between the current touch position and the moving reference point, and the second moving distance between the touch position of the previous touch frame and the moving reference point; if the first moving distance and the second moving distance are the same, then determine that the current touch frame position meets the stationary condition.
[0085] The first and second movement distances can be obtained by accumulating coordinates along the movement direction. Specifically, the first movement distance is obtained by accumulating the coordinates from the reference point to the touch position corresponding to the current touch position along the movement direction, and the second movement distance is obtained by accumulating the coordinates from the reference point to the touch position of the previous touch frame along the movement direction. The first and second movement distances being the same means that the accumulated coordinate values are identical in each movement direction.
[0086] Alternatively, both the first and second movement distances can be straight-line distances, where the first movement distance is the straight-line distance between the current touch position and the movement reference point, and the second movement distance is the straight-line distance between the touch position of the previous touch frame and the movement reference point.
[0087] In this embodiment, by calculating the first moving distance between the current touch position and the moving reference point, and the second moving distance between the touch position and the moving reference point in the previous touch frame of the current touch frame, if the first moving distance and the second moving distance are the same, it indicates that the current touch position has not moved. This enables a quick determination of the stationary condition, thereby improving the efficiency of the stationary condition determination.
[0088] In some embodiments, determining whether the current touch position meets the stationary condition in step 308 includes:
[0089] Obtain the touch position corresponding to the number of consecutive target touch frames preceding the current touch frame; if the current touch position is the same as the touch position corresponding to the number of consecutive target touch frames preceding the current touch frame, then determine that the current touch position satisfies the static condition.
[0090] The target quantity can be set according to the actual application scenario, such as 0, 1, 2 or 3.
[0091] Optionally, the touch position corresponding to the previous touch frame of the current touch frame is obtained. If the current touch position is the same as the touch position corresponding to the previous touch frame of the current touch frame, it is determined that the current touch position satisfies the static condition.
[0092] In this embodiment, by comparing the current touch position with the touch positions corresponding to the number of consecutive target touch frames preceding the current touch frame, if the current touch position is the same as the touch positions corresponding to the number of consecutive target touch frames preceding the current touch frame, it is determined that the current touch position meets the stationary condition. This can quickly determine whether the current touch position meets the stationary condition, thereby improving the efficiency of determining the stationary condition.
[0093] In one exemplary embodiment, the method further includes:
[0094] Obtain the directional movement distance parameter value corresponding to the previous touch frame of the current touch frame; if the directional movement distance parameter value corresponding to the previous touch frame meets the directional movement distance condition, then determine that the current touch position does not meet the locking condition, and update the position of the movement reference point; if the directional movement distance parameter value corresponding to the previous touch frame does not meet the directional movement distance condition, then determine that the current touch position meets the locking condition, and execute the step of determining whether the current touch position meets the stationary condition.
[0095] The directional movement distance parameter can include the movement distance within a preset duration corresponding to the previous touch frame. In practical applications, if the touch duration of the previous touch frame reaches the preset duration, and the movement distance within that preset duration is not greater than the preset movement distance, then the current touch position is determined to meet the locking condition. Alternatively, the directional movement distance parameter includes the movement distance within the preset duration corresponding to the previous touch frame. If there exists a movement distance within a preset duration before the previous touch frame that is not greater than the preset movement distance, then the current touch position is determined to meet the locking condition. In other words, the directional movement distance condition includes either the movement distance within the preset duration corresponding to the previous touch frame being not greater than the preset movement distance, or the movement distance within a preset duration before the previous touch frame being not greater than the preset movement distance. The preset movement distance can be set according to the actual application scenario; for example, the preset movement distance can be 2mm, 2.2mm, or 2.3mm.
[0096] In this embodiment, by determining whether the directional movement distance parameter value corresponding to the previous touch frame meets the directional movement distance condition, if the directional movement distance condition is not met, it is determined that the current touch position does not meet the locking condition, and the position of the movement reference point is updated. If the directional movement distance condition is met, it is determined that the current touch position meets the locking condition, and the step of determining whether the current touch position meets the stationary condition is executed. This allows for determining whether the current touch position meets the locking condition by judging the directional movement distance parameter value corresponding to the previous touch frame, and continuing to determine whether the stationary condition is met when the locking condition is met. This enables a faster determination of the locking condition, thereby improving the efficiency of updating the lock reference point.
[0097] In some embodiments, updating the position of the lock point reference point includes:
[0098] The position of the lock point reference point is updated to the touch position corresponding to the target touch frame that first meets the static condition, or the position of the lock point reference point is updated based on the touch position corresponding to the target touch frame and the touch positions corresponding to a specified number of consecutive touch frames after the target touch frame.
[0099] The target touch frame refers to the first touch frame that meets the stillness condition. Understandably, in a possible application scenario, after determining that the stillness condition is met, subsequent touch frames will continue to be detected, and these subsequent touch frames may also meet the stillness condition. Therefore, there may be multiple touch frames that meet the stillness condition. The current touch frame may be the first touch frame to meet the stillness condition, or it may be one of the touch frames following the first one. The electronic device can acquire the target touch frame that first meets the stillness condition, as well as a specified number of consecutive touch frames following the target touch frame. Each touch frame has a corresponding touch position. The specified number can be set according to actual needs, for example, 1, 2, 3, 4, or 5.
[0100] Optionally, the position of the lock point reference point can be updated to the touch position corresponding to the target touch frame, or the average or median value of the touch position corresponding to the target touch frame and the touch positions corresponding to a specified number of consecutive touch frames after the target touch frame can be calculated, and then the position corresponding to the calculated average or median value can be used as the updated position of the lock point reference point.
[0101] In one example, a diagram illustrating the touch position after stabilization is shown below. Figure 4As shown, after detecting stable or static touch, the coordinates of the touch position B of the first target touch frame that meets the static condition are obtained. Multiple touch frames will follow the target touch frame, thus obtaining the coordinates of the touch positions of the next 10 touch frames. The average of the coordinates of the touch position of the target touch frame and the coordinates of the touch position of the next 10 touch frames is calculated. Figure 4 The touch position within the dashed circle represents the touch position of the target touch frame and the touch positions of the 10 touch frames following the target touch frame. The touch position corresponding to this average value is used as the position of the updated lock point reference point.
[0102] In this embodiment, the position of the lock point reference point is updated to the touch position corresponding to the target touch frame that first meets the static condition, or the position of the lock point reference point is updated according to the target touch frame and the touch positions corresponding to a specified number of consecutive touch frames after the target touch frame. This makes the updated position of the lock point reference point closer to the position after the touch stabilizes, thereby improving the accuracy of the lock point reference point update.
[0103] In some embodiments, updating the position of the lock point reference point includes:
[0104] Update the position of the lock point reference point to the current touch position, or update the position of the lock point reference point based on the current touch position and the touch positions corresponding to the previous preset number of touch frames.
[0105] If the current touch position meets the static condition, the lock point reference point is updated. Specifically, the position of the lock point reference point can be updated to the current touch position; that is, the current touch position is used as the updated lock point reference point. In subsequent processing, a new lock point area is determined based on the updated lock point reference point.
[0106] Optionally, the touch positions corresponding to a preset number of consecutive touch frames preceding the current touch frame can be obtained, the average or median value of the current touch position and the touch positions corresponding to the preset number of consecutive touch frames preceding the current touch frame can be calculated, and the touch position corresponding to the average or median value can be used as the position of the updated lock point reference point.
[0107] In this embodiment, by updating the position of the lock point reference point to the current touch position, or by updating the position of the lock point reference point according to the current touch position and the touch positions corresponding to the consecutive preset number of touch frames before the current touch frame, the updated position of the lock point reference point can be a touch position that satisfies the static condition, or a touch position that is close to the static state, thereby improving the accuracy of the lock point reference point update.
[0108] In one exemplary embodiment, such as Figure 5As shown, the touch method includes steps 502 to 530.
[0109] Step 502: Obtain the touch data and movement reference point corresponding to the current touch frame during the touch process.
[0110] Step 504: Determine the current touch position corresponding to the touch data of the current touch frame.
[0111] Step 506: Calculate the target distance between the current touch position and the moving reference point.
[0112] Step 508: If the target distance is not greater than the first distance threshold, add one frame of time to obtain the touch statistics duration corresponding to the current touch frame. Add the cumulative directional movement distance to the directional movement distance of the current touch frame, and determine whether the cumulative directional movement distance is greater than the second distance threshold.
[0113] Step 510: If the cumulative distance of directional movement is not greater than the second distance threshold, then determine whether the touch statistics duration is greater than the preset duration.
[0114] Step 512: If the cumulative distance of directional movement is greater than the second distance threshold, then move the finger to the marker position 1, initialize the statistical parameter value, update the position of the movement reference point to the current touch position, and proceed to the step of checking whether the disconnection statistical duration is greater than the preset duration.
[0115] The statistical parameter values include the value of directional movement distance and the value corresponding to the touch statistics duration.
[0116] Step 514: If the touch statistics duration is greater than the preset duration, then determine whether the total directional movement distance within the preset duration is less than the third distance threshold.
[0117] Step 516: If the touch statistics duration is not greater than the preset duration, then exit the judgment of the current touch frame and enter the judgment process of the next touch frame.
[0118] Step 518: If the total directional movement distance within the preset time period is less than the third distance threshold, then update the lock point reference point to position 1 and execute step 522.
[0119] Step 520: If the total directional movement distance within the preset time period is not less than the third distance threshold, then exit the judgment of the current touch frame and enter the judgment process of the next touch frame.
[0120] Step 522: Initialize the statistical parameter values, update the position of the moving reference point to the current touch position, and determine whether the update flag of the lock reference point is 1.
[0121] Step 524: If the update flag of the lock point reference is 1, then update the lock point reference to the current touch position and the average of the touch positions of the three touch frames before the current touch frame.
[0122] Step 526: If the update flag of the lock reference point is not 1, then the judgment of the current touch frame ends and the judgment of the next touch frame begins.
[0123] Step 528: If the target distance is greater than the first distance threshold, then proceed to step 522.
[0124] Step 530: Obtain the movement distance of the preset duration corresponding to the previous touch frame of the current touch frame. If the movement distance of the preset duration corresponding to the previous touch frame of the current touch frame is greater than the preset movement distance, then execute step 522. If the movement distance of the preset duration corresponding to the previous touch frame of the current touch frame is not greater than the preset movement distance, then execute step 508.
[0125] Understandably, the meanings of the relevant terms and steps in this example can be found in the explanations and descriptions of the corresponding terms and steps in the above embodiments, and will not be repeated here.
[0126] In the above embodiments, by judging whether the current touch position of the current touch frame meets the locking condition, if the locking condition is met, it is judged whether the current touch position meets the stationary condition. If the stationary condition is met, the position of the lock point reference point is updated to the average of the current touch position and the touch positions of the three touch frames preceding the current touch position. This allows for accurate updating of the touch reference point when the touch is stationary within the lock point range, maximizing the lock point area again. The current touch position is not easily unlocked, thus making it less likely to be identified as a swipe, avoiding the problem of clicks being identified as swipes. Dynamically updating the lock point reference point within the lock point range for user clicks, long presses, and other operations can optimize click jitter, improve the accuracy and precision of touch recognition, and enhance the user's touch experience.
[0127] 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.
[0128] Based on the same inventive concept, this application also provides a touch device for implementing the touch method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more touch device embodiments provided below can be found in the limitations of the touch method described above, and will not be repeated here.
[0129] In one exemplary embodiment, such as Figure 6 As shown, a touch device is provided, including: a touch data acquisition module 602, a touch position determination module 604, a lock condition judgment module 606, a stationary condition judgment module 608, and a lock point position update module 610, wherein:
[0130] The touch data acquisition module 602 is used to acquire the touch data and the movement reference point corresponding to the current touch frame during the touch process;
[0131] The touch position determination module 604 is used to determine the current touch position corresponding to the touch data of the current touch frame;
[0132] The locking condition determination module 606 is used to determine whether the current touch position meets the locking condition based on the current touch position and the movement reference point;
[0133] The stationary condition judgment module 608 is used to determine whether the current touch position meets the stationary condition if the current touch position meets the locking condition.
[0134] The lock point position update module 610 is used to update the position of the lock point reference point if the current touch position meets the stationary condition.
[0135] In some embodiments, the locking condition determination module 606 is further configured to calculate the target distance between the current touch position and the moving reference point; if the target distance is not greater than the first distance threshold, it is determined that the current touch position meets the locking condition.
[0136] In some embodiments, the touch device further includes a motion reference point update module, which updates the position of the motion reference point to the current touch position if the current touch position does not meet the locking condition.
[0137] In some embodiments, the stationary condition determination module 608 is further configured to calculate the cumulative directional movement distance between the current touch position and the movement reference point; if the cumulative directional movement distance satisfies the first movement distance condition and the total directional movement distance within a preset time period satisfies the second movement distance condition, then it is determined that the current touch position satisfies the stationary condition.
[0138] In some embodiments, the stationary condition determination module 608 is further configured to determine the touch statistics duration corresponding to the current touch frame if the cumulative directional movement distance is not greater than a second distance threshold; the touch statistics duration refers to the touch duration from the end of the previous statistics to the current touch frame; if the touch statistics duration corresponding to the current touch frame is greater than a preset duration, the total directional movement distance within the preset duration is determined; if the total directional movement distance within the preset duration is less than a third distance threshold, the current touch position is determined to meet the stationary condition.
[0139] In some embodiments, the static condition judgment module 608 is further configured to obtain the touch statistics duration corresponding to the previous touch frame of the current touch frame; and to use the sum of the touch statistics duration corresponding to the previous touch frame and the touch duration corresponding to the current touch frame as the touch statistics duration corresponding to the current touch frame.
[0140] In some embodiments, the motion reference point update module is further configured to update the position of the motion reference point to the current touch position if the total directional movement distance within a preset time period is not less than a third distance threshold.
[0141] In some embodiments, the stationary condition determination module 608 is further configured to calculate a first moving distance between the current touch position and the moving reference point, and a second moving distance between the touch position of the previous touch frame and the moving reference point; if the first moving distance and the second moving distance are the same, then it is determined that the current touch position meets the stationary condition.
[0142] In some embodiments, the stationary condition determination module 608 is further configured to obtain the touch positions corresponding to the number of consecutive target touch frames preceding the current touch frame; if the current touch position is the same as the touch positions corresponding to the number of consecutive target touch frames preceding the current touch frame, then the current touch position is determined to satisfy the stationary condition.
[0143] In some embodiments, the above-described apparatus further includes a movement distance condition determination module, configured to obtain the directional movement distance parameter value corresponding to the previous touch frame of the current touch frame; if the directional movement distance parameter value corresponding to the previous touch frame does not meet the directional movement distance condition, it is determined that the current touch position does not meet the locking condition, and the position of the movement reference point is updated; if the directional movement distance parameter value corresponding to the previous touch frame meets the directional movement distance condition, it is determined that the current touch position meets the locking condition, and the determination of whether the current touch position meets the stationary condition is executed.
[0144] In some embodiments, the lock point position update module 610 is further configured to update the position of the lock point reference point to the touch position corresponding to the target touch frame that first satisfies the stationary condition, or to update the position of the lock point reference point according to the touch position corresponding to the target touch frame and the touch positions corresponding to a specified number of consecutive touch frames after the target touch frame.
[0145] In some embodiments, the lock point position update module 610 is further configured to update the position of the lock point reference point to the current touch position, or update the position of the lock point reference point according to the current touch position and the touch positions corresponding to a preset number of consecutive touch frames preceding the current touch frame.
[0146] Each module in the aforementioned touch 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.
[0147] In one exemplary embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, this 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 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 touch control method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the electronic device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the electronic device, or external keyboards, touchpads, or mice, etc.
[0148] Those skilled in the art will understand that Figure 7The 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.
[0149] In one exemplary embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the touch method described above.
[0150] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the touch method described above.
[0151] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the touch method described above.
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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 touch control method, characterized in that, The method includes: Acquire the touch data and movement reference point corresponding to the current touch frame during the touch process; Determine the current touch position corresponding to the touch data of the current touch frame; Based on the current touch position and the movement reference point, determine whether the current touch position meets the locking condition; If the current touch position meets the locking condition, then determine whether the current touch position meets the stationary condition; If the current touch position satisfies the stationary condition, then update the position of the lock point reference point.
2. The method according to claim 1, characterized in that, The step of determining whether the current touch position meets the locking condition based on the current touch position and the movement reference point includes: Calculate the target distance between the current touch position and the moving reference point; If the target distance is not greater than the first distance threshold, then the current touch position is determined to meet the locking condition.
3. The method according to claim 1, characterized in that, The method further includes: If the current touch position does not meet the locking condition, then the position of the moving reference point is updated to the current touch position.
4. The method according to claim 1, characterized in that, The step of determining whether the current touch position meets the static condition includes: Calculate the cumulative directional movement distance between the current touch position and the movement reference point; If the cumulative directional movement distance satisfies the first movement distance condition, and the total directional movement distance within a preset time period satisfies the second movement distance condition, then the current touch position is determined to satisfy the stationary condition.
5. The method according to claim 4, characterized in that, If the cumulative directional movement distance satisfies the first movement distance condition, and the total directional movement distance within a preset time period satisfies the second movement distance condition, then determining that the current touch position satisfies the stationary condition includes: If the cumulative distance of movement in the specified direction is not greater than the second distance threshold, then the touch statistics duration corresponding to the current touch frame is determined; the touch statistics duration refers to the touch duration from the end of the previous statistics to the current touch frame. If the touch statistics duration corresponding to the current touch frame is greater than the preset duration, then the total directional movement distance within the preset duration is determined; If the total directional movement distance within the preset time period is less than the third distance threshold, then the current touch position is determined to meet the stationary condition.
6. The method according to claim 5, characterized in that, Determining the touch statistics duration corresponding to the current touch frame includes: Obtain the touch statistics duration corresponding to the previous touch frame of the current touch frame; The sum of the touch statistics duration corresponding to the previous touch frame and the touch duration corresponding to the current touch frame is taken as the touch statistics duration corresponding to the current touch frame.
7. The method according to claim 5, characterized in that, The method further includes: If the total directional movement distance within the preset time period is not less than the third distance threshold, then the position of the movement reference point is updated to the current touch position.
8. The method according to claim 1, characterized in that, The step of determining whether the current touch position meets the static condition includes: Calculate the first movement distance between the current touch position and the movement reference point, and the second movement distance between the touch position of the previous touch frame and the movement reference point; If the first moving distance and the second moving distance are the same, then it is determined that the current touch position satisfies the stationary condition.
9. The method according to claim 1, characterized in that, The step of determining whether the current touch position meets the static condition includes: Obtain the touch position corresponding to the number of consecutive target touch frames preceding the current touch frame; If the current touch position is the same as the touch position corresponding to the number of consecutive target touch frames preceding the current touch frame, then the current touch position is determined to satisfy the stationary condition.
10. The method according to claim 1, characterized in that, The method further includes: Obtain the directional movement distance parameter value corresponding to the previous touch frame of the current touch frame; If the directional movement distance parameter value corresponding to the previous touch frame does not meet the directional movement distance condition, then it is determined that the current touch position does not meet the locking condition, and the position of the movement reference point is updated; If the directional movement distance parameter value corresponding to the previous touch frame satisfies the directional movement distance condition, then it is determined that the current touch position satisfies the locking condition, and the step of determining whether the current touch position satisfies the stationary condition is executed.
11. The method according to any one of claims 1 to 10, characterized in that, The update of the lock point reference point position includes: The position of the lock point reference point is updated to the touch position corresponding to the target touch frame that first satisfies the stationary condition, or the position of the lock point reference point is updated according to the touch position corresponding to the target touch frame and the touch positions corresponding to a specified number of consecutive touch frames after the target touch frame.
12. The method according to any one of claims 1 to 10, characterized in that, The update of the lock point reference point position includes: The position of the lock point reference point is updated to the current touch position, or the position of the lock point reference point is updated according to the current touch position and the touch positions corresponding to a preset number of consecutive touch frames before the current touch frame.
13. A touch device, characterized in that, The device includes: The touch data acquisition module is used to acquire the touch data and movement reference point corresponding to the current touch frame during the touch process; The touch position determination module is used to determine the current touch position corresponding to the touch data of the current touch frame; The locking condition determination module is used to determine whether the current touch position meets the locking condition based on the current touch position and the movement reference point; A stationary condition determination module is used to determine whether the current touch position meets the stationary condition if the current touch position meets the locking condition. The lock point position update module is used to update the position of the lock point reference point if the current touch position meets the stationary condition.
14. 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 12.
15. 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 12.
16. 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 12.