Touch identification method, device, equipment and storage medium of touch key

文档序号:259754 发布日期:2021-11-16 浏览:5次 中文

阅读说明:本技术 触摸按键的触摸识别方法、装置、设备和存储介质 (Touch identification method, device, equipment and storage medium of touch key ) 是由 陈定三 钱卿 于 2021-07-22 设计创作,主要内容包括:本申请公开了一种触摸按键的触摸识别方法、装置、设备和存储介质。该方法包括:获取触摸按键当前的检测值;获取当前的检测值与基准阈值之间的差值;确定差值大于或等于第一设定差值,则判定当前的检测值为有效触摸对应的检测值,并响应对应的触摸操作。如此,可以基于基准阈值和第一设定差值判定触摸按键当前的检测值是否有效,从而有效避免触摸按键误触发或者漏识别。(The application discloses a touch identification method, a device, equipment and a storage medium of a touch key. The method comprises the following steps: acquiring a current detection value of the touch key; acquiring a difference value between a current detection value and a reference threshold value; and if the difference is determined to be larger than or equal to the first set difference, judging the current detection value as a detection value corresponding to the effective touch, and responding to the corresponding touch operation. Therefore, whether the current detection value of the touch key is effective or not can be judged based on the reference threshold and the first set difference value, and therefore false triggering or missing identification of the touch key is effectively avoided.)

1. A touch recognition method for a touch key is characterized by comprising the following steps:

acquiring a current detection value of the touch key;

acquiring a difference value between the current detection value and a reference threshold value;

and if the difference is determined to be larger than or equal to a first set difference, judging that the current detection value is a detection value corresponding to effective touch, and responding to corresponding touch operation.

2. The method of claim 1, further comprising:

and if the absolute value of the difference is determined to be smaller than or equal to a second set difference, updating the reference threshold value based on the current detection value.

3. The method of claim 1, further comprising:

the reference threshold value is determined based on at least one historical detection value of the touch key.

4. The method of claim 3, wherein determining the reference threshold based on at least one historical detection value of the touch key comprises:

if the number of the historical detection values is determined to be smaller than or equal to the set number, acquiring a first average value of all the historical detection values; determining the reference threshold value according to the first average value;

if the number of the historical detection values is determined to be larger than the set number, obtaining a second average value of the latest detection values of the set number; and determining the reference threshold value according to the second average value.

5. The method of claim 2, wherein updating the reference threshold based on the current detection value comprises:

if the number of the historical detection values is smaller than the set number, acquiring a third average value of the current detection value and the historical detection values, and updating the reference threshold value according to the third average value;

determining that the number of the historical detection values is greater than or equal to a set number, and replacing the detection value at the earliest detection time in the set number of detection values with the current detection value based on the detection time; and acquiring a fourth average value of the replaced set number of detection values, and updating the reference threshold value according to the fourth average value.

6. The method according to any one of claims 1-5, further comprising:

and determining that the newly acquired difference is smaller than the first set difference, and determining that the touch key is released.

7. The method according to any one of claims 1-5, wherein the responding to the corresponding touch operation comprises:

periodically collecting the current detection value of the touch key based on a set frequency;

and determining that the number of times of continuously detecting the detection values corresponding to the effective touch reaches a set number of times, and responding to the corresponding touch operation.

8. A touch recognition device for touching a key, comprising:

the acquisition module is used for acquiring the current detection value of the touch key; acquiring a difference value between the current detection value and a reference threshold value;

and the response module is used for determining that the difference is greater than or equal to a first set difference, judging that the current detection value is a detection value corresponding to effective touch, and responding to corresponding touch operation.

9. An electronic device, wherein at least one touch key is disposed on the electronic device, and the electronic device comprises: a processor and a memory for storing a computer program capable of running on the processor, wherein,

the processor, when executing the computer program, is adapted to perform the steps of the method of any of claims 1 to 7.

10. A storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of the method of any one of claims 1 to 7.

Technical Field

The present disclosure relates to the field of touch keys, and in particular, to a touch identification method, apparatus, device, and storage medium for a touch key.

Background

Because the mechanical key has the problems of mechanical abrasion, oxidation and the like, the traditional mechanical key is often insensitive or completely failed after being used for a period of time. Different from mechanical keys, the capacitive touch keys sense the key operation of a user based on mechanical stress change, sense the key operation of the user through capacitance value change, do not depend on a mechanical structure, do not need key stress change, do not have the problems of mechanical abrasion, oxidation and the like, and can greatly prolong the service life of the keys. However, the capacitive touch key has certain disadvantages, and particularly when the capacitive touch key is applied to a place with high humidity, water vapor or water drops cover the surface of the capacitive touch key, so that the phenomenon of mistaken touch or even key failure can be caused.

Disclosure of Invention

In view of this, embodiments of the present application provide a method, an apparatus, a device, and a storage medium for touch identification of a touch key, which aim to effectively avoid false triggering or missed identification of the touch key.

The technical scheme of the embodiment of the application is realized as follows:

in a first aspect, an embodiment of the present application provides a touch identification method for a touch key, including:

acquiring a current detection value of the touch key;

acquiring a difference value between the current detection value and a reference threshold value;

and if the difference is determined to be larger than or equal to a first set difference, judging that the current detection value is a detection value corresponding to effective touch, and responding to corresponding touch operation.

In some embodiments, the method further comprises:

and if the absolute value of the difference is determined to be smaller than or equal to a second set difference, updating the reference threshold value based on the current detection value.

In some embodiments, the method further comprises:

the reference threshold value is determined based on at least one historical detection value of the touch key.

In some embodiments, said determining said reference threshold based on at least one historical sensed value of said touch key comprises:

if the number of the historical detection values is determined to be smaller than or equal to the set number, acquiring a first average value of all the historical detection values; determining the reference threshold value according to the first average value;

if the number of the historical detection values is determined to be larger than the set number, obtaining a second average value of the latest detection values of the set number; and determining the reference threshold value according to the second average value.

In some embodiments, said updating said reference threshold based on said current detection value comprises:

if the number of the historical detection values is smaller than the set number, acquiring a third average value of the current detection value and the historical detection values, and updating the reference threshold value according to the third average value;

determining that the number of the historical detection values is greater than or equal to a set number, and replacing the detection value at the earliest detection time in the set number of detection values with the current detection value based on the detection time; and acquiring a fourth average value of the replaced set number of detection values, and updating the reference threshold value according to the fourth average value.

In some embodiments, the method further comprises:

and determining that the newly acquired difference is smaller than the first set difference, and determining that the touch key is released.

In some embodiments, the responding to the corresponding touch operation comprises:

periodically collecting the current detection value of the touch key based on a set frequency;

and determining that the number of times of continuously detecting the detection values corresponding to the effective touch reaches a set number of times, and responding to the corresponding touch operation.

In a second aspect, an embodiment of the present application provides a touch recognition device for a touch key, including:

the acquisition module is used for acquiring the current detection value of the touch key; acquiring a difference value between the current detection value and a reference threshold value;

and the response module is used for determining that the difference is greater than or equal to a first set difference, judging that the current detection value is a detection value corresponding to effective touch, and responding to corresponding touch operation.

In a third aspect, an embodiment of the present application provides an electronic device, where at least one touch key is disposed on the electronic device, and the electronic device includes: a processor and a memory for storing a computer program capable of running on the processor, wherein the processor, when running the computer program, is configured to perform the steps of the method according to an embodiment of the present application.

In a fourth aspect, the present application provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the method of the present application are implemented.

According to the technical scheme provided by the embodiment of the application, the current detection value of the touch key is compared with the reference threshold value, and if the difference value between the current detection value and the reference threshold value is determined to be larger than or equal to the first set difference value, the current detection value is judged to be the detection value corresponding to the effective touch, and the corresponding touch operation is responded. Therefore, whether the current detection value of the touch key is effective or not can be judged based on the reference threshold and the first set difference value, and therefore false triggering or missing identification of the touch key is effectively avoided.

Drawings

Fig. 1 is a schematic flowchart of a touch identification method for a touch key according to an embodiment of the present application;

FIG. 2 is a schematic flowchart illustrating dynamic updating of a reference threshold in a touch recognition method according to an exemplary application of the present invention;

FIG. 3 is a schematic diagram illustrating a flow of a touch key response in a touch recognition method according to an exemplary application of the present application;

fig. 4 is a schematic structural diagram of a touch recognition device of a touch key according to an embodiment of the present application;

fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The present application will be described in further detail with reference to the following drawings and examples.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

As shown in fig. 1, an embodiment of the present application provides a touch recognition method for a touch key, which may be applied to an electronic device having the touch key, and the touch recognition method includes:

step 101, obtaining a current detection value of a touch key.

Here, the touch key may be a capacitive touch key or a resistive touch key, and the detection value may be determined based on at least one of a current signal or a voltage signal generated by a detection circuit of the touch key, which is not specifically limited in this embodiment of the present application.

Illustratively, acquiring the current detection value of the touch key comprises the following steps:

and periodically acquiring the current detection value of the touch key based on the set frequency.

It can be understood that, after the electronic device is powered on, the detection circuit of the touch key may periodically collect the current detection value of each touch key based on the set frequency. Taking the capacitive touch key as an example, the electronic device may periodically obtain a current capacitance detection value of each key.

For example, in order to save power consumption of the detection circuit of the touch key, the detection circuit of the touch key may further have a sleep mode and a wake-up mode, for example, in the sleep mode, the detection circuit stops collecting the current detection value of the touch key, and when the detection circuit is switched from the sleep mode to the wake-up mode, the detection circuit resumes periodically collecting the current detection value of the touch key based on the set frequency.

It is understood that the number of the touch keys on the electronic device may be multiple, and each touch key has a corresponding detection circuit. Taking a washing machine as an example, a panel of the washing machine may be provided with a power on/off key and various keys for setting working parameters, for example, keys corresponding to parameter adjustments such as a washing water amount, a washing time, a rinsing time, a working mode, and the like. For example, after power-on, each key is in an awake mode, that is, the detection circuit of each key may periodically collect the current detection value. After the washing program is started, each key can be switched to the dormant mode, so that the power consumption of the detection circuit is saved.

Step 102, obtaining a difference value between a current detection value and a reference threshold value.

After the current detection value is acquired, the acquired current detection value is subjected to difference calculation with a pre-stored reference threshold value to obtain a difference value between the acquired current detection value and the pre-stored reference threshold value.

And 103, determining that the difference is greater than or equal to a first set difference, judging that the current detection value is a detection value corresponding to effective touch, and responding to corresponding touch operation.

And comparing the calculated difference with a first preset difference which is stored in advance, and when the calculated difference is determined to be greater than or equal to the first preset difference which is stored in advance, indicating that the currently detected detection value is greater than a reference threshold which is stored in advance, indicating that the currently detected detection value is a detection value corresponding to the effective touch, namely, determining that the current touch signal is an effective touch signal, and responding to the corresponding touch operation according to the touch signal.

Here, the first setting difference value may be determined appropriately based on experimental data. Assuming that the reference threshold is C _ init, the first set difference is delta _ real, and judging whether C _ real-C _ init is greater than or equal to delta _ real or not for newly acquired C _ real, if so, regarding the C _ real as a detection value corresponding to effective touch of the touch key.

According to the technical scheme provided by the embodiment of the application, the current detection value of the touch key is compared with the reference threshold value, and if the difference value between the current detection value and the reference threshold value is determined to be larger than or equal to the first set difference value, the current detection value is judged to be the detection value corresponding to the effective touch, and the corresponding touch operation is responded. Therefore, whether the current detection value of the touch key is effective or not can be judged based on the reference threshold and the first set difference value, and therefore false triggering or missing identification of the touch key is effectively avoided.

In some embodiments, there may be a relationship between the setting of the reference threshold and the application environment of the touch key, and in order to more accurately determine whether the current detection value is the detection value corresponding to the valid touch, the method further includes an updating method for the reference threshold. The method comprises the following specific steps: and if the absolute value of the difference is determined to be less than or equal to the second set difference, updating the reference threshold value based on the current detection value.

In practical applications, the touch key may be affected by an application environment, and a situation of false triggering occurs, for example, in an environment with severe moisture, such as a bathroom, the moisture may slowly accumulate on the surface of the capacitive touch key, thereby causing a phenomenon of false triggering of the key. For example, the water film covers the surface of the capacitive touch key, which is equivalent to connecting a capacitor in parallel to the capacitive touch key, so that the detected overall capacitance of the key is raised, and when the capacitance is greater than the set trigger threshold, a false touch phenomenon occurs.

The improvement of the embodiment of the present application is that a conventional manner of detecting whether a touch key is triggered based on a fixed reference threshold is changed, the reference threshold of the embodiment of the present application may be adaptively adjusted based on a current detection value of the touch key, specifically, when an absolute value of a difference between the current detection value of the touch key and the reference threshold is less than or equal to a second set difference, it may be determined that the current detection value is not a detection value generated by a valid touch, that is, the touch signal is not a valid touch signal, and the detection value of the touch key is relatively obviously mutated due to a touch operation of a user, where it may be distinguished whether the detection value is changed due to a real touch of the user based on the second set difference that is reasonably set. If the current detection value is determined not to be the detection value corresponding to the real user touch, and the reference threshold value is updated based on the current detection value, the adaptability of the touch key to the application environment can be improved, and the false triggering or missing identification of the touch key can be effectively avoided.

The second setting difference may be the same as or different from the first setting difference described above. Preferably, the second setting difference is smaller than the first setting difference. In this way, the detection value corresponding to the valid touch and the detection value corresponding to the non-user touch can be effectively distinguished.

It is understood that before obtaining the difference between the current detection value and the reference threshold value, the method further comprises:

the reference threshold value is determined based on at least one historical detection value of the touch key.

Optionally, the reference threshold is determined based on at least one historical detection value when the touch key is powered on, so that the currently detected detection value may have a reference threshold.

In some embodiments, the determining of the reference threshold may be performed according to the number of historical detection values, and specifically, the determining of the reference threshold based on at least one historical detection value of the touch key includes:

if the number of the historical detection values is determined to be less than or equal to the set number, acquiring a first average value of all the historical detection values; and determining a reference threshold value according to the first average value.

When the number of detected historical detection values is smaller than or equal to the set number, the number of the detected historical detection values is small, all the detected historical detection values are used as a basis for determining the reference threshold value in order to ensure the accuracy of the reference threshold value, a first average value is obtained for all the detected historical detection values, and the obtained first average value is used as the reference threshold value.

If the number of the historical detection values is determined to be larger than the set number, obtaining a second average value of the latest set number of detection values; and determining a reference threshold value according to the second average value.

When the number of detected historical values is larger than the set number, the number of the historical detected values is large, in order to ensure the accuracy of setting the reference threshold, the historical detected values can be sorted according to the detection time, the historical detected values of the set number of the latest detection time can be obtained to be used as a basis for determining the reference threshold, the second average value of the historical detected values of the set number of the latest detection time can be obtained, and the obtained second average value can be used as the reference threshold.

For example, assuming that the set number is 10, it can be understood that the size of the sliding window is 10, taking the capacitive touch key as an example, the reference threshold is C _ init, and at the beginning of power-on, the default C _ init is 0. When a first capacitance value C1 is acquired, C _ init is C1; when a second capacitance value C2 is acquired, C _ init is (C1+ C2)/2; by analogy, when the tenth capacitance value C10 is acquired, C _ init is (C1+ C2+ … + C10)/10; when the eleventh capacitance value C11 is acquired, the sliding window moves forward by one grid, that is, C1 is removed from the sliding window, C11 is newly added, and C _ init is (C2+ C3+ … + C11)/10; the subsequent determination process of C _ init is similar and will not be described herein.

In some embodiments, updating the reference threshold based on the current sensed value also has a relationship with historical sensed values and set numbers. Updating the reference threshold based on the current detection value includes:

and if the number of the historical detection values is determined to be smaller than the set number, acquiring a third average value of the current detection value and the historical detection values, and updating the reference threshold value according to the third average value.

When the number of the detection values of the detection history is smaller than the set number, the number of the detection values of the detection history is small and does not reach the set number. When the reference threshold value is updated, the current detection value is directly added to the historical detection values, a third average value is obtained for the current detection value and all the historical detection values, and the reference threshold value is updated according to the obtained third average value.

And if the number of the historical detection values is determined to be larger than or equal to the set number, replacing the detection value at the earliest detection time in the set number of detection values with the current detection value based on the detection time, acquiring a fourth average value of the replaced set number of detection values, and updating the reference threshold value according to the fourth average value.

When the number of the detection values of the history is detected to be larger than or equal to the set number, the number of the detection values of the history is more, and the number reaches the set number. In a possible implementation manner, when updating the reference threshold, the current detection values and the historical detection values may be sorted according to the detection time, the set number of detection values of the latest detection time is obtained as a basis for updating the reference threshold, a fourth average value is obtained for the set number of detection values of the latest detection time, and the reference threshold is updated according to the obtained fourth average value. In another possible implementation manner, the historical detection values may be sorted according to the detection time, a set number of historical detection values of the latest detection time are obtained, the detection value of the earliest detection time in the set number of historical detection values is replaced by the current detection value, a fourth average value is obtained for the replaced set number of detection values, and the reference threshold value is updated according to the obtained fourth average value.

Based on the above example, assuming that the current detection value is C _ real, and the second set difference value is δ _ init, for newly obtained C _ real, it is determined whether | C _ real-C _ init | is smaller than δ _ init, and if yes, it is determined whether the number of the collected capacitance values is smaller than 10; and if the number of the collected capacitance values is less than 10, putting the C _ real into a sliding window to calculate a new average value, and updating the C _ init into the new average value. And if the number of the acquired capacitance values is determined to be greater than or equal to 10, removing the capacitance value with the earliest acquisition time in the sliding window, adding the C _ real at the tail end of the sliding window, calculating a new average value of the capacitance values in the sliding window, and updating the C _ init to the new average value. Therefore, the reference threshold can be updated based on the sliding window, and the influence of the application environment on the touch key can be better adapted, for example, when water vapor is slowly accumulated on the surface of the capacitive key, the reference threshold of the capacitive key can be dynamically adapted to the process of slow accumulation of the water vapor, so that false triggering or missed identification of the touch key can be effectively avoided.

In practical applications, because there may be electromagnetic interference in the space, or there may be occasional water splash during use, which may cause a transient in the capacitance value of a key, such transient should be regarded as a disturbance rather than a real key.

Based on this, in some embodiments, the responding to the corresponding touch operation in the touch recognition method includes:

periodically collecting the current detection value of the touch key based on the set frequency; and determining that the number of times of continuously detecting the detection values corresponding to the effective touches reaches the set number of times, and responding to the corresponding touch operation.

In order to reduce the false triggering caused by the capacitance value transient which should be regarded as disturbance, the embodiment of the application counts the number of times of the capacitance values of the continuous effective touch, determines that the number of times reaches the set number, and responds to the operation of touching the touch key, so that the probability of false triggering of the touch key can be further reduced.

It is understood that the set number of times can be appropriately set based on the sensitivity of detection.

Exemplarily, the touch recognition method further includes:

and adjusting at least one of the first set difference, the set times and the second set difference.

It can be understood that a user can adjust at least one of the first setting difference, the setting times and the second setting difference according to the actual requirements of the application scene, so that the touch identification method can better adapt to the requirements of the application scene, and the probability of false triggering or missed identification of the touch key is effectively reduced.

In some embodiments, after the operation of responding to the touch key being touched, the touch recognition method further includes:

and determining that the newly acquired difference is smaller than the first set difference, and determining that the touch key is released.

After the user touches the key, when the key is lifted, the difference between the current detection value of the newly acquired touch key and the reference threshold value is smaller than the first set difference, and the electronic device can confirm that the touch key is released based on the process, so that the next touch recognition of the touch key is facilitated, and false operation caused by repeated execution of touch operation of the touch key in the process of touching the touch key by the user can be avoided. For example, when the user sets the timing duration, if the touch key is repeatedly touched, the timing duration may be inaccurate, and user experience may be affected.

The present application is described in further detail below with reference to application examples.

Fig. 2 is a schematic flow chart illustrating dynamic updating of a reference threshold in a touch recognition method according to an application example, in which a touch key is a capacitive touch key. As shown in fig. 2, the flow of dynamically updating the reference threshold includes:

step 201, setting parameters.

The electronic device may perform parameter setting based on user input or default parameters, for example, setting a sliding window size (i.e., a set number) n _ init and a second set difference δ _ init.

At step 202, an initial baseline threshold is calculated.

Here, it is assumed that the reference threshold value of the touch key is C _ init.

The C _ init can be determined according to historical detection values collected within a set time length after power-on. For example, a plurality of detection values collected 1 second after power-on are averaged to obtain C _ init.

Step 203, obtain real-time capacitance.

It can be understood that, after the electronic device is powered on, the detection circuit of the touch key may periodically collect the current detection value of each touch key based on the set frequency, so as to obtain the real-time capacitance value C _ real of the touch key.

Step 204, determining whether | C _ real-C _ init | < δ _ init, if yes, executing step 205 and returning to step 203, and if not, continuing to return to step 203.

Step 205, updating C _ init based on C _ real.

Here, if the number of the historical detection values of the touch key is smaller than the set number, C _ real may be put into the sliding window and the detection values in the sliding window may be calculated to average; if the number of the historical detection values of the touch key reaches the set number, the detection value detected earliest in the sliding window is removed, the C _ real is added at the tail end of the sliding window, and then the detection values in the sliding window are averaged. Therefore, the reference threshold can be updated based on the sliding window, and the influence of the application environment on the touch key can be better adapted, for example, when water vapor is slowly accumulated on the surface of the capacitive key, the reference threshold of the capacitive key can be dynamically adapted to the process of slow accumulation of the water vapor, so that false triggering or missed identification of the touch key can be effectively avoided.

It is understood that if | C _ real-C _ init | ≧ δ _ init in step 204, step 205 is skipped, i.e., there is no need to update C _ init based on C _ real. Thereby avoiding updating the baseline threshold based on the capacitance value resulting from the actual touch by the user. It is ensured that the reference threshold value is changed only according to the change of the environment, so that the accuracy of the reference threshold value is effectively guaranteed.

Fig. 3 is a schematic diagram illustrating a flow of a touch key response in a touch recognition method of an application example, in which the touch key is a capacitive touch key. As shown in fig. 3, the flow of the touch key response includes:

and step 301, setting parameters.

The electronic device may perform parameter setting based on user input or default parameters, for example, setting the aforementioned setting number n _ real and the first setting difference δ _ real.

Step 302, periodically collecting C _ real.

It can be understood that, after the electronic device is powered on, the detection circuit of the touch key may periodically collect the current detection value of each touch key based on the set frequency, so as to obtain the real-time capacitance value C _ real of the touch key.

Step 303, determine whether C _ real-C _ init is greater than or equal to δ _ real, if yes, execute step 304.

It can be understood that before determining whether C _ real-C _ init ≧ δ _ real, | C _ real-C _ init ≧ δ _ init is determined, i.e., C _ real cannot be used to update the reference threshold C _ init, and if C _ real-C _ init ≧ δ _ real, C _ real is determined to be a capacitance value corresponding to the user touching the touch key, and step 304 is executed.

In practical applications, δ _ init may be set to δ _ real, that is, the first set difference is equal to the second set difference, so that the current detection value is either determined as a detection value corresponding to a non-user touch and is used to update the reference threshold value, so that the reference threshold value adapts to environmental changes; alternatively, the current detection value is determined as either a detection value corresponding to the user touch.

And step 304, determining effective touch of the touch key, and counting the continuous effective times.

Here, the count may be performed based on a counter for counting the number of consecutive times that C _ real is a detection value of a valid touch, that is, at an adjacent acquisition interval, if it is determined that C _ real is not a detection value of a valid touch, the counter stops counting and is cleared.

Step 305, judging whether the counted times reach the set times, if so, executing step 306; if not, go to step 309.

It is understood that the duration of the effective touch of the touch key may be determined based on the counted number, and if the counted number reaches n _ real, it indicates that the duration of the effective touch of the touch key meets the requirement, and step 306 is executed.

It can be understood that, if the counted number of times of continuous effective touches of the touch key is less than n _ real, the touch key is not responded to the operation of being touched, the counter is cleared, and the current number counting is exited. Therefore, false triggering of the touch key due to accidental detection value change can be reduced.

And step 306, executing the operation that the touch key is touched.

The operation of touching the touch key may be preset based on a program, which is not limited in the embodiment of the present application.

Step 307, judging whether C _ real-C _ init is less than delta _ real, if yes, executing step 308;

here, whether or not the touch key is released is confirmed based on whether or not C _ real-C _ init < δ _ real is determined, and if not released, this step 307 is continued.

Step 308, confirming that the touch key is released.

Step 309, end the current touch recognition.

It can be understood that after the electronic device confirms that the touch key is released, the current touch recognition is finished, so that the next touch recognition of the touch key is facilitated, and a false operation caused by repeated execution of the touch operation of the touch key in the process that the user touches the touch key can be avoided.

This application example, through the number of times of the capacitance value of the continuous effective touch of statistics, confirm that this number of times reaches the settlement number of times, just respond the operation that the touch button was touched, so, can effectively reduce the electromagnetic interference that probably exists because of the space, perhaps, there is occasional water to spatter the operation that the condition triggered the button that the key appearance value etc. appears the transient appears in the phenomenon such as result in, and then further reduce the probability that the touch button triggers by mistake, only detect the touch button by effective touch promptly and just think the touch button and pressed, and after confirming the touch button is released, just end current touch identification, can improve the accuracy of response, be convenient for promote user experience.

In order to implement the method of the embodiment of the present application, an embodiment of the present application further provides a touch recognition device for a touch key, where the touch recognition device for a touch key corresponds to the touch recognition method for a touch key, and each step in the touch recognition method for a touch key is also completely applicable to the embodiment of the touch recognition device for a touch key.

As shown in fig. 4, the touch recognition device for a touch key includes: an acquisition module 401 and a response module 402.

The obtaining module 401 is configured to obtain a current detection value of the touch key; acquiring a difference value between the current detection value and a reference threshold value; the response module 402 is configured to determine that the difference is greater than or equal to a first set difference, determine that the current detection value is a detection value corresponding to a valid touch, and respond to a corresponding touch operation.

In some embodiments, the touch recognition device of the touch key further includes: and an updating module 403, configured to determine that the absolute value of the difference is smaller than or equal to a second set difference, and update the reference threshold based on the current detection value.

In some embodiments, the touch recognition device of the touch key further includes: a determining module 404 for determining a reference threshold value based on at least one historical detection value of the touch key.

Illustratively, the determining module 404 is specifically configured to:

if the number of the historical detection values is determined to be smaller than or equal to the set number, acquiring a first average value of all the historical detection values; determining a reference threshold value according to the first average value;

if the number of the historical detection values is determined to be larger than the set number, obtaining a second average value of the latest set number of detection values; and determining a reference threshold value according to the second average value.

Illustratively, the updating module 403 is specifically configured to:

if the number of the historical detection values is smaller than the set number, obtaining a third average value of the current detection values and the historical detection values, and updating the reference threshold value according to the third average value;

determining that the number of the historical detection values is greater than or equal to a set number, and replacing the detection value at the earliest detection time in the set number of detection values with the current detection value based on the detection time; and acquiring a fourth average value of the replaced set number of detection values, and updating the reference threshold value according to the fourth average value.

In some embodiments, the response module 402 is further configured to: and determining that the newly acquired difference is smaller than the first set difference, and determining that the touch key is released.

In some embodiments, the response module 402 is specifically configured to:

periodically collecting the current detection value of the touch key based on the set frequency;

and determining that the number of times of continuously detecting the detection values corresponding to the effective touches reaches the set number of times, and responding to the corresponding touch operation.

Exemplarily, the touch recognition device of the touch key further includes: the setting module 405 is configured to adjust at least one of the first setting difference, the setting number and the second setting difference.

It is understood that the setting module 405 may also set the size of the sliding window, i.e. set the set number as described above.

In actual application, the obtaining module 401, the responding module 402, the updating module 403, the determining module 404, and the setting module 405 may be implemented by a processor in a touch recognition device of a touch key. Of course, the processor needs to run a computer program in memory to implement its functions.

It should be noted that: in the touch recognition device for touch keys provided in the above embodiments, when controlling an electronic device, only the division of the above program modules is taken as an example, and in practical applications, the above processing may be distributed to different program modules according to needs, that is, the internal structure of the device may be divided into different program modules to complete all or part of the above described processing. In addition, the touch recognition device of the touch key and the touch recognition method of the touch key provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.

Based on the hardware implementation of the program module, in order to implement the method according to the embodiment of the present application, an embodiment of the present application further provides an electronic device. Fig. 5 shows only an exemplary structure of the electronic device, not the entire structure, and a part of or the entire structure shown in fig. 5 may be implemented as necessary.

As shown in fig. 5, an electronic device 500 provided in an embodiment of the present application includes: at least one processor 501, memory 502, and a user interface 503. The various components in the electronic device 500 are coupled together by a bus system 504. It will be appreciated that the bus system 504 is used to enable communications among the components. The bus system 504 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 504 in fig. 5.

The user interface 503 in the embodiment of the present application may include a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touch pad, a touch screen, or the like.

The memory 502 in the embodiments of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program for operating on an electronic device.

The touch identification method for the touch key disclosed in the embodiment of the application can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip having signal processing capabilities. In the implementation process, the steps of the touch recognition method for the touch key can be implemented by an integrated logic circuit of hardware in the processor 501 or an instruction in the form of software. The Processor 501 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The processor 501 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium located in the memory 502, and the processor 501 reads information in the memory 502, and completes the steps of the touch recognition method for touch keys provided in the embodiments of the present application in combination with hardware thereof.

In an exemplary embodiment, the electronic Device may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the foregoing methods.

It will be appreciated that the memory 502 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memories described in the embodiments of the present application are intended to comprise, without being limited to, these and any other suitable types of memory.

Illustratively, the electronic device 500 may be a laundry treating device. Such as a washer, dryer, etc.

In practical application, the panel of the clothes treatment equipment is often easily interfered by water vapor, water drops and the like, and further the touch key is triggered by mistake.

Touch keys on a panel of the clothes treatment device are capacitance type touch keys, and in an environment with serious moisture such as a bathroom, the moisture can be slowly accumulated on the surfaces of the capacitance type touch keys, so that the phenomenon of key false triggering is caused.

Based on the touch identification method, the currently detected capacitance value can be compared with the reference threshold value, if the absolute value of the difference between the current capacitance value of the capacitive touch key and the reference threshold value is smaller than or equal to the second set difference value, it can be determined that the current capacitance value is not caused by the touch of the user, due to the touch operation of the user, the capacitance value of the touch key has relatively obvious sudden change, and the covering process of water vapor or water drops presents a trend that the capacitance value gradually changes, and here, whether the capacitance value changes caused by the real touch of the user can be distinguished based on the second set difference value which is reasonably set. If the current capacitance value is determined not to be the capacitance value corresponding to the real user touch, and the reference threshold value is updated based on the current capacitance value, the adaptability of the capacitive touch key to the application environment can be improved, and the capacitive touch key is effectively prevented from being triggered by mistake or being missed in identification.

For example, in order to save power consumption of the detection circuit of the capacitive touch key, the detection circuit of the capacitive touch key may further have a sleep mode and a wake-up mode, for example, in the sleep mode, the detection circuit stops collecting the current capacitance value of the capacitive touch key, and when the detection circuit switches from the sleep mode to the wake-up mode, the detection circuit resumes periodically collecting the current capacitance value of the capacitive touch key based on the set frequency.

In an exemplary embodiment, the present application further provides a storage medium, that is, a computer storage medium, which may be a computer readable storage medium, for example, a memory 502 storing a computer program, where the computer program is executable by a processor 501 of an electronic device to perform the steps described in the method of the present application. The computer readable storage medium may be a ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM, among others.

It should be noted that: "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.

The technical means described in the embodiments of the present application may be arbitrarily combined without conflict.

The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种差分信号双向隔离通讯电路及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类