CN108259044B - Touch key scanning method and device and computer readable storage medium - Google Patents

Touch key scanning method and device and computer readable storage medium Download PDF

Info

Publication number
CN108259044B
CN108259044B CN201810162623.7A CN201810162623A CN108259044B CN 108259044 B CN108259044 B CN 108259044B CN 201810162623 A CN201810162623 A CN 201810162623A CN 108259044 B CN108259044 B CN 108259044B
Authority
CN
China
Prior art keywords
touch key
duration
touch
charging
time length
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.)
Active
Application number
CN201810162623.7A
Other languages
Chinese (zh)
Other versions
CN108259044A (en
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.)
Shanghai Eastsoft Microelectronics Co ltd
Original Assignee
Shanghai Eastsoft Microelectronics 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 Shanghai Eastsoft Microelectronics Co ltd filed Critical Shanghai Eastsoft Microelectronics Co ltd
Priority to CN201810162623.7A priority Critical patent/CN108259044B/en
Publication of CN108259044A publication Critical patent/CN108259044A/en
Application granted granted Critical
Publication of CN108259044B publication Critical patent/CN108259044B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M11/00Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
    • H03M11/20Dynamic coding, i.e. by key scanning
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K17/00Electronic switching or gating, i.e. not by contact-making and –breaking
    • H03K17/94Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
    • H03K17/96Touch switches
    • H03K17/962Capacitive touch switches
    • H03K17/9622Capacitive touch switches using a plurality of detectors, e.g. keyboard
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K2217/00Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00
    • H03K2217/0036Means reducing energy consumption

Abstract

A touch key scanning method and device and a computer readable storage medium are provided, wherein the method comprises the following steps: when the current state of low power consumption is detected and the current moment is in the awakening period corresponding to the low power consumption state, controlling the switch circuits corresponding to all the touch keys to be closed; acquiring a first charging time length of a reference capacitor, and judging whether a trigger event exists according to the first charging time length, wherein the first charging time length is related to the sum of induction capacitors corresponding to all touch keys; the touch keys, the switch circuits and the induction capacitors are all in one-to-one correspondence. According to the scheme, the scanning time of the touch key in the sleep mode can be reduced, and the power consumption of the touch key control chip is reduced.

Description

Touch key scanning method and device and computer readable storage medium
Technical Field
The present invention relates to the field of touch key control, and in particular, to a touch key scanning method and apparatus, and a computer-readable storage medium.
Background
At present, a common touch key is mostly based on a capacitance sensing method to sense whether a touch operation is triggered, and a basic principle of the capacitance sensing method is that a capacitance value of a sensing capacitor Cp is changed based on a touch of a finger. In the prior art, the capacitance sensing method generally adopts a charge transfer method. For the charge transfer method, a reference capacitor Cx exists, and the variation of the capacitor on the capacitor Cp is detected by measuring the variation of the charging time of the Cp to the Cx, so as to judge whether a key event is generated, namely whether a key is triggered.
The existing touch key control chip adopting a charge transfer method generally adopts a channel polling method to scan keys and judge whether a trigger event is generated. The channel polling method is that only one touch channel is controlled to be opened for key scanning at the same time, only one comparator is in a working state, and a plurality of comparators are not required to work simultaneously.
In practical application, the touch key control chip has two working modes: a sleep mode and an operational mode. In the prior art, in a sleep mode, when a channel polling method is adopted to detect whether a touch key is triggered, the scanning time is long, and the power consumption is high.
Disclosure of Invention
The embodiment of the invention solves the problem of how to reduce the scanning time of the touch key in the sleep mode and reduce the power consumption of the touch key control chip.
To solve the above technical problem, an embodiment of the present invention provides a touch key scanning method, including: when the current state of low power consumption is detected and the current moment is in the awakening period corresponding to the low power consumption state, controlling the switch circuits corresponding to all the touch keys to be closed; acquiring a first charging time length of a reference capacitor, and judging whether a trigger event exists according to the first charging time length, wherein the first charging time length is related to the sum of induction capacitors corresponding to all touch keys; the touch keys, the switch circuits and the induction capacitors are all in one-to-one correspondence.
Optionally, the determining whether a trigger event exists according to the first charging duration includes: subtracting a preset first baseline duration from the first charging duration, and comparing the obtained difference with a preset first threshold; when the obtained difference value is larger than the first threshold value, judging that a trigger event exists; when the obtained difference value is not larger than the first threshold value, judging that no trigger event exists; the first baseline duration is: and when the triggering event does not exist, the induction capacitors corresponding to all the touch keys charge the reference capacitor for the required time length to the preset voltage value.
Optionally, the touch key scanning method further includes: and when the trigger event does not exist, setting the first charging time length as a first baseline time length corresponding to the next awakening period.
Optionally, after determining that the triggering event exists, the method further includes: controlling the switch circuits corresponding to all the touch keys to be switched from a closed state to an open state; sequentially controlling the switch circuits corresponding to all the touch keys to be sequentially closed; when one of the switch circuits is in a closed state, the other switch circuits are in an open state; and determining the touch key with the trigger event according to the second charging duration of the reference capacitor corresponding to the closed switch circuit.
Optionally, the determining, according to the second charging duration of the reference capacitor corresponding to when each switch circuit is closed, that the touch key has the trigger event includes: controlling a switch circuit i corresponding to the ith touch key to be closed, and switching circuits corresponding to other touch keys to be opened; acquiring a second charging time duration Ti of the reference capacitor when the switch circuit i is closed; determining whether the ith touch key is triggered or not according to the second charging time length Ti and a preset second baseline time length; i is a positive integer and is not more than N, and N is the total number of the touch keys; the second baseline duration is: and when no trigger event exists, the induction capacitor corresponding to the ith touch key charges the reference capacitor for the required time length to the preset voltage value.
Optionally, the determining whether the ith touch key is triggered according to the second charging duration Ti and a preset second baseline duration includes: subtracting the second baseline duration from the second charging duration Ti, and comparing the obtained difference with a preset second threshold; when the obtained difference value is larger than the second threshold value, judging that the ith touch key is triggered; and when the obtained difference value is not larger than the second threshold value, judging that the ith touch key is not triggered.
Optionally, subtracting the second baseline duration from the second charging duration Ti includes: and filtering the second charging duration Ti, subtracting the filtered second charging duration Ti from the second baseline duration, and comparing the obtained difference with the second threshold.
Optionally, any one of the following filtering manners is adopted to perform filtering processing on the second charging duration Ti: average filtering and median filtering.
Optionally, the touch key scanning method further includes: and after the ith touch key is determined not to be triggered, setting the second charging time length Ti as a second baseline time length corresponding to the next awakening period.
Optionally, the touch key scanning method further includes: and after the triggering event is judged to exist, switching the current state from the low power consumption state to the working state.
Optionally, after switching the current state from the low power consumption state to the operating state, the method further includes: and when the condition that the duration that the touch key is not triggered reaches the preset duration is detected, switching from the working state to the low-power consumption state.
The embodiment of the present invention further provides a touch key scanning device, including: the control unit is used for controlling the switch circuits corresponding to all the touch keys to be closed when detecting that the touch keys are in the low power consumption state at present and are in the wake-up period corresponding to the low power consumption state at present; the acquisition unit is used for acquiring a first charging time length of the reference capacitor; the judging unit is used for judging whether a trigger event exists according to the first charging time length, and the first charging time length is related to the sum of the induction capacitors corresponding to all the touch keys; the touch keys, the switch circuits and the induction capacitors are all in one-to-one correspondence.
Optionally, the determining unit is configured to subtract a preset first baseline duration from the first charging duration, and compare an obtained difference with a preset first threshold; when the obtained difference value is larger than the first threshold value, judging that a trigger event exists; when the obtained difference value is not larger than the first threshold value, judging that no trigger event exists; the first baseline duration is: and when the triggering event does not exist, the induction capacitors corresponding to all the touch keys charge the reference capacitor for the required time length to the preset voltage value.
Optionally, the touch key scanning device further includes: and the first setting unit is used for setting the first charging duration as a first baseline duration corresponding to the next awakening period when the judging unit judges that the triggering event does not exist.
Optionally, the touch key scanning device further includes: the touch key determining unit is used for controlling the switch circuits corresponding to all the touch keys to be switched from a closed state to an open state after the judging unit judges that the trigger event exists; sequentially controlling the switch circuits corresponding to all the touch keys to be sequentially closed; when one of the switch circuits is in a closed state, the other switch circuits are in an open state; and determining the touch key with the trigger event according to the second charging duration of the reference capacitor corresponding to the closed switch circuit.
Optionally, the touch key determining unit is configured to control a switch circuit i corresponding to the ith touch key to be closed, and switch circuits corresponding to other touch keys to be opened; acquiring a second charging time duration Ti of the reference capacitor when the switch circuit i is closed; determining whether the ith touch key is triggered or not according to the second charging time length Ti and a preset second baseline time length; i is a positive integer and is not more than N, and N is the total number of the touch keys; the second baseline duration is: and when no trigger event exists, the induction capacitor corresponding to the ith touch key charges the reference capacitor for the required time length to the preset voltage value.
Optionally, the touch key determining unit is configured to perform filtering processing on the second charging duration Ti, subtract the second baseline duration from the filtered second charging duration Ti, and compare an obtained difference with the second threshold.
Optionally, the touch key determining unit is configured to filter the second charging duration Ti, subtract the second baseline duration Ti from the filtered second charging duration Ti, and compare an obtained difference with a preset second threshold; and when the obtained difference value is larger than the second threshold value, judging that the ith touch key is triggered.
Optionally, any one of the following filtering manners is adopted to perform filtering processing on the second charging duration Ti: average filtering and median filtering.
Optionally, the touch key scanning device further includes: and the second setting unit is used for setting the second charging time length Ti as a second baseline time length corresponding to the next awakening period after the ith touch key is determined not to be triggered.
Optionally, the touch key scanning device further includes: and the state switching unit is used for switching the current state from the low power consumption state to the working state after judging that the triggering event exists.
Optionally, the state switching unit is further configured to switch from the operating state to the low power consumption state when it is detected that the duration that the touch key is not triggered reaches a preset duration.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer instruction is stored on the computer-readable storage medium, and when the computer instruction runs, the steps of any one of the touch key scanning methods are executed.
The embodiment of the invention also provides a touch key scanning device which comprises a memory and a processor, wherein the memory is stored with computer instructions, and the computer instructions execute any one of the steps of the touch key scanning method when running.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
and when the current moment is in the wake-up period corresponding to the low power consumption state, the switch circuits corresponding to all the touch keys are controlled to be closed, and at the moment, the induction capacitors corresponding to all the touch keys can be equivalent to a large capacitor. The reference capacitor is charged through the large capacitor, and whether a trigger event exists is judged according to the first charging time of the reference capacitor, so that whether each touch key is triggered or not does not need to be polled, the scanning time can be effectively reduced, and the power consumption is further reduced.
Furthermore, when the ith touch key is judged to be triggered, the second charging time length does not need to be subjected to filtering processing, and the subtraction operation is directly performed on the second baseline time length and the second charging time length, so that the power consumption can be further reduced.
In addition, when the touch key is in the working state, if the fact that the duration that the touch key is not triggered reaches the preset duration is detected, the working state is switched to the low power consumption state, and therefore power consumption is further reduced.
Drawings
FIG. 1 is a flowchart of a touch key scanning method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a conventional finger-touch key;
fig. 3 is a timing diagram illustrating an operation of the touch key control chip in the low power consumption mode according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a sensing capacitor and a reference capacitor in a touch key control chip according to the prior art;
fig. 5 is a schematic structural diagram of a touch key scanning device in an embodiment of the present invention.
Detailed Description
Currently, a touch key control chip using a charge transfer method is provided with a touch key and a reference capacitor. For each touch key, the corresponding metal keyboard has a corresponding sensing capacitor Cp. When a plurality of touch keys are arranged on the same chip, the switch circuits corresponding to the touch keys are sequentially closed in a time division multiplexing mode to detect whether the touch keys are triggered.
And each touch key is provided with a switch circuit corresponding to one touch key, and when the switch circuit is closed and no finger touches the touch key, the reference capacitor Cx is charged through the induction capacitor Cp until the voltage on the reference capacitor Cx reaches a preset value, and the time of the whole charging process is calculated. The capacitance Cfinger (hereinafter referred to as Cf) on the finger is a parasitic capacitance between the human body and the ground, and when the finger touches the touch key, the capacitance on Cp becomes Cp + Cf. At this time, when Cp charges the reference capacitance Cx, the capacitance capacity at Cp increases, and therefore the charging time is shortened. In the prior art, whether the touch key is triggered is determined by the variation of the charging time.
Referring to fig. 2, a schematic diagram of a conventional finger touching a touch key is shown. Capacitance Cf on the finger is the parasitic capacitance of the human body relative to the ground, Cp is the induction capacitance, and Cs is the capacitance of the capacitance on the finger relative to the ground corresponding to the metal keyboard. In general, Cs is negligible. Therefore, when the finger touches the touch key, the capacitance capacity at Cp becomes Cp + Cf.
In practical application, the touch key control chip has two working modes: a sleep mode and an operational mode. In the sleep mode, the touch key control chip is in a low power consumption state, and in order to timely know whether the touch key is triggered, a channel polling method can be adopted to detect whether the touch key is triggered. However, in practical applications, there may be the following application scenarios: the user touches the touch key 1, and the touch key corresponding to the currently polled touch channel is the touch key 2. Under the condition, the touch key touched by the user can be detected when the channel is polled next time, the scanning time is long, and the power consumption is high.
In the embodiment of the invention, when the current time is in the wake-up period corresponding to the low power consumption state, the switch circuits corresponding to all the touch keys are controlled to be closed, and at the moment, the induction capacitors corresponding to all the touch keys can be equivalent to a large capacitor. The reference capacitor is charged through the large capacitor, and whether a trigger event exists is judged according to the first charging time of the reference capacitor, so that whether each touch key is triggered or not does not need to be polled, the scanning time can be effectively reduced, and the power consumption is further reduced.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
An embodiment of the present invention provides a touch key scanning method, which is described in detail below with reference to fig. 1 through specific steps.
And S101, when the current state of low power consumption is detected and the current moment is in the awakening period corresponding to the low power consumption state, controlling the switch circuits corresponding to all the touch keys to be closed.
In a specific implementation, the touch key may be scanned by the touch key control chip, or may be scanned by another control device connected to the touch key. In practical applications, the states of the touch key control chip may include an operating state and a low power consumption state, and the power consumption of the touch key control chip in the operating state is much greater than that of the touch key control chip in the low power consumption state.
In the low power consumption mode, a wake-up period and a sleep period corresponding to the touch key control chip can be set. In a low power consumption mode, when the touch key control chip is in a wake-up period, the touch key control chip is woken up and scans whether the touch key is triggered; when the touch key control chip is in the sleep cycle, the touch key control chip is in the sleep state and cannot detect whether the touch key is triggered.
That is to say, when the touch key control chip is in the wake-up period, the touch key control chip is woken up, and whether the touch key is triggered is scanned within the wake-up duration.
In specific implementation, the wake-up period and the wake-up duration corresponding to each wake-up can be preset. The wake-up period and the wake-up duration can be set according to the actual application scene.
In an embodiment of the present invention, the wake-up period is set to 1s, and the wake-up duration is set to 0.25s, that is: the touch key control chip is awakened once every 1s, and the scanning operation with the duration of 0.25s is executed once the touch key control chip is awakened.
Referring to fig. 3, a timing diagram of an operation of the touch key control chip in the low power consumption mode in the embodiment of the present invention is shown. And at the time from T1 to T2, the touch key control chip is in a sleep cycle, at the time, the touch key control chip is in a sleep state, and the duration from the time T1 to the time T2 is the sleep cycle. And at the time of T2-T3, the touch key control chip is in a wake-up period, at the time, the touch key control chip is woken up and scans whether the touch key is triggered, and the time length from the time of T2 to the time of T3 is the wake-up time length. And at the time from T3 to T4, the touch key control chip is in a sleep cycle, at the time, the touch key control chip is in a sleep state, and the duration from the time T3 to the time T4 is the sleep cycle.
As can also be known from fig. 3, when the touch key control chip is in the sleep cycle, the current power consumption corresponding to the touch key control chip is smaller than the current power consumption when the touch key control chip is in the wake-up cycle.
In specific implementation, when the touch key control chip is detected to be in a low power consumption state at present and is in a wake-up period corresponding to the low power consumption state at present, the touch key control chip is judged to be woken up. And after the touch key control chip is awakened, controlling the switch circuits corresponding to all the touch keys to be closed.
In practical application, referring to fig. 4, a schematic diagram of sensing capacitance and reference capacitance in a touch key control chip in the prior art is provided.
The touch key control chip comprises N touch keys, and each touch key is provided with a switch circuit corresponding to the touch key and an induction capacitor corresponding to the touch key. As shown in fig. 4, the switch circuit corresponding to the touch key 1 is S11, and the corresponding sensing capacitor is Cp 1; the switch circuit corresponding to the touch key 2 is S12, and the corresponding sensing capacitor is Cp 2; by analogy, the switch circuit corresponding to the touch key N is S1N, and the corresponding sensing capacitor is CpN.
When the switch circuit corresponding to one touch key is closed, the reference capacitor is charged through the induction capacitor corresponding to the touch key.
In the embodiment of the invention, when the current state of low power consumption is detected and the wake-up period corresponding to the low power consumption state at the current moment is detected, the switch circuits corresponding to all the touch keys are controlled to be closed, that is, the switch circuits S11-S1N are controlled to be closed. At this time, the capacitance value of the inductive capacitor charged to the reference capacitor is: cp _ all is Cp1+ Cp2+ … … + CpN, i.e. the sum of the capacitance values of the sensing capacitors corresponding to all touch keys.
Step S102, collecting a first charging time length of a reference capacitor, and judging whether a trigger event exists according to the first charging time length.
In a specific implementation, after the first charging duration of the reference capacitor is acquired, a preset first baseline duration may be subtracted from the first charging duration, and the obtained difference may be compared with a preset first threshold. When the difference between the first baseline duration and the first charging duration is greater than a first threshold, it can be determined that a trigger event exists, that is, a touch key is triggered currently; when the difference between the first baseline duration and the first charging duration is not greater than the first threshold, it may be determined that there is no triggering event, that is, no touch key is currently triggered.
In a specific application, the following steps may be taken to obtain the first baseline duration: when the trigger event does not exist, after all the switch circuits are closed, the time length required when the reference capacitor is charged to the preset voltage value is collected and used as the first baseline time length.
In a specific implementation, the first threshold may be preset according to an actual application scenario. The first baseline duration may be a fixed duration, or may be a duration capable of adjusting gradual change in time.
In this embodiment of the present invention, at the current time, the first baseline duration may be: the first charging period when it was last determined that there was no triggering event. That is, upon determining that there is no triggering event at the present time, the first charging duration at the present time is set to the first baseline duration of the next wake-up period.
For example, the first charge duration when it was last determined that there was no triggering event was T1, the first baseline duration at the present time is preset to T1.
In the embodiment of the present invention, when determining whether a trigger event exists, the determination is performed according to the sum of the sensing capacitors corresponding to all the touch keys. And in the awakening period, all the switch circuits corresponding to the touch keys are closed, and whether a trigger event exists can be judged according to the acquired first charging time length. In the prior art, the switch circuit corresponding to each touch key is sequentially closed to poll whether each touch key is triggered. Therefore, the embodiment of the invention can know whether the trigger event exists or not only by judging once, thereby effectively reducing the scanning time and further reducing the power consumption.
In a specific implementation, when it is determined that there is no trigger event, the touch key control chip may wake up again in the next wake-up period, and step S101 to step S102 are repeated to determine whether there is a trigger event in the next wake-up period.
On the contrary, when the triggering event is determined to exist, the fact that at least one touch key is triggered at the moment is meant. At this time, the touch key control chip may determine the triggered touch key. And when the triggering event is judged to exist, the hardware part of the touch key control chip executes the discharging operation.
After the triggering event is determined to exist, the touch key control chip can control all the switch circuits to be switched from the closed state to the open state. After all the switch circuits are switched to the off state, the touch key control chip controls all the switch circuits to be closed in sequence; when one switch circuit is closed, the other switch circuits are all in an open state, namely only one switch circuit is in a closed state at the same time.
For example, referring to fig. 4, after the triggering event is determined to exist, the touch key control chip firstly controls the switch circuits S11 to S1N to be all opened, then controls the switch circuit S11 to be closed, and controls the switch circuits S12 to S1N to be all opened; after the scanning of the touch key 1 is completed, the control switch circuit S12 is closed, and the control switch circuits S11, S13 to S1N are opened to scan the touch key 2. And the rest can be done until the switch circuit S1N is closed and other switch circuits are opened, so that the scanning of all touch keys is realized.
It should be noted that, in the embodiment of the present invention, if no special description is provided, the switch circuit is the switch circuit corresponding to the touch key, and when the switch circuit is turned on, the sensing capacitor corresponding to the touch key charges the reference capacitor.
After the switch circuit corresponding to each touch key is closed, the induction capacitor corresponding to the touch key charges the reference capacitor, and then the second charging time length for charging the reference capacitor by the induction capacitor corresponding to the touch key can be collected. And determining whether the touch key has a trigger event or not according to the second charging time length.
In a specific implementation, after the triggering event is determined to exist, since only one switch circuit is closed at the same time, the second charging period of the reference capacitor may not be equal to the first charging period in step S102. For different touch keys, when the corresponding switch circuits are closed, the corresponding second charging durations may also be different. Therefore, the one-to-one second charging time period can be set for each touch key. Because the difference of the second charging time lengths corresponding to different touch keys is small, the uniform second charging time lengths can be set for all the touch keys. For example, the second charging time period corresponding to one touch key is selected as the second charging time periods corresponding to all touch keys. For another example, the average value of the second charging durations corresponding to all the touch keys is obtained through calculation and is used as the second charging durations corresponding to all the touch keys.
The touch key for determining whether the trigger event exists in the ith key is described as an example, wherein i is a positive integer and is less than or equal to N.
The touch key control chip controls the switch circuit i corresponding to the ith touch key to be closed, and at the moment, the rest switch circuits are all in an off state. And acquiring a second charging time Ti of the reference capacitor when the switch circuit i is closed. And determining whether the ith touch key is triggered or not according to the second charging time length Ti and a preset second baseline time length.
For the ith touch key, second baseline durations corresponding to the ith touch key can be preset. At this time, the second baseline duration may be: when the trigger event does not exist, the induction capacitor corresponding to the ith touch key charges the reference capacitor for the required time length to the preset voltage value.
In addition, a uniform second baseline duration may also be preset for all touch keys. For example, it is collected that when there is no trigger event, the time required for the sensing capacitor corresponding to each touch key to charge the reference capacitor to the preset voltage value is obtained, and an average value of the time required for charging the reference capacitor to the preset voltage value is obtained to serve as a uniform second baseline time.
In a specific implementation, the second baseline duration may be directly subtracted from the second charging duration Ti, and the obtained difference is compared with a preset second threshold. When the obtained difference value is larger than a second threshold value, judging that the ith touch key is triggered; otherwise, when the obtained difference is smaller than or equal to the second threshold, it is determined that the ith touch key is not triggered, that is, there is no triggering event.
In a specific implementation, when it is determined whether the ith touch key is triggered, the collected second charging duration Ti may be filtered, and then the second baseline duration is subtracted from the filtered second charging duration Ti, and the obtained difference is compared with the second threshold. When the obtained difference value is larger than a second threshold value, judging that the ith touch key is triggered; otherwise, when the obtained difference is smaller than or equal to the second threshold, the ith touch key is judged not to be triggered.
That is to say, in the embodiment of the present invention, when determining whether the ith touch key is triggered, filtering the second charging time duration Ti of the reference capacitor acquired when the switch circuit i is closed, and determining whether the ith touch key is triggered according to the filtered second charging time duration Ti; or, it is not necessary to filter the second charging duration Ti corresponding to the ith touch key, and it is directly determined whether the trigger is triggered according to the collected second charging duration Ti.
When the trigger is determined directly according to the second charging time duration Ti corresponding to the ith touch key, the filtering processing is not required to be carried out, so that the filtering processing function is not required to be started, and the power consumption can be further reduced.
In a specific implementation, when the second charging time Ti corresponding to the ith touch key is subjected to filtering processing, an average filtering algorithm may be adopted for the filtering processing, and a median filtering algorithm may also be adopted for the filtering processing. It can be understood that, in practical application, other filtering algorithms may also be adopted to perform filtering processing on the second charging duration Ti corresponding to the ith touch key, which is not described herein again.
In a specific implementation, after it is determined that the ith touch key is not triggered, the second baseline duration corresponding to the ith touch key may be further adjusted, and the second baseline duration corresponding to the ith touch key is adjusted to be the second charging duration Ti, that is, the second baseline duration at the current time is adjusted to be the second charging duration Ti when the ith touch key is not triggered last time.
In a specific implementation, after the triggering event is determined to exist, the touch key control chip is switched from the low power consumption state to the working state so as to respond to the operation of a user. If the touch key control chip is in a working state for a long time and the touch key control chip does not detect the touch operation of the user within the preset time, the current state of the touch key control chip can be switched from the working state to a low power consumption state in order to reduce power consumption.
In practical application, the preset duration can be set according to actual requirements. In an embodiment of the present invention, the preset duration is set to be 5 s. In another embodiment of the present invention, the preset time period is set to 20 s.
For example, when the touch key control chip is in an operating state and no touch operation of the user is detected within 5s, the touch key control chip is switched from the operating state to a low power consumption state.
It can be understood that the switch circuits in the embodiment of the present invention may be all opened or closed, or may be opened or closed one by one, so as to perform touch key scanning and determination in different modes, and the setting manner is flexible. By analogy, whether the touch key is triggered can be judged by adopting modes such as a bisection method and the like according to the requirements of the system on power consumption and scanning time, the opening or closing of different numbers of switch circuits is set, different charging time lengths, different baseline time lengths, different filtering modes and the like are set, so that the power consumption is further reduced, the scanning time length is reduced, and specific setting parameters are not repeated in the embodiment of the invention.
Referring to fig. 5, an embodiment of the present invention further provides a touch key scanning device 50, including: control unit 501, collection unit 502 and judgement unit 503, wherein:
the control unit 501 is configured to control the switch circuits corresponding to all touch keys to be closed when detecting that the touch keys are currently in the low power consumption state and the wake-up period corresponding to the low power consumption state at the current moment;
an acquisition unit 502, configured to acquire a first charging duration of a reference capacitor;
a determining unit 503, configured to determine whether a trigger event exists according to the first charging duration, where the first charging duration is related to a sum of the sensing capacitors corresponding to all the touch keys; the touch keys, the switch circuits and the induction capacitors are all in one-to-one correspondence.
In a specific implementation, the determining unit 503 may be configured to subtract a preset first baseline duration from the first charging duration, and compare the obtained difference with a preset first threshold; when the obtained difference value is larger than the first threshold value, judging that a trigger event exists; when the obtained difference value is not larger than the first threshold value, judging that no trigger event exists; the first baseline duration is: and when the triggering event does not exist, the induction capacitors corresponding to all the touch keys charge the reference capacitor for the required time length to the preset voltage value.
In a specific implementation, the touch key scanning device 50 may further include: a first setting unit 506, configured to set the first charging duration as a first baseline duration corresponding to a next wake-up period when the determining unit determines that the trigger event does not exist.
In a specific implementation, the touch key scanning device 50 may further include: a touch key determining unit 504, configured to control the switch circuits corresponding to all touch keys to switch from a closed state to an open state after the determining unit determines that the trigger event exists; sequentially controlling the switch circuits corresponding to all the touch keys to be sequentially closed; when one of the switch circuits is in a closed state, the other switch circuits are in an open state; and determining the touch key with the trigger event according to the second charging duration of the reference capacitor corresponding to the closed switch circuit.
In a specific implementation, the touch key determining unit 504 may be configured to control a switch circuit i corresponding to the ith touch key to be closed, and switch circuits corresponding to other touch keys to be open; acquiring a second charging time duration Ti of the reference capacitor when the switch circuit i is closed; determining whether the ith touch key is triggered or not according to the second charging time length Ti and a preset second baseline time length; i is a positive integer and is not more than N, and N is the total number of the touch keys; the second baseline duration is: and when no trigger event exists, the induction capacitor corresponding to the ith touch key charges the reference capacitor for the required time length to the preset voltage value.
In a specific implementation, the touch key determining unit 504 may be configured to subtract the preset second baseline duration from the second charging duration Ti, and compare the obtained difference with a preset second threshold; when the obtained difference value is larger than the preset second threshold value, judging that the ith touch key is triggered; and when the obtained difference value is not larger than the second threshold value, judging that the ith touch key is not triggered.
In a specific implementation, the touch key determining unit 504 may be configured to perform filtering processing on the second charging duration Ti, subtract the second baseline duration from the filtered second charging duration Ti, and compare an obtained difference with the second threshold.
In a specific implementation, any one of the following filtering manners may be adopted to perform filtering processing on the second charging period Ti: average filtering and median filtering.
In a specific implementation, the touch key scanning device 50 may further include: a second setting unit 507, configured to set the second charging duration Ti as a second baseline duration corresponding to a next wake-up period after determining that the ith touch key is not triggered.
In a specific implementation, the touch key scanning device 50 may further include: and the state switching unit 505 may be configured to switch the current state from the low power consumption state to the operating state after determining that the trigger event exists.
In a specific implementation, the state switching unit 505 may be further configured to switch from the operating state to the low power consumption state when it is detected that a duration that the touch key is not triggered reaches a preset duration.
The embodiment of the present invention further provides a computer-readable storage medium, on which a computer instruction is stored, and when the computer instruction runs, the steps of the touch key scanning method provided in any of the above embodiments of the present invention are executed, which is not described herein again.
The embodiment of the present invention further provides another touch key scanning device, which includes a memory and a processor, where the memory stores a computer instruction, and the computer instruction executes, when running, the steps of the touch key scanning method provided in any of the above embodiments of the present invention, which are not described herein again.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by instructing the relevant hardware through a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (22)

1. A touch key scanning method is characterized by comprising the following steps:
when the current state of low power consumption is detected and the current moment is in the awakening period corresponding to the low power consumption state, controlling the switch circuits corresponding to all the touch keys to be closed;
acquiring a first charging time length of a reference capacitor, and judging whether a trigger event exists according to the first charging time length, wherein the first charging time length is related to the sum of induction capacitors corresponding to all touch keys; the touch keys, the switch circuits and the induction capacitors are in one-to-one correspondence;
the determining whether a trigger event exists according to the first charging duration includes: subtracting a preset first baseline duration from the first charging duration, and comparing the obtained difference with a preset first threshold; when the obtained difference value is larger than the first threshold value, judging that a trigger event exists; when the obtained difference value is not larger than the first threshold value, judging that no trigger event exists; the first baseline duration is: and when the triggering event does not exist, the induction capacitors corresponding to all the touch keys charge the reference capacitor for the required time length to the preset voltage value.
2. The touch key scanning method of claim 1, further comprising: and when the trigger event does not exist, setting the first charging time length as a first baseline time length corresponding to the next awakening period.
3. The touch key scanning method of claim 1, after determining that the triggering event exists, further comprising:
controlling the switch circuits corresponding to all the touch keys to be switched from a closed state to an open state;
sequentially controlling the switch circuits corresponding to all the touch keys to be sequentially closed; when one of the switch circuits is in a closed state, the other switch circuits are in an open state;
and determining the touch key with the trigger event according to the second charging duration of the reference capacitor corresponding to the closed switch circuit.
4. The method for scanning touch keys according to claim 3, wherein the determining the touch key having the trigger event according to the second charging duration of the reference capacitor corresponding to each closed switch circuit comprises:
controlling a switch circuit i corresponding to the ith touch key to be closed, and switching circuits corresponding to other touch keys to be opened;
acquiring a second charging time duration Ti of the reference capacitor when the switch circuit i is closed;
determining whether the ith touch key is triggered or not according to the second charging time length Ti and a preset second baseline time length; i is a positive integer and is not more than N, and N is the total number of the touch keys; the second baseline duration is: and when no trigger event exists, the induction capacitor corresponding to the ith touch key charges the reference capacitor for the required time length to the preset voltage value.
5. The method for scanning touch keys according to claim 4, wherein the determining whether the ith touch key is triggered according to the second charging duration Ti and a preset second baseline duration comprises:
subtracting the second baseline duration from the second charging duration Ti, and comparing the obtained difference with a preset second threshold;
when the obtained difference value is larger than the second threshold value, judging that the ith touch key is triggered; and when the obtained difference value is not larger than the second threshold value, judging that the ith touch key is not triggered.
6. The touch key scanning method of claim 5, wherein said subtracting the second baseline duration from the second charging duration Ti comprises:
and filtering the second charging duration Ti, subtracting the filtered second charging duration Ti from the second baseline duration, and comparing the obtained difference with the second threshold.
7. The method for scanning touch keys according to claim 6, wherein the second charging duration Ti is filtered by any one of the following filtering methods: average filtering and median filtering.
8. The touch key scanning method of claim 4, further comprising: and after the ith touch key is determined not to be triggered, setting the second charging time length Ti as a second baseline time length corresponding to the next awakening period.
9. The touch key scanning method of claim 1, further comprising:
and after the triggering event is judged to exist, switching the current state from the low power consumption state to the working state.
10. The touch key scanning method of claim 9, further comprising, after switching the current state from the low power consumption state to the active state:
and when the condition that the duration that the touch key is not triggered reaches the preset duration is detected, switching from the working state to the low-power consumption state.
11. A touch key scanning device, comprising:
the control unit is used for controlling the switch circuits corresponding to all the touch keys to be closed when detecting that the touch keys are in the low power consumption state at present and are in the wake-up period corresponding to the low power consumption state at present;
the acquisition unit is used for acquiring a first charging time length of the reference capacitor;
the judging unit is used for judging whether a trigger event exists according to the first charging time length, and the first charging time length is related to the sum of the induction capacitors corresponding to all the touch keys; the touch keys, the switch circuits and the induction capacitors are in one-to-one correspondence; the determining whether a trigger event exists according to the first charging duration includes: subtracting a preset first baseline duration from the first charging duration, and comparing the obtained difference with a preset first threshold; when the obtained difference value is larger than the first threshold value, judging that a trigger event exists; when the obtained difference value is not larger than the first threshold value, judging that no trigger event exists;
the first baseline duration is: and when the triggering event does not exist, the induction capacitors corresponding to all the touch keys charge the reference capacitor for the required time length to the preset voltage value.
12. The touch key scanning device of claim 11, further comprising: and the first setting unit is used for setting the first charging duration as a first baseline duration corresponding to the next awakening period when the judging unit judges that the triggering event does not exist.
13. The touch key scanning device of claim 11, further comprising: the touch key determining unit is used for controlling the switch circuits corresponding to all the touch keys to be switched from a closed state to an open state after the judging unit judges that the trigger event exists; sequentially controlling the switch circuits corresponding to all the touch keys to be sequentially closed; when one of the switch circuits is in a closed state, the other switch circuits are in an open state; and determining the touch key with the trigger event according to the second charging duration of the reference capacitor corresponding to the closed switch circuit.
14. The touch key scanning device according to claim 13, wherein the touch key determining unit is configured to control a switch circuit i corresponding to an ith touch key to be closed, and switch circuits corresponding to other touch keys to be opened; acquiring a second charging time duration Ti of the reference capacitor when the switch circuit i is closed; determining whether the ith touch key is triggered or not according to the second charging time length Ti and a preset second baseline time length; i is a positive integer and is not more than N, and N is the total number of the touch keys; the second baseline duration is: and when no trigger event exists, the induction capacitor corresponding to the ith touch key charges the reference capacitor for the required time length to the preset voltage value.
15. The touch key scanning device of claim 14, wherein the touch key determining unit is configured to subtract the second baseline duration from the second charging duration Ti, and compare the obtained difference with a preset second threshold; when the obtained difference value is larger than the second threshold value, judging that the ith touch key is triggered; and when the obtained difference value is not larger than the second threshold value, judging that the ith touch key is not triggered.
16. The touch key scanning device of claim 15, wherein the touch key determining unit is configured to perform filtering processing on the second charging duration Ti, subtract the second baseline duration Ti from the filtered second charging duration Ti, and compare the obtained difference with the second threshold.
17. The touch key scanning device of claim 16, wherein the second charging duration Ti is filtered by any one of the following filtering methods: average filtering and median filtering.
18. The touch key scanning device of claim 17, further comprising: and the second setting unit is used for setting the second charging time length Ti as a second baseline time length corresponding to the next awakening period after the ith touch key is determined not to be triggered.
19. The touch key scanning device of claim 11, further comprising: and the state switching unit is used for switching the current state from the low power consumption state to the working state after judging that the triggering event exists.
20. The touch key scanning device of claim 19, wherein the state switching unit is further configured to switch from the operating state to the low power consumption state when it is detected that a duration in which the touch key is not triggered reaches a preset duration.
21. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, performs the steps of the touch key scanning method according to any one of claims 1 to 10.
22. A touch key scanning device comprising a memory and a processor, the memory having a computer program stored thereon, wherein the processor executes the computer program to perform the steps of the touch key scanning method according to any one of claims 1 to 10.
CN201810162623.7A 2018-02-26 2018-02-26 Touch key scanning method and device and computer readable storage medium Active CN108259044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810162623.7A CN108259044B (en) 2018-02-26 2018-02-26 Touch key scanning method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810162623.7A CN108259044B (en) 2018-02-26 2018-02-26 Touch key scanning method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108259044A CN108259044A (en) 2018-07-06
CN108259044B true CN108259044B (en) 2021-09-07

Family

ID=62745636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810162623.7A Active CN108259044B (en) 2018-02-26 2018-02-26 Touch key scanning method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108259044B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109445630A (en) * 2018-10-19 2019-03-08 李扬渊 Touch key-press panel and touch key-press method
CN110491005A (en) * 2019-08-16 2019-11-22 深圳市汇顶科技股份有限公司 Fingerprint gate lock awakening method, device, MCU, fingerprint gate lock and storage medium
CN110806816A (en) * 2019-10-30 2020-02-18 深圳市汇顶科技股份有限公司 Touch detection method, MCU, touch control equipment and storage medium
CN110959256B (en) * 2019-10-31 2024-01-23 深圳市汇顶科技股份有限公司 Control method, MCU, touch equipment and storage medium
CN110850478B (en) * 2019-11-26 2022-05-31 出门问问创新科技有限公司 Touch detection method, equipment and device and computer readable storage medium
CN113472357A (en) * 2020-03-31 2021-10-01 比亚迪半导体股份有限公司 Touch key scanning circuit, low-power-consumption mode exit method and device
CN113282194A (en) * 2021-05-31 2021-08-20 中微半导体(深圳)股份有限公司 Low-power-consumption touch detection awakening method and device
CN116131836B (en) * 2022-12-26 2024-04-09 深圳市航顺芯片技术研发有限公司 Low-power-consumption parallel device and method for touch keys

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908875A (en) * 2010-07-23 2010-12-08 中颖电子有限公司 Key-judging method for capacitive touch keys
CN103944217A (en) * 2014-04-01 2014-07-23 美的集团股份有限公司 Awakening device and awakening method for terminal and terminal
CN104184449A (en) * 2013-05-24 2014-12-03 十速兴业科技(深圳)有限公司 Capacitive touch control apparatus, method, and system
CN105183097A (en) * 2015-10-27 2015-12-23 同方计算机有限公司 Novel key system and key confirmation method
CN205540669U (en) * 2016-01-19 2016-08-31 深圳创维空调科技有限公司 Detection device and air conditioning equipment are close in touch
US9575606B1 (en) * 2007-05-07 2017-02-21 Cypress Semiconductor Corporation Reducing sleep current in a capacitance sensing system
TWI574193B (en) * 2016-05-13 2017-03-11 九齊科技股份有限公司 Touch sensing device
CN107633230A (en) * 2017-09-22 2018-01-26 重庆纳尔利科技有限公司 A kind of efficiently finger capacitive detection circuit

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6819011B2 (en) * 2002-11-14 2004-11-16 Fyre Storm, Inc. Switching power converter controller with watchdog timer
US9857394B2 (en) * 2013-10-04 2018-01-02 Microchip Technology Incorporated Multiple channel capacitive voltage divider scanning method and apparatus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9575606B1 (en) * 2007-05-07 2017-02-21 Cypress Semiconductor Corporation Reducing sleep current in a capacitance sensing system
CN101908875A (en) * 2010-07-23 2010-12-08 中颖电子有限公司 Key-judging method for capacitive touch keys
CN104184449A (en) * 2013-05-24 2014-12-03 十速兴业科技(深圳)有限公司 Capacitive touch control apparatus, method, and system
CN103944217A (en) * 2014-04-01 2014-07-23 美的集团股份有限公司 Awakening device and awakening method for terminal and terminal
CN105183097A (en) * 2015-10-27 2015-12-23 同方计算机有限公司 Novel key system and key confirmation method
CN205540669U (en) * 2016-01-19 2016-08-31 深圳创维空调科技有限公司 Detection device and air conditioning equipment are close in touch
TWI574193B (en) * 2016-05-13 2017-03-11 九齊科技股份有限公司 Touch sensing device
CN107633230A (en) * 2017-09-22 2018-01-26 重庆纳尔利科技有限公司 A kind of efficiently finger capacitive detection circuit

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Low-Power Touch-Sensing Circuit With Reduced Scanning Algorithm for Touch Screen Panels on Mobile Devices;Seok-Man Kim;《Journal of Display Technology》;20140922;36-43 *
基于充放电原理的电容式触摸按键设计;田野;《电子设计工程》;20101031;142-144 *

Also Published As

Publication number Publication date
CN108259044A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN108259044B (en) Touch key scanning method and device and computer readable storage medium
CN110310391B (en) Touch wake-up method and device, electronic equipment and storage medium
CN104794433A (en) Fingerprint recognition system and fingerprint recognition method
TW201610797A (en) Scan method for a touch panel and touch device
EP3410285B1 (en) Electronic device and detection method
US20100253639A1 (en) Method of detecting a touch event for a touch panel and related device
CN107831996A (en) Recognition of face starts method and Related product
CN101598986B (en) Touch detection device capable of saving power source consumption
TW201839576A (en) Touch sensor-type electronic device and sensor control method
CN108512542B (en) Touch key signal processing method and device and computer readable storage medium
CN110491005A (en) Fingerprint gate lock awakening method, device, MCU, fingerprint gate lock and storage medium
CN110084082B (en) Electronic equipment, fingerprint identification device and finger touch detection circuit thereof
EP3159780A1 (en) Terminal, protective case and induction method
CN111325877B (en) Electronic equipment control method and device and electronic equipment
CN102662536B (en) A kind of switch mode driving method of capacitance type multi-point touch-control
CN104184449A (en) Capacitive touch control apparatus, method, and system
CN105320875A (en) Control method and mobile terminal
CN105991121B (en) touch key system with LED display lamp and control method thereof
WO2022142204A1 (en) Vehicle lock control method and device, vehicle and storage medium
CN111857413B (en) Touch screen control method and device, terminal equipment and storage medium
CN107092342B (en) Method and system for dynamically starting fingerprint module of mobile terminal and mobile terminal
CN115314035A (en) Key trigger control method and device and electric equipment
CN114201739A (en) Electronic equipment starting method and device based on fingerprint
TW201405439A (en) Touch key circuit with self-learning calibration
CN108874253B (en) Awakening method and device based on self-contained touch screen

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
GR01 Patent grant
GR01 Patent grant