A method for realizing right-slide exit function based on touch coordinate calculation
By dynamically adjusting the sampling frequency and sensitivity of gesture recognition, combined with multi-layer curve fitting and path integrity detection, the problem of mistouching and inaccurate recognition of the traditional right-slide exit function in different scenarios and user gestures is solved, significantly improving the gesture Accuracy of identification and user experience.
Patent Information
- Application Number
- CN202411398324.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The traditional right-swipe exit function has problems of error touch and inaccurate recognition in different scenarios and user gestures. It is mainly due to the fixed sampling frequency and poor scene adaptability, resulting in insufficient gesture recognition accuracy and poor user experience.
By capturing touch track points in real time, dynamically adjusting the sampling frequency, combining sliding speed and pressure values to adjust the sensitivity of gesture recognition, and dynamically adjusting the sampling frequency and triggering conditions of gesture recognition according to the application scenario, multi-layer curve fitting analysis and paths are used. Integrity detection to ensure accurate recognition of gestures.
It improves the accuracy and sensitivity of gesture recognition, reduces misoperation, enhances the system's scene adaptability and operation experience, and ensures the accurate triggering and stability of the right swipe exit function.
Smart Images

Figure CN118897644B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of touch technology, and in particular to a method for realizing a right-swipe exit function based on touch coordinate calculation. Background Art
[0002] With the widespread use of smartphones and tablets, touch gesture operations have become particularly important in user interface interactions. As one of the common gesture interactions, the right swipe exit function is usually used to close the application interface or return to the previous operation interface. However, traditional right swipe exit functions mostly rely on a fixed sampling frequency and a preset sliding path, which leads to false triggering or inaccurate recognition in different scenarios and different user gestures. For example, when the user slides too fast or the gesture is more complex, the system may not be able to accurately recognize the sliding gesture, affecting the user experience. Therefore, how to dynamically adjust the sampling frequency in different application scenarios to improve the accuracy and flexibility of the right swipe exit function has become a key technical problem that needs to be solved.
[0003] The existing right-swipe exit function has the following technical problems in the process of collecting and recognizing sliding gestures:
[0004] 1. Fixed sampling frequency: Traditional systems fail to dynamically adjust the sampling frequency based on the user's sliding speed, gesture complexity, etc., resulting in insufficient accuracy in gesture recognition, especially when the sliding speed changes greatly, and cannot respond in time.
[0005] 2. Serious false triggering: The system cannot distinguish the complexity of sliding gestures, and it is easy to trigger the right swipe to exit when the sliding is unexpected, resulting in erroneous operation.
[0006] 3. Poor scenario adaptability: Existing methods fail to dynamically adjust the sensitivity and trigger conditions of gesture recognition according to different application scenarios (such as reading, games, etc.), resulting in poor user experience in certain specific scenarios.
[0007] Therefore, there is an urgent need for a right-swipe exit function implementation method that can dynamically adjust the sampling frequency and adapt to different scenarios to improve the accuracy of gesture recognition and the operating experience. Summary of the invention
[0008] The embodiment of the present invention provides a method for realizing a right-swipe exit function based on touch coordinate calculation to solve the above technical problem.
[0009] The present invention provides a method for realizing a right-swipe exit function based on touch coordinate calculation, which is characterized by comprising the following steps:
[0010] Step 1: Touch event capture and multi-point acquisition;
[0011] The step 1 includes: capturing the user's touch trajectory points in real time and dynamically adjusting the sampling frequency according to the sliding speed; when it is detected that the sliding speed exceeds the set threshold, the sampling frequency will be increased to 240Hz to ensure accurate gesture capture during fast sliding; and when it is detected that the sliding speed is low, the sampling frequency will be automatically reduced to 60Hz, thereby reducing the occupation of computing resources.
[0012] Step 2: multi-layer curve fitting analysis, including: adjusting the number of segments of the trajectory according to the complexity of the sliding trajectory obtained by fitting, and the basis for adjustment is the change in the curvature, acceleration and sliding speed of the sliding trajectory;
[0013] Step 3: calculating the correlation between pressure and speed, including: collecting the pressure value applied by the user during the sliding process in real time through the pressure sensor, and adjusting the sensitivity of gesture recognition in combination with the sliding speed of the touch point;
[0014] Step 4: Dynamic scene adaptive adjustment;
[0015] Step 5: Path integrity detection and right swipe exit trigger.
[0016] Furthermore, the step 2 fits the sliding trajectory curve by the following formula: ,
[0017] Where Pi = (x i ,y i ,t i ) is the trajectory point, x is the horizontal coordinate, y is the vertical coordinate, and t is the progress of the sliding gesture trajectory in time.
[0018] Furthermore, the value range of t is 0≤t≤1.
[0019] Furthermore, the step 2 also includes calculating the number of segments of the fitting trajectory by an adaptive dynamic segment fitting formula, the formula being:
[0020] ;
[0021] Among them, κ i is the curvature of the trajectory, a i is the acceleration, v i is the sliding speed, k1 is the reference coefficient, β is the curvature influence adjustment coefficient, γ is the acceleration influence adjustment coefficient, and δ is the speed influence adjustment coefficient.
[0022] Furthermore, step 4 includes the following operations:
[0023] Use the application type detection module to identify the type of application currently running and provide application scenario information;
[0024] According to the window status monitoring module, the window status of the application is monitored and adjusted based on the information provided by the application type detection module;
[0025] The user input pattern recognition module identifies the sliding speed and pressure parameters and analyzes them in combination with the application type and window status;
[0026] According to the scene parameter adjustment module, the trigger condition of sliding right to exit is adjusted according to the sliding speed and pressure parameters provided by the user input pattern recognition module;
[0027] The scene switching management module responds to changes in the application scene or window state to adapt to the new operating state.
[0028] Furthermore, the application type detection module increases the touch sampling frequency to 240 Hz when a gaming scene is detected, and reduces the touch sampling frequency to 60 Hz when a reading scene is detected.
[0029] Further, the step 5 includes the following operations:
[0030] Through path integrity detection, the continuity, direction and length of the sliding trajectory are determined;
[0031] Adjust the triggering conditions for swiping right to exit based on the detected sliding speed, track length and direction;
[0032] When the sliding track meets the adjusted trigger conditions, the right swipe to exit is triggered.
[0033] Furthermore, the path integrity detection includes analyzing the continuity of the touch track points, determining whether the sliding direction is within a predetermined horizontal angle range, and determining whether the track length reaches a preset threshold based on the sliding distance.
[0034] Furthermore, triggering the right-swipe exit includes calling a tactile feedback module to prompt the user that the operation is successful through vibration or animation feedback.
[0035] Furthermore, triggering the right-swipe exit includes switching or clearing the page by calling a touch interface function.
[0036] In the step of "touch event capture and multi-point acquisition", the present invention dynamically adjusts the sampling frequency so that the system can adaptively adjust the density of sampling points in real time according to the sliding speed of the user's gesture. Compared with the existing fixed sampling frequency technology, this solution ensures the full capture of trajectory points by increasing the sampling frequency during high-speed sliding, thereby reducing recognition errors during fast sliding. At the same time, the sampling frequency is reduced during low-speed sliding, effectively reducing unnecessary system computing resource usage. This dynamic adjustment method improves the system's adaptability to different sliding speeds, ensures the accuracy of gesture recognition and the rationality of resource utilization, and thus improves the flexibility and stability of the right-swipe exit function.
[0037] In the "multi-layer curve fitting analysis" step, the present invention effectively solves the problem of inaccurate recognition when the complexity of the gesture trajectory changes by performing dynamic segmented fitting based on the complexity of the sliding trajectory. Furthermore, this step adaptively adjusts the number of fitting segments so that the system can still accurately fit the complete sliding trajectory when processing sliding gestures with rapid turns and large curve changes, thereby avoiding misjudgment problems caused by trajectory interruption or deviation. At the same time, in the case of simple gestures and straight-line sliding, the system reduces the number of fitting segments, thereby optimizing calculation efficiency. This dynamic fitting solution based on gesture complexity significantly improves the recognition accuracy and system resource management capabilities of the right-swipe exit function under different gesture trajectories.
[0038] In the step of "calculating the correlation between pressure and speed", the system dynamically adjusts the sensitivity of gesture recognition by collecting the pressure value applied by the user in real time and combining it with the change in sliding speed. This design enables the system to adapt to changes in different operating forces and speeds. For example, when the user slides quickly or applies a lot of pressure, the system reduces the sensitivity to avoid allergic reactions in gesture recognition; when sliding slowly or applying less pressure, the system increases the sensitivity to ensure that even slight sliding operations can be accurately recognized. This sensitivity adjustment mechanism not only reduces misoperations, but also significantly improves the accuracy and adaptability of gesture recognition, especially the ability to achieve intelligent adjustments under different user operating habits, which improves the reliability of the right-swipe exit function.
[0039] In the step of "dynamic scene adaptive adjustment", the present invention introduces modules such as application type detection and window status monitoring, so that the system can dynamically adjust the sensitivity and trigger conditions of gesture recognition according to the current application scenario. In high-dynamic scenarios, such as game applications, the system increases the sampling frequency and gesture recognition sensitivity to ensure the response of fast sliding gestures; in low-dynamic scenarios, such as reading or browsing applications, the system reduces the sensitivity to reduce the occurrence of misoperations. In addition, by monitoring the window status, the system can identify the different requirements of full-screen mode or windowed mode and optimize the trigger conditions of gesture recognition. This scene adaptive adjustment mechanism enables the right-swipe exit function to be flexibly adjusted according to the needs of different application scenarios, greatly improving the system's scene adaptability and operating experience.
[0040] Finally, in the step of "path integrity detection and right swipe exit triggering", the present invention ensures the accurate triggering of the right swipe exit function by detecting the integrity and directionality of the sliding path, combined with the determination of the sliding speed and distance. Furthermore, through path detection and dynamic threshold adjustment, the system can effectively filter out abnormal sliding paths to ensure that the exit operation is triggered only when the preset conditions are met. This design prevents misoperation caused by incomplete sliding trajectories, too slow speeds, or deviations in path direction. In particular, in different application scenarios, the system can automatically adjust the sliding distance and speed thresholds as needed. For example, in high-dynamic scenarios, the sliding distance and speed thresholds are increased to ensure the accuracy of the gesture, while in low-dynamic scenarios, the thresholds are lowered to increase the response speed. This flexible path detection and trigger condition adjustment mechanism makes the right swipe exit function more intelligent and reliable, significantly improving the user's operating experience and the stability of the system.
[0041] In summary, the present invention provides a method for implementing the right-swipe exit function based on touch coordinate calculation, which collaboratively improves the accuracy, sensitivity and scene adaptability of gesture recognition through multiple steps, and solves the problems of false triggering and poor sensitivity existing in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a structural diagram of a method for realizing a right-swipe exit function based on touch coordinate calculation in an embodiment of the present invention;
[0044] Figure 2This is a schematic diagram of the structure of step 1 of an embodiment of the present invention;
[0045] Figure 3 This is a schematic diagram of the structure of step 2 of an embodiment of the present invention;
[0046] Figure 4 This is a schematic diagram of the structure of step 3 of an embodiment of the present invention;
[0047] Figure 5 This is a schematic diagram of the structure of step 4 of an embodiment of the present invention;
[0048] Figure 6 This is a schematic diagram of the structure of step 5 of an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Preferred embodiments of the present invention are provided in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0050] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0052] In the “method for realizing right-slide exit function based on touch coordinate calculation” of the present invention, the system specifically refers to the following:
[0053] (1) Modular implementation: The “system” in the invention refers to a collection of multiple functional modules, including but not limited to a touch event acquisition module, a pressure and speed association module, a scene recognition module, etc. These modules are responsible for processing tasks related to gesture recognition, dynamic sampling frequency adjustment, pressure sensing, etc., and realize the right-swipe exit function of the invention through data sharing and process collaboration.
[0054] (2) Dynamic sampling mechanism: The system in the invention refers to the coordination and operation between the modules. For example, by dynamically adjusting the sampling frequency module, the data collection frequency can be adjusted in real time according to the user's sliding speed and acceleration to ensure that the collected touch point data is accurate enough, thereby optimizing the gesture recognition process.
[0055] (3) System interface calls: The “system” includes the technical interfaces involved in the method, such as the interface functions used by the method in the LVGL library (such as lv_scr_load() or lv_obj_clean()). These functions are called through the system’s touch interface to perform operations such as interface switching and sliding feedback.
[0056] Embodiment 1
[0057] This embodiment provides a method for implementing the right swipe exit function based on touch coordinate calculation. In a possible implementation, the method first captures touch events and collects multi-point data. Specifically, when a user performs a sliding operation on the touch screen, the system captures the user's sliding gesture track points in real time and dynamically adjusts the sampling frequency according to the speed of the gesture sliding. The touch track points (P i = (x i , y i , t i ) ), the system continuously collects these touch points and generates a set of sampling points ( {P1, P2, ..., P n} ), providing accurate data support for subsequent sliding trajectory fitting.
[0058] The system provided in this embodiment performs multi-layer curve fitting analysis on the sliding trajectory. By fitting the sliding trajectory with multi-layer Bezier curves, it is ensured that the user's gesture can be accurately captured when the sliding gesture is relatively complex. In addition, curve fitting can not only handle simple straight-line sliding, but also adaptively adjust the number of fitting segments according to the complexity of the gesture, thereby improving the accuracy of trajectory fitting.
[0059] Based on the trajectory analysis, the system further calculates the correlation between pressure and speed. The pressure value (P i ), combined with the sliding speed ( v i ), adaptively adjusts the recognition accuracy of gestures, especially when the pressure and speed applied by the user change rapidly, the sensitivity will be adjusted accordingly to ensure the accuracy and response speed of sliding operations.
[0060] In addition, in this embodiment, the system also introduces a dynamic scene adaptive adjustment mechanism. The mechanism includes an application type detection module, a window status monitoring module, and a user input mode recognition module. By detecting the current scene, the system can automatically adjust the triggering conditions of the sliding gesture. For example, in the game scene, the system will increase the sampling frequency and sliding sensitivity, while in the reading scene, the system will appropriately reduce the sensitivity to reduce unnecessary misoperations.
[0061] Finally, path integrity detection is one of the key steps in this method. The system detects the integrity and continuity of the trajectory based on the trajectory points of the user's slide to ensure that there is no sudden change or abnormal deviation in the sliding path. By comprehensively analyzing the direction, speed, pressure and other parameters of the sliding trajectory, the system will trigger the right slide exit operation when the preset conditions for right slide exit are met. The triggering conditions for right slide exit include comprehensive judgment of factors such as sliding direction, sliding distance, and sliding speed.
[0062] In summary, this embodiment builds a highly intelligent right-swipe exit function system through multiple steps such as touch event capture, multi-layer curve fitting analysis, pressure and speed correlation calculation, and dynamic scene adaptive adjustment. By dynamically adjusting the sampling frequency and the sensitivity of gesture recognition, the system can accurately identify the user's sliding gesture in different scenarios, ensure the accurate triggering of the right-swipe exit function, and improve the user's operating experience.
[0063] Embodiment 2
[0064] This embodiment includes the touch event capture and multi-point acquisition steps in "a method for implementing the right swipe exit function based on touch coordinate calculation". This step can capture the user's sliding gesture trajectory in real time through an efficient touch event acquisition mechanism, and combined with a dynamic sampling frequency adjustment strategy, provide accurate and complete data support for subsequent sliding trajectory analysis and judgment.
[0065] Touch event capture and multi-point acquisition include:
[0066] (1) Real-time capture of touch data: When the user performs a sliding operation on the touch screen, the system automatically detects the starting point of the gesture (x start ,y start ) and the end point (x end ,y end ) and record the corresponding timestamp t start and t end The above data is used to determine the sliding direction, distance and speed. During the sliding operation, the system continuously collects multiple touch points P in the sliding trajectory. i =(x i ,y i ,t i), forming multiple sampling point sets of trajectories {P1,P2,…,P n}, providing data support for subsequent trajectory fitting and analysis.
[0067] (2) Adjust the dynamic sampling frequency: The speed is related to the sampling frequency by using the sliding speed calculation formula based on weighted Euclidean distance and acceleration correction:
[0068] ,
[0069] Among them, v i : The sliding speed of the i-th touch point;
[0070] x i ,y i : The coordinates of the i-th touch point;
[0071] t i : The timestamp of the i-th touch point;
[0072] a i : The acceleration of the i-th touch point is defined as:
[0073] ;
[0074] α: Weighting coefficient, used to adjust the effect of acceleration changes on speed.
[0075] The formula introduces an acceleration correction term to dynamically adjust the calculation result of the sliding speed according to the trend of the gesture acceleration or deceleration. The weighting coefficient α controls the impact of acceleration changes on speed, allowing the system to accurately identify sliding gestures at different speeds, especially improving the recognition accuracy during nonlinear sliding. For example, when the user accelerates during sliding, the system can quickly respond and adjust the speed calculation through the acceleration correction term, making the trajectory analysis more accurate.
[0076] According to the calculated sliding velocity v i , dynamically adjust the sampling frequency f through the following formula i :
[0077] ;
[0078] f i : Sampling frequency of the i-th touch point.
[0079] f min : Minimum sampling frequency 60Hz (in slow sliding scenarios such as browsing or reading, the sampling frequency is reduced to 60Hz to reduce unnecessary sampling points and reduce the system burden. The track points at this frequency can still accurately reflect the user's sliding gestures);
[0080] fmax : Maximum sampling frequency of 240Hz (in high-speed sliding scenarios such as games or fast interface switching, the sampling frequency is increased to 240Hz to ensure that the system can capture more touch points, accurately restore the sliding trajectory, and avoid gesture recognition errors caused by insufficient sampling);
[0081] v i : The sliding speed of the i-th touch point.
[0082] a i : The acceleration of the i-th touch point.
[0083] β,γ: adjustment coefficients, which respectively control the impact of speed and acceleration on the sampling frequency.
[0084] Specifically, the value range of the β adjustment coefficient is 0.01 ≤ β ≤ 2, which is used to control the impact of sliding speed on the sampling frequency. A larger β value (close to 2) is suitable for high-speed sliding scenarios, which can significantly increase the sampling frequency and ensure accurate capture of the trajectory; a smaller β value (close to 0.01) is suitable for low-speed sliding scenarios, which reduces the sampling frequency to save system resources.
[0085] The value range of the γ adjustment coefficient is 0.1 ≤ γ ≤ 1, which is used to control the impact of acceleration on the sampling frequency. When the γ value is close to 1, the system increases the sampling frequency when the acceleration changes significantly to ensure accurate recognition of gesture trajectories during acceleration or deceleration; when the γ value is close to 0.1, it is suitable for scenes with small acceleration changes, avoiding oversensitivity to slight acceleration changes, thereby reducing excessive occupation of system resources.
[0086] The formula for adjusting the sampling frequency in this embodiment takes into account the dynamic changes in acceleration and clarifies the value range of the β and γ adjustment coefficients, accurately capturing subtle changes in the sliding trajectory. Especially when processing complex gestures, it can identify details in the acceleration and deceleration process and improve the accuracy of gesture recognition. This embodiment prevents false touch operations by dynamically adjusting the sampling frequency, especially in slow or unstable sliding gestures. It is easy to be accompanied by unintentional touches or slight sliding, which may be misjudged as valid sliding under traditional methods, resulting in false triggering of interface switching. This embodiment can effectively prevent such misoperations by combining dynamic sampling frequency adjustment with acceleration correction.
[0087] When it is detected that the user's sliding speed is low and the acceleration change is small, that is, the gesture is relatively stable, the system automatically reduces the sampling frequency. i∣ item adjusts the frequency through acceleration changes. When the acceleration is small, the system's sensitivity to the sampling points is reduced, thereby reducing the sampling points of unintentional touches and the probability of misjudgment. The low sampling frequency reduces invalid calculations in the case of low-speed sliding, and improves the overall system response efficiency. After the dynamic adjustment of the sampling frequency is completed, the system uses the collected touch point data for multi-layer curve fitting analysis to ensure that the accurate capture of the sampling trajectory is seamlessly connected with the fitting calculation.
[0088] Embodiment 3
[0089] This embodiment includes a multi-layer curve fitting analysis step of the sliding trajectory in the method for realizing the right-swipe exit function based on touch coordinate calculation. This step analyzes the touch trajectory through the multi-layer curve fitting method to accurately determine whether the sliding gesture meets the right-swipe exit standard.
[0090] First, from the collected multiple touch points P i =(x i ,y i ,t i ), and fit the trajectory through the curve fitting formula. To adapt to the complexity of the sliding gesture, the formula is as follows:
[0091] ;
[0092] Where t represents the progress of the sliding gesture trajectory in time, and its value range is 0≤t≤1. When t=0, it indicates the starting point of the sliding, and when t=1, it indicates the end point of the sliding. The intermediate values of t correspond to different positions on the sliding trajectory. B(t) represents the fitting curve of the sliding gesture, which obtains the curve shape of the gesture trajectory through the control points (such as P0, P1, P2, P3) of the multi-layer curve fitting method.
[0093] In this embodiment, the number of segments of the curve is dynamically adjusted by an adaptive dynamic segment fitting formula according to the complexity of the obtained trajectory. The adaptive dynamic segment fitting formula is based on the sliding speed v i , acceleration a i , curvature κ i The system dynamically calculates the number of required fitting curves to fit the entire gesture trajectory based on the parameters such as the sliding speed. If a large change in sliding speed or a high curvature is detected, the system will increase the number of fitting segments to fit the entire trajectory. For simple gestures, the number of segments is reduced to improve calculation efficiency. The formula is as follows: ;
[0094] κ i: The curvature of the trajectory reflects the degree of curvature of the trajectory;
[0095] a i : Acceleration, indicating the speed change between touch points;
[0096] v i : Sliding velocity, defined as: ;
[0097] k 1: Base coefficient, which sets the initial number of segments for the fitting process. For the right swipe exit gesture scenario, the base number of segments must ensure that the basic sliding trajectory can be accurately captured and provide a basis for subsequent adaptive adjustments, 1 ≤k1≤ 10, (when 1 ≤k1≤ 5: used to process simple sliding gestures, such as straight-line sliding or slightly curved sliding. 5<k1≤10: suitable for more complex gestures, such as sliding operations with obvious curves, arcs or rapid direction changes. At this time, more segments can better capture the changes in the trajectory and improve the gesture recognition accuracy of the system).
[0098] β: Curvature effect adjustment coefficient, mainly used to deal with complex sliding gestures. When the user makes a sharp turn or the arc changes during the sliding process, the curvature κ i Increasing it can automatically increase the number of segments of the fitting curve according to the β value to make the fitting result more accurate; its range is: 0.1≤β≤2.
[0099] γ: Acceleration effect adjustment coefficient to control the acceleration change a in the sliding gesture i Impact on the number of segments. When it is detected that the acceleration of the user's gesture changes significantly during the sliding process, the γ control system increases the number of segments to better fit the dynamic characteristics of the gesture, ensuring that even when sliding at a non-uniform speed, the system can accurately capture every detail of the gesture, in the range of 0.1 ≤ γ ≤ 1, to meet the needs of dynamic changes of different gestures.
[0100] δ: Speed influence adjustment coefficient, controls the sliding speed v i Impact on the number of segments. When the sliding speed is high, the gesture changes more frequently. You can increase the number of segments by adjusting δ to ensure high-precision capture of the trajectory during high-speed sliding, and to accurately trigger the right-swipe exit function under fast sliding gestures. The range is 0.01≤δ≤1.
[0101] The adaptive dynamic segmented fitting formula provided in this embodiment combines the k1, β, γ, and δ coefficients together to automatically adjust the number of fitting segments according to the complexity of the gesture (curvature, speed, acceleration), thereby ensuring the recognition accuracy and system response speed in different sliding gesture scenarios. This combination can dynamically balance the fitting accuracy and resource consumption. In complex gesture scenarios (such as arc sliding, fast turning, etc.), the system automatically increases the number of segments through higher β and γ values, so that every detail of the trajectory can be accurately captured. Avoid mis-touch operations. In scenarios with lower curvature and smaller acceleration changes, the possibility of mis-operation can be reduced by appropriately reducing the number of segments (lower β and γ values), ensuring that only valid right-slide operations can trigger the exit function. Through the dynamic adjustment of the sliding speed by δ, the number of segments and sampling frequency can be automatically adjusted in different scenarios (such as reading, games, etc.), thereby ensuring the accuracy of gesture recognition in different application scenarios. In addition, a lower k1 value can reduce the number of segments and optimize system resources in simple gesture scenarios, while increasing the number of segments through high β, γ, and δ values in complex scenarios to ensure a balance between recognition accuracy and system resource usage.
[0102] Embodiment 4
[0103] This embodiment provides a method for implementing a right-swipe exit function based on touch coordinate calculation, which includes:
[0104] (1) Pressure value collection and processing: The pressure value P applied by the user on the touch screen is collected in real time through the pressure sensor. i , and records the corresponding pressure data for each touch point. The pressure value is used to determine the strength of the user's gesture. The set pressure value P i It is an important parameter for evaluating whether a gesture operation is significant enough. The pressure sensor captures the pressure changes of each touch point during the gesture execution process, thus forming a pressure track.
[0105] (2) Calculation of sliding speed: sliding speed v i It is based on the touch point position information (x i ,y i ) and the corresponding timestamp t i The calculation formula is as follows:
[0106] ;
[0107] (3) Adjusting dynamic sensitivity based on pressure and speed: According to the pressure value P applied by the user i and sliding speed v i , introduce nonlinear adjustment factors and acceleration correction terms to dynamically adjust the sensitivity S of gesture recognition adjust , the formula is as follows:
[0108] ;
[0109] P i : The pressure value applied by the user on the touch screen;
[0110] v i : sliding speed;
[0111] α: Pressure influence coefficient, 0.1≤α≤5, control pressure P i Impact on gesture recognition sensitivity. A higher α value (close to 5) will significantly enhance the impact of pressure on recognition, making the system respond more quickly to high-pressure operations; a lower α (close to 0.1) makes the system more sensitive to slight pressure, which is suitable for preventing accidental touch operations.
[0112] β: Speed and acceleration correction coefficient, used to adjust the sliding speed vi and acceleration change Δa i Impact on sensitivity, 0.01≤β≤2. A higher β (close to 2) is suitable for high-speed sliding or fast-acceleration gestures, allowing the system to respond quickly to dynamic changes; a lower β value (close to 0.01) is suitable for stable or low-speed gestures to prevent misjudgment caused by frequent adjustments.
[0113] γ1: nonlinear adjustment coefficient of pressure, controls the nonlinear influence of pressure and speed, 0.1≤γ1≤2. A higher γ1 value (close to 2) is suitable for complex operation scenarios, making the system more sensitive to larger pressure values; a lower γ1 value (close to 0.1) is used in simple operation scenarios to ensure that the system can respond stably under lower pressure conditions.
[0114] γ2: nonlinear speed adjustment coefficient, used to control the speed v i The nonlinear influence range is: 0.1≤γ2≤2. A higher γ2 value (close to 2) will enhance the impact of high-speed sliding gestures on sensitivity, allowing the system to adjust quickly. A lower γ2 value (close to 0.1) will improve the stability of the system during low-speed sliding and prevent frequent false triggering.
[0115] (4) Adjust the triggering conditions for gesture recognition: sensitivity parameter S calculated based on the association model adjust Automatically adjust the trigger conditions for gesture recognition. When the pressure Pi is large and the speed v i When the pressure is higher, the system will reduce the recognition sensitivity to ensure that the gesture can be triggered quickly to meet the user's needs for fast sliding. i Smaller or speed v i When the speed is slower, the system will increase the recognition sensitivity to prevent misoperation and ensure that only intentional sliding operations can trigger the right-swipe exit function.
[0116] (5) Data synchronization and trigger judgment: During the process of calculating the correlation between pressure and speed, the pressure and speed data of each touch point will be synchronized in real time, and the sensitivity parameter S adjust The trigger condition is judged. Through this association calculation, the system ensures that the right swipe exit operation is triggered when the sliding gesture meets the preset pressure and speed conditions.
[0117] Embodiment 5
[0118] This embodiment provides a dynamic scene adaptive adjustment step in a method for implementing a right-swipe exit function based on touch coordinate calculation, aiming to dynamically adjust the system's recognition sensitivity and trigger conditions for sliding gestures according to the characteristics of different application scenarios, thereby ensuring gesture recognition accuracy and operation stability in different scenarios. The dynamic scene adaptive adjustment includes the following modules:
[0119] (1) Application type detection module: responsible for monitoring the application currently being run by the user, identifying the type of operation scenario, and providing trigger data for scenario adaptive adjustment. This module can detect the type of application the user is in through the operating system interface (such as the application package name or application identifier) and decide whether to adjust the touch sampling frequency. For example, in the game scenario, the system triggers the sampling frequency to increase (240Hz) through the application type detection module to ensure that every subtle slide is captured; in the reading scenario, the trigger sampling frequency is reduced to 60Hz to save resources. In addition, by detecting different application types, the application type detection module can determine the complexity of the gesture trajectory and select a suitable curve fitting method. For example, in reading applications, the curve fitting accuracy is low because the sliding gesture is often simple; in games, complex sliding gestures require accurate multi-segment fitting. In addition, in high-dynamic scenarios (such as games), the application type detection module can dynamically adjust the gesture recognition sensitivity according to the user's sliding speed and pressure, so that the system can reduce misjudgment when detecting fast sliding; in reading or video scenarios, it can reduce the impact of pressure. The application type detection module determines the system's sampling frequency and gesture recognition sensitivity by identifying the type of application currently running (such as reading, gaming, or video playback). When a gaming scenario is detected, the system will automatically increase the sampling frequency to ensure quick gesture response; while in a reading scenario, the system will reduce the sampling frequency to reduce false triggers.
[0120] (2) Window state monitoring module: The window state monitoring module is combined with touch event capture data. When a full-screen window (such as video playback or full-screen game) is detected, the sampling frequency of the touch event can be adjusted according to the window state. For example, after entering the full screen, the system may reduce the sampling frequency to prevent misoperation from interrupting the user's viewing or gaming experience. The module also determines the complexity of the sliding trajectory by identifying the window state (such as video playback mode, normal reading mode). For video playback, the sliding trajectory is usually simple, and the system reduces the accuracy of fitting; while for full-screen games, the sliding trajectory is complex, and the accuracy of fitting needs to be increased and the segmented fitting needs to be refined. In addition, the window state monitoring is combined with the user's pressure and speed data. For example, in full-screen mode, when the user slides lightly or applies less pressure, the system recognizes it as a low-priority gesture through the window state module to avoid misjudgment; while in the windowed state, the gesture will be more sensitive and adapt to the sliding operation. The window state monitoring module is responsible for monitoring the window state of the current application, such as full-screen mode or windowed mode. When full-screen mode is detected, the system will reduce the sensitivity of gesture triggers to avoid misoperations caused by slight sliding; in windowed mode, the system will increase the sensitivity to ensure that users can respond quickly to complex operations.
[0121] (3) User input pattern recognition module: The user input pattern recognition module is closely integrated with the data collected by touch events, especially in the dynamic changes of sliding speed and touch pressure. When the user slides quickly, the system increases the sampling frequency to ensure that all sliding points can be captured; when sliding at a low speed, the system appropriately reduces the sampling frequency. The module adjusts the sensitivity according to the gesture speed to ensure that the system can respond in real time under high-speed sliding. The user input pattern recognition module will determine whether it is necessary to increase the complexity of Bezier curve fitting based on the position and speed data of the touch point. For smooth straight line gestures, the system can use simple curve fitting; for nonlinear gestures or arc sliding, the system will adaptively adjust and use more complex multi-level fitting. The module analyzes the combination of pressure and speed in real time to determine whether it is necessary to reduce the sensitivity. For example, at the pressure value P i and speed S i When the pressure is too high, the system will reduce the sensitivity to ensure more stable gesture judgment and prevent misoperation. The user input pattern recognition module dynamically adjusts the trigger conditions for gesture recognition according to the user's sliding speed and applied pressure. When the user applies a large pressure and slides quickly, the system will reduce the sensitivity to avoid mistriggers; when the pressure is light or the sliding is slow, the system will increase the sensitivity to ensure that even slight operations can be accurately recognized.
[0122] (4) Scene parameter adjustment module: The scene parameter adjustment module adjusts the sampling frequency based on the user input mode and application type detection. For example, when the user slides quickly, the system increases the sampling frequency. In game and fast switching scenarios, the high sampling frequency is ensured to accurately capture each touch event. The scene parameter adjustment module dynamically adjusts the number of segments and complexity of the curve fitting according to the complexity of the sliding trajectory. In simple sliding operations, the module reduces the segment fitting; in complex operations, the module increases the fitting accuracy and flexibility to ensure accurate recognition of complex gestures. The module automatically adjusts the trigger threshold of the gesture based on the pressure and speed data input by the user. In game or video scenarios, the system increases the trigger distance and speed threshold to ensure that the sliding gesture is not triggered by mistake; in reading scenarios, the threshold is reduced to enhance the gesture response speed. The scene parameter adjustment module dynamically adjusts the sliding distance and speed threshold of the gesture trigger based on the application type and window status. In high-dynamic scenarios (such as games), the system will increase the sliding distance and speed thresholds to ensure that the right-swipe exit operation is only triggered by a clear and quick swipe; in low-dynamic scenarios (such as reading or video playback), the system will reduce the sliding distance and speed thresholds to ensure that a slight swipe can also successfully trigger the exit function.
[0123] (5) Scene switching management module: The scene switching management module adjusts the touch sampling frequency by monitoring application switching and user operation data. When the user switches from reading to gaming or video playback, the system adjusts the sampling frequency to adapt to the real-time nature of gesture operations after scene switching. This module is combined with sliding trajectory fitting analysis. When the scene switches, the system re-evaluates the trajectory complexity and adjusts the fitting method based on the current scene switch. When the reading scene switches to the game scene, the system increases the fitting complexity to accurately capture complex gesture operations. Combining pressure and speed calculations, the scene switching management module readjusts the weights of pressure, speed, and sensitivity when the scene switches. After a quick scene switch, the module immediately adjusts the pressure response to ensure that false touches are reduced in high-dynamic operations.
[0124] Embodiment 6
[0125] This embodiment provides a path integrity detection and right swipe exit triggering method for implementing the right swipe exit function based on touch coordinate calculation. This step is the last step of the entire gesture recognition process, which ensures that the system accurately executes the right swipe exit function based on accurate judgment of the sliding gesture. By analyzing the integrity and compliance of the sliding path in real time, the accuracy and stability of the right swipe exit operation are guaranteed to avoid the occurrence of misoperation. The system makes judgments based on the length, direction and sliding speed of the sliding trajectory. When the sliding length of the trajectory reaches 200px, and the sliding direction is within the horizontal angle range of ±10°, and the sliding speed reaches 100px / s, the system determines that the slide is a valid right swipe gesture and triggers the exit operation, which includes:
[0126] (1) Path integrity detection: First, based on the touch point data (x i , y i , t i ), the continuity of the sliding path is detected to ensure that the distribution of the trajectory points of the sliding gesture is continuous and without mutation. The spacing between the touch points is determined by the sliding speed and the sampling frequency. The system calculates the reasonable distance range between the trajectory points based on the speed and the sampling frequency. Combined with the multi-layer curve fitting results, the system further detects the fitted curve to determine whether there is obvious deviation, jump or break in the trajectory. The curvature and smoothness of each segment of the fitted curve are calculated using the Bezier curve formula to ensure that the trajectory shape conforms to the horizontal sliding characteristics. If an obvious interruption or abnormal offset is detected in the sliding trajectory (such as the distance between the touch points is too large or the trajectory jumps significantly), the system will identify the gesture as an invalid sliding operation and will not trigger the right swipe exit function. This mechanism combines the pressure and speed association model in step 3 to further reduce misjudgments caused by unstable operation or screen jitter.
[0127] (2) Adjust the triggering conditions for right swipe exit: After the path integrity test is passed, the system further determines whether the gesture meets the triggering conditions for right swipe exit. The triggering conditions include multiple parameters such as sliding direction, speed, and distance, which are comprehensively determined based on the analysis results provided by the first four steps. Combined with the results of the fitting curve analysis, the system calculates the direction vector of the sliding gesture to confirm that the sliding direction meets the right swipe standard, that is, sliding from left to right. In this process, the direction vector fitted by the curve is used to accurately determine the sliding direction of the gesture to avoid misjudgment caused by slight vertical sliding or angle changes. Combined with the speed and pressure correlation calculation, it is determined whether the speed and sliding distance of the sliding gesture reach the preset threshold for right swipe exit. The threshold set by the system is dynamically adjusted according to different scenarios to ensure that the sensitivity is reduced when sliding quickly and increased when sliding slowly. For example: High dynamic scenarios (such as game scenarios): The system will increase the speed and distance thresholds to ensure that the user must slide faster and more significantly to trigger the right swipe exit function, thereby reducing the probability of misoperation. For example, in a game scenario, the speed threshold can be set to V _threshold = 500 px / s, distance threshold is D _threshold = 200 px. In low-dynamic scenarios (such as reading or static browsing): the system lowers the speed and distance thresholds so that users can trigger exit actions with slower, smaller swipes. For example, in a reading scenario, the speed threshold can be lowered to V _threshold = 200 px / s, distance threshold is D _threshold= 50 px, ensuring that slight sliding can respond quickly. If the sliding speed and distance both meet the set standards, the system will identify it as a valid right sliding gesture.
[0128] (3) Trigger right swipe exit: The system calls the object management function in the LVGL library (such as lv_scr_load() or lv_obj_clean()) through the internal touch interface to switch interfaces or clear pages. Depending on the application scenario and user operation requirements, right swipe exit can trigger returning to the previous interface, closing the current application, or performing other user-defined exit operations. To enhance the user experience, when the system triggers the right swipe exit, it can also call the tactile feedback module to prompt the user of the success of the operation through vibration feedback or sliding animation. This mechanism is fed back in real time by the path integrity detection module to ensure that the operation process is intuitive and smooth. Specifically, when the right swipe exit function is successfully triggered, the system will activate the tactile feedback mechanism, including providing a short vibration feedback (duration 50 milliseconds) accompanied by a 0.3 second animation effect to prompt the user that the operation is successful and enhance the user experience.
[0129] In summary, the path integrity detection and right-slide exit trigger provided by this embodiment are based on the data captured by the aforementioned touch event, and the collected sliding path is used as the basis for path integrity detection. By detecting the continuity of the collection points and the offset of the trajectory, it is ensured that the sliding gesture meets the trajectory requirements of the right-slide exit. With the help of the fitted multi-layer curve, the smoothness and continuity of the sliding trajectory are judged to ensure that the direction and shape of the sliding gesture meet the preset right-slide operation standards. And through the dynamic adjustment of the sliding speed and pressure, the sensitivity control of the right-slide exit is further optimized to ensure the accuracy and stability of gesture recognition. In addition, the right-slide exit trigger condition will be dynamically adjusted according to the current scene. For example, in the game or video playback scene, the trigger threshold is high, while in the reading scene, the system will lower the trigger threshold of the sliding distance to ensure the accurate response of the sliding exit operation. Through the path integrity detection and right-slide exit triggering steps, the present invention realizes the accurate judgment and execution of the right-slide exit function, ensures a smooth operation process, and avoids the bad experience caused by misjudgment or invalid operation.
[0130] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described 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.
[0131] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for implementing a right-swipe exit function based on touch coordinate calculation, characterized in that: The following steps are involved: Step 1: Touch event capture and multi-point acquisition, including: real-time capture of the user's touch track points and adjustment of the sampling frequency according to the sliding speed; Step 2: multi-layer curve fitting analysis, including: adjusting the number of segments of the trajectory according to the complexity of the sliding trajectory obtained by fitting, and the basis for adjustment is the change in the curvature, acceleration and sliding speed of the sliding trajectory; Step 3: calculating the correlation between pressure and speed, including: collecting the pressure value applied by the user during the sliding process in real time through the pressure sensor, and adjusting the sensitivity of gesture recognition in combination with the sliding speed of the touch point; Step 4: Dynamic scene adaptive adjustment; Step 4 includes the following operations: Use the application type detection module to identify the type of application currently running and provide application scenario information; According to the window status monitoring module, the window status of the application is monitored and adjusted based on the information provided by the application type detection module; The user input pattern recognition module identifies the sliding speed and pressure parameters and analyzes them in combination with the application type and window status; According to the scene parameter adjustment module, the trigger condition of sliding right to exit is adjusted according to the sliding speed and pressure parameters provided by the user input pattern recognition module; The scene switching management module responds to changes in the application scene or window state to adapt to the new operating state; Step 5: Path integrity detection and right swipe exit trigger.
2. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 1, characterized in that: The step 2 fits the sliding trajectory curve by the following formula: , Where Pi = (x i ,y i ,t i ) is the trajectory point, x is the horizontal coordinate, y is the vertical coordinate, and t is the progress of the sliding gesture trajectory in time.
3. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 2, characterized in that: The value range of t is 0≤t≤1.
4. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 2, characterized in that: The step 2 also includes calculating the number of segments of the fitting trajectory by using an adaptive dynamic segment fitting formula, the formula is: ; Among them, κ i is the curvature of the trajectory, a i is the acceleration, v i is the sliding speed, k1 is the reference coefficient, β is the curvature influence adjustment coefficient, γ is the acceleration influence adjustment coefficient, and δ is the speed influence adjustment coefficient.
5. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 1, characterized in that: The application type detection module increases the touch sampling frequency to 240 Hz when detecting a gaming scene, and reduces the touch sampling frequency to 60 Hz when detecting a reading scene.
6. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 1, characterized in that: The step 5 includes the following operations: Through path integrity detection, the continuity, direction and length of the sliding trajectory are determined; Adjust the triggering conditions for swiping right to exit based on the detected sliding speed, track length and direction; When the sliding track meets the adjusted trigger conditions, the right swipe to exit is triggered.
7. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 6, characterized in that: The path integrity detection includes analyzing the continuity of the touch track points, determining whether the sliding direction is within a predetermined horizontal angle range, and determining whether the track length reaches a preset threshold based on the sliding distance.
8. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 6, characterized in that: Triggering the right-swipe exit includes calling a tactile feedback module to prompt the user that the operation is successful through vibration or animation feedback.
9. The method for realizing the right-slide exit function based on touch coordinate calculation according to claim 6, characterized in that: Triggering right-swipe exit includes switching or clearing pages by calling a touch interface function.
Citation Information
Patent Citations
Touch panel sampling frequency adjusting device and method
CN104035608A
Touch screen sensitivity adjustment method and device
CN106775094A
Method and device for controlling touch display screen, touch display screen and electronic equipment
CN114286974A
Control method and system of touch display screen
CN117850653A
Touch control type regional operation method for display
CN118394237A
