Key signal response method, device and equipment and readable storage medium
By identifying and processing the jitter signals of mechanical keys, the problem that mechanical keys are prone to misidentified instructions in situations where power is disturbed by high power, and higher key command recognition accuracy and anti-interference performance are achieved.
Patent Information
- Application Number
- CN202311085604.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2025-02-25
AI Technical Summary
Mechanical buttons are prone to jitter in situations where power is disturbed greatly, resulting in misidentification of the commands and the system generates incorrect response instructions.
During the process of continuously sampling the key signal, it is recognized whether there is an effective key operation event in the first period. If it exists, the overall key signal is obtained, and a corresponding response command is generated based on the signal characteristic information.
It effectively avoids the generation of error response commands caused by key jitter, and improves the accuracy and anti-interference performance of key command recognition.
Smart Images

Figure CN119512380A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of key recognition technology, and in particular to a key signal response method, device, equipment and readable storage medium. Background Art
[0002] Mechanical keys are one of the most commonly used command input methods and are widely used in electronic devices such as atomizers and headphones. Therefore, the stability and reliability of the keys are very important. In some situations where power supply interference is large, mechanical keys will generate jitters when they are closed and disconnected. In order to ensure that the system can correctly identify the action instructions of the keys, the jitter signals of the keys must be processed. Under normal circumstances, the human body cannot feel the jitter of the keys, but the microcontroller can sense it. The processing speed of the microcontroller is at the "microsecond" level, while the key jitter time is at least at the "millisecond" level. The related technology uses a microcontroller to detect and determine the on and off state of the key during the key jitter period. The user's single press or release operation on the key may be mistakenly identified as multiple operations, thereby causing misprocessing. Summary of the invention
[0003] The main purpose of the present application is to provide a key signal response method, device, equipment and readable storage medium, which can at least solve the problem of mechanical keys in the related art being prone to misrecognition of instructions.
[0004] To achieve the above-mentioned purpose, the first aspect of the present application provides a key signal response method, which is applied to an electronic device, wherein the electronic device is configured with a mechanical key, and the key signal response method comprises:
[0005] In the process of continuously sampling the key signal, identifying whether there is a valid key operation event according to the key signal sampled in the first period;
[0006] If there is a valid key operation event, then the overall key signal corresponding to the valid key operation event is obtained; wherein the sampling period of the overall key signal is a second time period, the second time period is greater than or equal to the first time period, and is the same as the starting time of the first time period;
[0007] Generate corresponding response instructions based on the signal feature information in the overall key signal.
[0008] A second aspect of the present application provides a key signal response device, which is applied to an electronic device, wherein the electronic device is equipped with a mechanical key, and the key signal response device comprises:
[0009] An identification module, used for identifying whether there is a valid key operation event according to the key signal sampled in the first period during the process of continuously sampling the key signal;
[0010] An acquisition module, used for acquiring an overall key signal corresponding to a valid key operation event if there is one; wherein a sampling period of the overall key signal is a second period, the second period is greater than or equal to the first period, and is the same as the start time of the first period;
[0011] A filtering module is used to filter out interference signals in the overall key signal to obtain a valid key signal;
[0012] The generating module is used to generate corresponding response instructions based on the signal characteristic information of the effective key signal.
[0013] The third aspect of the present application provides an electronic device, comprising: a mechanical key, a memory and a processor, wherein the processor is used to execute a computer program stored in the memory, and when the processor executes the computer program, it implements the steps of the key signal response method provided in the first aspect of the present application.
[0014] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the key signal response method provided in the first aspect of the present application are implemented.
[0015] As can be seen from the above, according to the key signal response method, device, equipment and readable storage medium provided by the scheme of the present application, in the process of continuous sampling of key signals, whether there is a valid key operation event is identified based on the key signal sampled in the first time period; if there is a valid key operation event, the overall key signal corresponding to the valid key operation event is obtained; wherein, the sampling period of the overall key signal is the second time period, the second time period is greater than or equal to the first time period, and is the same as the starting time of the first time period; the corresponding response instruction is generated based on the signal characteristic information in the overall key signal. Through the implementation of the scheme of the present application, it is identified whether there is a valid key operation event in the corresponding time period, and the interference signal generated during the user's operation of the key is filtered out; the corresponding response instruction is generated based on the characteristic information of the valid key signal obtained after filtering. It can effectively avoid the phenomenon of generating erroneous response instructions due to key jitter, and greatly improve the accuracy and anti-interference performance of key instruction recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1A schematic diagram of the basic flow of the key signal response method provided in the first embodiment of the present application;
[0018] Figure 2 A detailed flowchart of the key signal response method provided in the second embodiment of the present application;
[0019] Figure 3 A schematic diagram of a module of a key signal response device provided in the third embodiment of the present application;
[0020] Figure 4 A schematic diagram of the structure of an electronic device provided in the fourth embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0022] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0023] In order to solve the problem of key signal response in the related art, the first embodiment of the present application provides a key signal response method, which is applied to an electronic device, and the electronic device is equipped with a mechanical key. Figure 1 The basic flow chart of the key signal response method provided in this embodiment is as follows. The key signal response method includes the following steps:
[0024] Step 101 : In the process of continuously sampling key signals, identify whether there is a valid key operation event according to the key signals sampled in the first period of time.
[0025] Specifically, the length of the key jitter time is determined by the mechanical characteristics of the key (the duration of the jitter is generally 5ms to 10ms). When the operator performs a key operation event, such as pressing a key, it is generally a few tenths of a second to several seconds. If the key jitters during this process, it will cause one key operation to be misread as multiple times, and then cause the system to generate an erroneous response instruction. Therefore, before determining the response instruction of the key, it is necessary to first use the key signal to identify whether the action generated by the key is a valid key operation event performed by the operator. The key signal in this embodiment can be a pulse signal, and the key signal can be obtained through the IO interface (Input / Output Interface, I / O) of the microcontroller unit (Microcontroller Unit, MCU). The first time period can be set to 100ms.
[0026] In some implementations of the present embodiment, the above-mentioned step of identifying whether there is a valid key operation event based on the key signal sampled in the first time period during the continuous sampling of the key signal includes: when a level jump event of the mechanical key is detected for the first time, triggering continuous acquisition of the key signal; wherein the level jump event is a jump from a first level state to a second level state; extracting all characteristic signal bands in the second level state from the key signal sampled in the first time period; wherein the starting time of the first time period is the time when the level jump event occurs; and identifying whether there is a valid key operation event based on the characteristic signal band.
[0027] Specifically, the first level state and the second level state can be one of a low level state and a high level state, respectively. For example, when a valid key operation event is not triggered (the key is in a natural state), the IO interface detects a high level, and when a valid key operation event is being executed (the key is pressed), the IO interface detects a low level. There are certain differences in the waveform characteristics corresponding to the pulse signal triggered by the manual operation of the key and the jitter of the key itself. Therefore, it is possible to determine whether there is a valid key operation event by judging the relevant characteristic signal band.
[0028] Furthermore, in some implementations of the present embodiment, the above-mentioned step of identifying whether there is a valid key operation event based on the characteristic signal band includes: comparing the duration of all characteristic signal bands with a preset first duration threshold; wherein the first time period is greater than or equal to the first duration threshold; if it is determined based on the comparison result that there is a target characteristic signal band among all the characteristic signal bands, then it is determined that there is a valid key operation event; wherein the duration of the target characteristic signal band is greater than or equal to the preset first duration threshold.
[0029] Specifically, if there is no target characteristic signal band with a duration greater than or equal to the first duration threshold in the characteristic waveform within the first time period, it means that the user has not performed a valid key operation event within the first time period, and in the key signal detected within the first time period, the key signal that is displayed as the second level state is an interference signal caused by jitter or other external interference factors and needs to be filtered out. The first duration threshold can be set to 25ms, 30ms, etc., without limitation. In a specific implementation of the present embodiment, the MCU is set to continuously sample the key signal according to a time reference of once every 10ms. When the pulse signal band collected in three consecutive monitorings is a characteristic signal band with the same stable pulse waveform (a pulse waveform corresponding to the stable second level state), it is determined that there is a valid key operation event, that is, it is determined that the user has performed an operation of pressing a key once.
[0030] Step 102: If there is a valid key operation event, obtain the overall key signal corresponding to the valid key operation event.
[0031] Specifically, the sampling period of the overall key signal is the second time period, the second time period is greater than or equal to the first time period, and is the same as the starting time of the first time period. After determining that there is a valid key operation event, that is, after determining that the user has operated the key, it is necessary to further determine what operations the user has performed on the key during the entire process by obtaining the overall key signal. It should be noted that in this embodiment, the second time period can be set manually (for example: the key operation event corresponding to the power-on instruction of the electronic device is five consecutive presses within 2s, then the second time period can be set to 2s), or it can be determined by the level change state of the key signal during the entire process.
[0032] In some implementations of the present embodiment, before the step of obtaining the overall key signal corresponding to the valid key operation event, it also includes: identifying the key signal after the first time period; determining the cutoff time of the overall key signal corresponding to the valid key operation event based on the key signal after the first time period; wherein, at the cutoff time, the key signal jumps from the second level state to the first level state, and the duration of the first level state after the cutoff time is greater than or equal to the second duration threshold.
[0033] Specifically, in a specific implementation of the present embodiment, the size of the second time period can be determined by the level change state of the key signal during the whole process. The starting time of the second time period is the same as the starting time of the first time period, and the end time of the second time period can be determined according to the situation of the user performing the key operation event. The second duration threshold can be 800ms. When it is detected that the key signal jumps from the second level state to the first level state, and the subsequent duration of the first level state is greater than or equal to the second duration threshold, it means that either the user does not perform a pressing operation later, or the time interval between the pressing operation performed by the user later and the current pressing operation is too long, and it cannot be determined as a valid operation of continuous pressing together with the current pressing operation.
[0034] In some implementations of this embodiment, the overall key signal corresponds to one or more valid key operation events, and one valid key operation event corresponds to a first time period; the signal characteristic information is the signal characteristic information corresponding to the valid key signal in the overall key signal. Before the above step of generating a corresponding response instruction based on the signal characteristic information in the overall key signal, it also includes: identifying the target characteristic signal band corresponding to the valid key operation event in the overall key signal in time sequence; determining the interference signal in the overall key signal according to the target characteristic signal band; filtering the interference signal in the overall key signal to obtain a valid key signal.
[0035] Specifically, during the key signal detection process, jitter may occur at the moment the key is closed and the moment the key is disconnected. The jittering action of the key may cause the corresponding pulse signal. These pulse signals are unstable and will interfere with the recognition of the response command, so de-jittering is required. The length of the key jitter time is related to the mechanical characteristics of the key. The jump time (rising edge and falling edge) of the signal output by the key is about 20ms, and the time it takes for the user to press the key once is about 120ms. The key to key de-jittering is to extract a stable low-level (or high-level) state, filter out the jitter pulses before and after the key is stable, and finally obtain a valid key signal.
[0036] Further, in some implementations of this embodiment, the characteristic waveform is a pulse waveform correspondingly generated when the key signal exhibits a second level state. The above step of determining the interference signal in the overall key signal according to the target characteristic signal band comprises: extracting the target key signal corresponding to the target characteristic signal band that appears for the first time in the first time period; determining the key signals corresponding to all characteristic waveforms in the overall key signal except the target key signal as interference signals.
[0037] Specifically, in a key signal corresponding to a valid key operation event, multiple target characteristic signal bands that meet the determination conditions of a valid key operation event may be identified, that is, it may be identified as the user performing multiple key pressing actions. In actual application, the time required for a user to press a key once is greater than or equal to the first period. Therefore, no matter how many target characteristic signal bands are identified in the first period, it is necessary to output the result of the user pressing a key once. Therefore, the target characteristic signal band that appears for the first time in the first period is used as the corresponding target key signal, and the key signals corresponding to all characteristic waveforms in the overall key signal except the target key signal are determined as interference signals.
[0038] It should be noted that, in this implementation, the deadline for the completion of a single valid key operation event may coincide with the deadline of the first time period, or may occur after the deadline of the first time period. Specifically, the following method may be used to determine whether the key signal at the deadline of the first time period is in the first level state; if so, it is determined that the deadline for the completion of the valid key operation event coincides with the deadline of the corresponding first time period; if not, it is determined that the deadline for the completion of the valid key operation event occurs after the deadline of the first time period, and the deadline for the completion of the valid key operation event is the moment when the key signal is first detected to jump from the second level state to the first level state after the deadline of the first time period.
[0039] It should also be noted that in this embodiment, when there are multiple valid key operation events corresponding to the overall key signal, that is, when the user performs multiple pressing operations, the key signal corresponding to the valid key operation event in the overall key signal can be obtained in the following manner. After determining that the first valid key operation event is completed, (starting from the end time of the completion of the first valid key operation event) continue to identify the subsequently generated key signals in chronological order, and when it is detected that the key signal jumps from the first level state to the second level state, determine this moment as the starting moment of the second first time period; then identify whether there is a valid key operation event based on the key signal sampled in the second first time period; if so, determine the end time of the completion of the valid key operation event in the second first time period; continue to identify the subsequently generated key signals; and so on, until the key signals corresponding to the second time period are traversed.
[0040] Step 103: Generate a corresponding response instruction based on the signal feature information in the overall key signal.
[0041] Specifically, based on the signal characteristic information of the effective key signal in the overall key signal, it is possible to accurately determine what operation the user actually performed on the key (such as: single press, continuous press, long press, short press, etc.), thereby generating a corresponding response instruction; and then the response instruction can be used to achieve precise control of the electronic device.
[0042] Further, in some implementations of this embodiment, the valid key signal includes all target key signals, and the signal characteristic information includes the number of target key signals in the valid key signal. The above-mentioned valid key signal includes all target key signals, and the signal characteristic information includes the number of target key signals in the valid key signal; the step of generating a corresponding response instruction based on the signal characteristic information of the valid key signal includes: matching the number of target key signals with a preset correspondence table; wherein the correspondence table includes the correspondence between different numbers of target key signals and response instructions; generating a response instruction corresponding to the valid key signal according to the matching result. Specifically, in this embodiment,
[0043] Specifically, in the present embodiment, the correspondence between the number of target key signals and the response instructions can be a one-to-one relationship or a many-to-one relationship. For example, when the number of target key signals is one, it corresponds to the first response instruction; when the number of target key signals is two, it corresponds to the second response instruction; when the number of target key signals is three, it corresponds to the third response instruction; when the number of target key signals is four, five, or six, the corresponding response instructions are all fourth response instructions. This is not limited here. In some other implementations, the type of valid key operation event can also be determined based on the duration of the valid key operation event corresponding to the target key signal; wherein the type of valid key operation event includes a long press operation and a short press operation; and then the corresponding response instruction can be determined based on the type of the above-mentioned valid key operation event.
[0044] Based on the technical solution of the above-mentioned embodiment of the present application, in the process of continuous sampling of key signals, whether there is a valid key operation event is identified based on the key signal sampled in the first time period; if there is a valid key operation event, the overall key signal corresponding to the valid key operation event is obtained; wherein, the sampling period of the overall key signal is the second time period, the second time period is greater than or equal to the first time period, and is the same as the starting time of the first time period; a corresponding response instruction is generated based on the signal characteristic information in the overall key signal. Through the above-mentioned implementation of the scheme of the present application, it is identified whether there is a valid key operation event in the corresponding time period, and the interference signal generated during the user's operation of the key is filtered out; the corresponding response instruction is generated based on the characteristic information of the valid key signal obtained after filtering. It can effectively avoid the phenomenon of generating erroneous response instructions due to key jitter, and greatly improve the accuracy and anti-interference performance of key instruction recognition.
[0045] Figure 2 The method in is a refined key signal response method provided in the second embodiment of the present application, and the key signal response method includes:
[0046] Step 201: When a level jump event of a mechanical key is detected for the first time, trigger continuous acquisition of key signals.
[0047] Specifically, the level jump event is a jump from a first level state to a second level state.
[0048] Step 202: extract all characteristic signal bands in the second level state from the key signals sampled in the first period.
[0049] Specifically, the characteristic waveform is a pulse waveform generated correspondingly when the key signal exhibits a second level state.
[0050] Step 203: Determine whether there is a target characteristic signal band in the characteristic signal band whose duration is greater than or equal to the first duration threshold.
[0051] Step 204: Determine that there is a valid key operation event, and obtain the overall key signal corresponding to the valid key operation event.
[0052] Step 205: extract the target characteristic signal band corresponding to the effective key operation event in the overall key signal.
[0053] Step 206: Determine the interference signal in the overall key signal according to the target characteristic signal band.
[0054] Step 207: Filter out the interference signal in the overall key signal to obtain a valid key signal.
[0055] Step 208: Generate a corresponding response instruction based on the signal characteristic information of the effective key signal.
[0056] It should be understood that the size of the serial number of each step in this embodiment does not mean the order of execution of the steps. The execution order of each step should be determined by its function and internal logic, and should not constitute a sole limitation on the implementation process of the embodiment of this application.
[0057] Based on the above technical solution of the embodiment of the present application, combined with the change of the level state in the key signal and the change of the characteristic waveform, the interference signal generated during the user's key operation is accurately identified, and these interference signals are filtered out to obtain effective key signals and generate corresponding response instructions. The anti-interference performance and accuracy of key scanning are greatly improved, and the stability and reliability of key instruction recognition are also improved, which is suitable for various electronic devices equipped with mechanical keys.
[0058] Figure 3 A key signal response device provided in the third embodiment of the present application is applied to an electronic device, and the electronic device is equipped with a mechanical key. The key signal response device can be applied to the above-mentioned key signal response method. Figure 3 As shown, the key signal response device mainly includes:
[0059] The identification module 301 is used to identify whether there is a valid key operation event according to the key signal sampled in the first time period during the process of continuously sampling the key signal.
[0060] The acquisition module 302 is used to acquire the overall key signal corresponding to the effective key operation event if there is a valid key operation event; wherein the sampling period of the overall key signal is the second time period, the second time period is greater than or equal to the first time period, and the second time period is the same as the starting time of the first time period.
[0061] The generating module 303 is used to generate a corresponding response instruction based on the signal characteristic information in the overall key signal.
[0062] In some implementations of this embodiment, the identification module is specifically used to: trigger continuous acquisition of key signals when a level jump event of a mechanical key is detected for the first time; wherein the level jump event is a jump from a first level state to a second level state;
[0063] All characteristic signal bands in the second level state are extracted from the key signal sampled in the first period; wherein the start time of the first period is the time when the level jump event occurs; and whether there is a valid key operation event is identified based on the characteristic signal bands.
[0064] Furthermore, in some implementations of the present embodiment, when the identification module executes the function of identifying whether there is a valid key operation event based on the characteristic signal band, it is also specifically used to: compare the duration of all characteristic signal bands with a preset first duration threshold; wherein the first time period is greater than or equal to the first duration threshold; if it is determined based on the comparison result that there is a target characteristic signal band among all the characteristic signal bands, then it is determined that there is a valid key operation event; wherein the duration of the target characteristic signal band is greater than or equal to the preset first duration threshold.
[0065] In some implementations of the present embodiment, the acquisition module is also used to: identify the key signal after the first time period before acquiring the overall key signal corresponding to the valid key operation event; determine the cutoff time of the overall key signal corresponding to the valid key operation event based on the key signal after the first time period; wherein, at the cutoff time, the key signal jumps from the second level state to the first level state, and the duration of the first level state after the cutoff time is greater than or equal to the second duration threshold.
[0066] In some implementations of the present embodiment, the key signal response device further includes a filtering module. The overall key signal corresponds to one or more valid key operation events, and one valid key operation event corresponds to a first time period; the signal characteristic information is the signal characteristic information corresponding to the valid key signal in the overall key signal;. The filtering module is used to: before filtering the interference signal in the overall key signal to obtain the valid key signal, identify the target characteristic signal band corresponding to the valid key operation event in the overall key signal in chronological order; determine the interference signal in the overall key signal according to the target characteristic signal band; filter the interference signal in the overall key signal to obtain the valid key signal.
[0067] Further, in some implementations of this embodiment, the characteristic waveform is a pulse waveform correspondingly generated when the key signal exhibits a second level state. When the filtering module performs the function of determining the interference signal in the overall key signal according to the target characteristic signal band, it is also specifically used to: extract the target key signal corresponding to the target characteristic signal band that appears for the first time in the first time period; determine the key signals corresponding to all characteristic waveforms in the overall key signal except the target key signal as interference signals.
[0068] In some implementations of this embodiment, the valid key signal includes all target key signals, and the signal characteristic information includes the number of target key signals in the valid key signal. The generation module is specifically used to: match the number of target key signals with a preset correspondence table; wherein the correspondence table includes the correspondence between different numbers of target key signals and response instructions; and generate a response instruction corresponding to the valid key signal according to the matching result.
[0069] It should be noted that the key signal response methods in the aforementioned embodiments can all be implemented based on the key signal response device provided in this embodiment. Ordinary technical personnel in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the key signal response device described in this embodiment can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0070] Based on the technical solution of the above-mentioned embodiment of the present application, in the process of continuously sampling the key signal, whether there is a valid key operation event is identified based on the key signal sampled in the first time period; if there is a valid key operation event, the overall key signal corresponding to the valid key operation event is obtained; wherein, the sampling period of the overall key signal is the second time period, the second time period is greater than or equal to the first time period, and is the same as the starting time of the first time period; based on the signal characteristic information in the overall key signal, a corresponding response instruction is generated. Through the above-mentioned implementation of the scheme of the present application, it is identified whether there is a valid key operation event in the corresponding time period, and the interference signal generated during the user's operation of the key is filtered out; the corresponding response instruction is generated according to the characteristic information of the valid key signal obtained after filtering. It can effectively avoid the phenomenon of generating erroneous response instructions due to key jitter, and greatly improve the accuracy and anti-interference performance of key instruction recognition.
[0071] Figure 4 An electronic device provided in the fourth embodiment of the present application can be used to implement the key signal response method in the above embodiments, mainly including:
[0072] A memory 401, a processor 402, a computer program 403 stored in the memory 401 and executable on the processor 402, and a mechanical key 404. The memory 401 and the processor 402 are connected via communication. When the processor 402 executes the computer program 403, the method in the first or second embodiment described above is implemented. The number of processors may be one or more.
[0073] Specifically, the electronic device in this embodiment may be an electronic atomization device, and the memory 401 may be a high-speed random access memory (RAM) memory, or a non-volatile memory, such as a disk memory. The memory 401 is used to store executable program codes, and the processor 402 is coupled to the memory 401.
[0074] Furthermore, the embodiment of the present application also provides a computer-readable storage medium, which may be disposed in the above-mentioned electronic device. The computer-readable storage medium may be the above-mentioned Figure 4 Memory in the illustrated embodiment.
[0075] The computer readable storage medium stores a computer program, and when the program is executed by the processor, the key signal response method in the aforementioned embodiment is implemented. Furthermore, the computer storable medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk, and other media that can store program codes.
[0076] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules 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, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0077] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0078] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0079] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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, which is stored in a readable storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned readable storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0080] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, 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 action sequence, because according to the present application, certain steps can be performed in other sequences 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.
[0081] 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.
[0082] The above is a description of the key signal response method, device, equipment and readable storage medium provided in the present application. For technicians in this field, according to the ideas of the embodiments of the present application, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A key signal response method, characterized in that: Applied to an electronic device, the electronic device is equipped with a mechanical key, and the key signal response method includes: In the process of continuously sampling the key signal, identifying whether there is a valid key operation event according to the key signal sampled in the first time period; If the valid key operation event exists, then acquiring the overall key signal corresponding to the valid key operation event; wherein the sampling period of the overall key signal is a second time period, the second time period is greater than or equal to the first time period, and is the same as the starting time of the first time period; A corresponding response instruction is generated based on the signal feature information in the overall key signal.
2. The key signal response method according to claim 1, characterized in that: The step of identifying whether there is a valid key operation event according to the key signal sampled in the first time period during the process of continuously sampling the key signal includes: When a level jump event of the mechanical key is detected for the first time, triggering continuous acquisition of key signals; wherein the level jump event is a jump from a first level state to a second level state; Extracting all characteristic signal bands in the second level state from the key signal sampled in the first time period; wherein the start time of the first time period is the time when the level jump event occurs; It is identified whether there is a valid key operation event according to the characteristic signal band.
3. The key signal response method according to claim 2, characterized in that: The step of identifying whether there is a valid key operation event according to the characteristic signal band includes: Compare the duration of all the characteristic signal bands with a preset first duration threshold; wherein the first time period is greater than or equal to the first duration threshold; If it is determined according to the comparison result that there is a target characteristic signal band among all the characteristic signal bands, it is determined that there is a valid key operation event; wherein the duration of the target characteristic signal band is greater than or equal to the preset first duration threshold.
4. The key signal response method according to claim 2, characterized in that: Before the step of obtaining the overall key signal corresponding to the valid key operation event, the method further includes: identifying a key signal after the first period of time; According to the key signal after the first time period, the cutoff time of the overall key signal corresponding to the valid key operation event is determined; wherein, at the cutoff time, the key signal jumps from the second level state to the first level state, and the duration of the first level state after the cutoff time is greater than or equal to the second duration threshold.
5. The key signal response method according to claim 3, characterized in that: The effective key operation event corresponding to the overall key signal is one or more, and one effective key operation event corresponds to one first time period; the signal characteristic information is the signal characteristic information corresponding to the effective key signal in the overall key signal; Before the step of generating a corresponding response instruction based on the signal feature information in the overall key signal, the method further includes: Identify the target characteristic signal band corresponding to the valid key operation event in the overall key signal in time sequence; Determining the interference signal in the overall key signal according to the target characteristic signal band; The interference signal in the overall key signal is filtered out to obtain the effective key signal.
6. The key signal response method according to claim 5, characterized in that: The step of determining the interference signal in the overall key signal according to the target characteristic signal band includes: Extracting the target key signal corresponding to the target characteristic signal band that appears for the first time in the first time period; The key signals corresponding to all the characteristic waveforms in the overall key signal except the target key signal are determined as the interference signals.
7. The key signal response method according to claim 6, characterized in that: The valid key signal includes all the target key signals, and the signal characteristic information includes the number of the target key signals in the valid key signal; The step of generating a corresponding response instruction based on the signal characteristic information of the effective key signal comprises: Matching the number of the target key signals with a preset correspondence table; wherein the correspondence table includes correspondences between different numbers of target key signals and response instructions; A response instruction corresponding to the valid key signal is generated according to the matching result.
8. A key signal response device, characterized in that: Applied to electronic equipment, the electronic equipment is equipped with a mechanical key, and the key signal response device includes: An identification module, used for identifying whether there is a valid key operation event according to the key signal sampled in the first time period during the process of continuously sampling the key signal; an acquisition module, configured to acquire, if the valid key operation event exists, an overall key signal corresponding to the valid key operation event; wherein the sampling period of the overall key signal is a second time period, the second time period is greater than or equal to the first time period, and is the same as the starting time of the first time period; A filtering module, used for filtering interference signals in the overall key signal to obtain a valid key signal; A generating module is used to generate a corresponding response instruction based on the signal characteristic information of the effective key signal.
9. An electronic device, characterized in that: It includes mechanical buttons, memory and processor, wherein: The processor is used to execute the computer program stored in the memory; When the processor executes the computer program, the steps in the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.