Intelligent keyboard input signal error detection and correction method and system

CN122593636APending Publication Date: 2026-08-18SHENZHEN JUPENG ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611020045.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]传统的智能键盘输入信号错误检测与校正方法,虽然能够对键盘设备在指令输入过程中产生的电信号进行动态监测,并对偏离常规特征的错位信号进行修正,但是,在机械键盘的按键矩阵扫描过程中,按键开关闭合或断开容易产生连续电平跳变,当轻击按压、机械抖动和短间隔伪触发信号同时出现在同一次有效按压操作事件内时,存在将抖动信号误判为按下输入或释放输入的问题;同时,在不同按键的历史绝对抖动持续时间存在差异的情况下,固定的判定时机难以适配按键自身的抖动变化,容易造成稳定按下状态、疑似按下抖动状态和轻击按压状态之间的判定偏差

Benefits of technology

本发明中,通过在按键矩阵扫描过程中获取首次跳变时间、跳变计数和历史平均抖动时长,并利用跳变补偿时长形成稳定判定时长,使按键按压触发状态能够结合当前电平变化和历史抖动特征进行判定;进一步通过轻击判定时长阈值识别轻击按压状态,通过中间抖动区间内的跳变前电平值、跳变后电平值和相邻跳变时间间隔识别伪按下触发信号和伪释放触发信号,并结合绝对抖动持续时间与选定学习率因子更新历史平均抖动时长,从而调整后续按键矩阵扫描判定时机;在后续判定时机内,再根据电平采样值与按下电平值或释放电平值的对应关系拦截伪事件触发错误并保留对应确认标记,起到了提高按键输入错误检测准确性和按键输入校正可靠性的作用。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593636A_ABST
    Figure CN122593636A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of signal detection, in particular to a kind of intelligent keyboard input signal error detection and correction method and system.In the present application, by obtaining first jump time, jump count and history average jitter duration, and using jump compensation duration to form stable determination duration, the press trigger state is determined;Light strike determination duration threshold is used to identify light press state, and according to the jump front level value, jump rear level value and adjacent jump time interval in the middle jitter interval, pseudo-press trigger signal and pseudo-release trigger signal are identified;Then, the absolute jitter duration and the selected learning rate factor are combined to update the history average jitter duration, adjust the subsequent key matrix scanning determination timing, and intercept pseudo-event trigger error, which improves the accuracy of key input error detection and the reliability of key input correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of signal detection technology, and in particular to a method and system for detecting and correcting errors in intelligent keyboard input signals. Background Technology

[0002] The intelligent keyboard input signal error detection and correction method refers to the data processing process of dynamically monitoring and judging abnormalities of electrical signals generated by the keyboard device during the instruction input process, and correcting misaligned signals that deviate from the normal characteristics.

[0003] Traditional methods for detecting and correcting input signal errors in smart keyboards, while capable of dynamically monitoring the electrical signals generated during input and correcting misaligned signals that deviate from normal characteristics, have several drawbacks. During the key matrix scanning process of a mechanical keyboard, the closing or opening of key switches can easily generate continuous level jumps. When a light press, mechanical bounce, and short-interval false trigger signals occur simultaneously within the same valid press event, the bounce signal may be misjudged as a pressed or released input. Furthermore, given the differences in the historical absolute bounce duration of different keys, a fixed judgment timing is difficult to adapt to the key's own bounce variations, easily leading to discrepancies between the judgment of a stable pressed state, a suspected pressed bounce state, and a light press state. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose a method and system for detecting and correcting errors in intelligent keyboard input signals.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting and correcting errors in intelligent keyboard input signals, comprising the following steps: During the key matrix scanning process of a mechanical keyboard, the initial state parameter set of the keys is obtained; Referring to the initial state parameter set, determine the multiple press trigger states of the button and integrate them into a press trigger state set; By referring to the set of press trigger states, the valid press operation events of the keys are determined, and the pseudo-event trigger errors of the valid press operation events are identified as the results of key input error detection. Based on the initial state parameter set, analyze multiple dynamic learning parameters of the mechanical key and integrate them into a dynamic learning parameter set; Based on the dynamic learning parameter set, the timing of subsequent key matrix scanning is adjusted, and the key input error detection results are corrected to obtain the key input correction results.

[0006] As a further aspect of the present invention, the acquisition of the initial state parameter set of the keys during the key matrix scanning process of the mechanical keyboard includes: During the key matrix scanning process of the mechanical keyboard, the continuous level state information of the keys is collected, the level transition of the keys is detected based on the continuous level state information, and the first transition time and transition count of the key level transition are obtained. Obtain the historical operation set of the key, extract all historical absolute bounce durations recorded in the historical operation set, calculate the average of all historical absolute bounce durations, and use this average as the historical average bounce duration of the key. By integrating the first transition time, the transition count, and the historical average jitter duration, a set of initial state parameters for the key is obtained.

[0007] As a further aspect of the present invention, the step of determining multiple press trigger states of a button by referring to the initial state parameter set and integrating them into a press trigger state set includes: The jump compensation duration is obtained by multiplying the jump count in the initial state parameter set with the preset jump penalty time coefficient. At the same time, the sum of the historical average jitter duration and the jump compensation duration is calculated as the stability determination duration. Obtain the current key matrix scan time, calculate the first time difference between the current key matrix scan time and the first transition time in the initial state parameter set, and use the first time difference as the state duration within the continuous level state information; When the duration of the state reaches or exceeds the stability determination duration, it is determined to be a stable pressed state of the button. When the duration of the state does not reach the stability determination duration, it is determined to be a suspected pressed jitter state of the button. Multiple press trigger states, including stable pressed state and suspected pressed jitter state, are integrated to obtain a press trigger state set.

[0008] As a further aspect of the present invention, the reference to the set of press trigger states determines the valid press operation event of the key, identifies the pseudo-event trigger error of the valid press operation event, and the key input error detection result includes: The current level is continuously maintained for a certain duration in the set of press trigger states corresponding to suspected press jitter states. When the current level continuously maintained for a certain duration reaches or exceeds a preset light tap judgment duration threshold, it is identified as a light tap press state of the button. When the current level continuously maintained for a certain duration does not reach the preset light tap judgment duration threshold, the judgment result of suspected press jitter state of the button is maintained. The light tap judgment duration threshold is less than the stable judgment duration and greater than the time interval between the current button matrix scan time and the previous button matrix scan time or the preset instantaneous jitter filtering duration. The stable pressed state and the light press state in the set of press trigger states are taken as valid press operation events of the button. The continuous level state information corresponding to the valid press operation event is obtained. The first transition time and the last transition time are extracted from the continuous level state information. The first transition time is taken as the start time and the last transition time is taken as the end time. The intermediate jitter interval of the valid press operation event is defined according to the start time and the end time. All transition signals within the intermediate jitter interval are acquired, along with the level value before the transition, the level value after the transition, and the time interval between adjacent transitions for each transition signal. Simultaneously, the pressed level value and the released level value are read from a preset key scanning configuration. When the level value before the transition is the same as the released level value and the level value after the transition is the same as the pressed level value, the corresponding transition signal is recorded as a pressed candidate signal. When the level value before the transition is the same as the pressed level value and the level value after the transition is the same as the released level value, the corresponding transition signal is recorded as a released candidate signal. At the same time, when the time interval between adjacent transitions does not reach a preset pseudo-trigger interval threshold, the corresponding pressed candidate signal is recorded as a pseudo-press trigger signal, and the corresponding released candidate signal is recorded as a pseudo-release trigger signal. The pseudo-event trigger error within the valid press operation event is identified by referring to the pseudo-press trigger signal and the pseudo-release trigger signal, and the pseudo-event trigger error is used as the key input error detection result.

[0009] As a further aspect of the present invention, the step of analyzing multiple dynamic learning parameters of the mechanical key based on the initial state parameter set and integrating them into a dynamic learning parameter set includes: Calculate the second time difference between the last transition time and the first transition time in the initial state parameter set, and use the second time difference as the absolute bounce duration of the key. Obtain a preset first learning rate factor and a second learning rate factor. When the absolute jitter duration exceeds the historical average jitter duration in the initial state parameter set, the first learning rate factor is selected as the learning rate factor. When the absolute jitter duration does not exceed the historical average jitter duration or is the same as the historical average jitter duration, the second learning rate factor is selected as the learning rate factor. By integrating the absolute jitter duration and the selected learning rate factor, a set of dynamic learning parameters is obtained.

[0010] As a further aspect of the present invention, the step of adjusting the timing of subsequent key matrix scanning and determining the key input error detection result based on the dynamic learning parameter set, and correcting the key input error detection result to obtain the key input correction result includes: Calculate the difference between constant 1 and the selected learning rate factor in the dynamic learning parameter set to obtain the learning rate complementarity difference. Calculate the first product of the absolute jitter duration in the dynamic learning parameter set and the selected learning rate factor. Calculate the second product of the historical average jitter duration and the learning rate complementarity difference. Update the historical average jitter duration based on the sum of the first product and the second product to obtain the updated historical average jitter duration. The sum of the updated historical average jitter duration and the jump compensation duration is calculated to obtain the corrected stable determination duration. The timing of subsequent key matrix scanning is adjusted according to the corrected stable determination duration. The level sampling value within the subsequent key matrix scan determination time is obtained. When the level sampling value is the same as the pressed level value, the false release trigger signal in the key input error detection result is intercepted and the corresponding pressed confirmation mark is retained. When the level sampling value is the same as the released level value, the false pressed trigger signal in the key input error detection result is intercepted and the corresponding released confirmation mark is retained. The retained pressed confirmation mark or released confirmation mark is used as the key input correction result of the key to characterize the pressed input or released input corresponding to the key in the subsequent key matrix scan determination time.

[0011] A smart keyboard input signal error detection and correction system, the system comprising: The parameter acquisition module acquires the initial state parameter set of the keys during the key matrix scanning process of the mechanical keyboard. The state determination module refers to the initial state parameter set, determines multiple button press trigger states, and integrates them into a press trigger state set; The pseudo-event detection module refers to the set of press trigger states to determine the valid press operation events of the key, and identifies pseudo-event trigger errors of the valid press operation events as the key input error detection results; The parameter learning module analyzes multiple dynamic learning parameters of the mechanical keys based on the initial state parameter set and integrates them into a dynamic learning parameter set. The correction module adjusts the timing of subsequent key matrix scanning based on the dynamic learning parameter set, and corrects the key input error detection results to obtain the key input correction results.

[0012] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by acquiring the first transition time, transition count, and historical average jitter duration during the key matrix scanning process, and using the transition compensation duration to form a stable judgment duration, the key press trigger state can be judged by combining the current level change and historical jitter characteristics. Furthermore, a light press state is identified through a light press judgment duration threshold. False press trigger signals and false release trigger signals are identified by the level value before the transition, the level value after the transition, and the time interval between adjacent transitions within the intermediate jitter interval. The historical average jitter duration is updated by combining the absolute jitter duration with a selected learning rate factor, thereby adjusting the subsequent key matrix scanning judgment timing. Within the subsequent judgment timing, false event trigger errors are intercepted and corresponding confirmation marks are retained based on the correspondence between the level sampling value and the press level value or release level value, thus improving the accuracy of key input error detection and the reliability of key input correction. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of the steps of the method of the present invention; Figure 2 This is a flowchart illustrating the steps and principles of the method of the present invention. Figure 3 This is a block diagram of the system of the present invention; Figure 4 This is a block diagram illustrating the module flow principle of the system of the present invention. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0015] Please see Figure 1-2 This invention provides a technical solution: a method for detecting and correcting errors in intelligent keyboard input signals, comprising the following steps: S1: During the key matrix scanning process of the mechanical keyboard, the initial state parameter set of the keys is obtained, including: During the key matrix scanning process of the mechanical keyboard, the continuous level state information of the keys is collected, the level transition of the keys is detected based on the continuous level state information, and the first transition time and transition count of the key level transition are obtained. When inputting using a mechanical keyboard, the keyboard controller firmware causes the row scan driver to output scan levels to the row containing the key according to the key matrix scan order. The column sampling terminal reads the level sample value of the column containing the key at each current key matrix scan time. The key matrix is ​​a cross-scan structure formed by the row and column containing the key. The row scan driver is the hardware port that provides scan levels to the row containing the key, and the column sampling terminal is the hardware port that reads the level sample value of the column containing the key. The level sample value is a high-level or low-level record formed at the column sampling terminal after the key switch is closed or opened. The key, the current key matrix scan time, and the level sample value are written into continuous level state information in chronological order. Continuous level state information is a time sequence of level sample values ​​formed by the same key during multiple adjacent key matrix scans. Then, the repeated level sample values ​​formed by the same key at the same current key matrix scan time are sorted according to the order of writing, and the earliest written level sample value is retained. Then, the level sample values ​​of two adjacent keys are read in chronological order according to the current key matrix scan time. If the current level sample value is different from the previous level sample value, the current key matrix scan time is recorded as the transition time; if the current level sample value is the same as the previous level sample value, the transition time is not recorded. The first transition time = the earliest transition time in the time sequence, and the transition count = the number of times it is recorded as a transition time. Finally, the first transition time and the transition count of the key that caused the level transition are obtained.

[0016] Obtain the historical operation set of the key, extract all historical absolute bounce durations recorded in the historical operation set, calculate the average of all historical absolute bounce durations, and use this average as the historical average bounce duration of the key. The storage area corresponding to the historical operation set stores the historical absolute bounce duration according to the key mapping relationship. The key mapping relationship is the correspondence between the key and the row and column where the key is located. The historical operation set is the historical record written after the previous valid key press operation event is formed. The historical absolute bounce duration is the length of time between the first jump time and the last jump time in the previous valid key press operation event. The valid key press operation event is the key operation event formed by the stable press state or the light press state. All historical absolute bounce durations are arranged in chronological order according to the formation time of the historical absolute bounce duration records, and the duration value of all historical absolute bounce durations is read one by one. The sum of all historical absolute bounce durations = the first historical absolute bounce duration + the second historical absolute bounce duration + up to the last historical absolute bounce duration. The number of historical absolute bounce duration records = the number of historical absolute bounce durations used in the average calculation. The historical average bounce duration = the sum of all historical absolute bounce durations ÷ the number of historical absolute bounce duration records, and finally obtains the historical average bounce duration of the key.

[0017] By integrating the first transition time, transition count, and historical average jitter duration, the initial state parameter set of the button is obtained; The system retrieves the first transition time, transition count, and historical average jitter duration according to the same key correspondence, and places these three parameters into the same key parameter record. The first transition time is the earliest time parameter in the continuous level state information where the key's level sample value changes; the transition count is the number of times the key's level sample value changes in the continuous level state information; and the historical average jitter duration is the average duration of the key's previous absolute jitter. First, the first transition time is written, then the transition count is written, followed by the historical average jitter duration. This creates a callable state parameter record for the first transition time, transition count, and historical average jitter duration under the same key correspondence, ultimately yielding the initial state parameter set for the key.

[0018] S2: Referring to the initial state parameter set, determine the multiple press trigger states of the button and integrate them into a press trigger state set, including: The jump compensation duration is obtained by multiplying the jump count in the initial state parameter set with the preset jump penalty time coefficient. At the same time, the sum of the historical average jitter duration and the jump compensation duration is calculated as the stability judgment duration. The jump penalty time coefficient is set according to the time interval between adjacent level jumps and the jump count. For determining the current key bounce, the transition count is read from the initial state parameter set, and the transition times of two adjacent transitions are read from the continuous level state information. The time interval between adjacent level transitions = the time of the next transition - the time of the previous transition. The preset transition penalty time coefficient is set based on the time interval between adjacent level transitions and the transition count. The value range of the preset transition penalty time coefficient is 0 to a time value below the historical average bounce duration. When the time interval between adjacent level transitions shortens and the transition count increases, the preset transition penalty time coefficient value moves closer to the historical average bounce duration; when the time interval between adjacent level transitions lengthens and the transition count decreases, the preset transition penalty time coefficient value moves closer to 0. The transition compensation duration = transition count × preset transition penalty time coefficient, and the stability determination duration = historical average bounce duration + transition compensation duration. Stability in the stability determination duration refers to the state duration within the continuous level state information reaching or exceeding the time boundary corresponding to the sum of the historical average bounce duration and the transition compensation duration, ultimately yielding the stability determination duration.

[0019] Get the current key matrix scan time, calculate the first time difference between the current key matrix scan time and the first transition time in the initial state parameter set, and use the first time difference as the state duration in the continuous level state information; The current key matrix scan time of the ongoing scan cycle is read, and the first transition time is read from the initial state parameter set. Both the current key matrix scan time and the first transition time use the same timing reference during the key matrix scan process. Then, after aligning the current key matrix scan time with the first transition time in the initial state parameter set, the time interval between them is calculated. The first time difference = current key matrix scan time - first transition time in the initial state parameter set. The first time difference is then stored in correspondence with the continuous level state information to obtain the duration of the state within the continuous level state information.

[0020] When the duration of the state reaches or exceeds the stable determination duration, it is determined to be a stable pressed state of the button. When the duration of the state does not reach the stable determination duration, it is determined to be a suspected pressed jitter state of the button. Multiple press trigger states, including stable pressed state and suspected pressed jitter state, are integrated to obtain a press trigger state set. The system reads the duration of the state and the stabilization determination duration within the continuous level state information, and compares them within the same time unit. The press-triggered state is a state record formed by the duration of the key's level during the current key matrix scan time. When the duration of the state within the continuous level state information reaches or exceeds the stabilization determination duration, the stable press state is taken as the current press-triggered state; when the duration of the state within the continuous level state information does not reach the stabilization determination duration, the suspected press-jitter state is taken as the current press-triggered state. The stable press state is the press-triggered state formed after the key level state reaches the time boundary corresponding to the stabilization determination duration, and the suspected press-jitter state is the press-triggered state formed before the time boundary corresponding to the stabilization determination duration, ultimately resulting in a set of press-triggered states.

[0021] S3: Referring to the set of press trigger states, determine the valid press operation events of the key, identify pseudo-event trigger errors of the valid press operation events, and include the following as key input error detection results: The current level is continuously maintained for the duration corresponding to the suspected press jitter state in the press trigger state set. When the current level continuously maintained for the duration reaches or exceeds the preset light click judgment duration threshold, it is identified as a light click press state of the button. When the current level continuously maintained for the duration does not reach the preset light click judgment duration threshold, the judgment result of the suspected press jitter state of the button is maintained. The light click judgment duration threshold is less than the stable judgment duration and greater than the time interval between the current button matrix scan time and the previous button matrix scan time or the preset instantaneous jitter filtering duration. For suspected press-triggered states in the press-triggered state set, the latest transition time in chronological order is read from the continuous level state information corresponding to the suspected press-triggered state. "Continuous maintenance" in the current level continuous maintenance duration means that the level sample value has not changed again from the latest transition time in chronological order to the current key matrix scan time. Current level continuous maintenance duration = current key matrix scan time - latest transition time in chronological order. The time interval between the current key matrix scan time and the previous key matrix scan time = current key matrix scan time - previous key matrix scan time. The preset instantaneous jitter filtering duration is the time value that reaches or exceeds the time interval between the current key matrix scan time and the previous key matrix scan time, but has not reached the stable judgment duration. The preset tap detection duration threshold uses the stable detection duration, the time interval between the current key matrix scan time and the previous key matrix scan time, and the preset instantaneous bounce filtering duration as setting boundaries. The preset tap detection duration threshold is the time value that has not reached the stable detection duration and exceeds the time interval between the current key matrix scan time and the previous key matrix scan time or exceeds the preset instantaneous bounce filtering duration. When the current level is continuously maintained for a duration that reaches or exceeds the preset tap detection duration threshold, the tapped state is taken as the current detection result; when the current level is continuously maintained for a duration that does not reach the preset tap detection duration threshold, the suspected key press bounce state is taken as the current detection result.

[0022] The stable pressed state and the light press state in the press trigger state set are taken as valid press operation events of the button. The continuous level state information corresponding to the valid press operation event is obtained. The first transition time and the last transition time are extracted from the continuous level state information. The first transition time is taken as the start time and the last transition time is taken as the end time. The intermediate jitter interval of the valid press operation event is defined according to the start time and the end time. The system reads the stable press and tap press states from the press trigger state set, and arranges the continuous level state information corresponding to the stable press state and the tap press state in chronological order according to the current key matrix scan time. The intermediate jitter interval is the time range between the first and last transition times in a valid press operation event. After sorting the level transition records in the continuous level state information according to their transition times, the earliest level transition record corresponds to the first transition time, and the latest level transition record corresponds to the last transition time. The start time = the first transition time, and the end time = the last transition time. Using the start time as the start point of the interval and the end time as the end point of the interval, the intermediate jitter interval of the valid press operation event is finally obtained.

[0023] Acquire all transition signals within the intermediate jitter interval, along with the pre-transition level value, post-transition level value, and adjacent transition time interval for each transition signal. Simultaneously, read the press level value and release level value from the preset key scan configuration. When the pre-transition level value is the same as the release level value and the post-transition level value is the same as the press level value, record the corresponding transition signal as a press candidate signal. When the pre-transition level value is the same as the press level value and the post-transition level value is the same as the release level value, record the corresponding transition signal as a release candidate signal. Furthermore, when the adjacent transition time interval does not reach the preset pseudo-trigger interval threshold, record the corresponding press candidate signal as a pseudo-press trigger signal and the corresponding release candidate signal as a pseudo-release trigger signal. The signal, referring to the pseudo-press trigger signal and pseudo-release trigger signal, identifies pseudo-event trigger errors within valid press operation events, and uses pseudo-event trigger errors as key input error detection results; the method for obtaining the press level value and release level value in the key scan configuration is as follows: when the keyboard controller writes the key scan configuration, it reads the level sampling value transmitted from the row scan driver to the column sampling terminal after the key switch is closed, and writes multiple consecutive identical level sampling values ​​into the key scan configuration as the press level value; when the key switch is open, it reads the idle level sampling value formed by the column sampling terminal under the action of the pull-up circuit or pull-down circuit, and writes multiple consecutive identical idle level sampling values ​​into the key scan configuration as the release level value; Within the intermediate jitter interval of a valid press operation event, transition signals whose transition times fall within the intermediate jitter interval are selected from the continuous level state information according to their start and end times. The level values ​​before and after each transition signal, as well as the transition times of adjacent transition signals, are read sequentially according to their transition times. A transition signal is a signal record formed by two consecutive level sample values ​​being different in the continuous level state information. The level value before the transition is the level sample value obtained from the key matrix scan before the transition signal is formed, and the level sample value after the transition is the level sample value obtained when the transition signal is formed. The time interval between adjacent transitions = the transition time of the next transition signal - the transition time of the previous transition signal. The pressed and released level values ​​are read from the preset key scan configuration. When the keyboard controller firmware writes the key scan configuration, the row scan driver transmits the level sampling value to the column sampling end after the key switch is closed. The column sampling end reads the level sampling value multiple times consecutively. "Multiple times consecutively" means that adjacent read records are included in the same configuration write judgment during the key scan configuration writing process. "Multiple identical times consecutively" means that the level sampling values ​​in adjacent read records are identical item by item. The level sampling values ​​that are identical multiple times consecutively are written into the key scan configuration as the pressed level value. When the key switch is open, the column sampling end forms an idle level sampling value under the action of the pull-up or pull-down circuit. The column sampling end reads the idle level sampling value multiple times consecutively. The idle level sampling values ​​that are identical multiple times consecutively are written into the key scan configuration as the released level value. The preset pseudo-trigger interval threshold takes the time interval between the current key matrix scan time and the previous key matrix scan time as the lower boundary and the stable judgment duration as the upper boundary. The preset pseudo-trigger interval threshold is the time value that exceeds the time interval between the current key matrix scan time and the previous key matrix scan time but has not reached the stable judgment duration. When the level value before the transition is the same as the release level value and the level value after the transition is the same as the press level value, the corresponding transition signal is recorded as a press candidate signal. When the level value before the transition is the same as the press level value and the level value after the transition is the same as the release level value, the corresponding transition signal is recorded as a release candidate signal. When the level value before the transition is different from the release level value or the level value after the transition is different from the press level value, the corresponding transition signal is not recorded as a press candidate signal. When the level value before the transition is different from the press level value or the level value after the transition is different from the release level value, the corresponding transition signal is not recorded as a release candidate signal. When the time interval between adjacent transitions does not reach the preset pseudo-trigger interval threshold, the corresponding press candidate signal is recorded as a pseudo-press trigger signal and the corresponding release candidate signal is recorded as a pseudo-release trigger signal. When the time interval between adjacent transitions reaches or exceeds the preset pseudo-trigger interval threshold, the corresponding press candidate signal is not recorded as a pseudo-press trigger signal and the corresponding release candidate signal is not recorded as a pseudo-release trigger signal, and the final key input error detection result is obtained.

[0024] S4: Based on the initial state parameter set, analyze multiple dynamic learning parameters of the mechanical key and integrate them into a dynamic learning parameter set, including: Calculate the second time difference between the last transition time and the first transition time in the initial state parameter set, and use the second time difference as the absolute bounce duration of the key. The last transition time is read from the valid press operation event, and the first transition time is read from the initial state parameter set. The last transition time and the first transition time in the initial state parameter set are then compared under the same time reference. The absolute bounce duration is the length of time a key spends between the first and last transition times in a single valid press operation event. The second time difference = last transition time - first transition time in the initial state parameter set. This second time difference is written to the bounce duration record corresponding to the current key press, ultimately yielding the absolute bounce duration of the key.

[0025] Obtain preset first and second learning rate factors. When the absolute jitter duration exceeds the historical average jitter duration in the initial state parameter set, the first learning rate factor is selected as the learning rate factor. When the absolute jitter duration does not exceed the historical average jitter duration or is the same as the historical average jitter duration, the second learning rate factor is selected as the learning rate factor. When the absolute jitter duration exceeds the historical average jitter duration, the first learning rate factor is used as the weight of the current absolute jitter duration in the historical average jitter duration update calculation, and is set according to the time difference interval between the absolute jitter duration and the historical average jitter duration. When the absolute jitter duration does not exceed the historical average jitter duration, the second learning rate factor is used as the weight of the current absolute jitter duration in the historical average jitter duration update calculation, and is set according to the time difference interval between the historical average jitter duration and the absolute jitter duration. The system reads the preset first learning rate factor, the preset second learning rate factor, the absolute jitter duration, and the historical average jitter duration from the initial state parameter set. The preset first and second learning rate factors are weights used in the historical average jitter duration update calculation, ranging from 0 to 1. Values ​​closer to 1 increase the proportion of the current absolute jitter duration in the historical average jitter duration update calculation; values ​​closer to 0 increase the proportion of the historical average jitter duration. The preset time difference intervals are set as continuous intervals, increasing from 0. Interval boundaries are obtained from the difference records between all historical absolute jitter durations in the historical operation set. These difference records are arranged in ascending order to form adjacent boundaries. When the time difference falls into a preset time difference interval further down the boundary, the preset first or second learning rate factor is closer to 1. When the absolute jitter duration exceeds the historical average jitter duration in the initial state parameter set, the time difference = absolute jitter duration - historical average jitter duration. The time difference is compared with each of the preset time difference intervals, and the first learning rate factor corresponding to the preset time difference interval into which the time difference falls is read. The first learning rate factor is used as the current selected learning rate factor. When the absolute jitter duration does not exceed the historical average jitter duration, the time difference = historical average jitter duration - absolute jitter duration. The time difference is compared with each of the preset time difference intervals, and the second learning rate factor corresponding to the preset time difference interval into which the time difference falls is read. The second learning rate factor is used as the current selected learning rate factor. When the absolute jitter duration is the same as the historical average jitter duration, the time difference = 0, and the second learning rate factor is used as the current selected learning rate factor. Finally, the selected learning rate factor is obtained.

[0026] By integrating the absolute jitter duration and the selected learning rate factor, a set of dynamic learning parameters is obtained; The absolute jitter duration and selected learning rate factor are read according to the same key mapping relationship, and then written to the same dynamic learning parameter record. The dynamic learning parameter set is a set of parameter records used for subsequent updates to the historical average jitter duration. The absolute jitter duration serves as the duration parameter corresponding to the current valid press operation event, and the selected learning rate factor serves as the learning parameter corresponding to the current absolute jitter duration. The absolute jitter duration is written first, followed by the selected learning rate factor, so that the absolute jitter duration and selected learning rate factor form a callable dynamic learning parameter record under the same key mapping relationship, ultimately resulting in the dynamic learning parameter set.

[0027] S5: Based on the dynamic learning parameter set, adjust the timing of subsequent key matrix scanning and judgment, and correct the key input error detection results to obtain key input correction results including: Calculate the difference between constant 1 and the selected learning rate factor in the dynamic learning parameter set to obtain the learning rate complementary difference. Calculate the first product of the absolute jitter duration in the dynamic learning parameter set and the selected learning rate factor. Calculate the second product of the historical average jitter duration and the learning rate complementary difference. Update the historical average jitter duration based on the sum of the first and second products to obtain the updated historical average jitter duration. Based on the dynamic learning parameter set, the selected learning rate factor and absolute jitter duration are read, along with the historical average jitter duration. The learning rate complement difference is the difference between the constant 1 and the selected learning rate factor, used to multiply by the historical average jitter duration. Learning rate complement difference = 1 - selected learning rate factor. First product = absolute jitter duration × selected learning rate factor. Second product = historical average jitter duration × learning rate complement difference. When the selected learning rate factor is 0, the updated historical average jitter duration = historical average jitter duration; when the selected learning rate factor is greater than 0 and less than 1, the updated historical average jitter duration = first product + second product; when the selected learning rate factor is 1, the updated historical average jitter duration = absolute jitter duration. The calculated duration is written to the update record corresponding to the historical average jitter duration, ultimately obtaining the updated historical average jitter duration.

[0028] Calculate the sum of the updated historical average jitter duration and the jump compensation duration to obtain the corrected stable judgment duration, and adjust the timing of subsequent key matrix scanning judgment based on the corrected stable judgment duration. The updated historical average jitter duration and jump compensation duration are read and placed in the same time unit. The corrected stability determination duration = updated historical average jitter duration + jump compensation duration. The subsequent key matrix scan determination timing is the scan time corresponding to the current key matrix scan time after the corrected stability determination duration. The current key matrix scan time is read, and the subsequent key matrix scan determination timing is determined according to the corrected stability determination duration. When the subsequent key matrix scan time reaches or exceeds the subsequent key matrix scan determination timing, the subsequent key matrix scan determination is initiated; when the subsequent key matrix scan time does not reach the subsequent key matrix scan determination timing, the subsequent key matrix scan determination is not initiated. Finally, the corrected stability determination duration is obtained, and the subsequent key matrix scan determination timing is adjusted.

[0029] The system acquires the level sampling value within the subsequent key matrix scan determination time. When the level sampling value is the same as the pressed level value, it intercepts the false release trigger signal in the key input error detection result and retains the corresponding pressed confirmation mark. When the level sampling value is the same as the released level value, it intercepts the false pressed trigger signal in the key input error detection result and retains the corresponding released confirmation mark. The retained pressed confirmation mark or released confirmation mark is used as the key input correction result of the key to characterize the pressed input or released input corresponding to the key in the subsequent key matrix scan determination time. When the subsequent key matrix scan time reaches or exceeds the subsequent key matrix scan determination time, the level sampling value is read in the scan round corresponding to the subsequent key matrix scan determination time. The pressed level value and released level value are read from the key scan configuration, and the pseudo-press trigger signal and pseudo-release trigger signal are read from the key input error detection result. The pressed confirmation flag is an input flag retained when the level sampling value in the subsequent key matrix scan determination time is the same as the pressed level value. The released confirmation flag is an input flag retained when the level sampling value in the subsequent key matrix scan determination time is the same as the released level value. When the level sampling value is the same as the pressed level value, the pseudo-release trigger signal is intercepted, and the corresponding pressed confirmation flag is retained; when the level sampling value is the same as the released level value, the pseudo-press trigger signal is intercepted, and the corresponding released confirmation flag is retained; when the level sampling value is different from both the pressed and released level values, neither the corresponding pressed nor the corresponding released confirmation flag is retained, ultimately obtaining the key input correction result.

[0030] Please see Figure 3-4 A smart keyboard input signal error detection and correction system, the system comprising: The parameter acquisition module acquires the initial state parameter set of the keys during the key matrix scanning process of the mechanical keyboard. The state determination module refers to the initial state parameter set, determines multiple button press trigger states, and integrates them into a press trigger state set; The pseudo-event detection module refers to the set of press trigger states to determine the valid press operation events of the key, and identifies pseudo-event trigger errors of the valid press operation events as the key input error detection results; The parameter learning module analyzes multiple dynamic learning parameters of the mechanical keys based on the initial state parameter set and integrates them into a dynamic learning parameter set. The correction module adjusts the timing of subsequent key matrix scanning based on the dynamic learning parameter set, and corrects the key input error detection results to obtain the key input correction results.

[0031] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for detecting and correcting input signal errors on an intelligent keyboard, characterized in that, Includes the following steps: During the key matrix scanning process of a mechanical keyboard, the initial state parameter set of the keys is obtained; Referring to the initial state parameter set, determine the multiple press trigger states of the button and integrate them into a press trigger state set; By referring to the set of press trigger states, the valid press operation events of the keys are determined, and the pseudo-event trigger errors of the valid press operation events are identified as the results of key input error detection. Based on the initial state parameter set, analyze multiple dynamic learning parameters of the mechanical key and integrate them into a dynamic learning parameter set; Based on the dynamic learning parameter set, the timing of subsequent key matrix scanning is adjusted, and the key input error detection results are corrected to obtain the key input correction results.

2. The method for detecting and correcting errors in intelligent keyboard input signals according to claim 1, characterized in that, The process of scanning the key matrix of a mechanical keyboard, including obtaining the initial state parameter set of the keys, includes: During the key matrix scanning process of the mechanical keyboard, the continuous level state information of the keys is collected, the level transition of the keys is detected based on the continuous level state information, and the first transition time and transition count of the key level transition are obtained. Obtain the historical operation set of the key, extract all historical absolute bounce durations recorded in the historical operation set, calculate the average of all historical absolute bounce durations, and use this average as the historical average bounce duration of the key. By integrating the first transition time, the transition count, and the historical average jitter duration, a set of initial state parameters for the key is obtained.

3. The method for detecting and correcting input signal errors on an intelligent keyboard according to claim 2, characterized in that, The reference to the initial state parameter set determines multiple button press trigger states, which are then integrated into a press trigger state set, including: The jump compensation duration is obtained by multiplying the jump count in the initial state parameter set with the preset jump penalty time coefficient. At the same time, the sum of the historical average jitter duration and the jump compensation duration is calculated as the stability determination duration. Obtain the current key matrix scan time, calculate the first time difference between the current key matrix scan time and the first transition time in the initial state parameter set, and use the first time difference as the state duration within the continuous level state information; When the duration of the state reaches or exceeds the stability determination duration, it is determined to be a stable pressed state of the button. When the duration of the state does not reach the stability determination duration, it is determined to be a suspected pressed jitter state of the button. Multiple press trigger states, including stable pressed state and suspected pressed jitter state, are integrated to obtain a press trigger state set.

4. The method for detecting and correcting errors in intelligent keyboard input signals according to claim 3, characterized in that, The reference set of press trigger states determines valid key press events and identifies pseudo-event trigger errors of valid key press events, which are included as key input error detection results: The current level is continuously maintained for a certain duration in the set of press trigger states corresponding to suspected press jitter states. When the current level continuously maintained for a certain duration reaches or exceeds a preset light tap judgment duration threshold, it is identified as a light tap press state of the button. When the current level continuously maintained for a certain duration does not reach the preset light tap judgment duration threshold, the judgment result of suspected press jitter state of the button is maintained. The light tap judgment duration threshold is less than the stable judgment duration and greater than the time interval between the current button matrix scan time and the previous button matrix scan time or the preset instantaneous jitter filtering duration. The stable pressed state and the light press state in the set of press trigger states are taken as valid press operation events of the button. The continuous level state information corresponding to the valid press operation event is obtained. The first transition time and the last transition time are extracted from the continuous level state information. The first transition time is taken as the start time and the last transition time is taken as the end time. The intermediate jitter interval of the valid press operation event is defined according to the start time and the end time. All transition signals within the intermediate jitter interval are acquired, along with the level value before the transition, the level value after the transition, and the time interval between adjacent transitions for each transition signal. Simultaneously, the pressed level value and the released level value are read from a preset key scanning configuration. When the level value before the transition is the same as the released level value and the level value after the transition is the same as the pressed level value, the corresponding transition signal is recorded as a pressed candidate signal. When the level value before the transition is the same as the pressed level value and the level value after the transition is the same as the released level value, the corresponding transition signal is recorded as a released candidate signal. At the same time, when the time interval between adjacent transitions does not reach a preset pseudo-trigger interval threshold, the corresponding pressed candidate signal is recorded as a pseudo-press trigger signal, and the corresponding released candidate signal is recorded as a pseudo-release trigger signal. The pseudo-event trigger error within the valid press operation event is identified by referring to the pseudo-press trigger signal and the pseudo-release trigger signal, and the pseudo-event trigger error is used as the key input error detection result.

5. The method for detecting and correcting input signal errors in an intelligent keyboard according to claim 4, characterized in that, The step of analyzing multiple dynamic learning parameters of the mechanical key based on the initial state parameter set and integrating them into a dynamic learning parameter set includes: Calculate the second time difference between the last transition time and the first transition time in the initial state parameter set, and use the second time difference as the absolute bounce duration of the key. Obtain a preset first learning rate factor and a second learning rate factor. When the absolute jitter duration exceeds the historical average jitter duration in the initial state parameter set, the first learning rate factor is selected as the learning rate factor. When the absolute jitter duration does not exceed the historical average jitter duration or is the same as the historical average jitter duration, the second learning rate factor is selected as the learning rate factor. By integrating the absolute jitter duration and the selected learning rate factor, a set of dynamic learning parameters is obtained.

6. The method for detecting and correcting input signal errors in a smart keyboard according to claim 5, characterized in that, The step of adjusting the timing of subsequent key matrix scanning based on the dynamic learning parameter set and correcting the key input error detection results to obtain key input correction results includes: Calculate the difference between constant 1 and the selected learning rate factor in the dynamic learning parameter set to obtain the learning rate complementarity difference. Calculate the first product of the absolute jitter duration in the dynamic learning parameter set and the selected learning rate factor. Calculate the second product of the historical average jitter duration and the learning rate complementarity difference. Update the historical average jitter duration based on the sum of the first product and the second product to obtain the updated historical average jitter duration. The sum of the updated historical average jitter duration and the jump compensation duration is calculated to obtain the corrected stable determination duration. The timing of subsequent key matrix scanning is adjusted according to the corrected stable determination duration. The level sampling value within the subsequent key matrix scan determination time is obtained. When the level sampling value is the same as the pressed level value, the false release trigger signal in the key input error detection result is intercepted and the corresponding pressed confirmation mark is retained. When the level sampling value is the same as the released level value, the false pressed trigger signal in the key input error detection result is intercepted and the corresponding released confirmation mark is retained. The retained pressed confirmation mark or released confirmation mark is used as the key input correction result of the key to characterize the pressed input or released input corresponding to the key in the subsequent key matrix scan determination time.

7. The method for detecting and correcting input signal errors in an intelligent keyboard according to claim 3, characterized in that, The preset transition penalty time coefficient is set according to the time interval between adjacent level transitions and the transition count.

8. The method for detecting and correcting errors in intelligent keyboard input signals according to claim 4, characterized in that, The method for obtaining the pressed level value and released level value in the key scanning configuration is as follows: when the keyboard controller writes the key scanning configuration, the level sampling value transmitted from the row scanning driver to the column sampling end after the key switch is closed is read, and the same level sampling value is written into the key scanning configuration as the pressed level value. When the key switch is off, the idle level sample value formed by the column sampling terminal under the action of the pull-up or pull-down circuit is read, and the same idle level sample value is written into the key scan configuration as the release level value.

9. The method for detecting and correcting errors in intelligent keyboard input signals according to claim 5, characterized in that, When the absolute jitter duration exceeds the historical average jitter duration, the first learning rate factor is used as the weight of the current absolute jitter duration in the historical average jitter duration update calculation, and is set according to the time difference interval between the absolute jitter duration and the historical average jitter duration; when the absolute jitter duration does not exceed the historical average jitter duration, the second learning rate factor is used as the weight of the current absolute jitter duration in the historical average jitter duration update calculation, and is set according to the time difference interval between the historical average jitter duration and the absolute jitter duration.

10. A smart keyboard input signal error detection and correction system, characterized in that, The system includes: The parameter acquisition module acquires the initial state parameter set of the keys during the key matrix scanning process of the mechanical keyboard. The state determination module refers to the initial state parameter set, determines multiple button press trigger states, and integrates them into a press trigger state set; The pseudo-event detection module refers to the set of press trigger states to determine the valid press operation events of the key, and identifies pseudo-event trigger errors of the valid press operation events as the key input error detection results; The parameter learning module analyzes multiple dynamic learning parameters of the mechanical keys based on the initial state parameter set and integrates them into a dynamic learning parameter set. The correction module adjusts the timing of subsequent key matrix scanning based on the dynamic learning parameter set, and corrects the key input error detection results to obtain the key input correction results.