Redirection read-write processing method and device, equipment and storage medium

The CBW protocol of USB BOT merges data transmission, which solves the problem of long and low redirected read and write processing of USB storage devices, and realizes efficient data transmission, which is suitable for all redirected read and write scenarios.

CN120335707APending Publication Date: 2025-07-18RUIJIE NETWORKS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410074289.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing USB storage device redirection reading and writing processing methods cannot be applied to all redirection reading and writing processing scenarios, resulting in problems such as long time and low reading and writing speed.

Method used

Through the CBW protocol of USB BOT, the actual data content is merged into a single transmission, and efficient data transmission is achieved between the terminal device and the storage device, including merging data read requests and status packet requests, reducing network transmission losses and accelerating the actual data transmission rate of the storage device.

Benefits of technology

It improves the processing efficiency of redirected read and write of USB storage devices, reduces processing time, and improves read and write rate, and is suitable for all redirected read and write processing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335707A_ABST
    Figure CN120335707A_ABST
Patent Text Reader

Abstract

The invention provides a redirection read-write processing method and device, equipment and a storage medium. The method comprises the following steps: receiving a first command packet request and a data reading request sent by a virtual machine; sending the first command block packaging request and the data reading request to the terminal equipment; receiving target read data sent by the terminal equipment, wherein the target read data is the target read data returned by the storage equipment in response to the data read request and received by the terminal equipment; the target read data is sent to the virtual machine, multiple times of network transmission of the actual data content are combined into single transmission to reduce network transmission loss, the actual data transmission rate of the storage device is increased, the method can be applied to all redirection read-write processing scenes, the processing time of redirection read-write of the USB storage device is shortened, and the user experience is improved. And the read-write rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a redirected read and write processing method, device, equipment and storage medium. Background Art

[0002] As a portable data copy device, a large number of cloud desktop users use Universal Serial Bus (USB) storage devices such as mobile storage devices (USB flash disk, U disk) and mobile hard disks to perform data read, write and copy operations in the cloud desktop. Users read files from the storage device to the cloud desktop, or write files from the cloud desktop to the storage device. The USB storage device redirects the device to the cloud desktop through the USB redirection technology, but its read and write copy speed is far from the bandwidth limit or the storage device IO limit. It is necessary to optimize the read and write copy speed of the USB redirection storage device.

[0003] In the related art, the read and write 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 U disk to the terminal, and 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 taken for the device to appear the drive letter and then to the disk is shorter. The second way is to use the network file system sharing method, such as through the information service block (Server Messages Block, Samba, to mount the U disk 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.

[0004] However, the USB storage device redirection read and write processing methods 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 technical problems of long time consumption and low read and write rate. Summary of the invention

[0005] The present application provides a redirected read and write processing method, apparatus, device and storage medium, which are used to solve the problem that the USB storage device redirected read and write processing method in the related art cannot be applied to all redirected read and write processing scenarios, and the USB storage device redirected read and write still has technical problems such as long time consumption and low read and write rate.

[0006] In a first aspect, the present application provides a redirected read and write processing method, comprising:

[0007] Receive a first command packet request and a data read request sent by the virtual machine;

[0008] Send the first command block packet request and the data read request to the terminal device, so as to allow the terminal device to send the first command block packet request to the storage device, and after receiving the 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;

[0009] Receive the target read data sent by the terminal device, where 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;

[0010] Send the target read data to the virtual machine.

[0011] This application provides an efficient redirection read-write processing method. When a USB storage device is redirected to a virtual machine, after receiving a first command 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 to the terminal device through a single network transmission at the same time, so as to connect to the storage device with the help of the terminal device, thereby realizing the redirection read-write processing of the storage device in the virtual machine. The above method combines multiple network transmissions of actual data content into a single transmission through the protocol request instruction of the USB Bulk-Only Transport (BOT) protocol, that is, the Command Block Wrapper (CBW), to reduce network transmission loss and accelerate the actual data transmission rate of the storage device. This method can be applied to all redirection read-write processing scenarios, reducing the processing time of the USB storage device redirection read-write and improving the read-write rate.

[0012] Optionally, the receiving the first command packet request and the data read request sent by the virtual machine includes:

[0013] After receiving the first command block packet request sent by the virtual machine, send a first success instruction to the virtual machine; receive the data read request returned by the virtual machine in response to the first success instruction.

[0014] Here, the server in the embodiment of this 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 realizing that after waiting for the successful reception of the data read request, the data read request and the first command block packet request are sent to the terminal device through a single network transmission at the same time, reducing the number of data transmissions and improving the read-write efficiency.

[0015] Optionally, the receiving the data read request returned by the virtual machine in response to the first success instruction includes:

[0016] Receiving a plurality of sub-data reading requests returned by the virtual machine in response to the first success instruction;

[0017] Merging the plurality of sub-data reading requests into a data reading request.

[0018] Here, embodiments of the present application can merge a plurality of sub-data reading requests sent by a virtual machine, and after merging them into a data reading request, uniformly send them to a terminal device, combining the original multiple network transmissions of the plurality of sub-data requests into a single transmission, further reducing the number of data transmissions and improving the reading and writing efficiency.

[0019] Optionally, after receiving the target reading data sent by the terminal device, it further includes:

[0020] Receiving a first command status packet request sent by the terminal device, where the first command status packet request is generated by the terminal device after the target reading data is successfully sent.

[0021] Optionally, after sending the target reading data to the virtual machine, it further includes:

[0022] Receiving first command status packet data sent by the virtual machine, where the first command status packet data is generated by the virtual machine according to the target reading data;

[0023] Sending the first command status packet request to the virtual machine.

[0024] Among them, the terminal device of the embodiments of the present application actively sends a command status wrapper (CSW) request to the server after the target reading data is successfully sent, directly returning the CSW request to the server to reply to the CSW data of the virtual machine, reducing the transmission process and further improving the transmission efficiency.

[0025] Optionally, before sending a first success instruction to the virtual machine after receiving a first command block packet request sent by the virtual machine, it further includes:

[0026] Receiving an input / output size increase request sent by a user terminal through a system interface; adjusting the maximum input / output size of the transmission request of the storage device to a target size according to the input / output size increase request.

[0027] Among them, in the present application, when the server processes the redirect read and write, it supports modifying the maximum input / output (IO) size of the transmission request. The user can, with the help of the user terminal, 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 rate of redirect read and write and reducing the redirect read and write processing time.

[0028] Optionally, the receiving the target read data sent by the terminal device includes:

[0029] Receiving multiple sub-target read data sent by the terminal device; combining the multiple sub-target read data into target read data.

[0030] Here, the server in the present application can receive multiple sub-target read data after being split and processed by the terminal device, and combine the multiple sub-target read data into target read data. After the target read data is split, it can be transmitted in parallel, improving the data transmission rate.

[0031] Optionally, the receiving the target read data sent by the terminal device includes: receiving the target read data in compressed mode sent by the terminal device;

[0032] Performing decompression processing on the target read data in compressed mode to obtain the decompressed target read data;

[0033] Correspondingly, the sending the target read data to the virtual machine includes: sending the decompressed target read data to the virtual machine.

[0034] Here, the server in the present application can receive multiple sub-target read data after being split and processed by the terminal device, and combine the multiple sub-target read data into target read data. After the target read data is split, it can be transmitted in parallel, improving the data transmission rate.

[0035] Optionally, the above method further includes:

[0036] After receiving the second command block packet request sent by the virtual machine, sending a third success instruction to the virtual machine;

[0037] Receiving the data write request returned by the virtual machine according to the third success instruction;

[0038] Receive the data writing request, and send the second command block packet request and the data writing request to the terminal device simultaneously, so that after receiving the second command block packet request and the data writing request, the terminal device sends the second command block packet request to the storage device, and after receiving the third success instruction sent by the storage device in response to the second command block packet request, sends the data writing request to the storage device;

[0039] Receive the second command status packet request sent by the terminal device, where the second command status packet request is generated by the terminal device after the data writing request is successfully sent;

[0040] Receive the second command status packet data sent by the virtual machine, where the second command status packet data is generated after the virtual machine transmits the writing data in the data writing request;

[0041] Send the second command status packet request to the virtual machine.

[0042] Here, 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, accelerate the actual data transmission of the storage device, and improve the efficiency of redirected data writing.

[0043] In a second aspect, the present application provides a redirected read-write processing method applied to a terminal device, and the method includes:

[0044] Receive the first command block packet request and the data reading request sent by the server, where the first command block packet request and the data reading request are sent by the virtual machine to the server;

[0045] Send the first command block packet request to the storage device;

[0046] After receiving the second success instruction returned by the storage device in response to the first command block packet request, send the data reading request to the storage device;

[0047] After receiving the target reading data returned by the storage device in response to the data reading request, send the target reading data to the server, so that the server sends the target reading data to the virtual machine.

[0048] Optionally, after sending the target reading data to the server after receiving the target reading data returned by the storage device in response to the data reading request, it further includes:

[0049] After the successful sending of the target read data, send a first command status packet request to the server, so that after the server receives the first command status packet data sent by the virtual machine, the server sends the first command status packet request to the virtual machine, where the first command status packet data is generated after the virtual machine receives the target read data.

[0050] Here, the present application provides an efficient data redirection read-write processing method applied to a terminal device. The terminal device can receive a first command block packet request and a data read request sent by the server at the same time. By using the protocol request instruction of USB BOT, i.e., CBW, the actual data content of multiple network transmissions is merged into a single transmission to reduce network transmission loss and accelerate the actual data transmission rate of the storage device. Further, 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 down and then sending the CSW data, reducing the transmission time. This method can be applied to all redirection read-write processing scenarios, reducing the processing time of USB storage device redirection read-write and improving the read-write rate.

[0051] Optionally, 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:

[0052] After receiving the target read data returned by the storage device in response to the data read request, obtain the size of the target read data; if the target read data is greater than a preset size threshold, perform a splitting process on the target read data to obtain a plurality of sub-target read data; respectively send the plurality of sub-target read data to the server.

[0053] Here, when the terminal device transmits the target read data to the server, the present application can perform a splitting process on the target read data to obtain a plurality of sub-target read data, split the large IO USB request into small IO respectively, improve the concurrency of IO and network, and further improve the data redirection read-write processing efficiency.

[0054] Optionally, 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:

[0055] After receiving the target read data returned by the storage device in response to the data read request, perform a compression process on the target read data through a preset compression method to obtain the target read data in the compressed mode; send the target read data in the compressed mode to the server.

[0056] Here, when the terminal device transmits target read data to the server, the present application can perform compression processing on the target read data, and the data transmission time after compression processing is accelerated, further improving the data redirection read and write processing efficiency.

[0057] In a third aspect, the present application provides a redirection read and write processing device, which is applied to the server, and the device includes:

[0058] A transceiver module, configured to receive a first command packet request and a data read request sent by a virtual machine;

[0059] A second sending module, configured to send the first command block packet request and the data read request to the terminal device, so as to allow the terminal device to send the first command block packet request to the 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;

[0060] A second receiving module, configured to receive target read data sent by the terminal device, where the target read data is the target read data received by the terminal device in response to the data read request returned by the storage device;

[0061] A third sending module, configured to send the target read data to the virtual machine.

[0062] Optionally, the transceiver module includes a first sending module and a first receiving module;

[0063] The 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;

[0064] The first receiving module is configured to receive a data read request returned by the virtual machine in response to the first success instruction.

[0065] Optionally, the first receiving module is specifically configured to:

[0066] Receive a plurality of sub-data read requests returned by the virtual machine in response to the first success instruction;

[0067] Merge the plurality of sub-data read requests into a data read request.

[0068] Optionally, after receiving the target read data sent by the terminal device, the second receiving module is further configured to:

[0069] Receive a first command status packet request sent by the terminal device, where the first command status packet request is generated by the terminal device after the target read data is successfully sent.

[0070] Optionally, after the third sending module sends the target read data to the virtual machine, the apparatus further includes:

[0071] A third receiving module, configured to receive first command status packet data sent by the virtual machine, where the first command status packet data is generated by the virtual machine according to the target read data;

[0072] A fourth sending module, configured to send the first command status packet request to the virtual machine.

[0073] Optionally, before the first sending module sends a first success instruction to the virtual machine after receiving a first command block packet request sent by the virtual machine, the apparatus further includes an adjustment module, configured to:

[0074] Receive an input / output size increase request sent by a user terminal through a system interface;

[0075] Adjust the maximum input / output size of a transmission request of a storage device to a target size according to the input / output size increase request.

[0076] Optionally, the second receiving module is specifically configured to:

[0077] Receive multiple sub-target read data sent by the terminal device;

[0078] Merge the multiple sub-target read data into target read data.

[0079] Optionally, the second receiving module is further specifically configured to:

[0080] Receive target read data in a compression mode sent by the terminal device;

[0081] Decompress the target read data in the compression mode to obtain decompressed target read data;

[0082] Correspondingly, the third sending module is specifically configured to:

[0083] Send the decompressed target read data to the virtual machine.

[0084] Optionally, the apparatus further includes a processing module, configured to:

[0085] After receiving a second command block packet request sent by the virtual machine, send a third success instruction to the virtual machine;

[0086] Receive a data write request returned by the virtual machine according to the third success instruction;

[0087] Receive the data writing request, and send the second command block packet request and the data writing request to the terminal device simultaneously, so that after receiving the second command block packet request and the data writing request, the terminal device sends the second command block packet request to the storage device, and after receiving the third success instruction sent by the storage device in response to the second command block packet request, sends the data writing request to the storage device;

[0088] Receive the second command status packet request sent by the terminal device, where the second command status packet request is generated by the terminal device after the data writing request is successfully sent;

[0089] Receive the second command status packet data sent by the virtual machine, where the second command status packet data is generated after the virtual machine transmits the writing data in the data writing request;

[0090] Send the second command status packet request to the virtual machine.

[0091] In a fourth aspect, the present application provides a redirected read / write processing device, which is applied to a terminal device. The device includes:

[0092] A fourth receiving module, configured to receive a first command block packet request and a data reading request sent by a server, where the first command block packet request and the data reading request are sent by a virtual machine to the server;

[0093] A fifth sending module, configured to send the first command block packet request to a storage device;

[0094] A sixth sending module, configured to send the data reading 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;

[0095] A seventh sending module, configured to send the target reading data to the server after receiving the target reading data returned by the storage device in response to the data reading request, so that the server sends the target reading data to the virtual machine.

[0096] Optionally, after the seventh sending module is configured to send the target reading data to the server after receiving the target reading data returned by the storage device in response to the data reading request, it further includes:

[0097] An eighth sending module, configured to send a first command status packet request to the server after the target read data is successfully sent, so that the server sends the first command status packet request to the virtual machine after receiving the first command status packet data sent by the virtual machine, where the first command status packet data is generated after the virtual machine receives the target read data.

[0098] Optionally, the seventh sending module is specifically configured to:

[0099] After receiving the target read data returned by the storage device in response to the data read request, obtain the size of the target read data; if the target read data is greater than a preset size threshold, perform splitting processing on the target read data to obtain a plurality of sub-target read data; and respectively send the plurality of sub-target read data to the server.

[0100] Optionally, the seventh sending module is further specifically configured to:

[0101] After receiving the target read data returned by the storage device in response to the data read request, perform compression processing on the target read data through a preset compression method to obtain the target read data in a compressed mode; and send the target read data in the compressed mode to the server.

[0102] In a fifth aspect, the present application provides a redirected read-write processing device, including: one or more processors and a memory;

[0103] The memory stores computer execution instructions;

[0104] The one or more processors execute the computer execution instructions stored in the memory, so that the one or more processors execute the redirected read-write processing method described in the first aspect and various possible designs of the first aspect above.

[0105] In a sixth aspect, the present invention provides a computer-readable storage medium, in which computer execution instructions are stored, and when a processor executes the computer execution instructions, the redirected read-write processing method described in the first aspect and various possible designs of the first aspect above is implemented.

[0106] In a seventh aspect, the present invention provides a computer program product, including a computer program, and when the computer program is executed by a processor, the redirected read-write processing method described in the first aspect and various possible designs of the first aspect above is implemented.

[0107] In an eighth aspect, the present application provides a redirected read-write processing device, including: one or more processors and a memory;

[0108] The memory stores computer-executable instructions;

[0109] The one or more processors execute the computer-executable instructions stored in the memory, so that the one or more processors execute the redirected read / write processing method as described in the second aspect above and various possible designs of the second aspect.

[0110] In a ninth aspect, the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the redirected read / write processing method as described in the second aspect above and various possible designs of the second aspect is implemented.

[0111] In a tenth aspect, the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the redirected read / write processing method as described in the second aspect above and various possible designs of the second aspect is implemented.

[0112] This application provides an efficient redirected read / write processing method. When a USB storage device is redirected to a virtual machine, after receiving a first command packet request and a data read request sent by the virtual machine, the server simultaneously sends the data read request and the first command block packet request to a terminal device through a single network transmission, so as to connect to the storage device with the help of the terminal device, thereby realizing the redirected read / write processing of the storage device in the virtual machine. The above method combines multiple network transmissions of actual data content into a single transmission through the protocol request instruction of USB BOT, that is, CBW, to reduce network transmission loss and accelerate the actual data transmission rate of the storage device. This method can be applied to all redirected read / write processing scenarios, reducing the processing time of redirected read / write of the USB storage device and improving the read / write rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] The accompanying drawings here are incorporated into the specification and form a part of the specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application.

[0114] Figure 1 It is a schematic diagram of a redirected read / write processing system architecture provided by an embodiment of this application;

[0115] Figure 2 It is a schematic flowchart of a redirected read / write processing method provided by an embodiment of this application;

[0116] Figure 3 It is a schematic flowchart of another redirected read / write processing method provided by an embodiment of this application;

[0117] Figure 4 It is a schematic flowchart of yet another redirected read / write processing method provided by an embodiment of this application;

[0118] Figure 5 This is a schematic structural diagram of a redirect read / write processing device provided by an embodiment of the present application;

[0119] Figure 6 This is a schematic structural diagram of a redirect read / write processing device provided by an embodiment of the present application.

[0120] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed implementation manners

[0121] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0122] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and above-mentioned drawings of the present application are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0123] USB storage devices such as USB flash drives and external hard drives are portable data copying devices. A large number of cloud desktop users use these devices to perform data reading, writing, and copying operations within the cloud desktop. Users read files from the storage device into the cloud desktop or write files from the cloud desktop to the storage device. The USB storage device redirects the device to the cloud desktop through USB redirection technology. However, its read / write and copy speed far from reaches the bandwidth limit or the storage device's IO limit. It is necessary to optimize the read / write and copy speed of the USB redirected storage device to enhance the user experience and improve the competitiveness of the cloud desktop. After the USB storage device is connected to the terminal, the redirection component obtains the device's data through the redirection driver, sends the data to the virtual USB device on the server side via network transmission, and finally exposes it to the storage device driver within the virtual cloud desktop through the virtual controller, enabling it to be used within the cloud desktop. Currently, the read / write and copy speed of the USB redirected storage device can be optimized through the following two methods. The first method is to use the ISCSI protocol. Mount the inserted USB flash drive to the terminal and share it with the cloud desktop via the iSCSI protocol. The cloud desktop uses the disk through the kernel iSCSI client driver, resulting in a shorter time from when the device appears with a drive letter to when it becomes a disk. The second method is to use the network file system sharing method. For example, mount the USB flash drive to the terminal via Samba and share it with the cloud desktop virtual machine through the file system sharing method to improve the recognition speed and copy speed.

[0124] The process of a redirection read / write processing method in the related art is as follows:

[0125] The VM system issues a URB (USB Request Block) IO request for reading the 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 redirect client through the redirection protocol and issues the CBW request to the terminal device, Device; after Device receives the URB IO of the CBW, it returns an IO reception success to the redirection module, waits for data retrieval, and finally returns the successful IO response to the VM system through the redirection protocol via the redirection module; after the VM system receives the success of the CBW IO, it issues a URB IO request for reading data to the virtual device through the USB Bulk IN endpoint to read the data. The system default read request size is generally 64KB; the virtual device forwards the request to the redirection protocol module, and the redirection module issues it to the client and finally sends it to Device; the Device side returns the data to the redirection module after receiving the read data IO. Finally, it is returned to the VM system through the redirection protocol, and the IO data reception is completed; the VM side issues a URB IO through the USB Bulk IN endpoint to obtain the CSW request for the status of the device after processing the read request from the simulation device and finally forwards it to Device through the redirection protocol; Device returns the processing status result response CSW (Command Block in the storage device protocol) of the final read request and finally returns it to the VM through the redirection protocol, and the read request process is completed.

[0126] However, the redirection read and write processing methods of related USB storage devices cannot be applied to all redirection read and write processing scenarios, and there are still technical problems such as long processing time and low read and write rate in the redirection read and write of USB storage devices.

[0127] To solve the above problems, the embodiments of the present application provide a redirection read and write processing method, device, equipment and storage medium. This method combines multiple network transmissions of actual data content into a single transmission through the CBW of USB BOT to reduce network transmission loss and accelerate the actual data transmission rate of the storage device. Further, after the target read data is successfully sent, the terminal device actively sends a CSW request to the server, directly returns the CSW request to the server to reply to the CSW data of the virtual machine, reducing the transmission process. This method can be applied to all redirection read and write processing scenarios, reducing the processing time of the redirection read and write of USB storage devices and improving the read and write rate.

[0128] Optionally, Figure 1 The following is a schematic diagram of the redirection read and write processing system architecture provided by the embodiments of the present application. As Figure 1 shown, the redirection read and write processing system of the embodiments of the present application mainly includes a terminal device and a server. Among them, the terminal device can be connected to the storage device to achieve communication, and the server can interact with the virtual machine.

[0129] The following briefly introduces the structure in Figure 1 :

[0130] I. Module functions of the server:

[0131] Server: As the carrier of the virtual machine, it is responsible for running the virtual machine. For scenarios where virtual machines such as Intelligent Desktop Virtualization (IDV) run locally on the physical machine, the server and the physical machine represent the same module at this time.

[0132] Virtual Machine VM: Refers to a computer system simulated by software.

[0133] Virtual USB bus device: Refers to a USB bus device simulated by software, used to mount the redirected USB device.

[0134] Virtual USB device: Refers to a USB device simulated by software, used for the VM system driver to identify and use the device.

[0135] Redirect protocol parsing module: Parses and processes the data received from the client redirect module, and processes the data of the request received from the virtual VM to the virtual USB device, including protocol processing of USB devices such as storage devices and camera devices.

[0136] Protocol server: Encapsulates different types of protocol data (display, audio, etc.), conducts network communication with terminal devices (clients), and performs basic protocol operations such as encrypted transmission.

[0137] II. Module functions of the terminal device:

[0138] Terminal device: Responsible for running the protocol client and connecting to real storage devices, such as USB physical device carriers.

[0139] Protocol client: Responsible for connecting to the remote virtual machine, displaying the desktop and providing interaction, transmission and encapsulation of redirected data, etc.

[0140] Redirect module: Responsible for controlling USB redirect devices.

[0141] Redirect protocol parsing module: Parses and processes the data received from the server redirect module, sends the request to the device interaction module, and processes the data received from the device interaction module, including protocol processing of USB devices such as storage devices and camera devices.

[0142] Device interaction module: Interacts with the underlying USB redirect driver, sends requests from the parsing module to the device and obtains device data.

[0143] Device redirection driver: a general USB redirection driver that directly interacts with devices.

[0144] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the architecture of the redirection read / write processing system. In other feasible embodiments of the present application, the above architecture may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements, which can be specifically determined according to the actual application scenario and will not be limited herein. Figure 1 The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0145] It should be understood that each of the above server and terminal device may include its own processing device, and the processing device can be implemented by a processor reading instructions in a memory and executing the instructions, or can be implemented by a chip circuit.

[0146] In addition, the network architecture and service scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of the network architecture and the emergence of new service scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0147] The following uses specific embodiments to elaborate in detail on the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems. These several 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 with reference to the accompanying drawings.

[0148] Optionally, Figure 2 is a flowchart of a redirection read / write processing method provided by an embodiment of the present application. The execution subject of the embodiment of the present application can be Figure 1 the server in, and the specific execution subject can be determined according to the actual application scenario. As Figure 2 shown, the method includes the following steps:

[0149] S201: Receive a first command packet request and a data read request sent by the virtual machine.

[0150] Optionally, the receiving the first command packet request and the data read request sent by the virtual machine includes:

[0151] After receiving the first command block packet request sent by the virtual machine, send a first success instruction to the virtual machine; receive the data read request returned by the virtual machine in response to the first success instruction.

[0152] Among them, the first success instruction is generated by the server when it determines that it 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.

[0153] Optionally, receiving the data read request returned by the virtual machine in response to the first success instruction includes:

[0154] Receiving multiple sub-data read requests returned by the virtual machine in response to the first success instruction; merging the multiple sub-data read requests into a data read request.

[0155] Here, the embodiment of the present application can merge multiple sub-data read requests sent by the virtual machine. After merging into a data read request, it is uniformly sent to the terminal device, combining the original multiple network transmissions of the multiple sub-data requests into a single transmission, further reducing the number of data transmissions and improving the read / write efficiency.

[0156] Optionally, the sub-data read request here is data within 64KB, and the data volume of the data read request only needs to be less than or equal to 1MB, expanding the transmission size of the data read request and reducing the number of transmissions.

[0157] In some embodiments, the server can integrate data requests. After receiving multiple sub-data requests sent by the virtual machine, for the multiple sub-data requests, it performs a merging process to obtain an integrated data request and sends it to the terminal device through a single network transmission.

[0158] Among them, the above data request can be a data read request, a data write request, or any other data request, and the embodiment of the present application does not make specific limitations on this.

[0159] Here, 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 to receive the data read request returned by the virtual machine in response to the first success instruction, so as to realize that after waiting for the successful reception of the data read request, the data read request and the first command block packet request are sent to the terminal device through a single network transmission at the same time, reducing the number of data transmissions and improving the read / write efficiency.

[0160] Optionally, before sending the first success instruction to the virtual machine after receiving the first command block packet request sent by the virtual machine, it further includes:

[0161] Receiving an input / output size increase request sent by the user terminal through the system interface; adjusting the maximum input / output size of the transmission request of the storage device to the target size according to the input / output size increase request.

[0162] Among them, in the embodiment of the present application, the server supports modifying the maximum input-output (IO) size of the transmission request during the process of handling redirection read and write. The user can, by means of the user terminal, 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, thereby further improving the rate of redirection read and write and reducing the redirection read and write processing time.

[0163] In a possible implementation, the maximum USB storage device IO instruction request of the system is increased to x MB to reduce the number of network transmissions and IO interactions. Here, x can be any positive number, such as 1, 2, 3, etc. The size of x can be determined according to the actual situation, and the embodiment of the present application does not make specific limitations in this regard.

[0164] S202: Send the first command block packet request and the data read request to the terminal device, so as to allow the terminal device to send the first command block packet request to the storage device, and after receiving the 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.

[0165] Among them, after receiving the command block packet request CBW and the data read / write request Request, the server of the embodiment of the present application sends CBW and Request to the terminal device together, and requests the instruction CBW through the USB BOT protocol to merge multiple network transmissions of the actual data content into a single transmission to reduce network transmission loss and accelerate the actual data transmission of the storage device.

[0166] S203: Receive the target read data sent by the terminal device.

[0167] Optionally, after receiving the target read data sent by the terminal device, the first command status packet request sent by the terminal device is also received.

[0168] Among them, 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 request is generated by the terminal device after the target read data is successfully sent.

[0169] Optionally, receiving the target read data sent by the terminal device includes:

[0170] Receiving multiple sub-target read data sent by the terminal device; merging the multiple sub-target read data into the target read data.

[0171] Here, the server in the embodiments of the present application can receive multiple sub-target read data after being split and processed by a receiving terminal device, and merge the multiple sub-target read data into target read data. After the target read data is split, it can be transmitted in parallel, improving the data transmission rate.

[0172] Optionally, receiving the target read data sent by the receiving terminal device includes: receiving the target read data in a compressed mode sent by the receiving terminal device; decompressing the target read data in the compressed mode to obtain the decompressed target read data; correspondingly, sending the target read data to the virtual machine includes: sending the decompressed target read data to the virtual machine.

[0173] Here, the server in the embodiments of the present application can receive multiple sub-target read data after being split and processed by a receiving terminal device, and merge the multiple sub-target read data into target read data. After the target read data is split, it can be transmitted in parallel, improving the data transmission rate.

[0174] S204: Send the target read data to the virtual machine.

[0175] Optionally, after sending the target read data to the virtual machine, it further includes:

[0176] Receiving the first command status packet data sent by the virtual machine; sending the first command status packet request to the virtual machine.

[0177] Among them, the first command status packet data is generated by the virtual machine according to the target read data.

[0178] Among them, after the target read data is successfully sent by the terminal device in the embodiments of the present application, the terminal device actively sends a CSW request to the server, and directly returns the CSW request to the server to reply to the CSW data of the virtual machine, reducing the transmission process and further improving the transmission efficiency.

[0179] The embodiments of the present application provide an efficient redirection read and write processing method. When a USB storage device is redirected to a virtual machine, after the server receives the first command packet request and data read request sent by the virtual machine, the data read request and the first command block packet request are sent to the terminal device through a single network transmission at the same time, so as to connect to the storage device with the help of the terminal device, thereby realizing the redirection read and write processing of the storage device in the virtual machine. The above method combines multiple network transmissions of actual data content into a single transmission through the protocol request instruction, i.e., CBW, of USB BOT to reduce network transmission loss and accelerate the actual data transmission rate of the storage device. This method can be applied to all redirection read and write processing scenarios, reducing the processing time of redirection read and write of the USB storage device and improving the read and write rate.

[0180] Optionally, the above method further includes:

[0181] After receiving the second command block packet request sent by the virtual machine, send a third success instruction to the virtual machine; receive the 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 after receiving the second command block packet request and the data write request, the terminal device sends the second command block packet request to the storage device, and after receiving the third success instruction sent by the storage device in response to the second command block packet request, sends the data write request to the storage device; receive the second command status packet request sent by the terminal device, where the second command status packet request is generated by the terminal device after the data write request is successfully sent; receive the second command status packet data sent by the virtual machine, where the second command status packet data is generated after the virtual machine transfers the write data in the data write request; send the second command status packet request to the virtual machine.

[0182] Optionally, the data write request and the write data can be losslessly compressed or split before data transmission, which further improves the data processing efficiency.

[0183] Here, the 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 the actual data transmission of the storage device, and improve the efficiency of redirected data writing.

[0184] Optionally, Figure 3 is a schematic flowchart of another redirected read / write processing method provided by the embodiment of the present application. The execution subject of the embodiment of the present application can be Figure 1 the terminal device in, and the specific execution subject can be determined according to the actual application scenario. As Figure 3 shown, the method includes the following steps:

[0185] S301: Receive the first command block packet request and the data read request sent by the server.

[0186] Among them, the first command block packet request and the data read request are sent by the virtual machine to the server.

[0187] Among them, the first command block packet request is sent by the virtual machine to the server.

[0188] Among them, the data read request is returned by the virtual machine after the server sends a first success instruction to the virtual machine after receiving the first command block packet request sent by the virtual machine.

[0189] The first command block packet request and the data reading request are sent by the server to the terminal device simultaneously through one network transmission.

[0190] S302: Send the first command block packet request to the storage device.

[0191] S303: After receiving the second success instruction returned by the storage device in response to the first command block packet request, send the data reading request to the storage device.

[0192] S304: After receiving the target read data returned by the storage device in response to the data reading request, send the target read data to the server so that the server can send the target read data to the virtual machine.

[0193] Optionally, after receiving the target read data returned by the storage device in response to the data reading request, sending the target read data to the server includes:

[0194] After receiving the target read data returned by the storage device in response to the data reading request, obtain the size of the target read data; if the target read data is greater than the preset size threshold, perform splitting processing on the target read data to obtain multiple sub-target read data; send the multiple sub-target read data to the server respectively.

[0195] It can be understood that the preset size threshold here can be determined according to the actual situation, and the embodiments of the present application do not make specific limitations on this.

[0196] Here, in the embodiments of the present application, when the terminal device transmits the target read data to the server, the target read data can be split, so as to obtain multiple sub-target read data, split the large-IO USB request into small-IOs respectively, improve the concurrency of IO and network, and further improve the data redirection read and write processing efficiency.

[0197] Optionally, after receiving the target read data returned by the storage device in response to the data reading request, sending the target read data to the server includes:

[0198] After receiving the target read data returned by the storage device in response to the data reading request, perform compression processing on the target read data through a preset compression method to obtain the target read data in the compressed mode; send the target read data in the compressed mode to the server.

[0199] Optionally, the target read data can be compressed through lossless compression methods such as lz4 and lzw encoding.

[0200] Here, when the terminal device transmits the target read data to the server in the embodiment of the present application, the target read data can be compressed, and the data transmission time after compression is accelerated, further improving the data redirection read / write processing efficiency.

[0201] Optionally, after step S304, the following steps are further included:

[0202] After the target read data is successfully sent, send a first command status packet request to the server, so that after the server receives the first command status packet data sent by the virtual machine, it sends the first command status packet request to the virtual machine.

[0203] Wherein, the first command status packet data is generated after the virtual machine receives the target read data.

[0204] Here, the embodiment of the present application provides an efficient data redirection read / write processing method applied to a terminal device. The terminal device can receive the first command block packet request and the data read request sent by the server at the same time. By using the protocol request instruction of USBBOT, that is, CBW, multiple network transmissions of the actual data content are combined into a single transmission to reduce network transmission loss and accelerate the actual data transmission rate of the storage device. Further, 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 reply to the CSW data of the virtual machine, without waiting to send the CSW data after the CSW data of the virtual machine is sent down, reducing the transmission time. This method can be applied to all redirection read / write processing scenarios, reducing the processing time of USB storage device redirection read / write and improving the read / write rate.

[0205] Optionally, Figure 4 is a flowchart of another redirection read / write processing method provided by the embodiment of the present application. The execution subject of the embodiment of the present application can be Figure 1 the redirection read / write processing system in, and the specific execution subject can be determined according to the actual application scenario. As Figure 4 shown, the method includes the following steps:

[0206] S401: The virtual machine sends a first command block packet request to the server.

[0207] S402: The server sends a first success instruction to the virtual machine.

[0208] S403: The server receives the data read request returned by the virtual machine in response to the first success instruction.

[0209] S404: The server sends the first command block packet request and the data read request to the terminal device.

[0210] S405: The terminal device sends a first command block packet request to the storage device.

[0211] S406: The terminal device receives a second success instruction returned by the storage device in response to the first command block packet request.

[0212] S407: The terminal device sends a data read request to the storage device.

[0213] S408: The terminal device receives the target read data returned by the storage device in response to the data read request.

[0214] S409: The server receives the target read data sent by the terminal device and receives a first command status packet request sent by the terminal device.

[0215] Wherein, the first command status packet request is generated by the terminal device after the target read data is successfully sent.

[0216] Optionally, the target read data and the first command status packet request can be transmitted separately or simultaneously.

[0217] S4010: The server sends the target read data to the virtual machine.

[0218] S4011: The server receives the first command status packet data sent by the virtual machine.

[0219] Wherein, the first command status packet data is generated by the virtual machine according to the target read data.

[0220] S4012: The server sends the first command status packet request to the virtual machine.

[0221] In a possible implementation manner, based on Figure 1 , the read optimization implementation manner of the storage device is as follows:

[0222] 5.1. Increase the maximum IO size of the storage device transmission request to 1MB through the system interface.

[0223] 5.2. After the server receives the CBW request sent by the virtual machine, it directly replies with IO success, waits for the virtual machine to send data, and then sends CBW and DATA Read Request (1MB) to the terminal device through the network.

[0224] Optionally, the DATA Read Request here is a data request directly sent by the virtual machine to the server, or is obtained after the server merges multiple data requests sent by the virtual machine.

[0225] Wherein, the request is any request not limited to read and write requests.

[0226] 5.3. After receiving the server CBW and DATA ReadRequest through a single network transmission, the terminal protocol redirection component first issues a CBW request. After the CBW request's IO is successful, it issues the received Data Read Requst request.

[0227] 5.4. The terminal protocol redirection component disassembles a single large IO of Data Read Requst (1MB) into multiple small IOs (64K) and issues them. After each small IO is successful, it directly sends them to the server in a lossless compression manner through the network, and also supports directly sending 1MB of large data in a lossless compression manner.

[0228] 5.5. After waiting to receive the complete data, the server returns it to the VM virtual machine to achieve concurrency of IO and network transmission.

[0229] 5.6. After the terminal device's Read and DATA IO are completely completed, it actively constructs and issues a CSW request to obtain the read status of the DataRead Requst and sends it to the server.

[0230] 5.7. After receiving the CSW request from the VM, the server directly replies with the CSW data returned by the terminal device to complete the data read process.

[0231] In a possible implementation, based on Figure 1 , the implementation method of storage device write optimization is as follows:

[0232] 6.1. Increase the maximum size of the storage device transmission request to 1MB through the system interface.

[0233] 6.2. After receiving the CBW request sent by the virtual machine through the server, the server directly replies that the IO is successful, waits for the virtual machine to send data, and then issues the CBW and DATA Write Request (1MB) data to the terminal device through the network respectively.

[0234] Optionally, the DATA Write Request here is a data request directly sent by the virtual machine to the server, or is obtained after the server merges multiple data requests sent by the virtual machine to the server.

[0235] Among them, the request is any request not limited to read and write requests.

[0236] 6.3. The server protocol redirection component disassembles a single large IO of Data Write Requst (1MB) into multiple small IOs (64K) and issues them separately. Each small IO is sent to the client in a lossless compression manner through the network, and also supports directly sending 1MB of large data in a lossless compression manner to the client.

[0237] 6.4. The terminal protocol redirection component receives the CBW from the server through a single network transmission, first sends the CBW request to the device, and then sends the received small IO request of Data Write Requst to the device after the CBW request IO is successful.

[0238] 6.5. The client continuously receives small IOs and sends them to the terminal device, realizing the concurrency of client IO and server network data transmission.

[0239] 6.6. After the client Write and DATA IO are completely completed, actively construct and send a CSW request to obtain the read status of DataWrite Requst and send it to the server.

[0240] 6.7. After receiving the CSW data from the VM, the server directly replies to the CSW request returned by the terminal device to complete the data write process.

[0241] Optionally, for the read / write requests or other storage device request instructions of the server in the embodiments of the present application, the CBW and Request can be integrated on the server in the above manner and then sent to the terminal device. After receiving the merged request, the terminal device first sends the CBW request to the storage device. After the terminal device receives the complete reply of the storage device to the CBW, it sends the request Request. After the terminal device receives the message indicating that the Request is completed, it replies to the server. The server directly returns to the virtual machine. The terminal device sends the constructed CSW request to the storage device. After the terminal device receives the reply to the CSW request, it directly returns the CSW to the server to reply to the CSW request of the VM.

[0242] The embodiments of the present application further provide a structural schematic diagram of a redirection read / write processing device, as Figure 5 shown. The device in the embodiments 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. Here, the redirection read / write processing device may be the server itself, or a processing device or processor of the server, or a chip or integrated circuit that implements the functions 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 logical function division. Physically, the two may be integrated or independent.

[0243] Among them, the transceiver module is used to receive the first command packet request and data read request sent by the virtual machine;

[0244] A second sending module, configured to send a first command block packet request and a data reading 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 reading request to the storage device;

[0245] A second receiving module, configured to receive target reading data sent by the terminal device, and receive a first command status packet request sent by the terminal device, where the target reading data is the target reading data returned by the storage device in response to the data reading request received by the terminal device, and the first command status packet request is generated by the terminal device after the target reading data is successfully sent;

[0246] A third sending module, configured to send the target reading data to a virtual machine.

[0247] Optionally, the transceiver module includes:

[0248] A first sending module, configured to send a first success instruction to the virtual machine after receiving a first command block packet request sent by the virtual machine;

[0249] A first receiving module, configured to receive a data reading request returned by the virtual machine in response to the first success instruction.

[0250] Optionally, the first receiving module is specifically configured to:

[0251] Receive multiple sub-data reading requests returned by the virtual machine in response to the first success instruction;

[0252] Merge the multiple sub-data reading requests into a data reading request.

[0253] Optionally, after the second receiving module receives the target reading data sent by the terminal device, it is further configured to:

[0254] Receive a first command status packet request sent by the terminal device, where the first command status packet request is generated by the terminal device after the target reading data is successfully sent.

[0255] Optionally, after the third sending module sends the target reading data to the virtual machine, the above device further includes:

[0256] A third receiving module, configured to receive first command status packet data sent by the virtual machine, where the first command status packet data is generated by the virtual machine according to the target reading data;

[0257] A fourth sending module, configured to send the first command status packet request to the virtual machine.

[0258] Optionally, before the first sending module sends a first success instruction to the virtual machine after receiving a first command block packet request sent by the virtual machine, the above device further includes an adjustment module, configured to:

[0259] Receive an input / output size increase request sent by the user terminal through the system interface;

[0260] Adjust the maximum input / output size of the transfer request of the storage device to a target size according to the input / output size increase request.

[0261] Optionally, the second receiving module is specifically configured to:

[0262] Receive multiple sub-target read data sent by the terminal device;

[0263] Merge the multiple sub-target read data into target read data.

[0264] Optionally, the second receiving module is further specifically configured to:

[0265] Receive target read data in a compression mode sent by the terminal device;

[0266] Decompress the target read data in the compression mode to obtain decompressed target read data;

[0267] Correspondingly, the third sending module is specifically configured to:

[0268] Send the decompressed target read data to the virtual machine.

[0269] Optionally, the above device further includes a processing module, configured to:

[0270] After receiving a second command block packet request sent by the virtual machine, send a third success instruction to the virtual machine;

[0271] Receive a data write request returned by the virtual machine according to the third success instruction;

[0272] 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 after receiving the second command block packet request and the data write request, the terminal device sends the second command block packet request to the storage device, and after receiving a third success instruction sent by the storage device in response to the second command block packet request, sends the data write request to the storage device;

[0273] Receive a second command status packet request sent by the terminal device, where the second command status packet request is generated by the terminal device after the data write request is successfully sent;

[0274] Receive the second command status packet data sent by the virtual machine, where the second command status packet data is generated after the virtual machine transmits the write data in the data write request;

[0275] Send the second command status packet request to the virtual machine.

[0276] The embodiment of the present application further provides another redirect read-write processing device. The device of the embodiment of the present application includes: a fourth receiving module, a fifth sending module, a sixth sending module, and a seventh sending module. Here, the redirect read-write processing device may be the terminal device itself, or a processing device or a processor of the terminal device, or a chip or an 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 logical function division, and physically, the two may be integrated or independent.

[0277] Among them, the fourth receiving module is used to receive the first command block packet request and the data read request sent by the server, where the first command block packet request and the data read request are sent by the virtual machine to the server;

[0278] The fifth sending module is used to send the first command block packet request to the storage device;

[0279] The sixth sending module is used to send the data read request to the storage device after receiving the second success instruction returned by the storage device in response to the first command block packet request;

[0280] The seventh sending module is used 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.

[0281] Optionally, after the seventh sending module is used 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, it further includes:

[0282] The eighth sending module is used to send a first command status packet request to the server after the target read data is successfully sent, so that the server sends the first command status packet request to the virtual machine after receiving the first command status packet data sent by the virtual machine, where the first command status packet data is generated after the virtual machine receives the target read data.

[0283] Optionally, the seventh sending module is specifically used for:

[0284] After receiving the target read data returned by the storage device in response to the data read request, obtain the size of the target read data; if the target read data is greater than a preset size threshold, split the target read data to obtain multiple sub-target read data; send the multiple sub-target read data to the server respectively.

[0285] Optionally, the seventh sending module is further specifically configured to:

[0286] After receiving the target read data returned by the storage device in response to the data read request, compress the target read data by a preset compression method to obtain the target read data in the compressed mode; send the target read data in the compressed mode to the server.

[0287] Reference Figure 6 FIG. shows a schematic structural diagram of a redirect read / write processing device 600 suitable for implementing the embodiments of the present disclosure. The redirect read / write processing device 600 may be a terminal device or a server. Among them, the terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable media players (PMPs), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs and desktop computers. Figure 6 The shown redirect read / write processing device is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present disclosure.

[0288] As Figure 6 shown, the redirect read / write processing device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to the program stored in the read only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the redirect read / write processing device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.

[0289] Typically, the following devices can be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, 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 can allow the redirecting read / write processing device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 6 the redirecting read / write processing device 600 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices can be alternatively implemented or had.

[0290] Specifically, 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 that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through 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 functions defined in the method of the embodiment of the present disclosure are executed.

[0291] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can 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 can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit 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 can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0292] The above-mentioned computer-readable medium can be included in the above-mentioned redirected read-write processing device; or it can exist separately and not be assembled into the redirected read-write processing device.

[0293] The above-mentioned computer-readable medium carries one or more programs, and when the one or more programs are executed by the redirected read-write processing device, the redirected read-write processing device is caused to execute the method shown in the above-mentioned embodiments.

[0294] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed 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 the case of 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., through the Internet using an Internet service provider).

[0295] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0296] The units involved in the embodiments described in the present disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".

[0297] The functions described above in this document may be performed at least in part by one or more hardware logic components. For example, by way of non-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 a chip (SOCs), complex programmable logic devices (CPLDs), and so on.

[0298] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0299] The redirect read / write processing device according to an embodiment of the present application can be used to execute the technical solutions in the foregoing method embodiments of the present application. The implementation principles and technical effects are similar and will not be described herein again.

[0300] An embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the redirect read / write processing method in any one of the foregoing.

[0301] An embodiment of the present application further provides a computer program product including a computer program that, when executed by a processor, is used to implement the redirect read / write processing method in any one of the foregoing.

[0302] In several embodiments provided in the present application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other may be through some interfaces, and the indirect couplings or communication connections of devices or units may be in electrical, mechanical, or other forms.

[0303] In addition, in each embodiment of the present application, the functional units may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.

[0304] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of 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 known common general knowledge or conventional technical means in the technical field not disclosed herein. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0305] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A redirect read-write processing method, characterized in that, Applied to the server side, the method includes: Receiving a first command packet request and a data reading request sent by a virtual machine; Sending the first command block packet request and the data reading 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, sending the data reading request to the storage device; Receiving target reading data sent by the terminal device, wherein the target reading data is the target reading data received by the terminal device from the storage device in response to the data reading request; Sending the target reading data to the virtual machine.

2. The method according to claim 1, wherein The receiving a first command packet request and a data reading request sent by a virtual machine includes: After receiving the first command block packet request sent by the virtual machine, sending a first success instruction to the virtual machine; Receiving a data reading request returned by the virtual machine in response to the first success instruction.

3. The method according to claim 2, wherein The receiving a data reading request returned by the virtual machine in response to the first success instruction includes: Receiving multiple sub-data reading requests returned by the virtual machine in response to the first success instruction; Merging the multiple sub-data reading requests into a data reading request.

4. The method according to claim 2, wherein After receiving the target reading data sent by the terminal device, it further includes: Receiving a first command status packet request sent by the terminal device, wherein the first command status packet request is generated by the terminal device after the target reading data is successfully sent.

5. The method according to claim 4, characterized in that, After sending the target reading data to the virtual machine, it further includes: Receiving a first command status packet data sent by the virtual machine, wherein the first command status packet data is generated by the virtual machine according to the target reading data; Sending the first command status packet request to the virtual machine.

6. The method according to any one of claims 1 to 5, characterized in that, Before sending a first success instruction to the virtual machine after receiving the first command block packet request sent by the virtual machine, it further includes: Receiving an input / output size increase request sent by a user terminal through a system interface; Adjusting the maximum input / output size of the transmission request of the storage device to a target size according to the input / output size increase request.

7. The method according to claim 6, characterized in that, The receiving target reading data sent by the terminal device includes: Receiving multiple sub-target reading data sent by the terminal device; Merging the multiple sub-target reading data into target reading data.

8. The method according to claim 7, wherein The receiving target reading data sent by the terminal device includes: Receiving target reading data in a compression mode sent by the terminal device; Performing decompression processing on the target reading data in the compression mode to obtain decompressed target reading data; Correspondingly, the sending the target reading data to the virtual machine includes: Sending the decompressed target reading data to the virtual machine.

9. The method according to claim 8, wherein It further 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 writing request returned by the virtual machine according to the third success instruction; Receive the data writing request, and simultaneously send the second command block packet request and the data writing request to the terminal device, so that after receiving the second command block packet request and the data writing request, the terminal device sends the second command block packet request to the storage device, and after receiving the third success instruction sent by the storage device in response to the second command block packet request, sends the data writing request to the storage device; Receive the second command status packet request sent by the terminal device, where the second command status packet request is generated by the terminal device after the data writing request is successfully sent; Receive the second command status packet data sent by the virtual machine, where the second command status packet data is generated after the virtual machine transmits the writing data in the data writing request; Send the second command status packet request to the virtual machine.

10. A method for redirecting read and write processing, characterized in that, Applied to a terminal device, the method includes: Receive the first command block packet request and the data reading request sent by the server, where the first command block packet request and the data reading request are sent by the virtual machine to the server; Send the first command block packet request to the storage device; After receiving the second success instruction returned by the storage device in response to the first command block packet request, send the data reading request to the storage device; After receiving the target reading data returned by the storage device in response to the data reading request, send the target reading data to the server, so that the server sends the target reading data to the virtual machine.

11. The method according to claim 10, wherein After sending the target reading data to the server after receiving the target reading data returned by the storage device in response to the data reading request, it further includes: After the target reading data is successfully sent, send a first command status packet request to the server, so that after the server receives the first command status packet data sent by the virtual machine, it sends the first command status packet request to the virtual machine, where the first command status packet data is generated after the virtual machine receives the target reading data.

12. The method according to claim 11, wherein The step of sending the target reading data to the server after receiving the target reading data returned by the storage device in response to the data reading request includes: After receiving the target reading data returned by the storage device in response to the data reading request, obtain the size of the target reading data; If the target reading data is greater than a preset size threshold, perform splitting processing on the target reading data to obtain multiple sub-target reading data; Send the multiple sub-target reading data to the server respectively.

13. The method according to claim 11, wherein The step of sending the target reading data to the server after receiving the target reading data returned by the storage device in response to the data reading request includes: After receiving the target read data returned by the storage device in response to the data read request, perform compression processing on the target read data through a preset compression method to obtain the target read data in the compressed mode; Send the target read data in the compressed mode to the server.

14. An electronic device, comprising: A processor and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the redirected read / write processing method according to any one of claims 1 to 9, or the redirected read / write processing method according to any one of claims 10 to 13.

15. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the computer execution instructions are executed by a processor, they are used to implement the redirected read / write processing method according to any one of claims 1 to 6, or the redirected read / write processing method according to any one of claims 10 to 13.