A USB redirection implementation method, system and related equipment

By adopting the preset data transmission mode in the USB redirection solution, the terminal simulates the data request of the cloud server and sends the data to the cloud server cache, which solves the problems of poor USB redirection compatibility and high latency in the existing technology, and achieves Low-latency, high-real-time data transmission improves user experience.

CN115190073BActive Publication Date: 2024-09-06ALIBABA (CHINA) CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202210554576.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2024-09-06
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

When transmitting peripherals with interrupt transmission type endpoints, the existing USB redirection solution has poor compatibility and cannot meet the transmission requirements of low latency and high real-time performance, resulting in poor user experience.

Method used

In the preset data transmission mode, the terminal simulates the data request of the cloud server, generates a simulated data request and sends the data of the USB device to the cloud server. The cloud server caches the received data for backup, and directly retrieves it from the cache when needed by the local USB application. Obtained from the queue to reduce the number of data interactions and network delay.

Benefits of technology

It improves the data interaction speed of USB redirection, meets the transmission requirements of low latency and high real-time, improves the user experience, and avoids data overflow and network congestion through congestion control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115190073B
    Figure CN115190073B
Patent Text Reader

Abstract

The present invention discloses a method, system and related equipment for realizing USB redirection. The method comprises: in a preset data transmission mode, a terminal generates a simulated data request according to a set rule and sends it to a USB device; the simulated data request is generated by simulating a data request sent by a cloud server; and the data provided by the USB device according to the simulated data request is sent to the cloud server. In the preset data transmission mode, after receiving the data of the USB device sent by the terminal, the cloud server adds the received data to a cache queue; after receiving the data acquisition request of the USB application, the requested data is obtained from the cache queue and provided to the USB application. The method can reduce the number of data interactions of USB redirection, improve the speed and efficiency of data interaction, meet the transmission requirements of low latency and high real-time performance of data transmission, improve system performance, and greatly improve user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and in particular to a method, system and related equipment for realizing USB redirection. Background Art

[0002] USB redirection is a technology that transfers local USB data of a device to a remote system and implements the corresponding USB function in the remote system. In cloud applications or cloud desktop scenarios, it is often necessary to support USB peripheral redirection functions, such as USB camera redirection. Currently, there are two main USB peripheral redirection solutions: USB device redirection and USB port redirection. For peripherals with interrupt transmission type endpoints, the USB device redirection solution requires a transmission channel to be provided at the application layer to transmit data, which has poor compatibility. Therefore, it is usually more inclined to use the USB port redirection solution, which directly transmits the underlying USB raw data and has better compatibility.

[0003] Since the interrupt transmission type will periodically query the interrupt transmission type endpoint of the peripheral to send or receive data, and since the amount of data in the polling request is large, the network delay and network jitter are relatively large, it cannot meet the transmission requirements of low latency and high real-time data transmission, and the user experience is poor. Summary of the invention

[0004] In view of the above problems, the present invention is proposed to provide a USB redirection implementation method, system and related devices that overcome the above problems or at least partially solve the above problems.

[0005] An embodiment of the present invention provides a method for implementing USB redirection, including:

[0006] In the preset data transmission mode, a simulated data request is generated according to a set rule and sent to the USB device; the simulated data request is generated by simulating a data request sent by a cloud server;

[0007] The data provided by the USB device according to the simulated data request is sent to the cloud server.

[0008] In some optional embodiments, generating a simulation data request according to a set rule includes:

[0009] Determine a simulation rate of the simulated data request according to the rate at which the cloud server sends the data request or the data transmission frequency configured by the USB data transmission type;

[0010] Generates simulated data requests at the simulated rate.

[0011] In some optional embodiments, the above method further includes:

[0012] Receive cache control information sent by the cloud server;

[0013] The simulation rate of the simulated data request is adjusted according to the data cache information included in the cache control information, wherein the data cache information includes at least one of the data length in the cache queue and the resource occupation ratio of the data cache queue.

[0014] In some optional embodiments, the above method further includes:

[0015] Based on the control instruction for obtaining device information received from the cloud server, send enumeration information of the USB device to the cloud server, wherein the enumeration information includes the endpoint type in the USB device; receive the start instruction sent by the cloud server, and start the preset data transmission mode according to the start instruction; and / or

[0016] When it is detected that the USB device is unplugged or a stop command sent by the cloud server is received, the preset data transmission mode is closed.

[0017] The embodiment of the present invention also provides another USB redirection implementation method, including:

[0018] In the preset data transmission mode, after receiving the data of the USB device sent by the terminal, the received data is added to the cache queue;

[0019] After receiving a data acquisition request from a USB application, the requested data is acquired from the cache queue and provided to the USB application.

[0020] In some optional embodiments, the above method further includes:

[0021] Sending a control instruction for acquiring device information to the terminal to acquire enumeration information of the USB device on the terminal; if the USB data transmission type is determined to be an interrupt transmission type or a transmission type in which the data transmission complies with a preset transmission rule according to the endpoint type in the USB device included in the enumeration information, sending a start instruction for starting the preset data transmission mode to the terminal, and starting the preset data transmission mode; and / or

[0022] Determine whether the USB device is unplugged or send a stop instruction to the terminal to stop the preset data transmission mode according to the requirements of the USB application, and close the preset data transmission mode.

[0023] In some optional embodiments, the above method further includes:

[0024] Cache control information is sent to the terminal, wherein the cache control information includes data cache information, and the data cache information includes at least one of the length of data in the cache queue and the resource occupancy ratio of the data cache queue.

[0025] An embodiment of the present invention provides a terminal, comprising: a simulation request module, a first data packet processing module and a USB redirection client;

[0026] The USB redirection client is used to communicate with the cloud server to send and receive data;

[0027] The simulation request module is used to generate a simulation data request according to a set rule based on the data request sent by the cloud server in a preset data transmission mode, and send it to the USB device;

[0028] The first data packet processing module is used to send the data provided by the USB device according to the simulated data request to the cloud server.

[0029] In some optional embodiments, the terminal further includes at least one of the following modules:

[0030] The first control packet processing module is used to send enumeration information of the USB device to the cloud server based on the control instruction for obtaining device information sent by the cloud server; the enumeration information includes the endpoint type in the USB device; receive the start instruction sent by the cloud server, start the preset data transmission mode according to the start instruction; and / or close the preset data transmission mode when detecting that the USB device is unplugged or receiving the stop instruction sent by the cloud server

[0031] The congestion control module is used to receive cache control information sent by the cloud server; adjust the simulation rate of the simulated data request according to the data cache information included in the cache control information, and the data cache information includes at least one of the data length in the cache queue and the resource occupancy ratio of the data cache queue.

[0032] An embodiment of the present invention provides a cloud server, comprising: a USB virtual controller, a second data packet processing module and a USB redirection server;

[0033] The USB redirection server is used to communicate with the terminal to send and receive data;

[0034] The USB virtual controller is used to send a data acquisition request of the USB application to the second data packet processing module;

[0035] The second data packet processing module is used to, in a preset data transmission mode, add the received data to a cache queue after receiving data from a USB device sent by a terminal; and after receiving a data acquisition request from a USB application, obtain the requested data from the cache queue and provide it to the USB application.

[0036] In some optional embodiments, the cloud server further includes: a second control packet processing module, configured to perform at least one of the following steps:

[0037] Sending a control instruction for acquiring device information to a terminal to acquire enumeration information of a USB device on the terminal; if the USB data transmission type is determined to be an interrupt transmission type or a transmission type in which the data transmission complies with a preset transmission rule according to the endpoint type in the USB device included in the enumeration information, sending a start instruction for starting the preset data transmission mode to the terminal, and starting the preset data transmission mode;

[0038] Determine that the USB device is unplugged or send a stop instruction to the terminal to stop the preset data transmission mode according to the requirements of the USB application, and turn off the preset data transmission mode;

[0039] Cache control information is sent to the terminal, wherein the cache control information includes data cache information, and the data cache information includes at least one of the length of data in the cache queue and the resource occupancy ratio of the data cache queue.

[0040] An embodiment of the present invention provides a USB redirection implementation system, comprising: the above-mentioned cloud server and the above-mentioned terminal.

[0041] An embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the processor implements one of the above-mentioned USB redirection implementation methods or another of the above-mentioned USB redirection implementation methods.

[0042] An embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and when the computer executable instructions are executed by a processor, the above-mentioned one USB redirection implementation method or the above-mentioned another USB redirection implementation method is implemented.

[0043] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:

[0044] The USB redirection implementation method provided by the embodiment of the present invention can, under a preset data transmission mode, enable the terminal to simulate a data request sent by a cloud server to generate a simulated data request, and obtain data from a USB device based on the simulated data request and send it to the cloud server for caching and standby, without having to wait for and receive the data request sent by the cloud server. This can reduce the amount of data in polling requests, reduce the number of data interactions, reduce the network delay of USB redirection data interaction, and increase the data interaction speed of USB redirection. This method can meet the transmission requirements of low latency and high real-time performance for data transmission, and greatly improve the user experience.

[0045] The USB redirection implementation method provided by the embodiment of the present invention, in a preset data transmission mode, after the cloud server receives the data of the USB device sent by the terminal based on the simulated data request generated by itself, it caches the data in the cache queue. When the local USB application needs to obtain data, it does not need to send a data request to the terminal, but directly obtains it from the cache queue, which can reduce the number of data interactions with the terminal and the waiting time for data acquisition, thereby reducing the network delay of USB redirection data interaction and improving the data interaction speed of USB redirection. This method can meet the transmission requirements of low latency and high real-time performance of data transmission, and greatly improve the user experience.

[0046] In the above method, when it is determined that the data transmission of the USB device meets certain requirements, the optimized preset data transmission mode is started, and this transmission mode is used for data transmission in subsequent transmissions. The transmission mode can be stopped at any time as needed and switched back to the existing transmission mode.

[0047] The above method can also adjust the rate of generating simulated data requests to adjust the rate of data transmission according to the cache status of the cache queue, avoid data overflow in the cache queue, and prevent network congestion; at the same time, it can also ensure that there is a certain amount of data cache in the cache queue for USB applications to use.

[0048] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0049] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0051] Figure 1 This is a flow chart of a method for implementing USB redirection in Embodiment 1 of the present invention;

[0052] Figure 2 This is a flow chart of a method for implementing USB redirection in Embodiment 2 of the present invention;

[0053] Figure 3 A schematic diagram of the structure of a terminal in an embodiment of the present invention;

[0054] Figure 4 This is a schematic diagram of the structure of a cloud server in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of the structure of a USB redirection implementation system in an embodiment of the present invention;

[0056] Figure 6 This is an example diagram of a system framework for implementing USB redirection in an embodiment of the present invention;

[0057] Figure 7 The present invention is a flowchart of a specific implementation method of USB redirection in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0059] In a cloud desktop or cloud application scenario, after a terminal is locally plugged into a USB device, if it is to be used in a remote cloud desktop or cloud application, it needs to be redirected to the cloud desktop or cloud application in the cloud. Currently, a USB port redirection solution is usually adopted. This solution transmits USB original data packets between the terminal or cloud server. The transmitted data packets are relatively small and in large quantities, so there are performance problems such as network delay and network jitter. In order to solve the problems in the prior art, an embodiment of the present invention provides a USB redirection implementation method. When the USB data transmission has a transmission requirement for optimized transmission, an optimized data transmission mode is started. In the optimized data transmission mode, the terminal simulates a data request from a cloud server, and based on the simulated data request, the data of the USB device is provided to the cloud server for caching. When the USB application in the cloud server needs to obtain data, it does not send a data request to the terminal, but obtains the requested data from the cached data, thereby reducing the amount of data transmission between the cloud server and the terminal, improving the speed and efficiency of the USB application in the cloud server to obtain data, reducing delays, and improving the performance of USB redirection.

[0060] Embodiment 1

[0061] Embodiment 1 of the present invention provides a USB redirection implementation method, which is implemented in a terminal, and its process is as follows: Figure 1 As shown, the following steps are included:

[0062] Step S101: In the preset data transmission mode, generate a simulated data request according to the set rules and send it to the USB device. The simulated data request is generated by simulating the data request sent by the cloud server.

[0063] When the terminal and the cloud server are in a normal data transmission mode, when the USB application in the cloud server needs to obtain data from the USB device of the terminal, the cloud server generally sends a data request to the terminal according to the request of the USB application, and the terminal obtains data from the inserted USB device according to the data request and provides it to the cloud server. The data delay is relatively long and the real-time performance is relatively poor. Therefore, in this application, for data transmission types that conform to certain transmission rules, an optimized preset data transmission mode is enabled. In this data transmission mode, the cloud server does not need to send a data request to the terminal. The terminal simulates the rule of sending data requests by the cloud, automatically generates a simulated data request, and obtains data from the USB device based on the simulated data request and provides it to the cloud server.

[0064] The terminal can determine the simulation rate of the simulated data request according to the rate at which the cloud server sends the data request or the data transmission frequency configured by the USB data transmission type, and generate the simulated data request according to the simulation rate. The simulation rate can be configured and adjusted according to actual needs.

[0065] Step S102: Send the data provided by the USB device according to the simulated data request to the cloud server.

[0066] In the above method, under the optimized preset data transmission mode, the terminal does not need to wait for the data request sent by the cloud server, and can provide the data of the USB device to the cloud server according to a certain rule. The cloud server does not need to send a data request to the terminal, but can obtain the data from the cache queue, thereby reducing the data transmission volume and data transmission delay, improving the speed and efficiency of data transmission, and improving the performance of USB redirection.

[0067] In some optional embodiments, the above method further includes the step of starting and / or shutting down a preset data transmission mode.

[0068] The terminal can start the preset data transmission mode based on the start instruction sent by the cloud server. An optional method is that the terminal sends the enumeration information of the USB device to the cloud server based on the control instruction for obtaining device information sent by the cloud server; the enumeration information includes the endpoint type in the USB device; receives the start instruction sent by the cloud server, and starts the preset data transmission mode according to the start instruction. The terminal detects that the USB device is unplugged or receives a stop instruction sent by the server, and turns off the preset data transmission mode. After turning off the preset data transmission mode, if the USB device still needs to transfer data, the terminal uses the conventional data transmission mode to transmit data with the cloud server.

[0069] After the USB device is inserted, a connection is established between the terminal and the cloud server, and the enumeration information of the USB device is synchronized to the cloud server through control instructions. This information may include USB device configuration information, endpoint type in the USB device, etc.

[0070] In some optional embodiments, the above method also includes: the terminal receives cache control information sent by the server, and adjusts the simulation rate of the simulated data request according to the data cache information included in the cache control information, the data cache information includes at least one of the data length in the cache queue and the resource occupancy ratio of the data cache queue.

[0071] When transmitting data in the preset data transmission mode, since the data transmitted to the cloud server is temporarily cached in the cache queue, in order to avoid overflow due to excessive data in the cache queue and at the same time ensure that there is a certain amount of cache data in the cache queue for USB application acquisition, the terminal can adjust the rate of generating simulated data requests according to the data cache situation of the cloud server to achieve congestion control. Congestion control can be achieved through control information transmitted between the terminal and the cloud server.

[0072] Embodiment 2

[0073] Embodiment 2 of the present invention provides a USB redirection implementation method, which is implemented in a cloud server. The process is as follows: Figure 2 As shown, the following steps are included:

[0074] Step S201: in a preset data transmission mode, after receiving data from a USB device sent by a terminal, the received data is added to a cache queue.

[0075] After the cloud server starts the preset data transmission mode, the data received from the USB device of the terminal will no longer be directly provided to the USB application, but will be cached in a cache queue, which can be a packet queue pre-established in the cloud server.

[0076] Step S202: after receiving a data acquisition request from a USB application, the requested data is acquired from a cache queue and provided to the USB application.

[0077] When a USB application needs to obtain data, the cloud server usually sends a data request to the terminal according to the request of the USB application. After the terminal returns the data of the USB device according to the data request, the cloud server provides the data to the USB application. In this application, in the preset data transmission mode, the cloud server does not need to send a data request to the terminal for the data acquisition request of the USB application, but directly obtains the corresponding data from the cache queue, which reduces the process of data interaction and the transmission of a large number of data requests, and can obtain the data required by the USB application more quickly.

[0078] In the above method, when the cloud server is in a preset data transmission mode, the data received by the USB device is sent by the terminal based on the simulated data request generated by itself, and the received data will be cached. When the USN application needs to obtain data, there is no need to send a data acquisition request to the terminal to obtain data as in the prior art, and the corresponding data can be directly obtained from the cache queue. Since the terminal sends the data in advance and the cloud server caches it for backup, the delay for the USB application to obtain data is greatly reduced, and the real-time performance is greatly improved.

[0079] In some optional embodiments, the above method further includes the step of starting and / or shutting down a preset data transmission mode.

[0080] The cloud server can send a control command for obtaining device information to the terminal to obtain the enumeration information of the USB device on the terminal; if the USB data transmission type is determined to be an interrupt transmission type or a transmission type that conforms to a preset transmission rule according to the endpoint type in the USB device included in the enumeration information, a start command for starting the preset data transmission mode is sent to the terminal, and the preset data transmission mode is started; the cloud server determines that the USB device is unplugged or sends a stop command to stop the preset data transmission mode to the terminal according to the needs of the USB application, and turns off the preset data transmission mode. After turning off the preset data transmission mode, if the USB application still needs to obtain data, the cloud server uses the conventional data transmission mode to transmit data with the terminal.

[0081] In some optional embodiments, the above method also includes: the cloud server sends cache control information to the terminal, the cache control information includes data cache information, and the data cache information includes at least one of the data length in the cache queue and the resource occupancy ratio of the data cache queue.

[0082] The methods of the above-mentioned embodiments 1 and 2 can be applied to cloud desktops or cloud application systems that need to implement USB redirection. Based on the same inventive concept, the embodiment of the present invention also provides a USB redirection implementation system, whose structure is as follows: Figure 3 As shown, it includes: a terminal 1 and a cloud server 2. The terminal 1 can implement the method described in the above embodiment 1, and the cloud server can implement the method described in the above embodiment 2.

[0083] The structure of the terminal 1 is as follows: Figure 4 As shown, it includes: a simulation request module 11, a first data packet processing module 12 and a USB redirection client 13;

[0084] The USB redirection client 13 is used to communicate with the cloud server to send and receive data;

[0085] The simulation request module 11 is used to generate a simulation data request according to a set rule based on the data request sent by the cloud server in a preset data transmission mode, and send it to the USB device;

[0086] The first data packet processing module 12 is used to send the data provided by the USB device according to the simulated data request to the cloud server.

[0087] Optionally, the terminal further includes at least one of the following modules:

[0088] The first control packet processing module 14 is used to send enumeration information of the USB device to the cloud server based on the control instruction for obtaining device information sent by the cloud server; the enumeration information includes the endpoint type in the USB device; receive the start instruction sent by the cloud server, start the preset data transmission mode according to the start instruction; and / or close the preset data transmission mode when detecting that the USB device is unplugged or receiving the stop instruction sent by the cloud server

[0089] The congestion control module 15 is used to receive cache control information sent by the cloud server; adjust the simulation rate of the simulated data request according to the data cache information included in the cache control information, and the data cache information includes at least one of the data length in the cache queue and the resource occupancy ratio of the data cache queue.

[0090] The structure of the cloud server 2 is as follows: Figure 5 As shown, it includes: a USB virtual controller 21, a second data packet processing module 22 and a USB redirection server 23;

[0091] The USB redirection server 23 is used to communicate with the terminal to send and receive data;

[0092] The USB virtual controller 21 is used to send the USB application data acquisition request to the second data packet processing module 22;

[0093] The second data packet processing module 22 is used to, in a preset data transmission mode, add the received data to a cache queue after receiving the data from the USB device sent by the terminal; and after receiving a data acquisition request from the USB application, obtain the requested data from the cache queue and provide it to the USB application.

[0094] Optionally, the cloud server 2 further includes: a second control packet processing module 24, configured to implement at least one of the following:

[0095] Sending a control instruction for acquiring device information to the terminal to acquire enumeration information of the USB device on the terminal; if the USB data transmission type is determined to be an interrupt transmission type or a transmission type in which the data transmission complies with a preset transmission rule according to the endpoint type in the USB device included in the enumeration information, sending a start instruction for starting a preset data transmission mode to the terminal, and starting the preset data transmission mode;

[0096] Determine that the USB device is unplugged or send a stop instruction to the terminal to stop the preset data transmission mode according to the requirements of the USB application, and turn off the preset data transmission mode;

[0097] Cache control information is sent to the terminal, wherein the cache control information includes data cache information, and the data cache information includes at least one of the length of data in the cache queue and the resource occupancy ratio of the data cache queue.

[0098] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the USB redirection implementation method described in Embodiment 1 or the USB redirection implementation method described in Embodiment 2 is implemented. The electronic device can be a cloud server or a terminal.

[0099] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, in which computer executable instructions are stored. When the computer executable instructions are executed by a processor, the USB redirection implementation method described in Embodiment 1 or the USB redirection implementation method described in Embodiment 2 can be implemented.

[0100] like Figure 3 The following is an example of a system framework for implementing USB redirection in an embodiment of the present invention.

[0101] A USB device can be inserted into the terminal. After the USB device is inserted, the USB driver will run on the terminal. The terminal is provided with a USB redirection client for communicating with the cloud server, and is also provided with a first data packet processing module, a first control packet processing module, a simulation request module and a congestion control module.

[0102] The first control packet processing module is used to process various control instructions sent by the cloud server and return corresponding control data, including but not limited to the control instructions for obtaining device information and cache control information mentioned in the above embodiment.

[0103] The first data packet processing module is used to process the data packet request sent by the cloud server, including but not limited to the data request mentioned in the above embodiment.

[0104] The congestion control module is used to control the rate of data requests according to the network congestion situation. The network congestion situation mainly considers the data consumption in the cloud server, which can be reflected by the data length of the cache queue, the resource occupancy ratio, etc.

[0105] The simulation request module is used to simulate a data request to request data from the USB device according to the device interface information, and send the request to the cloud server. The device interface information may include a previously received data request.

[0106] The USB redirection client is used to realize data transmission and reception between the terminal and the cloud server, including receiving and sending USB redirection data packets between the cloud server and the terminal, including but not limited to USB device data, various control instructions and control data packets, and passing the data packets to the corresponding processing module for processing.

[0107] USB applications can be installed in the cloud server, and the USB applications also have corresponding USB drivers. The cloud server is provided with a USB redirection client for communicating with the terminal, a second data packet processing module, a second control packet processing module, a USB virtual controller (VHCI) and a cache queue.

[0108] The second control packet processing module is used to send control instructions to the terminal and process control data returned by the terminal, and determine whether to start packet data optimization based on the control data, that is, to start the preset data transmission mode.

[0109] The second data packet processing module is responsible for receiving and parsing the data instructions of the VHCI to decide whether to directly obtain the data requested by the USB application from the cache queue and provide it to the USB application, or to send a data request to the terminal to obtain the requested data, and receive the data returned by the terminal and provide it to the USB application.

[0110] The USB virtual controller (VHCI) is used to generate a USB virtual device for users using the USB device data sent by the terminal, and run USB applications on the cloud server.

[0111] The USB redirection server is used to realize data transmission and reception between the cloud server and the terminal.

[0112] based on Figure 6 The system framework shown in FIG. 1 implements a specific implementation process of USB redirection, such as Figure 7 As shown, the following steps are included:

[0113] Step S301: The cloud server sends a control instruction to the terminal to obtain device information.

[0114] After the cloud server learns that a USB device is inserted into the terminal, the VHCI therein generates a control instruction for obtaining device information, which is processed by the second control packet processing module and then sent to the terminal through the USB redirection server to complete device enumeration.

[0115] Step S302: After receiving the control instruction, the terminal returns control data including USB device enumeration information to the cloud server.

[0116] After receiving the control instruction, the USB redirection client in the terminal transfers it to the first control packet processing module for processing. The first control packet processing module obtains the enumeration information of the USB device to generate control data including the enumeration information, and sends it to the cloud server via the USB redirection client.

[0117] Step S303: The cloud server determines that data optimization can be performed according to the endpoint type of the USB device included in the USB device enumeration information.

[0118] After receiving the control data through the USB redirection server, the cloud server transfers it to the second control packet processing module for processing. It determines whether it meets the requirements of data optimization based on the endpoint type in the USB device included therein. For example, if the endpoint type is an in-type interrupt request endpoint, and the corresponding data transmission type is an interrupt transmission type, it is considered to meet the data optimization requirements, and the optimized data transmission mode can be started. In this application, the transmission type corresponding to the endpoint type complies with certain transmission rules, so that the terminal can simulate the actions of the cloud server according to the transmission rules, and actively provide data to the cloud server. It can be considered to meet the data optimization requirements. For example, the transmission type is an interrupt transmission type, and the cloud server requests data from the terminal once every set interval. The duration of the interval can be variable, as long as it has a certain regularity.

[0119] Step S304: the cloud server sends a start instruction to the terminal and starts a preset data transmission mode.

[0120] After the second control packet processing module in the cloud server determines to start the preset data transmission mode, it sends a start instruction through the USB redirection server.

[0121] Step S305: the terminal starts the preset data transmission mode according to the start instruction.

[0122] After receiving the start instruction, the USB redirection client in the terminal forwards it to the first control packet processing module. After parsing and processing, the first control packet processing module notifies the simulation request module to start the preset data transmission mode.

[0123] After the terminal and the cloud server start the preset data transmission mode, the data of the USB device will be transmitted according to the following steps. The subsequent data interaction communication between the terminal and the cloud server is also realized through the USB redirection client and the USB redirection server. The relevant description of the USB redirection client and the USB redirection server sending and receiving data will be omitted in the subsequent description.

[0124] Step S306: the terminal generates a simulation data request according to the set rules and sends it to the USB device.

[0125] The simulation request module in the terminal sets the rules for generating simulation data requests based on the data requests previously received from the cloud server and the rules for sending data requests, generates simulation data requests according to the set rules and sends them to the inserted USB device to request data from the USB device. For example, simulation data requests can be generated at a certain rate.

[0126] Step S307: The terminal sends the data provided by the USB device according to the simulated data request to the cloud server.

[0127] The USB device provides the data to the first data packet processing module, which processes the data and then sends it to the cloud server.

[0128] Step S308: After receiving the data from the USB device sent by the terminal, the cloud server adds the received data to the cache queue.

[0129] After receiving the data from the USB device, the second data packet processing module in the cloud server determines that the data is currently in the preset data transmission mode, and caches the received data in the cache queue for standby use.

[0130] Step S309: After receiving the data acquisition request from the USB application, the cloud server obtains the requested data from the cache queue and provides it to the USB application.

[0131] The VHCI in the cloud server generates a data acquisition request based on the request of the USB application and sends it to the second data packet processing module. The second data packet processing module determines that it is currently in the preset data transmission mode. In this case, there is no need to send a data request to the terminal and wait for the data to be returned. Instead, the corresponding data is obtained from the cache queue and provided to the USB application.

[0132] During the data transmission process of the above steps S306 to S309, the terminal may adjust the rate of generating simulated data requests in a timely manner according to the network congestion situation to adjust the data transmission rate.

[0133] After the preset data transmission mode is started, the cloud server and the terminal can turn off the preset data transmission mode at any time when there is a situation to stop the mode.

[0134] The specific manner in which the systems and modules in the devices in the above embodiments perform operations has been described in detail in the embodiments of the method and will not be elaborated on here.

[0135] The above method and system of the embodiment of the present invention is a USB port redirection performance optimization solution, specifically, it can be a USB interrupt transmission optimization solution based on the USB port redirection technology, which can provide better USB transmission performance while maintaining good compatibility, and can flexibly support congestion control, and can adapt to various network environments, making it possible to use interrupt transmission type USB devices in public network environments. It can be applied to various cloud desktop products based on USB redirection protocol plus virtual machine solution.

[0136] This solution is optimized on the basis of USB port redirection, so it retains the advantage of good compatibility of USB port redirection. At the same time, it deeply understands the USB protocol and targets the characteristics of interrupted transmission. By simulating data requests and performing congestion control on the terminal side, and performing data caching and data provision processing on the cloud side, it achieves the purpose of shortening the request link and smoothing jitter, greatly improving the user experience.

[0137] Unless otherwise specifically stated, terms such as processing, computing, calculating, determining, displaying, etc. may refer to the actions and / or processes of one or more processing or computing systems, or similar devices, which operate and convert data represented as physical (e.g., electronic) quantities within registers or memories of a processing system into other data similarly represented as physical quantities within memories, registers, or other such information storage, transmission, or display devices of the processing system. Information and signals may be represented using any of a variety of different techniques and methods. For example, data, instructions, commands, information, signals, bits, symbols, and chips mentioned throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, light fields or particles, or any combination thereof.

[0138] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.

[0139] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0140] Those skilled in the art will also appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly illustrate the interchangeability between hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on specific applications and the design constraints imposed on the entire system. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as departing from the scope of protection of the present disclosure.

[0141] The steps of the method or algorithm described in conjunction with the embodiments herein may be directly embodied as hardware, a software module executed by a processor, or a combination thereof. The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may be located in a user terminal. Of course, the processor and the storage medium may also be present in a user terminal as discrete components.

[0142] For software implementation, the techniques described in this application can be implemented with modules (e.g., procedures, functions, etc.) that perform the functions described in this application. These software codes can be stored in a memory unit and executed by a processor. The memory unit can be implemented within the processor or outside the processor. In the latter case, it is coupled to the processor in a communication manner via various means, which are well known in the art.

[0143] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".

Claims

1. A method for implementing USB redirection, characterized in that: include: In the preset data transmission mode, the simulation rate of the simulated data request is determined according to the rate at which the cloud server has historically sent data requests or the data transmission frequency configured by the USB data transmission type; the simulated data request is generated at the simulation rate and sent to the USB device; wherein, in the preset data transmission mode, the cloud server does not send a data request; Sending the data provided by the USB device according to the simulated data request to the cloud server and storing it in a cache queue for the USB application to obtain; The method further comprises: Receive cache control information sent by the cloud server; The simulation rate of the simulated data request is adjusted according to the data cache information included in the cache control information.

2. The method according to claim 1, characterized in that Also includes: The data cache information includes at least one of the length of data in the cache queue and the resource occupancy ratio of the data cache queue.

3. The method according to claim 1 or 2, characterized in that Also includes: Based on the control instruction for obtaining device information received from the cloud server, the enumeration information of the USB device is sent to the cloud server, wherein the enumeration information includes the endpoint type in the USB device; receiving a start instruction sent by the cloud server, and starting the preset data transmission mode according to the start instruction; and / or When it is detected that the USB device is unplugged or a stop command sent by the cloud server is received, the preset data transmission mode is closed.

4. A method for implementing USB redirection, characterized in that: include: In the preset data transmission mode, after receiving the data sent by the USB device to the terminal according to the simulated data request, the received data is added to the cache queue; wherein, in the preset data transmission mode, the cloud server does not send a data request; the simulated data request is that the terminal determines the simulated rate of the simulated data request according to the rate of the cloud server sending data requests in history or the data transmission frequency configured by the USB data transmission type; and generates the simulated data request according to the simulated rate; After receiving a data acquisition request from a USB application, the requested data is acquired from a cache queue and provided to the USB application; The method further comprises: Cache control information is sent to the terminal, wherein the cache control information includes data cache information, and the data cache information is used by the terminal to adjust a simulation rate of a simulation data request.

5. The method according to claim 4, characterized in that Also includes: Sending a control instruction for acquiring device information to a terminal to acquire enumeration information of a USB device on the terminal; if the USB data transmission type is determined to be an interrupt transmission type or a transmission type in which the data transmission complies with a preset transmission rule according to the endpoint type in the USB device included in the enumeration information, sending a start instruction for starting the preset data transmission mode to the terminal, and starting the preset data transmission mode; and / or Determine whether the USB device is unplugged or send a stop instruction to the terminal to stop the preset data transmission mode according to the requirements of the USB application, and close the preset data transmission mode.

6. The method according to claim 4 or 5, characterized in that Also includes: The data cache information includes at least one of the length of data in the cache queue and the resource occupancy ratio of the data cache queue.

7. A terminal, characterized in that: include: A simulation request module, a first data packet processing module and a USB redirection client; The USB redirection client is used to communicate with the cloud server to send and receive data; The simulation request module is used to determine the simulation rate of the simulation data request according to the historical rate of sending data requests by the cloud server or the data transmission frequency configured by the USB data transmission type in the preset data transmission mode; generate the simulation data request according to the simulation rate and send it to the USB device; wherein, in the preset data transmission mode, the cloud server does not send a data request; The first data packet processing module is used to send the data provided by the USB device according to the simulated data request to the cloud server; The congestion control module is used to receive cache control information sent by the cloud server; and adjust the simulation rate of the simulated data request according to the data cache information included in the cache control information.

8. The terminal according to claim 7, characterized in that Also includes at least one of the following modules: A first control packet processing module, configured to send enumeration information of the USB device to the cloud server based on a control instruction for obtaining device information sent by the cloud server, wherein the enumeration information includes an endpoint type in the USB device; Receive a start command sent by the cloud server, and start the preset data transmission mode according to the start command; and / or detect that the USB device is unplugged or receive a stop command sent by the cloud server, and close the preset data transmission mode The data cache information includes at least one of the length of data in the cache queue and the resource occupancy ratio of the data cache queue.

9. A cloud server, characterized in that: include: USB virtual controller, second data packet processing module and USB redirection server; The USB redirection server is used to communicate with the terminal to send and receive data; The USB virtual controller is used to send a data acquisition request of the USB application to the second data packet processing module; The second data packet processing module is used to add the received data to the cache queue after receiving the data sent by the USB device to the terminal according to the simulated data request in the preset data transmission mode; wherein, in the preset data transmission mode, the cloud server does not send a data request; the simulated data request is that the terminal determines the simulated rate of the simulated data request according to the rate of the historical data request sent by the cloud server or the data transmission frequency configured by the USB data transmission type; and generates the simulated data request according to the simulated rate; after receiving the data acquisition request of the USB application, obtain the requested data from the cache queue and provide it to the USB application; The second control packet processing module is used to send cache control information to the terminal, wherein the cache control information includes data cache information, and the data cache information is used by the terminal to adjust the simulation rate of the simulation data request.

10. The cloud server according to claim 9, wherein: The data cache information includes at least one of the data length in the cache queue and the resource occupancy ratio of the data cache queue. The second control packet processing module is further used to perform at least one of the following steps: Sending a control instruction for acquiring device information to a terminal to acquire enumeration information of a USB device on the terminal; if the USB data transmission type is determined to be an interrupt transmission type or a transmission type in which the data transmission complies with a preset transmission rule according to the endpoint type in the USB device included in the enumeration information, sending a start instruction for starting the preset data transmission mode to the terminal, and starting the preset data transmission mode; Determine whether the USB device is unplugged or send a stop instruction to the terminal to stop the preset data transmission mode according to the requirements of the USB application, and close the preset data transmission mode.

11. A USB redirection implementation system, characterized in that: include: The cloud server as described in any one of claims 9-10 and the terminal as described in any one of claims 7-8.

12. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the USB redirection implementation method described in any one of claims 1 to 3 or the USB redirection implementation method described in any one of claims 4 to 6 is implemented.

13. A computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, and when the computer executable instructions are executed by the processor, the USB redirection implementation method described in any one of claims 1-3 or the USB redirection implementation method described in any one of claims 4-6 can be implemented.

Citation Information

Patent Citations

  • USB redirection system and method

    CN104123244A

  • USB equipment network sharing system and method based on USB redirection

    CN105391652A

  • Data transmission method, data transmission device and data transmission system based on virtual machine

    CN106453766A

  • Cloud desktop terminal USB redirection system

    CN112231004A

  • Data scanning optimization method, device and system and related components

    CN112311943A