Touch detection method and device, chip, electronic device and storage medium
By performing multiple scans and filtering of capacitive touch buttons, the problem of insufficient touch detection accuracy and anti-interference ability in the prior art is solved, and higher detection accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202210590167.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2042-05-26
AI Technical Summary
When touch detection is performed by existing capacitive touch buttons, due to different circuit design and peripheral environment, the counting accuracy and efficiency decrease, especially under strong interference, which is easily triggered by mistake.
By controlling the touch key module to scan the keys multiple times, obtain the scan count values, and filter these values to determine the number of abnormal filtering times. If the number exceeds the preset number, filter again until the touch operation is confirmed.
It improves the accuracy and anti-interference ability of touch button detection, reduces the situation of false triggering, and enhances the reliability of touch judgment.
Smart Images

Figure CN114967976B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of touch detection technology, and in particular to a touch detection method and device, a chip, an electronic device, and a storage medium. Background Art
[0002] At present, capacitive touch buttons are superior to traditional mechanical buttons in terms of appearance and service life. Therefore, capacitive touch buttons are widely used in fields including home appliances, consumer electronics, industrial control and mobile devices. However, when performing touch button detection, due to different circuit designs and the peripheral environments in which the touch buttons are located, the accuracy and efficiency of touch button counting will decrease to varying degrees. Especially when the touch buttons are susceptible to strong external interference, false triggering is more likely to occur. Summary of the invention
[0003] According to one aspect of the present disclosure, a touch detection method is provided, the method comprising:
[0004] Control the touch key module to perform touch key scans on one or more keys N times respectively, and obtain a scan count value when each touch key scan of each key is completed, wherein the touch key module obtains a detection result of a touch operation on the key according to the charge and discharge times of the charge and discharge unit, and the scan count value is determined according to the charge and discharge times corresponding to the key when the scan is completed, and N is a positive integer;
[0005] Filter the scan count value of each touch key scan of each key to obtain the filter value corresponding to each touch key scan;
[0006] Determine the first abnormal filtering times of each key, if the first abnormal filtering times is greater than the first preset number, filter the scan count value of the Nth touch key scan again, wherein the key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold;
[0007] If the filtered value after the second filtering is greater than the preset scan count value, it is determined that the touch operation of the key is detected.
[0008] In a possible implementation, the method further includes:
[0009] Determine the second abnormal filtering times for each key. If the second abnormal filtering times is greater than the second preset number, filter the scan count value of the Nth touch key scan again. The key corresponding to the second abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the first preset coefficient and the preset touch threshold, and the difference is greater than the product of the second preset coefficient and the preset touch threshold, wherein the second preset coefficient is less than the first preset coefficient, and the second preset number is less than the first preset number.
[0010] In one possible implementation, the method includes:
[0011] Determine the third abnormal filtering times for each key. If the third abnormal filtering times is greater than the third preset number, filter the scan count value of the Nth touch key scan again. The key corresponding to the third abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the second preset coefficient and the preset touch threshold, and the difference is greater than the product of the third preset coefficient and the preset touch threshold, wherein the third preset coefficient is less than the second preset coefficient, and the third preset number is less than the second preset number.
[0012] In a possible implementation, the method further includes:
[0013] If the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan are both greater than the corresponding filter values or are both less than the corresponding filter values, it is determined that the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan have the same change trend.
[0014] In a possible implementation, the touch key module includes a control unit, a plurality of detection channels, a comparison unit, a voltage generating unit, a first capacitor and a first switch, each detection channel corresponds to each touch key and is used for touch detection, wherein the positive input end of the comparison unit is connected to each detection channel, the first end of the first capacitor, and the first end of the first switch, and the second end of the first capacitor and the second end of the first switch are grounded.
[0015] The first output terminal of the voltage generating unit is connected to the negative input terminal of the comparing unit, and is used to sequentially output a plurality of reference voltages, wherein each reference voltage corresponds to each detection channel;
[0016] The second output end of the voltage generating unit is connected to the power supply end of each detection channel, and is used to sequentially output a plurality of charging voltages, wherein each charging voltage corresponds to each detection channel;
[0017] The control unit is connected to each detection channel and is used to perform charging and charge transfer according to the set charging time and charge transfer time respectively;
[0018] The method further comprises:
[0019] receiving control information, and determining a charging duration and a charge transfer duration of each detection channel according to the control information, wherein the charge transfer duration is shorter than the charging duration;
[0020] Each detection channel is charged and discharged in turn according to the charging time and charge transfer time of each detection channel.
[0021] In a possible implementation, each detection channel includes a button, a second switch, and a third switch, wherein:
[0022] The first end of the second switch is connected to the second output end of the voltage generating unit, and the second end of the second switch is connected to the first end of the third switch and the button.
[0023] The second end of the third switch is connected to the positive input end of the comparison unit, the first end of the first switch and the first end of the first capacitor.
[0024] Wherein, the method further comprises:
[0025] Step 1: Control the first switch to be turned on, and control each third switch and each second switch to be turned off, so as to release the charge on the first capacitor;
[0026] Step 2: Control the second switches of the detection channel corresponding to the first button to be turned on for the charging time, and control the first switch and each third switch to be turned off, so as to charge the capacitance of the button of the detection channel corresponding to the first button to the target voltage;
[0027] Step 3, controlling the third switch of the detection channel corresponding to the first button to turn on the charge transfer duration, moving the charge on the capacitor corresponding to the first button to the first capacitor to charge the first capacitor, and controlling the third switches of other detection channels, the first switch and each second switch to be turned off;
[0028] Repeat steps 2 and 3 until the voltage at the positive input terminal of the comparison unit is greater than the reference voltage at the negative input terminal, and determine the scan count value of the detection channel corresponding to the first key according to the number of repetitions of steps 2 and 3.
[0029] According to one aspect of the present disclosure, a touch detection device is provided, the device comprising:
[0030] A control module, used to control the touch key module to perform N touch key scans on one or more keys respectively, and obtain a scan count value when each touch key scan of each key is completed, wherein the touch key module obtains a detection result of a touch operation on a key according to the charge and discharge times of the charge and discharge unit, and the scan count value is determined according to the charge and discharge times corresponding to the key when the scan is completed, and N is a positive integer;
[0031] A first filtering module is used to filter the scan count value of each touch key scan of each key to obtain a filter value;
[0032] The second filtering module is used to determine the first abnormal filtering times of each key. If the first abnormal filtering times is greater than the first preset number, the scan count value of the Nth touch key scan is filtered again. The key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold.
[0033] The detection module is used to: if the filtered value after re-filtering is greater than a preset scan count value, determine that a touch operation of the key is detected.
[0034] According to one aspect of the present disclosure, a touch detection chip is provided, and the chip includes the touch detection device.
[0035] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0036] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.
[0037] In the embodiment of the present disclosure, the touch key module is controlled to perform N touch key scans on one or more keys respectively, and the scan count value of each touch key scan of each key is obtained when the scan is completed, and the scan count value of each touch key scan of each key is filtered to obtain the filter value corresponding to each touch key scan, and the first abnormal filtering times of each key is determined. If the first abnormal filtering times is greater than the first preset number, the scan count value of the Nth touch key scan is filtered again, wherein the key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold value. If the filtered value after filtering again is greater than the preset scan count value, it is determined that the touch operation of the key is detected. In this way, the embodiment of the present disclosure can resist strong interference, effectively prevent the key from being triggered by mistake, and increase the accuracy of touch judgment of the touch key module.
[0038] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0040] Figure 1 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0041] Figure 2 A schematic diagram of a touch key module according to an embodiment of the present disclosure is shown.
[0042] Figure 3 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0043] Figure 4a and Figure 4b Schematic diagrams of charging and discharging waveforms in related technologies and embodiments of the present disclosure are shown respectively.
[0044] Figure 5 A touch detection device according to an embodiment of the present disclosure is shown.
[0045] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0046] Figure 7A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0047] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0048] In the description of the present disclosure, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present disclosure.
[0049] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0050] In the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.
[0051] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0052] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0053] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0054] See also Figure 1 , Figure 1 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0055] like Figure 1 As shown, the method includes:
[0056] Step S11, controlling the touch key module to perform N touch key scans on one or more keys respectively, and obtaining a scan count value when each touch key scan of each key is completed, wherein the touch key module obtains a detection result of a touch operation on a key according to the charge and discharge times of the charge and discharge unit, and the scan count value is determined according to the charge and discharge times corresponding to the key when the scan is completed, and N is a positive integer;
[0057] Step S12, filtering the scan count value of each touch key scan of each key to obtain a filter value corresponding to each touch key scan;
[0058] Step S13, determining the first abnormal filtering times of each key, if the first abnormal filtering times is greater than the first preset number, filtering the scan count value of the Nth touch key scan again, wherein the key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold;
[0059] Step S14: If the filtered value after the second filtering is greater than the preset scan count value, it is determined that a touch operation of the key is detected.
[0060] In the embodiment of the present disclosure, the touch key module is controlled to perform N touch key scans on one or more keys respectively, and the scan count value of each touch key scan of each key is obtained when the scan is completed, and the scan count value of each touch key scan of each key is filtered to obtain the filter value corresponding to each touch key scan, and the first abnormal filtering times of each key is determined. If the first abnormal filtering times is greater than the first preset number, the scan count value of the Nth touch key scan is filtered again, wherein the key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold value. If the filtered value after filtering again is greater than the preset scan count value, it is determined that the touch operation of the key is detected. In this way, the embodiment of the present disclosure can resist strong interference, effectively prevent the key from being triggered by mistake, and increase the accuracy of touch judgment of the touch key module.
[0061] The embodiment of the present disclosure does not limit the specific size of N, and those skilled in the art can set it according to actual conditions and needs. When determining the number of abnormal filtering times, the embodiment of the present disclosure can adopt a cumulative counting method. For example, if N is 4, the scan count values and filter values corresponding to the 1st to 4th touch key scans can be obtained. If the difference between the scan count value of the 2nd touch key scan and the corresponding filter value is not 0, the scan count value of the 2nd touch key scan has the same change trend as the scan count value of the 1st touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold, the number of abnormal filtering times is increased by 1; if the difference between the scan count value of the 3rd touch key scan and the corresponding filter value is not 0, the scan count value of the 4th ... If the scan count value of the 3rd touch key scan has the same change trend as the scan count value of the 2nd touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold, the number of abnormal filtering times is increased by 1; if the difference between the scan count value of the 4th touch key scan and the corresponding filter value is not 0, the scan count value of the 4th touch key scan has the same change trend as the scan count value of the 3rd touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold, the number of abnormal filtering times is increased by 1. In this case, the first abnormal filtering number corresponding to the key in the 4 touch key scans is 3. Assuming the first preset number is 2, the scan count value of the 4th touch key scan is filtered again.
[0062] The touch detection method according to the embodiment of the present disclosure may be executed by a processing component or applied in an electronic device including the processing component.
[0063] In one example, the processing component includes but is not limited to a separate processor, or a discrete component, or a combination of a processor and a discrete component. The processor may include a controller having an execution instruction function in an electronic device, and the processor may be implemented in any appropriate manner, for example, by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components. Inside the processor, the executable instructions may be executed by hardware circuits such as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers.
[0064] In one example, the electronic device may include a terminal and a server. The terminal is also called a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. It is a device that provides voice and / or data connectivity to a user, or a device that provides specific functions, such as a handheld device with a wireless connection function, a vehicle-mounted device, etc. At present, some examples of terminals are: mobile phones, tablet computers, laptop computers, PDAs, mobile Internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control (Industrial Control), wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids (Smart Grid), wireless terminals in transportation safety (Transportation Safety), wireless terminals in smart cities (Smart City), wireless terminals in smart homes (Smart Home), wireless terminals in Internet of Vehicles, home electronic devices, etc.
[0065] The touch key scanning in the embodiment of the present disclosure may be that the touch key module scans each key sequentially or in parallel to obtain the scan count value when each key is scanned. Exemplarily, the sequential scan may also be called a polling scan, for example, executing from the first key, the second key to the Nth key may be regarded as completing one scan (N≥1 and is an integer, determined by the user's choice), and in the scanning process for each key, the charging, discharging, comparison, and counting operations for the key are performed, as exemplarily described below.
[0066] In a possible implementation, the touch key module of the embodiment of the present disclosure may include a charge and discharge unit (also referred to as a charge transfer unit), a comparison unit, and a counting unit. In the scanning of each key, the corresponding key is powered on, and the charge and discharge unit is charged and discharged multiple times, and the number of charge and discharge times of the charge and discharge unit is counted by the counting unit until the voltage of the energy storage capacitor in the charge and discharge unit reaches the reference voltage, and the count value in the counting unit is obtained as the scan count value, and the scan ends. Further, the touch key module may include a judgment unit, and the judgment unit may include a comparator. By comparing the scan count value obtained by performing the touch key scan and the preset scan count value, it can be determined whether the key is touched. The embodiment of the present disclosure does not limit the specific implementation of the touch key module, and does not limit the specific implementation of the charge and discharge unit, the comparison unit, the counting unit, and the judgment unit. The wake-up method of the embodiment of the present disclosure is applicable to various types of touch key modules, as long as it is a touch key module that performs touch judgment according to the principle introduced above. The following is an exemplary introduction to the possible implementation of the charge and discharge unit and the comparison unit of the touch key module.
[0067] See also Figure 2 , Figure 2 A schematic diagram of a touch key module according to an embodiment of the present disclosure is shown.
[0068] like Figure 2 As shown, the touch key module includes a plurality of detection channels (for example, N, where N is an integer greater than 1), a comparison unit 10 (including a comparator Cmp), a voltage generating unit 20, a first capacitor C1 and a first switch S W1 Each detection channel corresponds to each touch button and is used for touch detection. For example, each detection channel includes a touch button (corresponding to the button capacitance C TK1 , C TK2 ,…,C TKm ), the second switch (S W00 , S W01 ,…,S W0m )、The third switch (S W10 , S W11 ,…,S W1m ),in,
[0069] The positive input terminal of the comparison unit 10 (which may include a comparator Cmp) is connected to each detection channel (such as detection channels 1 to N), the first terminal of the first capacitor C1, the first switch S W1 a first end of the first capacitor C1 and a second end of the first switch S W1 The second end is grounded,
[0070] The first output terminal of the voltage generating unit 20 is connected to the negative input terminal of the comparing unit 10, and is used to sequentially output a plurality of reference voltages (such as V REFm , m is a positive integer), wherein each reference voltage corresponds to each detection channel;
[0071] The second output end of the voltage generating unit 20 is connected to the power supply end of each detection channel (the first end of each second switch), and is used to sequentially output a plurality of charging voltages, wherein each charging voltage corresponds to each detection channel, the second end of the second switch is connected to the first end of the third switch and the touch key, and the second end of the third switch is connected to the positive input end of the comparison unit Cmp, the first switch S W1 and a first end of the first capacitor C1.
[0072] The above introduction to the touch detection module is exemplary and should not be regarded as limiting the embodiments of the present disclosure.
[0073] Below Figure 2 The circuit structure shown is an exemplary introduction to the touch key scanning process of the touch key module, and the exemplary introduction is made by taking detection channel 1 as an example.
[0074] The first step is to turn on the first switch S W1 , disconnect the third switch S W10 , the second switch S W00 , release all the charges on the first capacitor C1, and then V P The voltage is 0;
[0075] The second step is to turn on the second switch S W00 , disconnect the third switch S W10 , the first switch S W1 , for capacitor C TK1 Charge to voltage VOP;
[0076] Step 3: Turn on the third switch S W10 , turn off the second switch S W00 , the first switch S W1 , the capacitor C TK1 The charge on S W10 Move to capacitor C1, now VP The voltage is raised;
[0077] Repeat the second and third steps of the charging and discharging process (also called charging and charge transfer process) until V P The voltage is greater than the reference voltage V REF , COMP_OUT becomes high, at this time, the number of charge and discharge times N (the count value when there is no touch) repeated in steps 2 and 3 in the counting unit is obtained; when a touch occurs (such as when the hand touches the detection button), it is equivalent to the capacitance C of the hand P (such as C P1 ) and the capacitance C of the touch button TK In parallel, the capacitance becomes larger, and the scan count is performed according to the above touch button scanning process to obtain the number of times M that steps two and three are repeated when a touch occurs. When the number N minus M is greater than a certain amount, the circuit detects a touch button.
[0078] Of course, the above introduction is exemplary and should not be regarded as a limitation on the embodiments of the present disclosure. The embodiments of the present disclosure do not limit the specific implementation method of the touch button scanning process. The embodiments of the present disclosure can change the above charging and discharging units, and accordingly, can also adaptively change the touch button scanning process.
[0079] The disclosed embodiment does not limit the number of touch key scans performed by the touch key module on the keys, and those skilled in the art can set it according to actual conditions and needs.
[0080] The disclosed embodiment filters the scan count values of each touch key scan of each key in step S12 to obtain the filter values corresponding to each touch key scan. The specific implementation method is not limited. Those skilled in the art can implement it by using the filtering method in the related technology. Exemplarily, the "filtering" can include a variety of data processing methods to smooth the scan count values, thereby reducing the fluctuation range of the data. For example, the scan count values obtained from one touch key scan can be averaged or smoothed in other ways.
[0081] The embodiments of the present disclosure do not limit the specific sizes of the first preset number and the first preset coefficient, and those skilled in the art may set them according to actual conditions and needs.
[0082] The disclosed embodiment does not limit the filtering method for re-filtering the scan count value of the Nth touch key scan in step S13. By way of example, the filtering method for re-filtering may be the same as the filtering method in step S12. In this way, the disclosed embodiment can reduce the computational complexity and computational cost. By way of example, the filtering method for re-filtering may also be different from the filtering method in step S12. In this way, the disclosed embodiment can further reduce noise interference and improve data accuracy by filtering the scan count value using different filtering methods.
[0083] See also Figure 3 , Figure 3 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0084] In a possible implementation, Figure 3 As shown, the method may also include:
[0085] Step S15, determining the second abnormal filtering times for each key, if the second abnormal filtering times is greater than the second preset number, filtering the scan count value of the Nth touch key scan again, the key corresponding to the second abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the first preset coefficient and the preset touch threshold, and the difference is greater than the product of the second preset coefficient and the preset touch threshold, wherein the second preset coefficient is less than the first preset coefficient, and the second preset number is less than the first preset number.
[0086] The embodiments of the present disclosure do not limit the specific sizes of the second preset number and the second preset coefficient, and those skilled in the art may set them according to actual conditions and needs.
[0087] The disclosed embodiment sets a second preset number and determines the second abnormal filtering times for each key. If the second abnormal filtering times is greater than the second preset number, the scan count value of the Nth touch key scan is filtered again, which can further improve the accuracy of the scan count value, improve the anti-interference ability of the touch key module, and prevent the touch key from being triggered by mistake.
[0088] In a possible implementation, Figure 3 As shown, the method may include:
[0089] Step S16, determining the third abnormal filtering times of each key, if the third abnormal filtering times is greater than the third preset number, filtering the scan count value of the Nth touch key scan again, the key corresponding to the third abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the second preset coefficient and the preset touch threshold, and the difference is greater than the product of the third preset coefficient and the preset touch threshold, wherein the third preset coefficient is less than the second preset coefficient, and the third preset number is less than the second preset number.
[0090] The embodiments of the present disclosure do not limit the specific sizes of the third preset number and the third preset coefficient, and those skilled in the art may set them according to actual conditions and needs.
[0091] The disclosed embodiment sets a third preset number and determines the third abnormal filtering times for each key. If the third abnormal filtering times is greater than the third preset number, the scan count value of the Nth touch key scan is filtered again, which can further improve the accuracy of the scan count value, improve the anti-interference ability of the touch key module, and prevent the touch key from being triggered by mistake.
[0092] The disclosed embodiment determines the first abnormal filtering times, the second abnormal filtering times, and the third abnormal filtering times of each key in turn through the above method, and judges the ranges of the first abnormal filtering times, the second abnormal filtering times, and the third abnormal filtering times in turn. If the first abnormal filtering times is greater than the first preset number, the scan count value of the Nth touch key scan is filtered again, wherein the key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold; if the second abnormal filtering times is greater than the second preset number, the scan count value of the Nth touch key scan is filtered again, wherein the key corresponding to the second abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold; The scan count value of the scan is the same as the scan count value of the N-1 touch key scan, the difference is less than or equal to the product of the first preset coefficient and the preset touch threshold, and the difference is greater than the product of the second preset coefficient and the preset touch threshold, wherein the second preset coefficient is less than the first preset coefficient, and the second preset number is less than the first preset number; if the third abnormal filtering number is greater than the third preset number, the scan count value of the N-1 touch key scan is filtered again, and the key corresponding to the third abnormal filtering number satisfies: the difference between the scan count value of the N-1 touch key scan and the corresponding filter value is not 0, the scan count value of the N-1 touch key scan has the same change trend, the difference is less than or equal to the product of the second preset coefficient and the preset touch threshold, and the difference is greater than the product of the third preset coefficient and the preset touch threshold, wherein the third preset coefficient is less than the second preset coefficient, and the third preset number is less than the second preset number. In this way, the embodiment of the present disclosure can perform filtering processing in different situations with different abnormal filtering times, thereby improving flexibility and adaptability.
[0093] Of course, for different situations corresponding to the first abnormal filtering number, the second abnormal filtering number, and the third abnormal filtering number, the method of "filtering again" may be different, or the filtering method may be the same, but the filtering effect may be set to be different. For example, the first filtering coefficient, the second filtering coefficient, and the third filtering coefficient may be set respectively (the first filtering coefficient> the second filtering coefficient> the third filtering coefficient). Different filtering coefficients correspond to different filtering levels (or filtering strengths). The larger the filtering coefficient, the larger the corresponding filtering level. The larger the filtering level, the more stable the data and the smaller the fluctuation.
[0094] Exemplarily, the first preset coefficient, the second preset coefficient, and the third preset coefficient can all be integers between 0 and 15, preferably, can be integers between 0 and 10. Of course, the embodiments of the present disclosure do not limit the specific sizes of the first preset coefficient, the second preset coefficient, and the third preset coefficient, and those skilled in the art can set them according to actual conditions and needs. Exemplarily, the first preset coefficient, the second preset coefficient, and the third preset coefficient can correspond to the finger threshold amplitude, and different users and different combinations of touch key modules can have different finger threshold amplitudes.
[0095] Exemplarily, for the situations where the first abnormal filtering number is less than or equal to the first preset number, the second abnormal filtering number is less than or equal to the second preset number, the third abnormal filtering number is less than or equal to the third preset number, the difference between the scan count value of the Nth touch key scan and the corresponding filter value is 0, and the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan have different change trends, the embodiments of the present disclosure can determine the scan count value obtained by the current touch key scan. In these situations, the embodiments of the present disclosure can clear the existing count of the abnormal filtering number and restart the touch key scan.
[0096] In a possible implementation, the method may further include:
[0097] If the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan are both greater than the corresponding filter values or are both less than the corresponding filter values, it is determined that the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan have the same change trend.
[0098] The disclosed embodiment can determine the changing trends of the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan by judging the size relationships between the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan and the corresponding filter values, and when it is determined that the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan are both respectively greater than the corresponding filter values or both respectively less than the corresponding filter values, it can be determined that the changing trends of the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan are the same; otherwise, it can be determined that the changing trends of the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan are different.
[0099] In a possible implementation, Figure 2As shown, the touch key module may further include a control unit 30, the control unit 30 is connected to each detection channel, and is used to perform charging and charge transfer according to the set charging time and charge transfer time;
[0100] The method may further comprise:
[0101] receiving control information, and determining a charging duration and a charge transfer duration of each detection channel according to the control information, wherein the charge transfer duration is shorter than the charging duration;
[0102] Each detection channel is charged and discharged in turn according to the charging time and charge transfer time of each detection channel.
[0103] Through the above method, the embodiment of the present disclosure can receive control information, and determine the charging time and charge transfer time of each detection channel according to the control information, and the charge transfer time is less than the charging time; each detection channel is charged and discharged in turn according to the charging time and charge transfer time of each detection channel, and by setting the charging time and charge transfer time respectively, the working efficiency of the touch button module can be effectively improved.
[0104] The present disclosure does not limit the specific lengths of the charging time and the charge transfer time, and those skilled in the art can set them according to actual conditions and needs. For example, the ratio of the charging time and the charge transfer time (the duty cycle of the switch control signal) can be 2:1.
[0105] In a possible implementation, Figure 2 As shown, taking detection channel 1 as an example, the method may further include:
[0106] Step 1: Control the first switch S W1 Turning on, controlling each third switch and each second switch to be turned off, and releasing the charge on the first capacitor C1;
[0107] Step 2: Control the second switch S of the detection channel corresponding to the first button W00 The first switch S is turned on for the charging time and controls W1 and each third switch is disconnected, the capacitance C of the key of the detection channel corresponding to the first key is TK1 Charge to target voltage;
[0108] Step 3: Control the third switch S of the detection channel corresponding to the first button W10 The charge transfer time is turned on to transfer the charge on the capacitor corresponding to the first button to the first capacitor C1 to charge the first capacitor C1 and control the third switch and the first switch S of other detection channels. W1 and each second switch is disconnected;
[0109] Repeat steps 2 and 3 until the voltage at the positive input terminal of the comparison unit is greater than the reference voltage at the negative input terminal, and determine the scan count value of the detection channel corresponding to the first key according to the number of repetitions of steps 2 and 3.
[0110] Exemplarily, the disclosed embodiment can divide the charging time and charge transfer time of the touch key capacitor into 16 or other number of gears, which are 1 to 16 times the clock time of the touch key module, respectively. The clock time of the touch key comes from the 1-128 frequency division of the system clock HCLK. For example, the highest HCLK is 48 MHz without frequency division and the lowest is 32 kHz with 512 frequency division. The minimum duration can be 1÷48×1us≈0.021us, and the maximum duration can be 1÷32×512×128×16ms≈32768ms. Therefore, the charging time and charge transfer time of the touch key range from 0.021us to 32.768s. The user can select the most suitable touch key time and charge transfer time according to the actual external touch key circuit to improve the working efficiency of the touch key. Using this method, the touch key can complete a sampling more efficiently.
[0111] See also Figure 4a and Figure 4b , Figure 4a and Figure 4b Schematic diagrams of charging and discharging waveforms in related technologies and embodiments of the present disclosure are shown respectively.
[0112] In one example, if Figure 4a As shown, in the related art, the charging time is the same as the charge transfer time. Assuming that both are 2T, it takes 12T to charge and discharge three times (charging and charge transfer three times); Figure 4b As shown, the embodiment of the present disclosure sets the charging time and the charge transfer time to be different, and sets the charging time to be longer than the charge transfer time. Assuming that the charging time is 2T and the charge transfer time is 1T, it takes 12T to charge and discharge 4 times. It can be seen that within the same time, by adjusting the charging time and the charge transfer time of the touch button and setting the charging time to be longer than the charge transfer time, the number of charge and discharge times of the touch button can be increased, thereby ultimately improving the working efficiency of the touch button.
[0113] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0114] In addition, the present disclosure also provides a touch detection device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any touch detection method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0115] See also Figure 5 , Figure 5 A touch detection device according to an embodiment of the present disclosure is shown.
[0116] like Figure 5 As shown, the device comprises:
[0117] The control module 60 is used to control the touch key module to perform N touch key scans on one or more keys respectively, and obtain a scan count value when each touch key scan of each key is completed, wherein the touch key module obtains a detection result of a touch operation on the key according to the charge and discharge times of the charge and discharge unit, and the scan count value is determined according to the charge and discharge times corresponding to the key when the scan is completed, and N is a positive integer;
[0118] A first filtering module 70 is used to filter the scan count value of each touch key scan of each key to obtain a filter value;
[0119] The second filtering module 80 is used to determine the first abnormal filtering times of each key. If the first abnormal filtering times is greater than the first preset number, the scan count value of the Nth touch key scan is filtered again. The key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold.
[0120] The detection module 90 is used to: if the filtered value after the second filtering is greater than the preset scan count value, determine that a touch operation of the key is detected.
[0121] In the embodiment of the present disclosure, the touch key module is controlled to perform N touch key scans on one or more keys respectively, and the scan count value of each touch key scan of each key is obtained when the scan is completed, and the scan count value of each touch key scan of each key is filtered to obtain the filter value corresponding to each touch key scan, and the first abnormal filtering times of each key is determined. If the first abnormal filtering times is greater than the first preset number, the scan count value of the Nth touch key scan is filtered again, wherein the key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold value. If the filtered value after filtering again is greater than the preset scan count value, it is determined that the touch operation of the key is detected. In this way, the embodiment of the present disclosure can resist strong interference, effectively prevent the key from being triggered by mistake, and increase the accuracy of touch judgment of the touch key module.
[0122] In a possible implementation, the device further includes:
[0123] The third filtering module is used to determine the second abnormal filtering times of each key. If the second abnormal filtering times is greater than the second preset number, the scan count value of the Nth touch key scan is filtered again. The key corresponding to the second abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the first preset coefficient and the preset touch threshold, and the difference is greater than the product of the second preset coefficient and the preset touch threshold, wherein the second preset coefficient is less than the first preset coefficient, and the second preset number is less than the first preset number.
[0124] In a possible implementation, the device further includes:
[0125] A fourth filtering module is used to determine the third abnormal filtering times of each key. If the third abnormal filtering times is greater than the third preset number, the scan count value of the Nth touch key scan is filtered again. The key corresponding to the third abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the second preset coefficient and the preset touch threshold, and the difference is greater than the product of the third preset coefficient and the preset touch threshold, wherein the third preset coefficient is less than the second preset coefficient, and the third preset number is less than the second preset number.
[0126] In a possible implementation, the device further includes:
[0127] A change trend judgment module is used to determine that the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan have the same change trend if the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan are both greater than the corresponding filter values or are both less than the corresponding filter values.
[0128] In a possible implementation, the touch key module includes a control unit, a plurality of detection channels, a comparison unit, a voltage generating unit, a first capacitor and a first switch, each detection channel corresponds to each touch key and is used for touch detection, wherein the positive input end of the comparison unit is connected to each detection channel, the first end of the first capacitor, and the first end of the first switch, and the second end of the first capacitor and the second end of the first switch are grounded.
[0129] The first output terminal of the voltage generating unit is connected to the negative input terminal of the comparing unit, and is used to sequentially output a plurality of reference voltages, wherein each reference voltage corresponds to each detection channel;
[0130] The second output end of the voltage generating unit is connected to the power supply end of each detection channel, and is used to sequentially output a plurality of charging voltages, wherein each charging voltage corresponds to each detection channel;
[0131] The control unit is connected to each detection channel and is used to perform charging and charge transfer according to the set charging time and charge transfer time respectively;
[0132] The control module is also used for:
[0133] receiving control information, and determining a charging duration and a charge transfer duration of each detection channel according to the control information, wherein the charge transfer duration is shorter than the charging duration;
[0134] Each detection channel is charged and discharged in turn according to the charging time and charge transfer time of each detection channel.
[0135] In a possible implementation, each detection channel includes a button, a second switch, and a third switch, wherein:
[0136] The first end of the second switch is connected to the second output end of the voltage generating unit, and the second end of the second switch is connected to the first end of the third switch and the button.
[0137] The second end of the third switch is connected to the positive input end of the comparison unit, the first end of the first switch and the first end of the first capacitor.
[0138] Wherein, the control module is also used for:
[0139] Step 1: Control the first switch to be turned on, and control each third switch and each second switch to be turned off, so as to release the charge on the first capacitor;
[0140] Step 2: Control the second switches of the detection channel corresponding to the first button to be turned on for the charging time, and control the first switch and each third switch to be turned off, so as to charge the capacitance of the button of the detection channel corresponding to the first button to the target voltage;
[0141] Step 3, controlling the third switch of the detection channel corresponding to the first button to turn on the charge transfer duration, moving the charge on the capacitor corresponding to the first button to the first capacitor to charge the first capacitor, and controlling the third switches of other detection channels, the first switch and each second switch to be turned off;
[0142] Repeat steps 2 and 3 until the voltage at the positive input terminal of the comparison unit is greater than the reference voltage at the negative input terminal, and determine the scan count value of the detection channel corresponding to the first key according to the number of repetitions of steps 2 and 3.
[0143] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0144] The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0145] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0146] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.
[0147] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0148] See also Figure 6 , Figure 6A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0149] For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0150] Reference Figure 6 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0151] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0152] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0153] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0154] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0155] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0156] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0157] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0158] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0159] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0160] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.
[0161] See also Figure 7 , Figure 7 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0162] For example, the electronic device 1900 may be provided as a server. Figure 7 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0163] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003). TM ), a graphical user interface operating system launched by Apple (Mac OSX TM ), a multi-user, multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.
[0164] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0165] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0166] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0167] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0168] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0169] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0170] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0171] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0172] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0173] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0174] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A touch detection method, characterized in that: The method comprises: Control the touch key module to perform touch key scans on one or more keys N times respectively, and obtain a scan count value when each touch key scan of each key is completed, wherein the touch key module obtains a detection result of a touch operation on the key according to the charge and discharge times of the charge and discharge unit, and the scan count value is determined according to the charge and discharge times corresponding to the key when the scan is completed, and N is a positive integer; Filter the scan count value of each touch key scan of each key to obtain the filter value corresponding to each touch key scan; Determine the first abnormal filtering times of each key, if the first abnormal filtering times is greater than the first preset number, filter the scan count value of the Nth touch key scan again, wherein the key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold; If the filtered value after the second filtering is greater than the preset scan count value, it is determined that the touch operation of the key is detected.
2. The method according to claim 1, characterized in that The method further comprises: Determine the second abnormal filtering times for each key. If the second abnormal filtering times is greater than the second preset number, filter the scan count value of the Nth touch key scan again. The key corresponding to the second abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the first preset coefficient and the preset touch threshold, and the difference is greater than the product of the second preset coefficient and the preset touch threshold, wherein the second preset coefficient is less than the first preset coefficient, and the second preset number is less than the first preset number.
3. The method according to claim 2, characterized in that The method comprises: Determine the third abnormal filtering times for each key. If the third abnormal filtering times is greater than the third preset number, filter the scan count value of the Nth touch key scan again. The key corresponding to the third abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, the difference is less than or equal to the product of the second preset coefficient and the preset touch threshold, and the difference is greater than the product of the third preset coefficient and the preset touch threshold, wherein the third preset coefficient is less than the second preset coefficient, and the third preset number is less than the second preset number.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan are both greater than the corresponding filter values or are both less than the corresponding filter values, it is determined that the scan count value of the Nth touch key scan and the scan count value of the N-1th touch key scan have the same change trend.
5. The method according to claim 1, characterized in that The touch key module includes a control unit, a plurality of detection channels, a comparison unit, a voltage generating unit, a first capacitor and a first switch, each detection channel corresponds to each touch key and is used for touch detection, wherein the positive input end of the comparison unit is connected to each detection channel, the first end of the first capacitor, and the first end of the first switch, and the second end of the first capacitor and the second end of the first switch are grounded. The first output terminal of the voltage generating unit is connected to the negative input terminal of the comparing unit, and is used to sequentially output a plurality of reference voltages, wherein each reference voltage corresponds to each detection channel; The second output end of the voltage generating unit is connected to the power supply end of each detection channel, and is used to sequentially output a plurality of charging voltages, wherein each charging voltage corresponds to each detection channel; The control unit is connected to each detection channel and is used to perform charging and charge transfer according to the set charging time and charge transfer time respectively; The method further comprises: receiving control information, and determining a charging duration and a charge transfer duration of each detection channel according to the control information, wherein the charge transfer duration is shorter than the charging duration; Each detection channel is charged and discharged in turn according to the charging time and charge transfer time of each detection channel.
6. The method according to claim 5, characterized in that Each detection channel includes a button, a second switch, and a third switch, wherein: The first end of the second switch is connected to the second output end of the voltage generating unit, and the second end of the second switch is connected to the first end of the third switch and the button. The second end of the third switch is connected to the positive input end of the comparison unit, the first end of the first switch and the first end of the first capacitor. Wherein, the method further comprises: Step 1: Control the first switch to be turned on, and control each third switch and each second switch to be turned off, so as to release the charge on the first capacitor; Step 2: Control the second switches of the detection channel corresponding to the first button to be turned on for the charging time, and control the first switch and each third switch to be turned off, so as to charge the capacitance of the button of the detection channel corresponding to the first button to the target voltage; Step 3, controlling the third switch of the detection channel corresponding to the first button to turn on the charge transfer duration, moving the charge on the capacitor corresponding to the first button to the first capacitor to charge the first capacitor, and controlling the third switches of other detection channels, the first switch and each second switch to be turned off; Repeat steps 2 and 3 until the voltage at the positive input terminal of the comparison unit is greater than the reference voltage at the negative input terminal, and determine the scan count value of the detection channel corresponding to the first key according to the number of repetitions of steps 2 and 3.
7. A touch detection device, characterized in that: The device comprises: A control module, used to control the touch key module to perform N touch key scans on one or more keys respectively, and obtain a scan count value when each touch key scan of each key is completed, wherein the touch key module obtains a detection result of a touch operation on a key according to the charge and discharge times of the charge and discharge unit, and the scan count value is determined according to the charge and discharge times corresponding to the key when the scan is completed, and N is a positive integer; A first filtering module is used to filter the scan count value of each touch key scan of each key to obtain a filter value; The second filtering module is used to determine the first abnormal filtering times of each key. If the first abnormal filtering times is greater than the first preset number, the scan count value of the Nth touch key scan is filtered again. The key corresponding to the first abnormal filtering times satisfies: the difference between the scan count value of the Nth touch key scan and the corresponding filter value is not 0, the scan count value of the Nth touch key scan has the same change trend as the scan count value of the N-1th touch key scan, and the difference is greater than the product of the first preset coefficient and the preset touch threshold. The detection module is used to: if the filtered value after re-filtering is greater than a preset scan count value, determine that a touch operation of the key is detected.
8. A touch detection chip, characterized in that: The chip includes the touch detection device according to claim 7.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for enhancing mobile phone interference resistance of capacitive touch button and circuit thereof
CN104104375A
Capacitance type anti-interference detection device and detection method for touch key
CN109428579A