A wireless keyboard adaptive polling control system and method based on keystroke feature analysis

By using an adaptive polling control system based on keystroke feature analysis, the polling strategy of the wireless keyboard is dynamically adjusted, solving the problem of balancing high performance and long battery life, and improving the user experience and stability of the wireless keyboard in complex environments.

CN121604026BActive Publication Date: 2026-04-10SHENZHEN HENGCHANGTONG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-29
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing wireless keyboards struggle to balance high performance and long battery life, and are susceptible to interference in complex electromagnetic environments, leading to packet loss. They also cannot intelligently perceive user intent and environmental channel quality, resulting in a choppy user experience and rapid battery drain.

Method used

An adaptive polling control system based on keystroke feature analysis is adopted. Through the circular buffer and adaptive polling logic in the microcontroller, the keystroke interval and channel quality are detected in real time, and the polling period and transmission strategy are dynamically adjusted, including dual-frequency redundant error correction transmission and voltage protection mechanism.

Benefits of technology

It achieves dynamic allocation of performance and battery life in different operating modes, improves the communication robustness and device stability of the wireless keyboard in complex environments, and ensures a low-latency and highly reliable operating experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121604026B_ABST
    Figure CN121604026B_ABST
Patent Text Reader

Abstract

The application provides a wireless keyboard adaptive polling control system and method based on keystroke feature analysis, and relates to the technical field of wireless communication control. The system detects the key action in real time and records the time interval of adjacent triggering through a data acquisition module, and a feature analysis module calculates the statistical variance of interval data and keystroke acceleration trend value based on a ring buffer. A mode determination module determines the user's energy-saving steady-state mode or competitive burst mode according to the above features, and cooperates with the channel quality factor generated by a channel sensing module, and a strategy scheduling module dynamically adjusts the polling cycle and transmission strategy of radio frequency communication. In the burst mode, the system can perform millisecond-level low-delay single-shot or dual-frequency point redundant transmission, and has a low-voltage transmission protection function. The application effectively solves the balance problem between low-power long endurance and high return rate electrical performance of the wireless keyboard, and improves the communication robustness under complex channels.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of wireless communication control, in particular to a wireless keyboard adaptive polling control system and method based on keystroke feature analysis. BACKGROUND

[0002] With the deep popularization of wireless communication technology, wireless keyboards have become the mainstream peripheral devices in desktop office and e-sports scenes. However, under the existing technical architecture, the design of wireless keyboards often falls into the technical dilemma of being difficult to achieve both high performance and long battery life. In order to meet the stringent requirements of e-sports players for millisecond-level response speed, professional-grade keyboards usually force the report rate to be locked at 1000Hz or even higher, which causes the radio frequency circuit to be in a high-power transmission state continuously, and the battery power can only last for tens of hours. While energy-saving keyboards for office scenarios can last for months, their low polling rate and fixed sleep-wake logic cannot adapt to intense game confrontation, resulting in obvious input lag for users during sudden high-frequency operations. Existing solutions mostly use physical switches or combination keys for manual mode switching, which is not only cumbersome to operate, but also cannot meet the needs of users who frequently switch between different scenarios during multitasking, making it difficult to balance smooth operation experience and long battery life.

[0003] In addition, current wireless keyboards generally work in the increasingly crowded 2.4GHz ISM frequency band, and are easily interfered by Wi-Fi routers, Bluetooth devices and other wireless signals. Traditional control logic often adopts blind retransmission or fixed frequency transmission strategies, and does not establish a real-time sensing mechanism for the surrounding electromagnetic environment. When the channel environment deteriorates, simply increasing the polling rate will only exacerbate the packet loss phenomenon due to the increase in data packet collision rate in the air, i.e. high polling rate does not necessarily bring high data transmission success rate under channel interference. At the same time, when the battery power decreases, the transient current generated by the high-frequency radio power amplifier being turned on can easily pull down the power supply voltage, which can easily cause the microcontroller to reset or the system to crash without intelligent control. Therefore, the industry urgently needs an adaptive control system that can intelligently sense the user's micro-keystroke intention and macro-environment channel quality, and dynamically adjust the polling strategy and transmission mechanism accordingly. SUMMARY

[0004] The present application aims to provide a wireless keyboard adaptive polling control system and method based on keystroke feature analysis to solve the problems identified in the background art.

[0005] In a first aspect, the present application provides a wireless keyboard adaptive polling control system based on keystroke feature analysis, comprising a wireless keyboard body, wherein a microcontroller, a key matrix scanning circuit connected to the microcontroller, and a radio frequency communication module are integrated in the wireless keyboard body; the microcontroller is configured with a ring buffer and an adaptive polling control logic, and the system comprises:

[0006] a data acquisition module configured to detect key actions in real time through the key matrix scanning circuit, obtain a time interval value between adjacent two key triggers, and write the time interval value into the ring buffer in time sequence;

[0007] a feature analysis module configured to read the last N time interval values in the ring buffer, calculate the statistical variance of the time interval values, and simultaneously calculate the first derivative of the time interval value sequence to generate a keystroke acceleration trend value;

[0008] a mode determination module configured to compare the statistical variance with a preset fluctuation threshold value, and compare the keystroke acceleration trend value with a preset burst threshold value to identify the current operation mode of the user;

[0009] a channel sensing module configured to perform background noise scanning on the current working channel in the idle time slot of data transmission using the radio frequency communication module to generate a channel quality factor;

[0010] a strategy scheduling module configured to dynamically adjust the polling period and data packet sending strategy of the radio frequency communication module according to the current operation mode and the channel quality factor.

[0011] Optionally, the data acquisition module uses an overwrite writing mechanism when writing the time interval value into the ring buffer, and the length of the ring buffer is fixed at 8 to 16 data points;

[0012] The data acquisition module is also configured with a debounce logic, and only when the level holding time of the key signal exceeds a physical debounce threshold value, the timestamp of the key press is recorded and the time interval value is calculated.

[0013] Optionally, the current operation mode identified by the mode determination module includes at least:

[0014] an energy-saving steady state mode: when the statistical variance is less than a preset stable threshold value and the mean value of the time interval value is greater than a preset low-frequency threshold value, the energy-saving steady state mode is determined;

[0015] a competitive burst mode: when the keystroke acceleration trend value presents a negative increase and the absolute value exceeds the burst threshold value, the current value of the statistical variance is shielded, and the competitive burst mode is preferentially determined.

[0016] Optionally, the strategy scheduling module sets the polling period to 8-16 milliseconds and closes the real-time scanning function of the channel sensing module to reduce system power consumption when determining the energy-saving steady state mode.

[0017] Optionally, the strategy scheduling module executes a hierarchical control strategy according to the channel quality factor when determining the competitive burst mode.

[0018] When the channel quality factor is better than a preset clearance threshold, the polling period is controlled to be adjusted to 1 millisecond, and a low-delay single-shot transmission strategy is executed.

[0019] When the channel quality factor is worse than the clearance threshold, the polling period is controlled to be adjusted to 2-4 milliseconds, and a redundant error correction transmission strategy is executed.

[0020] Optionally, the redundant error correction transmission strategy is specifically configured to: in the same polling period, the current key data packet is sent twice continuously, and frequency hopping logic is used to switch to adjacent frequency points at least 2 megahertz apart between the two transmissions, so as to resist channel interference by using frequency diversity effect.

[0021] Optionally, the feature analysis module calculates the keystroke acceleration trend value by:

[0022] extracting the latest 3 time interval values in the ring buffer as the latest point, the second-newest point, and the old point;

[0023] calculating the difference between the latest point and the second-newest point as a first instantaneous slope, and calculating the difference between the second-newest point and the old point as a second instantaneous slope;

[0024] If the first instantaneous slope and the second instantaneous slope are both negative and the absolute values are greater than the burst threshold, it is determined that the user is entering a high-frequency operation state.

[0025] Optionally, the power supply circuit of the wireless keyboard body includes an energy storage capacitor, and the strategy scheduling module detects the voltage level of the energy storage capacitor before adjusting the polling period to 1 millisecond.

[0026] If the voltage is lower than a safety threshold, the polling period is forcibly locked to be no lower than 4 milliseconds to prevent instantaneous voltage drop caused by high-frequency transmission.

[0027] Optionally, the radio frequency communication module is configured with an RSSI signal detection unit, and the channel sensing module quantifies the background noise by reading the received signal strength indication value of the RSSI signal detection unit in a non-transmission state.

[0028] The policy scheduling module is further configured with a dynamic weight table, which stores weight coefficients of the channel quality factor on the polling period adjustment under different operation modes.

[0029] In a second aspect, the application provides a wireless keyboard adaptive polling control method based on keystroke feature analysis, comprising the following steps:

[0030] Real-time acquisition of key actions is performed by a key matrix scanning circuit, and time interval values of adjacent keys are calculated and stored in a ring buffer;

[0031] Data in the ring buffer is read, statistical variance and first derivative slope of the time interval sequence are calculated, and a keystroke acceleration trend value is generated;

[0032] The statistical variance and the keystroke acceleration trend value are combined to determine the current operation mode of the user, and when the slope is detected to converge sharply, the competitive burst mode is determined first;

[0033] The background noise of the current channel is scanned using the idle time slot of the radio frequency communication module to generate a channel quality factor;

[0034] When in the competitive burst mode and the channel quality is good, the polling period is switched to 1 millisecond;

[0035] When in the competitive burst mode but the channel quality is poor, the polling period is switched to 2-4 milliseconds, and a dual-frequency point redundant packet sending mechanism is enabled.

[0036] The application has the following beneficial effects:

[0037] By constructing an edge computing model based on a ring buffer in the microcontroller firmware, the application realizes microsecond-level accurate prediction of user operation intention, balances the long-standing technical contradiction between performance and ultra-long endurance. Unlike the traditional lag algorithm that only relies on average speed, the application introduces a two-dimensional analysis logic of keystroke acceleration trend value and statistical variance, which can shield historical mean value data at the moment when double negative slope appears in the initial stage of user speed burst, and preferentially switch the polling period to 1 millisecond. This asymmetric judgment strategy can maximize the use of low-speed gaps in user thinking and document editing for deep sleep while ensuring the low-latency experience of e-sports level, and realizes dynamic on-demand allocation of performance output.

[0038] On the other hand, the application endows the wireless keyboard with active sensing ability to the electromagnetic environment, significantly improving the communication robustness in complex environment. By scanning the background noise in the idle time slot of data transmission, the system can quantify the current channel quality and adjust the transmission strategy accordingly. In a severe environment with serious interference, the system does not blindly increase the speed, but automatically opens the dual-frequency redundant error correction transmission strategy, which uses frequency diversity effect to ensure that the data packet can successfully penetrate the interference at least once in the frequency hopping interval, effectively avoiding the packet loss caused by the same frequency interference. In addition, combined with the voltage drop feedforward protection mechanism of the energy storage capacitor, the system will estimate the load capacity before transmission, effectively preventing the system from crashing due to blind high-frequency transmission under low power, and ensuring the running stability of the device throughout its life cycle.

[0039] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the application. The objects and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims.

[0040] The technical solutions of the present application will be further described in detail below with the help of the accompanying drawings and examples. BRIEF DESCRIPTION OF DRAWINGS

[0041] The accompanying drawings are included to provide a further understanding of the application, and constitute a part of the specification, together with the embodiments of the application, to explain the application, and do not constitute a limitation on the application. In the drawings:

[0042] Figure 1 It is a schematic diagram of a wireless keyboard adaptive polling control system based on keystroke feature analysis in an embodiment of the present application.

[0043] Figure 2 It is a flow chart of a wireless keyboard adaptive polling control method based on keystroke feature analysis in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The preferred embodiments of the present application will be described below in conjunction with the accompanying drawings, and it should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and do not limit the present application.

[0045] Embodiment one:

[0046] Please refer to Figure 1 , Figure 1A module structure schematic diagram of a wireless keyboard adaptive polling control system based on keystroke feature analysis is provided for an embodiment of the present application. In view of the technical contradiction between the high return rate performance and the long-lasting office energy saving of the wireless keyboard in the prior art, and the technical problem that simply increasing the polling rate leads to an increase in the packet loss rate in a complex electromagnetic environment, the embodiment provides an intelligent control system based on edge computing and environment perception. The system is an embedded processing terminal with real-time data analysis and strategy scheduling capabilities.

[0047] As shown in Figure 1 A wireless keyboard adaptive polling control system based on keystroke feature analysis is provided for an embodiment of the present application, and the hardware physical carrier is mainly the wireless keyboard body. The internal circuit board of the wireless keyboard body is integrated with a core processing unit, i.e., a microcontroller unit (MCU), and a key matrix scanning circuit, a radio frequency communication module and a power management circuit which are electrically connected with the microcontroller through printed circuit board wiring. Among them, the microcontroller is the operation and control center of the whole system, and a 32-bit low-power processor based on the ARM Cortex-M series kernel is preferably adopted, and the main frequency configuration is not less than 48 MHz, so as to ensure that the complex floating point operation, variance statistics and logic judgment are completed within the time window of microseconds, and the key scanning and data sending tasks of the main thread are not blocked. In the internal memory (including Flash and SRAM) of the microcontroller, the Flash area is burned with a firmware program for executing the adaptive polling control logic of the present application, and the SRAM area is divided into a specific address space for constructing a ring buffer for temporarily storing high-frequency sampled key timing data.

[0048] The key matrix scanning circuit is the basic front end of the system for sensing user physical operation, which is usually composed of vertical and horizontal interlaced row lines and column lines. Unlike conventional low-speed polling, the scanning circuit in the embodiment is configured in a high-speed interrupt trigger mode or a high-frequency DMA (direct memory access) scanning mode to capture the slight level change in the mechanical key closing moment. The radio frequency communication module is responsible for sending the encoded key data packet to the receiver of the host end through radio waves. This module supports a private communication protocol in the 2.4 GHz ISM frequency band, has programmable transmission power adjustment function, variable channel frequency synthesis function and received signal strength indication (RSSI) detection function, and provides an execution basis at the physical layer for subsequent strategy scheduling.

[0049] In the division of logical function modules, in order to clearly set forth the working principle of the present application, the firmware logic running inside the microcontroller can be abstracted into five tightly coupled core modules: a data acquisition module, a feature analysis module, a mode determination module, a channel awareness module and a strategy scheduling module. The five modules are functional units implemented by the microcontroller through time-sharing multiplexing or multi-thread scheduling during runtime, and they interact with each other through shared memory variables, message queues or flag bits.

[0050] First, the specific implementation of the data acquisition module is described in detail. The data acquisition module is configured to detect key actions in real time through the key matrix scanning circuit. In the existing technical solutions, key scanning often only focuses on which key is pressed and whether the state of the key is on or off, while ignoring the key time domain information that the key is pressed at what time point. The data acquisition module in this embodiment introduces the time dimension into the key data acquisition process. Specifically, a hardware timer (Timer) is maintained inside the system, and the counting frequency of the timer is usually set to 1MHz or higher to provide a time resolution of microseconds. When the key matrix scanning circuit detects the closing action of any valid key, the data acquisition module immediately reads the current hardware timer count value and marks it as the time stamp of this key action.

[0051] In order to ensure that the collected data can truly reflect the user's keystroke intention and exclude the interference of the physical characteristics of mechanical switches, the data acquisition module is also configured with high-order debouncing logic. As we all know, mechanical switches will produce a few milliseconds of level chattering (Chattering) in the moment of closing or opening due to the elastic collision of the metal spring. If the original signal is directly sampled, the system may misjudge a key press as multiple extremely fast consecutive hits, thereby seriously interfering with the subsequent analysis of the user's speed and rhythm. Therefore, this embodiment uses a continuous sampling debouncing algorithm based on a state machine: when a pin level change is detected, the data acquisition module starts a separate software counter and continuously confirms the state of the pin within a pre-set physical debouncing threshold (e.g. 3-5 milliseconds) at a very high frequency (e.g. every 50 microseconds). Only when the level of the key signal remains stable within the entire threshold time or the state is consistent in the continuous N (N is a positive integer) times of sampling, the key press is confirmed as a valid trigger, and the time stamp of this moment is recorded. Subsequently, the data acquisition module reads the time stamp of the last valid key press, calculates the difference between the current time stamp and the last time stamp, and thus obtains the time interval value between the adjacent two key triggers. This time interval value is used to quantify the user's instantaneous keystroke speed.

[0052] After obtaining the cleaned and calculated time interval values, the data collection module needs to store them for later analysis. Here, a ring buffer data structure is used. The data collection module uses an overwrite writing mechanism when writing the time interval values into the ring buffer. The ring buffer appears as a fixed-length array in physical memory, managed with a write pointer. Whenever a new time interval value is generated, the system writes it to the address pointed to by the current pointer, and then increments the pointer. When the pointer value exceeds the maximum index of the array, it automatically wraps around to the start of the array, overwriting the oldest data. This mechanism ensures that the buffer always stores the most recent set of user operation history, without running out of memory over time.

[0053] It is particularly important to note that the length of the ring buffer is strictly fixed at 8 to 16 data points. This value range is based on the results of in-depth psychological research on human neural response speed and operation habits. If the buffer length is too short (e.g., less than 8), the sample size is insufficient, and statistical chance errors will be amplified. For example, a user's occasional mis-touch or hesitation during typing can cause the calculated variance to fluctuate dramatically, triggering the system to frequently switch between different modes, causing instability in the experience. Conversely, if the buffer length is too long (e.g., more than 32), the system's inertia is too large. When the user suddenly switches from the slow state of document editing to the explosive state of electronic sports, the calculated mean and variance cannot meet the switching threshold due to the large amount of slow data remaining in the buffer, causing the system to fail to promptly increase the polling rate, resulting in operation delays at critical moments. Therefore, setting the length to 8 to 16 points is the best balance point between sensitivity and stability, ensuring that the system responds quickly within a few hundred milliseconds after a user behavior mutation.

[0054] The feature analysis module extracts behaviorally significant feature indicators from the time interval sequence, configured to read the last N time interval values in the ring buffer and perform two parallel mathematical operations: calculating the statistical variance of the time interval values, and simultaneously calculating the first derivative of the time interval value sequence to generate keystroke acceleration trend values.

[0055] The purpose of calculating the statistical variance is to quantify the stability of the user's keystroke rhythm. At a psychological level, when the user is in a focused state of operation for document input or code writing, although the keystroke speed may be fast, the intervals between adjacent keystrokes tend to remain within a relatively stable range, or exhibit certain long-period fluctuations related to the user's thinking rhythm. At this time, the calculated variance value is usually in a small to medium interval. When the user is in a thinking pause, or in irregular operation in games (such as sudden continuous attacks after a long latency), the fluctuations in time intervals will be extremely violent, resulting in a sharp increase in variance. The microcontroller quickly calculates the variance value by traversing the data in the ring buffer using the fixed-point number operation unit, providing the first dimension basis for pattern determination.

[0056] However, relying solely on variance and mean often has a lag, which cannot meet the near-zero delay requirement in e-sports scenarios. Therefore, the present application introduces a keystroke acceleration trend value. The method for calculating the keystroke acceleration trend value by the feature analysis module is as follows: first, extract the latest 3 time interval values in the ring buffer. For clarity of description, these data points are denoted as the latest point (Current_Delta), the second-newest point (Prev_Delta), and the oldest point (Old_Delta). These data points occur continuously on the time axis. Then, the feature analysis module calculates the difference between the latest point and the second-newest point as the first instantaneous slope, and calculates the difference between the second-newest point and the oldest point as the second instantaneous slope. The first derivative (i.e., the slope) here reflects the direction and rate of change of the time interval. If the difference is negative, it means that the time interval is shortening and the keystroke speed is increasing.

[0057] The feature analysis module will focus on monitoring the case of sharp convergence. If both the first instantaneous slope and the second instantaneous slope are negative, and their absolute values are greater than a preset burst threshold, it is determined that the user is entering a high-frequency operation state. The physical meaning of this double negative slope is that the user's keystroke interval is rapidly shortening in a non-linear and accelerated manner. For example, from 500 milliseconds to 100 milliseconds, and then to 20 milliseconds. This feature is particularly typical in the initial stage of operation in e-sports, representing the high excitement of the user's nervous system and the explosive contraction of the muscles. By recognizing this feature, the system can predict the arrival of high-frequency data flow in advance, thereby providing a basis for subsequent priority mode switching.

[0058] Further, the mode determination module receives the statistical variance and keystroke acceleration trend value output by the feature analysis module, and compares them with a preset threshold model to identify the current operation mode of the user. In order to cover most use scenarios, the mode determination module identifies at least two current operation modes, including an energy-saving steady-state mode and a competitive burst mode, and the determination logic of these two modes has an asymmetric priority design.

[0059] The determination of the energy saving steady state mode adopts strict AND gate logic. Only when the statistical variance is less than a preset steady threshold (indicating that the rhythm is even) and the mean value of the time interval value is greater than a preset low frequency threshold (indicating that the overall speed is slow, for example, the average interval is greater than 300 milliseconds), the system determines that the user is in the energy saving steady state mode. This conservative determination strategy is to prevent the user from being misjudged as idle state due to a short tactical pause (such as aiming, crouching) in an intense game, and thus the polling rate is incorrectly reduced to cause subsequent operation delay. Only when the long-time data all show that the user is in a slow and stable state, the system allows entering the low power consumption mode. For the determination of the competitive burst mode, the application adopts priority determination logic. Specifically, when the keystroke acceleration trend value presents negative increase and the absolute value exceeds the burst threshold, the mode determination module will shield the current value of the statistical variance and determine the competitive burst mode in priority. In the competitive scene, the warplane has instantaneity, and the operation from awareness to operation often occurs within milliseconds. If waiting for the variance statistical data to change significantly or waiting for the average speed to be pulled up, it has often passed hundreds of milliseconds, causing delay of the most critical first skill. Therefore, as long as the acceleration trend is detected, even if the historical data (old points) in the buffer still show that the user is in a slow state, the system will forcibly determine it as a burst mode and immediately mobilize all resources for low delay response.

[0061] In addition to the analysis of user behavior, the system also fully considers the influence of the wireless channel environment. In the 2.4 GHz ISM frequency band, Wi-Fi, Bluetooth, microwave oven and other devices may be occupied, and the channel environment changes greatly. Traditional wireless keyboards are often responsible for sending and not for listening, or only perform channel scanning when the connection is disconnected. The channel sensing module in the application is configured to use the radio frequency communication module to scan the background noise of the current working channel during the idle time slot of data transmission to generate a channel quality factor.

[0062] In the time division multiple access (TDMA) or similar protocol of wireless communication, the sending of data packets has a time window. For example, in an 8 millisecond polling period, the actual data transmission may only occupy 200 microseconds, and the remaining 7.8 milliseconds are mostly in the sleep or idle state of the radio frequency module. The channel sensing module uses this idle time to temporarily switch the radio frequency module to the receiving (RX) mode, but does not perform complete data packet demodulation, but uses the RSSI (Received Signal Strength Indication) signal detection unit inside the radio frequency chip to read the energy value of the current frequency point in the non-transmission state. This energy value represents the background noise in the environment.

[0063] The channel sensing module quantifies the background noise by reading the RSSI value of the receiving signal in non-transmitting state. If the RSSI value is high (e.g. greater than -70dBm), it means there is strong co-channel interference. If the RSSI value is low (e.g. less than -90dBm), it means the channel is very clean. The channel sensing module maps the weighted average and smoothed RSSI value to a channel quality factor between 0 and 100. This process is completely automatic and does not interrupt the normal data transmission process.

[0064] Finally, the policy scheduling module executes the final control action according to the outputs of the aforementioned modules. The module dynamically adjusts the polling period and data packet sending strategy of the radio frequency communication module according to the current operating mode and the channel quality factor.

[0065] When the policy scheduling module determines the energy-saving steady state mode, its primary goal is to minimize power consumption. At this time, the module sets the polling period to 8-16 milliseconds (equivalent to a reporting rate of 125-60 Hz). Relative to the visual persistence characteristics of the human eye and the input buffer processing mechanism of conventional office software, a 16-millisecond delay cannot be perceived. At the same time, the policy scheduling module sends instructions to the channel sensing module to turn off the real-time scanning function of the channel sensing module to reduce system power consumption. Because the data packet sending frequency is low in low-speed mode, even if a small amount of packet loss occurs, the link layer retransmission mechanism has enough time to compensate, and there is no need to consume additional power to monitor channel quality in real time.

[0066] When the policy scheduling module determines the competitive burst mode, the situation becomes complex. At this time, the system needs to ensure low latency and high reliability as much as possible. The policy scheduling module will execute a hierarchical control strategy according to the channel quality factor.

[0067] The first level is a low-latency single-shot transmission strategy. When the channel quality factor is better than the preset clearance threshold (indicating that the environment is very clean and almost no interference), the policy scheduling module controls the polling period to adjust to 1 millisecond (i.e. 1000 Hz reporting rate). This is the standard limit speed of MSB HID class devices. In this environment, due to minimal interference, the probability of data packet collision or loss is extremely low, so the system adopts the fastest speed, single-shot transmission strategy to ensure that each key action can be transmitted to the host at the physical limit speed, providing a smooth experience for the player.

[0068] The second level is a redundant error correction transmission strategy. When the channel quality factor is worse than the clearance threshold (indicating a poor environment and interference), if 1 millisecond polling is forcibly used at this time, due to high noise floor in the air, the extremely short transmission window is easily flooded by burst noise, resulting in check failure at the receiving end, and then triggering retransmission or packet loss, ultimately resulting in freezing. Therefore, the application controls the polling period to be adjusted to 2-4 milliseconds. Although the theoretical reporting rate decreases, the system uses the additional time window to perform a more stable transmission mechanism.

[0069] The redundant error correction transmission strategy is specifically configured to: within the same polling period, the current key data packet is sent twice in succession, and the frequency hopping logic is used to switch to adjacent frequency points at least 2 megahertz apart between the two transmissions, in order to resist channel interference by using frequency diversity effect. For example, the system first transmits a data packet at frequency point A, and then quickly switches to frequency point B (frequency point B = frequency point A + 2 MHz or more) to transmit the same data packet again. Since the interference signal usually has frequency selectivity (i.e. interference is often concentrated on certain specific frequency points), by sending redundantly at a distance in the frequency domain, it can be ensured with a high probability that at least one data packet can successfully penetrate the interference and reach the receiving end. For users, although the polling rate is reduced from 1000 Hz to 500 Hz or 250 Hz (delay increased by 1-3 milliseconds), compared to the tens of milliseconds of freezing caused by packet loss, it can greatly improve stability.

[0070] In addition, in order to further improve the robustness of the system, the application also fully considers the physical constraints of the hardware power supply system. The power supply circuit of the wireless keyboard body contains an energy storage capacitor (such as an MLCC array or a small super capacitor) for smoothing transient current. In the extremely high frequency (1 millisecond) transmission state, the instantaneous current consumption of the radio frequency power amplifier (PA) is extremely large, which may cause a slight drop in the supply voltage. If the voltage drop is too large, it may cause the microcontroller to reset or the analog-to-digital converter (ADC) sampling to be inaccurate. Therefore, before adjusting the polling period to 1 millisecond, the strategy scheduling module will first call the ADC module of the microcontroller to detect the voltage level of the energy storage capacitor. If the voltage is below the safety threshold, the polling period is forcibly locked to no less than 4 milliseconds to prevent transient voltage drop caused by high-frequency transmission. This hardware protection logic effectively prevents system under-voltage collapse caused by pursuing high-performance transmission, ensuring that the device can still maintain basic usability in a low battery state.

[0071] The policy scheduling module is also configured with a dynamic weight table, which stores the weight coefficients of the channel quality factor on the polling period adjustment under different operating modes. This table is stored in the non-volatile memory (such as EEPROM) of the microcontroller, allowing fine-tuning by the host computer software to adapt to the needs of different types of games (such as FPS sensitive to delay, MMORPG sensitive to stability).

[0072] In order for those skilled in the art to better understand and implement the present application, the following lists the preferred value range of the key parameters of the system under a typical hardware configuration (48MHz main frequency MCU, mechanical shaft body):

[0073] Physical dithering threshold: 3ms to 5ms;

[0074] Statistical variance stability threshold: 100 to 200 (unit: ms square), when the variance is less than this value, it is determined that the keystroke rhythm is uniform;

[0075] Breakout threshold (Trend): 150 to 300 (unit: ms), when the trend value exceeds this value, it is determined as strong acceleration intention;

[0076] Clearance threshold (QF): 80 points, higher than 80 points is considered as clean channel;

[0077] Safety threshold (voltage): 2.7V (for 3.3V power supply system), to prevent MCU under-voltage reset.

[0078] Example two:

[0079] Please refer to Figure 2 , Figure 2 A flowchart of a wireless keyboard adaptive polling control method based on keystroke feature analysis is provided for the embodiments of the present application. This method mainly runs in the microcontroller firmware built-in the wireless keyboard, and is realized through the task scheduling of real-time operating system (RTOS) or the front and back interrupt system to realize instant response.

[0080] As Figure 2 shown, the method described in the present application specifically includes the following detailed steps:

[0081] Step S100: system initialization and reference establishment.

[0082] After the wireless keyboard is powered on and reset, the microcontroller first performs the initialization sequence of the underlying hardware.

[0083] Firstly, the system configures the clock tree. The system main clock (HCLK) is multiplied by a phase-locked loop (PLL) to the highest operating frequency (e.g. 48MHz or 64MHz) to ensure sufficient computational redundancy when subsequent floating-point operations, variance statistics, and second-order differential analysis are involved, preventing logical blockage caused by computational bottlenecks.

[0084] Secondly, the system configures the electrical characteristics of the general-purpose input / output port (GPIO). For the pins connected to the key matrix, they are configured as high-speed push-pull input or open-drain input mode, with the internal pull-up resistor enabled, and the interrupt priority set to the highest level to ensure that the key signal can interrupt any background task.

[0085] Thirdly, the system initializes the registers of the radio frequency communication module. The configuration word is written through the SPI bus to set the default transmit power (e.g. 0dBm), reference communication frequency, and air data rate (e.g. 2Mbps).

[0086] Finally, the ring buffer in SRAM is initialized. The system resets the read and write pointers and pre-fills all data units in the buffer with a large value representing a stationary state (e.g. 500ms). This pre-filling mechanism prevents the system from causing division by zero errors or misjudging as burst mode during the first few seconds of cold start due to an empty or random garbage data buffer. At the same time, the system loads the dynamic weight table and historical channel quality records from the non-volatile memory (EEPROM), and if there are no records, it loads the factory default parameters. This step establishes the initial running baseline for the system, which defaults to an energy-saving steady-state mode with a polling period of 8ms to balance startup speed and power consumption control.

[0087] Step S200: Microsecond-level key timing acquisition and buffering.

[0088] The key matrix scanning circuit scans the physical keys at a very high frequency (e.g. 2000Hz to 4000Hz). To obtain accurate data sufficient to support psychological feature analysis, this step uses a composite acquisition mechanism of hardware interrupt triggering combined with time domain integral filtering.

[0089] The specific sub-steps are as follows:

[0090] S201: Interrupt response. When the user presses any key, the mechanical contact is closed, causing the GPIO pin level to jump, triggering an external interrupt of the microcontroller. The interrupt service program (ISR) immediately suspends the current task for response.

[0091] S202: Physical debounce. To eliminate mechanical bounce, the ISR first starts a hardware timer that lasts for 3-5 milliseconds. During this window, the system does not immediately acknowledge the key press, but instead oversamples the pin state at high frequency (e.g., once every 50 microseconds).

[0092] S203: Validity determination. The system integrates the sampling results. Only when the proportion of low levels in the sampling points exceeds a preset threshold (e.g., 95%), is the key press determined to be a real human operation. This statistical-based debounce logic has stronger anti-noise capability than simple delay debounce.

[0093] S204: Timestamp acquisition. Once the validity is confirmed, the system immediately reads the current high-precision free running counter value to generate the absolute timestamp (Timestamp_Current) of this key press.

[0094] S205: Interval calculation. The system immediately retrieves the timestamp (Timestamp_Last) of the last valid key press saved in memory and performs subtraction: ; wherein, represents the time interval value between the triggering of adjacent two key presses; represents the absolute timestamp of the current key action; represents the absolute timestamp of the last valid key press. This time interval value is the atomic data that quantifies the user's operation rhythm.

[0095] S206: Data cleaning and enqueuing. To adapt to the statistical model, the system performs upper and lower limit clamping processing on (e.g., limited to between 5ms and 2000ms). Subsequently, the data is pushed into the ring buffer. Since the ring buffer adopts an overwrite writing mechanism, the memory always saves the N (preferably 8-16) time interval samples closest to the current time, forming a sliding behavior feature window.

[0096] Step S300: Real-time operation of multi-dimensional key press features.

[0097] When new data enters the buffer, the arithmetic logic unit (ALU) of the microcontroller immediately starts the feature extraction task. To accurately capture the user's operation psychology and physiological burst, this step performs two-dimensional mathematical analysis, specifically including:

[0098] First dimension: statistical dispersion analysis (variance calculation).

[0099] The system iterates through N data points in the buffer. First, it calculates the arithmetic mean of the data, which reflects the user's macro-average hand speed. Then, it calculates the sum of squares of the differences between each data point and the mean, and divides this sum by the number of data points to obtain the variance.

[0100] ;

[0101] in, Indicates statistical variance; This represents the total number of time interval data points involved in the calculation within the circular buffer (the value ranges from 8 to 16). The index number of the data point; Indicates the number of... The time interval value between adjacent keys; This indicates that The arithmetic mean of the values ​​at each time interval.

[0102] The physical meaning of variance lies in quantifying the stability of user operations. When users are in a state of document editing or deliberate, slow input, although the speed is slow, the rhythm often has a certain sense of rhythm, and the variance remains at a low to medium level; however, when users are in a state of panic, tentative, or unconscious random typing, the variance will increase significantly.

[0103] Second dimension: Second-order trend derivative analysis (acceleration calculation).

[0104] The system extracts the three most recent time points from the buffer, denoted as... (up to date), (Newest) and (Old).

[0105] First, calculate the first-order difference (rate of change of velocity):

[0106] ;

[0107] ;

[0108] In a physical sense, if A negative value indicates that the latest interval is shorter than the previous one, meaning the user is accelerating.

[0109] Next, a double negative slope determination is performed. If and All values ​​are negative, indicating that the interval is continuously shortening and the speed is continuously increasing.

[0110] To further quantify the intensity of this acceleration, the system calculates a trend strength value:

[0111] ;

[0112] wherein, represents the newest time interval value in the ring buffer; represents the second-newest time interval value; represents the third-newest time interval value; is the first-order difference (first instantaneous slope) between the newest point and the second-newest point; is the first-order difference (second instantaneous slope) between the second-newest point and the oldest point; is the keystroke acceleration trend strength value; is a preset acceleration weighting coefficient, with a value range of 0.5 to 1.0, used to adjust the weight of the second instantaneous slope |k2| in the overall trend determination; the symbol |…| represents an absolute value operation, used to calculate the magnitude of the slope without considering its direction.

[0113] If the Trend value exceeds a preset burst threshold, it indicates that the user's keystroke speed is experiencing a nonlinear, exponential convergence process. This feature corresponds to the excitement of the user's nervous system in psychology, and usually occurs in the instant of an encounter battle in e-sports, which is a strong signal requiring the system to make a limit response.

[0114] Step S400: arbitration of the operation mode based on the asymmetric logic.

[0115] Based on the calculation result of step S300, the system determines the current operation mode through a nonlinear state machine. In order to solve the mean lag problem existing in the traditional algorithm, this step introduces a priority determination mechanism, which includes the following logic branches:

[0116] Logic branch one: extremely low delay preemption of the competitive burst mode.

[0117] The system monitors the keystroke acceleration trend value in real time. Once the double-negative slope sharp convergence feature described above is detected, regardless of the current statistical variance and regardless of how slow the long-period average speed is, the state machine immediately triggers the highest priority switching instruction, forcing the system state to be locked in the competitive burst mode.

[0118] This logic eliminates the time difference of waiting for the mean to rise. For example, the user suddenly starts to press from static, the first two keys are extremely fast, but there are 14 slow data in the buffer, and the mean is still very slow. If relying on the mean, the system cannot switch. If relying on the slope trend, the system can complete the switching before the third key is pressed, realizing the rapid prediction of the user's burst intention.

[0119] Logic branch two: hysteresis regression of the energy-saving steady-state mode.

[0120] The system adopts an inertial exit strategy to return to the energy-saving mode. Only when the statistical variance is lower than the stable threshold for a long time (e.g. 2 seconds continuously) and the average time interval is greater than the low-frequency threshold, the system allows the system to return to the energy-saving steady-state mode from the burst mode.

[0121] This asymmetric hysteresis design effectively prevents the Ping-Pong effect caused by short or tactical pauses in intense operations (such as weapon aiming in FPS games), ensuring the continuity of performance output and avoiding the wake-up delay when the user operates again after a short pause.

[0122] Step S500: Inertial scanning and quantification of channel environment.

[0123] This step is performed by the radio frequency communication module during the idle time slot of data transmission, and the specific operation is as follows:

[0124] S501: After completing a data packet transmission and receiving an ACK (or timeout), the microcontroller does not immediately put the radio frequency module to sleep.

[0125] S502: The microcontroller instructs the radio frequency synthesizer to lock the current operating frequency and switches the circuit to the receiving (RX) listening state.

[0126] S503: The RSSI (Received Signal Strength Indicator) detection unit of the radio frequency front end samples the electromagnetic noise in the air. In order to obtain accurate channel quality evaluation, the system will sample multiple times (e.g. 3 times) at different times within a polling period and take the average value.

[0127] S504: The RSSI value (usually negative dBm value) obtained by sampling is mapped to a channel quality factor of 0 to 100. For example, -90dBm corresponds to 100 points (excellent), -50dBm corresponds to 0 points (very poor).

[0128] Specifically, the linear normalization algorithm is used to generate the channel quality factor, and the calculation formula is as follows:

[0129] ;

[0130] Wherein, CQI represents the channel quality factor; RSSI represents the current measured noise floor value; RSSImin represents the preset lower limit of pure noise floor (this embodiment takes -90dBm); RSSImax represents the preset upper limit of saturated interference (this embodiment takes -50dBm); the Clamp function is used to limit the calculation result to the closed interval of 0 to 100. This formula ensures that the system can continuously and quantitatively perceive the degree of environmental interference.

[0131] S505: In addition, the system will also use the idle time to poll adjacent frequency points (such as the current frequency ) to establish a frequency black list to record the frequency bands with persistent interference, providing the basis for subsequent frequency hopping strategies.

[0132] Step S600: Adaptive strategy scheduling and physical layer execution.

[0133] When executing the strategy scheduling, the system calculates the final polling period according to the following adaptive formula to achieve dynamic adjustment:

[0134] ;

[0135] Wherein, represents the target polling period value determined after calculation; is the basic period of the current mode (for example, 1ms in the competitive mode); is the current channel quality factor; is the coefficient obtained from the dynamic weight table.

[0136] For example, in the competitive burst mode, the preset When the channel is excellent ( ), the increment is 0, and the system maintains a 1ms limit polling; when the channel is poor ( ), the system automatically stretches the period to , thus smoothly transitioning to a 2ms-4ms redundant packet window.

[0137] The strategy scheduling module integrates the operating mode and the channel quality factor to consult the dynamic weight table to determine the final radio frequency parameters and transmission logic, including the following scenarios:

[0138] Scenario A: burst mode and clean channel (QF> clear threshold).

[0139] The system pursues high performance speed. After the microcontroller detects that the energy storage capacitor voltage is normal, the polling period is reloaded to 1ms (1000Hz). The data packet adopts a single-shot low-delay strategy, that is, once the key action is collected and packaged, it is immediately sent without waiting and without automatic retransmission request at the link layer, so as to sprint at the physical limit speed to ensure the lowest delay.

[0140] Scenario B: burst mode but channel congestion (QF< clear threshold).

[0141] The system pursues reliability in harsh environments. If the channel quality factor is low, the system determines that if 1 ms single transmission is forcibly used at this time, the packet loss rate will be uncontrollable. Therefore, the strategy scheduling module adjusts the polling period to 2-4 milliseconds. With this additional time budget, the dual-frequency redundant packet transmission mechanism is enabled: in the same period, first send data at the primary frequency point, and then jump to the secondary frequency point with less interference to send the same data again. This frequency diversity technique takes advantage of the frequency selective fading characteristics of interference signals to ensure that at least one data can penetrate the interference.

[0142] Scenario C: Energy-saving steady-state mode.

[0143] The system pursues long endurance. The polling period is set to 8-16 milliseconds. After transmitting the heartbeat packet or low-speed key data, the radio frequency module immediately enters deep sleep mode. At this time, the system turns off most of the sensing functions and waits for the user to wake up.

[0144] Embodiment three:

[0145] Further, the timing details of the dual-frequency redundant packet transmission mechanism include:

[0146] In the 2.4 GHz ISM band, frequency hopping is a standard means of resisting interference, but the traditional Bluetooth frequency hopping interval is long (tens of milliseconds). The microsecond-level dual-transmission timing realized by the present invention is as follows:

[0147] T (relative time calculated from the packet transmission process) = 0 μs: the microcontroller fills the data packet payload into the radio frequency FIFO and starts the transmission instruction.

[0148] T = 10 μs~140 μs: the radio frequency PLL locks the frequency point F1, the PA is turned on, and the data packet is transmitted (assuming an airspeed of 2 Mbps, a packet length of 260 bits, and a time consumption of about 130 μs).

[0149] T = 140 μs~270 μs: transmission is complete, and the radio frequency chip automatically or under the control of the MCU switches the PLL to the frequency point F2. The selection logic of F2 is:

[0150] ;

[0151] wherein, Ftarget represents the target frequency of the frequency hopping switch (unit: MHz); Fstart represents the reference starting frequency of the system, which is taken as 2400 MHz in this embodiment; Fcurrent represents the current transmission frequency (unit: MHz); Finterval represents the preset frequency hopping interval value (at least 5 MHz); This indicates the effective available bandwidth range of the system within the 2.4GHz ISM band, which is taken as 80 MHz in this embodiment; mod represents the modulo operator, used to achieve cyclic coverage of frequency points.

[0152] This calculation logic ensures that when the calculation result exceeds the upper limit of the frequency band, it can automatically wrap back to the beginning of the frequency band. For example, if the current frequency is 2478MHz and the interval is 5MHz, the calculation result will wrap back to 2403MHz, thus ensuring... and It always falls within the effective ISM band.

[0153] The 5MHz frequency was chosen here to span the coherent bandwidth of common Wi-Fi signal bandwidths (20MHz / 22MHz), ensuring that F1 and F2 do not simultaneously fall within the coverage area of ​​the same interference source. PLL relocking typically takes 130μs.

[0154] T = 270μs~400μs: The RF PA is turned on again and sends the same data packet at frequency F2.

[0155] The entire redundant transmission process takes less than 500 μs. Within the 2-millisecond (2000 μs) polling period, the remaining 1500 μs can still be used to receive ACKs or enter sleep mode.

[0156] To complement the dual-frequency redundancy strategy of the transmitter, the corresponding wireless receiver (dongle) is configured with wide-window dual-guard logic: within a predetermined time slot, the receiver first locks onto frequency F1 for listening; if the data packet is not successfully demodulated on F1 (verification failure or no preamble detected), it utilizes the fast switching capability of the RF chip (Settling Time < 50μs) to immediately switch to frequency F2 for remedial reception in the latter half of the same time slot. This time-frequency synchronization mechanism between the transmitter and receiver ensures that redundant data packets can be effectively captured.

[0157] The energy storage capacitor and voltage drop protection logic include:

[0158] In the PCB layout of a wireless keyboard, to cope with the instantaneous large current draw (up to 30mA) of the RF PA, it is preferable to place a low ESR ceramic capacitor (MLCC, e.g., 22uF) close to the VCC pin of the RF chip. However, as the battery discharges, the internal resistance increases, and the voltage drop at the moment the PA turns on may cause VCC to momentarily fall below the MCU's BOD (Brown-out Detection) reset threshold.

[0159] The strategy scheduling module of the present application performs a load capacity estimation before deciding to switch to the 1ms low latency mode (meaning that the PA will be turned on at a high frequency of 1000Hz) each time:

[0160] S701: The microcontroller starts the ADC to sample the current battery static voltage .

[0161] S702: The voltage drop amplitude at the last transmission is combined with the historical record . It should be noted that when the device is powered on for the first time or has no historical record, the value of Vdrop is initialized to a safe and conservative value (for example, 200mV). Subsequently, the system dynamically updates this value using the exponential weighted moving average algorithm (EWMA):

[0162] ;

[0163] wherein, represents the battery voltage value obtained by ADC sampling at the moment when the radio frequency transmission ends; represents the updated average voltage drop amplitude value in this calculation; represents the historical average voltage drop amplitude value stored before the calculation. This self-learning algorithm enables the system to automatically adapt to the characteristics of the increase in battery internal resistance with aging, ensuring the accuracy of the low voltage protection logic throughout the life cycle of the device.

[0164] S703: Predict the minimum voltage after this transmission . Wherein, represents the predicted minimum voltage value at the moment of transmission; represents the current battery static voltage value obtained by ADC sampling; represents the average voltage drop amplitude value generated by the radio frequency power amplifier when it is turned on in the system historical record.

[0165] S704: If is close to the reset threshold of the MCU (for example, a safety margin of 0.1V is reserved), the system will forcibly prohibit entering the 1ms mode and will be locked in the 4ms mode, reducing the transmission duty cycle to give the capacitor enough time to recover the charge.

[0166] This physical model-based feedforward protection mechanism effectively avoids the risk of system crash in high-performance mode, solving the technical problem of easy disconnection of high-performance keyboards under low power in the prior art.

[0167] Embodiment Four

[0168] This embodiment provides several typical use scenarios to intuitively demonstrate the beneficial effects of the technical solution of the present application in practical applications, specifically including:​

[0169] Scenario 1: Low-frequency, low-speed document editing scenario (advantages of energy-saving steady-state mode).

[0170] The user is engaged in prolonged coding or academic writing. At this time, the keystroke rate is stable at around 150 words per minute, and the input rhythm is slow and steady.

[0171] System status: Time interval detected by the data acquisition module The mean was relatively large (>300ms), and due to user pauses in thought, the variance showed regular fluctuations but did not reach the outbreak threshold. The feature analysis module determined that no outbreak trend had been triggered.

[0172] Control strategy: The system operates stably in energy-saving steady-state mode with a polling cycle of 16 milliseconds.

[0173] Technical Results: For document input, the 16ms latency (corresponding to a 60fps refresh rate) is well below the perceptual threshold of human vision and touch, resulting in a smooth typing experience. Simultaneously, because the RF module is in sleep mode over 90% of the time, the average operating current is reduced to the microamplitude level. Compared to traditional gaming keyboards that consistently maintain a 1000Hz polling rate (typically offering only tens of hours of battery life), this system can provide several months of battery life in this scenario.

[0174] Scenario 2: Encounter in FPS games (Advantages of the competitive burst mode).

[0175] When a player is suddenly ambushed in the game, they instinctively move around and frequently trigger the button to fire.

[0176] System status: Within tens of milliseconds after the user pressed the first dodge key, the feature analysis module keenly detected that the time interval suddenly dropped from 300ms to 40ms, and the trend slope increased sharply in an instant, showing a double negative slope characteristic.

[0177] Control strategy: The mode determination module triggers priority determination. Before the third key data is generated, the system has switched to the 1ms low latency single-transmission mode (assuming the channel is clean).

[0178] The user's subsequent series of actions (aiming, scope in, firing) are transmitted to the computer at an extreme speed of 1000Hz. Compared to the slow polling of traditional office keyboards, this system significantly reduces input latency, allowing the player's actions to be executed with the most precise accuracy, thus improving the competitive win rate.

[0179] Scenario 3: Large-scale e-sports event (advantages of anti-interference strategies).

[0180] Users are in a venue filled with hundreds of mobile phones, Bluetooth devices, and high-power Wi-Fi, where the noise floor in the 2.4GHz band is as high as -50dBm.

[0181] System status: The channel sensing module detected severe interference across the entire frequency band, with an extremely low channel quality factor. Meanwhile, the user is engaged in intense team battles, operating in burst mode.

[0182] Control strategy: The strategy scheduling module does not blindly maintain 1ms single transmission (which means an extremely high packet loss rate under dirty channels), but intelligently switches to 2ms dual-frequency redundancy mode.

[0183] Although the polling rate was reduced from 1000Hz to 500Hz, dual-frequency transmission ensured highly reliable data packet delivery within each transmission window.

[0184] Example 5:

[0185] This embodiment will list several possible design variations, which also fall within the protection scope of this invention.

[0186] Variant 1: Alternative algorithms for statistical features.

[0187] In Example 2, variance was used to measure keystroke stability. In some low-cost MCUs with limited computing power, mean absolute deviation (MAD) can be used instead of variance. The calculation formula is: ,in, This represents the mean absolute deviation value; Indicates the number of samples; Indicates the first Sample values ​​for each time interval; Represents the arithmetic mean of all samples; symbol This indicates the absolute value operation; This represents the summation operation on all sample data within the buffer. Although the mathematical definitions differ, their physical meaning is the same: characterizing the degree of data dispersion, achieving the same technical effect. Therefore, any technical solution that uses statistical dispersion indicators to determine user keystroke patterns should be considered an equivalent implementation of this invention.

[0188] Variation 2: Alternative triggers for the outbreak trend.

[0189] While this invention preferably uses the first / second derivative of the time interval to determine bursts, in certain types of keyboards (such as analog switch keyboards and optical switch keyboards), the key press speed (travel / time) can be introduced as an auxiliary criterion. If the sensor detects that the physical speed at which the keycap is pressed is extremely fast (a heavy strike), this usually indicates that the user is in an excited or competitive state. Combining multimodal fusion determination of press speed and keystroke interval is also a natural extension of the concept of this invention.

[0190] Variation 3: Frequency domain extension for redundant transmission.

[0191] Dual frequency point redundancy is described in the embodiments of the present application. In extremely harsh environments, the policy scheduling module can be extended to three frequency points or even full-band spread spectrum (DSSS) transmission. That is, in a key event, data is transmitted continuously on more than three frequency points, or directly using spread spectrum coding technology. Although this will significantly increase power consumption and bandwidth occupation, as long as its trigger logic is based on the keystroke features described in the present application combined with channel-aware dual criteria, it belongs to the technical scope of the present application.

[0192] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application belong to the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.

Claims

1. A wireless keyboard adaptive polling control system based on keystroke feature analysis, comprising a wireless keyboard body, a microcontroller, a key matrix scanning circuit connected with the microcontroller and a radio frequency communication module integrated in the wireless keyboard body; characterized in that, The microcontroller is equipped with a circular buffer and adaptive polling control logic. The system includes: The data acquisition module is configured to detect key actions in real time through the key matrix scanning circuit, obtain the time interval value between two adjacent key triggers, and write the time interval value into the circular buffer in a time sequence. The feature analysis module is configured to read the most recent N time interval values ​​in the circular buffer, calculate the statistical variance of the time interval values, and simultaneously calculate the first derivative of the time interval value sequence to generate keystroke acceleration trend values. The mode determination module is configured to compare the statistical variance with a preset fluctuation threshold and compare the keystroke acceleration trend value with a preset burst threshold to identify the user's current operation mode. The channel sensing module is configured to use the radio frequency communication module to perform a noise floor scan of the current working channel during idle time slots in data transmission, and generate a channel quality factor. The strategy scheduling module is configured to dynamically adjust the polling period and data packet transmission strategy of the radio frequency communication module according to the current operating mode and the channel quality factor.

2. A wireless keyboard adaptive polling control system based on keystroke feature analysis as claimed in claim 1, wherein, When the data acquisition module writes the time interval value into the circular buffer, it adopts an overwrite mechanism, and the length of the circular buffer is fixed at 8 to 16 data points. The data acquisition module is also equipped with debouncing logic, which records the timestamp of the key press and calculates the time interval value only when the level holding time of the key signal exceeds the physical debouncing threshold.

3. A wireless keyboard adaptive polling control system based on keystroke feature analysis as claimed in claim 1, wherein, The current operation mode identified by the mode determination module includes at least the following: Energy-saving steady-state mode: When the statistical variance is less than a preset stability threshold and the mean of the time interval values ​​is greater than a preset low-frequency threshold, it is determined to be the energy-saving steady-state mode; Competitive Burst Mode: When the keystroke acceleration trend value shows a negative increase and the absolute value exceeds the burst threshold, the current value of the statistical variance is masked, and it is preferentially determined to be the competitive burst mode.

4. A wireless keyboard adaptive polling control system based on keystroke feature analysis as claimed in claim 3, wherein, When the strategy scheduling module determines that the system is in the energy-saving steady-state mode, it sets the polling period to 8 to 16 milliseconds and disables the real-time scanning function of the channel sensing module to reduce system power consumption.

5. A wireless keyboard adaptive polling control system based on keystroke feature analysis as claimed in claim 3, wherein, When the strategy scheduling module determines that the game is in the "competition outbreak mode", it executes a hierarchical control strategy based on the channel quality factor: When the channel quality factor is better than the preset clearance threshold, the polling period is adjusted to 1 millisecond, and a low-latency single-transmission strategy is executed. When the channel quality factor is worse than the net clearance threshold, the polling period is adjusted to 2 to 4 milliseconds, and a redundant error correction transmission strategy is executed.

6. A wireless keyboard adaptive polling control system based on keystroke feature analysis as claimed in claim 5, wherein, The redundancy error correction transmission strategy is specifically configured as follows: within the same polling cycle, the current key data packet is sent twice consecutively, and the frequency hopping logic is used to switch to an adjacent frequency point with an interval of at least 2 MHz between the two transmissions, so as to use frequency diversity effect to resist channel interference.

7. The keystroke feature analysis based wireless keyboard adaptive polling control system of claim 1, wherein, The specific method by which the feature analysis module calculates the keystroke acceleration trend value is as follows: Extract the three newest time interval values ​​from the circular buffer and record them as the newest point, the second newest point, and the oldest point; The difference between the latest point and the second newest point is calculated as the first instantaneous slope, and the difference between the second newest point and the old point is calculated as the second instantaneous slope; If both the first instantaneous slope and the second instantaneous slope are negative and their absolute values ​​are greater than the burst threshold, then it is determined that the user is entering a high-frequency operation state.

8. A wireless keyboard adaptive polling control system based on keystroke feature analysis according to claim 1, characterized in that, The power supply circuit of the wireless keyboard body includes an energy storage capacitor. Before adjusting the polling period to 1 millisecond, the strategy scheduling module first detects the voltage level of the energy storage capacitor. If the voltage is lower than the safety threshold, the polling period is forcibly locked to be no less than 4 milliseconds to prevent instantaneous voltage drops caused by high-frequency transmission.

9. A wireless keyboard adaptive polling control system based on keystroke feature analysis according to claim 1, characterized in that, The radio frequency communication module is equipped with an RSSI signal detection unit, and the channel sensing module quantifies the background noise by reading the received signal strength indication value of the RSSI signal detection unit in the non-transmit state. The policy scheduling module is also configured with a dynamic weight table, which stores the weight coefficients of the channel quality factor for adjusting the polling period under different operating modes.

10. A wireless keyboard adaptive polling control method based on keystroke feature analysis, characterized in that, Includes the following steps: The key press actions are collected in real time by a key matrix scanning circuit, the time interval between adjacent keys is calculated and stored in a circular buffer. Read the data from the circular buffer, calculate the statistical variance and the slope of the first derivative of the time interval sequence, and generate keystroke acceleration trend values; The user's current operation mode is determined by combining the statistical variance and the keystroke acceleration trend value. When the slope is detected to converge sharply, it is preferentially determined to be the competitive burst mode. The channel quality factor is generated by scanning the noise floor of the current channel using the idle time slots of the radio frequency communication module. When in the aforementioned competitive burst mode and with good channel quality, the polling period will be switched to 1 millisecond; When the competition burst mode is in effect but the channel quality is poor, the polling period is switched to 2 to 4 milliseconds, and the dual-frequency redundant packet transmission mechanism is enabled.

Citation Information

Patent Citations

  • Office and game automatic adaptation system and method

    CN117608852A

  • Method and system for protecting health of user through intelligent self-adaptive keyboard

    CN120356603A