Touch recognition method, device and computer readable medium

Through a touch recognition method that does not set a reference value and uses difference calculation and accumulated difference to determine the key status, it solves the problems of unrecognized key operations and loss of consecutive key presses in the existing technology, and achieves effective recognition of continuous key operations and user Improved experience.

CN118523765BActive Publication Date: 2024-10-08NANJING PRIME SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410990124.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-08
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Existing touch button technology can easily cause key operations to be unrecognized when the baseline value is updated. Keystroke recognition fails when the pressing speed is lower than the baseline value update speed. The slow reference change leads to the loss of continuous key operations, and the key cannot be pressed when powered on, which is a limitation. application conditions and user experience.

Method used

Using a touch recognition method that does not require setting a reference value, through the cumulative difference and minimum value mark initialization, the sampled data is used to calculate the difference, determine whether the difference data that is continuously greater than or equal to 0 exceeds the trigger threshold, update the button status, and set Release threshold to enable recognition of consecutive key presses.

Benefits of technology

It simplifies key touch recognition, avoids the loss of key operations, improves user experience, and enables multiple consecutive press operations without being limited by the base value update speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118523765B_ABST
    Figure CN118523765B_ABST
Patent Text Reader

Abstract

The present invention provides a touch recognition method, device and computer readable medium. The touch recognition method includes the following steps: a) initialization; b) data sampling of the sensing module at a preset sampling frequency; c) difference calculation of the sampled data. At time t, the difference data calculation method is: difference data ΔF t = This measurement value F t –Last measured value F t‑1 ; d) According to the above difference data ΔF t Determine whether the key is touched. If there are N consecutive difference data greater than or equal to 0 and the cumulative difference Sum obtained by summing the N difference data greater than or equal to 0 is greater than the trigger threshold, it means that the key is touched. Otherwise, it means that the key is not touched. This method simplifies the method of key touch recognition, optimizes the release threshold, and can realize continuous key operation, further improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of touch data processing technology, and in particular to a touch recognition method, device and computer-readable medium. Background Art

[0002] like Figure 1 As shown, existing touch button technologies, such as pressure / capacitive touch button technologies, perform pressure recognition by setting a reference value, a trigger threshold, and a follow threshold. The pressure / capacitance value when power is just turned on is used as the reference value, and the pressure measurement value / capacitance measurement value obtained subsequently is compared with the reference value (difference = measurement value - reference value). If the difference is greater than the trigger threshold, it is considered that a button touch exists. When the difference is lower than the follow threshold, the reference value will follow the measurement value through an algorithm to reduce the effects of creep caused by environmental changes.

[0003] This approach has the following problems:

[0004] 1. The benchmark value is the data that is updated regularly after filtering the measured data. If the benchmark value is updated synchronously with the pressing of a key, the latest data will be updated to the benchmark, causing the benchmark to increase abnormally and the difference value to decrease, resulting in the key operation not being recognized.

[0005] 2. When the pressing process is slow, if the pressing speed is lower than the update speed of the reference value, the reference value will always be updated to the measured value, and the difference between the two is 0, which also causes the key recognition to fail.

[0006] 3. Since the reference changes slowly, when the key is not completely released, the measured value may still exceed the trigger threshold after it decreases. In this case, the reference will no longer follow. If the measured value increases slowly at this time, the key operation will not be recognized. Especially in the case of continuous touch operation, after the key is released, it is often not completely released but the next key is pressed. The measured value often does not fall below the following threshold, making it difficult to achieve multiple continuous press operations.

[0007] 4. Benchmark setting problem: since the benchmark is recorded only at power-on / startup, it cannot be pressed at power-on, which limits the application conditions of the technology and affects the user experience. Summary of the invention

[0008] The purpose of the present invention is to provide a touch recognition method, which simplifies the method of key touch recognition, does not need to set a reference value, optimizes the release threshold, and can realize continuous key operation, avoid the loss of continuous key operation, and further improve the user experience.

[0009] To achieve the above object, the present invention proposes a touch recognition method, which can be applied to recognize the button touch of an electric toothbrush, comprising the following steps:

[0010] a) Initialization, set the cumulative difference and minimum value mark to 0;

[0011] b) sampling the data of the key sensing module at a preset sampling frequency;

[0012] c) Perform difference calculation on the sampled data. At time t, the difference data calculation method is: difference data ΔF t = This measurement value F t –Last measured value F t-1 ;

[0013] d) Based on the above difference data ΔF t Determine whether the button is touched. If there are N consecutive difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 , and the N difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 If the accumulated difference Sum obtained by summing up is greater than the trigger threshold, it indicates that the key is touched; otherwise, it indicates that the key is not touched.

[0014] Furthermore, in step d), if it is determined that the key is touched, the key touch state is set to touched, and the process returns to step b); otherwise, if the key is not touched, the accumulated difference is set to 0, and the process returns to step b).

[0015] Furthermore, in the step d), before returning to the step b), the following step is also included: e) temporarily storing the current measurement value as the last measurement value for the next difference data calculation.

[0016] Furthermore, in step d), if there are N consecutive difference data greater than or equal to 0, the following steps are also included:

[0017] f) Determine whether the difference data is greater than or equal to 0 for the first time. If the minimum value mark is 0, record the last measurement value as the Min value, record the current measurement value as the Max value, and set the minimum value mark to 1; otherwise, if the minimum value mark is 1, record the current measurement value as the Max value, and sum the current difference data with the aforementioned N-1 consecutive difference data greater than or equal to 0 to obtain the cumulative difference.

[0018] Furthermore, in step d), if the difference data is less than 0, the minimum value mark is set to 0 and the process returns to step b).

[0019] Furthermore, the step d) further comprises the following steps:

[0020] Step g), determine whether the current button state is touched, if not, proceed to step d);

[0021] Otherwise, proceed to step h) to determine whether to update the key state to the released state.

[0022] Further, the step h) is specifically as follows:

[0023] Determine whether the difference data is greater than or equal to 0. If so, update the current measurement value to the Max value, otherwise the Max value remains unchanged;

[0024] Determine whether the measured value is less than the key release threshold. If so, update the key state to the release state, clear the minimum value mark and the accumulated difference, otherwise return to step b).

[0025] Furthermore, the key release threshold is set as: (Max value + Min value) * calculation coefficient, and the calculation coefficient is preferably 0.5.

[0026] Furthermore, the sensing module is a pressure sensor or a capacitive sensor.

[0027] The present invention further proposes a touch recognition method for identifying the touch of a button of an electric toothbrush, comprising the following steps:

[0028] a) Initialization, set the cumulative difference and minimum value mark to 0;

[0029] b) sampling the data of the key sensing module at a preset sampling frequency;

[0030] c) Perform difference calculation on the sampled data. At time t, the difference data calculation method is: difference data ΔF t =Last measured value F t-1 - This measurement value F t ;

[0031] d) Based on the above difference data ΔF t Determine whether the button is touched. If there are N consecutive difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 , and the N difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 If the accumulated difference Sum obtained by summing up is greater than the trigger threshold, it indicates that the key is touched; otherwise, it indicates that the key is not touched.

[0032] To achieve the above object, the present invention further provides a touch recognition device, comprising:

[0033] A sensing module, used to receive external operations;

[0034] The data acquisition module collects data from the key sensing module according to a preset frequency;

[0035] The data processing module receives the data collected by the data collection module and calculates the difference data based on the data. t = This measurement value F t –Last measured value F t-1 , and determine whether there is a touch according to the difference data. If there are N consecutive difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 , and the N difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 If the accumulated difference Sum is greater than the trigger threshold, it means that the key is touched and a touch signal is sent; otherwise, it means that the key is not touched and a no touch signal is sent;

[0036] The output module receives the calculation result of the data processing module and outputs the calculation result.

[0037] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the above touch recognition method.

[0038] The present invention simplifies the method for key touch recognition, does not need to set a reference value, and prevents the situation where the key touch cannot be captured. Furthermore, multiple consecutive pressing operations can be implemented, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings are not intended to be drawn to scale. In the accompanying drawings, each identical or nearly identical component shown in each figure may be represented by the same reference numeral. For clarity, not every component is labeled in each figure. Embodiments of various aspects of the present invention will now be described by way of example and with reference to the accompanying drawings.

[0040] Figure 1 It is a schematic diagram of the force exerted on a key when it is pressed in the prior art.

[0041] Figure 2 FIG. 4 is a flow chart of a touch recognition method according to an embodiment of the present invention.

[0042] Figure 3 for Figure 2The specific flow chart for judging whether a button is triggered.

[0043] Figure 4 for Figure 2 The specific flow chart for judging whether a key is released.

[0044] Figure 5 FIG. 4 is a schematic diagram of modules of a touch recognition device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.

[0046] Various aspects of the present invention are described in this disclosure with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the present disclosure are not necessarily intended to include all aspects of the present invention. It should be understood that the various concepts and embodiments introduced above, as well as those described in more detail below, can be implemented in any of many ways, because the concepts and embodiments disclosed by the present invention are not limited to any implementation. In addition, some aspects disclosed by the present invention can be used alone or in any appropriate combination with other aspects disclosed by the present invention.

[0047] like Figure 2 FIG. 1 is a flow chart of a touch recognition method according to an embodiment of the present invention. Figure 2 It can be seen that the touch recognition method is used to recognize the touch of a key, and the specific steps are as follows:

[0048] First, initialize and set the cumulative difference and minimum value mark to 0;

[0049] The key sensing module is sampled at a preset sampling frequency;

[0050] The difference calculation is performed on the sampled data. At time t, the difference data calculation method is: difference data ΔF t = This measurement value F t –Last measured value F t-1 In this embodiment, taking the pressure sensing module as an example, the current pressure difference = current pressure value - last pressure value.

[0051] Next, the current state of the key is read to determine whether the key is currently in a touched state. If so, a step of determining whether the key is released is performed; if not, a process of determining whether the key is touched is performed.

[0052] Figure 3 for Figure 2 The specific flow chart for judging whether a button is touched is as follows: Figure 3 As shown, if the current state of the read button is not the touch state, then the difference data ΔF is determined.t Is it greater than or equal to 0? If not, keep the accumulated difference and Min mark as the initial value 0; if yes, further read whether the Min mark is 0. If yes, it means that the difference data is greater than or equal to 0 for the first time, record the current measurement value as the Max value, record the last measurement value as the Min value, and set the Min mark to 1. On the contrary, if the Min mark is not 0, but 1, it means that the difference data is not greater than or equal to 0 for the first time. The difference data greater than or equal to 0 this time is temporarily stored, and the current measurement value is recorded as the Max value. If there are N-1 consecutive difference data greater than or equal to 0 before the current moment t, the N difference data greater than or equal to 0 are summed to obtain the accumulated difference Sum. Then determine whether the accumulated difference Sum is greater than the set trigger threshold. If yes, it means that the button state needs to be updated to the touch state. Otherwise, the button maintains the current state, and the current measurement value is temporarily stored as the "last measurement value" when the difference data is calculated next time. The process of determining whether the button is touched is completed, and returns to the next cycle.

[0053] Figure 4 for Figure 2 A specific flow chart for judging whether a key is released. Figure 4 , determine whether the current button state is touched, if so, determine whether to update the button state to the released state. The specific process is as follows:

[0054] Determine whether the difference data is greater than or equal to zero. If not, proceed to the subsequent steps. If yes, record the current measurement value as the Max value and proceed to the subsequent steps.

[0055] Determine whether the measured value is less than the key release threshold. If so, record the key state as released, clear the hold count, minimum value mark, and accumulated difference, otherwise return.

[0056] During this period, the key release threshold is set to (Max value + Min value) * calculation coefficient, and the calculation coefficient is preferably 0.5, that is, the release threshold = (Max + Min) * 0.5.

[0057] In the above embodiment of the present invention, the sensing module is pressed in the positive direction, so the difference data is calculated according to the following formula ΔF t = This measurement value F t –Last measured value F t-1 In other embodiments, the sensing module may be subjected to reverse pressure, and the difference data is calculated according to the following formula: ΔF t = This measurement value F t-1 –Last measured value F t The remaining steps are similar to those in the above embodiment and will not be described in detail.

[0058] Figure 5 FIG. 1 is a schematic diagram of a module of a touch recognition device according to another embodiment of the present invention, comprising:

[0059] Sensing module, receiving external actions;

[0060] The data acquisition module collects data from the key sensing module according to a preset frequency;

[0061] The data processing module receives the data collected by the data collection module and calculates the difference data based on the data. t = This measurement value F t –Last measured value F t-1 , and determine whether there is a touch according to the difference data. If there are N consecutive difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 , and the N difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n If the accumulated difference Sum is greater than the trigger threshold, it means that the key is touched and a touch signal is sent; otherwise, it means that the key is not touched and a no touch signal is sent;

[0062] The output module receives the calculation result of the data processing module and outputs the calculation result.

[0063] In this embodiment, the sensing module can be a strain gauge, a MEMS bridge, a capacitor, etc., the data acquisition module can be an ADC, a TDC, a timer, etc., the data processing module can be a DSP, an MCU, etc., and the output module can be a GPIO or a communication port such as IIC, SPI, UART, etc. For people with general technical skills in this field, the specific configuration of the sensing module, the data acquisition module, the data processing module and the output module and the specific connection method between the modules belong to well-known technologies and will not be described in detail here.

[0064] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to perform the touch recognition method.

[0065] By observing and studying the key triggering process, the moment of pressing is very short, and the measured data is continuously mutated. The difference between the two measured data is greater than or equal to 0. Therefore, in the embodiment of the present invention, the difference data between the last measured value and the current measured value is used for judgment, and the difference data = the current measured value - the last measured value; if the difference data is greater than or equal to 0, it means that there is a possibility of key triggering, of course, it may also be a fluctuation; set a trigger threshold for the difference accumulation, and if there is a continuous difference greater than or equal to 0, and the difference accumulation is greater than the set trigger threshold, it is considered that there is a key trigger. In the calculation of the difference data, if any result is less than 0, the cumulative difference is cleared to 0.

[0066] When the difference data is greater than or equal to 0 for the first time, the last data value is recorded as the minimum value, and the current measurement value of the continuous difference data greater than or equal to 0 is recorded as the maximum value, and (Max value + Min value) * calculation coefficient is used as the release threshold of the key. That is, when the current measurement value is lower than the release threshold, it can be considered that the key is released, and the key status is updated to released.

[0067] The method of the present invention simplifies the method of key touch recognition, does not need to set a reference value, and prevents the situation where the key action cannot be captured. Furthermore, it can realize the operation of multiple consecutive presses, thereby improving the user experience.

[0068] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.

Claims

1. A touch recognition method, suitable for identifying the touch of a button of an electric toothbrush, characterized in that: The following steps are involved: a) Initialization, set the cumulative difference and minimum value mark to 0; b) sampling the data of the key sensing module at a preset sampling frequency; c) Perform difference calculation on the sampled data. At time t, the difference data calculation method is: Difference data ΔF t = This measurement value F t –Last measured value F t-1 ; d) When the key is in a non-touch state, according to the difference data ΔF t Determine whether the button is touched: If there are N consecutive difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 , then the N difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 Perform a sum operation to obtain the cumulative difference Sum, and: If the accumulated difference Sum is greater than the set trigger threshold, it means that the key is touched, and the key touch state is set to touched; otherwise, the key maintains the current state; Wherein, in step d), the following steps are also included: e) Temporarily store the current measurement value as the previous measurement value for the next calculation of difference data; The calculation of the difference data at the current time t also includes the following steps: f) Determine whether the difference data is greater than or equal to 0 for the first time: Read the minimum value mark. If the minimum value mark is 0, it means that the difference data is greater than or equal to 0 for the first time. Then record the last measurement value as the Min value, record the current measurement value as the Max value, and set the minimum value mark to 1. Otherwise, if the minimum value mark is 1, it means that the difference data at the current time t is not greater than or equal to 0 for the first time. Then record the current measurement value as the Max value. Then calculate the cumulative difference Sum of N consecutive difference data greater than or equal to 0.

2. The touch recognition method according to claim 1, characterized in that: In the step d), if the difference data is less than 0, the minimum value mark is set to 0 and the process returns to step b).

3. The touch recognition method according to claim 1, characterized in that: The step d) also includes the following steps before: Step g), determine whether the current button state is touched, if not, proceed to step d); otherwise, proceed to step h), determine whether to update the button state to the released state.

4. The touch recognition method according to claim 3, characterized in that: The step h) is specifically as follows: Determine whether the difference data is greater than or equal to 0. If so, update the current measurement value to the Max value, otherwise the Max value remains unchanged; Determine whether the measured value is less than the key release threshold. If so, update the key state to the release state, clear the minimum value mark and the accumulated difference, otherwise return to step b).

5. The touch recognition method according to claim 4, characterized in that: The key release threshold is set as: (Max value + Min value) * calculation coefficient.

6. The touch recognition method according to claim 5, characterized in that: The calculation coefficient is set to 0.

5.

7. The touch recognition method according to claim 1, characterized in that: The sensing module is a pressure sensor or a capacitance sensor.

8. A touch recognition method for identifying the touch status of a button of an electric toothbrush, characterized in that: The following steps are involved: a) Initialization, set the cumulative difference and minimum value mark to 0; b) sampling the data of the key sensing module at a preset sampling frequency; c) Perform difference calculation on the sampled data. At time t, the difference data calculation method is: difference data ΔF t =Last measured value F t-1 - This measurement value F t ; d) When the key is in a non-touch state, according to the difference data ΔF t Determine whether the button is touched: If there are N consecutive difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 , then the N difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 Perform a sum operation to obtain the cumulative difference Sum, and: If the accumulated difference Sum is greater than the set trigger threshold, it means that the key is touched, and the key touch state is set to touched; otherwise, the key maintains the current state; Wherein, in step d), the following steps are also included: e) Temporarily store the current measurement value as the previous measurement value for the next calculation of difference data; The calculation of the difference data at the current time t also includes the following steps: f) Determine whether the difference data is greater than or equal to 0 for the first time: Read the minimum value mark. If the minimum value mark is 0, it means that the difference data is greater than or equal to 0 for the first time. Then record the last measurement value as the Min value, record the current measurement value as the Max value, and set the minimum value mark to 1. Otherwise, if the minimum value mark is 1, it means that the difference data at the current time t is not greater than or equal to 0 for the first time. Then record the current measurement value as the Max value. Then calculate the cumulative difference Sum of N consecutive difference data greater than or equal to 0.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the touch recognition method according to any one of claims 1 to 7.

10. A touch recognition device, characterized in that: include: A sensing module, used to receive external operations; The data acquisition module collects data from the key sensing module according to a preset frequency; The data processing module receives the data collected by the data collection module and calculates the difference data based on the data. t = This measurement value F t –Last measured value F t-1 , and judging whether there is a touch according to the difference data, specifically as follows: when the key is in a non-touch state, according to the difference data ΔF t Determine whether the button is touched: If there are N consecutive difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 , then the N difference data ΔF greater than or equal to 0 t , ΔF t+1 ...ΔF t+n-1 Perform a sum operation to obtain a cumulative difference value Sum, and if the cumulative difference value Sum is greater than a set trigger threshold, it indicates that the key is touched, and the key touch state is set to touched; otherwise, it indicates that the key is not touched, the key maintains the current state, and the current measurement value is temporarily stored as the previous measurement value when the difference data is calculated next time; An output module receives the calculation result of the data processing module and outputs the calculation result; The data processing module is further configured to calculate the difference data ΔF obtained at the current time t. t , further determine whether the difference data is greater than or equal to 0 for the first time: Read the minimum value mark. If the minimum value mark is 0, it means that the difference data is greater than or equal to 0 for the first time. Then record the last measurement value as the Min value, record the current measurement value as the Max value, and set the minimum value mark to 1. Otherwise, if the minimum value mark is 1, it means that the difference data at the current time t is not greater than or equal to 0 for the first time. Then record the current measurement value as the Max value. Then calculate the cumulative difference Sum of N consecutive difference data greater than or equal to 0.