Key operation state detection method, electronic equipment, storage medium and program product

By setting the detection baseline and the environmental baseline in the key detection system, and combining the difference of the operation detection signal, accurately identifying and filtering radio frequency interference, the problem of inaccurate detection in the existing technology in complex electromagnetic environments is solved, and efficient and flexible key operation status detection is achieved.

CN119847830APending Publication Date: 2025-04-18BYD CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411465204.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect the operating state of the touch button in complex electromagnetic environments, and the commonly used methods consume high resources and are costly, and are difficult to flexibly apply in different scenarios.

Method used

By setting the detection baseline and the environmental baseline, the operating status of the key is determined based on the operation detection signal, the difference between the detection baseline and the environmental baseline, and the operation status of the key is achieved to accurately identify and filter radio frequency interference.

Benefits of technology

It improves the accuracy and anti-interference of key operation status detection, reduces detection cost and complexity, and is suitable for devices with a large number of keys, improving detection flexibility and versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847830A_ABST
    Figure CN119847830A_ABST
Patent Text Reader

Abstract

The invention relates to a key operation state detection method, electronic equipment, a storage medium and a program product, and relates to the technical field of key detection, an operation detection signal of a key is obtained, a detection base line and an environment base line of operation state detection are obtained, and the operation state of the key is determined according to the operation detection signal, the detection base line and the environment base line. The environment baseline is used for representing the environment interference degree of the key during operation state detection. According to the invention, the accuracy, flexibility and anti-interference performance of key operation state detection can be improved, and the detection cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of key detection, and in particular to a key operation state detection method, electronic equipment, computer-readable storage medium and computer program product. Background Art

[0002] Nowadays, touch buttons are widely used in home appliances, smart homes and other devices. In order to reduce accidental button touches, it is common to add a shielding layer to the touch panel, change the touch panel material, or use intelligent algorithms to detect the button operation signal.

[0003] However, traditional methods such as adding shielding layers and changing touch panel materials are not effective in complex electromagnetic environments. The buttons are still prone to accidental touches or locks, and the resource consumption and cost of the above methods are extremely high. If a combination of software and hardware intelligent algorithms is used, high-performance chips need to be introduced and additional touch channels need to be set up, which not only increases the cost and complexity of the system, but also makes it difficult to flexibly apply in different scenarios. Summary of the invention

[0004] The embodiment of the present application provides a key operation status detection method, which improves the accuracy and efficiency of fault detection, so as to at least partially solve the above-mentioned technical problems.

[0005] In order to achieve the above object, according to a first aspect of the present application, a key operation state detection method is provided, the method comprising:

[0006] Get the key operation detection signal;

[0007] Acquire a detection baseline and an environmental baseline for operation status detection; the environmental baseline is used to characterize the degree to which the key is interfered by the environment during operation status detection;

[0008] The operation state of the key is determined according to the operation detection signal, the detection baseline and the environmental baseline.

[0009] Optionally, determining the operation state of the key according to the operation detection signal, the detection baseline and the environmental baseline includes:

[0010] Obtaining a difference between the detection baseline and the operation detection signal to obtain a detection deviation;

[0011] Obtaining a difference between the environmental baseline and the operation detection signal to obtain an environmental deviation;

[0012] The operation state of the key is determined according to the detection deviation and the environmental deviation.

[0013] Optionally, determining the operation state of the button according to the detection deviation and the environmental deviation includes:

[0014] When the detection deviation is less than or equal to the operation threshold, determining that the operation state of the key is not operated;

[0015] When the detection deviation is greater than the operation threshold, and the environmental deviation is less than the environmental threshold, determining that the operation state of the key is operated;

[0016] When the detection deviation is greater than the operation threshold, and the environmental deviation is greater than the environmental threshold, it is determined that the current operation of the key is interfered by the environment.

[0017] Optionally, the method further comprises:

[0018] When it is determined that the operation state of the key is not operated, the current detection baseline and the environment baseline are updated to obtain an updated detection baseline and an updated environment baseline.

[0019] Optionally, the detection baseline is updated by the following steps:

[0020] Acquire multiple numerical intervals for measuring the magnitude of the detection deviation;

[0021] Determining an update strategy for updating the detection deviation according to the numerical interval of the detection deviation;

[0022] The detection baseline is updated according to the update strategy to obtain the updated detection baseline.

[0023] Optionally, updating the detection baseline according to the update strategy to obtain the updated detection baseline includes:

[0024] When the detection deviation is within a preset environmental noise value range, the detection baseline is updated according to the current operation detection signal of the key; the environmental noise value range is a numerical range between a set negative environmental noise value and a positive environmental noise value;

[0025] When the detection deviation is between the positive environmental noise value and the operation threshold, or between the negative environmental noise value and the negative operation threshold, after a preset round of operation detection for the key, the detection baseline is updated based on the detection deviation of the first ratio;

[0026] When the detection deviation is less than a negative operation threshold, after a preset round of operation detections on the key, updating the detection baseline based on the detection deviation of a second ratio;

[0027] When the detection deviation is greater than the operation threshold, the detection baseline is not updated.

[0028] Optionally, the environment baseline is updated by the following steps:

[0029] When the environmental deviation is within a preset environmental noise value range, updating the environmental baseline based on the environmental deviation of a third ratio at every preset time interval;

[0030] When the environmental deviation is still greater than the positive environmental noise value after a preset period of time, the environmental baseline is updated to the current operation detection signal of the button;

[0031] When the environmental deviation is less than the negative environmental noise value, the environmental baseline is not updated.

[0032] Optionally, after determining that the current operation of the key is interfered by the environment, the method further includes:

[0033] When the environmental deviation is greater than the positive environmental noise, reducing the update speed of the detection baseline;

[0034] When the environmental deviation is greater than a preset multiple of the positive environmental noise, setting a noise flag for the button;

[0035] In the case where the button has the noise mark, when the difference between the current operation detection signal of the button and the environmental baseline is within a preset error range, the detection baseline is updated to the current operation detection signal.

[0036] According to a second aspect of the present application, a computer-readable storage medium is further provided, wherein program instructions are stored in the computer-readable storage medium, and when the program instructions are executed, the method described above is implemented.

[0037] According to a third aspect of the present application, a computer program product is also provided, wherein the computer program product comprises program instructions, and when the program instructions are executed by a processor, the method as described above is implemented.

[0038] According to a fourth aspect of the present application, an electronic device is also provided for executing the method as described above.

[0039] In the embodiment of the present application, two baselines, a detection baseline and an environmental baseline, are set. The detection baseline is used to detect the operating state of the key, and the environmental baseline is used to monitor whether it is interfered with by the environment and the degree of interference during the detection process, so that the radio frequency interference can be accurately identified and filtered during the detection process, and the accuracy and anti-interference of the key operation state detection are improved. Secondly, in the embodiment of the present application, there is no need to add a shielding layer, replace the touch panel material, introduce high-performance chips, or set up additional touch channels during the entire detection process, which effectively reduces the detection cost and complexity. Moreover, the detection of the embodiment of the present application can be achieved only through software algorithms, without adding additional hardware components, so it is also suitable for key devices with a large number of keys, which improves the flexibility and versatility of the detection. Other features and advantages of the present application will be described in detail in the subsequent specific implementation method section. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0041] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same figure numbers represent the same parts in the following description.

[0042] Figure 1 is a schematic diagram of an environment for a key operation status test provided in an exemplary embodiment of the present application;

[0043] Figure 2 is a flowchart of a key operation state detection method provided in an exemplary embodiment of the present application;

[0044] Figure 3 is a flowchart of a key operation state detection method provided in an exemplary embodiment of the present application;

[0045] Figure 4 is a schematic diagram of a process for updating a detection baseline based on a detection deviation provided in an exemplary embodiment of the present application;

[0046] Figure 5 is a schematic diagram of a process for updating an environment baseline provided in an exemplary embodiment of the present application;

[0047] Figure 6 is a schematic diagram of a process for updating a detection baseline based on an environmental deviation provided in an exemplary embodiment of the present application;

[0048] Figure 7is a block diagram of an electronic device provided in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0050] Touch buttons are usually based on the principle of capacitive sensing, and determine whether the button is touched by monitoring the capacitance change on the touch panel. In order to reduce accidental button touches, it is often used to add a shielding layer to the touch panel, replace the touch panel material, or use intelligent algorithms to detect the touch signal of the button to improve the stability and reliability of the system. For example, adaptive filters, dynamic threshold adjustment and other technologies are used to filter external interference signals to avoid misoperation caused by noise interference, which improves the anti-interference performance of the system to a certain extent, and is widely used in various devices with high anti-interference requirements.

[0051] However, the existing methods of anti-interference detection for touch buttons still have some shortcomings. First, the traditional methods of adding a shielding layer and changing the touch panel material are not effective in complex electromagnetic environments. For example, when using high-frequency devices such as walkie-talkies and mobile phones, touch buttons are still susceptible to radio frequency interference, resulting in accidental touches or locks. In addition, the above methods involve changing the PCB structure and replacing high-quality power boards, which will greatly consume hardware resources and are costly.

[0052] Secondly, most existing methods use a single baseline update and detection mechanism. When the environment changes rapidly or is disturbed, the baseline tracking sensitivity of the single baseline update mechanism is insufficient, resulting in inaccurate judgment of the button status, prone to false touches or failure to recognize valid touches.

[0053] In addition, in order to enhance the anti-interference performance, a combination of software and hardware intelligent algorithms can also be used for key testing, but this method requires the introduction of high-performance chips and the setting of additional touch channels. For example, several touch channels need to be freed up to act as antennas to detect environmental interference, and then the corresponding processing is performed through software. This obviously wastes chip pin resources and also reduces key sensitivity. Therefore, this method not only increases the cost and complexity of the system, but also makes it difficult to flexibly adapt to different application scenarios. For example, it is not suitable for testing devices with a large number of keys.

[0054] Based on the above problems, the present application provides a key operation status detection method, setting two baselines, a detection baseline and an environmental baseline. The detection baseline is used to detect the operation status of the key, and the environmental baseline is used to monitor whether the environment is disturbed and the degree of interference during the detection process, so that the radio frequency interference can be accurately identified and filtered during the detection process, and the accuracy and anti-interference of the key operation status detection are improved. Secondly, the embodiment of the present application does not need to add a shielding layer, replace the touch panel material, introduce high-performance chips, or set up additional touch channels during the entire detection process, which effectively reduces the detection cost and complexity. In addition, the detection of the embodiment of the present application can be achieved only through software algorithms, without the need to add additional hardware components, so it is also suitable for key devices with a large number of keys, which improves the flexibility and versatility of detection.

[0055] The present application is described below in conjunction with specific embodiments.

[0056] Figure 2 is a schematic diagram of a key operation status detection method provided by an embodiment of the present application, such as Figure 2 As shown, the method may include the following steps 101-103, which are described in detail below.

[0057] Step 101: Obtain a key operation detection signal.

[0058] In order to more clearly describe the embodiments of the present application, Figure 1 The key detection environment of the present application is introduced as an example. Figure 1 As shown, as an example, the test environment of the key operation state may include a radio frequency interference source (such as a walkie-talkie) and a key device.

[0059] Among them, the intercom is used to generate radio frequency interference signals, and the panel of the key device includes 14 touchable keys from key 1 to key 14. During the test, the intercom can be kept close to the device panel but not in direct contact. After the intercom is turned on, radio frequency interference tests of different frequencies can be performed to observe whether the keys are accidentally touched or locked. A false touch means that the key device mistakenly determines that the key is activated when the key is not actually touched. Locking means that the key fails to respond after being touched, causing the key device to fail to operate normally.

[0060] Through the above detection of the button operation status, the performance of each button of the button device in the radio frequency interference environment can be evaluated, laying the foundation for subsequent optimization of button design and improving the anti-interference ability of buttons.

[0061] The operation detection signal refers to a capacitance signal generated according to the intensity and duration of the touch on the key when the key is touched or pressed. The operation detection signal is usually expressed as a unitless count value, for example, the count value can be 100, 1000, etc.

[0062] In some embodiments, the capacitance change of the touch panel of the key device can be sensed by a capacitive sensor or other touch sensing technology. The capacitance change reflects the user's operation behavior on the key (such as touch or press operations). The collected capacitance change can then be converted into a corresponding count value. The following will take the touch operation on the key as an example to introduce this embodiment.

[0063] Specifically, each effective touch on a key will cause the count value to increase, and the count value can be accumulated and updated according to the intensity, time and frequency of the key touch to determine the validity of the touch and perform baseline updates and status judgments in subsequent processing.

[0064] In this application, the operation detection signal can not only be used to detect the operation events of the buttons, but also can be used as the basic data of the dual baseline update algorithm. It can be dynamically adjusted according to the deviation between the current count value of the operation detection signal and the baseline to adapt to environmental changes and external interference. Through the operation detection signal, the noise signal can be effectively filtered. When environmental interference is detected, the change in the count value of the operation detection signal can trigger the corresponding adjustment strategy, thereby improving the anti-interference ability of the key operation state detection and reducing the key false touch.

[0065] Step 102: Acquire a detection baseline and an environment baseline for operation status detection.

[0066] The detection baseline refers to the reference signal value used to detect the operation status of a key, which can reflect the capacitance value of the key in a non-touch and non-interference state. Therefore, the detection baseline can be understood as a reference value, and by comparing the size relationship between the currently detected operation detection signal and the detection baseline in real time, it can be determined whether the key has undergone an effective operation behavior (such as touch, press, etc.).

[0067] The environmental baseline is used to characterize the degree of environmental interference to the key during the operation state detection. It is a reference signal value used to track and characterize the environmental noise or electromagnetic interference to the touch key during the operation process. It can reflect the impact of the external environment (such as radio frequency interference, temperature, humidity changes, etc.) on the key in the non-operating state. Adjusting the environmental baseline can help the system identify which signals belong to external interference, so as to effectively filter these interference signals during the detection process.

[0068] In some embodiments, when the system is initialized or reset, the sensor can collect the signal value in the non-operation state, and record the signal value as the initial value of the detection baseline, which reflects the capacitance or electrical signal characteristics of the device in the initial state. The detection baseline monitors the key state and makes fine adjustments over time and environmental changes to ensure that it can continuously and accurately identify whether the key is effectively triggered.

[0069] In some embodiments, the environmental baseline is similar to the detection baseline and is also obtained when the system is initialized. It should be noted that during the initialization phase of the key device, the key is in a non-operational state, there is no user touching the key, and there is no obvious environmental interference. Therefore, the initial values ​​of the detection baseline and the environmental baseline can be the signal values ​​captured by the sensor in a non-operational and non-interference state.

[0070] Step 103: Determine the operation state of the key according to the operation detection signal, the detection baseline and the environmental baseline.

[0071] After understanding the concepts of the above operation detection signal, detection baseline, and environmental baseline, it can be known that when a key is touched or pressed by a user, a difference is generated between the operation detection signal and the detection baseline, so the difference can be used to determine whether the key is operated. Correspondingly, during the process of detecting the operation status of the key, when external noise is detected, the environmental baseline will be updated to reflect the intensity of the current interference. By monitoring the environmental baseline, the magnitude of the external interference can be determined, and the judgment of the operation detection signal can be adjusted accordingly.

[0072] This application can determine whether a key is effectively operated by the difference between the operation detection signal and the detection baseline, and use the environmental baseline to filter external interference signals. With the cooperation of the dual baseline mechanism, it can accurately distinguish between effective operations and interference signals in complex environments, ensuring the high stability and anti-interference ability of key operations.

[0073] In some embodiments, step 103 may include:

[0074] First, the difference between the detection baseline and the operation detection signal is obtained to obtain the detection deviation;

[0075] Next, the difference between the environmental baseline and the operation detection signal is obtained to obtain the environmental deviation;

[0076] Finally, the operation state of the key is determined based on the detection deviation and the environmental deviation.

[0077] The detection deviation refers to the difference between the detection baseline and the operation detection signal, which is used to determine whether a valid operation has occurred on a key. For example, when a user touches or presses a key, the operation detection signal will have a large difference from the detection baseline, resulting in an obvious detection deviation.

[0078] In some embodiments, the expression for detecting deviation is:

[0079] SYS differ =SYS BASELINE -RAWDATA;

[0080] Among them, SYS differ is the detection deviation, SYS BASELINE is the detection baseline, and RAWDATA is the count value obtained by the current key detection.

[0081] The size of the detection deviation can directly reflect the state of the key operation. Usually, if the detection deviation exceeds the predetermined threshold, it can be preliminarily determined that the key has been triggered. However, it should be noted that the present application adopts a dual baseline detection mechanism, which fully considers that external interference may also cause similar deviations, so that the detection deviation alone is not enough to fully determine the operation state of the key, thereby effectively improving the accuracy of key operation state detection.

[0082] Among them, the environmental deviation refers to the difference between the environmental baseline and the operation detection signal, which is used to measure the environmental interference components contained in the key operation detection signal. When there is strong interference from the outside world (such as radio frequency interference), it means that the current key detection is subject to greater environmental interference, and the operation detection signal will have a large difference with the environmental baseline; correspondingly, if the environmental deviation is small, it means that the current key detection is less affected by the environment, for example, the current environmental noise value is within a reasonable range.

[0083] In some embodiments, the expression of environmental deviation is:

[0084] ENV differ =RAWDATA-ENV BASeLINE ;

[0085] Among them, ENV differ is the environmental deviation, ENV BASELINE is the environment baseline, and RAWDATA is the count value obtained by the current key detection.

[0086] During specific detection, if the detection deviation greatly exceeds the preset operation threshold, it means that the operation detection signal has changed significantly relative to the detection baseline, and it can be preliminarily determined that a user may have operated the key. At the same time, combined with the environmental deviation, it is judged whether the current detection is subject to greater environmental interference. For example, if the environmental deviation is less than the preset threshold, it means that the current detection is not subject to greater environmental interference, and the current detection environment noise is within a reasonable range. At this time, the key operation state can be determined as being operated. Correspondingly, if the environmental deviation is greater than the preset threshold, it means that the current detection environment can be subject to greater environmental interference. At this time, the detection result of the key operation state is not obtained temporarily, and the detection is performed after the environmental noise returns to a reasonable range or the subsequent environmental baseline is changed to the correct value.

[0087] It should be noted that when the detection deviation does not exceed the preset operation threshold, it means that the count value is close to the detection baseline, and there is no environmental interference in the detection environment. There is no need to consider the impact of environmental noise on detection through environmental baseline and environmental deviation, and the button operation status can be directly determined as not being operated.

[0088] This application can accurately distinguish between effective key operations and external interference signals by obtaining detection deviation and environmental deviation, and comparing the differences between the two. Detection deviation is used to preliminarily determine whether the key has been operated, while environmental deviation is used to determine whether the operation signal is affected by environmental interference. Combining these two data, high reliability and accuracy can be maintained in a complex RF interference environment to ensure normal operation and detection of the key.

[0089] In some embodiments, the operational state of a key may be determined by:

[0090] First, when the detection deviation is less than or equal to the operation threshold, it is determined that the operation state of the key is not operated;

[0091] Next, when the detection deviation is greater than the operation threshold and the environmental deviation is less than the environmental threshold, the operation state of the key is determined to be operated;

[0092] Finally, when the detection deviation is greater than the operation threshold and the environment deviation is greater than the environment threshold, it is determined that the current operation of the key is interfered by the environment.

[0093] It can be understood that when the detection deviation is less than or equal to the operation threshold, it means that the difference between the operation detection signal and the detection baseline is not large, the perceived signal change is small, and the condition for triggering the key operation is not met.

[0094] Correspondingly, when the detection deviation is greater than the operation threshold, it means that the difference between the operation detection signal and the detection baseline is large, and the key operation state may be operated. However, only the detection deviation exceeding the operation threshold is not enough to directly determine the operation state of the key, and the environmental deviation needs to be further considered. If the environmental deviation is less than the environmental threshold, it means that the difference between the operation detection signal and the environmental baseline is very small, and the current operation detection signal is not caused by external interference, but is a real key touch, press and other operations. It can be determined that the key operation state is operated.

[0095] Specifically, the conditional expression for determining whether the operation state of a key is being operated is:

[0096] SYS differ >FTH;

[0097] ENV differ <EFT;

[0098] Among them, SYS differ is the detection amount deviation, ENV differ is the environmental deviation, FTH is the operating threshold, and EFT is the environmental threshold.

[0099] Correspondingly, if the detection deviation is greater than the operation threshold, it indicates that the key operation signal has changed significantly, but at the same time, if the environmental deviation is greater than the environmental threshold, it means that the difference between the operation detection signal and the environmental baseline is large, and the current operation detection signal is subject to large external environmental interference, such as radio frequency interference and electromagnetic noise. At this time, it can be considered that the change in the operation detection signal is mainly caused by environmental interference, rather than the actual operation of the user. This is treated as a detection abnormality and the current detection result is not obtained for the time being.

[0100] It should be noted that, as mentioned above, if the key is not operated, the current detection is not subject to significant environmental interference. Therefore, under the condition that the key is not operated, there is no need to consider the size comparison between the environmental deviation and the environmental threshold.

[0101] As can be seen from the above, this application ensures that the system can accurately distinguish the real operation of the key from the environmental interference in a complex electromagnetic interference environment through the joint judgment of detection deviation and environmental deviation. Through the above mechanism, the anti-interference ability and operation accuracy of the key can be improved.

[0102] In some embodiments, when it is determined that the operation state of a key is not operated, the current detection baseline and the environment baseline may be updated to obtain an updated detection baseline and an updated environment baseline.

[0103] It can be understood that the purpose of updating the baseline is to ensure that the system can adapt to environmental changes when there is no operation, and maintain the stability and anti-interference ability of the touch key system. When it is determined that the key is not operated, the detection baseline can be updated according to the current detection signal, and the environmental baseline can be updated according to the current environmental noise value.

[0104] The detection baseline update mainly focuses on the standard capacitance value when the button is not operated, ensuring that the operation status of the button can be accurately determined according to the current environmental conditions. The environmental baseline update is mainly used to quickly track external noise or radio frequency interference signals to help the system filter invalid signals in a strong interference environment. In addition, the size of the detection deviation itself can be determined based on the size of the detection deviation, and the update speed of the detection baseline can be determined based on the size of the environmental deviation.

[0105] This application can ensure the accuracy of the baseline in the non-operation state through the coordinated update of the dual baseline, thereby maintaining stable operation judgment and strong anti-interference ability in complex environments. The dual baseline update mechanism can reduce key errors and lock phenomena, and improve the reliability of key use and user experience.

[0106] In some embodiments, the detection baseline may be updated by:

[0107] First, multiple numerical intervals for measuring the magnitude of the detection bias are obtained;

[0108] Next, according to the numerical range in which the detection deviation is located, an update strategy for updating the detection deviation is determined;

[0109] Finally, the detection baseline is updated according to the update strategy to obtain an updated detection baseline.

[0110] In order to better control the update amplitude and frequency of the detection baseline, a plurality of numerical intervals may be preset according to the size of the detection deviation, and each numerical interval represents a different degree of change of the operation detection signal.

[0111] Specifically, when the detection deviation is within a smaller range of values, the difference between the operation detection signal and the detection baseline is small, indicating that the detection environment has changed little or there is no significant operation, and the key is in a stable state or a slightly fluctuating state.

[0112] Correspondingly, when the detection deviation is in a medium range of values, it indicates that the difference between the operation detection signal and the detection baseline begins to increase, and a more significant environmental change or potential interference signal is detected, but the threshold for triggering a key operation has not yet been reached.

[0113] Correspondingly, when the detection deviation is in a larger range of numerical intervals, the difference between the operation detection signal and the baseline is significant, indicating that the key is subject to strong external interference or is about to enter a key trigger state.

[0114] By dividing the detection deviation into multiple numerical intervals, the system can flexibly respond to different degrees of changes in the operation detection signal, so as to adopt appropriate update strategies to ensure that the update of the detection baseline can adapt to environmental changes while avoiding over-adjustment. Its core purpose is to achieve: when the detection deviation is too large and in a larger numerical interval, the detection baseline can be updated slightly; when the detection deviation is small and in a smaller numerical interval, the detection baseline can be updated slightly.

[0115] In some embodiments, the updated detection baseline may be obtained by:

[0116] First, when the detection deviation is within a preset environmental noise value range, the detection baseline is updated according to the current operation detection signal of the key; the environmental noise value range is a numerical range between a set negative environmental noise value and a set positive environmental noise value;

[0117] Secondly, when the detection deviation is between the positive environmental noise value and the operation threshold, or between the negative environmental noise value and the negative operation threshold, after a preset round of operation detection for the key, the detection baseline is updated based on the detection deviation of the first ratio;

[0118] Next, when the detection deviation is less than the negative operation threshold, after a preset round of operation detections on the key, the detection baseline is updated based on the detection deviation of the second ratio;

[0119] Finally, when the detection deviation is larger than the operational threshold, the detection baseline is not updated.

[0120] It can be understood that when the detection deviation is between the set negative environmental noise value (e.g., -N) and the positive environmental noise value (e.g., +N), it means that the operation detection signal change is within an acceptable environmental noise range, indicating that no significant environmental interference is currently detected. In this case, the detection baseline can be updated according to the current operation detection signal, that is, the detection baseline is updated to the current count value. At this point, it can be considered that the current operation detection signal can accurately reflect the normal fluctuations of the environment, so it is necessary to adjust the detection baseline to this new state in order to more accurately track future changes from the operation detection signal. By updating the operation detection signal by a small amplitude, the system can quickly respond to slight changes in the current environment, thereby maintaining the accuracy and effectiveness of the detection baseline.

[0121] Correspondingly, when the detection deviation is between the positive ambient noise value and the operation threshold, or between the negative ambient noise value and the negative operation threshold, it means that although the operation detection signal has a large change, it has not reached the threshold for triggering a key operation, and a more conservative update strategy can be adopted for the detection baseline.

[0122] Specifically, a preset 4n rounds of operation detection can be performed on the key, where n is an integer greater than 0. In the above detection rounds, the change of the operation detection signal can be continuously monitored to confirm whether the operation detection signal is stable and whether the change trend is continuous. After completing 4n rounds of detection, the detection baseline can be updated according to the value of the detection deviation. For example, the update strategy can be to update the detection baseline according to the first ratio with the detection deviation as a step size. For example, the first ratio can be 1 / 2, that is, only half of the detection deviation can be applied to the detection baseline update, and the update amount under each step size is 1 / 2 times the detection deviation. The update amplitude is relatively mild to ensure that the detection baseline can be gradually adjusted without rapidly changing the detection baseline due to a large detection deviation, thereby maintaining the stability of the key detection.

[0123] Correspondingly, when the detection deviation is less than the negative operation threshold, it means that the operation detection signal is far below the detection baseline, and the current detection is affected by strong external interference or environmental changes. Therefore, in order to prevent the detection baseline from being adjusted incorrectly, a more cautious update strategy can be adopted for the detection baseline.

[0124] For example, a preset 6n rounds of operation detection can be performed on the button, which is more rounds than the previous 4n rounds. In the case of large interference or large signal fluctuations, more detection rounds are required to confirm the authenticity and stability of the signal. After completing 6n rounds of operation detection, the detection baseline can be updated based on the detection deviation of the second ratio, for example, the second ratio can be 1 / 5. That is, only 1 / 5 times the detection deviation can be applied to update the detection baseline. Using the second ratio update is more cautious and is suitable for environments with strong interference to avoid excessive adjustment of the detection baseline due to interference, ensuring that the detection baseline remains stable.

[0125] When the detection deviation is greater than the operation threshold, it indicates that the difference between the operation detection signal and the baseline has exceeded the normal range, which may be due to the key being actually triggered or excessive external interference. In this case, the detection baseline will not be updated to avoid incorrect adjustment of the detection baseline and keep the detection baseline stable to ensure that there will be no incorrect adjustment in the case of key operation or extreme interference, thereby ensuring the accuracy of the detection.

[0126] This application adopts a corresponding proportional update strategy based on different intervals and rounds of detection deviation to flexibly adjust the detection baseline. This update mechanism improves the system's anti-interference ability and ensures the accuracy of key operation and the stability of the system.

[0127] In some embodiments, the environment baseline may be updated by:

[0128] First, when the environmental deviation is within a preset environmental noise value range, the environmental baseline is updated based on the environmental deviation of the third ratio at every preset time interval;

[0129] Next, when the environmental deviation is still greater than the positive environmental noise value after a preset period of time, the environmental baseline is updated to the current operation detection signal of the button;

[0130] Finally, when the environmental deviation is less than the negative environmental noise value, the environmental baseline is not updated.

[0131] It can be understood that when the environmental deviation is between the preset negative environmental noise value and the positive environmental noise value, it means that the environmental noise is within the normal range. At this time, the environmental baseline can be updated regularly to ensure that the environmental baseline accurately reflects the current environmental status.

[0132] In some embodiments, a time interval may be set to update at the end of each time period. For example, based on the current environmental deviation, the environmental baseline may be updated at a preset time interval of every 100 ms and a third ratio of 0.01. Specifically, the update formula of the environmental baseline may be:

[0133] ENV BASELINE =LAST ENV BASElINE +0.01×ENV differ ;

[0134] Among them, ENV BASELINE is the updated environment baseline, LAST ENV BASELINE It is the environment baseline of the previous round, ENV differ It's environmental bias.

[0135] Correspondingly, after the preset time, the environmental deviation is still greater than the positive environmental noise value, indicating that the current environmental interference is strong. For example, the preset time can be set to 15 seconds. When the environmental deviation is greater than the positive environmental noise value for 15 seconds, it can be determined that the current system is stable and the baseline release mechanism is enforced, that is, the environmental baseline is no longer updated in a stable and slow manner, and the environmental baseline can be immediately updated to the current operation detection signal, that is, the current count value. It should be noted that the specific value of the preset time is not limited in this embodiment.

[0136] Correspondingly, when the environmental deviation is less than the negative environmental noise value, it indicates that the current deviation may be caused by touch, and the existing environmental baseline can be maintained without updating the current environmental baseline, thereby avoiding unnecessary adjustment of the baseline caused by too small an environmental change.

[0137] From the above, it can be seen that this application ensures that the environmental baseline can accurately reflect the current environmental status through analysis and update strategy of environmental deviations, thereby effectively improving the anti-interference ability and operation accuracy of the buttons, providing users with a more reliable experience.

[0138] In some embodiments, after determining that the current operation of the key is interfered by the environment, the method of the present application further includes:

[0139] First, when the environmental deviation is greater than the positive environmental noise, the update speed of the detection baseline is reduced;

[0140] Next, when the environmental deviation is greater than a preset multiple of positive environmental noise, a noise flag is set for the button;

[0141] Finally, in the case where a noise mark exists on a key, when the difference between the current operation detection signal of the key and the environmental baseline is within a preset error range, the detection baseline is updated to the current operation detection signal.

[0142] Specifically, when the environmental deviation exceeds the positive environmental noise value, it means that there is strong noise interference (such as radio frequency interference, electromagnetic interference, etc.) in the external environment, which may affect the detection accuracy of key operations, so measures need to be taken to deal with this situation in a timely manner. In this case, the update frequency or amplitude of the detection baseline can be slowed down to avoid excessive adjustment of the baseline due to external noise interference. A slower update speed can prevent the system from frequently adjusting due to short-term noise fluctuations, thereby maintaining the stability of the detection baseline. Reducing the update speed of the detection baseline can also help the system maintain the stability of the detection baseline in an interference environment, avoid overreaction to short-term interference, and ensure accurate operation recognition of the key.

[0143] In some embodiments, the update speed of the detection baseline can be reduced by appropriately reducing the update frequency. For example, the current detection can be changed from updating once every n detection rounds to updating once every 2n detection rounds, and for another example, the current detection can be changed from updating once every 2n detection rounds to updating once every 4n detection rounds. The specific value of the update frequency change is not limited in this embodiment.

[0144] Correspondingly, when the environmental deviation increases further and exceeds the preset multiple of the positive environmental noise value, for example, the preset multiple may be 1.2 times, it indicates that the interference in the current environment has reached a relatively strong level. At this time, a noise flag may be set for the button to mark that the current operation of the button may be significantly interfered by noise and needs to be considered in subsequent operation judgments. By setting a noise flag, different strategies can be applied to deal with interference in subsequent operation judgments, such as adding more error tolerance when processing button states, or making more stringent judgments to prevent false triggering caused by noise interference.

[0145] Correspondingly, after the noise flag is set for the button, the monitoring of the button operation signal can be strengthened, with particular attention paid to the difference between the button's current operation detection signal and the environmental baseline. When the difference between the button's current operation detection signal and the environmental baseline is within the preset error range, that is, when the button's count value returns to near the environmental baseline, it indicates that the current impact of noise interference may be reduced or the button's operation signal has stabilized. At this point, the detection baseline can be updated to the current operation detection signal, so that the detection baseline better adapts to the current operating state, further improving the accuracy and stability of button detection.

[0146] It can be understood that when the environmental noise interference of the detection scene is weakened, or the operation detection signal of the button becomes close to the environmental baseline, the detection baseline can be updated to the current operation detection signal, that is, the current count value, thereby ensuring that the baseline better reflects the current actual state and reducing the detection error caused by environmental noise.

[0147] As can be seen from the above, this application can enhance the anti-interference ability of keys in complex environments by monitoring environmental deviations and operation detection signals and flexibly adjusting the update strategy of the detection baseline. By reducing the update speed of the detection baseline, setting noise flags, and updating the baseline under appropriate circumstances, it can maintain stability in an interference environment and ensure the accuracy of touch key operations.

[0148] Figure 3 201 to 204 are flow charts of a key operation state detection method provided in an exemplary embodiment of the present application, including the following steps 201 to 204.

[0149] Step 201: Obtain the current operation detection signal of the key by key scanning.

[0150] Step 202: Execute the dual baseline update strategy. Step 202 may include the following steps 2021 and 2022:

[0151] Step 2021, calculating detection deviation and environmental deviation;

[0152] Step 2022: Update the detection baseline and environment baseline.

[0153] Step 203: Use the dual baseline standard to determine the operation status of the key.

[0154] Step 204: Start the scanning and detection operation of the next key.

[0155] It should be noted that the detailed description of steps 201 to 204 can be found in the above Figure 2 The relevant description of each step embodiment in the above will not be repeated here.

[0156] Figure 4It is a flowchart of updating the detection baseline based on the detection deviation provided in the exemplary embodiment of the present application, including the following steps 301 to 305.

[0157] Step 301: The current source is self-adapted and the operation detection signal of each channel is assigned to the detection baseline to obtain an initial detection baseline.

[0158] Step 302: When the detection deviation is within the range of the environmental noise value, after n rounds of detection, the detection baseline is immediately updated to the count value of the operation detection signal.

[0159] Step 303: When the detection deviation is between the positive ambient noise value range and the positive operation threshold, or between the negative ambient noise value and the negative operation threshold, after 4n rounds of detection, the detection baseline is updated with a step size of 1 / 2 times the detection deviation.

[0160] Step 304: When the detection deviation is continuously smaller than the negative operation threshold, after 6n rounds of detection, the detection baseline is updated with a step size of 1 / 5 times the detection deviation.

[0161] Step 305: When the detection deviation continues to be greater than the positive operation threshold, the detection baseline is not updated.

[0162] It should be noted that for detailed descriptions of steps 301 to 305, please refer to the above Figure 2 The relevant description of each step embodiment in the above will not be repeated here.

[0163] Figure 5 4 is a flowchart of updating an environment baseline provided in an exemplary embodiment of the present application, including the following steps 401 to 404.

[0164] Step 401: The current source is self-adapted, and the operation detection signal of each channel is assigned to the environmental baseline to obtain an initial environmental baseline.

[0165] Step 402: When the environmental deviation is between the positive and negative environmental noise, the baseline is updated every 100 ms according to the environmental baseline of the previous round and the environmental deviation of this round.

[0166] Step 403: When the environmental deviation is greater than the positive environmental noise for 15 seconds, the environmental baseline is updated to the current count value.

[0167] Step 404: When the environmental deviation is less than the negative environmental noise, the environmental baseline is not updated.

[0168] It should be noted that for detailed descriptions of steps 401 to 404, please refer to the above Figure 2 The relevant description of each step embodiment in the above will not be repeated here.

[0169] Figure 6 It is a flowchart of updating the detection baseline based on the environmental deviation provided in the exemplary embodiment of the present application, including the following steps 501 to 503.

[0170] Step 501: When the detection deviation is greater than the environmental noise value, it is determined that there is environmental interference in the detection, and the update speed of the detection baseline is reduced.

[0171] Step 502: When the detection deviation is greater than 1.2 times the environmental noise value, it is determined that the detection is greatly disturbed by the environment, the update speed of the detection baseline is reduced, and a noise flag is set for the key.

[0172] Step 503: When a noise mark is present on a key, and the count value of the operation detection signal is detected to fall back to near the environmental baseline, the detection baseline is updated to the current count value.

[0173] It should be noted that for detailed descriptions of steps 501 to 503, please refer to the above Figure 2 The relevant description of each step embodiment in the above will not be repeated here.

[0174] Figure 7 FIG. 6 is a block diagram of an electronic device 600 according to an exemplary embodiment. Figure 7 As shown, the electronic device 600 may include: a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input / output (I / O) component 604, and a communication component 605.

[0175] The processor 601 is used to control the overall operation of the electronic device 600 to complete all or part of the steps in the above-mentioned key operation state detection method. The memory 602 is used to store various types of data to support the operation of the electronic device 600, and these data may include, for example, instructions for any application or method used to operate on the electronic device 600, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 603 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 602 or sent through the communication component 605. The audio component also includes at least one speaker for outputting audio signals. The I / O component 604 provides an interface between the processor 601 and other interface modules, and the above-mentioned other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as WiFi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 605 may include: WiFi module, Bluetooth module, NFC module, etc.

[0176] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned key operation status detection method.

[0177] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by the domain controller, the steps of the key operation state detection method described above are implemented. For example, the computer-readable storage medium may be the memory 602 including the program instructions described above, and the program instructions may be executed by the processor 601 of the electronic device 600 to complete the following steps:

[0178] Get the key operation detection signal;

[0179] Acquire a detection baseline and an environmental baseline for operation status detection; the environmental baseline is used to characterize the degree to which the key is interfered by the environment during operation status detection;

[0180] The operation state of the key is determined according to the operation detection signal, the detection baseline and the environmental baseline.

[0181] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the charging control methods recorded in the above method embodiments.

[0182] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0183] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0184] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.

[0185] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0186] In addition, the functional units in the various embodiments of the application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software program modules.

[0187] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable storage unit. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage unit, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage unit includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0188] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage unit, which can include: a flash drive, a read-only storage unit, a random access memory, a magnetic disk or an optical disk, etc.

[0189] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings; however, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, a variety of simple modifications can be made to the technical solution of the present application, and these simple modifications all fall within the protection scope of the present application.

[0190] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this application will not further describe various possible combinations.

[0191] In addition, the various implementation modes of the present application may be arbitrarily combined, and as long as they do not violate the concept of the present application, they should also be regarded as the contents disclosed in the present application.

Claims

1. A key operation state detection method, characterized in that: The method comprises: Get the key operation detection signal; Acquire a detection baseline and an environmental baseline for operation status detection; the environmental baseline is used to characterize the degree to which the key is interfered by the environment during operation status detection; The operation state of the key is determined according to the operation detection signal, the detection baseline and the environmental baseline.

2. The method according to claim 1, characterized in that: The step of determining the operation state of the key according to the operation detection signal, the detection baseline and the environment baseline includes: Obtaining a difference between the detection baseline and the operation detection signal to obtain a detection deviation; Obtaining a difference between the environmental baseline and the operation detection signal to obtain an environmental deviation; The operation state of the key is determined according to the detection deviation and the environmental deviation.

3. The method according to claim 2, characterized in that The step of determining the operation state of the key according to the detection deviation and the environmental deviation includes: When the detection deviation is less than or equal to the operation threshold, determining that the operation state of the key is not operated; When the detection deviation is greater than the operation threshold, and the environmental deviation is less than the environmental threshold, determining that the operation state of the key is operated; When the detection deviation is greater than the operation threshold, and the environmental deviation is greater than the environmental threshold, it is determined that the current operation of the key is interfered by the environment.

4. The method according to claim 3, characterized in that The method further comprises: When it is determined that the operation state of the key is not operated, the current detection baseline and the environment baseline are updated to obtain an updated detection baseline and an updated environment baseline.

5. The method according to claim 4, characterized in that The detection baseline is updated by the following steps: Acquire multiple numerical intervals for measuring the magnitude of the detection deviation; Determining an update strategy for updating the detection deviation according to the numerical interval of the detection deviation; The detection baseline is updated according to the update strategy to obtain the updated detection baseline.

6. The method according to claim 5, characterized in that The updating of the detection baseline according to the update strategy to obtain the updated detection baseline includes: When the detection deviation is within a preset environmental noise value range, the detection baseline is updated according to the current operation detection signal of the key; the environmental noise value range is a numerical range between a set negative environmental noise value and a positive environmental noise value; When the detection deviation is between the positive environmental noise value and the operation threshold, or between the negative environmental noise value and the negative operation threshold, after a preset round of operation detection for the key, the detection baseline is updated based on the detection deviation of the first ratio; When the detection deviation is less than a negative operation threshold, after a preset round of operation detections on the key, updating the detection baseline based on the detection deviation of a second ratio; When the detection deviation is greater than the operation threshold, the detection baseline is not updated.

7. The method according to any one of claims 4 to 6, characterized in that: The environment baseline is updated by following the steps below: When the environmental deviation is within a preset environmental noise value range, updating the environmental baseline based on the environmental deviation of a third ratio at every preset time interval; When the environmental deviation is still greater than the positive environmental noise value after a preset period of time, the environmental baseline is updated to the current operation detection signal of the button; When the environmental deviation is less than the negative environmental noise value, the environmental baseline is not updated.

8. The method according to claim 7, characterized in that After determining that the current operation of the key is interfered by the environment, the method further includes: When the environmental deviation is greater than the positive environmental noise, reducing the update speed of the detection baseline; When the environmental deviation is greater than a preset multiple of the positive environmental noise, setting a noise flag for the button; In the case where the button has the noise mark, when the difference between the current operation detection signal of the button and the environmental baseline is within a preset error range, the detection baseline is updated to the current operation detection signal.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, which implement the method according to any one of claims 1 to 8 when executed.

10. A computer program product, characterized in that The computer program product comprises program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

11. An electronic device, characterized in that: Used to perform the method according to any one of claims 1 to 8.