USB Device Redirection Method, Device, Computer Device and Medium

By obtaining and parsing the redirection configuration information of USB devices and dynamically adjusting their redirection configuration, the problem of USB device redirection abnormality in cloud desktop systems is solved, and stability and flexibility during the system operation is achieved.

CN114237828BActive Publication Date: 2025-07-29HUNAN KYLIN XINAN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111594989.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2025-07-29
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

When the USB device redirection is abnormal in the cloud desktop system, control items need to be configured in advance before the system is running, resulting in the inability to dynamically adjust, affecting the stability of the system.

Method used

By responding to the redirection configuration request of the USB device, obtain the redirection configuration information, write the configuration file and trigger the virtual machine module resolution, and dynamically change the redirection configuration of the USB device, including channel binding, reset permissions, packet adjustment and redirect permissions.

Benefits of technology

It realizes dynamic adjustment of USB device redirection configuration during the operation of the network system, avoids connection interface drift and packet abnormalities, and improves the stability and flexibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237828B_ABST
    Figure CN114237828B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose a method, apparatus, computer device, and medium for redirecting a USB device. The method for redirecting a USB device is applied to a server including a virtual machine module, and includes: responding to a redirection configuration request for a USB device, obtaining redirection configuration information for the USB device; writing the redirection configuration information into a pre-stored configuration file, and sending a prompt signal to the virtual machine module; triggering the virtual machine module to parse the redirection configuration information; and changing the redirection configuration of the corresponding USB device according to the redirection configuration information. The server writes the obtained redirection configuration information into a pre-stored configuration file, triggers the virtual machine to parse the redirection configuration information, and changes the redirection configuration of the corresponding USB device. During the operation of the network system, the redirection configuration of the USB device can be dynamically changed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular, to a method, device, computer device, and medium for redirecting a USB device. Background Art

[0002] A cloud desktop, also known as desktop virtualization, is a technology that virtualizes components such as a processor, memory, and hard disk included in a terminal device in a backend server. In a cloud desktop usage scenario, to meet the usage requirements of different USB (Universal Serial Bus) devices, a cloud desktop system is usually configured with a USB device redirection function. A physical USB device of a user is connected to a virtual USB device in a server virtual machine, so that the physical USB device can be accessed in the cloud desktop system.

[0003] However, during the operation of a cloud desktop system, if situations such as connection interface drift or abnormal packet size occur, the USB device cannot receive packets sent by the server, resulting in abnormal redirection of the USB device. For the control item configuration of USB device redirection, it needs to be pre-configured before the cloud desktop system runs. When the redirection of the USB device is abnormal, it is necessary to close the running cloud desktop system and then modify the control item configuration of the USB device redirection. Summary of the Invention

[0004] In view of the defects existing in the prior art, the purpose of the embodiments of the present application is to provide a method, device, computer device, and medium for redirecting a USB device to solve the problem that it is necessary to pre-determine the control item configuration of USB device redirection before the cloud desktop system runs.

[0005] In a first aspect, an embodiment of the present application provides a method for redirecting a USB device, which is applied to a server including a virtual machine module. The method includes:

[0006] In response to a redirection configuration request for a USB device, obtain redirection configuration information for the USB device;

[0007] Write the redirection configuration information into a pre-stored configuration file, and send a prompt signal to the virtual machine module;

[0008] Trigger the virtual machine module to parse the redirection configuration information;

[0009] According to the redirection configuration information, change the redirection configuration corresponding to the USB device.

[0010] In combination with the first aspect, in a first possible implementation manner, the changing the redirection configuration corresponding to the USB device according to the redirection configuration information includes:

[0011] If the redirected configuration information parsed by the virtual machine module includes a channel binding request, determine a first redirected channel corresponding to the channel binding request, and bind the first redirected channel to the USB device;

[0012] If the redirected configuration information parsed by the virtual machine module does not include the channel binding request, obtain all second redirected channels in an idle state, and set one of the second redirected channels as the redirected channel of the USB device.

[0013] Combined with the first possible implementation manner of the first aspect, in the second possible implementation manner, the determining a first redirected channel corresponding to the channel binding request and binding the first redirected channel to the USB device includes:

[0014] Determine a first redirected channel corresponding to the channel binding request, and determine whether the first redirected channel is in an idle state;

[0015] If the first redirected channel is in an idle state, bind the first redirected channel to the USB device.

[0016] Combined with the first aspect, in the third possible implementation manner, the changing the redirected configuration corresponding to the USB device according to the redirected configuration information includes:

[0017] If the redirected configuration information parsed by the virtual machine module includes a reset permission request, send a reset shutdown instruction to the USB device to prohibit resetting the USB device.

[0018] Combined with the first aspect, in the fourth possible implementation manner, the changing the redirected configuration corresponding to the USB device according to the redirected configuration information includes:

[0019] If the redirected configuration information parsed by the virtual machine module includes a data packet adjustment request, change the size of the request data packet to a preset value corresponding to the data packet adjustment request.

[0020] Combined with the first aspect, in the fifth possible implementation manner, the changing the redirected configuration corresponding to the USB device according to the redirected configuration information includes:

[0021] If the redirected configuration information parsed by the virtual machine module includes a redirection permission request, based on the redirection permission request, set a redirection rule corresponding to the USB device to determine whether to redirect the USB device through the redirection rule.

[0022] In a first aspect, an embodiment of the present application provides a redirection device for a USB device, which is applied to a server including a virtual machine module. The device includes:

[0023] An information acquisition module, configured to respond to a redirection configuration request for a USB device and acquire redirection configuration information for the USB device;

[0024] A file configuration module, configured to write the redirection configuration information into a pre-stored configuration file and send a prompt signal to the virtual machine module;

[0025] An information parsing module, configured to trigger the virtual machine module to parse the redirection configuration information;

[0026] A configuration change module, configured to change the redirection configuration corresponding to the USB device according to the redirection configuration information.

[0027] In combination with the second aspect, in a first possible implementation manner, the configuration change module includes:

[0028] A first channel binding sub-module, configured to, if the redirection configuration information parsed by the virtual machine module includes a channel binding request, determine a first redirection channel corresponding to the channel binding request and bind the first redirection channel to the USB device;

[0029] A second channel binding sub-module, configured to, if the redirection configuration information parsed by the virtual machine module does not include a channel binding request, acquire all second redirection channels in an idle state and set one of the second redirection channels as the redirection channel of the USB device.

[0030] In a third aspect, an embodiment of the present application provides a computer device, including a processor and a memory. A program or instruction is stored on the memory, and the program or instruction is executed by the processor to enable the terminal device to execute the steps of the above-mentioned redirection method for a USB device.

[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. A program or instruction is stored on the computer-readable storage medium, and when the program or instruction is executed by a processor, the steps of the above-mentioned redirection method for a USB device are implemented.

[0032] The present application provides a method for redirecting a USB device, which is applied to a server including a virtual machine module. The method includes: responding to a redirect configuration request for the USB device, obtaining the redirect configuration information for the USB device; writing the redirect configuration information into a pre-stored configuration file, and sending a prompt signal to the virtual machine module; triggering the virtual machine module to parse the redirect configuration information; and changing the redirect configuration corresponding to the USB device according to the redirect configuration information. The server writes the obtained redirect configuration information into the pre-stored configuration file, triggers the virtual machine to parse the redirect configuration information, and changes the redirect configuration corresponding to the USB device, thereby realizing dynamically changing the redirect configuration of the USB device during the operation of the network system. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the present invention, the accompanying drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the protection scope of the present invention. In each of the drawings, similar components are denoted by similar reference numerals.

[0034] Figure 1 FIG. 9 shows a flowchart of a first method for redirecting a USB device provided in Embodiment 1 of the present invention;

[0035] Figure 2 FIG. 13 shows a flowchart of a second method for redirecting a USB device provided in Embodiment 1 of the present invention;

[0036] Figure 3 FIG. 17 shows a flowchart of a third method for redirecting a USB device provided in Embodiment 1 of the present invention;

[0037] Figure 4 FIG. 21 shows a flowchart of a fourth method for redirecting a USB device provided in Embodiment 1 of the present invention;

[0038] Figure 5 FIG. 25 shows a flowchart of a fifth method for redirecting a USB device provided in Embodiment 1 of the present invention;

[0039] Figure 6 FIG. 29 shows a schematic structural diagram of a USB device redirecting apparatus provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0040] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.

[0041] The components of the embodiments of the present invention that are typically depicted and shown in the accompanying drawings herein can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0042] Hereinafter, the terms "comprising", "having" and their cognates that can be used in various embodiments of the present invention are only intended to denote specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be construed as first precluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or as adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.

[0043] In addition, the terms "first", "second", "third", etc. are only used for differentiating descriptions and cannot be construed as indicating or implying relative importance.

[0044] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the various embodiments of the present invention belong. The terms (such as those defined in a commonly used dictionary) will be construed to have the same meaning as the contextual meaning in the relevant technical field and will not be construed to have an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present invention.

[0045] Embodiment 1

[0046] Please refer to Figure 1 , Figure 1 which shows a flowchart of the first method for redirecting a USB device provided by Embodiment 1 of the present invention. Figure 1 The method for redirecting a USB device in [[ ]] is applied to a server including a virtual machine module, and the method for redirecting the USB device includes the following steps:

[0047] Step 110, in response to a redirection configuration request for a USB device, obtain redirection configuration information for the USB device.

[0048] In this embodiment, the server is the server of the cloud desktop system, and the virtual machine module is the module for running the qemu (QuickEMUlator) process. At the same time, the cloud desktop system further includes a client device. After establishing a communication protocol with the server, the client device can access the virtual machine module in the server. The client device includes human-computer interaction devices such as a display, a mouse, and a keyboard. The user realizes the interaction with the cloud desktop system through the interaction interface provided by the human-computer interaction devices.

[0049] During the operation of the cloud desktop system, the user can write the redirection configuration information of the USB device through the human-computer interaction device. The server obtains the written redirection configuration information of the USB device through the communication protocol with the client device. The server dynamically adjusts the redirection configuration of the USB device according to the redirection configuration information of the USB device.

[0050] It should be understood that the redirection configuration information is set according to actual requirements. The redirection configuration information can be at least one of a channel binding request, a reset permission request, a data packet adjustment request, and a redirection permission request, or any redirection configuration request for the USB device, which is not limited herein.

[0051] Step 120: Write the redirection configuration information into a pre-stored configuration file and send a prompt signal to the virtual machine module.

[0052] In this embodiment, the configuration file is a json (JavaScript Object Notation) format file. The json format is a lightweight data exchange format, and the written redirection configuration information can be quickly read, parsed, and extended through the json file. When the redirection configuration information is written into the configuration file, a prompt signal is sent to the qemu process in the virtual machine module to trigger the virtual machine module to read the content in the configuration file.

[0053] Step 130: Trigger the virtual machine module to parse the redirection configuration information.

[0054] Specifically, the application for changing the configuration file is used as the sender, and the qemu process is used as the receiver. A communication connection is established between the application and the qemu process. The communication connection can be message communication, socket communication, or shared memory, which is not limited herein. For the convenience of understanding the technical solution of this application, taking socket communication as an example, the qemu process listens to the communication port with the application. When the redirection configuration information is written into the configuration file, the application sends a prompt message of "configuration file updated" to the qemu process based on the communication port. The qemu process reads the configuration file in the application and parses the redirection configuration information in the configuration file, so that the cloud desktop system can quickly read the configuration file during operation and change the redirection configuration of the USB device.

[0055] Step 140: Change the redirection configuration corresponding to the USB device according to the redirection configuration information.

[0056] According to the redirection configuration information parsed by the virtual machine module, during the operation of the cloud desktop system, the redirection configuration of the USB device is dynamically changed to avoid situations such as connection interface drift and abnormal packet size.

[0057] Please refer to Figure 2 , Figure 2 which shows the flowchart of the second method for redirecting a USB device provided in Embodiment 1 of the present invention. As an example, the step 140 includes:

[0058] Step 141: If the redirection configuration information parsed by the virtual machine module contains a channel binding request, determine the first redirection channel corresponding to the channel binding request, and bind the first redirection channel to the USB device.

[0059] The virtual machine module includes multiple USB buses, that is, data packets are sent and received with the server through multiple redirection channels. If the USB device is a device that converts a USB interface to a COM (cluster communication) interface, when the device is redirected to the virtual machine module, there will be a problem of COM port drift. If the redirection configuration information parsed by the virtual machine module contains a channel binding request for the device, the device is bound to the first redirection channel. During multiple device redirection processes, the device is mounted to the same USB bus of the virtual machine module to avoid the problem of COM port drift.

[0060] Step 142: If the redirection configuration information parsed by the virtual machine module does not contain the channel binding request, obtain all second redirection channels in the idle state, and set one of the second redirection channels as the redirection channel of the USB device.

[0061] If the redirection configuration information does not contain a channel binding request, the USB device can use any redirection channel without binding to a fixed redirection channel. Obtain all the second redirection channels in the idle state, and set one of the second redirection channels as the redirection channel of the USB device.

[0062] In an optional example, the determining the first redirection channel corresponding to the channel binding request and binding the first redirection channel to the USB device includes:

[0063] Determine the first redirection channel corresponding to the channel binding request, and determine whether the first redirection channel is in the idle state;

[0064] If the first redirection channel is in the idle state, bind the first redirection channel to the USB device.

[0065] Determine whether the first redirection channel is in the idle state. If the first redirection channel is in the idle state, bind the first redirection channel to the USB device. If the first redirection channel is not in the idle state, one of the second redirection channels in the idle state can be bound to the USB device, or a prompt message can be generated to indicate that the first redirection channel is occupied, which is not limited herein.

[0066] Please refer to Figure 3 , Figure 3 which shows the flowchart of the third redirection method for the USB device provided in Embodiment 1 of the present invention. As an example, the step 140 includes:

[0067] Step 143, if the redirection configuration information parsed by the virtual machine module contains a reset permission request, send a reset close instruction to the USB device.

[0068] Specifically, during the operation of the cloud desktop system, if it is detected that the USB device cannot be redirected to the virtual machine module of the server. According to the reset permission request included in the redirection configuration information, send a reset close instruction to the USB device to prohibit resetting the USB device to ensure that the USB device can be normally mapped to the virtual machine module. Different USB devices are set with corresponding reset permissions to avoid redirection anomalies caused by resetting the USB device. If the redirection configuration information does not contain a reset permission request, it is default to allow resetting the USB device to ensure that after the USB device crashes or other failures, the USB device can be restored to the normal operating state by resetting the USB device.

[0069] Please refer to Figure 4 , Figure 4 which shows the flowchart of the fourth redirection method for the USB device provided in Embodiment 1 of the present invention. As an example, the step 140 includes:

[0070] Step 144: If the redirected configuration information parsed by the virtual machine module includes a data packet adjustment request, change the size of the requested data packet to a preset value corresponding to the data packet adjustment request.

[0071] If the redirected configuration information does not include a data packet adjustment request, set the size of the requested data packet to the default value. When the size of the requested data packet is abnormal, such as being too large or too small, it will cause the inability to send and receive data between the server and the USB device. Based on the size of the requested data packet obtained by packet capture, generate a data packet adjustment request including the size of the requested data packet. Modify the redirected configuration of the USB device to change the size of the requested data packet to the preset value corresponding to the data packet adjustment request to ensure the normal redirection of the USB device.

[0072] Please refer to Figure 5 , Figure 5 which shows the flowchart of the fifth method for redirecting a USB device provided in Embodiment 1 of the present invention. As an example, the step 140 includes:

[0073] Step 145: If the redirected configuration information parsed by the virtual machine module includes a redirection permission request, set the redirection rule corresponding to the USB device based on the redirection permission request.

[0074] Assume that no redirection rule is set in the server, and any USB device can be redirected to the virtual machine module. If human-computer interaction devices such as touchscreens, keyboards, and mice are redirected to the virtual machine module, there is a risk that the human-computer interaction devices cannot operate properly. Redirection rules for USB devices can be set to provide a list of USB devices for redirection, and determine whether to redirect a USB device through the redirection rules.

[0075] Specifically, redirection rules corresponding to human-computer interaction devices can be set. When the server receives a redirection request sent by a human-computer interaction device, reject the redirection of the human-computer interaction device to the virtual machine module.

[0076] The present application provides a method for redirecting a USB device, which is applied to a server including a virtual machine module. The method includes: responding to a redirection configuration request for the USB device, and obtaining redirection configuration information for the USB device; writing the redirection configuration information into a pre-stored configuration file, and sending a prompt signal to the virtual machine module; triggering the virtual machine module to parse the redirection configuration information; and changing the redirection configuration corresponding to the USB device according to the redirection configuration information. The server writes the obtained redirection configuration information into a pre-stored configuration file, triggers the virtual machine to parse the redirection configuration information, and changes the redirection configuration corresponding to the USB device, thereby realizing dynamically changing the redirection configuration of the USB device during the operation of the network system.

[0077] Embodiment 2

[0078] Please refer to Figure 6 , Figure 6 which shows a schematic structural diagram of a redirection device for a USB device provided in Embodiment 2 of the present invention. Figure 6 The redirection device 200 for the USB device in

[0079] is applied to a server including a virtual machine module, and includes:

[0080] An information acquisition module 210, configured to respond to a redirection configuration request for the USB device and obtain redirection configuration information for the USB device;

[0081] A file configuration module 220, configured to write the redirection configuration information into a pre-stored configuration file and send a prompt signal to the virtual machine module;

[0082] An information parsing module 230, configured to trigger the virtual machine module to parse the redirection configuration information;

[0083] As an example, the configuration change module 240 includes:

[0084] A first channel binding sub-module, configured to determine a first redirection channel corresponding to the channel binding request if the redirection configuration information parsed by the virtual machine module includes a channel binding request, and bind the first redirection channel to the USB device;

[0085] A second channel binding sub-module, configured to obtain all second redirection channels in an idle state and set one of the second redirection channels as the redirection channel of the USB device if the redirection configuration information parsed by the virtual machine module does not include a channel binding request.

[0086] In an optional example, the first channel binding sub-module is further configured to determine a first redirected channel corresponding to the channel binding request, and determine whether the first redirected channel is in an idle state;

[0087] If the first redirected channel is in an idle state, bind the first redirected channel to the USB device.

[0088] As an example, the configuration change module 240 includes:

[0089] A reset configuration sub-module, configured to, if the redirected configuration information parsed by the virtual machine module includes a reset permission request, send a reset shutdown instruction to the USB device to prohibit resetting the USB device.

[0090] As an example, the configuration change module 240 includes:

[0091] A data packet adjustment sub-module, configured to, if the redirected configuration information parsed by the virtual machine module includes a data packet adjustment request, change the size of the request data packet to a preset value corresponding to the data packet adjustment request.

[0092] As an example, the configuration change module 240 includes:

[0093] A redirection permission sub-module, configured to, if the redirected configuration information parsed by the virtual machine module includes a redirection permission request, set a redirection rule for the corresponding USB device based on the redirection permission request, and determine whether to redirect the USB device through the redirection rule.

[0094] The redirection device 200 of the USB device is configured to execute the corresponding steps in the above-mentioned redirection method of the USB device. The specific implementation of each function will not be described one by one here. In addition, the optional examples in Embodiment 1 are also applicable to the redirection device 200 of the USB device in Embodiment 2.

[0095] An embodiment of the present application further provides a computer device, including a processor and a memory. A program or instruction is stored on the memory, and the program or instruction is executed by the processor to cause the router to execute the steps of the above-mentioned redirection method of the USB device.

[0096] An embodiment of the present application further provides a computer-readable storage medium. A program or instruction is stored on the computer-readable storage medium, and when the program or instruction is executed by a processor, the steps of the above-mentioned redirection method of the USB device are implemented.

[0097] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the structure diagram and / or flowchart, as well as the combination of blocks in the structure diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0098] In addition, in each embodiment of the present invention, each functional module or unit can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.

[0099] If the above-mentioned functions are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0100] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, and all should be covered by the protection scope of the present invention.

Claims

1. A method for redirecting a USB device, characterized in that, Applied to a server including a virtual machine module, the method includes: In response to a redirection configuration request for a USB device, obtain the redirection configuration information for the USB device; Write the redirection configuration information into a pre-stored configuration file, and send a prompt signal to the virtual machine module; Trigger the virtual machine module to parse the redirection configuration information; According to the redirection configuration information, change the redirection configuration corresponding to the USB device; The changing the redirection configuration corresponding to the USB device according to the redirection configuration information includes: If the redirection configuration information parsed by the virtual machine module includes a channel binding request, determine the first redirection channel corresponding to the channel binding request, and bind the first redirection channel to the USB device; If the redirection configuration information parsed by the virtual machine module does not include the channel binding request, obtain all second redirection channels in an idle state, and set one of the second redirection channels as the redirection channel of the USB device.

2. The redirection method of the USB device according to claim 1, characterized in that, The determining the first redirection channel corresponding to the channel binding request and binding the first redirection channel to the USB device includes: Determine the first redirection channel corresponding to the channel binding request, and determine whether the first redirection channel is in an idle state; If the first redirection channel is in an idle state, bind the first redirection channel to the USB device.

3. The redirection method of the USB device according to claim 1, characterized in that, The changing the redirection configuration corresponding to the USB device according to the redirection configuration information includes: If the redirection configuration information parsed by the virtual machine module includes a reset permission request, send a reset shutdown instruction to the USB device to prohibit resetting the USB device.

4. The redirection method of the USB device according to claim 1, characterized in that, The changing the redirection configuration corresponding to the USB device according to the redirection configuration information includes: If the redirection configuration information parsed by the virtual machine module includes a data packet adjustment request, change the size of the request data packet to a preset value corresponding to the data packet adjustment request.

5. The redirection method of the USB device according to claim 1, wherein The changing the redirection configuration corresponding to the USB device according to the redirection configuration information includes: If the redirection configuration information parsed by the virtual machine module includes a redirection permission request, based on the redirection permission request, set the redirection rule corresponding to the USB device to determine whether to redirect the USB device through the redirection rule.

6. A redirection device for a USB device, characterized in that, Applied to a server including a virtual machine module, the device includes: An information acquisition module, configured to obtain the redirection configuration information for the USB device in response to a redirection configuration request for the USB device; A file configuration module, configured to write the redirection configuration information into a pre-stored configuration file, and send a prompt signal to the virtual machine module; An information parsing module, configured to trigger the virtual machine module to parse the redirection configuration information; A configuration change module, configured to change the redirection configuration corresponding to the USB device according to the redirection configuration information; The first channel binding sub-module is used to determine a first redirected channel corresponding to the channel binding request if the redirected configuration information parsed by the virtual machine module includes a channel binding request, and bind the first redirected channel to the USB device; The second channel binding sub-module is used to obtain all second redirected channels in an idle state and set one of the second redirected channels as the redirected channel of the USB device if the redirected configuration information parsed by the virtual machine module does not include a channel binding request.

7. A computer device, characterized in that, It includes a processor and a memory, and a program or instruction is stored on the memory. When the program or instruction is executed by the processor, the steps of the redirection method of the USB device according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, characterized in that, A program or instruction is stored on the computer-readable storage medium. When the program or instruction is executed by the processor, the steps of the redirection method of the USB device according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for redirecting port, server and system

    CN105721566A

  • Cloud desktop terminal USB redirection method

    CN112256389A

  • Hardware equipment configuration method and device, equipment and storage medium

    CN113485756A