A multifunctional leather sheath keyboard wireless connection control method and system
By constructing an interference source distribution map and a multi-protocol switching table, the wireless connection of the multi-functional leather keyboard was optimized, solving the dynamic balance problem between connection stability and operation smoothness in complex environments, and improving the anti-interference capability and stability of the wireless connection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MINGHONG INTELLIGENT MANUFACTURING TECHNOLOGY CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies cannot achieve a dynamic balance between connection stability and operational smoothness of multi-functional leather keyboards in complex and ever-changing wireless environments, resulting in weak anti-interference capabilities of wireless connections.
By acquiring keyboard monitoring data for preprocessing and visualization, an interference source distribution map is constructed, frequency band priorities are divided, the weight value of the highest interference frequency band is calculated, environmental noise data is acquired for feature extraction and interference source type matching, a multi-protocol switching table is generated, the switching response speed is calculated, connection parameters are adjusted, and communication protocols are optimized to achieve a dynamic balance between connection stability and operational smoothness.
It achieves precise location and quantification of interference sources, improves the anti-interference capability of wireless connection, ensures connection stability and smooth operation in complex environments, solves the problems of lagging connection status perception and blind switching of multiple protocols in existing technologies, and ensures dynamic iterative optimization of connection configuration.
Smart Images

Figure CN122120810A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless communication technology, and in particular to a method and system for wireless connection control of a multifunctional leather keyboard. Background Technology
[0002] With the advancement of wireless communication and wireless networking technologies, how to achieve stable wireless control of multi-functional leather keyboard cases has become a key focus of the industry.
[0003] In existing technologies, the wireless connection of multi-functional leather keyboards typically employs a fixed communication protocol or a simple channel switching strategy, maintaining the connection based on the collected basic signal strength parameters to ensure basic communication needs. However, in complex wireless environments with multiple devices coexisting, such as offices and homes, existing technologies lack monitoring of signal strength distribution, spatial interference density, and correlation analysis of multiple signals. This makes it difficult to effectively separate interfering signals from the keyboard's valid signals, leading to problems such as delayed connection response and data packet loss in scenarios with overlapping signals from multiple devices.
[0004] Therefore, existing technologies lack dynamic perception of connection status, accurate modeling of interference sources, and scientific decision-making for multi-protocol switching. As a result, they cannot achieve a dynamic balance between connection stability and smooth operation in complex and ever-changing wireless environments, leading to the problem of weak anti-interference capability of multi-functional leather keyboards. Summary of the Invention
[0005] This invention provides a wireless connection control method and system for a multi-functional leather keyboard to solve the technical problem that existing technologies cannot achieve a dynamic balance between connection stability and smooth operation in complex and ever-changing wireless environments, resulting in weak anti-interference capabilities of the multi-functional leather keyboard.
[0006] In a first aspect, to solve the above-mentioned technical problems, the present invention provides a wireless connection control method for a multifunctional leather keyboard case, comprising: Acquire keyboard monitoring data, preprocess and visualize the keyboard monitoring data, and construct an interference source distribution map; Based on the interference source distribution map, frequency band priorities are divided, and the weight value of the highest interference frequency band is calculated based on the frequency band priorities. When the weight value of the highest interference frequency band exceeds a preset threshold, environmental noise data is acquired and features are extracted and interference source type is matched to obtain the degree of environmental noise impact. Based on the degree of environmental noise impact, a preset link quality mapping table is queried to obtain the stability index. Based on the stability index, a preset wireless communication protocol is matched to generate a multi-protocol switching table. The multi-protocol switching table is sorted and the optimal option is selected to obtain the basis for the optimal path selection. The system acquires environmental dynamic factors and connection recovery strength. Based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, it calculates the handover response speed. When the handover response speed exceeds a preset threshold, it extracts the target protocol from the multi-protocol handover table based on the connection recovery strength. It then combines the target protocol with the handover response speed to obtain a protocol handover decision. Calculate connection adjustment parameters based on the protocol switching decision, inject the connection adjustment parameters into the underlying communication driver for reconstruction, and obtain the connection optimization configuration. Based on the connection optimization configuration, the preset keyboard connection settings are updated to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, candidate communication frequency bands are re-selected and protocol matching is performed to determine the final connection scheme.
[0007] Preferably, the step of acquiring keyboard monitoring data, preprocessing and visualizing the keyboard monitoring data, and constructing an interference source distribution map includes: The keyboard monitoring data is time-domain synchronized and blind source separated to generate a time-series sampling sequence; Power spectral density analysis is performed on the time-series sampling sequence to obtain instantaneous signal intensity values. The instantaneous signal intensity values are then mapped to coordinate points on a preset two-dimensional grid to construct a signal intensity distribution matrix. The signal-to-noise ratio and spatial interference weights are calculated based on the signal strength distribution matrix, and the coordinate points of the preset two-dimensional grid are weighted to generate the spatial interference density. Density region data is extracted from the spatial interference density to generate a source location vector. The source location vector and the signal strength distribution matrix are then fused to construct an interference source distribution map.
[0008] Preferably, the step of dividing frequency bands into priorities based on the interference source distribution map and calculating the weight value of the highest interference frequency band based on the frequency band priorities includes: The interference source distribution map is analyzed to generate a carrier frequency set and signal overlap data; Perform time-frequency domain joint analysis on the signal overlap data to generate a conflict energy spectrum, and statistically analyze the conflict energy spectrum to obtain the spectrum occupancy ratio and interference duration. The spectrum occupancy ratio and the interference duration are input into a pre-trained weighted sorting model to obtain interference weight values. The carrier frequency set is then sorted according to the magnitude of the interference weight values to divide the frequency band priority. Based on the frequency band priority, the frequency band interval with the largest interference weight value is extracted to determine the highest interference frequency band weight value.
[0009] Preferably, the step of acquiring environmental noise data and performing feature extraction and interference source type matching to obtain the degree of environmental noise impact includes: Discretize the environmental noise data to extract noise fluctuation feature vectors; The noise fluctuation feature vector is compared with a preset interference source feature matching library, and the matching degree is calculated. The degree of environmental noise impact is obtained by weighting the matching degree and the noise fluctuation feature vector according to preset weights.
[0010] Preferably, the step of sorting and filtering the multi-protocol switching table to obtain the optimal path selection criteria includes: For each switching option in the multi-protocol switching table, the round-trip delay difference and the packet loss rate are calculated to obtain the connection latency change rate and data packet loss rate corresponding to each switching option; The multi-protocol switching table is sorted according to the connection latency change rate and the data packet loss rate to generate a sorted switching table; The connection latency change rate and the data packet loss rate corresponding to the first element of the sorting and switching table are used as the basis for optimal path selection.
[0011] Preferably, the step of obtaining environmental dynamic factors and connection recovery strength, and calculating the handover response speed based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, includes: The interference signal waveform is collected, feature parameters are extracted from the interference signal waveform, and the feature parameters are weighted according to preset weights to obtain the environmental dynamic factor; The reconnection success rate, reconnection delay duration, and reconnection stability in the historical protocol switching records are statistically analyzed, and the connection recovery strength is obtained through weighted calculation. Based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, a composite state feature vector is constructed. A noise intensity coefficient is calculated based on the environmental noise data. The noise intensity coefficient is then used to weight and correct the composite state feature vector to obtain a noise-corrected state matrix. The noise-corrected state matrix is input into the pre-trained time series analysis model to obtain the switching response speed.
[0012] Preferably, the step of calculating connection adjustment parameters based on the protocol switching decision, injecting the connection adjustment parameters into the underlying communication driver for reconstruction, and obtaining the connection optimization configuration includes: The protocol switching decision is analyzed, the adaptive channel range of the target protocol is extracted, the surrounding signal interference spectrum is obtained based on the adaptive channel range, the frequency domain fluctuation amplitude of the surrounding signal interference spectrum is extracted, and a real-time feature sequence is generated. Align the real-time feature sequence with the data packet loss rate and switching response speed, calculate the deviation gradient, and determine the connection adjustment parameters.
[0013] Preferably, the step of updating the preset keyboard connection settings according to the connection optimization configuration to obtain optimized connection stability, and when the optimized connection stability is lower than a preset threshold, re-screening candidate communication frequency bands and performing protocol matching to determine the final connection scheme includes: The connection optimization configuration is analyzed to obtain the channel hopping sequence and transmit power gain. The preset keyboard connection settings are updated according to the channel hopping sequence and transmit power gain to obtain the updated connection settings. Based on the updated connection settings, the coverage area of the connection signal is parsed, weak signal areas are identified, a weak signal area ratio and a set of recovery performance indicators are generated, and the weak signal area ratio and the set of recovery performance indicators are weighted and calculated to obtain the optimized connection stability. When the optimized connection stability is lower than the preset stability threshold, the radio frequency sensor array is triggered to scan and obtain a signal heat map. The signal heat map is analyzed to obtain a new spatial interference density, and the new spatial interference density is mapped to a preset frequency band priority list to obtain candidate communication frequency bands. The candidate communication frequency bands are matched with a preset minimum interference protocol, and the carrier frequency and modulation method are determined according to the preset minimum interference protocol to obtain the final connection scheme.
[0014] Secondly, the present invention provides a multifunctional wireless connection control system for a leather keyboard case, comprising: An interference feature construction module is used to acquire keyboard monitoring data, preprocess and visualize the keyboard monitoring data, and construct an interference source distribution map. The frequency band evaluation module is used to divide the frequency band priority according to the interference source distribution map, and calculate the weight value of the highest interference frequency band according to the frequency band priority; The stability index generation module is used to acquire environmental noise data and perform feature extraction and interference source type matching when the weight value of the highest interference frequency band exceeds a preset threshold, to obtain the degree of environmental noise impact, and to query a preset link quality mapping table based on the degree of environmental noise impact to obtain the stability index. The optimal path determination module is used to match a preset wireless communication protocol according to the stability index, generate a multi-protocol switching table, sort the multi-protocol switching table and filter the optimal option to obtain the basis for optimal path selection. The protocol switching decision generation module is used to obtain environmental dynamic factors and connection recovery strength, calculate the switching response speed based on the optimal path selection criteria, the environmental dynamic factors and the connection recovery strength, and when the switching response speed exceeds a preset threshold, extract the target protocol from the multi-protocol switching table based on the connection recovery strength, and combine the target protocol with the switching response speed to obtain the protocol switching decision. The connection optimization configuration generation module is used to calculate connection adjustment parameters according to the protocol switching decision, inject the connection adjustment parameters into the underlying communication driver for reconstruction, and obtain the connection optimization configuration. The closed-loop optimization module is used to update the preset keyboard connection settings according to the connection optimization configuration to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, candidate communication frequency bands are re-selected and protocol matching is performed to determine the final connection scheme.
[0015] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention performs time-domain synchronization, blind source separation and power spectral density analysis on keyboard monitoring data to generate an interference source distribution map. It also calculates the spectrum occupancy ratio and interference duration through joint time-frequency domain analysis, quantifies the weight of the highest interference frequency band, solves the problem that existing technologies cannot identify interference sources and quantify the degree of interference, realizes interference source location and interference level quantification, and improves the pertinence and accuracy of anti-interference connection adjustment.
[0016] (2) The present invention performs discretization feature extraction on environmental noise data, compares it with the preset interference source feature matching library to obtain the degree of noise impact, determines the stability index by combining the link quality mapping table, and then matches the wireless communication protocol based on the index, generates and filters the optimal option of the multi-protocol switching table, solves the problems of lagging connection status perception and blind multi-protocol switching in the prior art, realizes dynamic monitoring of connection status, and improves the stability and adaptability of wireless connection.
[0017] (3) This invention collects interference signal waveforms, extracts feature parameters to calculate environmental dynamic factors, statistically analyzes historical handover records to obtain connection recovery strength, integrates the optimal path selection criteria to construct a composite state feature vector, calculates the handover response speed after noise correction, and generates protocol handover decisions. This solves the problems of delayed handover response and unreasonable decision-making in existing technologies, ensures that handover does not interrupt user operations, and balances connection stability and operation smoothness.
[0018] (4) The present invention analyzes the protocol switching decision to calculate the connection adjustment parameters, injects the underlying communication driver to reconstruct the optimized configuration, and combines closed-loop optimization. When the optimized connection stability does not meet the standard, the candidate frequency band is re-selected and the minimum interference protocol is matched. This solves the problem that the existing technology has no closed-loop optimization and the connection stability cannot be continuously guaranteed. It realizes dynamic iterative optimization of connection configuration and improves the long-term reliability of wireless connection in complex environments. Attached Figure Description
[0019] Figure 1 This is a schematic flowchart of a wireless connection control method for a multifunctional leather keyboard provided in the first embodiment of the present invention; Figure 2 This is a schematic diagram of a multifunctional leather keyboard wireless connection control system provided in the second embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Reference Figure 1 The first embodiment of the present invention provides a wireless connection control method for a multifunctional leather keyboard case, comprising the following steps: S11, acquire keyboard monitoring data, preprocess and visualize the keyboard monitoring data, and construct an interference source distribution map; S12, according to the interference source distribution map, divide the frequency band priority, and calculate the weight value of the highest interference frequency band according to the frequency band priority; S13, when the weight value of the highest interference frequency band exceeds a preset threshold, acquire environmental noise data and perform feature extraction and interference source type matching to obtain the degree of environmental noise impact. Based on the degree of environmental noise impact, query the preset link quality mapping table to obtain the stability index. S14, Match the preset wireless communication protocol according to the stability index, generate a multi-protocol switching table, sort the multi-protocol switching table and filter the optimal option to obtain the optimal path selection basis; S15, obtain the environmental dynamic factors and connection recovery strength, calculate the handover response speed based on the optimal path selection criteria, the environmental dynamic factors and the connection recovery strength, and when the handover response speed exceeds a preset threshold, extract the target protocol from the multi-protocol handover table based on the connection recovery strength, and combine the target protocol with the handover response speed to obtain the protocol handover decision; S16, calculate connection adjustment parameters according to the protocol switching decision, inject the connection adjustment parameters into the underlying communication driver for reconstruction, and obtain the connection optimization configuration; S17. Based on the connection optimization configuration, update the preset keyboard connection settings to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, re-select candidate communication frequency bands and perform protocol matching to determine the final connection scheme.
[0022] In step S11, keyboard monitoring data is acquired, and the keyboard monitoring data is preprocessed and visualized to construct an interference source distribution map, including: Acquire keyboard monitoring data, perform time-domain synchronization and blind source separation on the keyboard monitoring data, and generate a time-series sampling sequence; Power spectral density analysis is performed on the time-series sampling sequence to obtain instantaneous signal intensity values. The instantaneous signal intensity values are then mapped to coordinate points on a preset two-dimensional grid to construct a signal intensity distribution matrix. The signal-to-noise ratio and spatial interference weights are calculated based on the signal strength distribution matrix, and the coordinate points of the preset two-dimensional grid are weighted to generate the spatial interference density. Density region data is extracted from the spatial interference density to generate a source location vector. The source location vector and the signal strength distribution matrix are then fused to construct an interference source distribution map.
[0023] It should be noted that the keyboard monitoring data consists of radio frequency (RF) data from the wireless keyboard communication band and radiation data from surrounding devices, captured by an RF sniffing device. Time-domain synchronization aligns the start times of each signal. Blind source separation uses independent component analysis to separate the frequency-hopping envelope of the RF data from interference signals radiated by surrounding devices, thereby generating a time-series sampling sequence. This time-series sampling sequence includes amplitude variation data of the keyboard frequency-hopping envelope and signal sampling time data. Power spectral density analysis specifically employs the short-time Fourier transform method, processing the time-series sampling sequence with a 10-millisecond window and a 50% overlap rate to obtain the instantaneous power distribution. The actual power values at corresponding frequency points are extracted, and the instantaneous signal strength value in dBm is obtained based on the power-signal strength matching table built into the RF sniffing device.
[0024] The mapping of instantaneous signal strength values involves filling the corresponding coordinate points of a two-dimensional grid with the instantaneous signal strength value at each spatial location. The pre-defined two-dimensional grid is centered on the keyboard, with a side length of 50 cm. The keyboard is the origin, the X-axis is horizontal, and the Y-axis is vertical. Coordinate points are arranged at 10 cm intervals, forming an 11×11 coordinate point array. Each coordinate point corresponds to a unique (X, Y) coordinate. The grid side length is determined based on the operating range of common keyboard usage scenarios such as offices and homes, ensuring that the grid completely covers the main radiation area of the keyboard signal. The signal strength distribution matrix is 11 rows and 11 columns. The rows of the matrix correspond to the horizontal coordinates of the grid, and the columns correspond to the vertical coordinates. The parameters within the matrix are the instantaneous signal strength values corresponding to each grid coordinate point.
[0025] It's worth noting that the signal-to-noise ratio (SNR) is the difference between the instantaneous signal strength at each grid coordinate point in the signal strength distribution matrix and the background noise intensity at that coordinate point. The background noise intensity is determined by averaging the environmental noise data collected when there is no keyboard signal. Spatial interference weights are assigned based on the SNR of each grid: grids with an SNR greater than or equal to 15 dB have a spatial interference weight of 0.9, those with an SNR less than or equal to 5 dB have a weight of 0.3, and those with an SNR greater than 5 dB but less than 15 dB have a weight of 0.6. The weighted signal strength of each grid is obtained by multiplying its corresponding instantaneous signal strength by its spatial interference weight. The weighted signal strengths of all grids are then sorted in coordinate order to obtain the spatial interference density. Data from the spatial interference density that has a signal strength exceeding a threshold of -55 dBm is selected. This threshold is determined based on experimental statistics. Tests in various scenarios, including office and home environments, showed that when the keyboard signal strength is below -55 dBm, the packet loss rate exceeds 15%, resulting in communication failure; above this value, stable transmission is possible. Source location vectors are generated by extracting location and intensity data from density region data, pointing to the spatial location of potential interference sources. The fusion of source location vectors and the signal intensity distribution matrix involves marking the location of the interference source corresponding to each source location vector at the corresponding coordinates in the signal intensity distribution matrix. The interference source distribution map is constructed by presenting the fused signal intensity distribution matrix data in a thermal color format, where red corresponds to high interference areas and green to low interference areas, thus identifying high interference areas and potential interference sources.
[0026] For example, when using a 2.4GHz wireless keyboard in an office environment, radio frequency (RF) data of its frequency-hopping communication is captured, while radiated signals from nearby devices such as WiFi routers, Bluetooth mice, and microwave ovens are recorded. The RF data and radiated signals from surrounding devices are synchronized, aligned, and blind-source separated to obtain a time-series sampling sequence. Power spectral density analysis is performed on the time-series sampling sequence to obtain instantaneous signal strength values. The signal strength values within each time window are mapped onto a two-dimensional grid with the keyboard as the origin and a side length of 50 cm. This grid has the X-axis horizontally and the Y-axis vertically, with coordinate points spaced at 10 cm intervals to form an 11×11 coordinate point array. Each coordinate point corresponds to a unique (X,Y) coordinate. For example, the array center coordinates (0,0) correspond to the grid center point with a signal strength of -45 dBm, and the signal strength of adjacent coordinate points decreases to -62 dBm, thus constructing an 11-row, 11-column signal strength distribution matrix.
[0027] The signal-to-noise ratio (SNR) parameter for each grid is calculated based on an 11x11 signal strength distribution matrix. For example, the grid center (0,0) corresponds to an instantaneous signal strength of -45dBm and a background noise level of -60dBm, resulting in an SNR of 15dB. The grid near the WiFi access point (+20,0) corresponds to an instantaneous signal strength of -60dBm and a background noise level of -65dBm, resulting in an SNR of 5dB. Spatial interference weights are also introduced. The 3x3 area at the center of rows 5-7 and columns 5-7 of the matrix has an SNR greater than or equal to 15dB, so the weight of this area is set to 0.9. The background noise of the grid near the WiFi access point increases, resulting in an SNR less than or equal to 5dB, so the weight of this area is reduced to 0.3.
[0028] The grid points are weighted, for example, the central grid is -45dBm × 0.9 = -40.5dBm, and the grid near WiFi is -60dBm × 0.3 = -18dBm. This weighting generates a spatial interference density, where high-value areas indicate significant interference threatening keyboard communication, while low-value areas are relatively clean. Connected high-density areas with intensity exceeding the threshold of -55dBm are extracted from the spatial interference density. Location and intensity data are extracted from these high-density areas to generate source location vectors. For example, one vector corresponds to coordinates (+30, 0), pointing towards the 2.4GHz wireless camera on the right bookshelf, and another vector corresponds to coordinates (0, -20), pointing towards the Bluetooth adapter under the desktop. The source location vectors are fused with the original 11x11 signal strength distribution matrix to construct a spatial distribution feature map of interference sources within a specific office desktop. This feature map is presented using thermal colors, with red high-interference areas concentrated near the wireless camera and router, and green low-interference areas located directly in front of the keyboard.
[0029] In step S12, frequency band priorities are assigned based on the interference source distribution map, and the weight value of the highest interference frequency band is calculated based on the frequency band priorities, including: The interference source distribution map is analyzed to generate a carrier frequency set and signal overlap data; Perform time-frequency domain joint analysis on the signal overlap data to generate a conflict energy spectrum, and statistically analyze the conflict energy spectrum to obtain the spectrum occupancy ratio and interference duration. The spectrum occupancy ratio and the interference duration are input into a pre-trained weighted sorting model to obtain interference weight values. The carrier frequency set is then sorted according to the magnitude of the interference weight values to divide the frequency band priority. Based on the frequency band priority, the frequency band interval with the largest interference weight value is extracted to determine the highest interference frequency band weight value.
[0030] It should be noted that the process begins by identifying high-interference areas in the image and extracting their signal strength data. Then, a Fast Fourier Transform (FFT) is used to scan the signal peaks within each time segment, collecting all occurrences of frequency points and integrating them to form a carrier frequency set. Frequency points containing both keyboard signals and interfering device signals are selected, and their location and intensity data are integrated to generate signal overlap data. When performing joint time-frequency domain analysis on the signal overlap data, a Short Time Fourier Transform (SFT) method is used with a 10-millisecond window and a 50% overlap rate to convert the signals into frequency domain energy data. The energy value of each time-frequency unit is obtained, and these values are arranged according to frequency and time dimensions to generate a conflict energy spectrum.
[0031] When analyzing the conflict energy spectrum, the preset observation window duration is 5 seconds, and the preset conflict energy threshold is -50dBm. This threshold is determined based on experimental statistics. After testing in multiple scenarios, when the conflict energy is below -50dBm, the packet loss rate of keyboard communication is greater than 15%. For each frequency band, the percentage of time with signal energy in that band within the 5-second observation window is calculated; this percentage is the spectrum occupancy ratio. The cumulative duration of the frequency band energy value exceeding -50dBm within the observation window is also calculated, and the proportion of this cumulative duration to the total 5-second duration is the interference duration.
[0032] It is worth noting that the training process of the pre-trained weighted ranking model uses historical spectrum occupancy ratio data and historical interference duration data in multiple scenarios such as office and home as input, and uses the manually labeled historical comprehensive interference weight values in the corresponding scenarios as output to perform linear weighted training on the model.
[0033] The model weighting coefficients are set to 0.6 for spectrum occupancy ratio and 0.4 for interference duration. Training terminates when the difference between the weight coefficients of two consecutive iterations is less than 0.001. When prioritizing frequency bands, the comprehensive interference weight values corresponding to each frequency band in the carrier frequency set are arranged in descending order, with higher weight values indicating higher priority. To determine the weight value of the highest interference frequency band, the highest priority frequency band is locked, and five neighboring frequencies are extended to the left and right of this band to form a continuous frequency band interval. After truncating this interval, the interference weight values of all frequency bands within the interval are extracted, and the maximum value is the weight value of the highest interference frequency band.
[0034] For example, in a 2.4GHz wireless keyboard communication scenario on an office desktop, the previously constructed interference source distribution map is first analyzed to identify high-interference areas formed by the overlap of radiation from the keyboard and a nearby WiFi router. Signal strength data for these areas is extracted, and signal peaks within each time segment are scanned using a Fast Fourier Transform to collect all occurring frequency points. These are then integrated to form a carrier frequency set, such as 2402MHz, 2412MHz, 2437MHz, and 2462MHz. Subsequently, frequency points containing both keyboard and WiFi router signals, such as 2412MHz, 2437MHz, and 2462MHz, are selected. The location and strength data of these frequency points are then integrated to generate signal overlap data.
[0035] A joint time-frequency domain analysis was performed on the overlapping signal data. The short-time Fourier transform method was used to convert the signal into frequency domain energy data, obtaining the energy value for each time-frequency unit and generating a conflict energy spectrum. For each frequency band in the carrier frequency set, the percentage of time with signal energy within a 5-second observation window was calculated to obtain the spectrum occupancy ratio of each frequency band. For example, the spectrum occupancy ratio of the 2437MHz band was 67%, the 2412MHz band was 58%, and the 2462MHz band was 31%. Simultaneously, the cumulative duration of energy values exceeding -50dBm in each frequency band within the observation window was calculated, and the proportion of this cumulative duration to the total 5-second duration was determined to obtain the interference duration of each frequency band. For example, the interference duration ratio of the 2437MHz band was 42%, the 2412MHz band was 38%, and the 2462MHz band was 19%. The spectrum occupancy ratio and interference duration of each frequency band are then input into a pre-trained weighted ranking model. The model calculates the interference weight value for each frequency band. For example, the interference weight value for the 2437MHz band is 0.6×67%+0.4×42%=0.57, for the 2412MHz band it is 0.51, for the 2462MHz band it is 0.262, and the interference weight values for other frequency points are all below 0.57. The carrier frequency set is arranged in descending order of interference weight value to classify frequency band priorities. For example, the highest priority is the 2437MHz band, followed by the 2412MHz band, and the lowest priority is the 2462MHz band and other low-weight frequency points. When determining the weight value of the highest interference frequency band, the highest priority 2437MHz band is locked. This band is then expanded to the left and right by five neighboring frequencies, forming a continuous frequency band from 2432MHz to 2442MHz. This band contains 11 frequencies: 2432MHz, 2433MHz, 2434MHz, 2435MHz, 2436MHz, 2437MHz, 2438MHz, 2439MHz, 2440MHz, 2441MHz, and 2442MHz, with corresponding interference weight values of 0.45, 0.48, 0.51, 0.53, 0.55, 0.57, 0.54, 0.52, 0.49, 0.47, and 0.44. After truncating this band, the maximum interference weight value within it is 0.57, which is the weight value of the highest interference frequency band.
[0036] In step S13, when the weight value of the highest interference frequency band exceeds a preset threshold, environmental noise data is acquired and feature extraction and interference source type matching are performed to obtain the degree of environmental noise impact. Based on the degree of environmental noise impact, a preset link quality mapping table is queried to obtain stability indicators, including: When the weight value of the highest interference frequency band exceeds a preset threshold, environmental noise data is acquired; Discretize the environmental noise data to extract noise fluctuation feature vectors; The noise fluctuation feature vector is compared with a preset interference source feature matching library, and the matching degree is calculated. Based on the matching degree and the noise fluctuation feature vector, the degree of environmental noise impact is calculated by weighting according to preset weights. Based on the degree of environmental noise impact, a preset link quality mapping table is queried to obtain the stability index.
[0037] It should be noted that the preset threshold for the highest interference frequency band weight is set to 0.45. This threshold is determined based on common knowledge in the field combined with experimental statistics. In the field of 2.4GHz wireless peripheral communication, an interference weight of 0.4 to 0.5 is the critical range for communication. After calibration through multiple scenarios in offices and homes, signal conflicts exceed the controllable range and the packet loss rate is greater than 12% when the weight value exceeds 0.45. The environmental noise data includes time-domain waveform data, signal amplitude data, and carrier frequency data, which are continuously acquired through the radio frequency monitoring module. The module sampling rate is set to 20MHz, and the continuous window is set to 3 seconds.
[0038] When discretizing and extracting features from environmental noise data, the data is first processed in 10-millisecond frames. The amplitude variance and frequency drift rate are calculated frame by frame. The amplitude variance reflects the fluctuation of signal strength, and the frequency drift rate describes the short-term shift of the carrier center frequency. Specifically, a Fast Fourier Transform is applied to each frame of environmental noise data to obtain a frequency domain energy distribution map. The frequency point corresponding to the energy peak in the map is the carrier center frequency of the current frame. The difference between the carrier center frequency of the current frame and the carrier center frequency of the previous frame is calculated. This difference is divided by the frame length of 10 milliseconds to obtain the instantaneous frequency drift rate of a single frame. The average of all instantaneous frequency drift rates is taken as the frequency drift rate of that frame. The amplitude variance and frequency drift rate of each frame are then integrated to generate a noise fluctuation feature vector.
[0039] It should be noted that the preset interference source feature matching library is built based on real-world testing in multiple office and home scenarios. Noise data from typical interference sources such as microwave ovens, WiFi, and smart speakers is collected, and the amplitude variance baseline value and frequency drift rate of each interference source are extracted to generate corresponding feature templates. Each template is bound to a unique interference source type, forming a complete matching library. The matching degree is calculated by first calculating the Euclidean distance between the current noise fluctuation feature vector and each feature template in the library, then performing minimum-maximum normalization to obtain a matching degree value between 0 and 1. The closer the value is to 1, the higher the matching degree. The noise fluctuation feature vector is then subjected to minimum-maximum normalization. The degree of environmental noise influence is equal to the matching degree multiplied by 0.7, plus the normalized value of the noise fluctuation feature vector multiplied by 0.3. This weight is determined based on experimental statistics. The matching degree has a stronger correlation with the determination of interference source type and a greater role in determining the degree of influence; therefore, the weight is set to 0.7. Multi-scenario testing shows that the influence calculated using this weight ratio closely matches the actual interference effect.
[0040] It's worth noting that the preset link quality mapping table is built based on real-world test data from multiple office and home scenarios. The type and distance of interference sources are adjusted in each scenario, and values for different levels of environmental noise impact are collected within the range of 0 to 1. The packet loss rate and latency jitter of the corresponding keyboard link are recorded simultaneously. At least 50 sets of sample data are collected for each impact level value. After removing abnormal fluctuations, the average value is used for calibration. Then, the ranges are divided according to the environmental noise impact level values and linked to corresponding link stability indicators. Specifically, three ranges are defined: 0 to 0.3 corresponds to excellent (packet loss rate less than 5%, latency jitter less than 8 milliseconds); 0.3 to 0.6 corresponds to moderate (packet loss rate 5% to 12%, latency jitter 8 to 20 milliseconds); and 0.6 to 1 corresponds to poor (packet loss rate greater than 12%, latency jitter greater than 20 milliseconds). The stability indicator includes three levels: excellent, moderate, and poor. Excellent corresponds to stable link communication; moderate corresponds to slight interference; and poor corresponds to severe interference. These three levels correspond to different ranges of packet loss rate and latency jitter, providing a clear indication of the link communication status.
[0041] For example, in a 2.4GHz wireless keyboard communication scenario in a family living room, the highest interference frequency band weight value is calculated to be 0.57 in step S12. This value exceeds the preset threshold of 0.45. Then, environmental noise data is continuously collected for 3 seconds at a sampling rate of 20MHz. The data is processed in frames with a frame length of 10 milliseconds. Three typical frames are selected to calculate the frequency drift rate. For example, the carrier center frequency of the first frame is 2437.000MHz, the second frame is 2437.0076MHz, and the third frame is 2437.0152MHz. Each frame has a frame length of 10 milliseconds, or 0.01 seconds. First, calculate the difference in carrier center frequency between adjacent frames. The difference between the second frame and the first frame is 0.0076MHz, and the difference between the third frame and the second frame is 0.0076MHz. Then, divide each difference by the frame length of 0.01 seconds to obtain the instantaneous frequency drift rate of each frame, which is 0.76kHz / s. Take the average of the instantaneous drift rates of the two frames to finally determine the frequency drift rate of this frame as 0.76kHz / s. At the same time, calculate the amplitude variance frame by frame and obtain the amplitude variance of this frame as 2.28. Combine the two to generate the noise fluctuation feature vector [2.28, 0.76kHz / s].
[0042] The noise fluctuation feature vector was compared with a preset interference source feature matching library. The Euclidean distance with the microwave oven interference feature template [2.5, 0.7kHz / s] was approximately 0.282, with the WiFi interference feature template [1.8, 1.2kHz / s] approximately 0.24, and with the smart speaker interference feature template [1.5, 1.0kHz / s] approximately 0.80. The matching degree with microwave oven interference was calculated using min-max normalization, resulting in a value of 0.92. First, min-max normalization was performed on the noise fluctuation feature vector. The extreme values of the amplitude variance ranged from 0 to 3, and the extreme values of the frequency drift rate ranged from 0 to 1kHz / s. After normalization, the amplitude variance of 2.28 was 2.28 ÷ 3 = 0.76, and the frequency drift rate of 0.76kHz / s was normalized to 0.76 ÷ 1 = 0.76. The average of these two normalized values was taken as the normalized value of the noise fluctuation feature vector, which was 0.76. After weighted summation, the environmental noise impact level is found to be 0.87.
[0043] Based on the environmental noise impact level of 0.87, the preset link quality mapping table was consulted. Since 0.87 is in the range of 0.6 to 1, the corresponding stability index is poor. This level corresponds to a keyboard link packet loss rate of over 12% and a latency jitter of over 20 milliseconds. The actual measured keyboard packet loss rate in this scenario is 15.3% and the latency jitter is 22 milliseconds, which is consistent with the mapping table.
[0044] In step S14, a multi-protocol switching table is generated by matching the stability index with a preset wireless communication protocol. The multi-protocol switching table is then sorted and the optimal option is selected to obtain the optimal path selection criteria, including: Based on the stability index, a preset wireless communication protocol is matched to generate a multi-protocol switching table; For each switching option in the multi-protocol switching table, the round-trip delay difference and the packet loss rate are calculated to obtain the connection latency change rate and data packet loss rate corresponding to each switching option; The multi-protocol switching table is sorted according to the connection latency change rate and the data packet loss rate to generate a sorted switching table; The connection latency change rate and the data packet loss rate corresponding to the first element of the sorting and switching table are used as the basis for optimal path selection.
[0045] It should be noted that the preset wireless communication protocols are a set of pre-built protocols adapted to 2.4GHz wireless keyboard communication, including three categories: 2.4GHz classic Bluetooth mode, 2.4GHz proprietary low-power protocol, and 2.4GHz enhanced frequency hopping protocol. When generating a multi-protocol switching table based on the preset wireless communication protocols according to stability indicators, the protocol adaptation priority is first determined according to the stability indicator level. Excellent stability indicators prioritize matching classic Bluetooth mode, medium stability indicators prioritize matching proprietary low-power protocol, and poor stability indicators prioritize matching enhanced frequency hopping protocol. The protocol name, protocol compatibility, and signal coverage radius are integrated to form the multi-protocol switching table.
[0046] To calculate the round-trip delay difference, first, average the round-trip delay samples of the keyboard and receiver before the handover, then average the same number of samples after the handover. The difference between the two is the round-trip delay difference. The connection delay change rate is the round-trip delay difference divided by the monitoring duration after the handover. To calculate the packet loss ratio, count the number of lost packets in 1000 consecutive transmissions after the handover. Divide the number of lost packets by the total number of packets (1000). The resulting ratio is the packet loss ratio, also known as the data loss rate.
[0047] It's worth noting that a weighted sorting method was used when generating the sorted switching table from the multi-protocol switching table. First, a weight of 0.4 was set for the connection latency change rate and 0.6 for the data packet loss rate. These weights were determined based on experimental statistics, with the data packet loss rate having a more direct impact on communication quality and thus a higher weight. Then, both indicators were normalized by minimizing and maximizing. The product of the normalized connection latency change rate multiplied by 0.4 and the product of the normalized data packet loss rate multiplied by 0.6 were added to obtain a comprehensive score. The lower the comprehensive score, the better the switching option. Finally, all options in the multi-protocol switching table were sorted from lowest to highest comprehensive score to generate the sorted switching table.
[0048] For example, the multi-protocol switching table is then sorted. First, the minimum-maximum normalization of two metrics is applied: after normalization, the connection latency change rate is 0.3 for Classic Bluetooth, 0.1 for Proprietary Low Energy Protocol (PLEP), and 0.8 for Enhanced Frequency Hopping Protocol (EFP). After normalization, the data packet loss rate is 0.15 for Classic Bluetooth, 0.25 for PLAEP, and 1 for EFP. A comprehensive score is calculated based on the weights: Classic Bluetooth 0.3 × 0.4 + 0.15 × 0.6 = 0.21, PLAEP 0.19, and EFP 0.92. A sorted switching table is generated by sorting the comprehensive scores from low to high, with the first element being PLAEP. The connection latency change rate of -0.3 ms / s and the data packet loss rate of 2.1% corresponding to this option are determined as the optimal path selection criteria.
[0049] In step S15, environmental dynamic factors and connection recovery strength are obtained. Based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, the handover response speed is calculated. When the handover response speed exceeds a preset threshold, the target protocol is extracted from the multi-protocol handover table based on the connection recovery strength. The target protocol is combined with the handover response speed to obtain a protocol handover decision, including: The interference signal waveform is collected, feature parameters are extracted from the interference signal waveform, and the feature parameters are weighted according to preset weights to obtain the environmental dynamic factor; The reconnection success rate, reconnection delay duration, and reconnection stability in the historical protocol switching records are statistically analyzed, and the connection recovery strength is obtained through weighted calculation. Based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, a composite state feature vector is constructed. A noise intensity coefficient is calculated based on the environmental noise data. The noise intensity coefficient is then used to weight and correct the composite state feature vector to obtain a noise-corrected state matrix. The noise-corrected state matrix is input into the pre-trained time series analysis model to obtain the switching response speed; When the switching response speed exceeds a preset threshold, the target protocol is extracted from the multi-protocol switching table based on the connection recovery strength, and the target protocol is combined with the switching response speed to obtain a protocol switching decision.
[0050] It should be noted that the characteristic parameters extracted from the interference signal waveform include three parameters: interference signal amplitude fluctuation value, interference frequency jump frequency, and interference energy duty cycle. The interference signal amplitude fluctuation value is extracted by dividing the interference signal waveform into frames with a frame length of 10 milliseconds, extracting the average amplitude of each frame, and then calculating the variance of the average amplitude of all frames. This variance is the interference signal amplitude fluctuation value. The interference frequency jump frequency is extracted by extracting the carrier center frequency frame by frame within a 3-second acquisition period, counting the number of times the difference between the carrier center frequencies of adjacent frames exceeds 0.1MHz, and the cumulative number of times is the interference frequency jump frequency. The interference energy duty cycle is calculated by using the 2.4GHz wireless communication interference reference energy value of -70dBm as the boundary, counting the effective duration of the interference signal energy exceeding -70dBm within a 3-second acquisition period, and dividing the effective duration by the total acquisition time of 3 seconds. The resulting ratio is the interference energy duty cycle.
[0051] The commonly used channel spacing for the 2.4GHz wireless keyboard communication band is 1MHz. 0.1MHz, which is 1 / 10 of the channel spacing, is a reasonable range for distinguishing between normal fluctuations and interference jumps. The preset weights for interference signal amplitude fluctuation are 0.5, interference frequency jump frequency is 0.3, and interference energy duty cycle is 0.2. These weights are determined based on experimental statistics. Multi-scenario testing shows that interference signal amplitude fluctuation has the most direct and highest impact on environmental dynamics, followed by frequency jump frequency, while energy duty cycle has a relatively smaller impact. The environmental dynamic factors calculated using this weight allocation have the highest degree of matching with actual environmental changes.
[0052] It should be noted that the historical reconnection success rate is calculated by combining the total number of protocol handovers and the number of successful reconnections in the same scenario. The success rate is calculated as a percentage, divided by the total number of handovers and multiplied by 100. The reconnection latency is calculated by taking the arithmetic mean of all successful reconnection samples to obtain the millisecond-level mean reconnection latency. Reconnection stability is calculated by calculating the variance of the historical reconnection latency. The weights are set at 0.4 for reconnection success rate, 0.3 for reconnection latency, and 0.3 for reconnection stability. These weights are determined based on experimental statistics. Reconnection success rate has the greatest impact on connection recovery capability, while latency and stability have a comparable impact. 200 sets of historical test data in the same scenario were collected to obtain the maximum and minimum values for the three indicators. The minimum and maximum values of the three indicators were then normalized to the range of 0 to 1, and finally weighted and summed according to their respective weights. The result is the connection recovery strength.
[0053] It is worth noting that when constructing the composite state feature vector, the connection delay change rate and data packet loss rate in the optimal path selection criteria are combined with environmental dynamic factors and connection recovery strength. These four parameters are combined in the following order: [connection delay change rate, data packet loss rate, combined with environmental dynamic factors, connection recovery strength] to form a four-dimensional composite state feature vector. The average energy value and the baseline energy value of the noise data are exponentially transformed to obtain the corresponding power. Then, the average power of the environmental noise is divided by the baseline power to obtain the noise intensity coefficient. The baseline energy value is determined to be -70dBm based on common knowledge in the field. This baseline energy value is the standard receiving energy threshold for normal communication of peripherals such as 2.4GHz wireless keyboards without interference, and is suitable for most common 2.4GHz wireless communication scenarios such as offices and homes. The current method for calculating the average energy value of environmental noise data is as follows: first, the collected environmental noise data is divided into frames with a frame length of 10 milliseconds, and the energy value is calculated frame by frame. The energy value of each frame is averaged by taking the square of the amplitude of all sampling points within the frame, converted to dBm units, and then the energy values of all frames are statistically analyzed. The arithmetic mean of the energy values of all frames is taken as the average energy value of the current environmental noise data. When weighting and correcting the composite state feature vector, the noise intensity coefficient is multiplied by each of the four parameters in the vector to obtain the corrected values of the four parameters, thus completing the weighting and correction.
[0054] It is worth noting that the noise-corrected state matrix is a 1-row, 4-column matrix. One row corresponds to a complete set of noise-corrected state data in a single protocol handover scenario, and the four columns correspond to four independent parameters. These matrix parameters correspond to the four parameters of the corrected composite state feature vector: corrected connection delay change rate, corrected data packet loss rate, corrected environmental dynamic factor, and corrected connection recovery strength. The pre-trained time series analysis model is a TCN time series prediction model. The training process uses historical noise-corrected state matrix data as input and corresponding historical handover response speed data as output to train the model. Training terminates when the difference in loss values between two adjacent iterations is less than 0.001.
[0055] It is worth noting that the preset threshold for switching response speed is set at 70ms. This threshold is determined based on common knowledge in the field combined with experimental statistics. The industry-standard perception range for user-perceptible switching latency for this type of peripheral is below 80ms. Further calibration through multi-scenario testing in offices and homes, using 500 samples with different interference intensities and usage scenarios, showed that 70ms is a critical value for both perceived latency and stability. Therefore, 70ms was determined as the switching response speed threshold. The specific process for extracting the target protocol based on connection recovery strength is as follows: First, the connection recovery strength is graded into ranges from 0 to 1, with 0.8 to 1 being high strength, 0.5 to 0.8 being medium strength, and 0 to 0.5 being low strength. Then, it is matched against the historical recovery strength levels of each protocol in the multi-protocol switching table, prioritizing the extraction of the protocol with the highest level that matches the current connection recovery strength. The protocol switching decision includes two aspects: the target protocol type and the switching response speed value.
[0056] For example, in a home office 2.4GHz wireless keyboard scenario, the interference signal waveform was first collected, and the interference signal amplitude fluctuation value was extracted as 0.8, the interference frequency jump frequency as 0.6, and the interference energy duty cycle as 0.7. The environmental dynamic factor was calculated to be 0.72. Then, historical handover records were statistically analyzed, showing a reconnection success rate of 95%, a reconnection latency of 6ms, and a reconnection stability variance of 0.2. All three indicators were normalized using minimum-maximum normalization. The extreme range of the reconnection success rate was 0% to 100%, and after normalization, it was 0.95; the extreme range of the reconnection latency was 0ms to 50ms, and after normalization, it was 0.12; the extreme range of the reconnection stability variance was 0 to 0.25, and after normalization, it was 0.8. The weighted summation of the connection recovery strength was 0.656. The optimal path selection criteria are known to be a connection latency change rate of -0.3ms / s, a data packet loss rate of 2.1%, and a minimum-maximum normalization value of 0.21. Based on these, a composite state feature vector is constructed as [-0.3, 0.21, 0.72, 0.656].
[0057] The current average ambient noise energy is -52.5 dBm, and the reference energy is -70 dBm. An exponential transformation of these two values yields a power of 5.623 × 10⁻⁶. -6 mW, 1×10 -7 The noise intensity coefficient is obtained by dividing the mW by 56.23. This coefficient is used to weight the correction vector, resulting in corrected parameters of -16.87, 11.81, 40.49, and 36.89, arranged in a 1x4 noise correction state matrix. Inputting this matrix into a pre-trained timing analysis model yields a handover response speed of 85ms. This value exceeds the preset threshold of 70ms. The current connection recovery strength of 0.656 is considered medium. Matching the multi-protocol handover table, the proprietary low-power protocol with the highest historical recovery strength of 0.68 shows the best match and overall score, thus this protocol is extracted as the target protocol. Finally, the target protocol (2.4GHz proprietary low-power protocol) and the handover response speed of 85ms are combined to obtain the protocol handover decision.
[0058] In step S16, connection adjustment parameters are calculated based on the protocol switching decision, and the connection adjustment parameters are injected into the underlying communication driver for reconstruction to obtain a connection optimization configuration, including: The protocol switching decision is analyzed, the adaptive channel range of the target protocol is extracted, the surrounding signal interference spectrum is obtained based on the adaptive channel range, the frequency domain fluctuation amplitude of the surrounding signal interference spectrum is extracted, and a real-time feature sequence is generated. Align the real-time feature sequence with the data packet loss rate and the handover response speed, calculate the deviation gradient, and determine the connection adjustment parameters. The connection adjustment parameters are injected into the underlying communication driver for reconstruction to obtain the connection optimization configuration.
[0059] It should be noted that when extracting the adaptive channel range of the target protocol, the target protocol type in the protocol switching decision is first parsed, and the preset inherent adaptive channel range of the target protocol is retrieved. The preset inherent adaptive channel range of the target protocol refers to the working channel range of the frequency band communication corresponding to the target protocol. For example, the inherent adaptive channel range of the 2.4GHz classic Bluetooth protocol is 2402MHz-2480MHz. Then, combined with the characteristics of the 2.4GHz wireless communication scenario, the disabled channels in the scenario and the conflicting channels that overlap with other devices are excluded, and finally the adaptive channel range of the target protocol is determined.
[0060] When acquiring the surrounding signal interference spectrum based on the adapted channel range, the adapted channel range is used as the scanning interval, with a scanning step size of 1MHz and a single scan duration of 2 seconds. Signal energy values are collected for each channel, and the energy distribution of each channel is recorded synchronously. All collected data are integrated to generate the surrounding signal interference spectrum. When extracting the frequency domain fluctuation amplitude of the surrounding signal interference spectrum, the surrounding signal interference spectrum is divided into frames with a duration of 100 milliseconds. The variance of the signal energy of all sampling points within the adapted channel range in each frame is calculated. This variance is the frequency domain fluctuation amplitude of a single frame. The frequency domain fluctuation amplitude values of each frame are concatenated in chronological order to form a real-time feature sequence with time as the axis.
[0061] It is worth noting that during alignment, a uniform sampling period of 1 second was used, and the same timestamp was added to the three data items. The real-time feature sequence was extracted synchronously frame by frame, the data packet loss rate was calculated as the percentage of data packets lost per second, and the switching response speed was collected as the average real-time response latency per second. Missing sampling points were filled in by the average of adjacent sampling points. When calculating the deviation gradient, the baseline thresholds for the three indicators were first set. The baseline thresholds for the three indicators can be fine-tuned according to the device hardware performance, communication priority, and usage scenario. The baseline values for the real-time feature sequence were 0.3, the data packet loss rate was 1%, and the switching response speed was 80ms. The deviation between the current value and the baseline value of each indicator was calculated. Then, the deviation values were weighted and summed according to the weights of the real-time feature sequence (0.4), the data packet loss rate (0.35), and the switching response speed (0.25) to obtain the deviation value. The difference between the deviation values of adjacent timestamps was calculated, and this difference is the deviation gradient.
[0062] The three benchmark thresholds were determined based on common knowledge in the field combined with experimental statistics. In the field of 2.4GHz wireless keyboards, it is generally accepted that when the frequency domain fluctuation amplitude is less than 0.3, the channel interference is within a controllable range and the communication is not significantly affected. In the field of human-computer interaction wireless peripherals, when the packet loss rate is less than 1%, users do not experience any missed keystrokes or latency. According to actual tests in keyboard scenarios, input is smooth and without abnormalities at this value. Above this value, the problem of missed keystrokes gradually appears. Wireless keyboards are instantaneous interactive peripherals. It is generally accepted in the field that users have no perceptible latency when switching response speed is within 80ms. Actual tests in multiple scenarios show that there is no lag in key response within 80ms.
[0063] The weights of the three indicators were determined based on experimental statistics. The contribution rate of each indicator to the keyboard connection quality was tested in multiple scenarios. The real-time feature sequence is a representation of environmental interference and directly determines subsequent packet loss and latency changes. It has the highest contribution rate, so its weight is set to 0.4. The data packet loss rate directly affects the integrity of input, while the missing key problem has the next greatest impact on user experience. Its weight is set to 0.35. The switching response speed only affects the perceived smoothness and has no substantial functional impact. Its weight is set to 0.25.
[0064] It's worth noting that when determining the connection adjustment parameters, a preset mapping relationship between the deviation gradient range and the parameters is established. A negative gradient indicates connection quality degradation, with smaller gradients indicating more severe degradation. A positive gradient indicates improved connection quality. Four categories of interval matching parameters are categorized based on gradient values. The output parameters include the target channel number, transmit power fine-tuning amount, and protocol reconnection timeout threshold. The more severe the gradient degradation, the larger the transmit power adjustment. Priority is given to switching to the adaptation channel with the lowest interference amplitude. Specifically, a gradient value below -0.035 indicates severe degradation, the target channel is selected as the optimal channel within the adaptation range with an interference amplitude not exceeding 0.25, and the transmit power is increased by 8%-10%. The reconnection timeout threshold is 150ms; if the gradient value is between -0.035 and -0.015 and includes both values, it is considered moderate degradation. The target channel should be a channel with an interference amplitude of less than 0.3 within the adaptation range, and the transmit power should be increased by 5%-7%, with a reconnection timeout threshold of 120ms; if the gradient value is between -0.015 and 0 and does not include both values, it is considered slight degradation. The target channel should be a channel with an interference amplitude of less than 0.4 within the adaptation range, and the transmit power should be increased by 2%-4%, with a reconnection timeout threshold of 100ms; if the gradient value is 0 or above, it is considered positive improvement. The current channel should be maintained, and the transmit power should remain at the baseline without adjustment, with a reconnection timeout threshold of 80ms.
[0065] When multiple timestamps have multiple deviation gradients, the deviation gradient corresponding to the latest timestamp is used as the judgment basis. At the same time, the gradient change trend within three consecutive timestamps is also taken into account. If the degradation interval to which the latest gradient belongs is the most severe within the current consecutive interval, the parameters corresponding to that interval are directly adjusted. If the gradient interval fluctuates, the parameters are uniformly matched and adjusted according to the interval with the highest degree of degradation among multiple gradients to ensure that the parameter adjustment can cope with the worst connection state and ensure the stability of wireless keyboard communication and input smoothness.
[0066] It is worth noting that when injecting connection adjustment parameters into the underlying communication driver for reconstruction, the parameter configuration interface of the underlying communication driver is first adapted. The three parameters—target channel number, transmit power fine-tuning amount, and protocol reconnection timeout threshold—are encapsulated according to the driver's preset format, and an incremental injection mode is used to avoid overwriting the driver's original basic configuration. After the driver reconstruction is completed, three data points—channel connection status, transmit power effectiveness, and reconnection response time—are collected in real time to verify whether all parameters are effective. If all parameters are effective, the real-time characteristic sequence, data packet loss rate, and handover response speed are continuously monitored within 30 seconds. If all three indicators are stable within the controllable range of the baseline threshold and there are no significant fluctuations, the reconstruction is considered successful, and the currently effective driver configuration is the connection optimization configuration. If the parameters are not fully effective or the monitored indicators fluctuate beyond the standard, the fine-tuned parameters are injected again for reconstruction until the indicators meet the standard and the connection optimization configuration is locked.
[0067] For example, in a home office 2.4GHz wireless keyboard scenario, the real-time feature sequence is aligned with the data packet loss rate per second and the switching response speed by adding the same timestamp with a unified sampling period of 1 second. Missing sampling points are filled in by the average of adjacent sampling points, achieving complete alignment of the three data time dimensions. Based on the real-time feature sequence baseline value of 0.3, the data packet loss rate baseline value of 1%, and the switching response speed baseline value of 80ms, the deviation of the three indicators at each timestamp is calculated. Then, the deviation values are weighted and summed according to the weights of the real-time feature sequence of 0.4, the data packet loss rate of 0.35, and the switching response speed of 0.25 to obtain the deviation value corresponding to each timestamp. Then, the difference between the deviation values of adjacent timestamps is calculated, and the deviation gradients are obtained as -0.023, -0.035, -0.041, and -0.038, respectively.
[0068] Based on the gradient interval and parameter mapping relationship, -0.023 is in the slightly degraded range, -0.035 is in the moderately degraded range, and -0.041 and -0.038 are in the severely degraded range. The current scene gradient has entered the severely degraded range, and the parameters need to be adjusted according to the severely degraded standard. Based on this, the connection adjustment parameters are determined: prioritize switching to the 2.412GHz target channel with an interference amplitude of 0.22 within the suitable channel range, increase the transmit power by 8%, and set the protocol reconnection timeout threshold to 150ms. Subsequently, the three connection adjustment parameters are encapsulated according to the underlying communication driver configuration format and incrementally injected through the driver parameter configuration interface. The currently effective driver configuration is the connection optimization configuration.
[0069] In step S17, based on the connection optimization configuration, the preset keyboard connection settings are updated to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, candidate communication frequency bands are re-screened and protocol matching is performed to determine the final connection scheme, including: The connection optimization configuration is analyzed to obtain the channel hopping sequence and transmit power gain. The preset keyboard connection settings are updated according to the channel hopping sequence and transmit power gain to obtain the updated connection settings. Based on the updated connection settings, the coverage area of the connection signal is parsed, weak signal areas are identified, a weak signal area ratio and a set of recovery performance indicators are generated, and the weak signal area ratio and the set of recovery performance indicators are weighted and calculated to obtain the optimized connection stability. When the optimized connection stability is lower than the preset stability threshold, the radio frequency sensor array is triggered to scan and obtain a signal heat map. The signal heat map is analyzed to obtain a new spatial interference density, and the new spatial interference density is mapped to a preset frequency band priority list to obtain candidate communication frequency bands. The candidate communication frequency bands are matched with a preset minimum interference protocol, and the carrier frequency and modulation method are determined according to the preset minimum interference protocol to obtain the final connection scheme.
[0070] It should be noted that when parsing the connection optimization configuration to obtain the channel hopping sequence and transmit power gain, the pre-stored dynamic channel adjustment records and power configuration parameters are extracted. The channel hopping sequence is the channel switching order and interval duration in the configuration, and the transmit power gain is the effective signal strength adjustment magnitude in the configuration. When updating the preset keyboard connection settings based on the channel hopping sequence and transmit power gain, the obtained channel hopping sequence is written into the keyboard's preset channel configuration list, specifying the automatic channel switching trigger conditions and fixed order, and determining the hopping interval duration. The transmit power gain is correspondingly superimposed on the keyboard's original transmit power, and the new transmit power setting is determined according to the gain magnitude. When parsing the coverage range of the connection signal based on the updated connection settings, identifying weak signal areas, and generating a weak signal area ratio and recovery performance index set, based on the channel and power parameters in the updated connection settings, the keyboard actively sends wireless detection signals. With the keyboard as the center and a maximum coverage radius of 5 meters, the signal reception strength is collected at each location to delineate the actual signal coverage boundary. Areas with signal strength lower than 50% of the baseline strength are identified as weak signal areas. The ratio of the total area of weak signal areas to the total coverage area within 5 meters is the weak signal area ratio. The baseline strength was set at 50dBm, representing the standard received strength for stable communication within a 5-meter range under the nominal interference-free scenario of a 2.4GHz wireless keyboard. Simultaneously, three data points were collected in the weak signal area: real-time signal strength, latency jitter, and reconnection success rate after disconnection, forming a set of recovery performance indicators.
[0071] It should be noted that the optimized connection stability is calculated by weighting the proportion of weak signal areas with the recovery performance index set. The weighting is set to 0.6 for the weak signal area proportion and 0.4 for the recovery performance index set. The weights are determined based on experimental statistics. The weak signal area proportion directly determines the effectiveness of connection coverage, hence its higher weight. The recovery performance index set affects the connection quality in weak areas, so its weight is secondary. The optimized connection stability value ranges from 0 to 1, with higher values indicating stronger stability. The calculation method is to subtract the weighted value of the weak signal area proportion from 1 and then add the weighted value of the recovery performance index set. The preset stability threshold is set to 0.75. This threshold is determined based on common knowledge in the field combined with experimental statistics. In office and home scenarios using wireless keyboards, 0.75 is the critical value between connection stability and instability. Below this value, users are more likely to experience lag and missed keys. The weighted average of the recovery performance index set is the comprehensive score of the index set. The calculation method is to score the real-time signal strength, latency jitter value, and reconnection success rate after disconnection in the index set according to 0 to 1. The real-time signal strength is scored according to the ratio of the actual strength to the target strength. The latency jitter value is scored as 1 point if it is lower than or equal to the target value and proportionally if it is higher than the target value. The reconnection success rate after disconnection is directly mapped to 0 to 1. Then, the three indicators are weighted and summed according to one-third weight of each to obtain the comprehensive score of the recovery performance index set, which is its weighted value.
[0072] It is worth noting that when analyzing the signal heatmap to obtain the new spatial interference density, the heatmap is divided into statistical units of 1 square meter each. Three data points are extracted from each unit: the number of interfering signals, the keyboard channel overlap, and the signal strength fluctuation value. The number of interfering signals is the total number of interfering signals in each unit. The keyboard channel overlap is used to determine whether the interfering signal channel and the keyboard working channel overlap within the unit. The signal strength fluctuation value is the maximum difference in the intensity of the interfering signals within the unit. Then, all three indicators are mapped to the interval between 0 and 1. 0 interfering signals are mapped to 0, two or more are mapped to 1, no overlap with the keyboard channel is mapped to 0, overlap is mapped to 1, and signal strength fluctuation less than 10dBm is mapped to 0, and fluctuation greater than or equal to 10dBm is mapped to 1. Then, the comprehensive influence value is obtained by weighting the channel overlap with a weight of 0.5, the signal strength fluctuation with a weight of 0.3, and the number of interfering signals with a weight of 0.2. This value is the spatial interference density.
[0073] The weights were determined based on experimental statistics. It is well known in the field that channel overlap will directly cause co-channel interference and block keyboard signal transmission, which is a factor affecting connection stability. Signal strength fluctuations will cause delay jitter, which has a secondary impact. The number of interfering signals only increases the probability of interference, and its impact is relatively minimal. According to multi-scenario tests, the proportions of the three types of factors causing keyboard connection abnormalities are 50%, 30%, and 20%, respectively. The weights are set according to the corresponding proportions of impact.
[0074] It is worth noting that mapping the new spatial interference density to a preset frequency band priority list to obtain candidate communication frequency bands involves first taking the average spatial interference density of all statistical units within the coverage area of each candidate frequency band as the overall interference density of that band. Then, the preset frequency band priority list is retrieved, prioritizing the frequency bands with higher priority in the list. The overall interference density of each of the higher-priority frequency bands is compared, and the frequency band with the highest priority and the lowest overall interference density is selected as the candidate communication frequency band. The preset frequency band priority list is constructed as follows: first, all 2.4GHz and 5GHz frequency bands and channels supported by the keyboard hardware are determined; then, scores are given based on three dimensions: frequency band interference probability, transmission stability, and keyboard compatibility. Each dimension is rated from 0 to 1, with higher scores for lower interference probability, higher transmission stability, and stronger keyboard compatibility. The total score is calculated by weighting the interference probability (0.4) and transmission stability and compatibility (0.3 each), and then sorting the scores from highest to lowest to form the list.
[0075] When matching candidate communication frequency bands with a preset minimum interference protocol, the preset minimum interference protocol is a pre-stored set of communication protocols adapted to different frequency bands and resistant to interference. These protocols include three types: channel adaptive adjustment, low-power anti-interference coding, and dynamic power adaptation. The matching method is to select the protocol with the strongest adaptability from the protocol set based on the frequency band characteristics and interference type of the candidate communication frequency band. If the frequency band interference is strong, an anti-interference coding protocol is matched; if the frequency band signal is weak, a dynamic power adaptation protocol is matched.
[0076] The protocol specifies the optimal carrier frequency range within the candidate frequency band, and selects specific carrier frequencies based on spatial interference density. The candidate frequency band is divided into multiple carrier frequency points in 1MHz increments. Referring to the overall spatial interference density of the band, a density below 0.3 indicates low interference, and carrier frequencies with larger bandwidth within the range are prioritized to balance transmission efficiency. A density between 0.3 and 0.7 indicates medium interference, and carrier frequencies with strong signal penetration and low interference are selected to balance efficiency and stability. A density above 0.7 indicates high interference, and dedicated anti-interference carrier frequencies are selected to avoid interference sources. Simultaneously, the protocol matches corresponding modulation schemes: for the 2.4GHz candidate frequency band, low interference is matched with Gaussian frequency shift keying (GFK), medium interference with π / 4 differential quadrature phase shift keying (QPSK), and high interference with binary phase shift keying (BPSK); for the 5GHz candidate frequency band, low interference is matched with orthogonal frequency division multiplexing (OFDM), medium interference with QPSK, and high interference with differential binary phase shift keying (BPSK). The final connection scheme includes the candidate communication frequency band, specific carrier frequency, and adapted modulation scheme.
[0077] For example, in a home office 2.4GHz wireless keyboard scenario, the 5GHz candidate communication frequency band is matched with a preset minimum interference protocol. Since the overall interference density of this frequency band is less than 0.3, according to the optimal carrier frequency range specified by the protocol, the carrier frequency with a larger bandwidth within the range is selected first. 5.18GHz is selected as the specific carrier frequency, and the corresponding modulation method is matched at the same time to balance transmission efficiency and basic anti-interference capability. The final connection scheme includes the 5GHz candidate communication frequency band, the 5.18GHz specific carrier frequency, and the adapted modulation method.
[0078] Reference Figure 2 The second embodiment of the present invention provides a multifunctional wireless connection control system for a leather keyboard case, comprising: An interference feature construction module is used to acquire keyboard monitoring data, preprocess and visualize the keyboard monitoring data, and construct an interference source distribution map. The frequency band evaluation module is used to divide the frequency band priority according to the interference source distribution map, and calculate the weight value of the highest interference frequency band according to the frequency band priority; The stability index generation module is used to acquire environmental noise data and perform feature extraction and interference source type matching when the weight value of the highest interference frequency band exceeds a preset threshold, to obtain the degree of environmental noise impact, and to query a preset link quality mapping table based on the degree of environmental noise impact to obtain the stability index. The optimal path determination module is used to match a preset wireless communication protocol according to the stability index, generate a multi-protocol switching table, sort the multi-protocol switching table and filter the optimal option to obtain the basis for optimal path selection. The protocol switching decision generation module is used to obtain environmental dynamic factors and connection recovery strength, calculate the switching response speed based on the optimal path selection criteria, the environmental dynamic factors and the connection recovery strength, and when the switching response speed exceeds a preset threshold, extract the target protocol from the multi-protocol switching table based on the connection recovery strength, and combine the target protocol with the switching response speed to obtain the protocol switching decision. The connection optimization configuration generation module is used to calculate connection adjustment parameters according to the protocol switching decision, inject the connection adjustment parameters into the underlying communication driver for reconstruction, and obtain the connection optimization configuration. The closed-loop optimization module is used to update the preset keyboard connection settings according to the connection optimization configuration to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, candidate communication frequency bands are re-selected and protocol matching is performed to determine the final connection scheme.
[0079] It should be noted that the multifunctional leather keyboard wireless connection control system provided in this embodiment of the invention is used to execute all the process steps of the multifunctional leather keyboard wireless connection control method in the above embodiment. The working principle and beneficial effects of the two are one-to-one, so they will not be described again.
[0080] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0081] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A wireless connection control method for a multi-functional leather keyboard case, characterized in that, include: Acquire keyboard monitoring data, preprocess and visualize the keyboard monitoring data, and construct an interference source distribution map; Based on the interference source distribution map, frequency band priorities are divided, and the weight value of the highest interference frequency band is calculated based on the frequency band priorities. When the weight value of the highest interference frequency band exceeds a preset threshold, environmental noise data is acquired and features are extracted and interference source type is matched to obtain the degree of environmental noise impact. Based on the degree of environmental noise impact, a preset link quality mapping table is queried to obtain the stability index. Based on the stability index, a preset wireless communication protocol is matched to generate a multi-protocol switching table. The multi-protocol switching table is sorted and the optimal option is selected to obtain the basis for the optimal path selection. The system acquires environmental dynamic factors and connection recovery strength. Based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, it calculates the handover response speed. When the handover response speed exceeds a preset threshold, it extracts the target protocol from the multi-protocol handover table based on the connection recovery strength. It then combines the target protocol with the handover response speed to obtain a protocol handover decision. Calculate connection adjustment parameters based on the protocol switching decision, inject the connection adjustment parameters into the underlying communication driver for reconstruction, and obtain the connection optimization configuration. Based on the connection optimization configuration, the preset keyboard connection settings are updated to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, candidate communication frequency bands are re-selected and protocol matching is performed to determine the final connection scheme.
2. The wireless connection control method for the multi-functional leather keyboard as described in claim 1, characterized in that, The process of acquiring keyboard monitoring data, preprocessing and visualizing the keyboard monitoring data, and constructing an interference source distribution map includes: The keyboard monitoring data is time-domain synchronized and blind source separated to generate a time-series sampling sequence; Power spectral density analysis is performed on the time-series sampling sequence to obtain instantaneous signal intensity values. The instantaneous signal intensity values are then mapped to coordinate points on a preset two-dimensional grid to construct a signal intensity distribution matrix. The signal-to-noise ratio and spatial interference weights are calculated based on the signal strength distribution matrix, and the coordinate points of the preset two-dimensional grid are weighted to generate the spatial interference density. Density region data is extracted from the spatial interference density to generate a source location vector. The source location vector and the signal strength distribution matrix are then fused to construct an interference source distribution map.
3. The wireless connection control method for the multi-functional leather keyboard as described in claim 1, characterized in that, The step of dividing frequency bands into priorities based on the interference source distribution map, and calculating the weight value of the highest interference frequency band based on the frequency band priorities, includes: The interference source distribution map is analyzed to generate a carrier frequency set and signal overlap data; Perform time-frequency domain joint analysis on the signal overlap data to generate a conflict energy spectrum, and statistically analyze the conflict energy spectrum to obtain the spectrum occupancy ratio and interference duration. The spectrum occupancy ratio and the interference duration are input into a pre-trained weighted sorting model to obtain interference weight values. The carrier frequency set is then sorted according to the magnitude of the interference weight values to divide the frequency band priority. Based on the frequency band priority, the frequency band interval with the largest interference weight value is extracted to determine the highest interference frequency band weight value.
4. The wireless connection control method for the multi-functional leather keyboard as described in claim 1, characterized in that, The process of acquiring environmental noise data, performing feature extraction and interference source type matching to obtain the degree of environmental noise impact includes: Discretize the environmental noise data to extract noise fluctuation feature vectors; The noise fluctuation feature vector is compared with a preset interference source feature matching library, and the matching degree is calculated. The degree of environmental noise impact is obtained by weighting the matching degree and the noise fluctuation feature vector according to preset weights.
5. The wireless connection control method for the multi-functional leather keyboard as described in claim 1, characterized in that, The process of sorting and filtering the multi-protocol switching table to obtain the optimal path selection criteria includes: For each switching option in the multi-protocol switching table, the round-trip delay difference and the packet loss rate are calculated to obtain the connection latency change rate and data packet loss rate corresponding to each switching option; The multi-protocol switching table is sorted according to the connection latency change rate and the data packet loss rate to generate a sorted switching table; The connection latency change rate and the data packet loss rate corresponding to the first element of the sorting and switching table are used as the basis for optimal path selection.
6. The wireless connection control method for the multi-functional leather keyboard as described in claim 1, characterized in that, The process of acquiring environmental dynamic factors and connection recovery strength, and calculating the handover response speed based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, includes: The interference signal waveform is collected, feature parameters are extracted from the interference signal waveform, and the feature parameters are weighted according to preset weights to obtain the environmental dynamic factor; The reconnection success rate, reconnection delay duration, and reconnection stability in the historical protocol switching records are statistically analyzed, and the connection recovery strength is obtained through weighted calculation. Based on the optimal path selection criteria, the environmental dynamic factors, and the connection recovery strength, a composite state feature vector is constructed. A noise intensity coefficient is calculated based on the environmental noise data. The noise intensity coefficient is then used to weight and correct the composite state feature vector to obtain a noise-corrected state matrix. The noise-corrected state matrix is input into the pre-trained time series analysis model to obtain the switching response speed.
7. The wireless connection control method for the multi-functional leather keyboard as described in claim 1, characterized in that, The connection adjustment parameters are calculated based on the protocol switching decision, and then injected into the underlying communication driver for reconstruction to obtain the connection optimization configuration. The protocol switching decision is analyzed, the adaptive channel range of the target protocol is extracted, the surrounding signal interference spectrum is obtained based on the adaptive channel range, the frequency domain fluctuation amplitude of the surrounding signal interference spectrum is extracted, and a real-time feature sequence is generated. Align the real-time feature sequence with the data packet loss rate and the switching response speed, calculate the deviation gradient, and determine the connection adjustment parameters.
8. The wireless connection control method for the multi-functional leather keyboard according to claim 1, characterized in that, Based on the optimized connection configuration, the preset keyboard connection settings are updated to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, candidate communication frequency bands are re-screened and protocol matching is performed to determine the final connection scheme, including: The connection optimization configuration is analyzed to obtain the channel hopping sequence and transmit power gain. The preset keyboard connection settings are updated according to the channel hopping sequence and transmit power gain to obtain the updated connection settings. Based on the updated connection settings, the coverage area of the connection signal is parsed, weak signal areas are identified, a weak signal area ratio and a set of recovery performance indicators are generated, and the weak signal area ratio and the set of recovery performance indicators are weighted and calculated to obtain the optimized connection stability. When the optimized connection stability is lower than the preset stability threshold, the radio frequency sensor array is triggered to scan and obtain a signal heat map. The signal heat map is analyzed to obtain a new spatial interference density, and the new spatial interference density is mapped to a preset frequency band priority list to obtain candidate communication frequency bands. The candidate communication frequency bands are matched with a preset minimum interference protocol, and the carrier frequency and modulation method are determined according to the preset minimum interference protocol to obtain the final connection scheme.
9. A multifunctional wireless connection control system for a leather keyboard case, characterized in that, include: An interference feature construction module is used to acquire keyboard monitoring data, preprocess and visualize the keyboard monitoring data, and construct an interference source distribution map. The frequency band evaluation module is used to divide the frequency band priority according to the interference source distribution map, and calculate the weight value of the highest interference frequency band according to the frequency band priority; The stability index generation module is used to acquire environmental noise data and perform feature extraction and interference source type matching when the weight value of the highest interference frequency band exceeds a preset threshold, to obtain the degree of environmental noise impact, and to query a preset link quality mapping table based on the degree of environmental noise impact to obtain the stability index. The optimal path determination module is used to match a preset wireless communication protocol according to the stability index, generate a multi-protocol switching table, sort the multi-protocol switching table and filter the optimal option to obtain the basis for optimal path selection. The protocol switching decision generation module is used to obtain environmental dynamic factors and connection recovery strength, calculate the switching response speed based on the optimal path selection criteria, the environmental dynamic factors and the connection recovery strength, and when the switching response speed exceeds a preset threshold, extract the target protocol from the multi-protocol switching table based on the connection recovery strength, and combine the target protocol with the switching response speed to obtain the protocol switching decision. The connection optimization configuration generation module is used to calculate connection adjustment parameters according to the protocol switching decision, inject the connection adjustment parameters into the underlying communication driver for reconstruction, and obtain the connection optimization configuration. The closed-loop optimization module is used to update the preset keyboard connection settings according to the connection optimization configuration to obtain optimized connection stability. When the optimized connection stability is lower than a preset threshold, candidate communication frequency bands are re-selected and protocol matching is performed to determine the final connection scheme.