Redirection processing operation method and apparatus, device and storage medium
Through the coordinated operation of the server and terminal devices, the USB BOT protocol is used to merge network transmission and adjust the IO size, which solves the problem of slow read and write speed when USB storage devices are redirected to the virtual machine, and achieves more efficient data transmission.
Patent Information
- Application Number
- PCT/CN2025/072327
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-18
- Filing Date
- 2025-01-14
- Publication Date
- 2025-07-24
AI Technical Summary
In the prior art, there are problems such as slow reading and writing speed and time-consuming when redirecting to a virtual machine, and it cannot be effectively applied in all redirecting reading and writing processing scenarios.
After receiving the command block packet request from the virtual machine through the server, the successful command is directly sent to the virtual machine, and the data processing request and command block packet request are sent to the terminal device at the same time. The USB BOT protocol is used to merge multiple network transmissions into a single transmission, adjust the maximum IO size of the transmission request, and the terminal device actively sends command status packet requests to reduce the number of network transmissions and IO interactions.
It improves the rate and efficiency of redirected read and write of USB storage devices, reduces processing time, and is suitable for all redirected read and write processing scenarios.
Smart Images

Figure CN2025072327_24072025_PF_FP_ABST
Abstract
Description
Method, device, equipment and storage medium for redirection processing operation
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on January 18, 2024, with application number 202410074289.5 and application name “Redirected read and write processing method, device, equipment and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the technical field of storage device redirection, and in particular to a method, apparatus, device, and storage medium for redirection processing operations. Background Art
[0004] Mobile storage devices (e.g., USB flash drives, portable hard drives, and other Universal Serial Bus (USB) storage devices) are portable data copying devices. Cloud desktop users use these devices to read, write, and copy data within the cloud desktop. Users copy files from the storage device to the cloud desktop, or vice versa. USB storage devices use USB redirection technology to redirect the device to the cloud desktop, allowing users to access the USB storage device through the cloud desktop.
[0005] In the related art, the read, write and copy speed of USB redirected storage devices can be optimized in the following two ways. The first way is to use the Internet Small Computer System Interface (ISCSI) protocol to mount the inserted USB flash drive to the terminal, and then share it to the cloud desktop through the ISCSI protocol. The cloud desktop uses the disk through the kernel ISCSI client driver, so that the time it takes for the device to appear a drive letter and then to the disk is shorter. The second way is to use the network file system sharing method, for example, through the Server Message Block (SMB), such as Samba, to mount the USB flash drive to the terminal, and share it to the cloud desktop virtual machine through the file system sharing method, thereby improving the recognition speed and copying speed. Summary of the Invention
[0006] The present application provides a redirected read and write processing method, apparatus, device and storage medium.
[0007] In a first aspect, exemplary embodiments of the present application provide a method for redirection processing operations, which is applied to a server, including:
[0008] Obtaining a first command block packet request sent by the virtual machine;
[0009] sending a first success instruction to the virtual machine in response to the first command block packet request;
[0010] Obtaining a data processing request sent by the virtual machine in response to the first success instruction; and
[0011] The first command block package request and the data processing request are sent to a terminal device.
[0012] In this embodiment, after receiving the first command block packet request sent by the virtual machine, the server directly sends the first success instruction to the virtual machine, and does not send the first command block packet request to the terminal through the network, thereby solving the problem that the USB storage device redirection read and write processing method in the related art cannot be applied to all redirection read and write processing scenarios, and the USB storage device redirection read and write still has the technical problems of long time consumption and low read and write rate.
[0013] In one embodiment, sending the first command block package request and the data processing request to the terminal device includes: splitting the data processing request into multiple first data processing sub-requests; and sending the first command block package request and the multiple first data processing sub-requests to the terminal device respectively.
[0014] In one embodiment, the data sizes of the multiple first data processing sub-requests are the same, and preferably, the data size is 64 kilobytes.
[0015] In one embodiment, obtaining the data processing request sent by the virtual machine in response to the first success instruction includes: respectively obtaining multiple second data processing sub-requests sent by the virtual machine in response to the first success instruction; and obtaining the data processing request based on the multiple second data processing sub-requests.
[0016] In one embodiment, before obtaining the data processing request sent by the virtual machine in response to the first success instruction, the method further includes: setting the maximum data volume corresponding to the data processing request as the target data volume, preferably, the target data volume is 1 megabyte.
[0017] In one embodiment, setting the maximum data amount corresponding to the data processing request as the target data amount includes: obtaining an increase request for the maximum data amount corresponding to the data processing request from a system interface; and setting the maximum data amount corresponding to the data processing request to the target data amount according to the increase request.
[0018] In one embodiment, the method further includes: receiving target processing data sent by the terminal device, wherein the target processing data is processing data received by the terminal device from a storage device in response to the data processing request, wherein the storage device is connected to the terminal device; and sending the target processing data to the virtual machine.
[0019] In one embodiment, after receiving the target processing data sent by the terminal device, the method further includes: receiving first command status packet data sent by the terminal device, wherein the first command status packet data is obtained by the terminal device from the storage device.
[0020] In one embodiment, after sending the target processing data to the virtual machine, the method further includes: receiving a first command status packet request sent by the virtual machine, wherein the first command status packet request is generated by the virtual machine according to the target processing data; and sending the first command status packet data to the virtual machine in response to the first command status packet request from the virtual machine.
[0021] In one embodiment, the receiving the target processing data sent by the terminal device includes: receiving a plurality of sub-target processing data sent by the terminal device respectively; and acquiring the target processing data according to the plurality of sub-target processing data.
[0022] In one embodiment, the receiving of the target processing data sent by the terminal device includes: receiving compressed target processing data sent by the terminal device, wherein the compressed target processing data is compressed by the terminal device in a compression mode before the target processing data is sent; and decompressing the compressed target processing data in the compression mode to obtain decompressed target processing data; and sending the target processing data to the virtual machine includes: sending the decompressed target processing data to the virtual machine.
[0023] In one embodiment, the data processing request is one of a data read request and a data write request.
[0024] In one embodiment, the type of the physical device of the server is the same as the type of the physical device of the terminal device.
[0025] Each exemplary embodiment of the present application provides a redirected read and write processing method, including: receiving a first command block packet request and a data read request sent by a virtual machine; sending the first command block packet request and the data read request to a terminal device to allow the terminal device to send the first command block packet request to a storage device, and after receiving a second success instruction returned by the storage device in response to the first command block packet request, sending the data read request to the storage device; receiving target read data sent by the terminal device, wherein the target read data is the target read data returned by the storage device in response to the data read request and received by the terminal device; and sending the target read data to the virtual machine.
[0026] The present application provides an efficient redirected read and write processing method. When a USB storage device is redirected to a virtual machine, after receiving a first command block packet request and a data read request sent by the virtual machine, the server sends the data read request and the first command block packet request simultaneously to a terminal device via a single network transmission. By connecting the terminal device to the storage device, the redirected read and write processing of the storage device in the virtual machine is achieved. The above method uses the protocol request instruction of the USB Bulk Only Transport (BOT) protocol specification, namely the Command Block Wrapper (CBW), to merge multiple network transmissions of actual data content into a single transmission, thereby reducing network transmission loss and accelerating the actual data transmission rate of the storage device. The method can be applied to all redirected read and write processing scenarios, reducing the processing time of USB storage device redirected read and write and improving the read and write rate.
[0027] In one embodiment, the receiving of the first command block package request and the data read request sent by the virtual machine may include: after receiving the first command block package request sent by the virtual machine, sending a first success instruction to the virtual machine; and receiving the data read request returned by the virtual machine in response to the first success instruction.
[0028] The server of the embodiment of the present application first sends a first success instruction to the virtual machine based on the first command block packet request sent by the virtual machine, so as to receive a data read request returned by the virtual machine in response to the first success instruction, thereby achieving that after waiting for the data read request to be successfully received, the data read request and the first command block packet request are simultaneously sent to the terminal device through one network transmission, thereby reducing the number of data transmission times and improving the reading and writing efficiency.
[0029] In one embodiment, receiving the data read request returned by the virtual machine in response to the first successful instruction may include: receiving multiple sub-data read requests returned by the virtual machine in response to the first successful instruction; and merging the multiple sub-data read requests into a data read request.
[0030] Here, the embodiment of the present application can merge multiple sub-data read requests sent by the virtual machine, and after merging them into a data read request, send them to the terminal device in a unified manner, merging the original multiple network transmissions of multiple sub-data data requests into a single transmission, further reducing the number of data transmissions and improving reading and writing efficiency.
[0031] In one embodiment, after receiving the target read data sent by the terminal device, the method may further include: receiving first command status packet data sent by the terminal device, wherein the first command status packet data is generated by the terminal device after the target read data is successfully sent.
[0032] In one embodiment, after sending the target read data to the virtual machine, the method further includes: receiving a first command status packet request sent by the virtual machine, wherein the first command status packet request is generated by the virtual machine based on the target read data; and sending the first command status packet data to the virtual machine.
[0033] After the target read data is successfully sent, the terminal device of the embodiment of the present application actively sends a command status wrapper (CSW) request to the server, and directly returns the CSW request to the server to respond to the CSW data of the virtual machine, thereby reducing the transmission process and further improving the transmission efficiency.
[0034] In one embodiment, after receiving the first command block packet request sent by the virtual machine and before sending the first success instruction to the virtual machine, it also includes: receiving an input / output size increase request sent by the user terminal through the system interface; adjusting the maximum input / output size of the storage device's transmission request to the target size according to the input / output size increase request.
[0035] In this application, the server supports modifying the maximum input and output (IO) size of the transmission request during the redirected reading and writing process. The user can use the user terminal to modify the maximum IO size of the system's transmission request through the system interface. By increasing the maximum IO size of the transmission request, the number of network transmissions and IO interactions is reduced, further improving the redirected reading and writing rate and reducing the redirected reading and writing processing time.
[0036] In one embodiment, the receiving target read data sent by the terminal device includes:
[0037] Receive multiple sub-target reading data sent by the terminal device; and merge the multiple sub-target reading data into target reading data.
[0038] In one embodiment, the server in the present application can receive multiple sub-target reading data after being split and processed by the receiving terminal device, and merge the multiple sub-target reading data into target reading data. After the target reading data is split, it can be transmitted in parallel to improve the data transmission rate.
[0039] In one embodiment, the receiving of the target read data sent by the terminal device includes: receiving the target read data in compressed mode sent by the terminal device; decompressing the target read data in compressed mode to obtain decompressed target read data; and sending the target read data to the virtual machine includes: sending the decompressed target read data to the virtual machine.
[0040] The server in the embodiment of the present application can receive multiple sub-target reading data after being split and processed by the terminal device, and merge the multiple sub-target reading data into target reading data. After the target reading data is split, it can be transmitted in parallel to improve the data transmission rate.
[0041] In one embodiment, the above method also includes: after receiving a second command block packet request sent by the virtual machine, sending a third success instruction to the virtual machine; receiving a data write request returned by the virtual machine according to the third success instruction; receiving the data write request, and sending the second command block packet request and the data write request to the terminal device at the same time, so that the terminal device sends the second command block packet request to the storage device after receiving the second command block packet request and the data write request, and sends the data write request to the storage device after receiving the third success instruction sent by the storage device in response to the second command block packet request; receiving a second command status packet request sent by the terminal device, wherein the second command status packet request is generated by the terminal device after the data write request is successfully sent; receiving second command status packet data sent by the virtual machine, wherein the second command status packet data is generated after the virtual machine transmits the write data in the data write request; and sending the second command status packet request to the virtual machine.
[0042] An embodiment of the present application provides an efficient redirected data processing method for writing data from a virtual machine to a storage device, which combines multiple network transmissions of actual data content into a single transmission to reduce network transmission loss, speed up actual data transmission of the storage device, and improve the efficiency of redirected data writing.
[0043] In a second aspect, each exemplary embodiment of the present application provides a method for redirecting a processing operation, which is applied to a terminal device, including: receiving a first command block package request and a data processing request sent by a server; sending the first command block package request to a storage device, wherein the storage device is connected to the terminal device; after obtaining a second success instruction sent by the storage device in response to the first command block package request, sending the data processing request to the storage device; and after receiving the target processing data sent by the storage device in response to the data processing request, sending the target processing data to the server, so that the server sends the target processing data to the virtual machine.
[0044] In one embodiment, after receiving the target processed data sent by the storage device in response to the data processing request and sending the target processed data to the server, the method further includes:
[0045] Sending first command status packet data to the server, so that the server sends the first command status packet data to the virtual machine in response to receiving the first command status packet request sent by the virtual machine, wherein the first command status packet request is generated after the virtual machine receives the target processing data.
[0046] In one embodiment, after receiving the target processing data sent by the storage device in response to the data processing request, sending the target processing data to the server includes: after receiving the target processing data sent by the storage device in response to the data processing request, obtaining the data volume of the target processing data; if the data volume of the target processing data is greater than or equal to a preset threshold, splitting the target processing data to obtain multiple sub-target processing data; and sending the multiple sub-target processing data to the server respectively.
[0047] In one embodiment, after receiving the target processing data sent by the storage device in response to the data processing request, sending the target processing data to the server includes: after receiving the target processing data sent by the storage device in response to the data processing request, compressing the target processing data by a preset compression method to obtain the target processing data in a compressed mode; and sending the target processing data in the compressed mode to the server.
[0048] Each exemplary embodiment of the present application provides a redirected read and write processing method, which is applied to a terminal device, and the method includes: receiving a first command block packet request and a data read request sent by a server, wherein the first command block packet request and the data read request are sent by a virtual machine to the server; sending the first command block packet request to a storage device; after receiving a second success instruction returned by the storage device in response to the first command block packet request, sending the data read request to the storage device; and after receiving target read data returned by the storage device in response to the data read request, sending the target read data to the server, so that the server sends the target read data to the virtual machine.
[0049] In one embodiment, after receiving the target read data returned by the storage device in response to the data read request, and sending the target read data to the server, the method further includes: after the target read data is successfully sent, sending first command status packet data to the server, so that the server sends the first command status packet data to the virtual machine after receiving the first command status packet request sent by the virtual machine, wherein the first command status packet request is generated after the virtual machine receives the target read data.
[0050] The present application provides an efficient data redirection read and write processing method for a terminal device, wherein the terminal device can receive a first command block packet request and a data read request sent simultaneously by a server, and through a USB BOT protocol request instruction, namely, CBW, multiple network transmissions of actual data content are merged into a single transmission to reduce network transmission loss and speed up the actual data transmission rate of the storage device. Furthermore, the terminal device actively sends a second command status packet request to the server, that is, directly returns a CSW request to the server to respond to the CSW data of the virtual machine, without waiting for the CSW data of the virtual machine to be sent before sending the CSW data, thereby reducing the transmission time. The method can be applied to all redirection read and write processing scenarios, reduces the processing time of redirection read and write of USB storage devices, and improves the read and write rate.
[0051] In one embodiment, after receiving the target read data returned by the storage device in response to the data read request, the target read data is sent to the server, including: after receiving the target read data returned by the storage device in response to the data read request, obtaining the size of the target read data; if the target read data is larger than a preset size threshold, splitting the target read data to obtain multiple sub-target read data; and sending the multiple sub-target read data to the server respectively.
[0052] When the terminal device transmits target read data to the server, the target read data can be split and processed to obtain multiple sub-target read data, and the large IO USB request can be split into small IOs respectively, thereby improving IO and network concurrency and further improving the efficiency of data redirection read and write processing.
[0053] In one embodiment, after receiving the target read data returned by the storage device in response to the data read request, sending the target read data to the server includes: after receiving the target read data returned by the storage device in response to the data read request, compressing the target read data by a preset compression method to obtain the target read data in a compressed mode; and sending the target read data in the compressed mode to the server.
[0054] When the terminal device transmits target read data to the server, the target read data can be compressed. The data transmission time after compression is accelerated, further improving the efficiency of data redirection reading and writing processing.
[0055] In a third aspect, an exemplary embodiment of the present application provides a redirected read and write processing device, which is applied to a server side, and the device includes: a transceiver module, which is used to obtain a first command block packet request sent by a virtual machine; send a first success instruction to the virtual machine in response to the first command block packet request; and obtain a data processing request sent by the virtual machine in response to the first success instruction; and a sending module, which is used to send the first command block packet request and the data processing request to a terminal device.
[0056] An exemplary embodiment of the present application provides a redirected read and write processing device, which is applied to a server, and the device includes: a transceiver module, which is used to receive a first command block packet request and a data read request sent by a virtual machine; a second sending module, which is used to send the first command block packet request and the data read request to a terminal device, so as to allow the terminal device to send the first command block packet request to a storage device, and after receiving a second success instruction returned by the storage device in response to the first command block packet request, send the data read request to the storage device; a second receiving module, which is used to receive target read data sent by the terminal device, wherein the target read data is the target read data returned by the storage device in response to the data read request and received by the terminal device; and a third sending module, which is used to send the target read data to the virtual machine.
[0057] In one embodiment, the transceiver module includes a first sending module and a first receiving module; the first sending module is used to send a first success instruction to the virtual machine after receiving a first command block packet request sent by the virtual machine; and the first receiving module is used to receive a data read request returned by the virtual machine in response to the first success instruction.
[0058] In one embodiment, the first receiving module is specifically configured to: receive multiple sub-data read requests returned by the virtual machine in response to the first success instruction; and merge the multiple sub-data read requests into a data read request.
[0059] In one embodiment, after receiving the target read data sent by the terminal device, the second receiving module is further used to: receive first command status packet data sent by the terminal device, wherein the first command status packet data is generated by the terminal device after the target read data is successfully sent.
[0060] In one embodiment, after the third sending module sends the target read data to the virtual machine, the above-mentioned device also includes: a third receiving module, used to receive a first command status packet request sent by the virtual machine, wherein the first command status packet request is generated by the virtual machine according to the target read data; and a fourth sending module, used to send the first command status packet data to the virtual machine.
[0061] In one embodiment, after the first sending module receives the first command block packet request sent by the virtual machine and before sending the first success instruction to the virtual machine, the above-mentioned device also includes an adjustment module for: receiving an input / output size increase request sent by the user terminal through the system interface; and adjusting the maximum input / output size of the storage device's transmission request to the target size according to the input / output size increase request.
[0062] In one embodiment, the second receiving module is specifically configured to: receive a plurality of sub-target reading data sent by the terminal device; and merge the plurality of sub-target reading data into target reading data.
[0063] In one embodiment, the second receiving module is further specifically used to: receive the target read data in compressed mode sent by the terminal device; decompress the target read data in compressed mode to obtain decompressed target read data; and the third sending module is specifically used to: send the decompressed target read data to the virtual machine.
[0064] In one embodiment, the above-mentioned device also includes a processing module, which is used to: after receiving a second command block packet request sent by the virtual machine, send a third success instruction to the virtual machine; receive a data write request returned by the virtual machine according to the third success instruction; receive the data write request, and send the second command block packet request and the data write request to the terminal device at the same time, so that the terminal device sends the second command block packet request to the storage device after receiving the second command block packet request and the data write request, and sends the data write request to the storage device after receiving the third success instruction sent by the storage device in response to the second command block packet request; receive a second command status packet request sent by the terminal device, wherein the second command status packet request is generated by the terminal device after the data write request is successfully sent; receive second command status packet data sent by the virtual machine, wherein the second command status packet data is generated after the virtual machine transmits the write data in the data write request; and send the second command status packet request to the virtual machine.
[0065] In a fourth aspect, each exemplary embodiment of the present application provides a redirected read / write processing device, applied to a terminal device, the device comprising:
[0066] a fourth receiving module, configured to receive a first command block packet request and a data read request sent by a server, wherein the first command block packet request and the data read request are sent by a virtual machine to the server;
[0067] a fifth sending module, configured to send the first command block packet request to a storage device;
[0068] a sixth sending module, configured to send the data read request to the storage device after receiving a second success instruction returned by the storage device in response to the first command block packet request; and
[0069] A seventh sending module is configured to send the target read data to the server after receiving the target read data returned by the storage device in response to the data read request, so that the server sends the target read data to the virtual machine.
[0070] In one embodiment, after the seventh sending module is used to send the target read data returned by the storage device in response to the data read request to the server, it also includes: an eighth sending module, used to send first command status packet data to the server after the target read data is successfully sent, so that the server sends the first command status packet data to the virtual machine after receiving the first command status packet request sent by the virtual machine, wherein the first command status packet request is generated after the virtual machine receives the target read data.
[0071] In one embodiment, the seventh sending module is specifically configured to:
[0072] After receiving the target read data returned by the storage device in response to the data read request, the size of the target read data is obtained; if the target read data is larger than a preset size threshold, the target read data is split and processed to obtain multiple sub-target read data; and the multiple sub-target read data are sent to the server respectively.
[0073] In one embodiment, the seventh sending module is further specifically configured to:
[0074] After receiving the target read data returned by the storage device in response to the data read request, the target read data is compressed using a preset compression method to obtain the target read data in a compressed mode; and the target read data in the compressed mode is sent to the server.
[0075] In a fifth aspect, exemplary embodiments of the present application provide an electronic device for redirecting processing operations, including: one or more processors and a memory;
[0076] The memory stores computer-executable instructions; and
[0077] The one or more processors execute the computer-executable instructions stored in the memory, so that the one or more processors perform the above-mentioned methods of each redirection processing operation.
[0078] In a sixth aspect, each exemplary embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above-mentioned methods of redirection processing operations are implemented.
[0079] In a seventh aspect, each exemplary embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned methods for each redirection processing operation.
[0080] The present application provides a method for efficient redirection processing operations. When a USB storage device is redirected to a virtual machine, after receiving a first command block packet request and a data processing request sent by the virtual machine, the server sends the data processing request and the first command block packet request to a terminal device via network transmission at the same time, so as to connect the terminal device to the storage device, thereby realizing the redirection processing operation of the storage device in the virtual machine. The above method uses the USB BOT protocol request instruction, namely CBW, to merge multiple network transmissions of actual data content into a single transmission to reduce network transmission loss and speed up the actual data transmission rate of the storage device. This method can be applied to all redirection read and write processing scenarios, reduces the processing time of redirection reading and writing of USB storage devices, and improves the read and write rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0082] FIG1 is a schematic diagram of a system architecture for a redirection processing operation provided by an embodiment of the present application;
[0083] FIG2 is a flow chart of a method for redirection processing provided in an embodiment of the present application;
[0084] FIG3 is a flow chart of another method for redirection processing provided in an embodiment of the present application;
[0085] FIG4 is a flow chart of another method for redirection processing provided in an embodiment of the present application;
[0086] FIG5 is a schematic diagram of the structure of an apparatus for redirection processing operations provided in an embodiment of the present application;
[0087] FIG6 is a schematic structural diagram of a device for redirection processing operations provided in an embodiment of the present application.
[0088] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0089] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0090] The terms "first," "second," "third," and "fourth," etc., as used in the specification and claims of the present application and in the accompanying drawings, if any, are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or that are inherent to these processes, methods, products, or apparatus.
[0091] As mentioned above, a mobile storage device (for example, a Universal Serial Bus (USB) storage device such as a USB flash disk or a mobile hard disk) is a portable data copying device. Cloud desktop users use this device to perform data read, write, and copy operations within the cloud desktop. Users read files from the storage device and copy them to the cloud desktop, or write files from the cloud desktop and copy them to the storage device. The USB storage device redirects the device to the cloud desktop through USB redirection technology, allowing users to access the USB storage device through the cloud desktop. However, the read and write copy speed of this method is far from reaching the server bandwidth limit or the storage device IO limit, and it is necessary to optimize the read and write copy speed of the USB redirection storage device.
[0092] After the USB storage device is connected to the terminal, the redirection component obtains the device data through the redirection driver, sends the data to the virtual USB device on the server through network transmission, and finally exposes the data to the storage device driver in the virtual cloud desktop through the virtual controller, allowing the USB storage device to be used in the cloud desktop.
[0093] In the related art, the read, write and copy speed of USB redirected storage devices can be optimized in the following two ways. The first way is to use the Internet Small Computer System Interface (ISCSI) protocol to mount the inserted USB flash drive to the terminal, and then share it to the cloud desktop through the ISCSI protocol. The cloud desktop uses the disk through the kernel ISCSI client driver, so that the time it takes for the device to appear a drive letter and then to the disk is shorter. The second way is to use the network file system sharing method, for example, through the Server Message Block (SMB), such as Samba, to mount the USB flash drive to the terminal, and share it to the cloud desktop virtual machine through the file system sharing method, thereby improving the recognition speed and copying speed.
[0094] In a redirected read and write processing method in the related art, the flow of the read processing method is as follows.
[0095] The virtual machine (VM) system sends a URB (USB Request Block) IO request of Read CBW (command status in the storage device protocol) to the virtual USB device through the USB BULK OUT endpoint; the virtual USB device forwards the data to the redirection client through the redirection protocol and sends the CBW request to the terminal device Device; after receiving the URB IO of CBW, the Device returns a successful IO reception response to the redirection module, waits for data to be retrieved, and finally returns the IO success response to the VM system through the redirection protocol through the redirection module; after receiving the CBW IO success, the VM system sends a URB IO request of reading data to the virtual device through the USB Bulk IN endpoint to read the data. The system defaults to a read request size of 64KB; the virtual device forwards the request to the redirection protocol module, which sends it to the client and finally to the USB Device; the Device receives the read data IO and returns the data to the redirection module. The data is finally returned to the VM system through the redirection protocol, and the IO data reception is completed; the VM side sends URB IO through the USB Bulk IN endpoint to obtain the status CSW request of the device processing the read request to the simulated device, and finally forwards it to the Device through the redirection protocol; the Device returns the final read request processing status result response CSW (command block in the storage device protocol), which is finally returned to the VM through the redirection protocol, and the read request process is completed.
[0096] However, the USB storage device redirection read and write processing methods of the above-mentioned related technologies cannot be applied to all redirection read and write processing scenarios, and the USB storage device redirection read and write still has technical problems of long time consumption and low read and write speed.
[0097] The embodiments of the present application provide a method, apparatus, device and storage medium for redirection processing operations. The method uses the CBW of the USB BOT to merge multiple network transmissions of actual data content into a single transmission to reduce network transmission loss and speed up the actual data transmission rate of the storage device.
[0098] The processing operations in each exemplary embodiment of the present application may include read operations, write operations, or other operations performed by the storage devices of the server and the terminal device.
[0099] The storage device in each exemplary embodiment of the present application may include a mobile storage device (for example, a Universal Serial Bus (USB) storage device such as a USB flash disk or a mobile hard disk).
[0100] The following embodiments will be described using a read operation or a write operation as an example, but it should be understood that the embodiments of the present application are not limited to these two types of operations.
[0101] In one embodiment, after the target read data is successfully sent, the terminal device actively sends a CSW request to the server, and directly returns the CSW request to the server to respond to the CSW data of the virtual machine, reducing the transmission process. This method can be applied to all redirected read and write processing scenarios, reducing the processing time of redirected read and write of USB storage devices and improving the read and write speed.
[0102] In this embodiment, the server may refer to a server providing cloud desktop services in the cloud desktop field. In other embodiments, the server may also be a terminal device that is the same as the terminal device, for example, both the server and the terminal device may be personal computers (PCs).
[0103] Figure 1 is a schematic diagram of the architecture of a redirected read and write processing system provided in an embodiment of the present application. As shown in Figure 1, the redirected read and write processing system of an embodiment of the present application mainly includes a terminal device and a server, wherein the terminal device can be connected to a storage device to achieve communication (for example, plugging a USB into the terminal device to form a communication connection), and the server can interact with a virtual machine.
[0104] The following is a brief introduction to the structure in Figure 1:
[0105] 1. Server and its module functions:
[0106] Server: Serves as the carrier of virtual machines and is responsible for running them. In scenarios such as Intelligent Desktop Virtualization (IDV), where virtual machines run locally on physical machines, the server and the physical machine represent the same module.
[0107] Virtual Machine (VM): refers to a computer system simulated by software.
[0108] Virtual USB bus device: refers to a USB bus device simulated by software and used to mount redirected USB devices.
[0109] Virtual USB device: refers to a USB device simulated by software, used by the VM system driver to identify and use the device.
[0110] Redirection protocol parsing module: parses and processes the data received from the client redirection module, and processes the data received from the virtual VM to the virtual USB device, including USB device protocol processing such as storage devices and camera devices.
[0111] Protocol server: encapsulates different types of protocol data (display, audio, etc.), communicates with terminal devices (clients) over the network, and performs basic protocol operations such as encrypted transmission.
[0112] 2. Terminal equipment and its module functions:
[0113] Terminal device: responsible for running the protocol client and connecting to a real storage device, such as a USB physical device.
[0114] Protocol client: responsible for connecting to the remote virtual machine, displaying the desktop and providing interaction, redirecting data transmission and packaging, etc.
[0115] Redirection module: responsible for USB redirection device related control.
[0116] Redirection protocol parsing module: parses the data received from the server redirection module and sends the request to the device interaction module, processes the data received from the device interaction module, including USB device protocol processing such as storage devices and camera devices.
[0117] Device interaction module: interacts with the underlying USB redirection driver, sends requests from the parsing module to the device, and obtains device data.
[0118] Device redirection driver: A general USB redirection driver that interacts directly with the device.
[0119] It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the architecture of the redirected read / write processing system. In other embodiments of this application, the above architecture may include more or fewer components than shown, or may combine or split certain components, or have different component arrangements. The specific configuration may be determined based on the actual application scenario and is not limited here. The components shown in Figure 1 can be implemented in hardware, software, or a combination of software and hardware.
[0120] It should be understood that the above-mentioned server and terminal devices may include respective processing devices, and the processing devices may be implemented by a processor reading instructions in a memory and executing the instructions, or may be implemented by a chip circuit.
[0121] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0122] The technical solution of the present application is described in detail below using specific exemplary embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0123] Figure 2 is a flow chart of a redirected read / write processing method provided by an embodiment of the present application. The execution subject of the embodiment of the present application can be the server in Figure 1, and the specific execution subject can be determined according to the actual application scenario. As shown in Figure 2, the method includes the following steps.
[0124] S201: Receive a first command block packet request and a data read request sent by a virtual machine.
[0125] The receiving the first command block packet request and the data read request sent by the virtual machine includes:
[0126] After receiving the first command block package request sent by the virtual machine, a first success instruction is sent to the virtual machine; and a data read request returned by the virtual machine in response to the first success instruction is received.
[0127] The first success instruction is generated by the server after confirming that the server has received the first command block packet request sent by the virtual machine, and is used to prompt the virtual machine to send a data read request.
[0128] Receiving a data read request returned by the virtual machine in response to the first successful instruction includes:
[0129] Receive multiple sub-data read requests returned by the virtual machine in response to the first successful instruction; and merge the multiple sub-data read requests into a data read request.
[0130] Here, the embodiment of the present application can merge multiple sub-data read requests sent by the virtual machine, and after merging them into a data read request, send them to the terminal device in a unified manner, merging the original multiple network transmissions of the multiple sub-data requests into a single transmission, further reducing the number of data transmissions and improving reading and writing efficiency.
[0131] The sub-data read request here is a plurality of data within 64KB, and the data amount of the data read request only needs to be less than or equal to 1MB, which increases the transmission size of the data read request and reduces the number of transmissions.
[0132] In some embodiments, the server can integrate data requests. After receiving multiple sub-data requests sent by the virtual machine, the server can merge the multiple sub-data requests to obtain an integrated data request, which is then sent to the terminal device through a single network transmission.
[0133] The above-mentioned data request may be a data read request, a data write request or any other data request, and the embodiment of the present application does not impose any specific limitation on this.
[0134] Here, the server of an embodiment of the present application first sends a first success instruction to the virtual machine based on the first command block packet request sent by the virtual machine, so as to receive the data read request returned by the virtual machine in response to the first success instruction, thereby achieving that after waiting for the data read request to be successfully received, the data read request and the first command block packet request are sent to the terminal device at the same time through one network transmission, reducing the number of data transmissions and improving the reading and writing efficiency.
[0135] After receiving the first command block packet request sent by the virtual machine and before sending the first success instruction to the virtual machine, the method further includes:
[0136] An input / output size increase request is received from a user terminal through a system interface; and a maximum input / output size of a transmission request of a storage device is adjusted to a target size according to the input / output size increase request.
[0137] In some embodiments, the storage device may be a mobile storage device, such as a USB flash drive, a mobile hard disk, etc.
[0138] Among them, in the embodiment of the present application, the server supports modifying the maximum input and output (IO) size of the transmission request during the redirected reading and writing process. The user can use the user terminal to modify the maximum IO size of the system's transmission request through the system interface. By increasing the maximum IO size of the transmission request, the number of network transmissions and IO interactions is reduced, further improving the redirected reading and writing rate and reducing the redirected reading and writing processing time.
[0139] In one possible implementation, the system's maximum USB storage device IO instruction request is increased to xMB to reduce network transmission and IO interaction times, where x can be any positive number, such as 1, 2, 3, etc. The size of x can be determined based on actual conditions, and the embodiment of the present application does not impose any specific restrictions on this.
[0140] S202: Send the first command block package request and the data read request to the terminal device to allow the terminal device to send the first command block package request to the storage device, and after receiving the second success instruction returned by the storage device in response to the first command block package request, send the data read request to the storage device.
[0141] Among them, after receiving the command block packet CBW request and the data read / write request Request, the server of the embodiment of the present application sends the CBW and Request together to the terminal device through the network, and uses the USB BOT protocol request instruction CBW to merge multiple network transmissions of the actual data content into a single transmission to reduce network transmission loss and speed up the actual data transmission of the storage device.
[0142] S203: Receive target read data sent by the terminal device.
[0143] After receiving the target read data sent by the terminal device, the first command status packet data sent by the terminal device is also received.
[0144] The target read data is the target read data returned by the storage device in response to the data read request and received by the terminal device, and the first command status packet data is generated by the terminal device after the target read data is successfully sent.
[0145] Receive target read data sent by the terminal device, including:
[0146] Receive multiple sub-target reading data sent by the terminal device; merge the multiple sub-target reading data into target reading data.
[0147] Here, the server in the embodiment of the present application can receive multiple sub-target read data after the terminal device splits and processes, merge the multiple sub-target read data into target read data, and then send the target read data to the virtual machine. In other embodiments, the server can also directly transmit the multiple sub-target read data in parallel to the virtual machine to increase the data transmission rate.
[0148] Receiving target read data sent by a terminal device includes: receiving target read data in a compressed mode sent by the terminal device; decompressing the target read data in the compressed mode to obtain decompressed target read data; and accordingly, sending the target read data to a virtual machine includes: sending the decompressed target read data to the virtual machine.
[0149] Here, the server in the embodiment of the present application can receive multiple sub-target reading data after being split and processed by the terminal device, and merge the multiple sub-target reading data into target reading data. After the target reading data is split, it can be transmitted in parallel to improve the data transmission rate.
[0150] S204: Send the target read data to the virtual machine.
[0151] After sending the target read data to the virtual machine, it also includes:
[0152] Receive a first command status packet request sent by the virtual machine; and send the first command status packet data to the virtual machine.
[0153] The first command status packet request is generated by the virtual machine according to target reading data.
[0154] Among them, after the target read data is successfully sent, the terminal device of the embodiment of the present application actively sends a CSW request to the server, and directly returns the CSW request to the server to respond to the CSW data of the virtual machine, thereby reducing the transmission process and further improving the transmission efficiency.
[0155] An embodiment of the present application provides an efficient redirected read and write processing method. When a USB storage device is redirected to a virtual machine, after receiving the first command block packet request and data read request sent by the virtual machine, the server sends the data read request and the first command block packet request to the terminal device at the same time through a network transmission, so as to connect the terminal device with the storage device, thereby realizing redirected read and write processing of the storage device in the virtual machine. The above method uses the USB BOT protocol request instruction, namely CBW, to merge multiple network transmissions of actual data content into a single transmission to reduce network transmission loss and speed up the actual data transmission rate of the storage device. This method can be applied to all redirected read and write processing scenarios, reduces the processing time of redirected read and write of USB storage devices, and improves the read and write rate.
[0156] The above method may further include:
[0157] After receiving the second command block packet request sent by the virtual machine, a third success instruction is sent to the virtual machine; a data write request returned by the virtual machine according to the third success instruction is received; the data write request is received, and the second command block packet request and the data write request are sent to the terminal device at the same time, so that the terminal device sends the second command block packet request to the storage device after receiving the second command block packet request and the data write request, and sends the data write request to the storage device after receiving the third success instruction sent by the storage device in response to the second command block packet request; a second command status packet request is received from the terminal device, wherein the second command status packet request is generated by the terminal device after the data write request is successfully sent; second command status packet data is received from the virtual machine, wherein the second command status packet data is generated after the virtual machine transmits the write data in the data write request; and the second command status packet request is sent to the virtual machine.
[0158] Data write requests and written data can be losslessly compressed before data transmission, or split before data transmission, further improving data processing efficiency.
[0159] Here, an embodiment of the present application provides an efficient redirected data processing method for writing data from a virtual machine to a storage device, which merges multiple network transmissions of actual data content into a single transmission to reduce network transmission loss, speed up actual data transmission of the storage device, and improve the efficiency of redirected data writing.
[0160] Figure 3 is a flow chart of another redirected read / write processing method provided by an embodiment of the present application. The execution subject of the embodiment of the present application can be the terminal device in Figure 1, and the specific execution subject can be determined according to the actual application scenario. As shown in Figure 3, the method includes the following steps.
[0161] S301: Receive a first command block packet request and a data read request sent by a server.
[0162] The first command block packet request and the data read request are sent by the virtual machine to the server.
[0163] The first command block packet request is sent by the virtual machine to the server.
[0164] The data read request is a first success instruction sent by the server to the virtual machine after receiving the first command block packet request sent by the virtual machine, and the virtual machine returns the first success instruction.
[0165] The first command block packet request and the data read request are sent simultaneously by the server to the terminal device through one network transmission.
[0166] S302: Send a first command block package request to a storage device.
[0167] S303: After receiving the second success instruction returned by the storage device in response to the first command block package request, send a data read request to the storage device.
[0168] S304: After receiving the target read data returned by the storage device in response to the data read request, the target read data is sent to the server, so that the server sends the target read data to the virtual machine.
[0169] After receiving the target read data returned by the storage device in response to the data read request, sending the target read data to the server may include:
[0170] After receiving the target read data returned by the storage device in response to the data read request, the size of the target read data is obtained; if the target read data is larger than a preset size threshold, the target read data is split and processed to obtain multiple sub-target read data; and the multiple sub-target read data are sent to the server respectively.
[0171] It is understandable that the preset size threshold here can be determined according to actual conditions, and the embodiments of the present application do not impose specific limitations on this.
[0172] Here, in the embodiment of the present application, when the terminal device transmits target read data to the server, the target read data can be split and processed to obtain multiple sub-target read data, and the large IO USB request can be split into small IOs respectively, thereby improving IO and network concurrency and further improving the data redirection read and write processing efficiency.
[0173] After receiving the target read data returned by the storage device in response to the data read request, sending the target read data to the server may include:
[0174] After receiving the target read data returned by the storage device in response to the data read request, the target read data is compressed using a preset compression method to obtain the target read data in a compressed mode; and the target read data in the compressed mode is sent to the server.
[0175] The target read data can be compressed using lossless compression methods such as lz4 and lzw encoding.
[0176] Here, in the embodiment of the present application, when the terminal device transmits target read data to the server, the target read data can be compressed. The data transmission time after compression is accelerated, further improving the efficiency of data redirection reading and writing processing.
[0177] After step S304, the method may further include the following steps:
[0178] After the target read data is sent successfully, the first command status packet data is sent to the server, so that the server sends the first command status packet data to the virtual machine after receiving the first command status packet request sent by the virtual machine.
[0179] The first command status packet request is generated after the virtual machine receives the target read data.
[0180] Here, an embodiment of the present application provides an efficient data redirection read and write processing method applied to a terminal device, wherein the terminal device can receive a first command block packet request and a data read request sent simultaneously by the server, and through the USB BOT protocol request instruction, namely CBW, multiple network transmissions of the actual data content are merged into a single transmission to reduce network transmission loss and speed up the actual data transmission rate of the storage device. Furthermore, the terminal device actively sends a second command status packet request to the server, that is, directly returns a CSW request to the server to respond to the CSW data of the virtual machine, without waiting for the CSW data of the virtual machine to be sent before sending the CSW data, thereby reducing the transmission time. This method can be applied to all redirection read and write processing scenarios, reducing the processing time of redirection reading and writing of USB storage devices and improving the read and write rate.
[0181] FIG4 is a flow chart of another redirected read / write processing method provided by an embodiment of the present application. The execution subject of the embodiment of the present application can be the redirected read / write processing system in FIG1 , and the specific execution subject can be determined according to the actual application scenario. As shown in FIG4 , the method may include the following steps.
[0182] S401: The virtual machine sends a first command block packet request to the server.
[0183] S402: The server sends a first success instruction to the virtual machine.
[0184] S403: The server receives a data read request returned by the virtual machine in response to the first successful instruction.
[0185] S404: The server sends the first command block package request and the data read request to the terminal device.
[0186] S405: The terminal device sends the first command block package request to the storage device.
[0187] S406: The terminal device receives a second success instruction returned by the storage device in response to the first command block package request.
[0188] S407: The terminal device sends a data read request to the storage device.
[0189] S408: The terminal device receives the target read data returned by the storage device in response to the data read request.
[0190] S409: The server receives the target read data sent by the terminal device, and receives the first command status packet data sent by the terminal device.
[0191] The first command status packet data is generated by the terminal device after the target read data is successfully sent.
[0192] The target read data and the first command status packet data may be transmitted separately or simultaneously.
[0193] S4010: The server sends the target read data to the virtual machine.
[0194] S4011: The server receives a first command status packet request sent by the virtual machine.
[0195] The first command status packet request is generated by the virtual machine according to target reading data.
[0196] S4012: The server sends the first command status packet data to the virtual machine.
[0197] In one possible implementation, based on FIG1 , storage device read optimization is implemented as follows:
[0198] 5.1. Increase the maximum IO size of storage device transfer requests to 1MB through the system interface.
[0199] 5.2. After the server receives the CBW request from the virtual machine, it directly replies that the IO is successful, waits for the virtual machine to send data, and then sends the CBW and DATA Read Request (1MB) to the terminal device through the network.
[0200] The DATA Read Request here is a data request sent directly by the virtual machine to the server, or a data request sent by the virtual machine to the server and then merged by the server.
[0201] The request is any request not limited to a read or write request.
[0202] 5.3. After receiving the server CBW and DATA Read Request through a network transmission, the terminal protocol redirection component first sends the CBW request, and then sends the received Data Read Request after the CBW request IO is successful.
[0203] 5.4. The terminal protocol redirection component breaks down a large IO (Data Read Request) (1MB) into multiple small IOs (64K) and sends them down. After each small IO succeeds, it is directly sent to the server via network lossless compression. It also supports direct lossless compression and sending of large 1MB data.
[0204] 5.5. The server waits for the complete data to be received and then returns it to the VM virtual machine, achieving concurrency of IO and network transmission.
[0205] 5.6. After the terminal device completes the Read and DATA IO, it actively constructs and sends a CSW request to obtain the read status of Data ReadRequest and sends it to the server.
[0206] 5.7. After receiving the CSW request from the VM, the server directly responds with the CSW data returned by the terminal device, completing the data reading process.
[0207] In one possible implementation, based on FIG1 , storage device write optimization is implemented as follows:
[0208] 6.1. Increase the maximum size of storage device transfer requests to 1MB through the system interface.
[0209] 6.2. After the server receives the CBW request from the virtual machine, it directly replies that the IO is successful. After waiting for the virtual machine to send data, it sends the CBW and DATA Write Request (1MB) data to the terminal device through the network.
[0210] The DATA Write Request here is a data request sent directly by the virtual machine to the server, or a data request sent by the virtual machine to the server and then merged by the server.
[0211] The request is any request not limited to a read or write request.
[0212] 6.3. The server-side protocol redirection component breaks down a large IO (Data Write Request) (1MB) into multiple small IOs (64K) and sends them separately. Each small IO is sent to the client via network lossless compression. It also supports direct lossless compression of large 1MB data and sending it to the client.
[0213] 6.4. The terminal protocol redirection component receives the server CBW through a network transmission, first sends the CBW request to the device, and then sends the received Data Write Request small IO request to the device after the CBW request IO is successful.
[0214] 6.5. The client continuously receives small IOs and sends them to the terminal device, realizing concurrent transmission of client IO and server network data.
[0215] 6.6. After the client Write and Data IO are completely completed, it actively constructs and sends a CSW request to obtain the read status of the Data Write Request and sends it to the server.
[0216] 6.7. After receiving the CSW data from the VM, the server directly responds to the CSW request returned by the terminal device to complete the data writing process.
[0217] In the embodiment of the present application, the server side can integrate the CBW and Request on the server side and send them to the terminal device in the above-mentioned manner regardless of the read and write request or other storage device request instructions. After receiving the merged request, the terminal device first sends the CBW request to the storage device. After the terminal device receives the complete response of the storage device CBW, it sends the request Request. After receiving the message that the Request is completed, the terminal device responds to the server side. The server side directly returns the virtual machine, and the terminal device sends the constructed CSW request to the storage device. After receiving the response to the CSW request, the terminal device directly returns the CSW to the server side to respond to the VM's CSW request.
[0218] The embodiment of the present application also provides a structural diagram of a redirected read and write processing device. As shown in Figure 5, the device of the embodiment of the present application includes: a transceiver module 501, a second sending module 502, a second receiving module 503 and a third sending module 504. The redirected read and write processing device here can be the above-mentioned server itself, or a processing device or processor of the server, or a chip or integrated circuit that realizes the function of the processor. It should be noted here that the division of the transceiver module 501, the second sending module 502, the second receiving module 503 and the third sending module 504 is only a division of logical functions. Physically, the two can be integrated or independent.
[0219] The transceiver module is used to receive a first command block packet request and a data read request sent by the virtual machine.
[0220] The second sending module is used to send the first command block package request and the data read request to the terminal device to allow the terminal device to send the first command block package request to the storage device, and after receiving the second success instruction returned by the storage device in response to the first command block package request, send the data read request to the storage device.
[0221] The second receiving module is used to receive the target read data sent by the terminal device and receive the first command status packet data sent by the terminal device, wherein the target read data is the target read data returned by the storage device in response to the data read request received by the terminal device, and the first command status packet data is generated by the terminal device after the target read data is successfully sent.
[0222] The third sending module is used to send the target read data to the virtual machine.
[0223] The transceiver module may include:
[0224] A first sending module is configured to send a first success instruction to the virtual machine after receiving a first command block packet request sent by the virtual machine; and
[0225] The first receiving module is configured to receive a data read request returned by the virtual machine in response to the first successful instruction.
[0226] The first receiving module may be specifically configured to:
[0227] receiving a plurality of sub-data read requests returned by the virtual machine in response to the first successful instruction; and
[0228] The multiple sub-data read requests are merged into a data read request.
[0229] After receiving the target read data sent by the terminal device, the second receiving module can also be used to:
[0230] Receive first command status packet data sent by the terminal device, wherein the first command status packet data is generated by the terminal device after the target read data is successfully sent.
[0231] After the third sending module sends the target read data to the virtual machine, the apparatus may further include:
[0232] A third receiving module is configured to receive a first command status packet request sent by the virtual machine, wherein the first command status packet request is generated by the virtual machine according to target read data;
[0233] The fourth sending module is used to send the first command status packet data to the virtual machine.
[0234] The first sending module is configured to, after receiving the first command block packet request sent by the virtual machine and before sending the first success instruction to the virtual machine, further include an adjustment module configured to:
[0235] receiving an input / output size increase request sent by a user terminal through a system interface;
[0236] The maximum input / output size of a transfer request of the storage device is adjusted to a target size according to the input / output size increase request.
[0237] The second receiving module can be specifically used for:
[0238] Receiving multiple sub-target reading data sent by the terminal device;
[0239] Merge multiple sub-target read data into target read data.
[0240] The second receiving module may also be specifically configured to:
[0241] Receiving target read data in compressed mode sent by the terminal device;
[0242] Decompressing the target read data in the compressed mode to obtain the decompressed target read data;
[0243] Accordingly, the third sending module is specifically configured to:
[0244] Send the decompressed target read data to the virtual machine.
[0245] The above device also includes a processing module, which can be used to:
[0246] After receiving the second command block packet request sent by the virtual machine, sending a third success instruction to the virtual machine;
[0247] receiving a data write request returned by the virtual machine according to the third successful instruction;
[0248] receiving a data write request, and simultaneously sending a second command block packet request and the data write request to the terminal device, so that the terminal device sends the second command block packet request to the storage device after receiving the second command block packet request and the data write request, and sends the data write request to the storage device after receiving a third success instruction sent by the storage device in response to the second command block packet request;
[0249] receiving a second command status packet request sent by the terminal device, wherein the second command status packet request is generated by the terminal device after the data write request is successfully sent;
[0250] receiving second command status packet data sent by the virtual machine, wherein the second command status packet data is generated after the virtual machine completes transmitting the write data in the data write request;
[0251] Sending a second command status packet request to the virtual machine.
[0252] The embodiment of the present application also provides another redirected read / write processing device, which includes: a fourth receiving module, a fifth sending module, a sixth sending module, and a seventh sending module. The redirected read / write processing device here can be the above-mentioned terminal device itself, or a processing device or processor of the terminal device, or a chip or integrated circuit that implements the functions of the processor. It should be noted here that the division of the fourth receiving module, the fifth sending module, the sixth sending module, and the seventh sending module is only a division of logical functions. Physically, the two can be integrated or independent.
[0253] The fourth receiving module is configured to receive a first command block packet request and a data read request sent by the server, wherein the first command block packet request and the data read request are sent by the virtual machine to the server;
[0254] a fifth sending module, configured to send the first command block packet request to the storage device;
[0255] A sixth sending module, configured to send a data read request to the storage device after receiving a second success instruction returned by the storage device in response to the first command block packet request;
[0256] The seventh sending module is configured to send the target read data to the server after receiving the target read data returned by the storage device in response to the data read request, so that the server sends the target read data to the virtual machine.
[0257] After the seventh sending module is configured to send the target read data to the server after receiving the target read data returned by the storage device in response to the data read request, the method may further include:
[0258] The eighth sending module is used to send the first command status packet data to the server after the target read data is successfully sent, so that the server sends the first command status packet data to the virtual machine after receiving the first command status packet request sent by the virtual machine, wherein the first command status packet request is generated after the virtual machine receives the target read data.
[0259] The seventh sending module can be specifically used for:
[0260] After receiving the target read data returned by the storage device in response to the data read request, the size of the target read data is obtained; if the target read data is larger than a preset size threshold, the target read data is split and processed to obtain multiple sub-target read data; and the multiple sub-target read data are sent to the server respectively.
[0261] The seventh sending module may also be specifically used for:
[0262] After receiving the target read data returned by the storage device in response to the data read request, the target read data is compressed using a preset compression method to obtain the target read data in a compressed mode; and the target read data in the compressed mode is sent to the server.
[0263] Referring to FIG6 , there is shown a schematic structural diagram of a redirection processing operation device 600 suitable for implementing an embodiment of the present disclosure. The redirection processing operation device 600 may be a terminal device or a server. The terminal device and the server may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as fixed terminals such as digital TVs, desktop computers, etc. The redirection processing operation device shown in FIG6 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0264] As shown in FIG6 , the redirection processing operation device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the redirection processing operation device 600 are also stored in RAM 603. The processing device 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0265] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the redirection processing operation device 600 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 illustrates the redirection processing operation device 600 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may alternatively be implemented or have.
[0266] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0267] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0268] The computer-readable medium may be included in the redirection processing operation device; or it may exist independently without being assembled into the redirection processing operation device.
[0269] The computer-readable medium carries one or more programs. When the one or more programs are executed by the redirection processing operation device, the redirection processing operation device executes the method shown in the above embodiment.
[0270] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0271] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0272] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0273] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0274] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0275] The redirection processing operation device of the embodiment of the present application can be used to execute the technical solutions in the above-mentioned method embodiments of the present application. Its implementation principles and technical effects are similar and will not be repeated here.
[0276] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement any of the above-mentioned redirection processing operation methods.
[0277] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement any of the above-mentioned redirection processing operation methods.
[0278] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0279] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0280] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0281] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for redirecting processing operations, applied to a server, includes: Obtaining a first command block packet request sent by a virtual machine; Sending a first success instruction to the virtual machine in response to the first command block packet request; Obtaining a data processing request sent by the virtual machine in response to the first success instruction; And Sending the first command block packet request and the data processing request to a terminal device.
2. The method according to claim 1, wherein The sending the first command block packet request and the data processing request to the terminal device includes: Splitting the data processing request into multiple first data processing sub-requests; and Sending the first command block packet request and the multiple first data processing sub-requests to the terminal device respectively.
3. The method according to claim 1 or 2, wherein The data volumes of the multiple first data processing sub-requests are the same. Preferably, the data size is 64 kilobytes.
4. The method according to any one of claims 1 to 3, wherein The obtaining the data processing request sent by the virtual machine in response to the first success instruction includes: Respectively obtaining multiple second data processing sub-requests sent by the virtual machine in response to the first success instruction; and Obtaining the data processing request according to the multiple second data processing sub-requests.
5. The method according to any one of claims 1 to 4, wherein Before obtaining the data processing request sent by the virtual machine in response to the first success instruction, the method further includes: Setting the maximum data volume corresponding to the data processing request as a target data volume. Preferably, the target data volume is 1 megabyte.
6. The method according to claim 5, wherein, The setting the maximum data volume corresponding to the data processing request as the target data volume includes: Obtaining an increase request for the maximum data volume corresponding to the data processing request from a system interface; and Setting the maximum data volume corresponding to the data processing request as the target data volume according to the increase request.
7. The method according to any one of claims 1 to 6, wherein The method further includes: Receiving target processing data sent by the terminal device, where the target processing data is processing data received by the terminal device from a storage device in response to the data processing request, and the storage device is connected to the terminal device; and Sending the target processing data to the virtual machine.
8. The method according to claim 7, wherein, After receiving the target processing data sent by the terminal device, the method further includes: Receiving first command status packet data sent by the terminal device, where the first command status packet data is obtained by the terminal device from the storage device.
9. The method according to claim 8, wherein After sending the target processing data to the virtual machine, the method further includes: Receiving a first command status packet request sent by the virtual machine, where the first command status packet request is generated by the virtual machine according to the target processing data; and Responding to the first command status packet request from the virtual machine, and sending the first command status packet data to the virtual machine.
10. The method according to any one of claims 7 to 9, wherein, The receiving the target processing data sent by the terminal device includes: Receiving multiple sub-target processing data sent by the terminal device respectively; and Obtaining the target processing data according to the multiple sub-target processing data.
11. The method according to any one of claims 7 to 10, wherein, The receiving the target processing data sent by the terminal device includes: Receive the compressed target processing data sent by the terminal device, where the compressed target processing data is obtained by the terminal device compressing the target processing data in a compression mode before sending; and Decompress the compressed target processing data in the compression mode to obtain the decompressed target processing data; and The sending the target processing data to the virtual machine includes: Send the decompressed target processing data to the virtual machine.
12. The method according to any one of claims 1 to 11, wherein, The data processing request is one of a data read request and a data write request.
13. The method according to any one of claims 1 to 12, wherein, The type of the physical device of the server is the same as the type of the physical device of the terminal device.
14. A method for a redirection processing operation, applied to a terminal device, includes: Receive a first command block packet request and a data processing request sent by a server; Send the first command block packet request to a storage device, where the storage device is connected to the terminal device; After obtaining a second success instruction sent by the storage device in response to the first command block packet request, send the data processing request to the storage device; and After receiving the target processing data sent by the storage device in response to the data processing request, send the target processing data to the server, so that the server sends the target processing data to the virtual machine.
15. The method according to claim 14, wherein, After the sending the target processing data to the server after receiving the target processing data sent by the storage device in response to the data processing request, the method further includes: Send first command status packet data to the server, so that the server, in response to receiving a first command status packet request sent by the virtual machine, sends the first command status packet data to the virtual machine, where the first command status packet request is generated after the virtual machine receives the target processing data.
16. The method according to claim 14, wherein The sending the target processing data to the server after receiving the target processing data sent by the storage device in response to the data processing request includes: After receiving the target processing data sent by the storage device in response to the data processing request, obtain the data volume of the target processing data; If the data volume of the target processing data is greater than or equal to a preset threshold, split the target processing data to obtain a plurality of sub-target processing data; and Send the plurality of sub-target processing data to the server respectively.
17. The method according to claim 14, wherein, The sending the target processing data to the server after receiving the target processing data sent by the storage device in response to the data processing request includes: After receiving the target processing data sent by the storage device in response to the data processing request, compress the target processing data through a preset compression method to obtain the target processing data in a compression mode; and Send the target processing data in the compression mode to the server.
18. A device for a redirection processing operation, applied to a server, includes: A transceiver module, configured to obtain a first command block packet request sent by a virtual machine; Send a first success instruction to the virtual machine in response to the first command block packet request; And obtain a data processing request sent by the virtual machine in response to the first success instruction; And A sending module, configured to send the first command block packet request and the data processing request to a terminal device.
19. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; When the processor is configured to execute the computer-executable instructions stored in the memory, it implements the method for the redirection processing operation according to any one of claims 1 to 13, or the method for the redirection processing operation according to any one of claims 14 to 17.
20. A computer-readable storage medium, wherein, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the method for the redirection processing operation according to any one of claims 1 to 13, or the method for the redirection processing operation according to any one of claims 14 to 17.
Citation Information
Patent Citations
Information processing method and device
CN106407151A
Data center network transmission method based on deep reinforcement learning
CN113890854A
Redirection method and device of USB (Universal Serial Bus) equipment, computer equipment and medium
CN114237828A
Universal serial bus (USB) network transport methods and apparatus
US20100169071A1
System and method to redirect hardware secure USB storage devices in high latency VDI environments
US20170063832A1