CN115800988A - Key detection method, device, equipment and storage medium - Google Patents

Key detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN115800988A
CN115800988A CN202111063881.8A CN202111063881A CN115800988A CN 115800988 A CN115800988 A CN 115800988A CN 202111063881 A CN202111063881 A CN 202111063881A CN 115800988 A CN115800988 A CN 115800988A
Authority
CN
China
Prior art keywords
capacitive touch
capacitance
touch key
key
pressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111063881.8A
Other languages
Chinese (zh)
Inventor
陈志华
丁渊明
金磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TANCY INSTRUMENT GROUP CO Ltd
Goldcard Smart Group Co Ltd
Original Assignee
Goldcard Smart Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goldcard Smart Group Co Ltd filed Critical Goldcard Smart Group Co Ltd
Priority to CN202111063881.8A priority Critical patent/CN115800988A/en
Publication of CN115800988A publication Critical patent/CN115800988A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Electronic Switches (AREA)

Abstract

The application provides a key detection method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring touch sensing data of at least two capacitive touch keys, and acquiring capacitance variation and capacitance variation rate corresponding to the capacitive touch keys according to the touch sensing data for each capacitive touch key; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate. According to the key detection method, when the plurality of capacitive touch keys exist adjacently, mutual interference among the keys can be greatly reduced, and mistaken touch of the keys is avoided.

Description

Key detection method, device, equipment and storage medium
Technical Field
The present application relates to the field of touch key technologies, and in particular, to a key detection method, device, apparatus, and storage medium.
Background
Along with the progress of science and technology, the touch key is more and more widely used, and the touch key not only can reduce the volume of key, prevents that the key from receiving the damage, and is more sensitive convenient moreover. The touch keys comprise capacitive touch keys, electrodes are arranged below the capacitive touch keys, a touch Integrated Circuit (IC) is used for collecting capacitance of the electrodes, capacitance change of the electrodes is obtained through a single chip microcomputer connected with the touch IC, and the single chip microcomputer detects whether the corresponding capacitive touch keys are pressed down or not according to the capacitance change of the electrodes.
At present, when detecting whether a capacitive touch key is pressed, an obtained capacitance value of an electrode is compared with a fixed static basic capacitance value, and if a difference value between the obtained capacitance value and the fixed static basic capacitance value is greater than a set threshold value, it is determined that the capacitive touch key is pressed, that is, a key action is detected. However, when a plurality of capacitive touch keys are adjacent to each other, the keys may interfere with each other, and the keys may be touched by mistake.
Disclosure of Invention
The application provides a key detection method, a device, equipment and a storage medium, which are used for solving the problem that when a plurality of capacitive touch keys exist adjacently, the keys are interfered with each other, so that the keys are touched by mistake.
In a first aspect, the present application provides a key detection method, which is suitable for detecting keys of at least two capacitive touch keys adjacent to each other in position, and the key detection method includes:
acquiring touch sensing data of at least two capacitive touch keys;
aiming at each capacitive touch key, acquiring a capacitance variation and a capacitance variation rate corresponding to the capacitive touch key according to touch sensing data, wherein the capacitance variation rate is a ratio of the capacitance variation to a first capacitance variation mean value, and the first capacitance variation mean value is a mean value of the capacitance variations of at least two capacitive touch keys; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate.
Optionally, determining whether the capacitive touch key is pressed according to the capacitance variation and the capacitance variation rate includes: when the capacitance variation is greater than or equal to the capacitance variation threshold and the target difference is greater than or equal to the capacitance variation rate threshold, determining that the capacitive touch key is pressed, wherein the target difference is the difference between the capacitance variation rate and the maximum value of the capacitance variation rate, and the maximum value of the capacitance variation rate is the maximum value of the capacitance variation rates corresponding to at least two capacitive touch keys; or when the capacitance variation is smaller than the capacitance variation threshold, or the target difference is smaller than the capacitance variation rate threshold, determining that the capacitive touch key is not pressed.
Optionally, the key detection method further includes: when the capacitive touch key is determined to be pressed, a capacitance change threshold corresponding to the capacitive touch key is adjusted based on the capacitance change and N historical capacitance changes of the capacitive touch key, wherein N is a non-negative integer.
Optionally, based on the capacitance variation and N historical capacitances of the capacitive touch key, adjusting a capacitance variation threshold corresponding to the capacitive touch key includes: obtaining a second capacitance variation mean value based on the capacitance variation and the N historical capacitance variations of the capacitive touch key; and adjusting the capacitance change threshold corresponding to the capacitive touch key according to the second capacitance change mean value and the capacitance change threshold.
Optionally, the key detection method further includes: when the capacitive touch key is determined to be pressed, adjusting a capacitance change rate threshold corresponding to the capacitive touch key based on the capacitance change rate and the N historical capacitance change rates of the capacitive touch key.
Optionally, adjusting a capacitance change rate threshold corresponding to the capacitive touch key based on the capacitance change rate and N historical capacitance change rates of the capacitive touch key includes: obtaining a first capacitance change rate difference value based on the capacitance change rate and the maximum value of the capacitance change rates of other capacitance touch keys; acquiring N first historical capacitance change rates of the capacitive touch key; aiming at each first historical capacitance change rate, obtaining the maximum value of second historical capacitance change rates of other capacitive touch keys at the same time as the first historical capacitance change rate; obtaining N second capacitance change rate differences according to the N first historical capacitance change rates and the maximum value of the second historical capacitance change rates; and adjusting the capacitance change rate threshold corresponding to the capacitive touch key according to the first capacitance change rate difference and the N second capacitance change rate differences.
Optionally, the key detection method further includes: when the capacitive touch key is determined to be pressed, obtaining a third capacitance variation mean value based on the capacitance variation of the capacitive touch key which is not pressed and the N historical capacitance variations of the capacitive touch key which is not pressed; and adjusting a capacitance change threshold corresponding to the capacitance touch key which is not pressed according to the third capacitance change average value.
Optionally, the key detection method further includes: and if the pressed duration time of the capacitive touch key is greater than or equal to the duration time threshold, adjusting a capacitance reference value corresponding to the capacitive touch key according to the difference value between the capacitance value of the capacitive touch key and the capacitance variation.
Optionally, the key detection method further includes: and if the pressed duration time of the capacitive touch key is greater than or equal to the duration threshold value, adjusting the capacitance reference value corresponding to the capacitive touch key which is not pressed according to the sum of the capacitance reference value corresponding to the capacitive touch key which is not pressed and the capacitance variation.
Optionally, the key detection method further includes: determining the continuous pressed times of the capacitive touch key; if the times are larger than or equal to the times threshold value, determining that the capacitive touch key is pressed down; and if the times are less than the time threshold value, determining that the capacitive touch key is not pressed.
Optionally, the key detection method further includes: when it is determined that at least two capacitive touch keys are not pressed, for each capacitive touch key, adjusting a capacitance reference value of the capacitive touch key according to a sum of the capacitance reference value and the capacitance variation corresponding to the capacitive touch key and L historical capacitance variations corresponding to the capacitive touch key when the capacitive touch key is not pressed, wherein L is a positive integer.
In a second aspect, the present application provides a key detection device, which is suitable for detecting keys of at least two capacitive touch keys adjacent to each other in position, and the key detection device includes:
the acquisition module is used for acquiring touch sensing data of at least two capacitive touch keys;
the processing module is used for acquiring capacitance variation and capacitance variation rate corresponding to the capacitive touch keys according to the touch sensing data for each capacitive touch key, wherein the capacitance variation rate is a ratio of the capacitance variation to a first mean value of the capacitance variation, and the first mean value of the capacitance variation is a mean value of the capacitance variation of at least two capacitive touch keys; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate.
Optionally, the processing module is specifically configured to: when the capacitance variation is greater than or equal to the capacitance variation threshold and the target difference is greater than or equal to the capacitance variation rate threshold, determining that the capacitive touch key is pressed, wherein the target difference is the difference between the capacitance variation rate and the maximum value of the capacitance variation rate, and the maximum value of the capacitance variation rate is the maximum value of the capacitance variation rates corresponding to at least two capacitive touch keys; or when the capacitance variation is smaller than the capacitance variation threshold, or the target difference is smaller than the capacitance variation rate threshold, determining that the capacitive touch key is not pressed.
Optionally, the key detection device further includes: and the adjusting module is used for adjusting a capacitance change threshold corresponding to the capacitive touch key based on the capacitance change and N historical capacitance changes of the capacitive touch key when the capacitive touch key is determined to be pressed, wherein N is a non-negative integer.
Optionally, the adjusting module is specifically configured to: obtaining a second capacitance variation mean value based on the capacitance variation and the N historical capacitance variations of the capacitive touch key; and adjusting the capacitance change threshold corresponding to the capacitive touch key according to the second capacitance change mean value and the capacitance change threshold.
Optionally, the adjusting module is further configured to: when the capacitive touch key is determined to be pressed, adjusting a capacitance change rate threshold value corresponding to the capacitive touch key based on the capacitance change rate and the N historical capacitance change rates of the capacitive touch key.
Optionally, the adjusting module is specifically configured to: obtaining a first capacitance change rate difference value based on the capacitance change rate and the maximum value of the capacitance change rates of other capacitance touch keys; acquiring N first historical capacitance change rates of the capacitive touch key; aiming at each first historical capacitance change rate, obtaining the maximum value of second historical capacitance change rates of other capacitive touch keys at the same time as the first historical capacitance change rate; obtaining N second capacitance change rate differences according to the N first historical capacitance change rates and the maximum value of the second historical capacitance change rates; and adjusting the capacitance change rate threshold corresponding to the capacitive touch key according to the first capacitance change rate difference and the N second capacitance change rate differences.
Optionally, the adjusting module is further configured to: when the capacitive touch key is determined to be pressed, obtaining a third mean value of capacitance variation based on the capacitance variation of the capacitive touch key which is not pressed and the N historical capacitance variations of the capacitive touch key which is not pressed; and adjusting the capacitance change threshold corresponding to the capacitance touch key which is not pressed according to the third capacitance change average value.
Optionally, the adjusting module is further configured to: and if the pressed duration time of the capacitive touch key is greater than or equal to the duration time threshold, adjusting a capacitance reference value corresponding to the capacitive touch key according to the difference value between the capacitance value of the capacitive touch key and the capacitance variation.
Optionally, the adjusting module is further configured to: and if the pressed duration time of the capacitive touch key is greater than or equal to the duration threshold, adjusting the capacitance reference value corresponding to the capacitive touch key which is not pressed according to the sum of the capacitance reference value corresponding to the capacitive touch key which is not pressed and the capacitance variation.
Optionally, the processing module is further configured to: determining the continuous pressed times of the capacitive touch key; if the times are larger than or equal to the time threshold value, determining that the capacitive touch key is pressed; and if the times are less than the times threshold value, determining that the capacitive touch key is not pressed.
Optionally, the adjusting module is further configured to: when it is determined that at least two capacitive touch keys are not pressed, for each capacitive touch key, adjusting a capacitance reference value of the capacitive touch key according to a sum of the capacitance reference value and the capacitance variation corresponding to the capacitive touch key and L historical capacitance variations corresponding to the capacitive touch key when the capacitive touch key is not pressed, wherein L is a positive integer.
In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer execution instructions;
the processor executes computer-executable instructions stored in the memory to implement the key detection method according to the first aspect of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, in which computer program instructions are stored, and when the computer program instructions are executed, the key detection method according to the first aspect of the present application is implemented.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the keystroke detection method as described in the first aspect of the present application.
According to the key detection method, the device, the equipment and the storage medium, the touch induction data of at least two capacitive touch keys are obtained, and the capacitance variation rate corresponding to the capacitive touch keys are obtained according to the touch induction data for each capacitive touch key; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate. According to the method and the device, the capacitance variation quantity corresponding to each capacitive touch key is considered, and the capacitance variation rate corresponding to each capacitive touch key is combined, namely whether the capacitive touch keys are pressed down or not is determined according to the capacitance variation quantity and the capacitance variation rate, so that when a plurality of capacitive touch keys exist adjacently, the mutual interference among the keys can be greatly reduced, and the keys are prevented from being touched by mistake.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a flowchart of a key detection method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a key detection method according to another embodiment of the present application;
fig. 4 is a flowchart of a capacitive touch key validity determination according to an embodiment of the present application;
FIG. 5 is a flowchart of a key detection method according to another embodiment of the present application;
fig. 6 is a flowchart illustrating key detection performed by the single chip microcomputer according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a key detection device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a key detection device according to another embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
At present, when detecting whether a capacitive touch key is pressed, by comparing an obtained capacitance value of an electrode with a fixed static basic capacitance value, if a difference value between the obtained capacitance value and the fixed static basic capacitance value is greater than a set threshold value, it is determined that the capacitive touch key is pressed, that is, a key action is detected. However, when a plurality of capacitive touch keys are adjacent to each other, the keys may interfere with each other, and particularly when the electrodes are far away from the capacitive touch panel and the capacitive touch keys are pressed down, the capacitance of the capacitive touch keys is changed weakly, and the positions of the capacitive touch keys are prone to be deviated, thereby causing the keys to be touched by mistake. In addition, when the electrode sensitivity of different electrodes is different, the phenomenon of mistaken touch of the key is more serious. If the set threshold corresponding to the capacitance change detected by the capacitive touch keys is increased, the sensitivity of the capacitive touch keys is reduced, and the aging of devices and pollutants accumulated by electrodes of the capacitive touch keys directly cause that the keys cannot be used, so that a new key detection and key learning method is needed for a plurality of adjacent capacitive touch keys (which can also be called as multi-channel capacitive touch keys), so that the capacitive touch keys can automatically adapt to the environment and achieve the best performance and function. In the prior art, a single-channel touch key learning method exists, but the method cannot process multi-channel touch keys.
Based on the above problems, the present application provides a key detection method, device, apparatus, and storage medium, which detect capacitance data corresponding to capacitive touch keys of different channels for multiple times, adjust a capacitance reference value corresponding to each capacitive touch key according to a detection result, and determine whether the capacitive touch key is pressed down to a corresponding threshold value, thereby improving key sensitivity and reducing mutual interference between keys.
First, an application scenario of the solution provided in the present application will be described below.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. As shown in fig. 1, in the application scenario, the capacitive touch panel 110 includes three adjacent capacitive touch keys a, B, and C, and an electrode (not shown in fig. 1) is disposed below each capacitive touch key. When the capacitive touch key C is pressed, the capacitance of the electrode is collected through the touch IC120 connected to the electrode corresponding to the capacitive touch key C, and the capacitance change of the electrode is obtained through the single chip microcomputer 130 connected to the touch IC120, and the single chip microcomputer 130 detects whether the corresponding capacitive touch key C is pressed according to the capacitance change of the electrode. The specific implementation process of the single chip microcomputer 130 detecting whether the corresponding capacitive touch key C is pressed according to the capacitance change of the electrode may be referred to the schemes of the following embodiments.
It should be noted that fig. 1 is only a schematic diagram of an application scenario provided in this embodiment, and this embodiment of the present application does not limit the devices included in fig. 1, and also does not limit the positional relationship between the devices in fig. 1.
Next, a key detection method will be described by way of a specific embodiment.
Fig. 2 is a flowchart of a key detection method according to an embodiment of the present application, which is suitable for key detection of at least two adjacent capacitive touch keys. As shown in fig. 2, the method of the embodiment of the present application includes:
s201, obtaining touch induction data of at least two capacitive touch keys.
In the embodiment of the application, referring to fig. 1 by way of example, the key detection of the capacitive touch keys is firstly the program operation of a single chip microcomputer, that is, the single chip microcomputer is powered on, and the touch parameters (that is, the initialized touch parameters) corresponding to each capacitive touch key are loaded from a memory, where the touch parameters mainly include a capacitance reference value, a capacitance change threshold, a capacitance change rate threshold, a clock frequency, and the like, which correspond to each capacitive touch key, and the touch IC is initialized by parameters such as a gain of the touch IC; and then the touch IC acquires touch induction data of each capacitive touch key. Illustratively, such as using an FDC2214 touch IC as the touch IC for touch sensitive data acquisition; using i.MXRT1052 as a single chip microcomputer for reading and controlling; and using electrodes corresponding to the four capacitive touch keys, namely four touch channels, and obtaining touch induction data of the four capacitive touch keys if the interval of each electrode is less than 5mm, for example. Illustratively, the sampling frequency may be set to be, for example, 100ms, and touch sensing data of four capacitive touch keys is collected every 100 ms.
S202, aiming at each capacitive touch key, obtaining a capacitance variation and a capacitance variation rate corresponding to the capacitive touch key according to touch induction data; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate.
The capacitance change rate is a ratio of the capacitance change to a first mean value of the capacitance change, and the first mean value of the capacitance change is a mean value of the capacitance changes of the at least two capacitive touch keys.
In this step, after the touch sensing data of each capacitive touch key is obtained, the capacitance value corresponding to each capacitive touch key can be obtained according to the touch sensing data by the following formula one:
Figure BDA0003257444180000081
wherein, C total Represents the capacitance value in the unit of the femtofarad (fF); pi is pi, and the value is 3.141592653589793238463; f sensor Representing the original capacitance value, F, of the touch IC after conversion sensor =(Fref×FIN_SEL×DATA)/2 28 Wherein Fref denotes a reference frequency, fref = f _ clk/freq _ divider, wherein f _ clk denotes a clock frequency, f _ clk takes a value of, for example, 43330000, freq_divider denotes a clock pre-division coefficient, freq _ divider takes a value of, for example, 1, fref takes a value of, for example, 43330000/1=43330000, FIN _seldenotes that a clock frequency source is from an internal clock, and FIN _ SEL takes a value of, for example, 2; DATA represents single-channel touch DATA obtained by touching the IC, i.e., touch sensing DATA of a single capacitive touch key; l _ uH represents the parallel inductance value, L _ uH for example being 18uH.
And obtaining the capacitance variation corresponding to each capacitive touch key according to the capacitance value corresponding to each capacitive touch key by the following formula II:
CR=C total -C baseline formula two
Wherein CR represents a capacitance change amount, C baseline Representing the capacitance reference value.
According to the capacitance variation corresponding to each capacitance touch key, obtaining a first capacitance variation mean value through the following formula three:
Figure BDA0003257444180000082
wherein, CR v1 Represents the mean value of the first capacitance variation, CR i And the capacitance variation corresponding to each capacitive touch key is represented, and m represents the total number of the capacitive touch keys.
And obtaining the capacitance change rate corresponding to each capacitive touch key through the following formula four:
Figure BDA0003257444180000083
where CK represents the rate of change in capacitance.
After the capacitance variation and the capacitance variation rate respectively corresponding to each capacitive touch key are obtained, for each capacitive touch key, whether the capacitive touch key is pressed or not can be determined according to the capacitance variation and the capacitance variation rate. For how to determine whether the capacitive touch key is pressed according to the capacitance variation and the capacitance variation rate, reference may be made to subsequent embodiments, which are not described herein again.
According to the key detection method provided by the embodiment of the application, the touch induction data of at least two capacitive touch keys are obtained, and the capacitance variation rate corresponding to the capacitive touch keys are obtained according to the touch induction data aiming at each capacitive touch key; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate. According to the embodiment of the application, the capacitance variation quantity corresponding to each capacitive touch key is considered, and the capacitance variation rate corresponding to each capacitive touch key is combined, namely whether the capacitive touch keys are pressed down or not is determined according to the capacitance variation quantity and the capacitance variation rate, so that when a plurality of capacitive touch keys exist adjacently, the mutual interference among the keys can be greatly reduced, and the keys are prevented from being touched by mistake.
Fig. 3 is a flowchart of a key detection method according to another embodiment of the present application. On the basis of the above embodiments, the embodiments of the present application further explain how to perform key detection. As shown in fig. 3, the method of the embodiment of the present application may include:
s301, touch sensing data of at least two capacitive touch keys are obtained.
For a detailed description of this step, reference may be made to the related description of step S201 in the embodiment shown in fig. 2, and details are not repeated here.
In the embodiment of the present application, the step S202 in fig. 2 may be further refined into two steps S302 and S303 as follows:
s302, aiming at each capacitive touch key, acquiring a capacitance variation and a capacitance variation rate corresponding to the capacitive touch key according to touch induction data; and when the capacitance variation is larger than or equal to the capacitance variation threshold and the target difference is larger than or equal to the capacitance variation rate threshold, determining that the capacitive touch key is pressed down.
The target difference value is the difference value between the capacitance change rate and the maximum value of the capacitance change rate, and the maximum value of the capacitance change rate is the maximum value of the capacitance change rates corresponding to the at least two capacitive touch keys.
In this step, referring to step S202, for each capacitive touch key, according to the touch sensing data, the capacitance variation and the capacitance variation rate corresponding to the capacitive touch key may be obtained, so that the maximum value of the capacitance variation rate may be determined as the maximum value of the capacitance variation rates corresponding to the capacitive touch keys, and the target difference value is the difference value between the capacitance variation rate and the maximum value of the capacitance variation rate, where the target difference value is, for example, CK delta And (4) showing. Illustratively, the capacitance change threshold and the capacitance change rate threshold are touch parameters corresponding to capacitive touch keys loaded from a memory when the single chip microcomputer is powered on, and the capacitance change threshold is, for example, CR thr Indicating, for example, a threshold value of the rate of change of capacitance by CK delta_thr And (4) showing. For example, for each capacitive touch key, according to a capacitance variation and a capacitance variation threshold corresponding to the capacitive touch key, when the capacitance variation is greater than or equal to the capacitance variation threshold, a case that the capacitance variation of the plurality of capacitive touch keys is greater than or equal to the capacitance variation threshold, that is, a case that the plurality of capacitive touch keys are pressed simultaneously is considered, and therefore, the determination is performed simultaneously according to the target difference and the capacitance variation rate threshold. Can be prepared byIt is understood that the capacitive touch key corresponding to the maximum value of the capacitance change rate is a pressed capacitive touch key, the target difference value is a difference value between the capacitance change rate of the capacitive touch key corresponding to the maximum value of the capacitance change rate and the capacitance change rates of other adjacent capacitive touch keys, and when the target difference value is greater than or equal to the threshold value of the capacitance change rate, it is determined that the capacitive touch key corresponding to the maximum value of the capacitance change rate is pressed.
S303, aiming at each capacitive touch key, obtaining a capacitance variation and a capacitance variation rate corresponding to the capacitive touch key according to the touch induction data; and when the capacitance variation is smaller than the capacitance variation threshold value or the target difference value is smaller than the capacitance variation rate threshold value, determining that the capacitive touch key is not pressed down.
Based on the foregoing embodiment, in a possible implementation manner, for each capacitive touch key, according to a capacitance variation and a capacitance variation threshold corresponding to the capacitive touch key, when the capacitance variation is smaller than the capacitance variation threshold, it may be determined that the capacitive touch key is not pressed. In another possible implementation, for example, four capacitive touch keys are used, and considering that there may be a case where the capacitance variation of the multiple capacitive touch keys is greater than or equal to the capacitance variation threshold, that is, a case where the multiple capacitive touch keys are pressed simultaneously, the determination may be performed according to the target difference and the capacitance variation rate threshold, and when the target difference is smaller than the capacitance variation rate threshold, it is determined that the capacitive touch key is not pressed.
The steps S302 and S303 may be understood as validity determination of the capacitive touch key, where the capacitive touch key is pressed and may be understood as a valid key, and the capacitive touch key is not pressed and may be understood as an invalid key.
After determining that the capacitive touch key is pressed based on the step S302, each capacitive touch key may perform key learning through the following steps S304 to S306. The key learning is performed immediately after the capacitive touch keys are determined to be pressed (namely, the keys are effective), so that the capacitance change threshold value and the capacitance change rate threshold value are updated, thereby learning user habits and environments, rationalizing the capacitance change threshold value and the capacitance change rate threshold value, avoiding the influence on the effect of the capacitive touch keys due to errors caused by installation or different key habits of users, and simultaneously performing mutual learning among the capacitive touch keys can also reduce mutual interference among the keys.
S304, when the capacitive touch key is pressed, adjusting a capacitance change threshold corresponding to the capacitive touch key based on the capacitance change and the N historical capacitance changes of the capacitive touch key.
Wherein N is a non-negative integer.
In this step, the N historical capacitance variations of the capacitive touch key may be understood as the capacitance variations corresponding to the key pressed the last N times that are stored before the current time. Therefore, when it is determined that the capacitive touch key is pressed, the capacitance change threshold corresponding to the capacitive touch key may be adjusted based on the capacitance change amount and the N historical capacitance change amounts of the capacitive touch key.
Further, optionally, adjusting the capacitance change threshold corresponding to the capacitive touch key based on the capacitance change amount and N historical capacitance change amounts of the capacitive touch key may include: obtaining a second capacitance variation mean value based on the capacitance variation and the N historical capacitance variations of the capacitive touch key; and adjusting the capacitance change threshold corresponding to the capacitive touch key according to the second capacitance change mean value and the capacitance change threshold.
For example, if the nmax is 99, it can be determined that there are 100 capacitance variations at most according to the capacitance variations and N historical capacitance variations of the capacitive touch key, where N is 100 at most, and if N is less than 100, the capacitance variation corresponding to the capacitive touch key pressed N times last is taken. Obtaining a second capacitance variation average value corresponding to the n capacitance variations through the following formula five:
CR v2 =(CR 1 +CR 2 +…+CR n ) Formula v
Wherein, CR v2 Representing the mean value of the second capacitance variation, CR 1 To CR n Representing capacitive touchThe capacitance variation of the key and the N historical capacitance variations.
Adjusting the capacitance change threshold corresponding to the capacitive touch key according to the second capacitance change mean value and the capacitance change threshold, and obtaining the adjusted capacitance change threshold corresponding to the capacitive touch key through the following formula six:
CR thr_new_1 =CR thr +CR v2 x 0.8 formula six
Wherein, CR thr_new_1 And the capacitance change threshold value corresponding to the adjusted capacitance touch key is represented, and 0.8 is a capacitance change threshold value adjustment coefficient which can be set as required.
It can be understood that the adjusted capacitance change threshold corresponding to the capacitive touch key is used for determining whether the capacitive touch key is pressed according to the acquired touch sensing data of at least two capacitive touch keys at the next time. By adjusting the capacitance change threshold corresponding to the capacitive touch key, the triggering of the key can be ensured, and the interference of non-key touch can be reduced.
S305, when the capacitive touch key is determined to be pressed down, adjusting a capacitance change rate threshold corresponding to the capacitive touch key based on the capacitance change rate and the N historical capacitance change rates of the capacitive touch key.
Based on the above embodiment, the capacitance change rate threshold determines an error event when a plurality of capacitive touch keys are pressed simultaneously, and when the difference between the capacitance change rates of the capacitive touch key corresponding to the maximum value of the capacitance change rate and other adjacent capacitive touch keys is smaller than the capacitance change rate threshold, it is determined that the plurality of capacitive touch keys are pressed simultaneously and the plurality of capacitive touch keys are all invalid, that is, it is determined that the plurality of capacitive touch keys are not pressed. The N historical capacitance change rates of the capacitive touch key may be understood as the maximum value of the capacitance change rates of other keys at the same time when the key was pressed the last N times, which is stored before the current time. Therefore, when it is determined that the capacitive touch key is pressed, the capacitance change rate threshold corresponding to the capacitive touch key may be adjusted based on the capacitance change rate and the N historical capacitance change rates of the capacitive touch key.
Further, optionally, adjusting the threshold of the capacitance change rate corresponding to the capacitive touch key based on the capacitance change rate and N historical capacitance change rates of the capacitive touch key may include: obtaining a first capacitance change rate difference value based on the capacitance change rate and the maximum value of the capacitance change rates of other capacitance touch keys; acquiring N first historical capacitance change rates of the capacitive touch key; aiming at each first historical capacitance change rate, obtaining the maximum value of second historical capacitance change rates of other capacitive touch keys at the same time with the first historical capacitance change rate; obtaining N second capacitance change rate differences according to the N first historical capacitance change rates and the maximum value of the second historical capacitance change rates; and adjusting the capacitance change rate threshold corresponding to the capacitive touch key according to the first capacitance change rate difference and the N second capacitance change rate differences.
Illustratively, if the nmax is 99, according to the capacitance change rate and the N historical capacitance change rates of the capacitive touch key, it may be determined that there are at most 100 capacitance change rates, which are represented by N, where N is 100 at most, and if N is less than 100, the capacitance change rate when the capacitive touch key is pressed last N times is taken. And obtaining a capacitance change rate threshold value corresponding to the adjusted capacitive touch key through a seventh formula:
Figure BDA0003257444180000121
wherein CK delta_thr_new Indicating the adjusted capacitance change rate threshold, CK, corresponding to the capacitive touch key n Indicating the rate of change of capacitance, CK, of a capacitive touch key 1 To CK n-1 Representing N first historical rates of change, CK, of capacitive touch keys nmax Denotes the maximum value, CK, of the rate of change of capacitance of other capacitive touch keys when the capacitive touch key is pressed 1max To CK (n-1)max Representing the maximum of the second historical rates of change of capacitance for the N other capacitive touch keys at the same time as the first historical rate of change of capacitance,(CK n -CK nmax ) Representing a first rate of change of capacitance difference, (CK) 1 -CK 1max )+(CK 2 -CK 2max )+…+(CK (n-1) -CK (n-1)max ) And N second capacitance change rate difference values are represented, and 1.2 is a capacitance change rate threshold value adjusting coefficient which can be set as required.
It can be understood that the adjusted capacitance change rate threshold corresponding to the capacitive touch keys is used for determining whether the capacitive touch keys are pressed according to the acquired touch sensing data of at least two capacitive touch keys at the next time. By adjusting the capacitance change rate threshold corresponding to the capacitive touch key, most of key invalid events caused by error position touch and error events when multiple keys are pressed simultaneously can be shielded, meanwhile, the judgment rate of effective key events can be improved to the maximum extent, the fault tolerance rate can be improved, the key events can also take effect when the touch position deviation is determined, and the user experience can be greatly improved.
S306, when the capacitive touch key is determined to be pressed, obtaining a third capacitance variation mean value based on the capacitance variation of the capacitive touch key which is not pressed and the N historical capacitance variations of the capacitive touch key which is not pressed; and adjusting a capacitance change threshold corresponding to the capacitance touch key which is not pressed according to the third capacitance change average value.
In the step, when the capacitive touch key is determined to be pressed, the capacitance change threshold corresponding to other keys (namely, the capacitive touch key which is not pressed) is adjusted, so that the other keys cannot be pressed through the judgment of the capacitance change rate because the capacitive touch key is pressed, and particularly for some capacitance touch keys which are not commonly used, through key learning, the probability of triggering the keys by mistake can be reduced, the interference resistance is improved, the updating of the capacitance change threshold can be carried out, the sensitivity reduction caused by long-time non-use is reduced, and further the key failure can not be caused through the judgment of the capacitance change threshold. Illustratively, if the nmax is 99, then according to the capacitance variation of the non-pressed capacitive touch key and the N historical capacitance variations of the non-pressed capacitive touch key, it may be determined that there are 100 capacitance variations at most, where N is 100 at most, and if N is less than 100, then the capacitance variation corresponding to the nearest N times of non-pressed capacitive touch key when the adjacent key is pressed is taken. Therefore, when it is determined that the capacitive touch key is pressed, obtaining a third capacitance variation mean value based on the capacitance variations of the capacitive touch key which is not pressed and the N historical capacitance variations of the capacitive touch key which is not pressed; and adjusting a capacitance change threshold corresponding to the capacitance touch key which is not pressed according to the third capacitance change average value. Illustratively, the adjusted capacitance change threshold corresponding to the capacitance-type touch key that is not pressed is obtained by the following formula eight:
Figure BDA0003257444180000131
wherein, CR thr_new_2 Indicating a capacitance change threshold, CR, corresponding to the adjusted non-pressed capacitive touch key o1 To CR on Representing the capacitance variation of the capacitive touch key that is not pressed and the N historical capacitance variations of the capacitive touch key that is not pressed,
Figure BDA0003257444180000132
and the average value of the third capacitance variation is represented, and 1.2 is a capacitance variation threshold value adjusting coefficient which can be set as required.
It can be understood that the adjusted capacitance change threshold corresponding to the capacitance touch key that is not pressed is used for determining whether the capacitance touch key is pressed according to the acquired touch sensing data of at least two capacitance touch keys at the next time. By adjusting the capacitance change threshold corresponding to the capacitance touch key which is not pressed down, the false touch probability caused by the fact that the adjacent key is pressed down can be reduced, and the key sensitivity of the capacitance touch key which is not pressed down can be learned.
And S307, if the pressed duration time of the capacitive touch key is greater than or equal to the time length threshold, adjusting a capacitance reference value corresponding to the capacitive touch key according to the difference value between the capacitance value of the capacitive touch key and the capacitance variation.
In this step, the capacitive touch key is pressed, but is not released for a long time, and key timeout learning is required. The key overtime learning is used for solving the problem that other capacitive touch keys are invalid when some positions of the capacitive touch key panel are covered by water drops, damaged and stuck by other substances or are pressed by other things and block the touch panel. Considering that the capacitive touch key can work normally when the interference substances disappear, only the capacitance reference value corresponding to the capacitive touch key is adjusted, and the capacitance change threshold value or the capacitance change rate threshold value is not modified. Because the capacitance reference value corresponding to the capacitive touch key is continuously learned, and the influence of the pressed capacitive touch key can be reduced, the capacitive touch key cannot occur any more when the capacitive touch key is not released. Illustratively, the duration threshold may be set as desired. And obtaining a capacitance reference value corresponding to the adjusted capacitive touch key through the following formula nine:
C baseline_new_1 =C total - (CR X0.8) formula nine
Wherein, C baseline_new_1 And the reference value of the capacitance corresponding to the adjusted capacitive touch key is represented, and 0.8 is a reference value adjustment coefficient of the capacitance and can be set as required.
By adjusting the capacitance reference value corresponding to the capacitive touch key, the new capacitance reference value can be directly increased to a height of 80% of the current capacitance reference value (because CR = C) total -C baseline ) Therefore, the capacitance change threshold value cannot be judged, and learning space is provided.
And S308, if the pressed duration time of the capacitive touch key is greater than or equal to the duration time threshold, adjusting the capacitance reference value corresponding to the capacitive touch key which is not pressed according to the sum of the capacitance reference value corresponding to the capacitive touch key which is not pressed and the capacitance variation.
In this step, if the duration of the pressing of the capacitive touch key is greater than or equal to the time threshold, the capacitive touch key that is not pressed needs to be subjected to key overtime learning. And obtaining a capacitance reference value corresponding to the adjusted capacitance touch key which is not pressed through the following formula ten:
C baseline_new_2 =C baseline + (CR.times.0.5) equation ten
Wherein, C baseline_new_2 And the adjusted capacitance reference value corresponding to the capacitance touch key which is not pressed is represented, and 0.5 is a capacitance reference value adjustment coefficient which can be set as required.
By adjusting the capacitance reference value corresponding to the capacitance-type touch key which is not pressed down, the capacitance reference value corresponding to the capacitance-type touch key which is not pressed down can be quickly increased by half of the capacitance variation, so that the judgment of mistaken touch of the key can be reduced, and the normal use of the key can be ensured.
S309, when it is determined that at least two capacitive touch keys are not pressed, aiming at each capacitive touch key, adjusting the capacitance reference value of the capacitive touch key according to the sum of the capacitance reference value and the capacitance variation corresponding to the capacitive touch key and L historical capacitance variations corresponding to the capacitive touch key when the capacitive touch key is not pressed.
Wherein L is a positive integer.
In the step, when it is determined that at least two capacitive touch keys are not pressed, each capacitive touch key needs to be statically learned to update a capacitance reference value of the capacitive touch key, so that the problems of key aging or key touch insensitivity caused by long-time key nonuse are prevented. For example, if L is 3, the adjusted capacitance reference value of the capacitive touch key is obtained according to the following formula eleven:
C baseline_new_3 =C baseline +CR×0.05+CR 1 ×0.03+CR 2 ×0.01+CR 3 x 0.005 formula eleven
Wherein, C baseline_new_3 A reference value of capacitance, CR, representing the adjusted capacitive touch key 1 To CR 3 Represents 3 historical capacitance variation corresponding to the capacitance type touch key which is not pressed, wherein CR is 1 To CR 3 Each of which isEach capacitance variation is less than the corresponding capacitance variation threshold, CR 1 To CR 3 The time sequence obtained is the sequence from near to far from the current time, such as CR 1 And 0.05, 0.03, 0.01 and 0.005 are capacitance reference value adjusting coefficients which are corresponding to the capacitance variation when the capacitive touch key is not pressed for the last time before the current time and can be set as required.
It should be noted that, considering that there may be a plurality of capacitive touch keys pressed simultaneously, it may be determined that no capacitive touch key is pressed by the target difference value and the capacitance change rate threshold, and in this case, each capacitive touch key does not perform static learning.
According to the key detection method provided by the embodiment of the application, the touch induction data of at least two capacitive touch keys are obtained, and the capacitance variation rate corresponding to the capacitive touch keys are obtained according to the touch induction data aiming at each capacitive touch key; when the capacitance variation is larger than or equal to the capacitance variation threshold and the target difference is larger than or equal to the capacitance variation rate threshold, determining that the capacitive touch key is pressed, and when the capacitance variation is smaller than the capacitance variation threshold or the target difference is smaller than the capacitance variation rate threshold, determining that the capacitive touch key is not pressed; when the capacitive touch key is determined to be pressed, adjusting a capacitance change threshold corresponding to the capacitive touch key based on the capacitance change amount and N historical capacitance change amounts of the capacitive touch key, adjusting a capacitance change rate threshold corresponding to the capacitive touch key based on the capacitance change rate and the N historical capacitance change rates of the capacitive touch key, and obtaining a third capacitance change average value based on the capacitance change amount of the capacitive touch key which is not pressed and the N historical capacitance change amounts of the capacitive touch key which is not pressed; adjusting a capacitance change threshold corresponding to the capacitance touch key which is not pressed according to the third capacitance change average value; if the pressed duration time of the capacitive touch key is greater than or equal to the duration threshold, adjusting a capacitance reference value corresponding to the capacitive touch key according to a difference value between a capacitance value and a capacitance variation of the capacitive touch key, and adjusting a capacitance reference value corresponding to the capacitive touch key which is not pressed according to a sum of the capacitance reference value and the capacitance variation corresponding to the capacitive touch key which is not pressed; when it is determined that at least two capacitive touch keys are not pressed, for each capacitive touch key, the capacitance reference value of the capacitive touch key is adjusted according to the sum of the capacitance reference value and the capacitance variation corresponding to the capacitive touch key and L historical capacitance variations corresponding to the capacitive touch key when the capacitive touch key is not pressed. According to the embodiment of the application, whether the capacitive touch keys are pressed or not is determined according to the capacitance variation and the capacitance variation rate, when the capacitive touch keys are determined to be pressed, the capacitive touch keys perform key learning, when the capacitive touch keys are pressed for a long time, key overtime learning is performed, and when the capacitive touch keys are not pressed, static learning is performed.
On the basis of the foregoing embodiment, for each capacitive touch key, exemplarily, fig. 4 is a flowchart of a validity determination of the capacitive touch key provided in an embodiment of the present application, and as shown in fig. 4, a method in an embodiment of the present application may include:
s401, obtaining a capacitance value C of the capacitive touch key total
S402, acquiring the capacitance change amount CR and the capacitance change rate CK.
S403, judging whether the capacitance variation CR is larger than or equal to the capacitance variation threshold CR thr
If CR is less than CR thr If yes, go to step S404; if CR is greater than or equal to CR thr Then, steps S405 to S407 are executed.
And S404, determining that the key is invalid.
The key is not valid, i.e. the capacitive touch key is not pressed.
S405, obtaining a target difference CK delta
For a detailed description of this step, reference may be made to the related description of the step S302 in the embodiment shown in fig. 3, and details are not repeated here.
S406, judging the target difference CK delta Whether or not it is greater than or equal to the threshold value CK of rate of change of capacitance delta_thr
If CK delta Is greater than or equal to CK delta_thr If yes, executing step S407; if CK delta Less than CK delta_thr Then step S404 is performed.
And S407, determining that the key is valid.
The key is valid, i.e. the capacitive touch key is pressed.
On the basis of the above embodiment, optionally, the number of times that the capacitive touch key is continuously pressed is determined; if the times are larger than or equal to the time threshold value, determining that the capacitive touch key is pressed; and if the times are less than the times threshold value, determining that the capacitive touch key is not pressed.
Illustratively, the number threshold is, for example, 3. After the capacitive touch key is continuously pressed for 3 times, the capacitive touch key is pressed; and if the times are less than 3, determining that the capacitive touch key is not pressed. Through the mode, the capacitive touch key can be prevented from being touched by mistake, and whether the capacitive touch key is pressed down or not can be determined more accurately.
On the basis of the foregoing embodiment, for example, in order to ensure that whether the capacitive touch key is pressed or not is determined more accurately, fig. 5 is a flowchart of a key detection method according to another embodiment of the present application. As shown in fig. 5, the method of the embodiment of the present application may include:
and S501, acquiring touch induction data of the four capacitive touch keys at preset time intervals.
If the preset time interval is 100ms, for example, touch sensing data of four capacitive touch keys are collected for 100 ms.
S502, converting the touch induction data of the four capacitive touch keys into corresponding capacitance data respectively.
For a detailed description of this step, reference may be made to the related description of the step S202 in the embodiment shown in fig. 2, and details are not repeated here.
And S503, judging the validity of the capacitive touch keys aiming at the capacitive touch keys.
For a detailed description of this step, reference may be made to the description related to the embodiment shown in fig. 4, which is not described herein again.
S504, determining whether validity judgment is passed.
If the validity does not pass the judgment, executing the steps S505 and S506; if the validity is judged, the relevant steps from S507 to S512 are executed.
And S505, determining that the capacitive touch key is invalid, clearing the times of validity judgment, setting the times to be in a key-free state, and storing the updated parameters.
In this step, no key state, i.e. none of the capacitive touch keys, is pressed.
And S506, performing static learning by using the capacitive touch keys.
For a detailed description of this step, reference may be made to the related description of the step S309 in the embodiment shown in fig. 3, and details are not repeated here. After the capacitive touch key completes static learning, the step S501 is continuously executed.
And S507, accumulating and adding a preset value according to the frequency of validity judgment.
The preset value is for example 1.
And S508, judging whether the frequency judged by the validity is greater than or equal to a frequency threshold value.
The number threshold is, for example, 3 times. If the number of times of validity judgment is greater than or equal to 3, executing the relevant steps from S509 to S512; if the number of times of passing the validity judgment is less than 3, the step S501 is executed.
And S509, determining that the capacitive touch key is valid and setting the capacitive touch key to be in a key valid state.
And S510, performing key learning by using the capacitive touch keys.
For a detailed description of this step, reference may be made to the related description of steps S304 to S306 in the embodiment shown in fig. 3, and details are not repeated here.
And S511, judging whether the pressed duration time of the capacitive touch key is greater than or equal to a time length threshold value.
The duration threshold is, for example, 5 seconds. If the duration time for which the capacitive touch key is pressed is greater than or equal to 5 seconds, executing step S512; if the duration of the pressing of the capacitive touch key is less than 5 seconds, the step S501 is executed.
And S512, performing key overtime learning by the capacitive touch keys.
For a detailed description of this step, reference may be made to the related description of steps S307 and S308 in the embodiment shown in fig. 3, and details are not described here again.
After the capacitive touch key is used for key overtime learning, the step S501 is continuously executed.
Fig. 6 is a flowchart of performing key detection by the single chip microcomputer according to an embodiment of the present application. As shown in fig. 6, the method of the embodiment of the present application may include:
and S601, running a single chip microcomputer program, and loading touch parameters corresponding to the capacitive touch keys.
And S602, collecting capacitance data of each capacitive touch key of the touch IC.
And S603, judging the effectiveness of each capacitive touch key.
And S604, performing corresponding learning on each capacitive touch key according to the effectiveness judgment result.
And S605, adjusting the corresponding touch parameters of the capacitive touch keys, and storing the adjusted touch parameters.
On the basis of the above embodiment, optionally, the touch IC may be another signal touch chip or a hardware resistance-Capacitance circuit (Resistor-capacitor circuit) touch scheme; the sampling frequency may be, for example, to collect touch sensing data of each capacitive touch key every 50 ms; the number threshold is, for example, 4; the capacitance reference value adjustment coefficient can be set as required, for example, from 0.8 to 0.9.
In summary, the technical solution provided by the present application has at least the following advantages:
(1) Through the study of big data, the more the key is used, the better the key is used, and the self-study is carried out according to the touch characteristic and the installation environment, so that the key is more convenient and simpler to touch, and the problem of difficult touch caused by installation deviation or the problem of touch panel replacement and inconsistent change strength when the key is pressed by a person is reduced.
(2) Through mutual learning among the touch keys, even the touch keys which are not commonly used can be learned and adjusted when other touch keys are pressed, the problem that the touch keys cannot be used due to aging is prevented, meanwhile, the sensitivity of the touch keys can be kept, and the service life of the touch keys is prolonged.
(3) When one touch key is invalid, other touch keys can be quickly adjusted, interference caused by the touch keys is reduced, and influence and loss are reduced.
(4) The self-learning of the touch key can keep the sensitivity and the anti-interference performance of the touch key, the good balance between the false touch and the sensitivity is always kept, the use experience of a user is improved, and the service life of the user is prolonged.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 7 is a schematic structural diagram of a key detection device according to an embodiment of the present application, which is suitable for key detection of at least two adjacent capacitive touch keys. As shown in fig. 7, a key detection apparatus 700 according to an embodiment of the present application includes: an acquisition module 701 and a processing module 702. Wherein:
the obtaining module 701 is configured to obtain touch sensing data of at least two capacitive touch keys.
The processing module 702 is configured to, for each capacitive touch key, obtain, according to the touch sensing data, a capacitance variation and a capacitance variation rate corresponding to the capacitive touch key, where the capacitance variation rate is a ratio of the capacitance variation to a first mean value of the capacitance variations, and the first mean value of the capacitance variations is a mean value of the capacitance variations of at least two capacitive touch keys; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate.
In some embodiments, the processing module 702 may be specifically configured to: when the capacitance variation is greater than or equal to the capacitance variation threshold and the target difference is greater than or equal to the capacitance variation rate threshold, determining that the capacitive touch key is pressed, wherein the target difference is the difference between the capacitance variation rate and the maximum value of the capacitance variation rate, and the maximum value of the capacitance variation rate is the maximum value of the capacitance variation rates corresponding to at least two capacitive touch keys; or when the capacitance variation is smaller than the capacitance variation threshold, or the target difference is smaller than the capacitance variation rate threshold, determining that the capacitive touch key is not pressed.
Fig. 8 is a schematic structural diagram of a key detection device according to another embodiment of the present application. As shown in fig. 8, the key detection apparatus 800 according to the embodiment of the present application may further include, on the basis of the apparatus structure shown in fig. 7:
the adjusting module 703 is configured to, when it is determined that the capacitive touch key is pressed, adjust a capacitance change threshold corresponding to the capacitive touch key based on the capacitance change amount and N historical capacitance change amounts of the capacitive touch key, where N is a non-negative integer.
In some embodiments, the adjusting module 703 may be specifically configured to: obtaining a second capacitance variation mean value based on the capacitance variation and the N historical capacitance variations of the capacitive touch key; and adjusting the capacitance change threshold corresponding to the capacitive touch key according to the second capacitance change mean value and the capacitance change threshold.
Optionally, the adjusting module 703 may be further configured to: when the capacitive touch key is determined to be pressed, adjusting a capacitance change rate threshold corresponding to the capacitive touch key based on the capacitance change rate and the N historical capacitance change rates of the capacitive touch key.
Optionally, the adjusting module 703 may be specifically configured to: obtaining a first capacitance change rate difference value based on the capacitance change rate and the maximum value of the capacitance change rates of other capacitance touch keys; acquiring N first historical capacitance change rates of the capacitive touch key; aiming at each first historical capacitance change rate, obtaining the maximum value of second historical capacitance change rates of other capacitive touch keys at the same time as the first historical capacitance change rate; obtaining N second capacitance change rate differences according to the N first historical capacitance change rates and the maximum value of the second historical capacitance change rates; and adjusting the capacitance change rate threshold corresponding to the capacitive touch key according to the first capacitance change rate difference and the N second capacitance change rate differences.
Optionally, the adjusting module 703 may be further configured to: when the capacitive touch key is determined to be pressed, obtaining a third capacitance variation mean value based on the capacitance variation of the capacitive touch key which is not pressed and the N historical capacitance variations of the capacitive touch key which is not pressed; and adjusting a capacitance change threshold corresponding to the capacitance touch key which is not pressed according to the third capacitance change average value.
Optionally, the adjusting module 703 may be further configured to: and if the pressed duration time of the capacitive touch key is greater than or equal to the duration time threshold, adjusting a capacitance reference value corresponding to the capacitive touch key according to the difference value between the capacitance value of the capacitive touch key and the capacitance variation.
Optionally, the adjusting module 703 may be further configured to: and if the pressed duration time of the capacitive touch key is greater than or equal to the duration threshold, adjusting the capacitance reference value corresponding to the capacitive touch key which is not pressed according to the sum of the capacitance reference value corresponding to the capacitive touch key which is not pressed and the capacitance variation.
Optionally, the processing module 702 may further be configured to: determining the number of times that the capacitive touch key is continuously pressed; if the times are larger than or equal to the times threshold value, determining that the capacitive touch key is pressed down; and if the times are less than the times threshold value, determining that the capacitive touch key is not pressed.
Optionally, the adjusting module 703 may be further configured to: when it is determined that at least two capacitive touch keys are not pressed, for each capacitive touch key, adjusting a capacitance reference value of the capacitive touch key according to a sum of the capacitance reference value and the capacitance variation corresponding to the capacitive touch key and L historical capacitance variations corresponding to the capacitive touch key when the capacitive touch key is not pressed, wherein L is a positive integer.
The apparatus of this embodiment may be configured to implement the technical solution of any one of the above-mentioned method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the application. Illustratively, the electronic device may be provided as a device comprising at least two adjacently located capacitive touch keys. Referring to fig. 9, electronic device 900 includes a processing component 901 that further includes one or more processors and memory resources, represented by memory 902, for storing instructions, e.g., applications, that are executable by processing component 901. The application programs stored in memory 902 may include one or more modules that each correspond to a set of instructions. Furthermore, the processing component 901 is configured to execute instructions to perform any of the above-described method embodiments.
The electronic device 900 may also include a power component 903 configured to perform power management for the electronic device 900, a wired or wireless network interface 904 configured to connect the electronic device 900 to a network, and an input/output (I/O) interface 905. The electronic device 900 may operate based on an operating system stored in memory 902, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
The application also provides a computer readable storage medium, in which computer execution instructions are stored, and when the processor executes the computer execution instructions, the scheme of the key detection method is implemented.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements an aspect of the key detection method as above.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or 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 or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the key detection apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (15)

1. A key detection method is suitable for key detection of at least two capacitive touch keys adjacent to each other in position, and comprises the following steps:
acquiring touch sensing data of at least two capacitive touch keys;
for each capacitive touch key, obtaining a capacitance variation and a capacitance variation rate corresponding to the capacitive touch key according to the touch sensing data, wherein the capacitance variation rate is a ratio of the capacitance variation to a first mean value of the capacitance variation, and the first mean value of the capacitance variation is a mean value of the capacitance variations of the at least two capacitive touch keys; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate.
2. The method according to claim 1, wherein said determining whether the capacitive touch key is pressed according to the capacitance variation and the capacitance variation rate comprises:
when the capacitance variation is greater than or equal to a capacitance variation threshold and a target difference value is greater than or equal to a capacitance variation rate threshold, determining that the capacitive touch key is pressed, wherein the target difference value is the difference value between the capacitance variation rate and the maximum value of the capacitance variation rate, and the maximum value of the capacitance variation rate is the maximum value of the capacitance variation rates corresponding to the at least two capacitive touch keys;
or when the capacitance variation is smaller than the capacitance variation threshold or the target difference is smaller than the capacitance variation rate threshold, determining that the capacitive touch key is not pressed down.
3. The key detection method according to claim 1 or 2, further comprising:
when the capacitive touch key is determined to be pressed, adjusting a capacitance change threshold corresponding to the capacitive touch key based on the capacitance change and N historical capacitance changes of the capacitive touch key, wherein N is a non-negative integer.
4. The method according to claim 3, wherein the adjusting a capacitance change threshold corresponding to the capacitive touch key based on the capacitance change and N historical capacitance changes of the capacitive touch key comprises:
obtaining a second capacitance variation mean value based on the capacitance variations and the N historical capacitance variations of the capacitive touch key;
and adjusting the capacitance change threshold corresponding to the capacitive touch key according to the second capacitance change mean value and the capacitance change threshold.
5. The key detection method according to claim 1 or 2, further comprising:
when the capacitive touch key is determined to be pressed, adjusting a capacitance change rate threshold value corresponding to the capacitive touch key based on the capacitance change rate and the N historical capacitance change rates of the capacitive touch key.
6. The method according to claim 5, wherein the adjusting a threshold of a capacitance change rate corresponding to the capacitive touch key based on the capacitance change rate and N historical capacitance change rates of the capacitive touch key comprises:
obtaining a first capacitance change rate difference value based on the capacitance change rate and the maximum value of the capacitance change rates of the other capacitance touch keys;
acquiring N first historical capacitance change rates of the capacitive touch key;
acquiring the maximum value of second historical capacitance change rates of other capacitive touch keys at the same time as the first historical capacitance change rate aiming at each first historical capacitance change rate;
obtaining N second capacitance change rate differences according to the maximum value of the N first historical capacitance change rates and the second historical capacitance change rate;
and adjusting a capacitance change rate threshold corresponding to the capacitive touch key according to the first capacitance change rate difference and the N second capacitance change rate differences.
7. The key detection method according to claim 1 or 2, further comprising:
when the capacitive touch key is determined to be pressed, obtaining a third capacitance variation mean value based on the capacitance variation of the capacitive touch key which is not pressed and the N historical capacitance variations of the capacitive touch key which is not pressed;
and adjusting a capacitance change threshold corresponding to the capacitance touch key which is not pressed according to the third capacitance change average value.
8. The key detection method according to claim 1 or 2, further comprising:
and if the pressed duration time of the capacitive touch key is greater than or equal to a duration threshold, adjusting a capacitance reference value corresponding to the capacitive touch key according to the difference value between the capacitance value of the capacitive touch key and the capacitance variation.
9. The key detection method according to claim 1 or 2, further comprising:
and if the duration time of the pressed capacitive touch key is greater than or equal to the duration threshold, adjusting the capacitance reference value corresponding to the non-pressed capacitive touch key according to the sum of the capacitance reference value corresponding to the non-pressed capacitive touch key and the capacitance variation.
10. The key detection method according to claim 1 or 2, further comprising:
determining the number of times that the capacitive touch key is continuously pressed;
if the times are larger than or equal to a time threshold value, determining that the capacitive touch key is pressed down;
and if the times are smaller than the times threshold value, determining that the capacitive touch key is not pressed.
11. The key detection method according to claim 1 or 2, further comprising:
when it is determined that the at least two capacitive touch keys are not pressed, for each capacitive touch key, adjusting a capacitance reference value of the capacitive touch key according to a sum of the capacitance reference value corresponding to the capacitive touch key and the capacitance variation and L historical capacitance variations corresponding to the capacitive touch key when the capacitive touch key is not pressed, wherein L is a positive integer.
12. A key detection device is suitable for key detection of at least two capacitive touch keys adjacent in position, and comprises:
the acquisition module is used for acquiring touch sensing data of at least two capacitive touch keys;
the processing module is used for obtaining capacitance variation and capacitance variation rate corresponding to the capacitive touch keys according to the touch sensing data for each capacitive touch key, wherein the capacitance variation rate is a ratio of the capacitance variation to a first capacitance variation mean value, and the first capacitance variation mean value is a mean value of the capacitance variation of the at least two capacitive touch keys; and determining whether the capacitive touch key is pressed or not according to the capacitance variation and the capacitance variation rate.
13. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the key detection method of any one of claims 1 to 11.
14. A computer readable storage medium having computer program instructions stored therein which, when executed, implement the key detection method of any one of claims 1 to 11.
15. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the key detection method of any one of claims 1 to 11.
CN202111063881.8A 2021-09-10 2021-09-10 Key detection method, device, equipment and storage medium Pending CN115800988A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111063881.8A CN115800988A (en) 2021-09-10 2021-09-10 Key detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111063881.8A CN115800988A (en) 2021-09-10 2021-09-10 Key detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115800988A true CN115800988A (en) 2023-03-14

Family

ID=85416852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111063881.8A Pending CN115800988A (en) 2021-09-10 2021-09-10 Key detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115800988A (en)

Similar Documents

Publication Publication Date Title
RU2461049C2 (en) Touch sensor device, control method, touchpad and programme
US8570293B2 (en) Noise reduction method and system for touch detection device
US9377907B2 (en) Self capacitance implementation method
CN103677452A (en) Capacitive touch screen calibration method and capacitive touch device
US9568526B2 (en) Noise detection and correction routines
US20150049064A1 (en) Method of calibrating sensitivity of a touch input device and touch input device employing the same
US20130342497A1 (en) Detection method, device and system for detecting self-capacitance touch screen
WO2014086211A1 (en) Method, system, and touch terminal for updating standard of touch screen
KR20130113181A (en) Touch sensing device and control method thereof
Kumar et al. Improved Shewhart-type charts for monitoring times between events
WO2018000343A1 (en) Method and device for preventing touch screen edge misoperation
US8797277B1 (en) Method for multiple touch position estimation
US20070124674A1 (en) Motion detection system and motion detection method
US9377883B2 (en) Touch sensing method, recording medium in which program for realizing the same is recorded, and touch sensing system
CN113253878A (en) Touch screen report point determining method and device, electronic equipment and storage medium
JP2016095648A (en) Input device
CN110658935B (en) Data detection method and device, storage medium and touch device
KR102013592B1 (en) Touch sensing system and touch sensing method
TWI416396B (en) Touch point detecting method
CN115800988A (en) Key detection method, device, equipment and storage medium
US8072356B2 (en) Capacitive sensing user interfaces and implementation thereof
CN111953326A (en) Dynamic adjustment method for key touch threshold and touch key display screen
US10860150B1 (en) Touch system, operation method, and non-transitory computer readable storage medium
US20170052626A1 (en) Touch Sensing Device Capable of Detecting Speed
EP4350490A1 (en) Capacitive touch screen calibration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20231012

Address after: 325600 291 weft seventeen Road, Yueqing Economic Development Zone, Wenzhou, Zhejiang

Applicant after: Goldcard Smart Group Co.,Ltd.

Applicant after: Tancy Instrument Group Co.,Ltd.

Address before: 325600 291 weft seventeen Road, Yueqing Economic Development Zone, Wenzhou, Zhejiang

Applicant before: Goldcard Smart Group Co.,Ltd.

TA01 Transfer of patent application right