Key debounce method and system

By establishing an aging database and determining the target dejitter parameters, the problem of difficult to effectively dejitter aging buttons is solved, and more accurate jitter suppression and delay compensation are achieved, which improves user experience and extends the life of the buttons.

CN119759218APending Publication Date: 2025-04-04INVENTEC APPLIANCES (SHANGHAI) CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411821540.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The prior art is difficult to effectively de-shake the aging button, resulting in problems such as false triggering and response delays, especially in application scenarios such as fast operations and games.

Method used

By establishing a button aging database, the measured aging parameters are obtained, and the target dejitter parameters are determined based on the correlation between these parameters and the database, thereby achieving accurate dejittering of the button.

Benefits of technology

It achieves more accurate and effective jitter suppression and delay compensation, extends the service life of buttons, reduces maintenance costs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759218A_ABST
    Figure CN119759218A_ABST
Patent Text Reader

Abstract

The present invention discloses a key debouncing method and system. The key debouncing method comprises: establishing a key aging database, the aging database comprising a first correlation between an aging parameter and a debouncing parameter; obtaining the measured aging parameter of the key; determining a target debouncing parameter based on the measured aging parameter and the first correlation; and debouncing the key based on the target debouncing parameter. By adopting the above scheme, the problem of the difficulty in effectively debouncing the key after the key is aged is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic technology, and in particular to a key debounce method and system. Background Art

[0002] The switches used in common buttons are usually mechanical elastic switches. At the moment of closing and opening the button switch, due to the elastic effect of the mechanical contacts, the shrapnel contact points will elastically collide, bounce back and forth several times, and a series of jitters will occur. The length of the jitter time is determined by the mechanical and material properties of the button. The jitter of the button is imperceptible to humans, but it is very important for signal analysis, because the control module that processes the button signal processes at a speed of microseconds, while the button jitter time is at least in milliseconds, so the button jitter is easily regarded as multiple key misoperations. The measure to prevent this phenomenon is to eliminate the button jitter.

[0003] Existing anti-shake solutions usually use hardware solutions or software solutions, but hardware solutions are costly and large in size. Software solutions usually use a timer key de-shake method. The principle of the timer key de-shake method is: the key is interrupt-driven. When the key is pressed, the key interrupt is triggered. A timer is started in the key interrupt. The timer timing cycle is a fixed duration, which is the de-shake time. When the timer timing reaches the de-shake time, the timer interrupt will be triggered. Finally, the key value is read in the timer interrupt processing function. If the key value is still in the pressed state, it means that this is a valid key press, thereby achieving de-shake of the key.

[0004] However, as the keys are used for a long time, the aging of the keys will cause the jitter time to increase, and the existing software solutions usually use a fixed de-bouncing time, which cannot automatically adapt to the adjustment of keys with different aging conditions to effectively de-bouncing. Therefore, after the keys are aged, problems such as false triggering and response delays will be seriously aggravated, especially in application scenarios such as fast operations and games, which seriously affects the user experience and efficiency. Summary of the invention

[0005] The present invention provides a key debouncing method and system to solve the problem that it is difficult to effectively debouncing keys after keys have aged.

[0006] According to one aspect of the present invention, a key debounce method is provided, the key debounce method comprising:

[0007] Establishing an aging database of the key, the aging database including a first correlation between an aging parameter and a debounce parameter;

[0008] Obtaining measured aging parameters of the button;

[0009] Determine a target debouncing parameter based on the measured aging parameter and the first correlation;

[0010] The button is debounced based on the target debounce parameter.

[0011] In an optional embodiment of the present invention, the aging parameter includes a first aging parameter and a second aging parameter, and the aging database includes a first correlation between the second aging parameter and a debouncing parameter and a second correlation between the first aging parameter and the second aging parameter;

[0012] The step of obtaining the measured aging parameter of the button includes:

[0013] Obtaining a first aging parameter actually measured for the button;

[0014] Obtaining a measured second aging parameter of the button;

[0015] Accordingly, determining a target de-jitter parameter based on the measured aging parameter and the first correlation includes:

[0016] determining an expected second aging parameter based on the measured first aging parameter and the second correlation;

[0017] A target de-bouncing parameter is determined based on the expected second aging parameter, the measured second aging parameter, and the first correlation.

[0018] In an optional embodiment of the present invention, determining a target de-jitter parameter based on the expected second aging parameter, the measured second aging parameter, and the first correlation includes:

[0019] When a difference between the measured second aging parameter and the corresponding expected second aging parameter is greater than a preset difference threshold, determining a target debouncing parameter based on the measured second aging parameter and the first correlation;

[0020] When the difference between the measured second aging parameter and the corresponding expected second aging parameter is less than or equal to a preset difference threshold, a target de-bouncing parameter is determined based on the expected second aging parameter corresponding to the measured second aging parameter and the first correlation.

[0021] In an optional embodiment of the present invention, the number of the measured second aging parameters is multiple, and determining the target de-jitter parameter based on the measured second aging parameters and the first correlation includes:

[0022] Determine a plurality of debouncing parameters based on the plurality of measured second aging parameters and the first correlation;

[0023] The maximum value among the multiple de-jitter parameters is determined as the target de-jitter parameter.

[0024] In an optional embodiment of the present invention, the first aging parameter includes the number of button triggering times, and the second aging parameter includes one or more of response time, button conduction pressure, and contact resistance.

[0025] In an optional embodiment of the present invention, the aging database includes a third correlation between a key parameter and the first correlation, and after establishing the key aging database, the method further includes:

[0026] Get the current button parameters;

[0027] The first correlation is determined based on the current key parameter and the third correlation.

[0028] In an optional embodiment of the present invention, the key parameters include one or more of key type, key material, key axial force curve, and key design parameters.

[0029] In an optional embodiment of the present invention, it also includes:

[0030] When the difference between the actually measured second aging parameter and the corresponding expected second aging parameter is greater than a preset difference threshold, an aging warning message is issued.

[0031] According to another aspect of the present invention, a key debouncing system is provided, the key debouncing system comprising a control module and a detection module;

[0032] The detection module is used to detect the aging parameters of the keys to obtain the measured aging parameters;

[0033] The control module is electrically connected to the detection module, and the control module is used to execute the key debouncing method described in any embodiment of the present invention.

[0034] In an optional embodiment of the present invention, the detection module includes a counter and a resistance detection circuit, and the counter is used to detect the number of times the key is triggered;

[0035] The resistance detection circuit is used to detect the contact resistance of the key.

[0036] The technical solution of the embodiment of the present invention is to establish an aging database of keys, wherein the aging database includes a first correlation between aging parameters and de-jitter parameters, then obtain the measured aging parameters of the keys, and finally determine the target de-jitter parameters based on the measured aging parameters and the first correlation. The aging process of keys can be predicted and inferred, and the target de-jitter parameters can be adjusted according to the current aging condition of the keys, thereby achieving more accurate and effective jitter suppression and delay compensation, maximizing the life of the product, achieving optimal performance and improving the overall satisfaction of the user. The problem of the difficulty in effectively de-jittering keys after they have aged is solved.

[0037] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 A flowchart of a key debounce method provided in Embodiment 1 of the present invention;

[0040] Figure 2 A flowchart of a key debounce method provided in Embodiment 2 of the present invention;

[0041] Figure 3 A flowchart of a key debounce method provided in Embodiment 3 of the present invention;

[0042] Figure 4 This is a circuit block diagram of a key debouncing system provided by Embodiment 4 of the present invention;

[0043] Figure 5 is a circuit block diagram of another key debouncing system provided by Embodiment 4 of the present invention;

[0044] Figure 6 This is a circuit schematic diagram of a key debouncing system provided in Embodiment 4 of the present invention.

[0045] Among them: 1. detection module; 11. counter; 12. resistance detection circuit; 121. amplifier; 122. analog integrator; 123. analog-to-digital converter; 124. voltage follower; 125. first resistor; 126. second resistor; 127. capacitor; 2. control module; 3. button; 4. power supply. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0048] Embodiment 1

[0049] Figure 1 This is a flowchart of a key debounce method provided in Embodiment 1 of the present invention. This embodiment can be applied to debounce keys included in any of mobile devices, game controllers, industrial control systems, and medical devices. The mobile devices include one or more of smart phones, laptops, tablet computers, and smart wearable devices. The key debounce method can be executed by a control module in the key debounce system. Figure 1 As shown, the key debounce method includes:

[0050] S110: Establishing an aging database of a key, wherein the aging database includes a first correlation between an aging parameter and a debouncing parameter.

[0051] The aging database of the keys can be established by collecting aging data of the keys under different usage conditions. In some embodiments, the aging data can be directly obtained from data provided by the manufacturer; in some embodiments, the aging data is obtained through testing. In some embodiments, part of the aging data is directly obtained from data provided by the manufacturer, and part of the aging data is obtained through testing.

[0052] Aging parameters refer to parameters related to key aging. In some embodiments, aging parameters include one or more of key trigger times, response time, key conduction pressure, and contact resistance. Key trigger times refer to the number of times a key can successfully trigger signal transmission after being subjected to pressure or operation. Response time refers to the time from when a key is pressed to when the system receives a signal and responds. Key conduction pressure refers to the pressure that needs to be applied after pressing a key to close the circuit and trigger key signal transmission. The key conduction pressure usually determines the touch and trigger sensitivity of the key. When current passes through the mechanical contact surface of two conductors, the resistance of the interface part will be higher than the resistance of other parts. This resistance is called contact resistance. In a key, when the key is pressed, the contact inside the key will contact the corresponding position on the circuit board to form a conductive path. However, due to the presence of tiny gaps, oxides, dust or other contaminants on the contact surface, as well as factors such as the unevenness of the contact surface, the current will be hindered to a certain extent when passing through the contact surface, thereby generating contact resistance.

[0053] The debounce parameter refers to a parameter for debounce a key, and in some embodiments, the debounce parameter includes a debounce time. It is understandable that in other embodiments, the debounce parameter may also include a debounce compensation time, and the debounce compensation time refers to the time for compensating the debounce time.

[0054] For buttons, when the aging degree of the buttons is different, the values ​​of the aging parameters reflecting the aging degree will be different, and the required de-bouncing parameters will also be different. For example, when the button ages, the contact resistance increases, which will cause the button bounce time to be extended, so the de-bouncing time needs to be extended to better de-bouncing the button. Therefore, there is a certain correlation between the aging parameters of the buttons and the de-bouncing parameters. The first correlation between the aging parameters and the de-bouncing parameters can be obtained by testing the buttons. The first correlation is used to reflect the correlation between the aging parameters and the de-bouncing parameters. In some embodiments, the first correlation can be presented in a table, and the table intuitively reflects the correlation between the aging parameters and the de-bouncing parameters. In other embodiments, the first correlation can also be presented in other ways, such as by a curve. The specific presentation method of the first correlation is not specifically limited here, but is just an example.

[0055] S120: Obtaining the actually measured aging parameters of the button.

[0056] The measured aging parameters refer to the aging parameters of the keys detected when the keys are actually used.

[0057] S130. Determine a target debouncing parameter based on the measured aging parameter and the first correlation.

[0058] The target debounce parameter refers to a specific parameter value set to eliminate the influence of jitter when dealing with the key jitter problem. Since the first correlation is used to reflect the correlation between the aging parameter and the debounce parameter, after obtaining the measured aging parameter, the value of the debounce parameter under the current aging program of the key can be obtained according to the measured aging parameter and the first correlation, that is, the target debounce parameter.

[0059] S140: Debounce the button based on the target debounce parameter.

[0060] Among them, in this embodiment, the target de-bouncing parameter is the target de-bouncing duration. When the button is pressed, the button interrupt is triggered. A timer is started in the button interrupt. The timer timing period is the target de-bouncing duration. When the timer timing reaches the target de-bouncing duration, the timer interrupt is triggered. Finally, the value of the button is read in the timer interrupt processing function. If the value of the button is still in the pressed state, it means that this is a valid button press, thereby achieving de-bouncing of the button.

[0061] The above scheme establishes an aging database of keys, wherein the aging database includes a first correlation between aging parameters and de-jitter parameters, then obtains the measured aging parameters of the keys, and finally determines the target de-jitter parameters based on the measured aging parameters and the first correlation. It is possible to predict and infer the key aging process, adjust the target de-jitter parameters according to the current aging status of the keys, and then de-jitter the keys according to the target de-jitter parameters, thereby achieving more accurate and effective jitter suppression and delay compensation, maximizing the life of the product, achieving optimal performance and improving the overall user satisfaction. It solves the problem of difficulty in effectively de-jittering keys after they have aged.

[0062] Embodiment 2

[0063] Figure 2 A flowchart of a key debouncing method provided in Embodiment 2 of the present invention, this embodiment is used to improve Embodiment 1, optionally, the aging parameters include a first aging parameter and a second aging parameter, the aging database includes a first correlation between the second aging parameter and the debouncing parameter and a second correlation between the first aging parameter and the second aging parameter; the obtaining of the measured aging parameters of the key includes: obtaining the measured first aging parameter of the key; obtaining the measured second aging parameter of the key; correspondingly, determining the target debouncing parameter based on the measured aging parameters and the first correlation includes: determining the expected second aging parameter based on the measured first aging parameter and the second correlation; determining the target debouncing parameter based on the expected second aging parameter, the measured second aging parameter and the first correlation. Based on this, Figure 2 As shown, the key debounce method includes:

[0064] S210: Establish an aging database of the key, wherein the aging database includes a first correlation between the second aging parameter and the debouncing parameter and a second correlation between the first aging parameter and the second aging parameter.

[0065] Among them, the second correlation refers to a relationship that reflects the correlation between the first aging parameter and the second aging parameter. In some embodiments, the first aging parameter includes the number of button trigger times, and the second aging parameter includes one or more of response time, button conduction pressure, and contact resistance. For the same button, when the number of button trigger times is different, the response time, button conduction pressure, and contact resistance will also be different. There is a certain connection between the number of button trigger times and the response time, button conduction pressure, and contact resistance, so an aging database for the button can be established in advance to obtain the second correlation between the first aging parameter and the second aging parameter. When the response time, button conduction pressure, and contact resistance of the button are different, the required debouncing parameters are also different, so an aging database for the button can be established in advance to obtain the first correlation between the second aging parameter and the debouncing parameter.

[0066] S220: Obtain a first aging parameter actually measured for the button.

[0067] The measured first aging parameter refers to the first aging parameter of the key detected when the key is actually used. In some embodiments, the first aging parameter includes the number of key trigger times, which can be detected by a counter to obtain the measured number of key trigger times.

[0068] S230: Obtain a second aging parameter actually measured for the button.

[0069] The measured second aging parameter refers to the second aging parameter of the key detected when the key is actually used. In some embodiments, the second aging parameter includes a contact resistance, which can be detected by a resistance detection circuit to obtain the measured contact resistance.

[0070] S240: Determine an expected second aging parameter based on the actually measured first aging parameter and the second correlation.

[0071] Among them, the expected second aging parameter refers to the second aging parameter corresponding to the measured first aging parameter in the second correlation when the first aging parameter of the current key is the measured first aging parameter, that is, the value that the second aging parameter should be when the key is normally aged. In some embodiments, the number of the second aging parameters is multiple, so the expected second aging parameters determined at this time are also multiple. For example, the first aging parameter includes the number of key triggers, and the second aging parameter includes one or more of response time, key conduction pressure, and contact resistance. After obtaining the measured number of key triggers, the response time, key conduction pressure, and contact resistance corresponding to the measured number of key triggers in the second correlation can be obtained. The obtained response time, key conduction pressure, and contact resistance are the expected response time, expected key conduction pressure, and expected contact resistance, respectively.

[0072] S250. Determine a target de-bouncing parameter based on the expected second aging parameter, the measured second aging parameter, and the first correlation.

[0073] Among them, the expected second aging parameter refers to the value that the second aging parameter should be when the key is aged normally, and the measured second aging parameter refers to the measured value of the second aging parameter. The deviation between the two can reflect the health status of the key. At the same time, both are related to the de-bouncing parameter, so the target de-bouncing parameter can be determined based on the expected second aging parameter, the measured second aging parameter and the first correlation, so that the obtained target de-bouncing parameter is more in line with the actual aging condition of the key, effectively suppressing key jitter, and by continuously adjusting the target de-bouncing parameter according to the actual condition of the key, the accuracy of the key jitter suppression and delay compensation is improved, the service life of the key is effectively extended, and the maintenance cost is reduced.

[0074] S260: Debounce the button based on the target debounce parameter.

[0075] In an optional embodiment of the present invention, determining a target de-jitter parameter based on the expected second aging parameter, the measured second aging parameter, and the first correlation includes:

[0076] When the difference between the measured second aging parameter and the corresponding expected second aging parameter is greater than the preset difference threshold, the target de-bouncing parameter is determined based on the measured second aging parameter and the first correlation, indicating that the deviation between the measured second aging parameter and the expected second aging parameter is large and the key is abnormal, so the target de-bouncing parameter is determined based on the measured second aging parameter and the first correlation, so that the obtained target de-bouncing parameter is more consistent with the actual aging condition of the key.

[0077] When the difference between the measured second aging parameter and the corresponding expected second aging parameter is less than or equal to the preset difference threshold, the target de-bouncing parameter is determined based on the expected second aging parameter corresponding to the measured second aging parameter and the first correlation. This indicates that the deviation between the measured second aging parameter and the expected second aging parameter is small, and the button is aged normally. At this time, the de-bouncing parameter corresponding to the expected second aging parameter in the first correlation is directly determined as the target de-bouncing parameter.

[0078] On the basis of the above embodiment, the number of the measured second aging parameters is multiple, and the target debouncing parameter is determined based on the measured second aging parameters and the first correlation, including: determining multiple debouncing parameters based on the multiple measured second aging parameters and the first correlation; determining the maximum value of the multiple debouncing parameters as the target debouncing parameter. Wherein, when the number of the measured second aging parameters is multiple, the debouncing parameters corresponding to different measured second aging parameters are different. At this time, the maximum value of the multiple debouncing parameters is determined as the target debouncing parameter, which can make the target debouncing parameter larger, effectively suppress the key jitter, improve the accuracy of the key jitter suppression and delay compensation, effectively extend the service life of the key, and reduce the maintenance cost. For example, when the measured second aging parameters include the measured response time, the measured key conduction pressure, the measured contact resistance, etc., the measured response time, the measured key conduction pressure, and the measured contact resistance have different corresponding debouncing parameters in the first correlation, and the maximum value of the multiple debouncing parameters corresponding to the measured response time, the measured key conduction pressure, and the measured contact resistance is determined as the target debouncing parameter.

[0079] In an optional embodiment of the present invention, the key debouncing method further includes: when the difference between the actually measured second aging parameter and the corresponding expected second aging parameter is greater than a preset difference threshold, issuing aging warning information.

[0080] The aging warning information refers to information used to warn users that the degree of aging of keys is too high. The aging warning information can be sent through hardware or software, and the aging warning information can also be in different forms, including but not limited to text, voice, light, etc., which are not specifically limited here. After receiving the aging warning information, the user can know the aging of the keys, so as to replace the keys in time to ensure the reliability of the device and the user's experience.

[0081] The following is a specific implementation example to illustrate the specific implementation of this scheme. First, by collecting key data, an aging database of keys is established. Then, during the use of the keys, the number of key triggers is detected to obtain the measured number of key triggers, and the contact resistance of the keys is detected to obtain the measured contact resistance. According to the measured number of key triggers and the second correlation, the expected contact resistance can be obtained. Then, the measured contact resistance and the expected contact resistance are compared. When the difference between the measured contact resistance and the expected contact resistance is less than or equal to the preset difference threshold, the debouncing parameter corresponding to the expected contact resistance in the first correlation is determined as the target debouncing parameter. When the difference between the measured contact resistance and the expected contact resistance is greater than the expected difference threshold, the debouncing parameter corresponding to the measured contact resistance in the first correlation is determined as the target debouncing parameter. In this way, the target debouncing parameter can be automatically adjusted according to the actual aging of the keys to suppress key jitter. Through continuous calculation and parameter adjustment, the accuracy of jitter suppression and delay compensation can be improved, the service life of the keys can be effectively extended, and the maintenance cost can be reduced.

[0082] Embodiment 3

[0083] Figure 3 A flowchart of a key debounce method provided in Embodiment 3 of the present invention, this embodiment is used to improve Embodiment 2, optionally, the aging database includes key parameters and a third correlation of the first correlation, after establishing the key aging database, further includes: obtaining current key parameters; determining the first correlation based on the current key parameters and the third correlation. Based on this, Figure 3 As shown, the key debounce method includes:

[0084] S310: Establish an aging database for a key, wherein the aging database includes a first correlation between the second aging parameter and a debouncing parameter, a second correlation between the first aging parameter and the second aging parameter, and a third correlation between a key parameter and the first correlation.

[0085] Among them, key parameters refer to various characteristics and settings related to keys. In some embodiments, the key parameters include one or more of key type, key material, key axial force curve graph, and key design parameters. Key type refers to the classification of keys according to their functions, shapes, uses, etc. Key material refers to the material used to make keys. Different materials have different physical and chemical properties, which will affect the feel, durability, appearance, etc. of the keys. The key axial force curve graph is a graph used to describe the change in pressure required for a key at different travel distances. Key design parameters refer to various parameters that need to be considered when designing keys, which affect the function, performance, appearance, etc. of the keys. For keys with different key parameters, the required debounce parameters may be different when the aging parameters are the same.

[0086] The third correlation is a relationship that reflects the correlation between the key parameters and the first correlation. Since the specific correlation between the second aging parameter and the debounce parameter may be different for different keys, that is, the first correlation may be different, the third correlation between the key parameters and the first correlation may be obtained by establishing a key aging database in advance.

[0087] S320, obtaining current key parameters.

[0088] The current key parameters refer to the key parameters of the key that currently needs to be debounced.

[0089] S330: Determine the first correlation based on the current key parameter and the third correlation.

[0090] Among them, since the third correlation is a relationship reflecting the correlation between the key parameter and the first correlation, after the current key parameter is obtained, the first correlation corresponding to the current key parameter in the third correlation is the first correlation of the key. In some embodiments, the third correlation is specifically a relationship reflecting the correlation between the key parameter, the first correlation and the second correlation, so that after the current key parameter is obtained, the first correlation and the second correlation can be obtained according to the current key parameter.

[0091] S340: Obtain a first aging parameter actually measured for the button.

[0092] S350: Obtain a second aging parameter actually measured for the button.

[0093] S360: Determine an expected second aging parameter based on the actually measured first aging parameter and the second correlation.

[0094] S370. Determine a target de-bouncing parameter based on the expected second aging parameter, the measured second aging parameter, and the first correlation.

[0095] S380. Debounce the button based on the target debounce parameter.

[0096] Through the above scheme, the complex characteristics of the aging process of different keys can be learned. For different types of keys, the first correlation of the current key can be obtained through the current key parameters and the key aging database established in advance. Later, the de-bouncing parameters of the key under different aging conditions can be obtained according to the first correlation. Therefore, it can be applicable to different types of keys and has high versatility.

[0097] Embodiment 4

[0098] Figure 4This is a structural diagram of a key debounce system provided by Embodiment 4 of the present invention. Figure 4 As shown, the key debouncing system includes a control module 2 and a detection module 1.

[0099] The detection module 1 is used to detect the aging parameters of the button 3 to obtain the measured aging parameters.

[0100] The control module 2 is electrically connected to the detection module 1 , and the control module 2 is used to execute the key 3 debouncing method of any embodiment of the present invention.

[0101] Among them, the detection module 1 refers to a module that can detect parameters related to aging during the use of the button 3. The aging parameters include one or more of the number of times the button 3 is triggered, the response time, the conduction pressure of the button 3, and the contact resistance. The control module 2 refers to a functional module for performing logic control. In some embodiments, the control module 2 includes one of MCU, FPGA, and DSP. In this embodiment, the control module 2 is specifically an MCU. It can be understood that in other embodiments, the control module 2 can also be other components, which is not specifically limited here, but is just an example.

[0102] The key debouncing system provided in the embodiment of the present invention has the beneficial effects of the key 3 debouncing method provided in any of the above embodiments, which will not be described in detail here.

[0103] In an optional embodiment of the present invention, Figure 5 As shown, the detection module 1 includes a counter 11, which is used to detect the number of times the button 3 is triggered, and then obtain the measured number of triggers, which is the number of times the button 3 is actually triggered. In some embodiments, the counter 11 is independently set. In this embodiment, the counter 11 is integrated inside the control module 2.

[0104] In an optional embodiment of the present invention, Figure 5 and Figure 6 As shown, the detection module 1 also includes a resistance detection circuit 12, which is used to detect the contact resistance of the key 3, and then obtain the measured contact resistance, which is the actual current contact resistance of the key 3. It can be understood that in other embodiments, the detection module 1 can also include other structures to detect aging parameters such as response time and conduction pressure of the key 3, which is not specifically limited here, but is only an example.

[0105] Based on the above embodiments, Figure 5 and Figure 6As shown, the resistance detection circuit 12 includes an amplifier 121, an analog integrator 122, an analog-to-digital converter 123, a voltage follower 124, a first resistor 125, a second resistor 126 and a capacitor 127. The first input end of the amplifier 121 is electrically connected to the first end of the key 3, the second input end of the amplifier 121 is electrically connected to the second end of the key 3, the output end of the amplifier 121 is electrically connected to the input end of the analog integrator 122, the output end of the analog integrator 122 is electrically connected to the first input end of the analog-to-digital converter 123, the input end of the voltage follower 124 is electrically connected to the second end of the key 3, the output end of the voltage follower 124 is electrically connected to the second input end of the analog-to-digital converter 123, and the output end of the analog-to-digital converter 123 is electrically connected to the input end of the control module 2. The first connection port of the control module 2 is electrically connected to the analog integrator 122, and the second connection port of the control module 2 is electrically connected to the first end of the key 3. The first end of the key 3 is electrically connected to the power supply 4 through the first resistor 125, and the second end of the key 3 is electrically connected to the ground through the second resistor 126. The first input terminal of the amplifier 121 is electrically connected to the ground through the capacitor 127. The power supply 4 terminal of the control module 2 is connected to the power supply 4. In some embodiments, the power supply 4 is specifically a constant current source.

[0106] Among them, since the contact resistance of the button 3 is very small, the contact resistance signal generated is small, and the amplifier 121 is used to amplify the contact resistance signal to amplify it to the required amplitude value. In some embodiments, the contact resistance signal generated by pressing the button 3 is a voltage signal, and the amplifier 121 is specifically a high-voltage low-rate voltage amplifier 121. The analog integrator 122 is used to integrate the change in contact resistance, so as to obtain a cumulative signal related to the change in contact resistance, and this cumulative signal can be used for further signal processing or detection. The analog-to-digital converter 123 is used to convert the analog signal generated by the change in contact resistance into a digital signal, which is convenient for the control module 2 to process.

[0107] The voltage follower 124 can accurately output the input contact resistance signal without amplifying or attenuating the signal. In the resistance detection circuit 12, the voltage follower 124 can also be used to isolate and buffer the input contact resistance signal to prevent the subsequent circuit from interfering with the input contact resistance signal while maintaining the integrity of the signal. The cooperation of the first resistor 125, the second resistor 126 and the voltage follower 124 can provide a reference voltage so that the contact resistance of the key 3 can be obtained according to the contact resistance signal which is a voltage signal.

[0108] The first input terminal of the amplifier 121 is electrically connected to the ground through the capacitor 127, so that high-frequency noise and interference in the input signal entering the amplifier 121 can be filtered out, thereby ensuring that the amplifier 121 can receive a clear and stable signal.

[0109] The above scheme can accurately detect the actual contact resistance of the key 3, that is, the measured contact resistance, through the amplifier 121, the analog integrator 122, the analog-to-digital converter 123, the voltage follower 124, the first resistor 125, the second resistor 126 and the capacitor 127.

[0110] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0111] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A key debounce method, characterized in that: include: Establishing an aging database of the key, the aging database including a first correlation between an aging parameter and a debounce parameter; Obtaining measured aging parameters of the button; Determine a target debouncing parameter based on the measured aging parameter and the first correlation; The button is debounced based on the target debounce parameter.

2. The key debounce method according to claim 1, characterized in that: The aging parameters include a first aging parameter and a second aging parameter, and the aging database includes a first correlation between the second aging parameter and a debounce parameter and a second correlation between the first aging parameter and the second aging parameter; The step of obtaining the measured aging parameter of the button includes: Obtaining a first aging parameter actually measured for the button; Obtaining a measured second aging parameter of the button; Accordingly, determining a target de-jitter parameter based on the measured aging parameter and the first correlation includes: determining an expected second aging parameter based on the measured first aging parameter and the second correlation; A target de-bouncing parameter is determined based on the expected second aging parameter, the measured second aging parameter, and the first correlation.

3. The key debounce method according to claim 2, characterized in that: The determining a target de-jittering parameter based on the expected second aging parameter, the measured second aging parameter, and the first correlation includes: When a difference between the measured second aging parameter and the corresponding expected second aging parameter is greater than a preset difference threshold, determining a target debouncing parameter based on the measured second aging parameter and the first correlation; When the difference between the measured second aging parameter and the corresponding expected second aging parameter is less than or equal to a preset difference threshold, a target de-bouncing parameter is determined based on the expected second aging parameter corresponding to the measured second aging parameter and the first correlation.

4. The key debounce method according to claim 3, characterized in that: The number of the measured second aging parameters is multiple, and determining the target de-jitter parameter based on the measured second aging parameters and the first correlation includes: Determine a plurality of debouncing parameters based on the plurality of measured second aging parameters and the first correlation; The maximum value among the multiple de-jitter parameters is determined as the target de-jitter parameter.

5. The key debounce method according to any one of claims 2 to 4, characterized in that: The first aging parameter includes the number of button trigger times, and the second aging parameter includes one or more of response time, button conduction pressure, and contact resistance.

6. The key debounce method according to any one of claims 1 to 4, characterized in that: The aging database includes the key parameter and the third correlation of the first correlation. After the key aging database is established, the following further includes: Get the current button parameters; The first correlation is determined based on the current key parameter and the third correlation.

7. The key debounce method according to claim 6, characterized in that: The key parameters include one or more of key type, key material, key axial force curve, and key design parameters.

8. The key debounce method according to claim 3 or 4, characterized in that: Also includes: When the difference between the actually measured second aging parameter and the corresponding expected second aging parameter is greater than a preset difference threshold, an aging warning message is issued.

9. A key debounce system, characterized in that: It includes a control module and a detection module; The detection module is used to detect the aging parameters of the keys to obtain the measured aging parameters; The control module is electrically connected to the detection module, and the control module is used to execute the key debouncing method according to any one of claims 1 to 8.

10. The key debouncing system according to claim 9, characterized in that: The detection module includes a counter and a resistance detection circuit, and the counter is used to detect the number of times the button is triggered; The resistance detection circuit is used to detect the contact resistance of the key.

Citation Information

Cited By

  • Load adjusting method, device and equipment for automobile keys and storage medium

    CN120611450A

  • Method, device and equipment for load adjustment of car key, and storage medium

    CN120611450B

  • Keyboard input data correction method and system

    CN121433525A

  • A method and system for correcting keyboard input data

    CN121433525B