1. Technical Field
Embodiments of the present disclosure relate to data transmitting technology, and particularly to a server, a client device, and a universal serial bus (USB) redirection method.
2. Description of Related Art
A universal serial bus (USB) redirection technology relates to redirecting data from a USB device to a remote server. For example, if the USB device is connected to a client device with a USB redirection function, the client device is capable of redirecting the data to the remote server using the USB redirection. However, if the data is huge, heavy network traffic between the client device and the server may be generated, which may result in network congestion or packet loss. Therefore, there is room for improvement in the art.
The disclosure is illustrated by way of examples and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The client device 20 can be connected to a universal serial (USB) device 10. The USB device 10 may be, but is not limited to, a USB storage device (e.g., a USB flash drive), a USB camera, a USB token, or any other USB devices. The client device 20 includes a remote desktop 22. The remote desktop 22 may be, but is not limited to, a remote desktop protocol (RDP) application, a virtual desktop infrastructure (VDI) application, or any other remote control applications. The remote desktop 22 can control the client device 20. Furthermore, the remote desktop 22 can remotely access and control the server 40.
The server 40 includes one or more virtual machines 401 (one virtual machine 401 is shown in
The starting module 210 starts a USB redirection in the client device 20 using the remote desktop 22 when the USB device 10 is connected to the client device 20. In one embodiment, if the USB device 10 is plugged in the client device 20, the starting module 210 activates the remote desktop 22 and requests the remote desktop 22 to start the USB redirection in the client device 20.
The detection module 220 detects a type of the USB device 10. In one embodiment, the client 20 includes an operating system (OS), the OS includes a registry which stores one or more values. Each type of the USB device 10 corresponds to one of the one or more values, and a value corresponding to the type of the USB device 10 is determined when the USB device 10 is connected to the client 20. For example, assuming that the USB storage device corresponds to a value A, the value A is determined when the USB storage device is connected to the client 20. The detection module 220 searches for the determined value in the registry and determines the type of the USB device 10 according to the determined value.
The compression module 230 obtains data from the USB device 10 and compresses the data using a compression algorithm corresponding to the type of the USB device 10. The compression algorithm may be, but is not limited to, a Lempel-Ziv-Welch (LZW) algorithm, a Lempel-Ziv-Storer-Szymanski (LZSS) algorithm, a MPEG-1 algorithm, a MPEG-2 algorithm, a MPEG-4 algorithm, a H.254 algorithm, a H.265 algorithm, a LZ77 algorithm or a LZ78 algorithm. In one embodiment, if the USB device 10 is the USB storage device, the compression module 230 compresses the data using the LZW algorithm or the LZSS algorithm. If the USB device 10 is the USB camera device, the compression module 230 compresses the data using the MPEG-1 algorithm, the MPEG-2 algorithm, the MPEG-4 algorithm, the H.254 algorithm, or the H.265 algorithm. If the USB device 10 is the USB token, the compression module 230 compressed the data using the LZ77 algorithm or the LZ78 algorithm. Additionally, the compression module 230 encrypts the compressed data using an encryption algorithm, such as, an advanced encryption standard (AES) algorithm, a data encryption standard (DES) algorithm, or a secure sockets layer (SSL) algorithm.
The transmission module 240 transmits the compressed data to the server 40 using the USB redirection in the client device 20.
The activating module 410 activates a USB redirection in the server 40. In one embodiment, the remote desktop 22 sends activating commands to the server 40 when the USB redirection is started in the client device 20, the activating module 410 receives the activating commands and activates the USB redirection in the server 40.
The receiving module 420 receives the compressed data using the USB redirection in the server 40.
The decompression module 430 decompresses the compressed data. In one embodiment, the compressed data includes a filename extension, such as .zip, and .war, for example. The filename extension indicates a file format of the compressed data and the compression algorithm. If the compressed data is compressed by the LZW algorithm, the decompression module 430 determines the filename extension of the compressed data and uses the LZW algorithm to decompress the compressed data. Additionally, if the compressed data is encrypted, the decompression module 430 decrypts the compressed data first, and the decompression module 430 decompresses the compressed data.
The sending module 440 sends the decompressed data to the virtual machine 401. The remote desktop 22 utilized by a user of the client device 20 operates the decompressed data when the decompressed data is stored in the virtual machine 401. For example, the remote desktop 22 utilized by a user of the client device accesses the virtual machine 401 and remotely deletes, edits, or copies the decompressed data.
In step S10, the starting module 210 starts a USB redirection in the client device 20 when the USB device 10 is connected to the client device 20, and the activating module 410 activate a USB redirection in the server 40. The USB redirection in the client device 20 is activated by the remote desktop 22 when the USB device 10 is plugged in the client device 20. The remote desktop 22 sends activating commands to the server 40, the activating module 410 activates the USB redirection in the server 40.
In step S20, the detection module 220 detects a type of the USB device 10. The detection module 220 determines the type of the USB device 10 by searching the determined value in the registry of the OS installed in the client device 10.
In step S30, the compression module 230 obtains data from the USB device 10 and compresses the data using a compression algorithm corresponding to the type of the USB device 10. In one embodiment, the LZW algorithm and the LZSS algorithm are used to compress the data from the USB storage device. The MPEG-1 algorithm, the MPEG-2 algorithm, the MPEG-4 algorithm, the H.254 algorithm, and the H.265 algorithm are used to compress the data from the USB camera device. The LZ77 algorithm and the LZ78 algorithm are used to compress the data from the USB token.
In step S40, the transmission module 240 transmits the compressed data to the server 40 using the USB redirection in the client device 20.
In step S50, the receiving module 420 receives the compressed data from the client device 20 using the USB redirection in the server 40.
In step S60, the decompression module 430 decompresses the compressed data. In one embodiment, the decompression module 430 determines the compression algorithm according to the filename extension of the compressed data, and decompress the compressed data using determined compression algorithm.
In step S70, the sending module 440 sends the decompressed data to a virtual machine 401, and the remote desktop 22 remotely operates the decompressed data stored in the virtual machine 401.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 102114463 | Apr 2013 | TW | national |