USB equipment redirection method and device based on container desktop cloud

The method and apparatus for USB device redirection in container desktop clouds address the challenge of redirecting USB devices in CDI by enabling cross-network sharing and management, offering flexibility, security, and efficiency across various OS environments.

CN119854289APending Publication Date: 2025-04-18BEIJING YUNCHUANG SHILIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510038999.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

Current USB redirection technologies in cloud desktop virtualization, particularly in Container Desktop Infrastructure (CDI), face challenges in effectively redirecting USB devices to client cloud desktops.

Method used

A method and apparatus for USB device redirection in container desktop clouds, involving steps like sending mount instructions to USB/IP shared services, establishing TCP connections, and binding USB devices across cloud services to enable cross-network sharing and management.

Benefits of technology

Enables flexible, secure, and efficient sharing of USB devices across networks, allowing access to remote devices without physical connection, supporting multiple OS environments, and enhancing scalability and cost-effectiveness in team environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854289A_ABST
    Figure CN119854289A_ABST
Patent Text Reader

Abstract

The invention discloses a container desktop cloud-based USB (universal serial bus) equipment redirection method and device, and a cloud client comprises the following steps: receiving a mounting instruction by a USB / IP (internet protocol) sharing service, sharing information of to-be-mounted USB equipment to a USBIPD (universal serial bus IPD) service, and sending a request for establishing tcp (transfer control protocol) connection to the USBIPD service; receiving tcp connection establishment information; the information of the USB device to be mounted is sent to the USBIPD service of the cloud server side; and binding the USB device with the cloud server, and establishing a connection. Through the method and the device, cross-network sharing comprises the following steps: sharing USB equipment on a network, and accessing remote equipment; no physical access is required: the device is shared on the network; flexibility and expandability are realized; resource sharing: allowing a plurality of users to share the same device; compatibility: the system can be operated on various operating systems, and requirements in various environments are met; and security: ensuring that the data is protected in a network transmission process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of USB devices, and in particular relates to a method and device for redirecting USB devices based on container desktop cloud. Background Art

[0002] Traditional USB redirection usually requires physical access to the device, such as connecting the USB device to the host and then redirecting it to the virtual machine.

[0003] With the development of cloud computing and virtualization technology, cloud desktop technology has gradually matured. With the digital transformation of enterprises, more and more enterprises are using cloud desktop as a flexible, secure and efficient office solution.

[0004] The current mainstream cloud desktop virtualization technology is VDI, but due to its natural architecture, the density of virtual desktops is low. At this time, cloud desktop applications based on CDI (container-based infrastructure) architecture were born.

[0005] The current USB redirection technology based on the VDI technology architecture, through the cloud desktop virtualization transmission protocol analysis, under the CDI architecture (based on container infrastructure), how to redirect USB external devices to the client cloud desktop has become an urgent problem to be solved. Summary of the invention

[0006] The purpose of the present invention is to overcome the above problems and provide a method and apparatus for redirecting USB devices based on container desktop cloud.

[0007] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0008] A method for redirecting a USB device based on a container desktop cloud, wherein the cloud client comprises the following steps:

[0009] Send a mount instruction to the USB / IP sharing service, the USB / IP sharing service receives the mount instruction, and based on the mount instruction, shares the USB device information to be mounted with the USBIPD service, and the USBIPD service sends a request to establish a TCP connection to the USBIPD service on the cloud service end;

[0010] Receive information about establishing a TCP connection;

[0011] Send the USB device information to be mounted to the USBIPD service of the cloud server;

[0012] Receive the binding device information of the cloud server, bind the USB device to the cloud server, and establish a connection.

[0013] As a further improvement, the cloud client further includes the following steps:

[0014] Sending a USB device mount success confirmation request message to the management service of the cloud server;

[0015] Receive confirmation that the USB device has been successfully mounted;

[0016] Sending the USB device ID and the container service name to the management service of the cloud service end, and sending the management service of the cloud service end a mapping request;

[0017] Receive the mapping establishment success message.

[0018] On the other hand, a method for redirecting a USB device based on a container desktop cloud is provided, and the cloud server includes the following steps:

[0019] The USBIPD service receives the request to establish a TCP connection, establishes the TCP connection information and feeds it back to the cloud client;

[0020] Receive the USB device information to be mounted;

[0021] The bound USB device information to be mounted is sent to the USBIPD service of the cloud client.

[0022] As a further improvement, the receiving of the USB device information to be mounted includes the following steps:

[0023] The USBIPD service receives the USB device ID of the USB device to be mounted and the unique identification information of the desktop.

[0024] As a further improvement, the management service of the cloud service end includes the following steps:

[0025] Receive USB device mount success confirmation request information, and send mount success confirmation information to the cloud client;

[0026] Receive the USB device ID and container service name,

[0027] Receive mapping request information, and send mapping request information of successful establishment to the cloud client.

[0028] As a further improvement, the management service of the cloud service end further includes the following steps:

[0029] Receive the corresponding file information of the mounted USB device;

[0030] Write the corresponding file information of the mounted USB device into the devices.allow file under the corresponding container directory.

[0031] As a further improvement, the monitoring service of the cloud service end includes the following steps:

[0032] Detect mounted USB devices;

[0033] Based on the mounted USB device, record the corresponding file of the mounted USB device;

[0034] Send the corresponding file of the mounted USB device to the management service of the cloud service end.

[0035] On the other hand, the present invention also provides a redirection device for a USB device based on a container desktop cloud, the device comprising at least one processor and a memory storing instructions, and when the instructions are executed by at least one processor, the method in the above technical solution is implemented.

[0036] A computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method described in the steps of the above technical solution.

[0037] A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method described in the steps of the above technical solution is implemented.

[0038] The beneficial effects of the present invention are:

[0039] Through this method and device, cross-network sharing is achieved: USB devices can be shared on the network, and remote devices can be accessed without having to be directly connected to the devices; no physical access is required: the devices are shared on the network, and virtual machines or remote hosts can access them through the network; flexibility and scalability: greater flexibility and scalability are provided, and are not limited to use on the same host. Devices and hosts can be connected arbitrarily on the network without being restricted by physical location; resource sharing: in a team environment, multiple users are allowed to share the same device, thereby saving costs and improving efficiency; compatibility: it can run on a variety of operating systems, including Windows, Linux, and macOS, and can meet the needs of a variety of environments; security: a certain degree of security is provided through encryption and authentication to ensure that data is protected during network transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The present invention has the following accompanying drawings:

[0041] Figure 1 are flow charts of some specific embodiments of the present invention;

[0042] Figure 2 are flow charts of some specific embodiments of the present invention;

[0043] Figure 3A schematic diagram of a redirection device for a USB device based on a container desktop cloud in the present invention. DETAILED DESCRIPTION

[0044] The following examples further illustrate the content of the present invention, but should not be construed as limiting the present invention. Without departing from the spirit and substance of the present invention, modifications or substitutions made to the methods, steps or conditions of the present invention all fall within the scope of the present invention.

[0045] like Figure 1 As shown, the present invention provides a method for redirecting a USB device based on a container desktop cloud, and the cloud client includes the following steps:

[0046] Step S10: Sending a mount instruction to the USB / IP sharing service, the USB / IP sharing service receives the mount instruction, and based on the mount instruction, shares the USB device information to be mounted with the USBIPD service, and the USBIPD service sends a request to establish a TCP connection to the USBIPD service on the cloud service end;

[0047] Step S11: receiving information on establishing a TCP connection;

[0048] Step S12: Send the USB device information to be mounted to the USBIPD service of the cloud server;

[0049] Step S13: Receive the binding device information of the cloud server, bind the USB device to the cloud server, and establish a connection.

[0050] The cloud client also includes the following steps:

[0051] Step S14: Sending a USB device mount success confirmation request message to the management service of the cloud server;

[0052] Step S15: receiving confirmation that the USB device is mounted successfully;

[0053] Step S16: Sending the USB device ID and the container service name to the management service of the cloud service end, and sending the management service of the cloud service end a mapping request;

[0054] Step S17: Receive mapping establishment success information.

[0055] like Figure 2 As shown, on the other hand, a method for redirecting a USB device based on a container desktop cloud is provided, and the cloud server includes the following steps:

[0056] Step S20: The USBIPD service receives the request to establish a TCP connection, establishes the TCP connection information and feeds it back to the cloud client;

[0057] Step S21: receiving the USB device information to be mounted;

[0058] Step S22: Send the bound USB device information to be mounted to the USBIPD service of the cloud client.

[0059] Receiving the USB device information to be mounted includes the following steps:

[0060] The USBIPD service receives the USB device ID of the USB device to be mounted and the unique identification information of the desktop.

[0061] The management service of the cloud server includes the following steps:

[0062] Step S23: receiving a USB device mount success confirmation request message, and sending the mount success confirmation message to the cloud client;

[0063] Step S24: receiving the USB device ID and container service name,

[0064] Step S25: Receive mapping request information, and send successful mapping request information to the cloud client.

[0065] The management service of the cloud server also includes the following steps:

[0066] Step S26: receiving the corresponding file information of the mounted USB device;

[0067] Step S27: Write the corresponding file information of the mounted USB device into the devices.allow file under the corresponding container directory.

[0068] The monitoring service on the cloud server includes the following steps:

[0069] Detect mounted USB devices;

[0070] Based on the mounted USB device, record the corresponding file of the mounted USB device;

[0071] Send the corresponding file of the mounted USB device to the management service of the cloud service end.

[0072] The present invention discloses a USB redirection method based on a container desktop cloud client, which can enable a user to redirect a USB device when using the container cloud desktop client.

[0073] Detailed explanation of the program content

[0074] 1. Install USBIPD service on the server and client

[0075] Install and configure the `usbipd` service on the server and client to enable USB devices to be mounted to remote clients over the network. The `usbipd` service can share USB devices over an IP network.

[0076] 2. Install USB event monitoring service on the server

[0077] Install a dedicated USB event monitoring service on the server, such as `udev` or `libusb`, to monitor the plugging and unplugging events of USB devices on the server in real time.

[0078] The monitoring service will record each USB device plug-in and unplug event in the database. The information recorded in the database includes device ID, device type, plug-in and unplug time, and other possible device attribute information.

[0079] The database may adopt MySQL, PostgreSQL or other suitable relational database management systems.

[0080] 3. Perform the mount operation on the container desktop cloud client

[0081] When the container desktop cloud client needs to use a USB device, use the `usbip` command to mount the USB device to the server.

[0082] The specific operation commands are `usbip bind` and `usbip attach`. The former is executed on the client to share the USB device, and the latter is executed on the server to mount the device.

[0083] The mounting process involves details such as device identification, connection establishment, and data transmission optimization.

[0084] 4. Map USB devices to container cloud desktop

[0085] The container desktop cloud client maps the USB device mounted on the server to the specific container cloud desktop.

[0086] This step requires the client to send the device ID and the unique identifier of the desktop to the server's USB service so that the server knows which device to map to which desktop instance.

[0087] Use RPC (Remote Procedure Call) or RESTful API for communication to ensure efficient and secure data transmission.

[0088] 5. Update the device access permissions of the container

[0089] The USB service on the server obtains relevant device information based on the file list corresponding to the device ID monitored in the database.

[0090] Write these device information to the `devices.allow` file of the corresponding container to authorize the container to access specific USB devices.

[0091] This process involves permission management and security settings to ensure that only authorized containers can access the corresponding USB devices.

[0092] A specific implementation method of this method is described below:

[0093] 1. Install the Docker environment on the server and create a swarm cluster as required.

[0094] 2. Install the desktop cloud management system based on the cluster, enter the system to create users, desktops, and policies, and assign specific container desktops and USB-related policies to users.

[0095] 3. Install and start the USB service.

[0096] 4. Install the desktop cloud client on the client.

[0097] 5. Log in to the client, select desktop startup, select a USB device plugged into the client, click Connect, redirect the device to the server, and then call the interface to mount the device on the server into a Docker container on the server.

[0098] Glossary

[0099] VDI: Virtual Desktop Infrastructure, the user's desktop and data are centrally deployed in a cloud data center (server), the user's desktop is virtualized, and the user uses a terminal (thin terminal or PC, etc.) to access the user's desktop in the cloud data center through a network transmission protocol. VDI virtual desktop architecture is a "cloud storage, centralized computing" desktop cloud architecture. During operation, the virtualization management program Hypervisor virtualizes each server into multiple virtual machines, and meets basic office needs by installing OS, basic software, office applications, etc. in the virtual machine.

[0100] CDI: Based on the container desktop infrastructure (Container Desktop Infrastructure), the user's desktop and data are centrally deployed in the cloud data center (server). Users access the user's desktop in the cloud data center through terminals (thin terminals or PCs, etc.) through network transmission protocols, and the user's desktop is delivered anytime and anywhere through the cloud. However, unlike VDI, the server does not perform traditional virtualization, but provides users with an application operating environment based on the container engine and container cluster management platform. Each user can use one or more containers as needed, and can be flexibly allocated.

[0101] Container cloud desktop: cloud desktop based on CDI architecture

[0102] Container Desktop Cloud Client: Cloud Desktop Client Software Based on CDI Architecture

[0103] usbipd service: USB / IP is a remote USB device sharing technology that allows users to share and access USB devices over the network as if they were directly connected to the local computer. The USB / IP service (usbipd) is part of the USB / IP implementation and is responsible for managing the sharing and access of USB devices on the server side. usbipd is responsible for listening to client requests and mapping these requests to USB devices on the server, allowing clients to access these devices remotely.

[0104] Client: Usually refers to the computer or device that makes requests to the server to obtain services or resources in the network. In this case, the client can be a computer that installs and runs the client application.

[0105] Through this method and device, cross-network sharing is achieved: USB devices can be shared on the network, and remote devices can be accessed without having to be directly connected to the devices; no physical access is required: the devices are shared on the network, and virtual machines or remote hosts can access them through the network; flexibility and scalability: greater flexibility and scalability are provided, and are not limited to use on the same host. Devices and hosts can be connected arbitrarily on the network without being restricted by physical location; resource sharing: in a team environment, multiple users are allowed to share the same device, thereby saving costs and improving efficiency; compatibility: it can run on a variety of operating systems, including Windows, Linux, and macOS, and can meet the needs of a variety of environments; security: a certain degree of security is provided through encryption and authentication to ensure that data is protected during network transmission.

[0106] In some specific embodiments, Figure 3As shown, a redirection device for a USB device based on a container desktop cloud is provided, the device comprising at least one processor and a memory storing instructions for implementing any one of the redirection methods for a USB device based on a container desktop cloud in the above technical solutions.

[0107] In some specific embodiments, a computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in the above technical solution.

[0108] In some specific embodiments, a computer program product is provided, the computer program product includes a computer program, and when the computer program is executed by a processor, the method of implementing the steps in the above technical solution is implemented.

[0109] The embodiments and functional operations of the subject matter described in this specification may be implemented in: digital electronic circuitry, tangibly implemented computer software or firmware, computer hardware, including the structures disclosed in this specification and their structural equivalents, or a combination of more than one of the above. The embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on one or more tangible non-transitory program carriers, for execution by a data processing device or to control the operation of a data processing device.

[0110] Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode information for transmission to an appropriate receiver device for execution by a data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of the above devices.

[0111] A computer program (which may also be referred to or described as a program, software, software application, module, software module, script or code) may be written in any form of programming language, including compiled or interpreted languages ​​or declarative or procedural languages, and the computer program may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment. A computer program may, but need not, correspond to a file in a file system. A program may be stored in a portion of a file that stores other programs or data, for example, one or more scripts stored in the following: in a markup language document; in a single file dedicated to a related program; or in multiple collaborative files, for example, files storing one or more modules, subroutines or code portions. A computer program may be deployed to execute on one or more computers, the computers being located in one place or distributed to multiple locations and interconnected by a communication network.

[0112] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.

[0113] Although the present invention has been described in detail above by general description, specific implementation methods and experiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A method for redirecting USB devices based on container desktop cloud, characterized in that: The cloud client includes the following steps: Send a mount instruction to the USB / IP sharing service, the USB / IP sharing service receives the mount instruction, and based on the mount instruction, shares the USB device information to be mounted with the USBIPD service, and the USBIPD service sends a request to establish a TCP connection to the USBIPD service on the cloud service end; Receive information about establishing a TCP connection; Send the USB device information to be mounted to the USBIPD service of the cloud server; Receive the binding device information of the cloud server, bind the USB device to the cloud server, and establish a connection.

2. According to a method for redirecting a USB device based on a container desktop cloud according to claim 1, it is characterized in that: The cloud client further comprises the following steps: Sending a USB device mount success confirmation request message to the management service of the cloud server; Receive confirmation that the USB device has been successfully mounted; Sending the USB device ID and the container service name to the management service of the cloud service end, and sending the management service of the cloud service end a mapping request; Receive the mapping establishment success message.

3. A method for redirecting USB devices based on container desktop cloud, characterized in that: The cloud service includes the following steps: The USBIPD service receives the request to establish a TCP connection, establishes the TCP connection information and feeds it back to the cloud client; Receive the USB device information to be mounted; The bound USB device information to be mounted is sent to the USBIPD service of the cloud client.

4. According to a method for redirecting a USB device based on a container desktop cloud according to claim 1, it is characterized in that: The receiving of the USB device information to be mounted comprises the following steps: The USBIPD service receives the USB device ID of the USB device to be mounted and the unique identification information of the desktop.

5. According to a method for redirecting a USB device based on a container desktop cloud according to claim 1, it is characterized in that: The management service of the cloud server includes the following steps: Receive USB device mount success confirmation request information, and send mount success confirmation information to the cloud client; Receive the USB device ID and container service name, Receive mapping request information, and send mapping request information of successful establishment to the cloud client.

6. According to a method for redirecting a USB device based on a container desktop cloud according to claim 1, it is characterized in that: The management service of the cloud server also includes the following steps: Receive the corresponding file information of the mounted USB device; Write the corresponding file information of the mounted USB device into the devices.allow file under the corresponding container directory.

7. According to a method for redirecting a USB device based on a container desktop cloud according to claim 1, it is characterized in that: The monitoring service of the cloud server includes the following steps: Detect mounted USB devices; Based on the mounted USB device, record the corresponding file of the mounted USB device; Send the corresponding file of the mounted USB device to the management service of the cloud service end.

8. A USB device redirection device based on container desktop cloud, the device comprising at least one processor and a memory storing instructions, characterized in that: When the instruction is executed by at least one processor, a USB device redirection method based on a container desktop cloud as described in any one of claims 1 to 7 is implemented.