[go: up one dir, main page]

CN115190073B - USB redirection realization method, system and related equipment - Google Patents

USB redirection realization method, system and related equipment Download PDF

Info

Publication number
CN115190073B
CN115190073B CN202210554576.7A CN202210554576A CN115190073B CN 115190073 B CN115190073 B CN 115190073B CN 202210554576 A CN202210554576 A CN 202210554576A CN 115190073 B CN115190073 B CN 115190073B
Authority
CN
China
Prior art keywords
data
usb
cloud server
data transmission
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210554576.7A
Other languages
Chinese (zh)
Other versions
CN115190073A (en
Inventor
邱联魁
刘彬彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210554576.7A priority Critical patent/CN115190073B/en
Publication of CN115190073A publication Critical patent/CN115190073A/en
Application granted granted Critical
Publication of CN115190073B publication Critical patent/CN115190073B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/25Flow control; Congestion control with rate being modified by the source upon detecting a change of network conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/30Flow control; Congestion control in combination with information about buffer occupancy at either end or at transit nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/56Queue scheduling implementing delay-aware scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/08Protocols specially adapted for terminal emulation, e.g. Telnet

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a USB redirection realization method, a system and related equipment. The method comprises the following steps: the terminal generates an analog data request according to a set rule in a preset data transmission mode and sends the analog data request to the USB equipment; the simulated data request is generated by simulating a data request sent by a cloud server; and sending the data provided by the USB equipment according to the analog data request to a cloud server. The cloud server receives data of USB equipment sent by a terminal in a preset data transmission mode, and then adds the received data into a cache queue; after receiving the data acquisition request of the USB application, acquiring the requested data from the cache queue and providing the data to the USB application. The method can reduce the data interaction quantity of USB redirection, improve the speed and efficiency of data interaction, meet the transmission requirements of low delay and high real-time of data transmission, improve the system performance and greatly improve the user experience.

Description

USB redirection realization method, system and related equipment
Technical Field
The present invention relates to the field of data transmission technologies, and in particular, to a method, a system, and a related device for implementing USB redirection.
Background
USB redirection is a technology that transmits local USB data of a device to a remote system and implements a corresponding USB function in the remote system, and in a cloud application or cloud desktop scenario, it is often required to support a USB peripheral redirection function, such as supporting USB camera redirection. Currently, the USB peripheral redirection schemes mainly include two types of USB device redirection and USB port redirection. For the peripheral equipment with an interrupt transmission type endpoint, a USB device redirection scheme is adopted, a transmission channel is required to be provided at an application layer for data transmission, and the compatibility is poor; therefore, it is generally preferred to adopt a USB port redirection scheme, which directly transmits the underlying USB bare data, and has better compatibility.
The interrupt transmission type can periodically inquire the external interrupt transmission type end points so as to send or receive data, and the network delay and the network jitter are larger because the data volume of the polling request is larger, so that the transmission requirements of low delay and high real-time performance of data transmission can not be met, and the use experience is poorer.
Disclosure of Invention
The present invention has been made in view of the above-mentioned problems, and it is therefore an object of the present invention to provide a USB redirection implementation method, system and related devices that overcomes or at least partially solves the above-mentioned problems.
The embodiment of the invention provides a USB redirection realization method, which comprises the following steps:
under a preset data transmission mode, generating an analog data request according to a set rule, and sending the analog data request to USB equipment; the simulated data request is generated by simulating a data request sent by a cloud server;
and sending the data provided by the USB equipment according to the analog data request to a cloud server.
In some alternative embodiments, the generating the simulated data request according to the set rule includes:
Determining the simulation rate of the simulation data request according to the rate of sending the data request by the cloud server or the data transmission frequency configured by the USB data transmission type;
and generating an analog data request according to the analog rate.
In some alternative embodiments, the above method further comprises:
receiving cache control information sent by a cloud server;
And adjusting the simulation rate of the simulation data request according to the data cache information included in the cache control information, wherein the data cache information comprises at least one of the data length in a cache queue and the resource occupation proportion of the data cache queue.
In some alternative embodiments, the above method further comprises:
Based on a received control instruction for acquiring equipment information sent by a cloud server, enumeration information of USB equipment is sent to the cloud server, wherein the enumeration information comprises endpoint types in the USB equipment; receiving a starting instruction sent by a cloud server, and starting the preset data transmission mode according to the starting instruction; and/or
And detecting that the USB equipment is pulled out or a stopping instruction sent by the cloud server is received, and closing the preset data transmission mode.
The embodiment of the invention also provides another USB redirection realization method, which comprises the following steps:
under a preset data transmission mode, after receiving data of USB equipment sent by a terminal, adding the received data into a cache queue;
After receiving the data acquisition request of the USB application, acquiring the requested data from the cache queue and providing the data to the USB application.
In some alternative embodiments, the above method further comprises:
Sending a control instruction for acquiring equipment information to a terminal so as to acquire enumeration information of USB equipment on the terminal; if the USB data transmission type is determined to be the interrupt transmission type or the transmission type of the data transmission conforming to the preset transmission rule according to the endpoint type in the USB equipment included in the enumeration information, sending a starting instruction for starting the preset data transmission mode to a terminal, and starting the preset data transmission mode; and/or
And determining that the USB equipment is pulled out or sending a stop instruction for stopping the preset data transmission mode to the terminal according to the requirement of the USB application, and closing the preset data transmission mode.
In some alternative embodiments, the above method further comprises:
and sending cache control information to the terminal, wherein the cache control information comprises data cache information, and the data cache information comprises at least one of the length of data in a cache queue and the resource occupation proportion of the data cache queue.
An embodiment of the present invention provides a terminal, including: the system comprises an analog request module, a first data packet processing module and a USB redirection client;
the USB redirection client is used for communicating with the cloud server to receive and send data;
The simulation request module is used for generating a simulation data request according to a set rule based on a data request sent by the cloud server in a preset data transmission mode and sending the simulation data request to the USB equipment;
The first data packet processing module is used for sending the data provided by the USB equipment according to the simulated data request to the cloud server.
In some optional embodiments, the terminal further includes at least one of the following modules:
The first control packet processing module is used for sending enumeration information of the USB equipment to the cloud server based on a received control instruction for acquiring equipment information sent by the cloud server, wherein the enumeration information comprises endpoint types in the USB equipment; receiving a starting instruction sent by a cloud server, and starting the preset data transmission mode according to the starting instruction; and/or detecting that the USB equipment is pulled out or a stopping instruction sent by the cloud server is received, and closing the preset data transmission mode
The congestion control module is used for receiving cache control information sent by the cloud server; and adjusting the simulation rate of the simulation data request according to the data cache information included in the cache control information, wherein the data cache information comprises at least one of the data length in the cache queue and the resource occupation proportion of the data cache queue.
The embodiment of the invention provides a cloud server, which comprises: the system comprises a USB virtual controller, a second data packet processing module and a USB redirection server;
The USB redirection server is used for communicating with the terminal to receive and send data;
The USB virtual controller is used for sending a data acquisition request of the USB application to the second data packet processing module;
The second data packet processing module is configured to, in a preset data transmission mode, add the received data to a buffer queue after receiving data of the USB device sent by the terminal; and after receiving the data acquisition request of the USB application, acquiring the requested data from the cache queue and providing the data to the USB application.
In some optional embodiments, the cloud server further includes: the second control packet processing module is used for executing at least one of the following steps:
Sending a control instruction for acquiring equipment information to a terminal so as to acquire enumeration information of USB equipment on the terminal; if the USB data transmission type is determined to be the interrupt transmission type or the transmission type of the data transmission conforming to the preset transmission rule according to the endpoint type in the USB equipment included in the enumeration information, sending a starting instruction for starting the preset data transmission mode to a terminal, and starting the preset data transmission mode;
Determining that the USB equipment is pulled out or according to the requirement of USB application, sending a stop instruction for stopping the preset data transmission mode to a terminal, and closing the preset data transmission mode;
and sending cache control information to the terminal, wherein the cache control information comprises data cache information, and the data cache information comprises at least one of the length of data in a cache queue and the resource occupation proportion of the data cache queue.
The embodiment of the invention provides a USB redirection realizing system, which comprises: the cloud server and the terminal.
An embodiment of the present invention provides an electronic device, including: the system comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes one USB redirection realizing method or the other USB redirection realizing method when executing the program.
The embodiment of the invention provides a computer storage medium, wherein computer executable instructions are stored in the computer storage medium, and when the computer executable instructions are executed by a processor, one USB redirection implementation method or the other USB redirection implementation method is realized.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
According to the USB redirection realizing method provided by the embodiment of the invention, under the preset data transmission mode, the terminal can simulate the data request sent by the cloud server to generate the simulated data request, acquire data from the USB device based on the simulated data request and send the data to the cloud server for caching for standby, the data request sent by the cloud server does not need to be waited and received, the data quantity of the polling request can be reduced, the data interaction quantity is reduced, the network delay of USB redirection data interaction is reduced, the data interaction speed of USB redirection is improved, and the method can meet the transmission requirements of low time delay and high real-time performance of data transmission and greatly improve user experience.
According to the USB redirection realizing method provided by the embodiment of the invention, in the preset data transmission mode, the cloud server receives the data of the USB equipment sent by the terminal based on the self-generated analog data request and then caches the data in the cache queue, when the local USB application needs to acquire the data, the data request is not required to be sent to the terminal and is directly acquired from the cache queue, the data interaction quantity with the terminal can be reduced, the waiting time for data acquisition is reduced, the network delay of the USB redirection data interaction is reduced, the data interaction speed of USB redirection is improved, the transmission requirements of low time delay and high instantaneity of data transmission can be met, and the user experience is greatly improved.
In the method, when the data transmission of the USB equipment meets a certain requirement, an optimized preset data transmission mode is started, the data transmission is carried out by using the transmission mode in the subsequent transmission, the transmission mode can be stopped at any time according to the requirement, and the existing transmission mode is switched back.
The method can also adjust the rate of generating the simulated data request according to the caching condition of the caching queue so as to adjust the data sending rate, avoid the overflow of the data in the caching queue and prevent the occurrence of network congestion; meanwhile, a certain data buffer quantity in the buffer queue can be ensured to be used by USB application.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention. In the drawings:
FIG. 1 is a flowchart of a method for implementing USB redirection in accordance with a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for implementing USB redirection in a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a cloud end server according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a USB redirection implementation system in an embodiment of the present invention;
FIG. 6 is an exemplary diagram of a USB redirection implementation system architecture in accordance with an embodiment of the present invention;
FIG. 7 is a flowchart of a specific implementation of a method for implementing USB redirection in an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Under the cloud desktop or cloud application scene, after the terminal is locally inserted into the USB device, if the terminal is to be used in a remote cloud desktop or cloud application, the cloud desktop or cloud application to be redirected to the cloud end is required, and at present, a USB port redirection scheme is usually adopted in a tendency, and USB original data packets are transmitted between the terminal or cloud server by the scheme, so that the transmitted data packets are smaller and more in number, and therefore, the performance problems such as network delay and network jitter exist. In order to solve the problems in the prior art, the embodiment of the invention provides a method for realizing USB redirection, which is characterized in that when USB data transmission has the transmission requirement of optimized transmission, an optimized data transmission mode is started, in the optimized data transmission mode, a terminal simulates a data request of a cloud server, data of USB equipment is provided for the cloud server to be cached based on the simulated data request, when USB application in the cloud server needs to acquire the data, the data request is not sent to the terminal, and the requested data is acquired from the cached data, so that the data transmission amount between the cloud server and the terminal is reduced, the speed and the efficiency of acquiring the data by the USB application in the cloud server are improved, the time delay is reduced, and the performance of USB redirection is improved.
Example 1
The first embodiment of the invention provides a method for implementing redirection of USB, which is implemented in a terminal, and the flow is shown in figure 1, and comprises the following steps:
Step S101: and under a preset data transmission mode, generating an analog data request according to a set rule, and sending the analog data request to the USB equipment. Wherein the simulated data request is generated by simulating the data request sent by the cloud server
When the terminal and the cloud server are in a conventional data transmission mode, the cloud server generally sends a data request to the terminal according to a request of the USB application when the USB application in the cloud server needs to acquire data from the USB device of the terminal, the terminal acquires the data from the inserted USB device according to the data request and then provides the data to the cloud server, and the data delay is longer and the instantaneity is poorer.
The terminal can determine the simulation rate of the simulation data request according to the rate of sending the data request by the cloud server or the data transmission frequency configured by the USB data transmission type, and generate the simulation data request according to the simulation rate. The analog rate can be configured and adjusted according to actual needs.
Step S102: and sending the data provided by the USB equipment according to the analog data request to the cloud server.
According to the method, under the optimized preset data transmission mode, the terminal can provide the data of the USB equipment to the cloud server according to a certain rule without waiting for the data request sent by the cloud server, and the cloud server can acquire the data from the cache queue without sending the data request to the terminal, so that the data transmission amount and the data transmission time delay are reduced, the data transmission speed and efficiency are improved, and the USB redirection performance is improved.
In some alternative embodiments, the method further comprises the step of enabling and/or disabling the predetermined data transmission mode.
The terminal can start a preset data transmission mode based on a starting instruction sent by the cloud server, and the terminal can send enumeration information of the USB device to the cloud server based on a received control instruction for acquiring device information sent by the cloud server, wherein the enumeration information comprises endpoint types in the USB device; and receiving a starting instruction sent by the cloud server, and starting a preset data transmission mode according to the starting instruction. The terminal detects that the USB equipment is pulled out or receives a stop instruction sent by the server, and closes a preset data transmission mode. After the preset data transmission mode is closed, if the USB equipment still needs to transmit data, the terminal uses the conventional data transmission mode to transmit data with the cloud server.
After the USB device is inserted, connection is established between the terminal and the cloud server, enumeration information of the USB device is synchronized to the cloud server through a control instruction, and the information can include configuration information of the USB device, endpoint types in the USB device and the like.
In some alternative embodiments, the above method further comprises: the terminal receives the cache control information sent by the server, adjusts the simulation rate of the simulation data request according to the data cache information included in the cache control information, and the data cache information comprises at least one of the data length in the cache queue and the resource occupation proportion of the data cache queue.
When data is transmitted in a preset data transmission mode, the data transmitted to the cloud server is temporarily cached in the cache queue, so that the cache queue is prevented from overflowing due to excessive data, a certain amount of cache data is guaranteed to be available for USB application acquisition, the terminal can adjust the rate of generating the simulated data request according to the data caching condition of the cloud server, congestion control is achieved, and the congestion control can be achieved through control information transmitted between the terminal and the cloud server.
Example two
The second embodiment of the present invention provides a method for implementing USB redirection, which is implemented in a cloud server, and the flow is shown in fig. 2, and includes the following steps:
step S201: and under a preset data transmission mode, after receiving the data of the USB equipment transmitted by the terminal, adding the received data into a cache queue.
After the cloud server starts a preset data transmission mode, the received data from the USB device of the terminal is not directly provided to the USB application any more, but is cached in a cache queue, wherein the cache queue can be a packet queue pre-established in the cloud server.
Step S202: after receiving the data acquisition request of the USB application, acquiring the requested data from the cache queue and providing the data to the USB application.
When the USB application needs to acquire data, conventionally, a cloud server sends a data request to a terminal according to a request of the USB application, and the cloud server provides the data to the USB application after the terminal returns the data of the USB device according to the data request. According to the application, the cloud server can directly acquire corresponding data from the buffer queue without sending the data request to the terminal for the data acquisition request of the USB application under the preset data transmission mode, so that the data interaction round-trip process is reduced, the transmission of a large number of data requests is reduced, and the data required by the USB application can be acquired more quickly.
In the method, when the cloud server is in the preset data transmission mode, the received data of the USB device are sent by the terminal based on the self-generated analog data request, the received data are cached, when the USN application needs to acquire the data, the data acquisition request is not required to be sent to the terminal to acquire the data as in the prior art, and the corresponding data are directly acquired from the cache queue.
In some alternative embodiments, the method further comprises the step of enabling and/or disabling the predetermined data transmission mode.
The cloud server can send a control instruction for acquiring equipment information to the terminal so as to acquire enumeration information of USB equipment on the terminal; if the USB data transmission type is determined to be the interrupt transmission type or the transmission type of the data transmission conforming to the preset transmission rule according to the endpoint type in the USB equipment included in the enumeration information, sending a starting instruction for starting the preset data transmission mode to the terminal, and starting the preset data transmission mode; the cloud server determines that the USB equipment is pulled out or sends a stopping instruction for stopping the preset data transmission mode to the terminal according to the requirement of the USB application, and closes the preset data transmission mode. After the preset data transmission mode is closed, if the USB application still needs to acquire data, the cloud server uses the conventional data transmission mode to perform data transmission with the terminal.
In some alternative embodiments, the above method further comprises: the cloud server sends cache control information to the terminal, wherein the cache control information comprises data cache information, and the data cache information comprises at least one of the data length in a cache queue and the resource occupation proportion of the data cache queue.
The method of the first embodiment and the second embodiment can be applied to a cloud desktop or a cloud application system which needs to implement USB redirection. Based on the same inventive concept, the embodiment of the invention also provides a system for implementing USB redirection, the structure of which is shown in fig. 3, comprising: a terminal 1 and a cloud server 2. The terminal 1 may implement the method described in the first embodiment, and the cloud server may implement the method described in the second embodiment.
The structure of the terminal 1 is shown in fig. 4, and includes: the device comprises an analog request module 11, a first data packet processing module 12 and a USB redirection client 13;
a USB redirect client 13, configured to communicate with a cloud server to send and receive data;
the simulation request module 11 is configured to generate a simulation data request according to a set rule based on a data request sent by the cloud server in a preset data transmission mode, and send the simulation data request to the USB device;
The first data packet processing module 12 is configured to send data provided by the USB device according to the analog data request to the cloud server.
Optionally, the terminal further includes at least one of the following modules:
The first control packet processing module 14 is configured to send enumeration information of the USB device to the cloud server based on a received control instruction sent by the cloud server to obtain device information, where the enumeration information includes an endpoint type in the USB device; receiving a starting instruction sent by a cloud server, and starting a preset data transmission mode according to the starting instruction; and/or detecting that the USB equipment is pulled out or a stopping instruction sent by the cloud server is received, and closing a preset data transmission mode
The congestion control module 15 is configured to receive cache control information sent by the cloud server; and adjusting the simulation rate of the simulation data request according to the data cache information included in the cache control information, wherein the data cache information comprises at least one of the data length in the cache queue and the resource occupation proportion of the data cache queue.
As shown in fig. 5, the cloud server 2 includes: a USB virtual controller 21, a second packet processing module 22, and a USB redirect server 23;
A USB redirect server 23 for communicating with the terminal to receive and transmit data;
A USB virtual controller 21, configured to send a data acquisition request of a USB application to the second packet processing module 22;
The second data packet processing module 22 is configured to, in a preset data transmission mode, add the received data to the buffer queue after receiving the data of the USB device sent by the terminal; and after receiving the data acquisition request of the USB application, acquiring the requested data from the cache queue and providing the data to the USB application.
Optionally, the cloud server 2 further includes: a second control packet processing module 24 for implementing at least one of:
Sending a control instruction for acquiring equipment information to a terminal so as to acquire enumeration information of USB equipment on the terminal; if the USB data transmission type is determined to be the interrupt transmission type or the transmission type of the data transmission conforming to the preset transmission rule according to the endpoint type in the USB equipment included in the enumeration information, sending a starting instruction for starting the preset data transmission mode to the terminal, and starting the preset data transmission mode;
Determining that the USB equipment is pulled out or according to the requirement of USB application, sending a stop instruction for stopping a preset data transmission mode to the terminal, and closing the preset data transmission mode;
and sending cache control information to the terminal, wherein the cache control information comprises data cache information, and the data cache information comprises at least one of the length of data in a cache queue and the resource occupation proportion of the data cache queue.
Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, including: the system comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the USB redirection realization method in the first embodiment or the USB redirection realization method in the second embodiment when executing the program. The electronic device may enable a cloud server or terminal.
Based on the same inventive concept, the embodiment of the present invention further provides a computer storage medium, where computer executable instructions are stored, where the computer executable instructions implement the USB redirection implementation method described in the first embodiment or implement the USB redirection implementation method described in the second embodiment when executed by a processor.
An example of a system framework for implementing USB redirection in an embodiment of the invention is shown in FIG. 3. Wherein:
The terminal can be inserted with USB equipment, after the USB equipment is inserted, USB drive can be operated on the terminal, a USB redirection client which is communicated with the cloud server is arranged on the terminal, and the terminal is further provided with a first data packet processing module, a first control packet processing module, a simulation request module and a congestion control module.
The first control packet processing module is used for processing various control instructions issued by the cloud server and returning corresponding control data. Including but not limited to the control instructions for obtaining device information, cache control information, etc. mentioned in the above embodiments.
The first data packet processing module is configured to process a data packet request issued by the cloud server, including, but not limited to, the data request mentioned in the above embodiment.
The congestion control module is used for controlling the rate of the data request according to the network congestion condition, and the network congestion condition mainly considers the consumption condition of the data in the cloud server and can be embodied by the data length, the resource occupation proportion and the like of the cache queue.
The simulation request module is used for simulating a data request to request data from the USB device according to the device interface (interface) information and sending the data to the cloud server. The device interface information may include a previously received data request.
The USB redirection client is used for realizing data receiving and transmitting between the terminal and the cloud server, and comprises receiving USB redirection data packets between the cloud server and the terminal, including but not limited to data of USB equipment, various control instructions and data packets of control data, and transmitting the data packets to corresponding processing modules for processing.
The cloud server is provided with a USB redirection client which is communicated with the terminal, a second data packet processing module, a second control packet processing module, a USB virtual controller (VHCI) and a cache queue.
The second control packet processing module is used for issuing a control instruction to the terminal, processing control data returned by the terminal, and judging whether to start packet data optimization or not based on the control data, namely starting a preset data transmission mode.
And a second data packet processing module: and the data receiving terminal is responsible for receiving and analyzing the data instruction of the VHCI to decide whether to directly obtain the data requested by the USB application from the buffer queue and provide the data for the USB application or send a data request to the terminal to obtain the requested data, and receives the data returned by the terminal and provides the data for the USB application.
The USB virtual controller (VHCI) is used for generating USB virtual equipment for a user to use by utilizing data of the USB equipment sent by the terminal, and running USB application on the cloud server.
The USB redirection server is used for realizing data receiving and transmitting between the cloud server and the terminal.
One specific implementation procedure for implementing USB redirection based on the system framework shown in fig. 6, as shown in fig. 7, includes the following steps:
step S301: the cloud server sends a control instruction for acquiring equipment information to the terminal.
After the cloud server knows that the terminal is inserted with the USB device, the VHCI generates a control instruction for acquiring the device information, and the control instruction is processed by the second control packet processing module and then sent to the terminal through the USB redirection server so as to complete device enumeration.
Step S302: and after receiving the control instruction, the terminal returns control data comprising USB equipment enumeration information to the cloud server.
After receiving the control instruction, the USB redirection client in the terminal transfers the control instruction to the first control packet processing module for processing, and the first control packet processing module acquires enumeration information of the USB equipment to generate control data comprising the enumeration information, and sends the control data to the cloud server through the USB redirection client.
Step S303: the cloud server determines that data optimization can be performed according to the endpoint types in the USB device included in the USB device enumeration information.
The cloud server receives the control data through the USB redirection service end and then transfers the control data to the second control packet processing module for processing, whether the control data meets the data optimization requirement is determined according to the endpoint type in the USB equipment, for example, if the endpoint type is an in-type interrupt request endpoint, the data transmission type is an interrupt transmission type, the data transmission type is considered to be met, and then the optimized data transmission mode can be started. In the application, the transmission type corresponding to the endpoint type accords with a certain transmission rule, so that the terminal can simulate the action of the cloud server according to the transmission rule, and the data can be actively provided for the cloud server to meet the data optimization requirement. For example, the transmission type is an interrupt transmission type, and the cloud server requests the terminal for data once every set time interval. The duration of the interval may not be fixed as long as there is a certain regularity.
Step S304: the cloud server sends a starting instruction to the terminal and starts a preset data transmission mode.
And after the second control packet processing module in the cloud server determines to start the preset data transmission mode, sending a starting instruction through the USB redirection server.
Step S305: and the terminal starts a preset data transmission mode according to the starting instruction.
After receiving the starting instruction, the USB redirection client in the terminal is transferred to the first control packet processing module, and after the first control packet processing module analyzes and processes, the simulation request module is informed to start a preset data transmission mode.
After the terminal and the cloud server start a preset data transmission mode, data of the USB equipment are transmitted according to the following steps. The data interaction communication between the subsequent terminal and the cloud server is also to realize the receiving and transmitting through the USB redirection client and the USB redirection server, and the related description of the receiving and transmitting data of the USB redirection client and the USB redirection server is omitted in the subsequent description.
Step S306: and the terminal generates an analog data request according to the set rule and sends the analog data request to the USB equipment.
The simulation request module in the terminal sets a rule for generating a simulation data request based on a data request sent by a cloud server and a rule for sending the data request, generates the simulation data request according to the set rule, sends the simulation data request to the inserted USB device, and requests data from the USB device. For example, analog data requests may be generated at a rate.
Step S307: and the terminal sends the data provided by the USB equipment according to the analog data request to the cloud server.
The USB equipment provides data for the first data packet processing module, and the data is sent to the cloud server after being processed by the first data packet processing module.
Step S308: and after receiving the data of the USB equipment sent by the terminal, the cloud server adds the received data into a cache queue.
After receiving the data of the USB device, a second data packet processing module in the cloud server determines that the USB device is currently in a preset data transmission mode, and caches the received data in a cache queue for standby.
Step S309: and after receiving the data acquisition request of the USB application, the cloud server acquires the requested data from the cache queue and provides the data to the USB application.
The VHCI in the cloud server generates a data acquisition request according to the request of the USB application and sends the data acquisition request to the second data packet processing module, and the second data packet processing module determines that the data acquisition request is currently in a preset data transmission mode, and does not need to send the data request to the terminal and wait for data return, but acquires corresponding data from the cache queue and provides the corresponding data to the USB application.
In the data transmission process from step S306 to step S309, the terminal may adjust the rate of generating the analog data request in time according to the network congestion condition, so as to adjust the rate of data transmission.
After the preset data transmission mode is started, the cloud server and the terminal can close the preset data transmission mode at any time when the mode is stopped.
The specific manner in which the operations are performed by the systems and the respective modules in the respective devices in the above embodiments have been described in detail in the embodiments related to the method, and will not be described in detail.
The method and the system of the embodiment of the invention are a USB port redirection performance optimization scheme, in particular to a USB interrupt transmission optimization scheme based on the improvement of a USB port redirection technology, which can provide good USB transmission performance under the condition of keeping good compatibility, can flexibly support congestion control, can adapt to various network environments, and can enable the use of interrupt transmission type USB equipment to be possible under a public network environment. The method can be applied to various cloud desktop products based on USB redirection protocol plus virtual machine scheme.
The scheme optimizes on the basis of the redirection of the USB port, so that the advantage of good compatibility of the redirection of the USB port is reserved. Meanwhile, the USB protocol is penetrated in, aiming at the characteristics of interrupt transmission, the cloud side simulates a data request and performs congestion control, and the data caching and the data providing processing are performed by the cloud side, so that the purposes of shortening a request link and smoothing jitter are achieved, and the user experience is greatly improved.
Unless specifically stated otherwise, terms such as processing, computing, calculating, determining, displaying, or the like, may refer to an action and/or process of one or more processing or computing systems, or similar devices, that manipulates and transforms data represented as physical (e.g., electronic) quantities within the processing system's registers or memories into other data similarly represented as physical quantities within the processing system's memories, registers or other such information storage, transmission or display devices. Information and signals may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
It should be understood that the specific order or hierarchy of steps in the processes disclosed are examples of exemplary approaches. Based on design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.
In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, invention lies in less than all features of a single disclosed embodiment. Thus the following claims are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate preferred embodiment of this invention.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. The processor and the storage medium may reside as discrete components in a user terminal.
For a software implementation, the techniques described in this disclosure may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. These software codes may be stored in memory units and executed by processors. The memory unit may be implemented within the processor or external to the processor, in which case it can be communicatively coupled to the processor via various means as is known in the art.
The foregoing description includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, as used in the specification or claims, the term "comprising" is intended to be inclusive in a manner similar to the term "comprising," as interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean "non-exclusive or".

Claims (13)

1. A method for implementing USB redirection, comprising:
Under a preset data transmission mode, determining the simulation rate of the simulation data request according to the data transmission rate of the cloud server history data request transmission or the data transmission frequency configured by the USB data transmission type; generating an analog data request according to the analog rate, and sending the analog data request to USB equipment; in a preset data transmission mode, the cloud server does not send a data request;
transmitting the data provided by the USB equipment according to the analog data request to a cloud server and storing the data into a cache queue for obtaining by a USB application;
the method further comprises the steps of:
receiving cache control information sent by a cloud server;
And adjusting the simulation rate of the simulation data request according to the data cache information included in the cache control information.
2. The method as recited in claim 1, further comprising:
the data caching information comprises at least one of the length of data in a caching queue and the resource occupation proportion of the data caching queue.
3. The method of claim 1 or 2, further comprising:
Based on a received control instruction for acquiring equipment information sent by a cloud server, enumeration information of USB equipment is sent to the cloud server, wherein the enumeration information comprises endpoint types in the USB equipment; receiving a starting instruction sent by a cloud server, and starting the preset data transmission mode according to the starting instruction; and/or
And detecting that the USB equipment is pulled out or a stopping instruction sent by the cloud server is received, and closing the preset data transmission mode.
4. A method for implementing USB redirection, comprising:
Under a preset data transmission mode, after receiving data sent by the USB equipment to the terminal according to the analog data request, adding the received data into a cache queue; the cloud server does not send a data request in a preset data transmission mode; the simulation data request is that the terminal determines the simulation rate of the simulation data request according to the data transmission rate of the cloud server history data request transmission or the data transmission frequency configured by the USB data transmission type; and generating a simulation data request according to the simulation rate;
after receiving a data acquisition request of the USB application, acquiring the requested data from the cache queue and providing the data to the USB application;
the method further comprises the steps of:
And sending cache control information to the terminal, wherein the cache control information comprises data cache information, and the data cache information is used for adjusting the simulation rate of the simulation data request by the terminal.
5. The method as recited in claim 4, further comprising:
Sending a control instruction for acquiring equipment information to a terminal so as to acquire enumeration information of USB equipment on the terminal; if the USB data transmission type is determined to be the interrupt transmission type or the transmission type of the data transmission conforming to the preset transmission rule according to the endpoint type in the USB equipment included in the enumeration information, sending a starting instruction for starting the preset data transmission mode to a terminal, and starting the preset data transmission mode; and/or
And determining that the USB equipment is pulled out or sending a stop instruction for stopping the preset data transmission mode to the terminal according to the requirement of the USB application, and closing the preset data transmission mode.
6. The method of claim 4 or 5, further comprising:
the data caching information comprises at least one of the length of data in a caching queue and the resource occupation proportion of the data caching queue.
7. A terminal, comprising: the system comprises an analog request module, a first data packet processing module and a USB redirection client;
the USB redirection client is used for communicating with the cloud server to receive and send data;
The simulation request module is used for determining the simulation rate of the simulation data request according to the data transmission frequency configured by the data transmission type or the data transmission rate of the USB data transmission type of the cloud server in a preset data transmission mode; generating an analog data request according to the analog rate, and sending the analog data request to USB equipment; in a preset data transmission mode, the cloud server does not send a data request;
The first data packet processing module is used for sending the data provided by the USB equipment according to the simulated data request to the cloud server;
the congestion control module is used for receiving cache control information sent by the cloud server; and adjusting the simulation rate of the simulation data request according to the data cache information included in the cache control information.
8. The terminal of claim 7, further comprising at least one of the following modules:
The first control packet processing module is used for sending enumeration information of the USB equipment to the cloud server based on a received control instruction for acquiring equipment information sent by the cloud server, wherein the enumeration information comprises endpoint types in the USB equipment; receiving a starting instruction sent by a cloud server, and starting the preset data transmission mode according to the starting instruction; and/or detecting that the USB equipment is pulled out or a stopping instruction sent by the cloud server is received, and closing the preset data transmission mode
The data caching information comprises at least one of the length of data in a caching queue and the resource occupation proportion of the data caching queue.
9. A cloud server, comprising: the system comprises a USB virtual controller, a second data packet processing module and a USB redirection server;
The USB redirection server is used for communicating with the terminal to receive and send data;
The USB virtual controller is used for sending a data acquisition request of the USB application to the second data packet processing module;
The second data packet processing module is used for adding the received data into a cache queue after receiving the data sent by the USB equipment to the terminal according to the simulated data request in a preset data transmission mode; the cloud server does not send a data request in a preset data transmission mode; the simulation data request is that the terminal determines the simulation rate of the simulation data request according to the data transmission rate of the cloud server history data request transmission or the data transmission frequency configured by the USB data transmission type; and generating a simulation data request according to the simulation rate; after receiving a data acquisition request of the USB application, acquiring the requested data from the cache queue and providing the data to the USB application;
The second control packet processing module is used for sending cache control information to the terminal, wherein the cache control information comprises data cache information, and the data cache information is used for adjusting the simulation rate of the simulation data request by the terminal.
10. The cloud server as claimed in claim 9, wherein said data buffering information includes at least one of a data length in a buffering queue and a resource occupation ratio of the data buffering queue, and further for executing at least one of the following steps:
Sending a control instruction for acquiring equipment information to a terminal so as to acquire enumeration information of USB equipment on the terminal; if the USB data transmission type is determined to be the interrupt transmission type or the transmission type of the data transmission conforming to the preset transmission rule according to the endpoint type in the USB equipment included in the enumeration information, sending a starting instruction for starting the preset data transmission mode to a terminal, and starting the preset data transmission mode;
and determining that the USB equipment is pulled out or sending a stop instruction for stopping the preset data transmission mode to the terminal according to the requirement of the USB application, and closing the preset data transmission mode.
11. A USB redirection implementing system, comprising: the cloud server according to any of claims 9-10 and the terminal according to any of claims 7-8.
12. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the USB redirection implementation method according to any one of claims 1-3 or the USB redirection implementation method according to any one of claims 4-6 when executing the program.
13. A computer storage medium having stored therein computer executable instructions which when executed by a processor implement the USB redirection implementation method of any of claims 1-3 or the USB redirection implementation method of any of claims 4-6.
CN202210554576.7A 2022-05-20 2022-05-20 USB redirection realization method, system and related equipment Active CN115190073B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210554576.7A CN115190073B (en) 2022-05-20 2022-05-20 USB redirection realization method, system and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210554576.7A CN115190073B (en) 2022-05-20 2022-05-20 USB redirection realization method, system and related equipment

Publications (2)

Publication Number Publication Date
CN115190073A CN115190073A (en) 2022-10-14
CN115190073B true CN115190073B (en) 2024-09-06

Family

ID=83513632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210554576.7A Active CN115190073B (en) 2022-05-20 2022-05-20 USB redirection realization method, system and related equipment

Country Status (1)

Country Link
CN (1) CN115190073B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117555829B (en) * 2024-01-12 2024-03-22 中诚华隆计算机技术有限公司 USB redirection system and method for realizing network sharing of USB equipment
CN117573454A (en) * 2024-01-15 2024-02-20 中诚华隆计算机技术有限公司 A diagnostic method and system for USB device redirection problems

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311943A (en) * 2019-08-01 2021-02-02 深信服科技股份有限公司 Data scanning optimization method, device and system and related components
CN113596181A (en) * 2021-09-27 2021-11-02 阿里云计算有限公司 Data redirection method, terminal, server and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2901308B1 (en) * 2012-09-25 2021-11-03 A10 Networks, Inc. Load distribution in data networks
CN104123244A (en) * 2013-04-25 2014-10-29 鸿富锦精密工业(深圳)有限公司 USB redirection system and method
IN2013CH05264A (en) * 2013-05-01 2015-05-29 Wyse Technology Llc
US9936049B2 (en) * 2015-07-29 2018-04-03 Dell Products L.P. Protocol independent way for dynamically selecting data compression methods for redirected USB devices
CN106453766B (en) * 2015-08-04 2019-04-09 阿里巴巴集团控股有限公司 Data transmission method, apparatus and system based on virtual machine
US9965431B2 (en) * 2015-08-26 2018-05-08 Dell Products L.P. System and method to improve USB mass storage device arrival acceleration for redirected USB mass storage devices
CN105391652B (en) * 2015-12-03 2018-08-31 武汉噢易云计算股份有限公司 The system and method for realizing USB device network share is redirected based on USB
US10402364B1 (en) * 2018-08-07 2019-09-03 Dell Products L.P. Read-ahead mechanism for a redirected bulk endpoint of a USB device
US10798097B2 (en) * 2018-08-07 2020-10-06 Dell Products L.P. Intelligent redirection of authentication devices
CN114090475A (en) * 2020-07-02 2022-02-25 中兴通讯股份有限公司 USB device redirection method, system, electronic device and storage medium
CN112231004B (en) * 2020-10-19 2022-06-17 北京京航计算通讯研究所 Cloud desktop terminal USB redirection system
CN114237828B (en) * 2021-12-24 2025-07-29 湖南麒麟信安科技股份有限公司 Redirection method and device of USB device, computer device and medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311943A (en) * 2019-08-01 2021-02-02 深信服科技股份有限公司 Data scanning optimization method, device and system and related components
CN113596181A (en) * 2021-09-27 2021-11-02 阿里云计算有限公司 Data redirection method, terminal, server and storage medium

Also Published As

Publication number Publication date
CN115190073A (en) 2022-10-14

Similar Documents

Publication Publication Date Title
CN115190073B (en) USB redirection realization method, system and related equipment
JP6178523B2 (en) Transport accelerator implementing request manager and connection manager functionality
US8661118B2 (en) Detection of end-to-end transport quality
CN102307153A (en) Virtual desktop transmission device and method
KR20220050104A (en) Method for transmitting stream, streaming server and streaming system
WO2019154221A1 (en) Method for sending streaming data and data sending device
CN113645150B (en) Transmission rate control method, apparatus, electronic device, and readable storage medium
CN117312229B (en) Data transmission device, data processing equipment, system, method and medium
CN104904169A (en) Adjusting thread priority to improve throughput between peer-to-peer (P2P) devices
CN116155832A (en) Data transmission method, device, storage medium and system
CN111064771A (en) Network request processing method and system
KR102036579B1 (en) Method and apparatus for providing a web service in a wireless communication system
CN110830388A (en) Data scheduling method, device, network equipment and computer storage medium
US6798870B1 (en) Non real-time facsimile system for a computing device
CN111858099B (en) Message subscription method and device
CN102469028A (en) Apparatus and method for ensuring fairness of UDP data transmission in Ethernet environment
CN118138530A (en) Network active congestion control method and device, electronic equipment and storage medium
EP3440842A1 (en) Media stream prioritization
WO2019095942A1 (en) Data transmission method and communication device
EP1506487A1 (en) Dma controller system including real-time data communication features
WO2021115482A1 (en) Token adjusting method and device
KR20010066370A (en) Multi Media Service System Using Virtual Server
CN115576710A (en) Data transmission method of substrate management controller and related device
JP5163770B2 (en) Packet communication restriction system and packet communication restriction method for portable terminal
CN117389733B (en) SAS I/O scheduling method and device for reducing switch chain overhead

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant