Bluetooth HID device management and control method and system based on virtual Bluetooth HID device

By adopting a management method based on virtual Bluetooth HID devices, the complexity, compatibility, and security issues of existing keyboard and mouse sharing technologies have been resolved. This has enabled efficient Bluetooth device connections and stable data transmission across operating systems, overcoming hardware dependencies and physical connection limitations.

CN121919136APending Publication Date: 2026-04-24SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN GREEN CONNECTION TECH CO LTD
Filing Date
2025-11-24
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing keyboard and mouse sharing technologies suffer from problems such as complex deployment, poor system compatibility, high security risks, significant latency, restricted permissions, and poor scalability, especially poor compatibility between different operating systems and device types.

Method used

A management method based on virtual Bluetooth HID devices is adopted. By obtaining administrator privileges, virtual device information is configured, virtual service stations are registered, device information is managed, and working channels are allocated to achieve efficient connection and data interaction of Bluetooth devices. Virtual service station and channel redirection technology are used to avoid hardware dependence and physical connection limitations.

Benefits of technology

It achieves seamless adaptation across multiple operating systems, reduces deployment complexity and cost, improves Bluetooth device connection efficiency and success rate, reduces connection waiting time and error probability, ensures data transmission stability and reliability, and expands the remote control range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121919136A_ABST
    Figure CN121919136A_ABST
Patent Text Reader

Abstract

The invention discloses a Bluetooth HID device management and control method and system based on a virtual Bluetooth HID device, and the method and system are implemented to ensure that the subsequent management and control operation can be smoothly carried out in an environment with enough authority by obtaining the authority of an administrator to configure virtual device information; by registering the virtual service station and managing the equipment information, other Bluetooth equipment can obtain related information of the target virtual equipment, and a necessary information basis is provided for connection between the Bluetooth equipment. Meanwhile, connection requests of other Bluetooth devices for the published device information can be responded in time, efficient processing of the connection requests between the devices is achieved, and the waiting time and the error occurrence probability in the connection process are reduced. Finally, after connection requests of other Bluetooth devices are received, adaptive working channels can be intelligently allocated, channel redirection can be executed, it is ensured that Bluetooth data are interacted according to preset and optimized channels, stable and reliable interaction of the Bluetooth data is ensured, and the quality and reliability of data transmission are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of device interaction management technology, and in particular to a method and system for managing Bluetooth HID devices based on virtual Bluetooth HID devices. Background Technology

[0002] Currently, keyboard and mouse sharing technologies mainly fall into two categories: application-layer transmission solutions and wired switch solutions. The core principle of the application-layer transmission solution is to establish a network transmission protocol at the application layer to transmit keyboard and mouse event data. Specifically, both ends of the communication require a dedicated application to transmit mouse data via Bluetooth or a local area network protocol, followed by mouse movement operations through Windows system API calls. Cherry Fusion is a typical software product of this type. However, this solution has several drawbacks: First, it suffers from significant software dependency issues, requiring both ends of the communication devices to install corresponding applications and complete Bluetooth pairing, making deployment extremely complex. Second, it lacks system compatibility, requiring different versions of the application to support different operating systems such as Windows, macOS, and iOS. Third, it presents security risks, as application-layer transmission is easily blocked by firewalls, leading to network security vulnerabilities. Fourth, it suffers from significant latency issues, as the application-layer processing adds data transmission delays, severely impacting user experience. Fifth, it has limited permissions, as the application layer cannot fully simulate the behavior of the underlying hardware, limiting its functionality.

[0003] The wired switch solution works by using a physical KVM switch or USB switch to share keyboard and mouse across multiple devices. Specifically, the hardware switch is connected to multiple computers, and control is switched via buttons. KVM switches are typical examples of this solution. However, this solution also has several problems: First, it is highly hardware-dependent, requiring additional physical switching equipment, which increases costs. Second, the connection range is limited by the length of the physical cables, making remote control impossible. Third, its scalability is poor, supporting a limited number of devices, typically only 2-4 devices due to physical size and other factors. Finally, this solution also suffers from poor compatibility with different operating systems and device types. Summary of the Invention

[0004] This invention provides a Bluetooth HID device management method and system based on a virtual Bluetooth HID device. Only one software installation is required on a single control terminal, which enables convenient and efficient control of multiple Bluetooth HID devices.

[0005] The first aspect of this invention discloses a method for managing Bluetooth HID devices based on virtual Bluetooth HID devices, the method comprising: The system obtains administrator privileges to run on the target device through a preset virtual device registration program and configures the device information included in the preset virtual device management program into the system of the target device. The virtual device management program and the preset target callback function register a virtual service station in the system of the target device, and perform a device information publishing operation on the device information corresponding to the target virtual device registered in the virtual service station. At the same time, it responds to connection requests from other Bluetooth devices for the published device information corresponding to the target virtual device. The virtual device management program and the virtual service station allocate working channels adapted to the other Bluetooth devices according to the connection request, and perform channel management operations on the connection between the other Bluetooth devices and the system according to the preset channel redirection program and the working channels, so as to modify the interaction channel of the Bluetooth data; wherein, the channel management operation is used to perform channel redirection operations on the Bluetooth data transmitted by the other Bluetooth devices.

[0006] As an optional implementation, in the first aspect of the present invention, the method further includes: When a preset user interaction program detects a query command for the device information, it retrieves the Bluetooth device list corresponding to the device information and displays the Bluetooth device list on the display interface of the target device; the Bluetooth device list is used to display all first Bluetooth devices currently connected to the target device and all second Bluetooth devices that the target device can control. When the user interaction program detects a control command for the Bluetooth device list, it determines the device affiliation of the Bluetooth device to be controlled based on the control command. The device affiliation includes indicating that the Bluetooth device to be controlled is the native Bluetooth device of the target device and belongs to the native affiliation or non-native affiliation of the target device. When it is determined that the device corresponding to the Bluetooth device to be controlled belongs to the local device, the user interaction program releases the control command so that the target device's Bluetooth response program can respond to the control command.

[0007] As an optional implementation, in the first aspect of the present invention, the method further includes: When it is determined that the device corresponding to the Bluetooth device to be controlled belongs to the non-local device, the user interaction program intercepts the control command. The user interaction program sends the control command to the virtual Bluetooth HID device corresponding to the Bluetooth device under control through the interaction interface set by the virtual device management program, so that the control command is fed back to the device body of the Bluetooth device under control through the virtual Bluetooth HID device, and the Bluetooth device under control responds to the control command.

[0008] As an optional implementation, in the first aspect of the present invention, before configuring the device information included in the preset virtual device management program to the system of the target device, the method further includes: The virtual device management program sets a target callback function, which is used to execute a device callback operation matching the device event when a device event for the virtual Bluetooth HID device is detected; the device event includes at least one of the following: device connection, device disconnection, and data transmission error. After configuring the device information included in the preset virtual device management program into the system of the target device, the method further includes: Generate a device insertion event for the device information, and trigger the target callback function based on the device insertion event.

[0009] As an optional implementation, in the first aspect of the present invention, the step of registering a virtual service station in the system of the target device by the virtual device management program and a preset target callback function includes: The virtual device management program and the preset target callback function register a virtual service station and a specified PSM Bluetooth channel on the Bluetooth protocol stack of the target device; the virtual service station is used to manage the registration and communication of the virtual Bluetooth HID device. The step of publishing device information for the target virtual device registered on the virtual service station includes: The virtual device management program performs an encapsulation operation on the device information corresponding to the target virtual device registered in the virtual service station and the specified PSM Bluetooth channel according to a preset protocol to obtain the encapsulation result for the device information corresponding to the target virtual device and the specified PSM Bluetooth channel. The target callback function performs an information publishing operation on the encapsulation result through the Bluetooth protocol stack.

[0010] As an optional implementation, in the first aspect of the present invention, responding to a connection request from another Bluetooth device for device information corresponding to the published target virtual device includes: The encapsulation result is received by other Bluetooth devices, and the virtual service station is connected according to the specified PSM Bluetooth channel included in the encapsulation result; The other Bluetooth devices parse the encapsulation result to obtain the device ID corresponding to the target virtual Bluetooth HID device that matches the other Bluetooth devices; and, based on the device ID and the specified PSM Bluetooth channel, generate a connection request for the target virtual Bluetooth HID device, wherein the connection request includes at least the MAC address corresponding to the other Bluetooth devices; Update the MAC addresses of the other Bluetooth devices included in the connection request to the virtual service station.

[0011] As an optional implementation, in the first aspect of the present invention, the step of performing channel management operations on the connection between the other Bluetooth devices and the system according to a preset channel redirection procedure and the working channel includes: A preset channel redirection program monitors and intercepts Bluetooth data transmitted by other Bluetooth devices based on the working channel; The channel redirection program determines whether the data request type of the Bluetooth data matches a preset data request type. When the determination result is yes, the Bluetooth data is parsed to obtain the initial PSM value corresponding to the Bluetooth data. The initial PSM value is then modified to a custom PSM value, which is used to redirect the Bluetooth data to a redefining channel that matches the custom PSM when the Bluetooth data is connected to the virtual service station.

[0012] A second aspect of this invention discloses a Bluetooth HID device management system based on a virtual Bluetooth HID device, the system comprising: The initial configuration module is used to obtain administrator privileges running on the target device from the preset virtual device registration program and configure the device information included in the preset virtual device management program into the system of the target device; The registration management module is used to register virtual service stations in the target device's system by the virtual device management program and a preset target callback function; The information publishing module is used by the virtual device management program to perform device information publishing operations on the device information corresponding to the target virtual device registered in the virtual service station; A connection response module is used by the virtual device management program to respond to connection requests from other Bluetooth devices for device information corresponding to the published target virtual device. The channel management module is used by the virtual device management program and the virtual service station to allocate working channels compatible with other Bluetooth devices according to the connection request; The channel management module is further configured to perform channel management operations on the connection between the other Bluetooth devices and the system according to a preset channel redirection procedure and the working channel, so as to modify the interaction channel of the Bluetooth data; wherein, the channel management operation is used to perform channel redirection operations on the Bluetooth data transmitted by the other Bluetooth devices.

[0013] As an optional implementation, in a second aspect of the invention, the system further includes: The information retrieval and processing module is used to obtain a Bluetooth device list corresponding to the device information when a preset user interaction program detects a retrieval command for the device information, and to display the Bluetooth device list on the display interface of the target device; the Bluetooth device list is used to display all first Bluetooth devices currently connected to the target device and all second Bluetooth devices that can be controlled. The determination module is used to determine the device affiliation of the Bluetooth device to be controlled based on the control command when the user interaction program listens for the control command for the Bluetooth device list; the device affiliation includes indicating that the Bluetooth device to be controlled is the local Bluetooth device of the target device and belongs to the local affiliation or non-local affiliation of the target device. The first instruction processing module is used to, when it is determined that the device corresponding to the Bluetooth device to be controlled belongs to the local device, release the control instruction by the user interaction program so that the target device's Bluetooth response program can respond to the control instruction.

[0014] As an optional implementation, in a second aspect of the invention, the system further includes: The second instruction processing module is used to intercept the control instruction by the user interaction program when it is determined that the device corresponding to the Bluetooth device to be controlled belongs to the non-local owner; The second instruction processing module is further configured to send the control instruction to the virtual Bluetooth HID device corresponding to the Bluetooth device under control through the interaction interface set by the user interaction program, so as to feed back the control instruction to the device body of the Bluetooth device under control through the virtual Bluetooth HID device, and to have the Bluetooth device under control respond to the control instruction.

[0015] As an optional implementation, in a second aspect of the invention, the system further includes: The callback control module is used to configure a target callback function by the virtual device management program before the initial configuration module configures the device information included in the preset virtual device management program to the system of the target device by the preset virtual device registration program. The target callback function is used to execute a device callback operation matching the device event when a device event for the virtual Bluetooth HID device is detected. The device event includes at least one of the following: device connection, device disconnection, and data transmission abnormality. The callback control module is further configured to generate a device insertion event for the device information after the initial configuration module configures the device information included in the preset virtual device management program to the target device system by the preset virtual device registration program, and trigger the target callback function according to the device insertion event.

[0016] As an optional implementation, in the second aspect of the present invention, the registration management module registers a virtual service station in the system of the target device using the virtual device management program and a preset target callback function, specifically including: The virtual device management program and the preset target callback function register a virtual service station and a specified PSM Bluetooth channel on the Bluetooth protocol stack of the target device; the virtual service station is used to manage the registration and communication of the virtual Bluetooth HID device. The information publishing module, through the virtual device management program, performs device information publishing operations on the device information corresponding to the target virtual device registered in the virtual service station. Specifically, this includes: The virtual device management program performs an encapsulation operation on the device information corresponding to the target virtual device registered in the virtual service station and the specified PSM Bluetooth channel according to a preset protocol to obtain the encapsulation result for the device information corresponding to the target virtual device and the specified PSM Bluetooth channel. The target callback function performs an information publishing operation on the encapsulation result through the Bluetooth protocol stack.

[0017] As an optional implementation, in a second aspect of the invention, the connection response module responds to connection requests from other Bluetooth devices for device information corresponding to the published target virtual device by the device association program when needed, specifically including: The encapsulation result is received by other Bluetooth devices, and the virtual service station is connected according to the specified PSM Bluetooth channel included in the encapsulation result; The other Bluetooth devices parse the encapsulation result to obtain the device ID corresponding to the target virtual Bluetooth HID device that matches the other Bluetooth devices; and, based on the device ID and the specified PSM Bluetooth channel, generate a connection request for the target virtual Bluetooth HID device, wherein the connection request includes at least the MAC address corresponding to the other Bluetooth devices; Update the MAC addresses of the other Bluetooth devices included in the connection request to the virtual service station.

[0018] As an optional implementation, in a second aspect of the present invention, the channel management module performs channel management operations on the connection between the other Bluetooth devices and the system according to a preset channel redirection procedure and the working channel, specifically including: A preset channel redirection program monitors and intercepts Bluetooth data transmitted by other Bluetooth devices based on the working channel; The channel redirection program determines whether the data request type of the Bluetooth data matches a preset data request type. When the determination result is yes, the Bluetooth data is parsed to obtain the initial PSM value corresponding to the Bluetooth data. The initial PSM value is then modified to a custom PSM value, which is used to redirect the Bluetooth data to a redefining channel that matches the custom PSM when the Bluetooth data is connected to the virtual service station.

[0019] A third aspect of this invention discloses a Bluetooth HID device management and control device based on a virtual Bluetooth HID device, the device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute some or all of the steps in the Bluetooth HID device management method based on a virtual Bluetooth HID device according to any of the first aspects of the present invention.

[0020] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps in the Bluetooth HID device management method based on a virtual Bluetooth HID device as described in any of the first aspects of the present invention.

[0021] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a method for managing Bluetooth HID devices based on virtual Bluetooth HID devices. By acquiring administrator privileges to configure virtual device information, this method ensures that subsequent management operations can be carried out smoothly in an environment with sufficient permissions, avoiding operation failures or functional limitations due to insufficient permissions, and providing a foundation for subsequent management. Furthermore, by registering a virtual service station and managing device information, other Bluetooth devices can obtain relevant information about the target virtual device, providing the necessary information basis for connections between Bluetooth devices. Simultaneously, it can promptly respond to connection requests from other Bluetooth devices regarding published device information, achieving efficient processing of connection requests between devices, improving the efficiency and success rate of Bluetooth device connections, and reducing waiting time and the probability of errors during the connection process. Finally, upon receiving a connection request from another Bluetooth device, it can intelligently allocate and adapt working channels and perform channel redirection, ensuring stable and reliable Bluetooth data interaction, effectively avoiding interference and conflicts during data transmission, and ensuring that Bluetooth data is exchanged according to a predetermined and optimized channel, which is beneficial to improving the quality and reliability of data transmission. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a Bluetooth HID device management method based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another Bluetooth HID device management method based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a Bluetooth HID device management and control system based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention; Figure 4 This is a schematic diagram of another Bluetooth HID device management system based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a Bluetooth HID device management and control device based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.

[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0027] This invention discloses a Bluetooth HID device management method and system based on virtual Bluetooth HID devices. By obtaining administrator privileges to configure virtual device information, it ensures that subsequent management operations can be carried out smoothly in an environment with sufficient permissions, avoiding operation failures or functional limitations due to insufficient permissions, and providing a foundation for subsequent management. Furthermore, by registering a virtual service station and managing device information, other Bluetooth devices can obtain relevant information about the target virtual device, providing the necessary information foundation for connections between Bluetooth devices. Simultaneously, it can promptly respond to connection requests from other Bluetooth devices regarding published device information, achieving efficient processing of connection requests between devices, improving the efficiency and success rate of Bluetooth device connections, and reducing waiting time and the probability of errors during the connection process. Finally, upon receiving connection requests from other Bluetooth devices, it can intelligently allocate and adapt working channels and perform channel redirection, ensuring stable and reliable Bluetooth data interaction, effectively avoiding interference and conflicts during data transmission, and ensuring that Bluetooth data is exchanged according to a predetermined and optimized channel, which is beneficial to improving the quality and reliability of data transmission. These are described in detail below.

[0028] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a Bluetooth HID device management method based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention. Figure 1 The described Bluetooth HID device management method based on virtual Bluetooth HID devices can be applied to Bluetooth HID device management devices and systems based on virtual Bluetooth HID devices, and the embodiments of the present invention are not limited thereto. Figure 1 As shown, the Bluetooth HID device management method based on virtual Bluetooth HID devices may include the following operations: 101. The system obtains administrator privileges on the target device through the preset virtual device registration program and configures the device information included in the preset virtual device management program to the target device system.

[0029] In this embodiment of the invention, based on step 101, the dependence of traditional Bluetooth HID device management on physical hardware can be bypassed, and virtualized management without hardware intervention can be achieved.

[0030] In this embodiment of the invention, by obtaining administrator privileges, the system restricts the modification of device information to authorized programs only, preventing malicious software from spoofing virtual devices. This helps improve the accuracy of access control and the security and reliability of subsequent operations.

[0031] In this embodiment of the invention, the virtual device manager can be a driver developed based on Windows Driver Framework (WDF).

[0032] 102. The virtual device management program and the preset target callback function register a virtual service station in the target device's system.

[0033] 103. The virtual device management program performs a device information publishing operation on the device information corresponding to the target virtual device registered in the virtual service station.

[0034] 104. The virtual device manager responds to connection requests from other Bluetooth devices for the device information corresponding to the published target virtual device.

[0035] In this embodiment of the invention, a virtual service station is registered in the system through a virtual device management program and a target callback function, enabling dynamic publishing of device information and real-time response to connection requests. Specifically: the publishing of device information supports simultaneous registration of multiple devices, breaking through the physical limitation of traditional Bluetooth HID device "one-to-one" connection; at the same time, the callback function mechanism ensures immediate processing of connection requests, reducing the risk of connection failure due to delay; and by constructing a virtual service station as a logic layer middleware, the interaction between physical devices and the system is isolated, which helps to improve system stability.

[0036] 105. The virtual device management program and virtual service station allocate working channels for compatibility with other Bluetooth devices based on connection requests.

[0037] 106. Based on the preset channel redirection procedure and working channel, perform channel management operations on the connection between other Bluetooth devices and the system to modify the Bluetooth data interaction channel.

[0038] In this embodiment of the invention, the channel management operation is used to perform a channel redirection operation on Bluetooth data transmitted by other Bluetooth devices.

[0039] In this embodiment of the invention, the operation of step 105 is implemented based on a pre-set channel allocation algorithm. This channel allocation algorithm can automatically match the optimal transmission channel according to the device type (such as keyboard, mouse) to reduce data conflicts.

[0040] In this embodiment of the invention, by executing the corresponding schemes of steps 101-106 above, the virtualized Bluetooth HID device eliminates the dependence of Bluetooth HID device interaction on specific operating systems or hardware, and also reduces the consumption of system resources. Specifically, the above scheme can seamlessly adapt to multiple operating systems such as Windows, Linux, and macOS, without the need to develop independent drivers for different systems. In addition, the channel management operation is completed at the kernel level, avoiding performance loss caused by frequent calls to system APIs by user-level programs. At the same time, the above deployment operation only requires the installation of the corresponding drivers (the above-mentioned virtual device registration program, virtual device management program, channel redirection program, and subsequent user interaction program) on the control end, without the need to perform other data configurations on the controlled end or additional hardware devices, achieving simple deployment, breaking through the limitations of physical cables, and realizing remote control within the effective range of Bluetooth.

[0041] It is evident that implementation Figure 1The described Bluetooth HID device management method based on virtual Bluetooth HID devices obtains administrator privileges to configure virtual device information, ensuring that subsequent management operations can be carried out smoothly in an environment with sufficient permissions. This avoids operational failures or functional limitations due to insufficient permissions, providing a foundation for subsequent management. Furthermore, by registering a virtual service station and managing device information, other Bluetooth devices can obtain relevant information about the target virtual device, providing the necessary information basis for connections between Bluetooth devices. Simultaneously, it can promptly respond to connection requests from other Bluetooth devices regarding published device information, achieving efficient processing of connection requests between devices, improving the efficiency and success rate of Bluetooth device connections, and reducing waiting time and the probability of errors during the connection process. Finally, upon receiving connection requests from other Bluetooth devices, it can intelligently allocate and adapt working channels and perform channel redirection, ensuring stable and reliable Bluetooth data exchange, effectively avoiding interference and conflicts during data transmission, and guaranteeing that Bluetooth data is exchanged according to a predetermined and optimized channel, thus improving the quality and reliability of data transmission.

[0042] In an optional embodiment, before step 101 configures the device information included in the preset virtual device management program to the target device's system, the method further includes: The virtual device manager sets a target callback function, which is used to execute a device callback operation matching the device event when a device event for the virtual Bluetooth HID device is detected. The device event includes at least one of the following: device connection, device disconnection, and data transmission error. After configuring the device information included in the preset virtual device management program into the target device's system, the method further includes: Generate a device insertion event for the device information, and trigger the target callback function based on the device insertion event.

[0043] In this optional embodiment, the target callback function can be a PNP callback function, which is a plug-and-play callback function capable of automatically identifying and configuring hardware devices. Simultaneously, the target callback function is specifically designed to monitor device-related events of the virtual Bluetooth HID device, covering critical situations such as device connection, device disconnection, and data transmission anomalies. By setting such a callback function, various important events occurring during device operation can be captured in real-time and accurately, providing a foundation for timely and effective handling of these events. For example, when a virtual Bluetooth HID device experiences a connection anomaly and disconnection, the callback function can quickly detect this event, avoiding problems such as device management errors or data loss due to delayed detection.

[0044] In this optional embodiment, the generation of a device insertion event signifies the successful registration and identification of the virtual device in the system. Triggering the callback function at this point ensures an effective monitoring mechanism is established once the device enters normal operating mode. Once triggered, the target callback function executes a matching device callback operation based on the specific device event detected. For example, when a data transmission anomaly is detected, the callback operation can take measures such as re-establishing the connection or adjusting transmission parameters to restore normal data transmission. This ensures that the virtual Bluetooth HID device operates stably and reliably under various conditions, improving the automation and response speed of device management.

[0045] As can be seen, in this optional embodiment, by setting the target callback function in advance, key matters such as connection, disconnection, and data transmission anomalies of the virtual Bluetooth HID device can be monitored in real time and accurately; after the device information is configured, an insertion event trigger callback function is generated, which can automatically perform matching operations according to specific matters, effectively ensuring the stable and reliable operation of the Bluetooth HID device, and at the same time helping to improve the automation and response capabilities of the Bluetooth HID device's management.

[0046] In another optional embodiment, step 102 above, which involves the virtual device management program and a preset target callback function registering a virtual service station in the target device's system, specifically includes: The virtual device management program and the preset target callback function register a virtual service station and a specified PSM Bluetooth channel in the Bluetooth protocol stack of the target device; the virtual service station is used to manage the registration and communication of the virtual Bluetooth HID device. In this optional embodiment, the registered virtual service station can be implemented by the PNP callback function described above registering a custom L2CAP Server in the Bluetooth protocol stack through the BRB structure (Bluetooth Request Block, a standard data structure in the Windows Bluetooth driver stack). L2CAP (Logical Link Control and Adaptation Protocol) is a Bluetooth logical link control and adaptation protocol used to provide packet segmentation, reassembly, and error detection between Bluetooth devices.

[0047] The specific methods for performing the device information publishing operation on the target virtual device registered in the virtual service station in step 103 above include: The virtual device management program performs encapsulation operations on the device information and specified PSM Bluetooth channel corresponding to the target virtual device registered in the virtual service station according to a preset protocol, and obtains the encapsulation result for the device information and specified PSM Bluetooth channel corresponding to the target virtual device. The target callback function performs an information publishing operation on the encapsulated result via the Bluetooth protocol stack.

[0048] In this optional embodiment, the Bluetooth protocol stack is the core management area for Bluetooth device communication. Registering a virtual service station within it enables the system to centrally manage registration and communication related to virtual Bluetooth HID devices. Simultaneously, the virtual service station, as a dedicated logical entity, can uniformly process device registration requests, such as recording the device's unique identifier and device type. In other words, this virtual service stack improves the convenience and efficiency of subsequent device identification and management.

[0049] In this optional embodiment, registering a designated / specific PSM channel ensures that data transmission from the virtual Bluetooth HID device occurs on a dedicated channel, avoiding conflicts with data transmission from other Bluetooth services and improving the accuracy and reliability of data transmission. For example, when multiple Bluetooth devices connect to a target device simultaneously, the data from the virtual Bluetooth HID device can accurately reach the target through the designated PSM channel, preventing data loss or errors due to channel misuse.

[0050] In this optional embodiment, a preset protocol specifies the encapsulation format and rules for device information and channel information. This encapsulation integrates key device information (such as device name, device type, device subclass, functional characteristics, etc.) and designated PSM channel information into a unified data structure, facilitating subsequent transmission and processing. Optionally, the preset protocol can be the HID protocol (Human Interface Protocol), and the unified data structure can be encapsulated into the data structure corresponding to the classic Bluetooth SDP (Service Discovery Protocol) protocol.

[0051] In this optional embodiment, the target callback function triggers this operation after listening for device-related events, enabling timely publication of the encapsulated device information. The Bluetooth protocol stack, acting as the information publication channel, can transmit the encapsulation result to other Bluetooth devices on the network. This allows other Bluetooth devices to obtain detailed information about the target virtual device and its communication channel, thus initiating a connection request. For example, when a new Bluetooth mouse registers as a virtual device with a virtual service station, the information publication operation allows nearby computers and other devices to quickly discover the mouse and determine which PSM channel to use for communication, improving the efficiency and convenience of device connection.

[0052] As can be seen, in this optional embodiment, by registering a virtual service station and specifying a PSM channel in the Bluetooth protocol stack, centralized management and dedicated channel transmission for virtual Bluetooth HID device registration and communication are achieved, ensuring the accuracy and reliability of data transmission. The virtual device management program encapsulates device information and channels according to a preset protocol, and then the target callback function publishes it through the Bluetooth protocol stack, enabling other Bluetooth devices to quickly obtain the target virtual device information and connect accurately, thus improving the efficiency and convenience of device connection.

[0053] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating another Bluetooth HID device management method based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention. Figure 2 The described Bluetooth HID device management method based on virtual Bluetooth HID devices can be applied to Bluetooth HID device management devices and systems based on virtual Bluetooth HID devices, and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the Bluetooth HID device management method based on virtual Bluetooth HID devices may include the following operations: 201. The system obtains administrator privileges on the target device through the preset virtual device registration program and configures the device information included in the preset virtual device management program to the target device system.

[0054] In this embodiment of the invention, simply installing the aforementioned virtual device management program is not enough to directly trigger the target callback function. It is necessary to add the corresponding device GUID / device information to the system registry. This requires a simple registry service installation program, i.e., the virtual device registration program. After obtaining the administrator program, the device GUID corresponding to the virtual device management program is configured via WINAPI's BluetoothSetLocalServiceInfo. This allows the driver's PNP callback to be triggered.

[0055] 202. The virtual device management program and the preset target callback function register a virtual service station in the target device's system.

[0056] 203. The virtual device management program performs a device information publishing operation on the device information corresponding to the target virtual device registered in the virtual service station.

[0057] 204. The virtual device manager responds to connection requests from other Bluetooth devices for the device information corresponding to the published target virtual device.

[0058] 205. The virtual device management program and virtual service station allocate working channels for compatibility with other Bluetooth devices based on connection requests.

[0059] 206. Based on the preset channel redirection procedure and working channel, perform channel management operations on the connection between other Bluetooth devices and the system to modify the Bluetooth data interaction channel.

[0060] For further descriptions of steps 201-206 in this embodiment of the invention, please refer to the other specific descriptions of steps 101-106 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.

[0061] 207. When a pre-defined user interaction program detects a query command for device information, it retrieves the Bluetooth device list corresponding to the device information and displays the Bluetooth device list on the target device's display interface.

[0062] In this embodiment of the invention, the Bluetooth device list is used to display all first Bluetooth devices currently connected to the target device and all second Bluetooth devices that the target device can control.

[0063] In this embodiment of the invention, the user interaction program includes using the external IOCTL interface (Input / Output Control, a standard mechanism for communication between user-mode applications and kernel drivers) exposed by the virtual device manager. The program obtains the Bluetooth device list driven by the virtual device manager through the specified IOCTL interface. The device information of the Bluetooth device list is returned to the user program and finally displayed on the user interface. Bluetooth information configured by the user through the Windows system will appear in the Bluetooth device list, and the address of the device to be switched can be specified by the IOCTL command of switching devices.

[0064] In this embodiment of the invention, by maintaining an intuitive and viewable Bluetooth device list, users can easily understand the current Bluetooth connection and control status of the device without having to search through multiple interfaces or settings, which greatly improves the convenience and efficiency of user operation.

[0065] 208. When the user interaction program detects a control command for the Bluetooth device list, it determines the device affiliation of the Bluetooth device to be controlled based on the control command.

[0066] In this embodiment of the invention, the device attribution includes the native Bluetooth device that indicates the Bluetooth device to be controlled as the target device, and belongs to the native attribution or non-native attribution of the target device.

[0067] In this embodiment of the invention, in a multi-device shared environment, there may be multiple devices connected to the same type of Bluetooth device (such as multiple computers connected to the same Bluetooth speaker). By determining the affiliation, it can be clearly determined whether the control command is for the Bluetooth device directly connected to the local machine or for the Bluetooth device that needs to be controlled through other means, thus avoiding misoperation and confusion of control commands.

[0068] 209. When it is determined that the Bluetooth device to be controlled belongs to the local device, the user interaction program releases the control command so that the target device's Bluetooth response program can respond to the control command.

[0069] In this embodiment of the invention, step 209 enables the Bluetooth device directly connected to the local machine to quickly respond to control commands and make corresponding actions in a timely manner through the Bluetooth response program of the target device, thus ensuring the real-time performance and smoothness of device control.

[0070] In this embodiment of the invention, the method may optionally further include: When it is determined that the Bluetooth device to be controlled belongs to a device that is not owned by the local device, the user interface program will intercept the control command. The user interaction program sends control commands to the virtual Bluetooth HID device corresponding to the Bluetooth device under control through the interaction interface set by the virtual device management program. The virtual Bluetooth HID device then feeds back the control commands to the actual Bluetooth device under control, and the Bluetooth device under control responds to the control commands.

[0071] In this embodiment of the invention, the aforementioned user interaction program can obtain Windows mouse and keyboard messages (corresponding to control commands for the Bluetooth device list) by registering a global message hook, and insert the hook into the hook chain. If the user needs to control the local Bluetooth device, the hook will directly allow the process and will not send HID reports to any paired device. If the user selects the device to be controlled through the Bluetooth device list, the hook will intercept the local keyboard and mouse messages and instead send them to the local device via the IOCTL interface exposed by the virtual device manager. The virtual device manager will then drive the simulated Bluetooth HID device and send the messages to the controlled slave device.

[0072] In this embodiment of the invention, by intercepting control commands, conflicts and errors that might occur if control commands directly act on non-native devices are avoided. Then, the user interaction program sends the control commands to the virtual Bluetooth HID device corresponding to the Bluetooth device to be controlled through the interaction interface set by the virtual device management program. The virtual Bluetooth HID device acts as a bridge and converter, accurately feeding back the control commands to the actual device of the Bluetooth device to be controlled, which then responds to the control commands. For example, in a conference room scenario, if a user wants to control a Bluetooth projector connected to another computer, since the projector's device is not registered to the local computer, the control commands are first intercepted, then forwarded through the virtual Bluetooth HID device. The projector can then correctly receive and execute the control commands, achieving effective control of non-native Bluetooth devices and expanding the scope and flexibility of device management.

[0073] It is evident that implementation Figure 2 The described Bluetooth HID device management method based on virtual Bluetooth HID devices allows users to easily understand device connection and control status by detecting and viewing commands and displaying a Bluetooth device list. By listening to control commands and accurately determining device ownership, commands can be directly granted to devices owned by the user for rapid response, while commands from non-owned devices can be intercepted and forwarded through the virtual Bluetooth HID device. This expands the scope of device management and greatly improves the convenience, accuracy, and flexibility of user operations in controlling Bluetooth devices.

[0074] In an optional embodiment, step 204 above, which responds to connection requests from other Bluetooth devices for device information corresponding to the published target virtual device, specifically includes the following methods: Other Bluetooth devices receive the encapsulation results and connect to the virtual service station based on the specified PSM Bluetooth channel included in the encapsulation results; The encapsulation result is parsed by other Bluetooth devices to obtain the device ID corresponding to the target virtual Bluetooth HID device that matches other Bluetooth devices; and a connection request for the target virtual Bluetooth HID device is generated based on the device ID and the specified PSM Bluetooth channel. The connection request includes at least the MAC address corresponding to the other Bluetooth device. Update the MAC addresses of other Bluetooth devices included in the connection request to the virtual service station.

[0075] In this optional embodiment, if other Bluetooth devices need to connect to the published device information, during the Bluetooth pairing process, these other Bluetooth devices first connect to the L2CAP Server created by the virtual Bluetooth HID device (i.e., the aforementioned virtual service station) through the specified PSM channel in the structure data of the SDP protocol (the encapsulation result described above). Then, by parsing the report Descriptor set in the SDP, they obtain the corresponding HID report IDs for the mouse and keyboard (e.g., 0x01 for the mouse, 0x02 for the keyboard; other HID devices can be customized), and perform HID communication for the mouse and keyboard according to the data structure corresponding to the reportDescriptor. Simultaneously, the virtual service station L2CAP Server allocates two communication channels based on the specified PSM value. These two communication channels include a control channel and an interrupt channel. The interrupt channel is used for the Server to send HID reports to the Bluetooth Client; the control channel is used to receive configuration information from the Client.

[0076] In this optional embodiment, by explicitly specifying a particular PSM channel, a precise communication path is provided for the connection between other Bluetooth devices and the virtual service station. This avoids connection confusion or conflicts caused by devices randomly selecting channels in complex Bluetooth communication environments.

[0077] In this optional embodiment, the device ID is a unique identifier for the device. By parsing and obtaining the device ID, other Bluetooth devices can clearly identify the specific target virtual device they want to connect to, improving the accuracy of connections between other Bluetooth devices and the target virtual device. Simultaneously, including the MAC address in the connection request allows the virtual service station to accurately identify the identity of the device initiating the connection, providing crucial identity information for subsequent device management and communication.

[0078] In this optional embodiment, by recording MAC addresses, the virtual service station can effectively manage and monitor connected devices, such as counting the number of connected devices and identifying devices that are repeatedly connected. Furthermore, during subsequent communication, the virtual service station can quickly locate the corresponding device based on the recorded MAC address, enabling precise data transmission and interaction. This improves the efficiency and accuracy of data transmission and enhances the reliability and controllability of the entire Bluetooth device management system.

[0079] As can be seen, in this optional embodiment, specifying the PSM Bluetooth channel ensures that other Bluetooth devices accurately connect to the virtual service station, effectively avoiding connection chaos; then, by parsing the encapsulation result to obtain the device ID and generating a connection request in combination with the MAC address, the connection target and device identity are clearly identified; and the MAC address is updated to the virtual service station, achieving effective management and precise communication of connected devices, thus improving the stability, accuracy, and reliability of Bluetooth device management.

[0080] In another optional embodiment, step 206, which performs channel management operations on the connection between other Bluetooth devices and the system based on a preset channel redirection procedure and a working channel, specifically includes: A preset channel redirection program listens for and intercepts Bluetooth data transmitted by other Bluetooth devices based on the working channel; The channel redirection program determines whether the data request type of the Bluetooth data matches the preset data request type. When the determination result is yes, the Bluetooth data is parsed to obtain the initial PSM value corresponding to the Bluetooth data. The initial PSM value is then modified to a custom PSM value. The custom PSM value is used to redirect the Bluetooth data to a redefining channel that matches the custom PSM when the Bluetooth data is connected to a virtual service station.

[0081] In this optional embodiment, the preset channel redirection program can be a PSM redirection driver written in the Bluetooth adapter device stack, and this channel redirection program has the ability to monitor and intercept Bluetooth data transmitted by other Bluetooth devices based on the working channel in real time. Furthermore, the aforementioned working channel is the path for regular data transmission between Bluetooth devices. In a complex Bluetooth communication environment, various different types of data may be transmitted on the working channel.

[0082] In this optional embodiment, specifically in practical applications, a channel redirection program can be used to listen for the _URB_BULK_OR_INTERRUPT_TRANSFER event, and then intercept Bluetooth communication data through the data structure in the URB's TransferBuffer. Since all channels are converted into electrical signals by the Bluetooth adapter for interaction, and then the upper-layer Bluetooth protocol stack interacts with the data, this channel redirection program is registered at the lower layer of the Bluetooth USB adapter. It can automatically intercept the IOCTL_INTERNAL_USB_SUBMIT_URB request in the device stack (corresponding to the intercepted Bluetooth data mentioned above), and determine whether it is a URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER request (corresponding to the matching judgment with the preset data request type mentioned above) through the Function type in the URB. When the judgment is successful, the buffer data stores the PSM value of the interaction, and its data structure needs to be parsed out and modified to a custom PSM value.

[0083] In this optional embodiment, the channel redirection procedure enables data interception and processing at the USB and Bluetooth protocol stack levels, providing complete protocol link monitoring and control capabilities.

[0084] In this optional embodiment, since we only need to install the software on the Windows host, it is found that the PSM exposed in the pairing protocol SDP maintains channels 0x11 and 0x13. When connecting to the L2CAP service of the virtual Bluetooth device through channels 0x11 and 0x13 exposed by the SDP, it will be redirected to a custom PSM such as (0x1011, 0x1013). Thus, the flexibility of this channel redirection procedure resolves the conflict caused when other HID devices connect. In addition, the user can interact with the channel redirection procedure through the aforementioned user interface to choose whether to enable the PSM mapping, thereby resolving the conflict.

[0085] In this optional embodiment, the channel redirection program can accurately capture and intercept this data, ensuring that no Bluetooth data passing through the working channel is missed. For example, in a system that simultaneously connects multiple Bluetooth peripherals (such as Bluetooth mice, keyboards, headphones, etc.), these peripherals and the system continuously transmit operation commands, audio data, etc., through the working channel. The channel redirection program can comprehensively monitor this data, providing a complete data source for subsequent processing and ensuring effective control over all relevant Bluetooth data.

[0086] In this optional embodiment, the channel redirection program can determine and match the data request type of the intercepted Bluetooth data. Through this matching and determination, data that meets the system processing requirements can be filtered out, avoiding unnecessary processing of irrelevant data and improving the utilization efficiency of system resources.

[0087] In this optional embodiment, the initial PSM value is modified to a custom PSM value that matches a redefined channel in the virtual service station. This modification redirects Bluetooth data to the redefined channel matching the custom PSM when connecting to the virtual service station. This redirection operation enables flexible control over the Bluetooth data transmission channel, allowing data to be transmitted on specific channels according to the system's design requirements.

[0088] As can be seen, in this optional embodiment, by listening to and intercepting Bluetooth data on the working channel through the channel redirection program, filtering out data that meets the requirements by matching the data request type, modifying its initial PSM value to a custom value, and redirecting it to the matching redefinition channel, flexible control of the Bluetooth data transmission channel is achieved, which is conducive to improving system resource utilization efficiency, data transmission stability and security.

[0089] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of a Bluetooth HID device management system based on a virtual Bluetooth HID device, as disclosed in an embodiment of the present invention. This Bluetooth HID device management system based on a virtual Bluetooth HID device can be used to execute some or all of the steps in the Bluetooth HID device management method based on a virtual Bluetooth HID device disclosed in Embodiment 1 or Embodiment 2 of the present invention; the present invention does not limit the scope of the method. Figure 3 As shown, the Bluetooth HID device management system based on virtual Bluetooth HID devices may include an initial configuration module 301, a registration management module 302, an information publishing module 303, a connection response module 304, and a channel management module 305, wherein: The initial configuration module 301 is used to obtain administrator privileges running on the target device from the preset virtual device registration program and configure the device information included in the preset virtual device management program to the target device system.

[0090] The registration management module 302 is used to register virtual service stations in the target device's system by the virtual device management program and the preset target callback function.

[0091] The information publishing module 303 is used by the virtual device management program to perform device information publishing operations on the device information corresponding to the target virtual device registered in the virtual service station.

[0092] The connection response module 304 is used by the virtual device manager to respond to connection requests from other Bluetooth devices for device information corresponding to the published target virtual device.

[0093] The channel management module 305 is used by the virtual device management program and the virtual service station to allocate working channels that are compatible with other Bluetooth devices based on connection requests.

[0094] The channel management module 305 is also used to perform channel management operations on the connection between other Bluetooth devices and the system according to the preset channel redirection program and the working channel, so as to modify the Bluetooth data interaction channel; wherein, the channel management operation is used to perform channel redirection operations on the Bluetooth data transmitted by other Bluetooth devices.

[0095] It is evident that implementation Figure 3 The described Bluetooth HID device management system, based on virtual Bluetooth HID devices, configures virtual device information by obtaining administrator privileges, ensuring that subsequent management operations can be carried out smoothly in an environment with sufficient permissions. This avoids operational failures or functional limitations caused by insufficient permissions, providing a foundation for subsequent management. Furthermore, by registering a virtual service station and managing device information, other Bluetooth devices can obtain relevant information about the target virtual device, providing the necessary information basis for connections between Bluetooth devices. Simultaneously, it can promptly respond to connection requests from other Bluetooth devices regarding published device information, achieving efficient processing of connection requests between devices, improving the efficiency and success rate of Bluetooth device connections, and reducing waiting time and the probability of errors during the connection process. Finally, upon receiving connection requests from other Bluetooth devices, it can intelligently allocate and adapt working channels and perform channel redirection, ensuring stable and reliable Bluetooth data exchange, effectively avoiding interference and conflicts during data transmission, and guaranteeing that Bluetooth data is exchanged according to a predetermined and optimized channel, thus improving the quality and reliability of data transmission.

[0096] In an optional embodiment, please refer to Figure 4 , Figure 4 This is a schematic diagram of another Bluetooth HID device management system based on a virtual Bluetooth HID device disclosed in an embodiment of the present invention. Figure 4 As shown, the system also includes an information retrieval and processing module 306, a determination module 307, and a first instruction processing module 308, wherein: The information retrieval and processing module 306 is used to obtain the Bluetooth device list corresponding to the device information when a preset user interaction program detects a retrieval command for device information, and to display the Bluetooth device list on the display interface of the target device; the Bluetooth device list is used to display all first Bluetooth devices currently connected to the target device and all second Bluetooth devices that can be controlled. The determination module 307 is used to determine the device affiliation of the Bluetooth device to be controlled based on the control command when the user interaction program listens for the control command for the Bluetooth device list; the device affiliation includes indicating that the Bluetooth device to be controlled is the local Bluetooth device of the target device and belongs to the local affiliation or non-local affiliation of the target device. The first instruction processing module 308 is used to release control instructions by the user interaction program when it is determined that the device corresponding to the Bluetooth device to be controlled belongs to the local device, so that the target device's Bluetooth response program can respond to the control instructions.

[0097] In this optional embodiment, such as Figure 4 As shown, the system also includes a second instruction processing module 309, wherein: The second instruction processing module 309 is used to intercept control instructions by the user interaction program when it is determined that the device corresponding to the Bluetooth device to be controlled belongs to a non-local user. The second instruction processing module 309 is also used to send control instructions from the user interaction program to the virtual Bluetooth HID device corresponding to the Bluetooth device under control through the interaction interface set by the virtual device management program, so as to feed back the control instructions to the device body of the Bluetooth device under control through the virtual Bluetooth HID device, and to have the Bluetooth device under control respond to the control instructions.

[0098] As can be seen, in this optional embodiment, by detecting and viewing commands and displaying the Bluetooth device list, users can easily understand the device connection and control status; by listening to control commands and accurately determining device ownership, commands can be directly released for devices to which the user belongs, enabling a rapid response; commands for devices not to which the user belongs are intercepted and forwarded through a virtual Bluetooth HID device, expanding the scope of device management and greatly improving the convenience, accuracy, and flexibility of users' operations in controlling Bluetooth devices.

[0099] In another alternative embodiment, such as Figure 4 As shown, the system also includes a callback management module 310, wherein: The callback control module 310 is used to set a target callback function by the virtual device management program before the initial configuration module 301 configures the device information included in the preset virtual device management program to the target device's system by the preset virtual device registration program. The target callback function is used to execute a device callback operation matching the device event when a device event for the virtual Bluetooth HID device is detected. The device event includes at least one of the following: device connection, device disconnection, and data transmission abnormality. The callback control module 310 is also used to generate a device insertion event for the device information after the initial configuration module 301 configures the device information included in the preset virtual device management program into the target device system by the preset virtual device registration program, and to trigger the target callback function according to the device insertion event.

[0100] As can be seen, in this optional embodiment, by setting the target callback function in advance, key matters such as connection, disconnection, and data transmission anomalies of the virtual Bluetooth HID device can be monitored in real time and accurately; after the device information is configured, an insertion event trigger callback function is generated, which can automatically perform matching operations according to specific matters, effectively ensuring the stable and reliable operation of the Bluetooth HID device, and at the same time helping to improve the automation and response capabilities of the Bluetooth HID device's management.

[0101] In yet another optional embodiment, the registration management module 302 registers the virtual service station in the target device's system using the virtual device management program and a preset target callback function, specifically including: The virtual device management program and the preset target callback function register a virtual service station and a specified PSM Bluetooth channel in the Bluetooth protocol stack of the target device; the virtual service station is used to manage the registration and communication of the virtual Bluetooth HID device. The information publishing module 303, through the virtual device management program, performs device information publishing operations on the device information corresponding to the target virtual device registered in the virtual service station. Specifically, this includes: The virtual device management program performs encapsulation operations on the device information and specified PSM Bluetooth channel corresponding to the target virtual device registered in the virtual service station according to a preset protocol, and obtains the encapsulation result for the device information and specified PSM Bluetooth channel corresponding to the target virtual device. The target callback function performs an information publishing operation on the encapsulated result via the Bluetooth protocol stack.

[0102] As can be seen, in this optional embodiment, by registering a virtual service station and specifying a PSM channel in the Bluetooth protocol stack, centralized management and dedicated channel transmission for virtual Bluetooth HID device registration and communication are achieved, ensuring the accuracy and reliability of data transmission. The virtual device management program encapsulates device information and channels according to a preset protocol, and then the target callback function publishes it through the Bluetooth protocol stack, enabling other Bluetooth devices to quickly obtain the target virtual device information and connect accurately, thus improving the efficiency and convenience of device connection.

[0103] In another optional embodiment, the connection response module 304 may respond to connection requests from other Bluetooth devices for the device information corresponding to the published target virtual device by means of the device association program required by the device at that time, specifically including: Other Bluetooth devices receive the encapsulation results and connect to the virtual service station based on the specified PSM Bluetooth channel included in the encapsulation results; The encapsulation result is parsed by other Bluetooth devices to obtain the device ID corresponding to the target virtual Bluetooth HID device that matches other Bluetooth devices; and a connection request for the target virtual Bluetooth HID device is generated based on the device ID and the specified PSM Bluetooth channel. The connection request includes at least the MAC address corresponding to the other Bluetooth device. Update the MAC addresses of other Bluetooth devices included in the connection request to the virtual service station.

[0104] As can be seen, in this optional embodiment, specifying the PSM Bluetooth channel ensures that other Bluetooth devices accurately connect to the virtual service station, effectively avoiding connection chaos; then, by parsing the encapsulation result to obtain the device ID and generating a connection request in combination with the MAC address, the connection target and device identity are clearly identified; and the MAC address is updated to the virtual service station, achieving effective management and precise communication of connected devices, thus improving the stability, accuracy, and reliability of Bluetooth device management.

[0105] In another optional embodiment, the channel management module 305 performs channel management operations on the connection between other Bluetooth devices and the system according to a preset channel redirection procedure and the working channel, specifically including: A preset channel redirection program listens for and intercepts Bluetooth data transmitted by other Bluetooth devices based on the working channel; The channel redirection program determines whether the data request type of the Bluetooth data matches the preset data request type. When the determination result is yes, the Bluetooth data is parsed to obtain the initial PSM value corresponding to the Bluetooth data. The initial PSM value is then modified to a custom PSM value. The custom PSM value is used to redirect the Bluetooth data to a redefining channel that matches the custom PSM when the Bluetooth data is connected to a virtual service station.

[0106] As can be seen, in this optional embodiment, by listening to and intercepting Bluetooth data on the working channel through the channel redirection program, filtering out data that meets the requirements by matching the data request type, modifying its initial PSM value to a custom value, and redirecting it to the matching redefinition channel, flexible control of the Bluetooth data transmission channel is achieved, which is conducive to improving system resource utilization efficiency, data transmission stability and security.

[0107] Example 4 Please see Figure 5 , Figure 5 This is a schematic diagram of a Bluetooth HID device management and control device based on a virtual Bluetooth HID device, as disclosed in an embodiment of the present invention. Figure 5 As shown, the Bluetooth HID device management and control device based on the virtual Bluetooth HID device may include: Memory 401 storing executable program code; Processor 402 coupled to memory 401; The processor 402 calls the executable program code stored in the memory 401 to execute some or all of the steps in any of the Bluetooth HID device management methods based on virtual Bluetooth HID devices described in Embodiment 1 or Embodiment 2 of the present invention.

[0108] Example 5 This invention discloses a computer storage medium storing computer instructions. When these computer instructions are invoked, they are used to execute some or all of the steps in any of the Bluetooth HID device management methods based on virtual Bluetooth HID devices described in Embodiment 1 or Embodiment 2 of this invention.

[0109] The apparatus and system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0110] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0111] Finally, it should be noted that the above embodiments are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for managing Bluetooth HID devices based on virtual Bluetooth HID devices, characterized in that, The method includes: The system obtains administrator privileges to run on the target device through a preset virtual device registration program and configures the device information included in the preset virtual device management program into the system of the target device. The virtual device management program and the preset target callback function register a virtual service station in the system of the target device, and perform a device information publishing operation on the device information corresponding to the target virtual device registered in the virtual service station. At the same time, it responds to connection requests from other Bluetooth devices for the published device information corresponding to the target virtual device. The virtual device management program and the virtual service station allocate working channels adapted to the other Bluetooth devices according to the connection request, and perform channel management operations on the connection between the other Bluetooth devices and the system according to the preset channel redirection program and the working channels, so as to modify the interaction channel of the Bluetooth data; wherein, the channel management operation is used to perform channel redirection operations on the Bluetooth data transmitted by the other Bluetooth devices.

2. The Bluetooth HID device management method based on a virtual Bluetooth HID device according to claim 1, characterized in that, The method further includes: When a preset user interaction program detects a query command for the device information, it retrieves the Bluetooth device list corresponding to the device information and displays the Bluetooth device list on the display interface of the target device; the Bluetooth device list is used to display all first Bluetooth devices currently connected to the target device and all second Bluetooth devices that the target device can control. When the user interaction program detects a control command for the Bluetooth device list, it determines the device affiliation of the Bluetooth device to be controlled based on the control command. The device affiliation includes indicating that the Bluetooth device to be controlled is the native Bluetooth device of the target device and belongs to the native affiliation or non-native affiliation of the target device. When it is determined that the device corresponding to the Bluetooth device to be controlled belongs to the local device, the user interaction program releases the control command so that the target device's Bluetooth response program can respond to the control command.

3. The Bluetooth HID device management method based on a virtual Bluetooth HID device according to claim 2, characterized in that, The method further includes: When it is determined that the device corresponding to the Bluetooth device to be controlled belongs to the non-local device, the user interaction program intercepts the control command. The user interaction program sends the control command to the virtual Bluetooth HID device corresponding to the Bluetooth device under control through the interaction interface set by the virtual device management program, so that the control command is fed back to the device body of the Bluetooth device under control through the virtual Bluetooth HID device, and the Bluetooth device under control responds to the control command.

4. The Bluetooth HID device management method based on a virtual Bluetooth HID device according to any one of claims 1-3, characterized in that, Before configuring the device information included in the preset virtual device management program into the system of the target device, the method further includes: The virtual device management program sets a target callback function, which is used to execute a device callback operation matching the device event when a device event for the virtual Bluetooth HID device is detected; the device event includes at least one of the following: device connection, device disconnection, and data transmission error. After configuring the device information included in the preset virtual device management program into the system of the target device, the method further includes: Generate a device insertion event for the device information, and trigger the target callback function based on the device insertion event.

5. The Bluetooth HID device management method based on a virtual Bluetooth HID device according to claim 4, characterized in that, The process of registering a virtual service station in the system of the target device by the virtual device management program and a preset target callback function includes: The virtual device management program and the preset target callback function register a virtual service station and a specified PSM Bluetooth channel on the Bluetooth protocol stack of the target device; the virtual service station is used to manage the registration and communication of the virtual Bluetooth HID device. The step of publishing device information for the target virtual device registered on the virtual service station includes: The virtual device management program performs an encapsulation operation on the device information corresponding to the target virtual device registered in the virtual service station and the specified PSM Bluetooth channel according to a preset protocol to obtain the encapsulation result for the device information corresponding to the target virtual device and the specified PSM Bluetooth channel. The target callback function performs an information publishing operation on the encapsulation result through the Bluetooth protocol stack.

6. The Bluetooth HID device management method based on a virtual Bluetooth HID device according to claim 5, characterized in that, The response to connection requests from other Bluetooth devices for device information corresponding to the published target virtual device includes: The encapsulation result is received by other Bluetooth devices, and the virtual service station is connected according to the specified PSM Bluetooth channel included in the encapsulation result; The other Bluetooth devices parse the encapsulation result to obtain the device ID corresponding to the target virtual Bluetooth HID device that matches the other Bluetooth devices; and, based on the device ID and the specified PSM Bluetooth channel, generate a connection request for the target virtual Bluetooth HID device, wherein the connection request includes at least the MAC address corresponding to the other Bluetooth devices; Update the MAC addresses of the other Bluetooth devices included in the connection request to the virtual service station.

7. The Bluetooth HID device management method based on a virtual Bluetooth HID device according to claim 6, characterized in that, The step of performing channel management operations on the connection between the other Bluetooth devices and the system according to the preset channel redirection procedure and the working channel includes: A preset channel redirection program monitors and intercepts Bluetooth data transmitted by other Bluetooth devices based on the working channel; The channel redirection program determines whether the data request type of the Bluetooth data matches a preset data request type. When the determination result is yes, the Bluetooth data is parsed to obtain the initial PSM value corresponding to the Bluetooth data. The initial PSM value is then modified to a custom PSM value, which is used to redirect the Bluetooth data to a redefining channel that matches the custom PSM when the Bluetooth data is connected to the virtual service station.

8. A Bluetooth HID device management and control system based on virtual Bluetooth HID devices, characterized in that, The system includes: The initial configuration module is used to obtain administrator privileges running on the target device from the preset virtual device registration program and configure the device information included in the preset virtual device management program into the system of the target device; The registration management module is used to register virtual service stations in the target device's system by the virtual device management program and a preset target callback function; The information publishing module is used by the virtual device management program to perform device information publishing operations on the device information corresponding to the target virtual device registered in the virtual service station; A connection response module is used by the virtual device management program to respond to connection requests from other Bluetooth devices for device information corresponding to the published target virtual device. The channel management module is used by the virtual device management program and the virtual service station to allocate working channels compatible with other Bluetooth devices according to the connection request; The channel management module is further configured to perform channel management operations on the connection between the other Bluetooth devices and the system according to a preset channel redirection procedure and the working channel, so as to modify the interaction channel of the Bluetooth data; wherein, the channel management operation is used to perform channel redirection operations on the Bluetooth data transmitted by the other Bluetooth devices.

9. A Bluetooth HID device management and control device based on a virtual Bluetooth HID device, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the Bluetooth HID device management method based on a virtual Bluetooth HID device as described in any one of claims 1-7.

10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the Bluetooth HID device management method based on a virtual Bluetooth HID device as described in any one of claims 1-7.