Low-power keyboard and mouse communication method and system based on frequency hopping technology

By establishing an interference characteristic model and neighborhood interference spread coefficient in low-power keyboard and mouse devices, and optimizing the channel selection and switching mechanism, the problem of unreasonable channel selection in the prior art is solved, and a highly reliable and low-power communication effect is achieved.

CN123122574APending Publication Date: 2026-11-17DONGGUAN WEIJI ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611279227.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing low-power keyboard and mouse devices cannot effectively predict interference patterns in complex and ever-changing wireless environments, leading to unreasonable channel selection and a tendency to fall into vicious switching cycles. This makes it impossible to guarantee a balance between high reliability and low power consumption, especially during high-priority data transmission, where data loss is common.

Method used

By collecting historical transmission records at the receiving end, calculating the quality evaluation value using the time attenuation factor and the communication success rate, establishing an interference characteristic model, screening channels, and calculating the neighborhood interference spread coefficient by combining the intersection of concurrent packet loss between adjacent channels, constructing a working frequency hopping channel set, predicting the interference probability, and switching to an alternative channel, and using a long preamble to achieve blind transmission of high-priority data.

Benefits of technology

It improves the accuracy of channel quality assessment, reduces cascading packet loss caused by adjacent channel interference, ensures stable transmission of high-priority data, reduces power consumption overhead caused by invalid retransmissions, and enhances the device's communication anti-interference capability in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123122574A_ABST
    Figure CN123122574A_ABST
Patent Text Reader

Abstract

This invention relates to the field of frequency hopping technology, and particularly to a low-power keyboard and mouse communication method and system based on frequency hopping technology. The method includes the following steps: the receiving end constructs a channel quality model based on transmission history, calculates a channel score by combining a time attenuation factor, and adds extra weight to anti-interference channels; extracts failure time sequences from channels with low scores and packet loss, and models interference characteristics through autocorrelation; filters channels with scores exceeding a second threshold to form a candidate pool, calculates the interference spread coefficient by combining it with neighboring channel packet loss correlation, determines the security isolation degree accordingly, selects multiple channels to form a frequency hopping set, and ensures that the channel frequency spacing within the set meets the standard; before switching, verifies the interference model of the standby channel, temporarily suspends high-risk channels, and selects the best alternative from the frequency hopping set; the transmitting and receiving end negotiates a global backup channel, and switches to the backup channel when the uplink transmission failure rate exceeds the standard and there is high-priority data, transmitting data packets with a handover identifier using a lengthened preamble and repeated transmission method; the receiving end polls and identifies messages, and lowers the original uplink channel quality score.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of frequency hopping technology, and in particular to a low-power keyboard and mouse communication method and system based on frequency hopping technology. Background Technology

[0002] Low-power wireless peripherals such as keyboards and mice typically use the 2.4GHz public frequency band for data exchange. However, with the dense deployment of wireless devices in modern office and home environments, the 2.4GHz band is filled with numerous interference sources such as Wi-Fi routers, Bluetooth nodes, and microwave radiation, leading to severe congestion on the same frequency. To maintain communication in this environment, existing wireless keyboards and mice generally employ frequency hopping communication technology. In conventional control methods, the radio frequency chip mainly relies on a factory-preset fixed frequency hopping table, or simply triggers a simple channel avoidance action based on the loss of a single data packet on the current channel, attempting to avoid the currently interfered frequency band.

[0003] However, in complex and ever-changing real-world application scenarios, the aforementioned traditional control methods reveal significant limitations, specifically in the following three aspects: First, when faced with recurring interference such as that caused by Wi-Fi video streams, traditional devices lack long-term tracking records of channel availability. Because they cannot extract the temporal patterns of continuous packet loss on a specific channel and make predictions in advance, devices often fall into a vicious cycle of blindly switching to high-risk channels when interference occurs, easily leading to continuous communication interruptions.

[0004] Secondly, existing methods for selecting frequency-hopping channels neglect the physical phenomenon of electromagnetic interference spreading to surrounding frequencies. For example, a high-power Wi-Fi signal can often simultaneously overwhelm several adjacent narrowband channels used by keyboards and mice. Traditional methods simply eliminate the center frequency that directly causes the lag, without calculating the severity of the interference spreading to adjacent frequencies. This results in devices selecting operating channels that are too close together, making the entire communication network highly susceptible to widespread failure once it encounters strong radiation from neighboring frequency bands.

[0005] Furthermore, when environmental interference suddenly intensifies, or when players need to issue high-priority instantaneous commands, existing communication heavily relies on two-way handshake confirmation. Once the original channel is completely blocked by strong interference, the device has no backup channel to skip the regular handshake process. At this point, the sending end can only repeatedly send data on the faulty channel, not only wasting power but also causing critical button commands to be completely lost, greatly degrading the user experience.

[0006] In summary, the fundamental flaw of existing frequency hopping control rules lies in the severe disconnect between the fixed evaluation conditions and the dynamic changes of the real physical environment. The system cannot extract the temporal patterns of interference occurrence, nor can it quantify the degree of danger of adjacent channels being affected, and it lacks a backup blind transmission mechanism in extreme disconnection situations. Therefore, a novel communication method is urgently needed that can dynamically predict interference based on historical success records and adaptively increase the physical isolation distance between channels, thereby completely solving the balance problem between high reliability and low power consumption. Summary of the Invention

[0007] To address the challenge of balancing high reliability and low power consumption under interference, this invention provides a low-power keyboard and mouse communication method and system based on frequency hopping technology.

[0008] In a first aspect, the present invention provides a low-power keyboard and mouse communication method based on frequency hopping technology, which adopts the following technical solution: The receiving end uses a radio frequency transceiver to collect historical transmission records and calculates a quality evaluation value based on the time attenuation factor and the communication success rate; for channels with packet loss clusters, the communication failure timestamp sequence is extracted to establish an interference feature model, which reflects the temporal pattern of interference. Channels are selected based on the quality evaluation value, and the neighborhood interference spread coefficient is calculated by combining the concurrent packet loss intersection between adjacent channels. Based on this, a working frequency hopping channel set is constructed and the security isolation is adjusted so that the frequency interval between adjacent channels in the working frequency hopping channel set is greater than the security isolation. The security isolation is positively correlated with the neighborhood interference spread coefficient. The receiving end predicts the probability of interference based on the interference feature model, selects an alternative channel, and synchronizes it to the transmitting end through an acknowledgment frame to switch radio frequency parameters. When the transmitting end has high-priority data and the transmission failure rate exceeds the standard, it switches to the global backup channel and uses a long preamble to blindly transmit data packets. After the receiving end polls and captures the data, it performs a downgrade on the original channel.

[0009] This invention fundamentally changes the traditional blind frequency hopping approach by introducing real-time patterns and adjacent diffusion quantization values. On one hand, the system can predict the timing of interference in advance and, based on the frequency of simultaneous interruptions in adjacent channels, forcibly increase the physical interval between operating frequencies. This fundamentally eliminates cascading packet loss caused by strong interference spreading to surrounding frequencies. On the other hand, in extreme cases of sudden link failure, the system directly drives the underlying RF hardware to forcibly change the frequency and uses a long preamble to achieve handshaking-free forced transmission of high-priority commands. This safety net ensures the absolute arrival of keyboard and mouse control signals at the physical level, greatly reducing retransmission power consumption and operation latency in complex environments.

[0010] Preferably, the calculation of the quality evaluation value based on the time decay factor and the communication success rate includes: The cumulative number of successful handshakes and the total number of communication requests on a single physical channel within a preset time window are statistically analyzed, and the ratio of the two is calculated as the communication success rate. The historical quality evaluation value of the previous period is discounted using the time decay factor to obtain the historical discounted weight value. The communication success rate is weighted using a coefficient complementary to the time decay factor to obtain the current weight value for this period; The historical discounted weight values ​​are combined with the current weight values ​​for the current period to generate the updated quality evaluation value.

[0011] This invention utilizes a time-discounting processing method to prevent the system from misjudging good channels due to occasional momentary interference, thus enabling the evaluation results to more stably and accurately reflect the long-term availability of physical channels.

[0012] Preferred options also include: In the next evaluation cycle, if the alternative channel successfully completes communication, an anti-interference success identifier code will be inserted into the data log for the alternative channel. When calculating the quality evaluation value, for the alternative channel with an anti-interference success identifier code, a reward coefficient greater than a constant 1 is multiplied by the communication success ratio to improve its corresponding quality evaluation value.

[0013] This invention rewards channels that successfully evade interference with bonus points, encouraging the system to stay in clean channels that have been proven in practice, thus avoiding frequent and meaningless frequency switching.

[0014] Preferably, the establishment of the interference feature model includes: Calculate the time interval offset between adjacent failure time nodes in the communication failure timestamp sequence; Based on the frequency of occurrence of each time interval offset, the preceding time interval with the highest frequency is extracted as the feature periodic parameter. Based on the aforementioned characteristic periodic parameters, a probability calculation model based on physical time series is constructed as the interference characteristic model, which is used to output the probability of the channel being disturbed at future time nodes.

[0015] This invention directly extracts the actual physical cycle of interference from messy packet loss records, replacing massive and complex calculations with extremely simple periodic patterns, enabling devices to accurately avoid regular interference with very low computing power consumption.

[0016] Preferably, the calculation of the neighborhood interference spread coefficient by combining the intersection of concurrent packet loss between adjacent channels includes: Using a certain channel as a reference channel, multiple channels with frequencies adjacent to it are extracted to form the adjacent channels; Extract the concurrent packet loss intersection of the adjacent channel and the reference channel within the time window, and count the number of concurrent packet loss intersections; The ratio of the number to the total number of packet losses in the reference channel is used as the initial correlation degree. The initial correlation degrees of each of the adjacent channels are weighted and summed to determine the neighborhood interference diffusion coefficient corresponding to the reference channel.

[0017] Preferably, the adjustment of the safety isolation degree includes: Monitor whether there are any channel pairs in the working frequency hopping channel set that have failed to communicate concurrently; If it exists, then for all physical channels within the frequency range covered by the channel, a penalty amplification value is superimposed on their original neighborhood interference diffusion coefficient. Based on the neighborhood interference diffusion coefficient after superimposed penalty amplification, the baseline value of the security isolation is expanded, and some channels in the working frequency hopping channel set are removed until the frequency spacing of the remaining adjacent channels is greater than the expanded adjusted security isolation.

[0018] This invention determines that the area is experiencing outward-spreading broadband interference once it detects that two adjacent frequency points consistently lose connection simultaneously, and then forcibly requires the operating frequency points to be further apart. This physical anti-interference approach ensures that each selected channel is absolutely pure and independent.

[0019] Preferably, the selection of an alternative channel includes: Unused alternative channels are extracted from outside the working frequency hopping channel set, and the quality evaluation value and the corresponding interference probability of each alternative channel are obtained. Based on the ratio of the quality evaluation value of each candidate channel to the probability of interference, the comprehensive anti-interference score of each candidate channel is calculated. The candidate channel with the highest overall anti-interference score is selected as the alternative channel, and the number of the alternative channel is encapsulated in the confirmation frame.

[0020] Preferably, the step of controlling the radio frequency phase-locked loop to switch to a global backup channel and blindly transmitting data packets using a long preamble includes: The high-priority data is determined by parsing the application layer data header, and the transmission failure rate is determined to be excessive by combining the proportion of acknowledgment signals received within the sliding window. The RF transceiver chip at the transmitting end is driven to forcibly reset the frequency point of the RF phase-locked loop to the global backup channel; The long preamble consisting of alternating level characters is appended to the beginning of the data packet in the current buffer. The data packet with the appended long preamble is sent cyclically without waiting for an acknowledgment, and the duration of the continuous transmission is longer than the timeout period required for the receiving end to trigger the polling capture.

[0021] Preferably, after the receiving end polls and captures the signal, it performs a degradation of the original channel, including: The receiving end triggers a timer interrupt after a preset time of continuous loss of synchronization signals, and performs the polling capture. In the polling capture, the frequency of the global backup channel is scanned at a preset step value, and the receiving state is locked and the message is extracted after the long preamble is identified; After successful data parsing and verification, the number of the original channel that caused the loss of connection is extracted, and the corresponding quality evaluation value is reduced to half of the original value as a downgrade penalty.

[0022] Secondly, this invention provides a low-power keyboard and mouse communication system based on frequency hopping technology, comprising the following modules: A module is established for the receiving end to collect historical transmission records using an RF transceiver and calculate a quality evaluation value based on the time attenuation factor and the communication success rate; for channels with packet loss clusters, the timestamp sequence of communication failures is extracted to establish an interference feature model, which reflects the temporal pattern of interference. The adjustment module is used to filter channels based on the quality evaluation value, calculate the neighborhood interference spread coefficient by combining the concurrent packet loss intersection between adjacent channels, construct a working frequency hopping channel set and adjust the security isolation degree so that the frequency interval between adjacent channels in the working frequency hopping channel set is greater than the security isolation degree, and the security isolation degree is positively correlated with the neighborhood interference spread coefficient. The communication module is used by the receiving end to predict the probability of interference based on the interference feature model, select an alternative channel and synchronize it to the sending end through an acknowledgment frame to switch radio frequency parameters; when the sending end has high-priority data and the transmission failure rate exceeds the standard, it controls the radio frequency phase-locked loop to switch to the global backup channel and uses a long preamble to blindly transmit data packets, and the receiving end performs downgrading on the original channel after polling and capturing.

[0023] The present invention has the following technical effects: By combining historical transmission records and time attenuation factors to construct a channel quality assessment model, and assigning enhanced weights to alternative channels that successfully avoid interference, the accuracy of channel quality assessment is improved. For channels with abnormal packet loss, an interference characteristic model is established through autocorrelation analysis, enabling the identification of communication interference patterns. The safety isolation of adjacent channel frequency intervals is adjusted based on the neighborhood interference spread coefficient and a preset mapping coefficient, suppressing the spread of adjacent-channel interference. During frequency hopping handover, high-risk areas are avoided in advance and the optimal alternative channel is selected by utilizing interference characteristic prediction and a channel suspension mechanism. A global backup channel and a long preamble retransmission mechanism are constructed for high-priority data. Combined with a degradation penalty for the original channel, stable data transmission can still be guaranteed in a wireless environment, improving the anti-interference capability of keyboard and mouse devices and reducing power consumption caused by invalid retransmissions. Attached Figure Description

[0024] Figure 1 This is a flowchart of a low-power keyboard and mouse communication method based on frequency hopping technology provided in an embodiment of the present invention; Figure 2 A quality assessment line graph provided for embodiments of the present invention; Figure 3 The bar chart shows the performance comparison provided for the embodiments of the present invention. Detailed Implementation

[0025] This invention discloses a low-power keyboard and mouse communication method based on frequency hopping technology, referring to... Figure 1 This includes steps S1-S4: S1: The receiver maintains a channel quality assessment model based on historical transmission records. It uses a time decay factor to calculate the quality evaluation value based on the ratio of successful transmissions to the total number of attempts for each channel within the time window. It marks the alternative channel transmission events that successfully avoid interference and assigns them enhancement weights in the model. For channels with quality evaluation values ​​below the first threshold or where packet loss is time-domain clustered, it records the communication failure timestamp sequence and establishes an interference characteristic model through autocorrelation analysis.

[0026] A static random access memory (SRAM) is allocated in the receiver microcontroller to store historical transmission records in an array structure, where the transmitter is either a mouse or a keyboard. A time window size of 1000ms is set. After each time window, a sliding window algorithm is used to count the number of successfully received data packets and the total number of reception attempts for each channel. The time decay factor is implemented using an exponential moving average algorithm. The success rate within the current time window is weighted and summed with the quality evaluation value from the previous moment according to the exponential moving average formula to calculate the quality evaluation value.

[0027] If a frequency hopping retransmission occurs and data is successfully received on the new alternative channel, a hardware interrupt is triggered, and the channel number and timestamp of the alternative channel are stored in a hash table for marking. In the next calculation of the quality assessment value, for channels present in the hash table, their current time window success rate is multiplied by an enhancement weighting coefficient greater than 1 before being included in the calculation.

[0028] If the calculated quality evaluation value is lower than the set first threshold, or if K-Means clustering analysis reveals a high-density clustering of communication failure events on the time axis, then the absolute timestamp of the communication failure at that time is appended to the non-volatile memory to obtain a timestamp sequence. For the time-domain clustered timestamp sequence, the time interval offset between adjacent timestamps is calculated and a deviation distribution table is generated. The two most frequent time intervals appearing in the histogram are extracted using a histogram peak-finding algorithm, for example, the first peak at 11ms and the second peak at 22ms. These two peaks are set as characteristic period parameters. Based on the last failure time, an interference feature model is constructed using a Hidden Markov Model (HMM). The hidden state space of the HMM is defined as {interference-affected, no interference}, and the observation state space is defined as {communication failure, communication success}. The extracted characteristic period parameters and historical communication records are used to initialize the state transition probability matrix and the observation probability matrix. After the model is established, given the current observation sequence, it is input into the HMM and the forward algorithm is run to calculate the probability that the target channel is in an interference-hidden state at a specified time node in the future, thereby constructing an interference feature model that can determine the future interference tolerance range.

[0029] As one possible implementation, the calculation of the quality evaluation value using a time decay factor based on the ratio of successful transmissions within a time window to the total number of attempts for each channel includes: The cumulative number of handshake data packets that have successfully completed backhaul verification on a single physical channel within the recording time window is used as the first basic statistic. The total number of all communication requests initiated on the physical channel within the same time window is recorded synchronously and used as the second basic statistic. Calculate the ratio of the first basic statistic to the second basic statistic to obtain the basic success rate for the current period in the current time window; Multiply the historical quality evaluation value cached in the previous evaluation period by the preset time decay factor to obtain the historical discounted weight value; Then, the current period's basic success rate is multiplied by a weighting coefficient that complements the time decay factor to obtain the current period's weight value; The historical discounted weight value is added to the current weight value for the current period to generate an updated quality evaluation value.

[0030] In low-power keyboard and mouse communication systems, the firmware of the main control chip defines a sliding time window, preferably ranging from 50ms to 200ms. Taking a typical 100ms time window as an example, the RF transceiver initiates communication with a certain physical channel, such as a channel with a center frequency of 2415MHz.

[0031] The counter within the microcontroller synchronously records the total number of communication requests within this 100ms period, such as a second basic statistic of 50 requests. Simultaneously, the interrupt routine counts the number of successfully received ACK acknowledgments, such as a first basic statistic of 45 requests, at which point the basic success rate for this period is 0.90%.

[0032] A preset time decay factor is used, preferably within the range of 0.6 to 0.9. Assuming the decay factor is set to 0.8, the complementary weighting coefficient is 0.2. If the historical quality evaluation value of the channel in the previous cycle recorded in the memory is 0.95, the firmware calculation unit will multiply it by 0.8 to obtain the historical discounted weight value of 0.76, and then multiply the current period's base success rate of 0.90 by 0.2 to obtain the current period's weight value of 0.18.

[0033] Adding the two values ​​together yields an updated quality assessment value of 0.94. This calculation process runs periodically within the protocol stack, taking into account both long-term channel stability and response to sudden interference. Figure 2 As shown, the trends in baseline success rate and quality score are illustrated over 10 consecutive time windows.

[0034] As one possible implementation, the step of marking successful interference-avoiding alternative channel transmission events and assigning them enhanced weights in the model includes: The protocol stack scheduling manager identifies and confirms successful communication events that utilize alternative channels. Insert a specific length of anti-interference success identifier code into the header log of the corresponding successfully transmitted data packet, and store it in the system log library for future reference; When entering the next channel quality assessment cycle, retrieve and count the number of data packets with the anti-interference success identifier code on each channel; For alternative channels with the aforementioned anti-interference success identifier code, when calculating the quality evaluation value, a reward coefficient greater than 1 is multiplied by the base success rate to improve the evaluation score in the model.

[0035] When interference occurs on the original channel, leading to packet loss and retransmission, the protocol stack scheduling manager will schedule the system to switch to an alternative channel for retransmission. Once a correct acknowledgment frame is received on the alternative channel, for example, after switching from channel 20 to channel 45, the manager inserts a 1-byte anti-interference success identifier, such as the specific hexadecimal code 0xAA, into the control header of the memory packet transmission log and saves it to a circular buffer system log library that supports at least 1024 records.

[0036] When the channel evaluation cycle begins in the next time window, the microprocessor's background task scans the log database to count the distribution of data packets with the 0xAA identifier on each channel.

[0037] For alternative channels with this identifier, the algorithm model sets a reward coefficient, preferably ranging from 1.1 to 1.5. Assuming the reward coefficient for channel 45 is set to 1.2, and its original base success rate is 0.85, the calculation logic multiplies the two, correcting the base success rate to 1.02. Due to the success rate cap mechanism, this is truncated to a maximum score of 1.0. This strategy of assigning enhanced weights can improve the ranking of channels that perform well under electromagnetic interference and reduce peripheral latency.

[0038] As one possible implementation, the method of establishing an interference characteristic model through autocorrelation analysis for channels with quality evaluation values ​​below a first threshold or where packet loss exhibits temporal clustering, includes: Extract channels whose quality evaluation value is below the first threshold or whose packet loss is clustered in the time domain, record the time nodes of communication failure and form a communication failure timestamp sequence; Calculate the time interval offset between adjacent failure time nodes in the communication failure timestamp sequence, and generate an offset distribution table; Extract the two most frequent time intervals from the deviation distribution table as characteristic periodic parameters; The characteristic periodic parameters are used as the core reference for the system to identify specific regular interferences, and an interference characteristic model is established to predict future interference time windows.

[0039] The preset first threshold range is typically selected between 0.5 and 0.7. When the quality evaluation value of a working channel, such as channel 12, falls below the threshold set to 0.60, the firmware's system timer activates the capture function, recording the system tick of each ACK reception timeout with 1ms precision. Due to interference, continuous or intermittent packet loss may occur, resulting in a failure timestamp sequence such as [10ms, 21ms, 43ms, 54ms, 76ms]. This sequence is used to perform differential calculations on adjacent time nodes, obtaining time interval offsets of [11ms, 22ms, 11ms, 22ms], which are then filled into the histogram array of the deviation distribution table with a 1ms resolution. The two most frequent time intervals are extracted using a histogram peak-finding algorithm, such as the first peak of 11ms and the second peak of 22ms, and set as characteristic period parameters. Based on the last failure time, an interference characteristic model is established using parameter extrapolation, and the tolerance range of possible future interference is calculated and marked on the time axis to guide the receiver in implementing avoidance scheduling.

[0040] The receiver's background task extracts the timestamps of current or future frequency-hopping nodes and inputs them into the interference characteristic model of the target channel. It then calculates the probability that the channel will be in a hidden interference state at a future time by running a forward algorithm. If the predicted interference probability is higher than a preset safety threshold, the channel is marked as suspended in advance for avoidance. Simultaneously, the model predicts the interference probabilities of other candidate channels in the working channel set, divides their current quality evaluation values ​​by the predicted interference probabilities to obtain a comprehensive anti-interference score, and selects the channel with the highest score as the optimal alternative channel. The frequency-hopping update command is then synchronized to the transmitter in advance via an acknowledgment frame, achieving seamless synchronous switching between the transmitter and receiver on interference-free frequencies.

[0041] S2: Based on the quality evaluation value, select channels that are higher than the second threshold to form a candidate channel pool. Calculate the neighborhood interference spread coefficient according to the historical packet loss correlation of adjacent channels. Select multiple channels from the candidate channel pool to form a working frequency hopping channel set. Adjust the security isolation degree so that the frequency interval between adjacent channels in the set is greater than the isolation degree. The isolation degree is obtained by multiplying the neighborhood interference spread coefficient by a preset frequency mapping coefficient.

[0042] Traverse the quality evaluation values ​​of all channels in the channel quality assessment model, call the quicksort algorithm to sort the channels above the set second threshold in descending order, and store the channel numbers at the top of the list into a one-dimensional array to form a candidate channel pool.

[0043] For channels in the candidate channel pool, the ratio of the total number of intersection records of the target channel and the two adjacent channels on the physical frequency that failed to communicate concurrently within the same historical time tolerance window to the total number of communication failure records of the target channel is calculated as the preliminary correlation degree. The preliminary correlation degrees of each adjacent channel are weighted and summed to obtain the neighborhood interference diffusion coefficient of the target channel.

[0044] A fixed frequency mapping coefficient is predefined in the program's read-only memory area. For each target channel, the calculated neighborhood interference spread coefficient is multiplied by the frequency mapping coefficient using a floating-point multiplication instruction to calculate the corresponding security isolation frequency bandwidth.

[0045] When constructing the working frequency hopping channel set, an empty set structure is initialized, and a greedy algorithm is used to sequentially add channels from the head of the candidate channel pool to the set. Before each addition, the absolute value of the physical frequency difference between the channel to be added and all existing channels in the set is calculated. Only when all absolute values ​​are greater than the security isolation levels corresponding to the channel to be added and the existing channels, is the channel allowed to be pushed into the working frequency hopping channel set, until the number of channels in the set reaches the fixed number of frequency hopping points required by the communication protocol.

[0046] As one possible implementation, the step of selecting channels with quality evaluation values ​​higher than a second threshold to form a candidate channel pool, and calculating the neighborhood interference spread coefficient based on the historical packet loss correlation of adjacent channels, includes: Centered on the channel under test, a predetermined number of channels with adjacent frequencies are selected to form an adjacent channel observation group; Extract the total number of communication failure records of the channel under test within a preset time period, and use it as the denominator parameter for correlation calculation; The total number of intersection records of concurrent communication failures between each channel and the channel under test within the same time tolerance window in the adjacent channel observation group is extracted and used as the molecular parameter for correlation calculation. The ratio of the numerator parameter to the denominator parameter is used as the initial correlation degree, and the initial correlation degrees of each adjacent channel are weighted and summed to determine the neighborhood interference diffusion coefficient of the channel under test, which is used for configuring the security isolation degree.

[0047] The control algorithm sets a preset time period of the most recent 500ms, and selects two adjacent frequency points on each side of the test channel, such as channel 30 with a center frequency of 2430MHz, to form an observation group, namely channels 28, 29, 31, and 32. The total number of packet losses in the test channel within this 500ms period is extracted, for example, 20 times, and used as the denominator parameter.

[0048] A time tolerance window of ±5ms was set, and the number of intersection failures occurring simultaneously for each channel in the observation group was extracted within this window. Assume that within this tolerance window, channels 29 and 31, which are closer to the channel under test, failed to intersect 10 and 8 times respectively, while channels 28 and 32, which are farther apart, failed to intersect 2 and 3 times respectively. The initial correlation coefficients are 0.50, 0.40, 0.10, and 0.15, respectively.

[0049] A weight of 0.8 is applied to channels offset by 1 frequency point, and a weight of 0.4 is applied to channels offset by 2 frequency points. A weighted summation is performed to obtain the neighborhood interference spread coefficient: 0.82. This coefficient, which quantitatively represents the degree of cross-band energy leakage, is output to the baseband, driving the adaptive broadening of channel isolation.

[0050] As one possible implementation, the step of selecting multiple channels from the candidate channel pool to form a working frequency hopping channel set, and adjusting the security isolation to make the frequency spacing between adjacent channels within the set greater than the isolation, includes: Real-time monitoring to determine if multiple channels in the current working frequency hopping channel set experience correlated communication failures within a preset dense time window; If they exist, extract the channel pairs that have experienced correlated communication failures and identify all physical channels within their frequency intervals; A preset penalty amplification value is superimposed on the neighborhood interference diffusion coefficient of the above physical channel to globally increase the interference diffusion assessment level. Based on the increased neighborhood interference diffusion coefficient and the preset frequency mapping coefficient, the security isolation is recalculated and expanded; If the expanded security isolation level results in the candidate channel pool being unable to meet the selection requirements, the total number of channels in the working frequency hopping channel set will be adaptively reduced until the frequency interval between adjacent working channels is greater than the expanded security isolation level.

[0051] The keyboard and mouse frequency hopping engine configures the preset dense time window to 20ms. If, within this short time window, channels 20 and 24 in the frequency hopping channel set are found to be unresponsive one after another, this channel pair is marked as being affected by broadband pulse interference, and the physical channels affected between the two ends, channels 21 to 23, are identified.

[0052] The processor adds a penalty amplification value of 0.4 to the original neighborhood interference spread coefficients of the three intermediate channels. If the maximum coefficient after superposition reaches 1.2, it is multiplied by a set frequency mapping coefficient, such as 5MHz / unit coefficient, to calculate the latest security isolation of 6MHz. This means that any adjacent channels in the working channel set must be separated by at least 6 frequency points with a bandwidth of 1MHz.

[0053] When this condition causes the channels in the original 40 candidate pools to be unable to meet the standard 16 frequency hopping operating frequencies, the logic control will adaptively reduce the size of the operating frequency hopping channel set to 12 or even 8. By reducing the number of channels, the physical isolation between frequency bands is increased, thereby improving the stability of the connection link.

[0054] S3: The receiving end selects the optimal alternative channel based on the pre-prediction and synchronizes the update instruction to the sending end through the acknowledgment frame, realizing the synchronous frequency hopping handover between the sending and receiving ends at the agreed node; the sending and receiving ends negotiate the global backup channel. When the sending end has high-priority data and the uplink channel transmission failure rate is higher than the preset level, it switches to the global backup channel to perform transmission, and sends data packets with the handover identifier by adding a long preamble and / or continuous retransmission. The receiving end receives the data packets through a polling and listening mechanism and degrades the original uplink channel as a penalty.

[0055] Before the local timer triggers the next frequency hopping action, the current timestamp is read and input into the Hidden Markov Model of the target channel to run the forward algorithm, calculating the probability that the channel is currently in an interference state. If the output probability is higher than the preset risk judgment probability threshold, the status flag of the channel is set to suspended, and a delay recovery timer is started. The working frequency hopping channel set is traversed, the quality evaluation value of each channel is read, and the maximum value lookup function is called to select the channel with the highest evaluation value, which is then assigned to the frequency control register of the current RF transceiver chip as the alternative channel.

[0056] During the device pairing initialization phase, the transmitting and receiving ends write the same fixed physical frequency value into the control frame payload through a three-way handshake protocol and store it in their respective flash memory as a global backup channel.

[0057] When the memory access controller moves the data to be transmitted, the transmitting master control chip parses the application layer data header to obtain the priority field. If it is determined to be high-priority data, and at the same time, the sliding window algorithm is used to calculate that the proportion of received acknowledgment packets in the most recent 10 uplink channel transmission requests is lower than a preset threshold, the transmitting master control chip controls the RF transceiver chip to switch the RF phase-locked loop to the frequency of the global backup channel. When constructing the medium access control layer data frame, a 64-byte preamble consisting of alternating 0s and 1s is inserted into the front of the physical layer data packet, and a switching flag is set in the frame control field. The transmitting end calls the continuous transmission interface and continuously transmits the data packet without waiting for an acknowledgment, and sets the total duration of the continuous transmission to be greater than the timeout determination time required for the receiving end to trigger the polling listening mechanism, for example, continuously transmitting for 50ms, to ensure that the data packet stream can cover the listening window of the receiving end when switching to the global backup channel.

[0058] After losing two normal frequency hopping synchronization frames in succession, the receiver triggers a timer interrupt, changes the working mode of the RF transceiver chip, enters the polling listening mechanism, periodically scans the global backup channel frequency according to a preset step value, and locks the receiving channel after recognizing a long preamble signal to extract data packets with switching identifiers.

[0059] After successful data parsing, the receiving end performs an update operation, halving the quality evaluation value of the original uplink channel in the channel quality assessment model where packet loss occurred, thus completing the degradation penalty.

[0060] As one possible implementation, the receiving end selects the optimal alternative channel based on pre-prediction and synchronizes the update command to the sending end through an acknowledgment frame, thereby achieving synchronous frequency hopping handover between the transmitting and receiving parties at the agreed node, including: The receiver's background task periodically calls the interference characteristic model of each channel to query whether future frequency hopping nodes will fall into the predicted high-risk area. If it is determined that a certain channel to be used will exceed the safety threshold in the future, it will be marked as pending. The current quality evaluation value and predicted interference probability of the remaining unsuspended alternative channels in the working frequency hopping channel set are extracted in parallel. Divide the quality evaluation value of each candidate channel by the predicted interference probability to calculate the comprehensive anti-interference score of each candidate channel. Select the candidate channel with the highest comprehensive anti-interference score as the alternative channel, and generate a frequency hopping update command containing the source standby channel number, the alternative channel number, and the effective frequency hopping sequence number; When the receiving end replies with an acknowledgment frame at the current normal physical frequency point, it encapsulates the frequency hopping update instruction in the MAC layer control header and sends it to the transmitting end. When the frequency hopping counter reaches the effective frequency hopping sequence number, both the transmitting and receiving ends synchronously switch the radio frequency transceiver parameters to the alternative channel to complete data transmission.

[0061] To ensure synchronization of the transmit and receive links at the physical layer, the timing scheduler employs a pre-negotiation mechanism that advances one or more frequency hopping cycles. The receiver's backend algorithm pre-reads the target standby channel to be switched, such as the interference characteristic model of channel 15. If it is estimated that when it is channel 15's turn to communicate, it will be within the 10ms risk range of interference, exceeding the safety threshold, the scheduler will lock channel 15 as the avoidance target in advance.

[0062] In the background computation of the current cycle, the parameters of the remaining 7 candidate channels in the working set are read in parallel. If the quality evaluation value of candidate channel 40 is 0.90 and its predicted interference probability is 0.10, the overall score is 9.0; while the quality value of channel 55 is 0.95 but its interference probability is 0.25, and the score is 3.8. The comparison shows that the highest score is for channel 40. After the receiver successfully receives the data packet from the transmitter on the current normal communication channel, such as channel 12, it writes a specific instruction in the extended header of the returned ACK confirmation frame: when the frequency hopping counter reaches N, the original channel 15 is changed to channel 40. After the transmitter's main control chip parses and confirms the instruction, it updates the local frequency hopping mapping table. When the global frequency hopping counters of both the transmitter and receiver synchronously reach node N, the baseband chip registers of both sides simultaneously receive the instruction to change the PLL phase-locked loop frequency division parameters, completing the coordinated switching of the hardware center frequency point to channel 40. This avoids the link disconnection caused by single-end switching, enabling the wireless keyboard and mouse to maintain a polling rate of 1000Hz in noisy environments.

[0063] Wireless keyboard and mouse communication was tested in a congested office environment on the 2.4GHz band. Five routers running at full load and three Bluetooth audio devices were deployed in the environment to create broadband pulse interference and periodic interference. The test device was a low-power wireless mouse supporting a 1000Hz polling rate, with a radio frequency center frequency between 2400MHz and 2483.5MHz. The comparison group consisted of a basic adaptive frequency hopping scheme and this application applying a complete adaptive anti-interference frequency hopping algorithm. The test duration for both was 1 hour, and the communication distance was set to 5 meters.

[0064] The basic scheme initiated 3.6 million communication requests during testing, successfully receiving 3.168 million acknowledgment packets, with an average packet loss rate of 12% and an average communication latency of 4.5ms. During network beacon frame bursts, delays exceeding 20ms occurred multiple times. Under the same conditions, this application also initiated 3.6 million communication requests. Through an interference characteristic model, it successfully predicted and avoided 86,000 periodic interferences in advance. It also adaptively reduced the number of working frequency-hopping channels from 16 to 12 using the neighborhood interference diffusion coefficient and increased the security isolation to 6MHz. This application successfully received 3.564 million acknowledgment packets, reducing the average packet loss rate to 1%, stabilizing the average communication latency at 1.2ms, and with the maximum latency jitter not exceeding 3ms. A comparison of the core performance indicators of the basic scheme and this invention is provided below. Figure 3 As shown, the optimization effect of this application on both packet loss rate and latency is presented.

[0065] This application reduces packet loss rate by 11 percentage points and average communication latency by 73.3%. By establishing an interference characteristic model and extracting time interval offsets, the system has the ability to predict future interference time windows, reducing channel collisions and unnecessary retransmissions. The adjustment mechanism of neighborhood interference spread coefficient and security isolation reduces correlated communication failures caused by energy leakage in adjacent frequency bands, and the comprehensive anti-interference scoring mechanism ensures the selection of the optimal alternative channel, guaranteeing high stability and low latency response of the equipment in harsh wireless environments.

[0066] In the second embodiment, the present invention also proposes a low-power keyboard and mouse communication system based on frequency hopping technology, comprising the following modules: A module is established for the receiving end to collect historical transmission records using an RF transceiver and calculate a quality evaluation value based on the time attenuation factor and the communication success rate; for channels with packet loss clusters, the timestamp sequence of communication failures is extracted to establish an interference feature model, which reflects the temporal pattern of interference. The adjustment module is used to filter channels based on the quality evaluation value, calculate the neighborhood interference spread coefficient by combining the concurrent packet loss intersection between adjacent channels, construct a working frequency hopping channel set and adjust the security isolation degree so that the frequency interval between adjacent channels in the working frequency hopping channel set is greater than the security isolation degree, and the security isolation degree is positively correlated with the neighborhood interference spread coefficient. The communication module is used by the receiving end to predict the probability of interference based on the interference feature model, select an alternative channel and synchronize it to the sending end through an acknowledgment frame to switch radio frequency parameters; when the sending end has high-priority data and the transmission failure rate exceeds the standard, it controls the radio frequency phase-locked loop to switch to the global backup channel and uses a long preamble to blindly transmit data packets, and the receiving end performs downgrading on the original channel after polling and capturing.

Claims

1. A low-power keyboard and mouse communication method based on frequency hopping technology, characterized in that, include: The receiving end uses a radio frequency transceiver to collect historical transmission records and calculates a quality evaluation value based on the time attenuation factor and the communication success rate; for channels with packet loss clusters, the communication failure timestamp sequence is extracted to establish an interference feature model, which reflects the temporal pattern of interference. Channels are selected based on the quality evaluation value, and the neighborhood interference spread coefficient is calculated by combining the concurrent packet loss intersection between adjacent channels. Based on this, a working frequency hopping channel set is constructed and the security isolation is adjusted so that the frequency interval between adjacent channels in the working frequency hopping channel set is greater than the security isolation. The security isolation is positively correlated with the neighborhood interference spread coefficient. The receiving end predicts the probability of interference based on the interference feature model, selects an alternative channel, and synchronizes it to the transmitting end through an acknowledgment frame to switch radio frequency parameters. When the transmitting end has high-priority data and the transmission failure rate exceeds the standard, it switches to the global backup channel and uses a long preamble to blindly transmit data packets. After the receiving end polls and captures the data, it performs a downgrade on the original channel.

2. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 1, characterized in that, The calculation of the quality evaluation value based on the time decay factor and the communication success rate includes: The cumulative number of successful handshakes and the total number of communication requests on a single physical channel within a preset time window are statistically analyzed, and the ratio of the two is calculated as the communication success rate. The historical quality evaluation value of the previous period is discounted using the time decay factor to obtain the historical discounted weight value. The communication success rate is weighted using a coefficient complementary to the time decay factor to obtain the current weight value for this period; The historical discounted weight values ​​are combined with the current weight values ​​for the current period to generate the updated quality evaluation value.

3. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 2, characterized in that, Also includes: In the next evaluation cycle, if the alternative channel successfully completes communication, an anti-interference success identifier code will be inserted into the data log for the alternative channel. When calculating the quality evaluation value, for the alternative channel with an anti-interference success identifier code, a reward coefficient greater than a constant 1 is multiplied by the communication success ratio to improve its corresponding quality evaluation value.

4. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 1, characterized in that, The establishment of the interference feature model includes: Calculate the time interval offset between adjacent failure time nodes in the communication failure timestamp sequence; Based on the frequency of occurrence of each time interval offset, the preceding time interval with the highest frequency is extracted as the feature periodic parameter. Based on the aforementioned characteristic periodic parameters, a probability calculation model based on physical time series is constructed as the interference characteristic model, which is used to output the probability of the channel being disturbed at future time nodes.

5. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 1, characterized in that, The calculation of the neighborhood interference spread coefficient by combining the intersection of concurrent packet loss between adjacent channels includes: Using a certain channel as a reference channel, multiple channels with frequencies adjacent to it are extracted to form the adjacent channels; Extract the concurrent packet loss intersection of the adjacent channel and the reference channel within the time window, and count the number of concurrent packet loss intersections; The ratio of the number to the total number of packet losses in the reference channel is used as the initial correlation degree. The initial correlation degrees of each of the adjacent channels are weighted and summed to determine the neighborhood interference diffusion coefficient corresponding to the reference channel.

6. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 5, characterized in that, The adjustment of the security isolation degree includes: Monitor whether there are any channel pairs in the working frequency hopping channel set that have failed to communicate concurrently; If it exists, then for all physical channels within the frequency range covered by the channel, a penalty amplification value is superimposed on their original neighborhood interference diffusion coefficient. Based on the neighborhood interference diffusion coefficient after superimposed penalty amplification, the baseline value of the security isolation is expanded, and some channels in the working frequency hopping channel set are removed until the frequency spacing of the remaining adjacent channels is greater than the expanded adjusted security isolation.

7. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 1, characterized in that, The selection of alternative channels includes: Unused alternative channels are extracted from outside the working frequency hopping channel set, and the quality evaluation value and the corresponding interference probability of each alternative channel are obtained. Based on the ratio of the quality evaluation value of each candidate channel to the probability of interference, the comprehensive anti-interference score of each candidate channel is calculated. The candidate channel with the highest overall anti-interference score is selected as the alternative channel, and the number of the alternative channel is encapsulated in the confirmation frame.

8. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 1, characterized in that, The control of the radio frequency phase-locked loop switching to the global backup channel and blindly transmitting data packets using a long preamble includes: The high-priority data is determined by parsing the application layer data header, and the transmission failure rate is determined to be excessive by combining the proportion of acknowledgment signals received within the sliding window. The RF transceiver chip at the transmitting end is driven to forcibly reset the frequency point of the RF phase-locked loop to the global backup channel; The long preamble consisting of alternating level characters is appended to the beginning of the data packet in the current buffer. The data packet with the appended long preamble is sent cyclically without waiting for an acknowledgment, and the duration of the continuous transmission is longer than the timeout period required for the receiving end to trigger the polling capture.

9. The low-power keyboard and mouse communication method based on frequency hopping technology according to claim 1, characterized in that, After the receiving end polls and captures the data, it performs a downgrade on the original channel, including: The receiving end triggers a timer interrupt after a preset time of continuous loss of synchronization signals, and performs the polling capture. In the polling capture, the frequency of the global backup channel is scanned at a preset step value, and the receiving state is locked and the message is extracted after the long preamble is identified; After successful data parsing and verification, the number of the original channel that caused the loss of connection is extracted, and the corresponding quality evaluation value is reduced to half of the original value as a downgrade penalty.

10. A low-power keyboard and mouse communication system based on frequency hopping technology, characterized in that, Includes the following modules: A module is established for the receiving end to collect historical transmission records using an RF transceiver and calculate a quality evaluation value based on the time attenuation factor and the communication success rate; for channels with packet loss clusters, the timestamp sequence of communication failures is extracted to establish an interference feature model, which reflects the temporal pattern of interference. The adjustment module is used to filter channels based on the quality evaluation value and calculate the neighborhood interference spread coefficient by combining the concurrent packet loss intersection between adjacent channels; Based on this, a working frequency hopping channel set is constructed and the security isolation is adjusted so that the frequency interval between adjacent channels in the working frequency hopping channel set is greater than the security isolation. The security isolation is positively correlated with the neighborhood interference diffusion coefficient. The communication module is used by the receiving end to predict the probability of interference based on the interference feature model, select an alternative channel and synchronize it to the sending end through an acknowledgment frame to switch radio frequency parameters; when the sending end has high-priority data and the transmission failure rate exceeds the standard, it controls the radio frequency phase-locked loop to switch to the global backup channel and uses a long preamble to blindly transmit data packets, and the receiving end performs downgrading on the original channel after polling and capturing.