Keyboard multimode pairing method, device and equipment and storage medium
By using a pre-connection mechanism and a switching time calculation model, the keyboard multi-mode pairing process is dynamically adjusted, solving the problems of long switching delay and low connection success rate in traditional technologies, and achieving fast and stable device switching.
Patent Information
- Application Number
- CN202511265887.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-11-07
AI Technical Summary
Traditional keyboard multi-mode pairing technology suffers from long switching delays, lack of dynamic adjustment, and low connection success rates, especially performing poorly in complex network environments.
By adopting a pre-connection mechanism, a handover time calculation model is established, which combines user key press behavior patterns, device historical response characteristics, and network environment status to dynamically calculate the theoretically optimal handover time and select appropriate node activation strategies and power allocation schemes to achieve instantaneous device handover.
It significantly reduces device switching time, improves connection success rate and switching efficiency, and adapts to the performance requirements of different usage scenarios.
Smart Images

Figure CN120916271A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of keyboard pairing, in particular to a keyboard multi-mode pairing method, device, equipment and storage medium. BACKGROUND
[0002] The traditional keyboard multi-mode pairing technology generally adopts a fixed delay mechanism and a single connection strategy. When a user needs to switch between multiple paired devices, a response time of 2-5 seconds is often required, which seriously affects the continuity of user operation and work efficiency. The switching of keyboard devices in the prior art mainly relies on experience value setting and static parameter configuration, and cannot be dynamically adjusted according to the actual network environment, device characteristics and user behavior patterns, resulting in inconsistent switching performance in different use scenarios.
[0003] The core problem of the current keyboard multi-mode pairing technology is the lack of intelligent switching time prediction mechanism and adaptive node coordination strategy. The traditional scheme usually adopts a serialized connection attempt method, i.e., trying one communication protocol first, and then trying other protocols after failure. This passive response mode not only increases the switching time, but also reduces the connection success rate. At the same time, the prior art lacks comprehensive consideration of the user operation urgency, device historical response characteristics and network environment changes, and cannot realize personalized switching optimization, especially in complex network environments, which is prone to connection failure or slow response. SUMMARY
[0004] The main purpose of the present application is to provide a keyboard multi-mode pairing method, device, equipment and storage medium. The present application adopts a pre-connection mechanism to establish a target device connection in advance before the user completes the switching instruction, changes passive response switching to active prediction switching, and realizes instantaneous device switching.
[0005] To achieve the above purpose, the present application provides a keyboard multi-mode pairing method, comprising the following steps: According to the reference switching time of the keyboard hardware, the protocol node coordination coefficient, the device response weight coefficient and the pre-connection optimization coefficient, a switching time calculation model of the keyboard is established; Monitor the user key behavior pattern and combine the connection weight and historical response time ratio of the paired device to calculate the theoretical optimal switching time of the current switching scenario through the switching time calculation model; According to the theoretical optimal switching time, select the single node direct switching, double node pre-connection or three node parallel pre-connection working mode of the keyboard Bluetooth node, 2.4GHz node and USB node; According to the timing requirements of the working mode, activate the corresponding communication node, send a connection handshake signal to the target device and establish a communication link pre-connection state; After detecting that the user completes the device switching instruction, the keyboard input and output are switched from the current device to the target device based on the communication link pre-connection state, and the fast connection switching between devices is completed.
[0006] Optionally, in the first implementation manner of the first aspect, the switching time calculation model of the keyboard is established according to the reference switching time of the keyboard hardware, the protocol node coordination coefficient, the device response weight coefficient and the pre-connection optimization coefficient, and the switching time calculation model comprises: The reference switching time is obtained by analyzing the response characteristics of the keyboard hardware, and the keyboard hardware comprises a Bluetooth chip, a 2.4 GHz wireless module and a USB controller; The basic parameter set comprising the protocol node coordination coefficient, the device response weight coefficient and the pre-connection optimization coefficient is configured according to the reference switching time; The connection weight of the paired device is quantitatively calculated based on the device type identification and the connection frequency data of the paired device, and the historical response time ratio is calculated according to the historical connection time record of the paired device, so as to obtain the device connection parameter data comprising the connection weight and the historical response time ratio; The pre-connection success probability function is constructed based on the signal strength, the network congestion degree and the device power state of the current network environment; The basic parameter set, the device connection parameter data and the pre-connection success probability function are combined and operated according to the mathematical relationship of exponential decay and weighted summation, so as to obtain the switching time calculation model.
[0007] Optionally, in the second implementation manner of the first aspect, the user key pressing behavior mode is monitored, the connection weight and the historical response time ratio of the paired device are combined, the theoretical optimal switching time of the current switching scene is calculated through the switching time calculation model, and the theoretical optimal switching time comprises: The key pressing frequency, the key pressing interval time and the key pressing duration of the user within a preset time window are collected and analyzed in real time, so as to obtain the user key pressing behavior mode; The user operation emergency degree is evaluated according to the user key pressing behavior mode, and the device response analysis is performed on the user operation emergency degree by reading the connection weight and the historical response time ratio of the target device from the device connection parameter data, so as to obtain the device response weight value; The pre-connection success probability function is dynamically calculated based on the signal strength, the network congestion degree and the device power state of the target device, so as to obtain the pre-connection success probability value under the current network environment; The user operation emergency degree score, the device response weight value and the pre-connection success probability value are input into the switching time calculation model for comprehensive operation, so as to obtain the theoretical optimal switching time of the current switching scene.
[0008] Optionally, in a third implementation form of the first aspect of the present application, the step of selecting the single-node direct switching, the two-node pre-connection or the three-node parallel pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node according to the theoretical optimal switching time comprises: comparing the theoretical optimal switching time with the first preset threshold and the second preset threshold; selecting the single-node direct switching of the keyboard Bluetooth node, the 2.4GHz node and the USB node as the working mode when the theoretical optimal switching time is less than the first preset threshold; selecting the two-node pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node as the working mode when the theoretical optimal switching time is between the first preset threshold and the second preset threshold; selecting the three-node parallel pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node as the working mode when the theoretical optimal switching time is greater than or equal to the second preset threshold.
[0009] Optionally, in a fourth implementation form of the first aspect of the present application, the step of activating the corresponding communication node according to the time sequence requirement of the working mode, sending the connection handshake signal to the target device and establishing the communication link pre-connection state comprises: configuring the activation time sequence of the keyboard Bluetooth node, the 2.4GHz node and the USB node according to the working mode to obtain a node activation time sequence scheme; performing power distribution and channel configuration on the communication node based on the node activation time sequence scheme to obtain a communication node working configuration; inputting the target device identification and connection parameters into the communication node working configuration to send the connection handshake signal, and each activated node sends the connection request and identity authentication data to the target device in parallel according to the configured time sequence to obtain a multi-path connection attempt state; performing real-time monitoring analysis on the multi-path connection attempt state, and immediately sending a connection stop instruction to other nodes when detecting that any communication node successfully establishes a connection with the target device, while recording the node identification and connection parameters of the successfully connected node to obtain a communication link pre-connection state.
[0010] Optionally, in a fifth implementation form of the first aspect of the present application, the step of switching the keyboard input and output from the current device to the target device based on the communication link pre-connection state after detecting that the user completes the device switching instruction to complete the fast connection switching between devices comprises: performing real-time scanning and identification on the user key sequence, and immediately reading the communication link pre-connection state when detecting the combination input of the Fn key and the number key to verify whether the target device connection has been established to obtain a switching execution condition confirmation result; According to the switching execution condition confirmation result, a connection state switching operation is performed on the current device and the target device, a connection suspension instruction is sent to the current device, the connection state is marked as a hibernation mode, meanwhile, a connection channel of the target device is activated and keyboard input and output are redirected to the target device, and a device connection switching completion state is obtained; Based on the device connection switching completion state, a connection stability verification test is performed on the target device, and a connection verification result is obtained. According to the connection verification result, when the verification passes, the current device identifier is updated and a switching success timestamp is recorded, when the verification fails, a connection recovery program is started to reestablish the connection through a backup communication node or fall back to the original device connection state, and a device switching state is obtained.
[0011] Optionally, in the sixth implementation manner of the first aspect of the present application, the keyboard multi-mode pairing method further includes: Based on the switching process from the current device to the target device, a multi-target reinforcement learning state vector containing the current switching state, the historical switching sequence and the device response characteristics is constructed, and a multi-target reward signal is calculated based on three optimization targets of minimum switching time, maximum connection success rate and minimum power consumption; Based on the multi-target reinforcement learning state vector and the multi-target reward signal, a multi-target reward function is calculated, and a multi-target optimization evaluation index is obtained. The multi-target optimization evaluation index is input into a Q learning algorithm to calculate a parameter update strategy, an adjustment action of a protocol node cooperation coefficient, a device response weight coefficient and a pre-connection optimization coefficient is selected through an exploration-exploitation balance mechanism, a Q value function is updated using a gradient descent method, and a reinforcement learning optimization action is calculated. According to the reinforcement learning optimization action, the correlation coefficient of the switching time calculation model is adaptively adjusted, and an optimized switching time calculation model is obtained.
[0012] The present application also provides a keyboard multi-mode pairing device, comprising: The establishment module is configured to establish a switching time calculation model of the keyboard according to the reference switching time of the keyboard hardware, the protocol node cooperation coefficient, the device response weight coefficient and the pre-connection optimization coefficient. The calculation module is configured to monitor the user keying behavior pattern, combine the connection weight of the paired device and the historical response time ratio, and calculate the theoretical optimal switching time of the current switching scene through the switching time calculation model. The selection module is configured to select the working mode of single-node direct switching, double-node pre-connection or three-node parallel pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node according to the theoretical optimal switching time. The activation module is configured to activate the corresponding communication node according to the timing requirement of the working mode, send a connection handshake signal to the target device, and establish a communication link pre-connection state. The switching module is configured to switch the keyboard input and output from the current device to the target device based on the communication link pre-connection state after detecting that the user completes the device switching instruction, and complete the fast connection switching between devices.
[0013] The application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of the preceding embodiments when executing the computer program.
[0014] The application further provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method according to any one of the preceding embodiments when executed by a processor.
[0015] In summary, the technical scheme provided by the application can dynamically calculate the theoretically optimal switching time according to the user key behavior mode, device historical response characteristics and network environment state by establishing a switching time calculation model based on the keyboard hardware characteristics and the cooperation of multiple protocol nodes, and significantly reduces unnecessary waiting time compared with the traditional fixed delay mechanism. By intelligently selecting the working mode of single node direct switching, double node pre-connection or three node parallel pre-connection, and combining the differentiated node activation strategy and power distribution scheme, the best switching performance can be obtained in different scenarios. The pre-connection mechanism can establish the target device connection in advance before the user completes the switching instruction, and change the passive response switching to active prediction switching, thereby realizing instantaneous device switching. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is a step schematic diagram of the keyboard multi-mode pairing method in an embodiment of the application; Figure 2 is a structural block diagram of the keyboard multi-mode pairing device in an embodiment of the application; Figure 3 is a structural schematic block diagram of the computer device in an embodiment of the application.
[0017] The implementation of the application, functional features and advantages will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical scheme and advantages of the application more clear, the application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application and do not limit the application.
[0019] Reference Figure 1The embodiment provides a keyboard multi-mode pairing method, which comprises the following steps: S1, a switching time calculation model of the keyboard is established according to a reference switching time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient; Wherein, the response characteristics of the hardware modules in the keyboard are analyzed, the analysis covers three main communication nodes of Bluetooth chip, 2.4GHz wireless module and USB controller, through testing their starting delay, switching response and interruption recovery time under typical working conditions, a representative average response time in the minimum stable state is obtained as the reference switching time of the keyboard. On this basis, the basic parameter set required for the calculation model is further configured, including the coordination coefficient for adjusting the coordination ability between multi-protocol nodes, the response weight coefficient for reflecting the influence of historical device response behavior on the current judgment, and the pre-connection optimization coefficient for quantifying the influence degree of the current connection state of the target device on the connection efficiency, these parameters jointly determine the dynamic adaptability of the model. Data extraction and behavior statistics are performed on all paired external devices, the connection weight of each device is calculated according to the device type identifier, the use frequency, the recent connection success rate and other indicators, and the ratio between the time consumed by each device in the past connection and the reference switching time is analyzed to obtain the historical response time ratio, thereby forming a device connection parameter data set. At the same time, the current network environment information is collected, and a real-time updateable pre-connection success probability function is constructed according to the real-time signal strength of the target device, the congestion degree of the network and the current power state and other factors, which is used to predict the possibility of successful connection of the target device under the current environment. The basic parameter set, the device connection parameter data and the pre-connection success probability function are introduced into the unified modeling system, the decreasing trend of the connection efficiency in the time advancing process is expressed in the form of exponential decay, and the weighted summation method is used to combine the influence factors according to the weight proportion, thereby establishing a switching time calculation model for multi-mode keyboard devices, which has environment adaptability and behavior prediction ability.
[0020] S2, the user keying behavior mode is monitored, and the connection weight and the historical response time ratio of the paired devices are combined, and the theoretical optimal switching time of the current switching scene is calculated through the switching time calculation model; Specifically, a set of key behavior real-time monitoring modules are configured inside the keyboard. The modules continuously collect and process data of the user's key actions within a preset time window, including the key frequency per unit time, the interval time between adjacent keys, and the duration of each key press. Through pattern recognition and feature analysis of these behavior parameters, the behavior rhythm and response density of the current user operation are extracted. According to the analysis results, the user's operation urgency is evaluated and numerically scored as an emergency degree score, which reflects whether the user is in a high-frequency switching or regular operation state. The connection weight value of the current target device and its historical response time ratio are extracted from the device connection parameter data. Through joint analysis of the two with the user's emergency degree score, the response ability of the device to the user's switching request under the current situation is comprehensively evaluated, generating a device response weighting value that reflects the matching degree of the user's operation priority and the device's response ability. At the same time, the network communication environment of the target device is monitored, and dynamic parameters such as the current signal strength, bandwidth occupancy rate of the frequency band, and device remaining power state that affect communication efficiency are obtained in real time. Based on this, the pre-connection success probability function is updated and calculated, obtaining a pre-connection success probability value that conforms to the current network state, which measures the potential interference or additive effect of the device's current environment on the connection behavior. The user's operation emergency degree score, device response weighting value, and pre-connection success probability value under the current network environment are input into the switching time calculation model, and through the exponential decay function and weighted combination relationship set in the model, a theoretical optimal switching time that is updated in real time with the change of the use scenario is output.
[0021] S3, according to the theoretical optimal switching time, selecting the working mode of single-node direct switching, double-node pre-connection, or three-node parallel pre-connection of the keyboard Bluetooth node, 2.4GHz node, and USB node; It should be noted that two sets of preset time thresholds are set in the keyboard switching control module, which are respectively used to determine the response interval of the theoretical optimal switching time, wherein the first preset threshold is used to distinguish the high response rate scene, and the second preset threshold is used to identify the switching scene with slow response or complex environment. The theoretical optimal switching time is compared with the first preset threshold and the second preset threshold in sequence, so as to trigger the corresponding node activation strategy decision process. If the theoretical optimal switching time is lower than the first preset threshold, it is determined that the current target device has high response capability, high connection stability and good network environment, so the working mode is selected as single node direct switching, and one of the Bluetooth node, 2.4GHz node or USB node in the communication protocol channel is automatically selected as the active channel according to the connection record of the target device, and the connection operation is quickly completed through centralized resources; if the theoretical optimal switching time is between the first preset threshold and the second preset threshold, it indicates that the current target device has general response but the connection success rate fluctuates, so the system selects the working mode as double node pre-connection, and selects two nodes with complementary communication capabilities as the main node and the standby node in the three communication protocols, and tries to establish the channel in parallel connection mode to improve the connection success rate and anti-interference ability; when the theoretical optimal switching time is greater than or equal to the second preset threshold, it means that the target device has relatively poor response performance or the network environment is relatively complex, and the single channel connection success rate is low, so the system selects the working mode as three node parallel pre-connection, and activates the Bluetooth, 2.4GHz and USB three nodes, and initiates the connection attempt in the interval mode according to the predetermined time sequence, to ensure that at least one channel can stably establish the connection.
[0022] S4, according to the time sequence requirement of the working mode, activate the corresponding communication node, send the connection handshake signal to the target device and establish the communication link pre-connection state; Specifically, the Bluetooth node, 2.4GHz node and USB node are configured with activation timing according to the working mode, and the node activation order and delay parameters are formulated according to the selected mode, so as to generate a node activation timing scheme. In the single-node direct switching mode, only the communication node with the highest priority is activated immediately, while in the dual-node pre-connection mode, the activation order and start interval of the primary and standby nodes are configured, for example, the primary node is activated immediately, and the standby node is started after 200 milliseconds. In the three-node parallel pre-connection mode, the order of starting the Bluetooth, 2.4GHz and USB nodes in turn with an interval of 100 milliseconds is formulated. According to the node activation timing scheme, the power resource allocation and communication channel configuration of each communication node are performed. In terms of power, a differentiated allocation strategy is adopted, for example, in the dual-node mode, 70% of the power is allocated to the primary node and 30% to the standby node, while in the three-node mode, the power is allocated to the Bluetooth, 2.4GHz and USB nodes in the proportion of 50%, 30% and 20% respectively. Independent communication channels and connection parameters are allocated to each node according to the network congestion degree and channel interference condition, to form the communication node working configuration. The identification information of the target device and the handshake parameters required for connection are loaded into the communication node working configuration, and according to the established activation timing control scheme, the activated communication nodes are driven to send connection request and identity verification related data packets to the target device in parallel. During the multi-path connection attempt, each node maintains an independent connection queue, error retransmission mechanism and response timeout judgment, to ensure that there is no channel competition or conflict problem during the multi-path attempt process. The entire multi-path connection attempt state is monitored and analyzed in real time. When any communication node first successfully completes the handshake process with the target device and confirms the establishment of a stable connection channel, the system immediately broadcasts a connection termination instruction to all other communication nodes that have not completed the connection, terminates their subsequent connection attempt process, and releases the related communication resources. At the same time, the successfully connected node identification, communication channel number and related connection parameters are recorded and output as the current communication link pre-connection state.
[0023] S5, after detecting that the user completes the device switching instruction, the keyboard input and output are switched from the current device to the target device based on the communication link pre-connection state, to complete the fast connection switching between devices.
[0024] Among them, the user's key behavior is scanned and identified in real time, the combination input of Fn key and number key with control instruction significance is monitored with high priority, when the combination input that meets the switching intention is detected in the key sequence, the system immediately interrupts the regular key signal processing flow, calls the previously established communication link pre-connection state data, verifies the connection completion state of the target device, confirms whether the direct switching condition is met, and generates the switching execution condition confirmation result. If it is confirmed that the target device connection has been established and is in a usable state, the connection state conversion operation is started immediately, the connection pause instruction is sent to the currently connected device instead of the disconnect instruction, and the state is marked as hibernation mode in the connection state database to reserve the connection context of the device. Then activate the communication channel corresponding to the target device, redirect the input and output data path of the keyboard in the internal channel mapping, make all keyboard signals transmitted to the new device immediately, and start a new signal return listening process, thus forming the device connection switching completion state. After completing the redirection operation, start the connection stability verification test mechanism, send a verification signal to the target device by simulating a low-risk but measurable key event (such as Caps Lock state switching), and wait for its response. Perform delay response detection, packet loss rate statistics, and signal strength confirmation to determine three indicators, and comprehensively judge whether the target device connection meets the stable use standard to form the connection verification result. If the verification is passed, the system updates the identification information of the currently activated device, records the time stamp of this successful switching into the device switching log, and updates the device connection weight and historical response record; if the verification fails, start the connection recovery program, try to re-establish the connection with the target device through the standby communication node according to the previously saved communication node activation information, if the reconnection fails, the system automatically falls back to the original device connection state and cancels this switching process, thereby generating the final device switching state.
[0025] In one example, according to the reference switching time of the keyboard hardware, the protocol node coordination coefficient, the device response weight coefficient and the pre-connection optimization coefficient, a switching time calculation model of the keyboard is established, including: The response characteristics of the keyboard hardware are analyzed to obtain the reference switching time, the keyboard hardware including a Bluetooth chip, a 2.4GHz wireless module and a USB controller; According to the reference switching time, a basic parameter set containing the protocol node coordination coefficient, the device response weight coefficient and the pre-connection optimization coefficient is configured; The connection weight of the paired device is quantitatively calculated based on the device type identification and connection frequency data of the paired device, and the historical response time ratio is calculated according to the historical connection time record of the paired device to obtain device connection parameter data containing the connection weight and the historical response time ratio; Construct a pre-connection success probability function based on the signal strength, network congestion degree and device power state of the current network environment; Combine the basic parameter set, device connection parameter data and pre-connection success probability function according to the mathematical relationship of exponential decay and weighted summation to obtain a switching time calculation model.
[0026] In this example, the response characteristics of the main communication modules inside the keyboard are analyzed. The keyboard hardware mainly includes Bluetooth chips, 2.4 GHz wireless modules, and USB controllers, three types of communication units. Due to differences in protocol mechanisms, communication media, wake-up modes, and energy consumption strategies, the response capabilities of these modules exhibit significantly different dynamic characteristics. The system tests the start-stop response delay, handshake request response time, and connection establishment average time of the three types of modules in different environments. Combined with statistical data from multiple batches of devices in cold start, hot switching, and reconnection scenarios, the system extracts the time constant representing the overall response capability of the keyboard communication modules and defines it as the reference switching time. Based on the reference switching time, the system constructs a basic parameter set. To describe the response time overlap or coupling phenomenon generated by multiple protocol nodes during collaborative activation or competitive connection, the system introduces the protocol node collaboration coefficient, which uses the mutual exclusion response rate of the three types of communication protocols in parallel connection tests as the basis weight extraction factor to adjust the sensitivity of the time decay function to protocol interference behavior in the model. To continuously affect the current switching judgment with the performance of historical devices, the system introduces the device response weight coefficient, which calculates the weighted result by accumulating the response time proportion and the number of failed reconnections of paired devices in the past multiple switching. This enhances the model's utilization of long-term behavior characteristics. To enhance the model's prediction of the current connection success probability, the system introduces the pre-connection optimization coefficient, which adjusts the proportion of environmental evaluation factors in the connection time function, making the model still have high decision-making rationality in complex scenarios. The system identifies and analyzes all paired devices by reading device type identifiers and connection frequency data, classifies different types of devices, and quantifies their connection weights based on their switching frequency, connection failure records, and average response time in the recent period. To improve the dynamic response capability of the data, the system uses the exponential moving average algorithm to give higher weights to the latest connection behavior, giving higher priority to frequently used high-performance devices. At the same time, the system calculates the ratio of the response time of each connection to the reference switching time based on the historical connection time records of each paired device, obtaining the historical response time ratio. Together with the device connection parameter dataset, they express the comprehensive performance of the target device in response capability and usage preference dimensions. The system performs real-time analysis of the current network environment, including the signal strength of the target device, electromagnetic interference background, congestion degree of the network channel, and current power state. These parameters are obtained through multi-sensor collaboration and input into the network environment analysis module in real time. The system uses nonlinear interpolation and fuzzy weighting to construct a pre-connection success probability function, with the function output value representing the theoretical success probability of attempting to establish a connection under the current conditions, ranging from 0 to 1 and dynamically adjusting with environmental changes.The basic parameter set, device connection parameter data and pre-connection success probability function are input into the mathematical model for combined operation. The operation process is coupled and expressed by two mechanisms of exponential decay and weighted summation. The exponential decay is used to simulate the nonlinear decreasing trend of the device response ability changing with time, and also embodies the negative influence of long response time device on the overall performance prediction. The weighted summation mechanism proportionally fuses the connection weight, response ratio and success probability to construct the current comprehensive connection ability index. The final output of the comprehensive operation is the theoretical optimal switching time generated by the switching time calculation model.
[0027] In one example, the user key behavior pattern is monitored, and the connection weight and historical response time ratio of the paired device are combined to calculate the theoretical optimal switching time of the current switching scene through the switching time calculation model, including: The key frequency, key interval time and key duration of the user within a preset time window are collected and analyzed in real time to obtain the user key behavior pattern; The user operation urgency is evaluated according to the user key behavior pattern, and the device response analysis of the user operation urgency is performed from the connection weight and historical response time ratio of the target device in the device connection parameter data to obtain the device response weighted value; The pre-connection success probability function is dynamically calculated based on the signal strength, network congestion degree and device power state of the target device to obtain the pre-connection success probability value under the current network environment; The user operation urgency score, device response weighted value and pre-connection success probability value are input into the switching time calculation model for comprehensive operation to obtain the theoretical optimal switching time of the current switching scene.
[0028] In this example, the user's key behavior within a preset time window is collected and analyzed in real time. The keyboard switching controller embeds a high-frequency key scanning module that continuously monitors all user typing activities at millisecond-level sampling intervals and processes the key data generated by the user within each fixed-length time window (e.g., 30 seconds) in a structured manner. This includes counting the total number of keys pressed per unit time to generate a key frequency indicator, calculating the average time interval between adjacent key presses to extract a key interval parameter, and detecting the time span of a single key from pressing to releasing to extract a key duration indicator. The key frequency, key interval time, and key duration input behavior recognition model forms the user's key behavior pattern, and the system quantifies the urgency of the user's current operation based on the built-in urgency evaluation function. This function combines the increase in key frequency, the contraction trend of key interval, and the shortening of key duration to output an urgency score that reflects whether there is a clear need for rapid switching in the current input behavior. At the same time, the system analyzes the user operation urgency score in relation to the response capability of the target device, extracts the connection weight value and historical response time ratio of the current switching target from the device connection parameter data set, and cross-matches these two parameters with the urgency score through the device response analysis module to generate a device response weighting value that reflects the matching degree between the user's urgent demand and the device's actual response capability. At the same time, the system dynamically evaluates the network environment in which the target device is currently located, specifically including the acquisition and analysis of three key indicators. Signal strength parameter, through the real-time RSSI value measurement of Bluetooth and 2.4GHz modules to judge the connection physical quality of the device; network congestion degree analysis, by detecting the communication traffic density and retransmission ratio in the channel to judge whether there is interference and delay in the data link; device power state monitoring, the system reads the remaining power of the target device through the standard protocol to judge whether it is in the high-performance response stage or the energy-saving restriction mode. The three parameters form the network state input set, which is input into the pre-connection success probability function for real-time calculation. This function uses a weighted fitting form to map the three parameters to a normalized probability value, outputting the theoretical possibility of the target device's pre-connection success under the current network condition, which is the pre-connection success probability value. The user operation urgency score, device response weighting value, and pre-connection success probability value are input into the switching time calculation model for comprehensive operation. This model internally builds a response prediction engine based on an exponential decay function, a linear superposition function, and a constraint normalization function. The engine takes the baseline switching time as the reference time point, adjusts the decay curve slope according to the user behavior intensity, stretches or compresses the model curve's horizontal distribution according to the device response characteristics, and finally adjusts the dynamic displacement within the output time interval based on the current network state judgment function. The weight proportion of the three parameters is optimized in real time through a dynamic parameter adjustment mechanism, resulting in a theoretical optimal switching time value.
[0029] In one example, according to the theoretical optimal switching time, the working mode of single-node direct switching, double-node pre-connection or three-node parallel pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node is selected, including: numerically comparing the theoretical optimal switching time with the first preset threshold and the second preset threshold; when the theoretical optimal switching time is less than the first preset threshold, the working mode is selected as single-node direct switching of the keyboard Bluetooth node, the 2.4GHz node and the USB node; when the theoretical optimal switching time is between the first preset threshold and the second preset threshold, the working mode is selected as double-node pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node; when the theoretical optimal switching time is greater than or equal to the second preset threshold, the working mode is selected as three-node parallel pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node.
[0030] In this example, a switching time interval judgment mechanism is established within the keyboard switching controller, which takes the theoretically optimal switching time as the core input variable and presets two key thresholds as the demarcation criteria, namely the first preset threshold and the second preset threshold. The first preset threshold is used to distinguish high-performance fast connection scenarios, while the second preset threshold is used to identify connection scenarios in high complexity or weak response environments. The system continuously compares the theoretically optimal switching time calculated by the switching time calculation model with the first preset threshold and the second preset threshold in the time judgment module. When the theoretically optimal switching time is less than the first preset threshold, it indicates that the current switching behavior has high response efficiency, the user's operation urgency is low, or the target device has strong connection capability, and the network environment is stable with minimal interference. At this time, the model judges that it is in the connection resource consumption minimization interval, so the system automatically selects the lightest working mode, i.e., single-node direct switching. In this mode, the system selects a single communication node as the active channel according to the communication protocol priority of the target device among the Bluetooth node, 2.4GHz node, or USB node. This node is assigned all the connection power resources, and the remaining nodes remain in sleep state. The system initiates a connection handshake request to the target device through the shortest path and quickly completes the connection establishment, thereby realizing a fast response mode with low power consumption, low resource occupation, and high connection success rate, which is suitable for immediate switching operation of high-frequency commonly used devices and shortens the overall switching process by simplifying the connection channel. When the theoretically optimal switching time is between the first preset threshold and the second preset threshold, it is judged to be in the intermediate response interval. This scenario reflects that the user's operation intensity is moderate, but the connection state of the target device fluctuates, such as the device being in a critical signal range, the power being low, or there being intermittent connection delays. At this time, the system automatically enables the dual-node pre-connection mode to balance the connection success rate and resource usage efficiency. In this mode, the controller activates two communication nodes as connection channels, one as the main connection path and the other as the redundant standby path. A fixed time difference is set between the two nodes, such as the main node being activated immediately and the standby node being activated after a 200-millisecond delay to avoid synchronization interference. The system will use a differentiated power allocation scheme, such as 70% power for the main node and 30% power for the standby node, and configure different channel parameters and handshake mechanisms for the two nodes. When the theoretically optimal switching time is greater than or equal to the second preset threshold, the system judges that the current switching scenario is in the worst response capability interval. This situation is commonly seen when the target device is in a weak signal area, there is significant network congestion, or the historical connection failure rate is high, while the user is in a high-intensity fast switching behavior mode.To cope with such complex conditions and guarantee the minimum stability of the connection, the system automatically selects a three-node parallel pre-connection mode, in which the three types of communication nodes, Bluetooth, 2.4GHz and USB, are activated in sequence or in parallel, and an interval activation strategy is adopted among them, for example, the Bluetooth node is activated first, and then the 2.4GHz node and the USB node are activated in turn after 100 milliseconds, so as to disperse the risk of connection conflict; at the same time, all the three nodes are configured with independent connection parameters, handshake paths and error retransmission mechanisms, and a connection state monitoring thread is set up internally, so as to immediately issue a connection termination instruction to the remaining nodes as soon as any node successfully establishes a connection, thereby releasing system resources and recording the identity of the successful node.
[0031] In one example, the corresponding communication nodes are activated according to the timing requirements of the working mode, connection handshake signals are sent to the target device, and the communication link pre-connection state is established, including: The activation timing configuration of the keyboard Bluetooth node, the 2.4GHz node and the USB node is configured according to the working mode, and the node activation timing scheme is obtained; Based on the node activation timing scheme, the power distribution and channel configuration of the communication nodes are performed, and the communication node working configuration is obtained; The target device identity and connection parameters are input into the communication node working configuration for connection handshake signal sending, each activated node sends connection request and identity verification data to the target device in parallel according to the configured timing, and the multi-path connection attempt state is obtained; The multi-path connection attempt state is monitored and analyzed in real time, and when it is detected that any communication node successfully establishes a connection with the target device, a connection stop instruction is immediately sent to the other nodes, and the node identity and connection parameters of the successful connection are recorded, and the communication link pre-connection state is obtained.
[0032] In this example, the keyboard Bluetooth node, 2.4GHz node and USB node are activated according to the working mode, the internal configuration of the node priority mapping table, the combination of the target device's historical communication protocol preference and the current device switching context information, the determination of the communication node set to be activated under the current strategy, and the sorting and delay allocation of each node according to the protocol type, connection initialization time, power consumption characteristics and anti-interference ability, etc. The node activation timing scheme is obtained. Based on the node activation timing scheme, according to the communication protocol specification and device energy consumption management requirements of different nodes, power allocation and channel parameter setting are performed on all communication nodes to be activated. In terms of power allocation, the system adopts a proportional strategy to allocate overall connection power resources according to different working modes, such as allocating 70% to the master node and 30% to the standby node in the two-node mode, and allocating 50%, 30% and 20% to the Bluetooth, 2.4GHz and USB nodes in the three-node mode. At the same time, in order to prevent multiple nodes from establishing connections in adjacent frequency bands at the same time and causing interference, the system independently allocates the communication channel, handshake code rate, identity verification protocol and retransmission mechanism of each node to form a node working configuration set, and preloads the connection failure fallback path and secondary attempt window length. The system loads the unique identification information and historical connection parameters of the target device into the configuration of each communication node to be activated, and starts the connection module of each node according to the previously determined node activation timing scheme, so that it sends connection request packets containing handshake request, device identity verification, connection capability description and other key data to the target device in turn or in parallel. This process is internally represented as the initiation of multiple path connection attempts, where each communication node maintains an independent handshake state machine and connection response buffer to ensure that they can be isolated from each other and not interfere with each other during parallel activation, and can independently complete the connection success or failure judgment criteria during the connection process. The system continuously records the request number, response delay, handshake failure code and other state information of each connection node during the connection attempt state. During the continuous operation of the connection attempt state, the system's connection state monitoring module analyzes and dynamically judges the connection results of all communication nodes in real time. When any node successfully completes identity verification and establishes a stable handshake connection with the target device, the system immediately issues a global connection stop command and broadcasts it to other communication nodes that are still trying to connect, forcing the termination of their connection process and releasing the occupied resources to avoid resource waste and redundant channel interference. At the same time, the system stores the node identification, communication protocol type, activation timestamp and handshake parameters of the successfully connected node in the communication link state register, updates the pre-connection state corresponding to the current switching task, and marks this state as a switchable state. At the same time of successful connection establishment, the connection configuration and connection time of the node are written into the device connection state database.
[0033] In one example, after detecting that the user completes the device switching instruction, the keyboard input and output are switched from the current device to the target device based on the communication link pre-connection state, completing the fast connection switching between devices, including: The user key sequence is scanned and recognized in real time, and when the combination input of the Fn key and the number key is detected, the communication link pre-connection state is read immediately, the target device connection is verified to determine whether it has been established, and a switching execution condition confirmation result is obtained; According to the switching execution condition confirmation result, the connection state switching operation is performed on the current device and the target device, a connection suspension instruction is sent to the current device and the connection state is marked as a hibernation mode, while the connection channel of the target device is activated and the keyboard input and output are redirected to the target device, and a device connection switching completion state is obtained; Based on the device connection switching completion state, the target device is tested for connection stability verification, and a connection verification result is obtained; According to the connection verification result, when the verification is passed, the current device identifier is updated and the switching success timestamp is recorded, when the verification fails, the connection recovery program is started to re-establish the connection through the standby communication node or to fall back to the original device connection state, and a device switching state is obtained.
[0034] In this example, the key scanning module integrated in the keyboard switching controller scans all key states at a millisecond level cycle and constructs a soft logic judgment unit for combination key recognition. The unit has a high priority for recognizing simultaneous pressing events between function keys (such as Fn keys) and number keys. When detecting a combination input that meets the set rules, the system immediately interrupts the regular distribution process of the current key data stream and calls the pre-connection state information of the communication link that has been previously constructed. It reads the connection establishment identifier, communication channel state, and activation timestamp corresponding to the current target device. By judging whether the target device has completed the connection handshake and is in the active channel maintenance state, the switching execution condition confirmation result is formed. If it is confirmed that the target device has not established an effective connection, the system will suspend the switching operation and enter the waiting retry process. If it is confirmed that the connection conditions are met, it will immediately enter the switching operation phase. In the switching execution phase, the system initiates a series of synchronous connection state adjustment operations based on the switching execution condition confirmation result. First, it sends a connection pause instruction to the current device. This instruction does not directly interrupt the communication channel, but switches the current communication path to sleep mode, allowing the current device's connection context to be preserved, thereby supporting fast switching without re-handshake. At the same time, the system updates the current device's state identifier to "sleeping" and saves it in the device connection state database. The system immediately activates the communication channel corresponding to the target device, which has completed the handshake establishment in the pre-connection process. Therefore, it only needs to redirect the keyboard's data input and output path from the original device's mapping channel to the target device's corresponding communication node through the logic control module, complete the data channel remapping, and ensure that user key inputs can be transmitted to the target device immediately without initializing the connection process again. After completing this series of operations, the system updates the device connection state identifier to "target device activated" and marks the switching task as "device connection switching complete state". After the switching action is completed, to ensure connection reliability and confirm that the target device's communication link has long-term stable operation capability, the system enters the connection stability verification test process. This process takes the simulated key trigger mechanism as the core and selects a key instruction with controllable system response and clear feedback (such as the Caps Lock key) as the test signal. It sends the instruction to the target device and captures the response signal state in the return channel. At the same time, the system synchronously performs delay measurement, signal strength confirmation, and data packet loss rate analysis. All three indicators must meet the system's set communication quality threshold to be considered a pass. Otherwise, the system considers the connection quality to be unsatisfactory and determines that the verification fails. Based on the connection verification result, the system decides the update strategy for the current device identifier and whether to perform subsequent recovery operations. If the verification is successful, the system updates the current active device identifier to the target device number and records the switching timestamp, channel type, verification delay, and handshake response information in the device switching log.If the verification fails, the connection recovery procedure is immediately started. The system first attempts to activate the target device connection path again through the backup communication node, and performs a secondary connection attempt process. If the reconnection is successful, the connection verification step is repeated to confirm whether it is available. If the backup node reconnection also fails, the system automatically falls back to the original device connection state, reactivates the channel to the original communication node, and redirects the input and output paths back to the previous device, ensuring that the keyboard maintains communication with at least one valid device. The entire switching process uses an atomic execution structure, which ensures that the system state can be rolled back and the data structure can be restored in the event of an exception at any stage, thereby achieving stable control, fast response, and high reliability of the connection between multi-mode devices. Finally, the device switching state is formed.
[0035] In one example, the keyboard multi-mode pairing method further comprises: Based on the switching process from the current device to the target device, a multi-target reinforcement learning state vector is constructed, which includes the current switching state, the historical switching sequence, and the device response characteristics. Meanwhile, a multi-target reward signal is calculated based on three optimization objectives of minimizing switching time, maximizing connection success rate, and minimizing power consumption. Based on the multi-target reinforcement learning state vector and the multi-target reward signal, a multi-target reward function is calculated to obtain a multi-target optimization evaluation index. The multi-target optimization evaluation index is input into the Q-learning algorithm to calculate the parameter update strategy. Through the exploration-exploitation balance mechanism, the adjustment actions of the protocol node coordination coefficient, the device response weight coefficient, and the pre-connection optimization coefficient are selected. The gradient descent method is used to update the Q value function and calculate the reinforcement learning optimization action. According to the reinforcement learning optimization action, the related coefficients of the switching time calculation model are adaptively adjusted to obtain an optimized switching time calculation model.
[0036] In this example, the full process information from the current device switching to the target device is structured and expressed, and a multi-target reinforcement learning state vector is constructed, which contains the current switching state, the historical switching sequence and the device response characteristics. Among them, the current switching state covers whether the target device connection is established, the current connection channel type, the actual switching time, whether the connection verification is passed, etc. The historical switching sequence records the selected communication path, the corresponding switching success rate and the number of failure retries in the past multiple rounds of device switching process. The device response characteristics are composed of connection weight, historical response time ratio and pre-connection success rate of the target device. The three types of information are fused into a multi-dimensional state vector by a state encoder, which is used as the input state space of the reinforcement learning model. At the same time, in order to consider performance, reliability and resource consumption in the switching strategy optimization process, the system defines three parallel optimization targets: minimum switching time, maximum connection success rate and minimum power consumption. The minimum switching time objective calculates the instantaneous loss function value through the deviation between the optimal switching time and the actual switching time. The maximum connection success rate objective generates a type-specific reward value through events such as whether the connection is successful at one time or whether a retry occurs. The minimum power consumption objective calculates the resource consumption penalty term based on the number of selected communication nodes and power allocation ratio. The three objectives output independent single-target reward signals, which are combined by weighting after being input into the multi-target reward function to form a multi-target reward signal. The state vector and multi-target reward signal are jointly input into the multi-target reinforcement learning controller. In this structure, an improved Q learning algorithm is used to build an optimization strategy solving framework. By introducing the function combination form of multi-objective evaluation indexes, the evaluation of each state-action pair not only reflects the efficiency of a single behavior, but also balances the overall performance of the three optimization objectives in the current scenario, obtaining a set of dynamically adjusted multi-objective optimization evaluation indexes. The Q learning process uses state transition probability and long-term revenue accumulation as the basic logical structure, and updates the corresponding Q value after each switching is completed. Through the optimization iteration of the Q value function, the system is guided to converge to the optimal strategy path in performance. In the strategy updating process, the system uses an exploration-exploitation balance mechanism to maintain the dynamic balance between the breadth of the search space and the practicality of the strategy selection, i.e. selecting a strategy that proportionally controls the optimal action indicated by the maximum value of the current Q value estimate and other possible actions. In the specific execution of the update, the system uses the protocol node coordination coefficient, the device response weight coefficient and the pre-connection optimization coefficient as the target parameters of strategy optimization. These three coefficients are the most influential variables in the switching time calculation model, which determine the sensitivity of the theoretical switching time to communication coupling, historical response and connection feasibility.The optimized action output by the Q-learning model is parsed as an instruction for fine-tuning three coefficients, and the Q value of the corresponding state-action pair is updated by performing gradient descent calculation on the current parameter value with positive and negative increments and combining the learning rate, so that the entire model is more inclined to use the combination of coefficients with better performance in subsequent switching. The system records this optimized action and its results in the policy cache area to support batch training and long-term policy review. After completing Q value update and policy action optimization, the system adjusts the relevant core coefficients in the model according to the output reinforcement learning optimization action for switching time calculation. Specifically, it reconfigures the node coordination coefficient related to the communication node response relationship in the model, the response weight coefficient reflecting the importance proportion of the device historical performance, and the pre-connection optimization coefficient measuring the accuracy of the connection prediction ability. The new coefficient value will directly replace the old value in the next round of switching time calculation and continue to accept evaluation and adjustment by the reinforcement learning mechanism during use. This process continues to circulate, allowing the entire switching time calculation model to achieve structural parameter optimization and policy evolution as the use scenario changes, the number of devices grows, and the communication environment fluctuates, thereby building a multi-objective adaptive time control system.
[0037] With reference to Figure 2 The embodiment provides a keyboard multi-mode pairing device, comprising: A establishing module 1 is configured to establish a switching time calculation model of the keyboard according to a reference switching time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient, and a pre-connection optimization coefficient; A calculation module 2 is configured to monitor user keying behavior patterns and calculate a theoretical optimal switching time of a current switching scenario through the switching time calculation model in combination with a connection weight and a historical response time ratio of a paired device; A selection module 3 is configured to select a single-node direct switching, double-node pre-connection, or three-node parallel pre-connection working mode of a keyboard Bluetooth node, a 2.4 GHz node, and a USB node according to the theoretical optimal switching time; An activation module 4 is configured to activate corresponding communication nodes according to a time sequence requirement of the working mode, send a connection handshake signal to a target device, and establish a communication link pre-connection state; A switching module 5 is configured to switch keyboard input and output from a current device to a target device based on the communication link pre-connection state after detecting that a user completes a device switching instruction, and complete fast connection switching between devices.
[0038] In the embodiment, the specific implementation of each unit in the device embodiment is described above in the method embodiment, which will not be repeated here.
[0039] The application can dynamically calculate the theoretical optimal switching time according to the specific conditions of the current switching scene by establishing a switching time calculation model based on the keyboard hardware characteristics, protocol node coordination coefficient, device response weight coefficient and pre-connection optimization coefficient, compared with the traditional fixed delay mechanism, can significantly reduce unnecessary waiting time and avoid switching timeout problem. According to the relationship between the theoretical optimal switching time and the preset threshold, the working mode of single node direct switching, double node pre-connection or three node parallel pre-connection is intelligently selected, and the best switching performance can be obtained in different network environments and device response conditions through the differentiated node activation strategy and power distribution scheme. By establishing the communication link pre-connection state of the target device in advance before the user completes the switching instruction, the traditional passive response switching is changed into active predictive switching, the waiting time of connection establishment is eliminated, and the real instantaneous device switching is realized. By real-time monitoring the user key behavior mode and quantifying the user operation urgency, combined with the historical connection characteristics of the target device, personalized switching optimization scheme can be provided for different user operation habits and device use preferences. Based on the multi-objective optimization target of minimizing switching time, maximizing connection success rate and minimizing power consumption, the Q learning algorithm is used to realize the adaptive adjustment of parameters, so that the system can continuously learn and improve in the use process, adapt to network environment changes and device aging and other factors. Through the multi-path parallel connection attempt and real-time connection state monitoring mechanism, when the main connection path has a problem, it can quickly switch to the standby path, and at the same time provides connection recovery and fallback mechanism, ensures that the keyboard can maintain effective connection with at least one device in any case.
[0040] Reference Figure 3 In the embodiments of the application, a computer device is also provided, which can be a server, and the internal structure thereof can be as shown in Figure 3 The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in the embodiments. The network interface of the computer device is used to communicate with the external terminal through the network connection. The computer program is executed by the processor to implement the above method.
[0041] Those skilled in the art can understand Figure 3 that the structure shown in
[0042] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the method.
[0043] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the computer program can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium provided by the present application and used in the embodiments can include non-volatile and / or volatile memory. The non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. The volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM, etc.
[0044] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusions, so that processes, devices, articles or methods including a series of elements not only include those elements, but also include other elements not explicitly listed, or inherent to such processes, devices, articles or methods. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0045] The above description is only the preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, as described in the specification and drawings of the present application, are also included in the patent protection scope of the present application.
Claims
1. A method of keyboard multi-mode pairing, the method comprising: The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient.
2. The keyboard multi-mode pairing method of claim 1, wherein, The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient.
3. The keyboard multi-mode pairing method of claim 1, wherein, The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient. The application relates to a keyboard switch time calculation model based on a reference switch time of keyboard hardware, 4. The keyboard multi-mode pairing method of claim 3, wherein, The work mode of single-node direct switching, double-node pre-connection or three-node parallel pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node is selected according to the theoretical optimal switching time, including: The theoretical optimal switching time is compared with the first preset threshold and the second preset threshold; When the theoretical optimal switching time is less than the first preset threshold, the work mode is selected as single-node direct switching of the keyboard Bluetooth node, the 2.4GHz node and the USB node; When the theoretical optimal switching time is between the first preset threshold and the second preset threshold, the work mode is selected as double-node pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node; When the theoretical optimal switching time is greater than or equal to the second preset threshold, the work mode is selected as three-node parallel pre-connection of the keyboard Bluetooth node, the 2.4GHz node and the USB node.
5. The keyboard multi-mode pairing method of claim 1, wherein, The corresponding communication node is activated according to the timing requirements of the work mode, a connection handshake signal is sent to the target device, and a communication link pre-connection state is established, including: The node activation timing scheme is obtained by activating the keyboard Bluetooth node, the 2.4GHz node and the USB node according to the work mode; The communication node work configuration is obtained by power distribution and channel configuration of the communication node based on the node activation timing scheme; The target device identifier and connection parameters are input into the communication node work configuration to send a connection handshake signal, and each activated node sends a connection request and identity authentication data to the target device in parallel according to the configured timing to obtain a multi-path connection attempt state; The multi-path connection attempt state is monitored and analyzed in real time, and when any communication node successfully establishes a connection with the target device, a connection stop instruction is immediately sent to other nodes, and the node identifier and connection parameters of the successfully connected node are recorded to obtain a communication link pre-connection state.
6. The keyboard multi-mode pairing method of claim 1, wherein, After detecting that the user completes the device switching instruction, the keyboard input and output are switched from the current device to the target device based on the communication link pre-connection state, and the fast connection switching between devices is completed, including: The user key sequence is scanned and identified in real time, and when the combination input of the Fn key and the number key is detected, the communication link pre-connection state is immediately read, and whether the target device connection is established is verified to obtain a switching execution condition confirmation result; According to the switching execution condition confirmation result, the connection state switching operation is performed on the current device and the target device, a connection pause instruction is sent to the current device, the connection state is marked as a sleep mode, the connection channel of the target device is activated, and the keyboard input and output are redirected to the target device to obtain a device connection switching completion state; The connection stability verification test is performed on the target device based on the device connection switching completion state to obtain a connection verification result; According to the connection verification result, when the verification is passed, the current device identifier is updated and the switching success timestamp is recorded, and when the verification fails, the connection recovery program is started to re-establish the connection through the standby communication node or to fall back to the original device connection state to obtain a device switching state.
7. The keyboard multi-mode pairing method of claim 1, wherein, The keyboard multi-mode pairing method further includes: A multi-objective reinforcement learning state vector containing a current switching state, a historical switching sequence and a device response feature is constructed based on a switching process from a current device to a target device, and a multi-objective reward signal is calculated based on three optimization objectives of minimizing switching time, maximizing connection success rate and minimizing power consumption; A multi-objective reward function calculation is performed based on the multi-objective reinforcement learning state vector and the multi-objective reward signal to obtain a multi-objective optimization evaluation index; The multi-objective optimization evaluation index is input into a Q-learning algorithm to calculate a parameter update strategy, select a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient adjustment action through an exploration-exploitation balance mechanism, update a Q value function using a gradient descent method and calculate a reinforcement learning optimization action; The related coefficients of the switching time calculation model are adaptively adjusted according to the reinforcement learning optimization action to obtain an optimized switching time calculation model.
8. A keyboard multi-mode pairing apparatus, characterized by, The steps of the keyboard multi-mode pairing method according to any one of claims 1 to 7 are implemented by the keyboard multi-mode pairing device, which comprises: A building module for building a switching time calculation model of the keyboard according to a reference switching time of keyboard hardware, a protocol node coordination coefficient, a device response weight coefficient and a pre-connection optimization coefficient; A calculation module for monitoring user keying behavior patterns and combining connection weights and historical response time ratios of paired devices to calculate a theoretical optimal switching time of a current switching scenario through the switching time calculation model; A selection module for selecting a single-node direct switching, a double-node pre-connection or a three-node parallel pre-connection working mode of a keyboard Bluetooth node, a 2.4GHz node and a USB node according to the theoretical optimal switching time; An activation module for activating corresponding communication nodes according to the timing requirements of the working mode, sending a connection handshake signal to a target device and establishing a communication link pre-connection state; A switching module for switching keyboard input and output from a current device to a target device based on the communication link pre-connection state after detecting that a user completes a device switching instruction to complete fast connection switching between devices. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8. The processor executes the computer program to implement the steps of the keyboard multi-mode pairing method according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the keyboard multi-mode pairing method according to any one of claims 1 to 7.
Citation Information
Cited By
Automatic connection switching method and device for wireless keyboard
CN122018710A
Wireless connection control method and system for multifunctional leather sheath keyboard
CN122120810A