Touch detection method, device and chip, electronic device and storage medium
By performing multiple scans in the touch key module and processing the scan count value using a preset scaling coefficient, the problem of unable to effectively judge the trigger of the touch key in the prior art is solved, and a high-accurate touch judgment is achieved.
Patent Information
- Application Number
- CN202210399680.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-15
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-04-15
AI Technical Summary
The existing touch key module cannot effectively judge the triggering of touch keys, mainly due to the differences in the peripheral hardware circuits of each key.
By controlling the touch key module to scan one or more keys at least twice, the scanning count values of each key are obtained, and the count values are processed using the preset scaling coefficient to determine the touch operation of the detected key.
The touch operation of detecting the key is realized quickly and accurately, eliminating the peripheral circuit differences of each key, and improving the accuracy of touch keys touch judgment.
Smart Images

Figure CN114706495B_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, device and chip, electronic device and 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, the current touch button module is unable to make effective judgments on the triggering of touch buttons due to differences in the peripheral hardware circuits of each button. Summary of the invention
[0003] According to one aspect of the present disclosure, a touch detection method is provided, the method comprising:
[0004] Controlling the touch key module to perform at least two touch key scans on one or more keys, and obtaining a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed, wherein the touch key module obtains a detection result of a touch operation on the touch 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 each key when the scan is completed;
[0005] Processing the first scan count value and the second scan count value respectively using a preset scaling factor;
[0006] When the difference between the processed first scan count value and the processed second scan count value is greater than the comparison threshold, it is determined that the touch operation of the key is detected.
[0007] In a possible implementation, the method further includes:
[0008] For each button, a preset scaling factor corresponding to each button is set respectively, and the preset scaling factor includes an integer part and a decimal part. The integer part of the preset scaling factor is used to adjust the scan count value by a first amplitude, and the decimal part of the preset scaling factor is used to adjust the scan count value by a second amplitude, and the first amplitude is greater than the second amplitude.
[0009] In a possible implementation manner, the using a preset scaling factor to process the first scan count value and the second scan count value respectively includes:
[0010] The preset scaling factor is multiplied by the first scan count value and the second scan count value to obtain a processed first scan count value and a processed second scan count value.
[0011] In a possible implementation, the method further includes:
[0012] When no key is touched, the touch key module is controlled to perform touch key scanning on one or more keys to obtain a reference scanning count value of each key;
[0013] A comparison threshold corresponding to the current key is determined according to the reference scan count value and a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence between a plurality of scan count value ranges and the comparison threshold value.
[0014] In a possible implementation, the method further includes:
[0015] When each key is not touched and when each key is touched, the touch key module is controlled to perform multiple touch key scans on one or more keys to obtain multiple non-touch scan count values when each key is not touched and multiple touch scan count values when each key is touched;
[0016] Sorting a plurality of non-touch scan count values and a plurality of touch scan count values, and dividing the sorted non-touch scan count values into N scan count value ranges, wherein the N scan count value ranges are determined by using N-1 boundary values, and N ≥ 2 and is an integer;
[0017] Determine N-1 boundary touch scan count values corresponding to the boundary values one by one from the sorted touch scan count values, wherein each boundary touch scan count value is greater than the corresponding boundary value;
[0018] The comparison threshold corresponding to each scan count value range is determined by using each boundary scan count value, each boundary value and a preset coefficient.
[0019] In a possible implementation manner, the determining of the comparison threshold corresponding to each scan count value range by using each boundary scan count value, each boundary value and a preset coefficient includes:
[0020] Multiplying the difference between each boundary scan count value and the corresponding boundary value by the preset coefficient to obtain N-1 intermediate values;
[0021] Determine N-1 intermediate coefficients respectively by using the N-1 intermediate values and the preset comparison threshold, wherein each intermediate coefficient, each intermediate value corresponds to each boundary value;
[0022] The comparison threshold corresponding to each scan count value range is determined by using the product of each intermediate value and the corresponding intermediate coefficient to obtain a preset corresponding relationship, wherein the preset corresponding relationship includes a corresponding relationship between multiple scan count value ranges and the comparison threshold.
[0023] In a possible implementation, the touch key module includes a plurality of detection channels, a comparison unit, a voltage generating unit, a first capacitor and a first switch, each detection channel corresponds to a charge and discharge unit of each key, wherein:
[0024] 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.
[0025] 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;
[0026] 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;
[0027] The method further comprises:
[0028] When the detection channel corresponding to the first button is charged, the other detection channels are charged synchronously;
[0029] When the charge is transferred to the detection channel corresponding to the first key, the other detection channels are grounded for discharge.
[0030] In a possible implementation, each detection channel includes a button, a second switch, and a third switch, wherein:
[0031] 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.
[0032] 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.
[0033] Wherein, the method further comprises:
[0034] Step 1: Control the first switch to be turned on, and control each third switch and each second switch to be turned off to release the charge on the first capacitor;
[0035] Step 2: Control each second switch to be turned on, and control the first switch and each third switch to be turned off, so as to charge the capacitance of the key of each detection channel to the target voltage;
[0036] Step 3, controlling the third switch of the detection channel corresponding to the first button to be turned on, 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, the first switch and each second switch of other detection channels to be turned off, and controlling the capacitors of other detection channels to be grounded for discharge;
[0037] 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.
[0038] According to one aspect of the present disclosure, a touch detection device is provided, the device comprising:
[0039] A control module, used to control the touch key module to perform at least two touch key scans on one or more keys, and obtain a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed, wherein the touch key module obtains a detection result of a touch operation on the touch 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 each key when the scan is completed;
[0040] A calculation module, used for processing the first scanning count value and the second scanning count value respectively by using a preset scaling factor;
[0041] The detection module is used to determine that a touch operation of the key is detected when the difference between the processed first scan count value and the processed second scan count value is greater than a comparison threshold.
[0042] According to one aspect of the present disclosure, a touch detection chip is provided, and the chip includes the touch detection device.
[0043] According to one aspect of the present disclosure, there is provided an electronic device, including:
[0044] processor;
[0045] a memory for storing processor-executable instructions;
[0046] The processor is configured to call the instructions stored in the memory to execute the method described above.
[0047] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.
[0048] The disclosed embodiment controls the touch key module to perform at least two touch key scans on one or more keys, thereby obtaining a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed. The first scan count value and the second scan count value are processed separately using a preset scaling factor. When the difference between the processed first scan count value and the processed second scan count value is greater than a comparison threshold, it is possible to quickly and accurately determine that a touch operation of the key has been detected. The preset scaling factor can eliminate the differences in the peripheral circuits of each key, thereby improving the accuracy of touch judgment of the touch key.
[0049] 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
[0050] 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.
[0051] Figure 1 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0052] Figure 2 A schematic diagram of a touch key module according to an embodiment of the present disclosure is shown.
[0053] Figure 3 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0054] Figure 4 A block diagram of a touch detection device according to an embodiment of the present disclosure is shown.
[0055] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0056] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0057] 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.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] See also Figure 1, Figure 1 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0065] like Figure 1 As shown, the method includes:
[0066] Step S11, controlling the touch key module to perform at least two touch key scans on one or more keys, and obtaining a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed, wherein the touch key module obtains a detection result of a touch operation on the touch 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 each key when the scan is completed;
[0067] Step S12, processing the first scan count value and the second scan count value respectively using a preset scaling factor;
[0068] Step S13: When the difference between the processed first scan count value and the processed second scan count value is greater than a comparison threshold, it is determined that a touch operation of the key is detected.
[0069] The disclosed embodiment controls the touch key module to perform at least two touch key scans on one or more keys, thereby obtaining a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed. The first scan count value and the second scan count value are processed separately using a preset scaling factor. When the difference between the processed first scan count value and the processed second scan count value is greater than a comparison threshold, it is possible to quickly and accurately determine that a touch operation of the key has been detected. The preset scaling factor can eliminate the differences in the peripheral circuits of each key, thereby improving the accuracy of touch judgment of the touch key.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] See also Figure 2 , Figure 2 A schematic diagram of a touch key module according to an embodiment of the present disclosure is shown.
[0076] 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,
[0077] 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 The first end of the first capacitor C1 and the first switch S W1 The second end is grounded,
[0078] 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;
[0079] 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.
[0080] The above introduction to the touch detection module is exemplary and should not be regarded as limiting the embodiments of the present disclosure.
[0081] 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.
[0082] 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;
[0083] 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;
[0084] 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;
[0085] 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.
[0086] 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.
[0087] 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.
[0088] In a possible implementation, the method may further include:
[0089] For each button, a preset scaling factor corresponding to each button is set respectively, and the preset scaling factor includes an integer part and a decimal part. The integer part of the preset scaling factor is used to perform a first amplitude adjustment (coarse adjustment) on the scan count value, and the decimal part of the preset scaling factor is used to perform a second amplitude adjustment (fine adjustment) on the scan count value, and the first amplitude is greater than the second amplitude.
[0090] The embodiments of the present disclosure do not limit the specific size of the preset scaling factor, and those skilled in the art may set it according to the disclosure and needs.
[0091] Exemplarily, the embodiments of the present disclosure may set a preset zoom factor greater than 1 to ensure that the scan count value of the touch key is in an enlarged state, and may set a preset zoom factor less than 1 to ensure that the scan count value is in a reduced state, wherein the integer part may, for example, include 16 bits, and the decimal part may, for example, include 8 bits.
[0092] For example, in actual use, it is possible that the scan count value exceeds the maximum value (such as 65535) represented by the register (such as 16 bits) when not touching or when touching, resulting in a count overflow and an inability to obtain an accurate count value. In this case, the embodiment of the present disclosure can set a preset scaling factor less than 1 to reduce the count value of the touch button to obtain accurate data.
[0093] Exemplarily, the disclosed embodiments can set the same preset scaling factor for each key, and the same preset scaling factor proportionally amplifies the scan count values of all detection channels; of course, an independent preset scaling factor can also be set for each detection channel, and the independent preset scaling factor can make the scan count values of different detection channels consistent, thereby achieving the function of eliminating the differences in the peripheral hardware of different touch key pins and judging the touch keys.
[0094] Exemplarily, due to layout and wiring reasons or other reasons, the count value of each touch key is different. In order to facilitate the judgment of key triggering, the embodiment of the present disclosure can normalize the scan count value of the touch key, for example, normalize each scan count value to about 10,000, so that all keys can be kept the same after the touch and achieve the same resolution, and the count value can produce a relatively large change after the touch, which is conducive to the change of key triggering. Since the count value of the touch key is fluctuating, after statistics and calculations, the fluctuation range of the count value is within plus or minus 2%. Taking 10,000 as a reference value, the actual count value fluctuates between 9,800 and 10,200, so the normalized range is set to fluctuate within 10,000 values within plus or minus 2%, so that each touch key is within the same numerical fluctuation range, and the same method can be used to determine whether the key is triggered. Of course, the fluctuation range can be set according to actual conditions and needs, and the embodiment of the present disclosure is not limited.
[0095] Exemplarily, when the count value of each touch key is increased to the target count value (such as a value of 10,000 within plus or minus 2%), the touch count value can be uniformly amplified using the same preset scaling factor; when the scan counts of each key are significantly different, different preset scaling factors can be used to amplify the count values of each touch key to the same range, so as to eliminate large differences caused by peripheral circuits, noise, etc., and improve the accuracy of touch judgment.
[0096] In a possible implementation manner, the processing of the first scan count value and the second scan count value respectively by using a preset scaling factor in step S12 may include:
[0097] The preset scaling factor is multiplied by the first scan count value and the second scan count value to obtain a processed first scan count value and a processed second scan count value.
[0098] The embodiment of the present disclosure scales the first scan count value and the second scan count value by multiplying the preset scaling factor with the first scan count value and the second scan count value, thereby obtaining a processed first scan count value and a processed second scan count value, thereby eliminating large differences caused by peripheral circuits, noise, etc. and improving the accuracy of touch judgment.
[0099] At present, the related technology usually uses a fixed comparison threshold to determine whether a key is touched. However, when the use environment of the touch key module, such as temperature, humidity, etc., changes, it will cause the actual touch to fail to reach or greatly exceed the set comparison threshold, resulting in the phenomenon that the touch key is insensitive or oversensitive, that is, it is impossible to accurately perform touch detection. In addition, the PCB board also has a great influence on the touch key. The same touch key pins on different PCB boards or different touch key pins on the same PCB board have large differences in parasitic capacitance. Some touch key pins even have large parasitic capacitance, resulting in a small change in the count value of the touch key before and after the finger touches the key, and the fixed comparison threshold cannot be used to judge the key normally.
[0100] In view of this, the embodiment of the present disclosure adaptively and flexibly determines a suitable comparison threshold according to the conditions of each detection channel to improve the accuracy of touch detection. An exemplary introduction is given below.
[0101] See also Figure 3 , Figure 3 A flow chart of a touch detection method according to an embodiment of the present disclosure is shown.
[0102] In a possible implementation, Figure 3 As shown, the method may also include:
[0103] Step S21, when no key is touched, controlling the touch key module to perform touch key scanning on one or more keys to obtain a reference scanning count value of each key;
[0104] Step S22, determining a comparison threshold corresponding to the current key according to the reference scan count value and a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence between a plurality of scan count value ranges and comparison thresholds.
[0105] The disclosed embodiment controls the touch key module to perform touch key scanning on one or more keys when no keys are touched, thereby obtaining a reference scan count value for each key, and determining a comparison threshold value corresponding to the current key according to the reference scan count value and a preset corresponding relationship. This allows for flexible determination of a suitable comparison threshold value in each detection channel to improve the accuracy of touch detection.
[0106] The embodiments of the present disclosure do not limit the specific form of the preset corresponding relationship. The preset corresponding relationship can be determined in advance and stored in the storage module. The control module can directly call the preset corresponding relationship from the storage module to determine the appropriate comparison threshold in each detection channel to improve the accuracy of touch detection.
[0107] In one example, the storage module may include a computer-readable storage medium, which may be a tangible device that can hold and store instructions used by the instruction execution device. The computer-readable storage medium may 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 of the above. More specific examples of computer-readable storage media (a non-exhaustive list) 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 programmable read-only memory (PROM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0108] Exemplarily, step S22 determines the comparison threshold corresponding to the current key according to the reference scan count value and the preset corresponding relationship, which may include:
[0109] Determine a scan count value range within which the reference scan count value lies;
[0110] The comparison threshold corresponding to the current key is determined according to the scan count value range in which the reference scan count value is located and the preset corresponding relationship.
[0111] The embodiments of the present disclosure do not limit the number of scan count value ranges in the preset corresponding relationship and the specific size of each range, and those skilled in the art can set them according to actual conditions and needs.
[0112] The embodiments of the present disclosure do not limit the method for obtaining the preset corresponding relationship. Those skilled in the art can obtain it through multiple experiments, or by adopting a suitable method according to actual conditions and needs. An exemplary introduction is given below.
[0113] In a possible implementation, Figure 3As shown, the method may also include:
[0114] Step S31, when each key is not touched and when each key is touched, respectively control the touch key module to perform multiple touch key scans on one or more keys to obtain multiple non-touch scan count values when each key is not touched and multiple touch scan count values when each key is touched;
[0115] Step S32, sorting the plurality of non-touch scan count values and the plurality of touch scan count values, and dividing the sorted non-touch scan count values into N scan count value ranges, wherein the N scan count value ranges are determined by using N-1 boundary values, and N ≥ 2 and is an integer;
[0116] Step S33, determining N-1 boundary touch scan count values corresponding to the boundary values one by one from the sorted touch scan count values, wherein each boundary touch scan count value is greater than the corresponding boundary value;
[0117] Step S34, using each boundary scan count value, each boundary value and a preset coefficient to determine a comparison threshold value corresponding to each scan count value range.
[0118] The disclosed embodiment controls the touch key module to perform multiple touch key scans on one or more keys when each key is not touched and when each key is touched, respectively, to obtain multiple no-touch scan count values when each key is not touched and multiple touch scan count values when each key is touched, sorts the multiple no-touch scan count values and the multiple touch scan count values, divides the sorted no-touch scan count values into N scan count value ranges, determines N-1 boundary touch scan count values corresponding to the boundary values from the sorted touch scan count values, and uses each boundary scan count value, each boundary value and a preset coefficient to quickly determine a comparison threshold value corresponding to each scan count value range, and obtains the preset corresponding relationship.
[0119] The embodiments of the present disclosure do not limit the specific implementation methods of each step in step S31 to step S34. Those skilled in the art may adopt appropriate methods to implement the steps according to actual conditions and needs. For example, in step S32, the sorting method may adopt a bubble sort method or other sorting methods; in step S33, the embodiments of the present disclosure may obtain each boundary touch scan count value that is greater than the corresponding boundary value by comparing the sizes.
[0120] Among them, a minimum touch scan count value greater than a certain boundary value may be determined among the sorted touch scan count values as a boundary touch scan count value corresponding to the boundary value.
[0121] In a possible implementation, Figure 3As shown, step S34 uses each boundary scan count value, each boundary value and a preset coefficient to determine a comparison threshold value corresponding to each scan count value range, which may include:
[0122] Step S341, multiplying the difference between each boundary scan count value and the corresponding boundary value by the preset coefficient to obtain N-1 intermediate values;
[0123] Step S342, using the N-1 intermediate values and the preset comparison threshold to respectively determine N-1 intermediate coefficients, wherein each intermediate coefficient and each intermediate value corresponds to each boundary value;
[0124] Step S343, using the product of each intermediate value and the corresponding intermediate coefficient to determine the comparison threshold corresponding to each scan count value range, to obtain a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence relationship between multiple scan count value ranges and the comparison threshold.
[0125] The disclosed embodiment obtains N-1 intermediate values by multiplying the difference between each boundary scan count value and the corresponding boundary value with the preset coefficient, and uses the N-1 intermediate values and the preset comparison threshold to respectively determine the N-1 intermediate coefficients, wherein each intermediate coefficient and each intermediate value corresponds to each boundary value, and the comparison threshold corresponding to each scan count value range is determined by the product of each intermediate value and the corresponding intermediate coefficient, so that the preset corresponding relationship can be quickly obtained, and the preset corresponding relationship includes the corresponding relationship between multiple scan count value ranges and comparison thresholds.
[0126] The following introduces possible implementation methods of determining the preset corresponding relationship with specific examples.
[0127] Exemplarily, step S31 controls the touch key module to perform multiple touch key scans on one or more keys when each key is not touched and when each key is touched, respectively, to obtain multiple touch-free scan count values for each key when not touched and multiple touch scan count values when touched. Step S32 sorts the multiple touch-free scan count values and the multiple touch scan count values, and divides the sorted touch-free scan count values into N scan count value ranges. Assuming N is 7, it includes 6 boundary values. For example, the 6 boundary values are 20,000, 10,000, 5,000, 2,500, 1,000 and 500, respectively. Then, 7 scan count value ranges can be obtained. The 7 scan count value ranges include: greater than 20,000, 20,000-10,000, 10,000-5,000, 5,000-2,500, 2,500-1,000, 1,000-500, and less than 500.
[0128] Exemplarily, assume that according to step S33, N-1 (e.g., 6) boundary touch scan count values corresponding to the boundary values are determined from the sorted touch scan count values, including 21250, 11000, 5500, 2750, 1125, and 600, respectively, where 21250 is the minimum value among the touch scan count values greater than 20000, and so on.
[0129] According to step S341, the difference between each boundary scan count value (F12) and the corresponding boundary value (F11) is multiplied by the preset coefficient (P) (|F11-F12|×P) to obtain N-1 intermediate values. Exemplarily, the preset coefficient can be a decimal between 0 and 1. Assuming that the preset coefficient is 0.8, 6 intermediate values can be obtained according to 6 boundary values (20000, 10000, 5000, 2500, 1000 and 500) and the corresponding 6 boundary touch scan count values (21250, 11000, 5500, 2750, 1125, 600), wherein the corresponding relationship between the boundary value and the boundary touch scan count value can be shown in Table 1:
[0130] Table 1
[0131] Boundary Value 20000 10000 5000 2500 1000 500 Boundary touch scan count value 21250 11000 5500 2750 1125 600
[0132] Exemplarily, six intermediate values may be obtained according to the following calculations:
[0133] |21250-20000|×0.8=1000;
[0134] |11000-10000|×0.8=800;
[0135] |5500-5000|×0.8=400;
[0136] |2750-2500|×0.8=200;
[0137] |1125-1000|×0.8=100;
[0138] |600-500|×0.8=80.
[0139] After obtaining each intermediate value, the embodiment of the present disclosure can determine N-1 intermediate coefficients respectively according to step S342 using the N-1 intermediate values and the preset comparison threshold. For example, the embodiment of the present disclosure can divide each intermediate value by the preset comparison threshold, and use the quotient of the two as the intermediate coefficient, wherein the preset comparison threshold can be set as needed. For example, assuming that the preset comparison threshold is 800, the intermediate coefficients corresponding to the 6 intermediate values (1000, 800, 400, 200, 100, 80) are respectively obtained by the following operations:
[0140] 1000÷800=1.25;
[0141] 800÷800=1;
[0142] 400÷800=0.5;
[0143] 200÷800=0.25;
[0144] 100÷800=0.12;
[0145] 80÷800=0.10;
[0146] That is, 6 intermediate coefficients (1.25, 1, 0.5, 0.25, 0.12, 0.10) can be obtained.
[0147] Exemplarily, the corresponding relationship between the intermediate value and the intermediate coefficient may be as shown in Table 2.
[0148] Table 2
[0149] Median 1000 800 400 200 100 80 Intermediate coefficient 1.25 1 0.5 0.25 0.12 0.10
[0150] Exemplarily, after obtaining each intermediate coefficient, the embodiment of the present disclosure can determine the comparison threshold corresponding to each scan count value range by using the product of each intermediate value and the corresponding intermediate coefficient according to step S343 to obtain a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence between multiple scan count value ranges and the comparison threshold. For example, according to 6 intermediate values (1000, 800, 400, 200, 100, 80) and the corresponding 6 intermediate coefficients (1.25, 1, 0.5, 0.25, 0.12, 0.10), each comparison threshold can be obtained through the following calculation:
[0151] 1000×1.25=1250;
[0152] 800×1=800;
[0153] 400×0.5=200;
[0154] 200×0.25=50;
[0155] 100×0.12=12;
[0156] 80×0.10=8.
[0157] Exemplarily, each comparison threshold value obtained above may correspond one-to-one to each scan count value range to obtain a preset corresponding relationship as shown in Table 3.
[0158] Table 3
[0159]
[0160] Exemplarily, when the scan count value is less than 500, since it changes slowly, an empirical value may be used instead, for example, | may be a decimal between 0 and 0.1, such as 0.02.
[0161] The above is an exemplary introduction to the method for determining the preset corresponding relationship, but it should not be regarded as a limitation on the embodiments of the present disclosure.
[0162] During the use of touch key modules, liquid coverage is often encountered. For example, water is spilled on the key panel, or the finger is wet. In this case, the liquid will have a great interference with the touch judgment of the touch key module. The relevant technology usually lays a waterproof electrode around the pad of the touch key module. When water drops enter between the touch pad and the waterproof electrode, the voltage follower is used to prevent the capacitor formed by the current water drop from transferring charge, thereby offsetting the influence of the water drop. However, the relevant technology will increase the cost, and when the finger enters between the waterproof electrode and the key, the touch key will not respond.
[0163] The disclosed embodiment controls other keys to emit voltage waveforms of the same frequency as the acquisition key while scanning one key, that is, other key channels output compensation waveforms. Since the voltage of the current key is the same as that of the other keys, the parasitic capacitance of the currently scanned key is no longer increased, thereby effectively avoiding the phenomenon of false triggering of touch keys due to water drops falling on other touch keys.
[0164] Illustratively, the disclosed embodiment can synchronously charge the capacitors of all keys of the touch key module during the charging and discharging stage of the key capacitors. When the charging is completed and the charge of the key capacitors is transferred, the capacitors of other keys are connected to the ground for discharge after the charge of the currently scanned key capacitors is transferred. In this way, the disclosed embodiment can control other keys to emit waveforms of the same frequency as the acquisition key while scanning one key, thereby effectively avoiding the phenomenon of false triggering of touch keys due to water drops falling on other touch keys.
[0165] Combine the following Figure 2 Provide an exemplary introduction.
[0166] In a possible implementation, the method may further include:
[0167] When the detection channel corresponding to the first button is charged, the other detection channels are charged synchronously;
[0168] When the charge is transferred to the detection channel corresponding to the first key, the other detection channels are grounded for discharge.
[0169] In a possible implementation, Figure 2 As shown, detection channel 1 is used as an example for introduction, and the method may further include:
[0170] 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;
[0171] Step 2: Control each second switch to be turned on, and control the first switch S W1 and each third switch is disconnected, and the capacitance of the key of each detection channel is charged to the target voltage;
[0172] Step 3: Control the third switch S of the detection channel 1 corresponding to the first button W10 The first switch S1 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 S2 of other detection channels. W1 and each second switch is disconnected, controlling the capacitors of other detection channels to be grounded for discharge;
[0173] Repeat steps 2 and 3 until the voltage V P is greater than the negative input reference voltage V REF , determine the scan count value of the detection channel corresponding to the first button according to the number of repetitions of step two and step three.
[0174] For example, the disclosed embodiment can set the key capacitance (C TK1 , C TK2 ,…,C TKm ) are grounded through a fourth switch (not shown). In this way, the embodiment of the present disclosure can control the conduction state of the fourth switch to discharge the corresponding key capacitor to the ground.
[0175] 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.
[0176] See also Figure 4 , Figure 4 A block diagram of a touch detection device according to an embodiment of the present disclosure is shown.
[0177] like Figure 4 As shown, the device comprises:
[0178] The control module 60 is used to control the touch key module to perform at least two touch key scans on one or more keys, and obtain a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed, wherein the touch key module obtains the detection result of the touch operation on the touch 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 each key when the scan is completed;
[0179] A calculation module 70, configured to process the first scan count value and the second scan count value respectively using a preset scaling factor;
[0180] The detection module 80 is used to determine that a touch operation of a key is detected when the difference between the processed first scan count value and the processed second scan count value is greater than a comparison threshold.
[0181] The disclosed embodiment controls the touch key module to perform at least two touch key scans on one or more keys, thereby obtaining a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed. The first scan count value and the second scan count value are processed separately using a preset scaling factor. When the difference between the processed first scan count value and the processed second scan count value is greater than a comparison threshold, it is possible to quickly and accurately determine that a touch operation of the key has been detected. The preset scaling factor can eliminate the differences in the peripheral circuits of each key, thereby improving the accuracy of touch judgment of the touch key.
[0182] In a possible implementation, the device further includes:
[0183] A setting module is used to set a preset scaling factor corresponding to each key for each key, wherein the preset scaling factor includes an integer part and a decimal part, the integer part of the preset scaling factor is used to adjust the scan count value by a first amplitude, and the decimal part of the preset scaling factor is used to adjust the scan count value by a second amplitude, wherein the first amplitude is greater than the second amplitude.
[0184] In a possible implementation manner, the using a preset scaling factor to process the first scan count value and the second scan count value respectively includes:
[0185] The preset scaling factor is multiplied by the first scan count value and the second scan count value to obtain a processed first scan count value and a processed second scan count value.
[0186] In a possible implementation, the method further includes:
[0187] When no key is touched, the touch key module is controlled to perform touch key scanning on one or more keys to obtain a reference scanning count value of each key;
[0188] A comparison threshold corresponding to the current key is determined according to the reference scan count value and a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence between a plurality of scan count value ranges and the comparison threshold value.
[0189] In a possible implementation manner, the control module is further used to: when each key is not touched and when each key is touched, respectively control the touch key module to perform multiple touch key scans on one or more keys, to obtain multiple non-touch scan count values when each key is not touched and multiple touch scan count values when each key is touched;
[0190] The device also includes:
[0191] A sorting module, used to sort the plurality of touch-free scan count values and the plurality of touch scan count values, and divide the sorted touch-free scan count values into N scan count value ranges, wherein the N scan count value ranges are determined by using N-1 boundary values, and N ≥ 2 and is an integer;
[0192] The first determination module is used to:
[0193] Determine N-1 boundary touch scan count values corresponding to the boundary values one by one from the sorted touch scan count values, wherein each boundary touch scan count value is greater than the corresponding boundary value;
[0194] The comparison threshold corresponding to each scan count value range is determined by using each boundary scan count value, each boundary value and a preset coefficient.
[0195] In a possible implementation manner, the determining of the comparison threshold corresponding to each scan count value range by using each boundary scan count value, each boundary value and a preset coefficient includes:
[0196] Multiplying the difference between each boundary scan count value and the corresponding boundary value by the preset coefficient to obtain N-1 intermediate values;
[0197] Determine N-1 intermediate coefficients respectively by using the N-1 intermediate values and the preset comparison threshold, wherein each intermediate coefficient, each intermediate value corresponds to each boundary value;
[0198] The comparison threshold corresponding to each scan count value range is determined by using the product of each intermediate value and the corresponding intermediate coefficient to obtain a preset corresponding relationship, wherein the preset corresponding relationship includes a corresponding relationship between multiple scan count value ranges and the comparison threshold.
[0199] In a possible implementation, the touch key module includes a plurality of detection channels, a comparison unit, a voltage generating unit, a first capacitor and a first switch, each detection channel corresponds to a charge and discharge unit of each key, wherein:
[0200] 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.
[0201] 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;
[0202] 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;
[0203] The control module is also used for:
[0204] When the detection channel corresponding to the first button is charged, the other detection channels are charged synchronously;
[0205] When the charge is transferred to the detection channel corresponding to the first key, the other detection channels are grounded for discharge.
[0206] In a possible implementation, each detection channel includes a button, a second switch, and a third switch, wherein:
[0207] 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.
[0208] 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.
[0209] Wherein, the control module is also used for:
[0210] 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;
[0211] Step 2: Control each second switch to be turned on, and control the first switch and each third switch to be turned off, so as to charge the capacitance of the key of each detection channel to the target voltage;
[0212] Step 3, controlling the third switch of the detection channel corresponding to the first button to be turned on, 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, the first switch and each second switch of other detection channels to be turned off, and controlling the capacitors of other detection channels to be grounded for discharge;
[0213] 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.
[0214] According to one aspect of the present disclosure, a touch detection chip is provided, and the chip includes the touch detection device.
[0215] 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.
[0216] 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.
[0217] 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.
[0218] 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.
[0219] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0220] See also Figure 5 , Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0221] 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.
[0222] Reference Figure 5, 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 .
[0223] 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.
[0224] 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.
[0225] 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.
[0226] 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.
[0227] 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.
[0228] 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.
[0229] 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.
[0230] 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.
[0231] 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.
[0232] 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.
[0233] See also Figure 6 , Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0234] For example, the electronic device 1900 may be provided as a server. Figure 6 , 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.
[0235] 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.
[0236] 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.
[0237] 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.
[0238] 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.
[0239] 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.
[0240] 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.
[0241] 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.
[0242] 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.
[0243] 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.
[0244] 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.
[0245] 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.
[0246] 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: Controlling the touch key module to perform at least two touch key scans on one or more keys, and obtaining a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed, wherein the touch key module obtains a detection result of a touch operation on the touch 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 each key when the scan is completed; Processing the first scan count value and the second scan count value respectively using a preset scaling factor; When the difference between the processed first scan count value and the processed second scan count value is greater than the comparison threshold, it is determined that a touch operation of the key is detected. The method further comprises: When each key is not touched and when each key is touched, the touch key module is controlled to perform multiple touch key scans on one or more keys to obtain multiple non-touch scan count values when each key is not touched and multiple touch scan count values when each key is touched; Sorting a plurality of non-touch scan count values and a plurality of touch scan count values, and dividing the sorted non-touch scan count values into N scan count value ranges, wherein the N scan count value ranges are determined by using N-1 boundary values, and N ≥ 2 and is an integer; Determine N-1 boundary touch scan count values corresponding to the boundary values one by one from the sorted touch scan count values, wherein each boundary touch scan count value is greater than the corresponding boundary value; Using each boundary scan count value, each boundary value and a preset coefficient to determine a comparison threshold value corresponding to each scan count value range, including: multiplying the difference between each boundary scan count value and the corresponding boundary value by the preset coefficient to obtain N-1 intermediate values; using the N-1 intermediate values and the preset comparison threshold value to respectively determine N-1 intermediate coefficients, including: dividing each intermediate value by the preset comparison threshold value, and taking the quotient of the two as the intermediate coefficient, wherein each intermediate coefficient and each intermediate value correspond to each boundary value; using the product of each intermediate value and the corresponding intermediate coefficient to determine the comparison threshold value corresponding to each scan count value range, so as to obtain a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence between multiple scan count value ranges and the comparison threshold value.
2. The method according to claim 1, characterized in that The method further comprises: For each button, a preset scaling factor corresponding to each button is set respectively, and the preset scaling factor includes an integer part and a decimal part. The integer part of the preset scaling factor is used to adjust the scan count value by a first amplitude, and the decimal part of the preset scaling factor is used to adjust the scan count value by a second amplitude, and the first amplitude is greater than the second amplitude.
3. The method according to claim 1, characterized in that The using a preset scaling factor to process the first scan count value and the second scan count value respectively includes: The preset scaling factor is multiplied by the first scan count value and the second scan count value to obtain a processed first scan count value and a processed second scan count value.
4. The method according to claim 1, characterized in that The method further comprises: When no key is touched, the touch key module is controlled to perform touch key scanning on one or more keys to obtain a reference scan count value of each key; A comparison threshold corresponding to the current key is determined according to the reference scan count value and a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence between a plurality of scan count value ranges and the comparison threshold value.
5. The method according to claim 1, characterized in that The touch key module includes multiple detection channels, a comparison unit, a voltage generating unit, a first capacitor and a first switch, each detection channel corresponds to a charge and discharge unit of each key, 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 method further comprises: When the detection channel corresponding to the first button is charged, the other detection channels are charged synchronously; When the charge is transferred to the detection channel corresponding to the first key, the other detection channels are grounded for discharge.
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 to release the charge on the first capacitor; Step 2: Control each second switch to be turned on, and control the first switch and each third switch to be turned off, so as to charge the capacitance of the key of each detection channel to the target voltage; Step 3, controlling the third switch of the detection channel corresponding to the first button to be turned on, 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, the first switch and each second switch of other detection channels to be turned off, and controlling the capacitors of other detection channels to be grounded for discharge; 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 at least two touch key scans on one or more keys, and obtain a first scan count value of each key when the first touch key scan is completed, and a second scan count value when the second touch key scan is completed, wherein the touch key module obtains a detection result of a touch operation on the touch 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 each key when the scan is completed; A calculation module, used for processing the first scan count value and the second scan count value respectively by using a preset scaling factor; A detection module is used to determine that a touch operation of a key is detected when the difference between the processed first scan count value and the processed second scan count value is greater than a comparison threshold, The control module is also used to: when each key is not touched and when each key is touched, respectively control the touch key module to perform multiple touch key scans on one or more keys, to obtain multiple non-touch scan count values when each key is not touched and multiple touch scan count values when each key is touched; The device also includes: A sorting module, used to sort the plurality of touch-free scan count values and the plurality of touch scan count values, and divide the sorted touch-free scan count values into N scan count value ranges, wherein the N scan count value ranges are determined by using N-1 boundary values, and N ≥ 2 and is an integer; The first determination module is used to: determine N-1 boundary touch scan count values corresponding to the boundary values one by one from the sorted touch scan count values, wherein each boundary touch scan count value is greater than the corresponding boundary value; determine the comparison threshold corresponding to each scan count value range using each boundary scan count value, each boundary value and a preset coefficient, including: multiplying the difference between each boundary scan count value and the corresponding boundary value by the preset coefficient to obtain N-1 intermediate values; determine N-1 intermediate coefficients respectively using the N-1 intermediate values and the preset comparison threshold, including: dividing each intermediate value by the preset comparison threshold, and taking the quotient of the two as the intermediate coefficient, wherein each intermediate coefficient and each intermediate value correspond to each boundary value; determine the comparison threshold corresponding to each scan count value range using the product of each intermediate value and the corresponding intermediate coefficient to obtain a preset corresponding relationship, wherein the preset corresponding relationship includes a correspondence between multiple scan count value ranges and the comparison threshold.
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
Key-judging method for capacitive touch keys
CN101908875A
Sampling Circuity
CN102564474A
Touch key anti-interference method and circuit
CN110971225A