Communication method, device and system and storage medium
By introducing a communication method between the terminal device and the cloud desktop virtual machine, and sending read or write request messages directly to the USB storage device, the problem of low efficiency in accessing USB storage devices in the cloud desktop virtual machine is solved, and more efficient data reading and writing operations are achieved.
Patent Information
- Application Number
- CN202410136022.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-11-21
- Filing Date
- 2024-01-30
- Publication Date
- 2025-05-23
AI Technical Summary
Cloud desktop virtual machines have low efficiency in accessing USB storage devices, resulting in low data reading and writing efficiency.
By introducing a communication method between the terminal device and the cloud desktop virtual machine, the terminal device receives the command block packet request message of the cloud desktop virtual machine, generates and sends a read or write request message to the USB storage device, avoiding waiting for the response of the cloud desktop virtual machine, and thus directly sends a request message to the USB storage device.
It improves the efficiency of reading data from USB storage devices and writing data to USB storage devices, and improves the overall efficiency of accessing USB storage devices in cloud desktop virtual machines.
Smart Images

Figure CN120029701A_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202311558325.7 filed on November 21, 2023, with invention name “A USB storage device acceleration method and device based on cloud desktop”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communications, and in particular to a communication method, device, system and storage medium. Background Art
[0003] The cloud desktop system includes a cloud service platform and terminal devices. The cloud service platform includes a cloud desktop virtual machine, which is a remote virtual machine. The interface of the cloud desktop virtual machine can be delivered to the terminal device for display through the remote desktop protocol. At the same time, the terminal device can also map the universal serial bus (USB) device connected to the terminal device to the cloud desktop virtual machine.
[0004] The USB device connected to the terminal device may include a USB storage device. Since the USB storage device is mapped on the cloud desktop virtual machine, the cloud desktop virtual machine has a need to access the USB storage device. For example, the cloud desktop virtual machine may need to save data to the USB storage device, or the cloud desktop virtual machine may need to read data saved in the USB storage device. However, in the related art, the efficiency of the cloud desktop virtual machine in reading the data saved in the USB storage device is low, and the efficiency of the cloud desktop virtual machine in saving data to the USB storage device is also low, that is, in the related art, the efficiency of the cloud desktop virtual machine in accessing the USB storage device is low. Summary of the invention
[0005] The present application provides a communication method, device, system and storage medium to improve the efficiency of cloud desktop virtual machine accessing USB storage devices. The technical solution is as follows:
[0006] In the first aspect, the present application provides a communication method, which is applied to a terminal device, wherein the terminal device is connected to a universal serial bus USB storage device, and the USB storage device stores first data to be read by a cloud desktop virtual machine. In the method, the terminal device receives a command block packet CBW request message sent by the cloud desktop virtual machine, and the CBW request message includes storage location information of the first data in the USB storage device. The terminal device sends the CBW request message to the USB storage device. The terminal device generates a first read request message, and the first read request message is used to indicate reading the first data. The terminal device sends a first read request message to the USB storage device. The terminal device receives a read reply message sent by the USB storage device, and the read reply message includes the first data read by the USB storage device based on the storage location information. The terminal device sends the read reply message to the cloud desktop virtual machine.
[0007] Since the terminal device generates a first read request message and sends the first read request message to the USB storage device after receiving the CBW request message, the terminal device can send a read request message to the USB storage device without waiting to send a CBW response message to the cloud desktop virtual machine and waiting to receive a read request message sent by the cloud desktop virtual machine, thereby improving the efficiency of reading data from the USB storage device, that is, improving the efficiency of the cloud desktop virtual machine accessing the USB storage device.
[0008] In a possible implementation, the terminal device receives a CBW reply message sent by the USB storage device, and the CBW reply message is used to instruct the USB storage device to obtain the storage location information. The terminal device generates a first read request message in response to the CBW reply message. Therefore, the terminal device can obtain the first read request message and send the first read request message to the USB storage device without waiting to send a CBW response message to the cloud desktop virtual machine and waiting to receive a read request message sent by the cloud desktop virtual machine, thereby improving the efficiency of reading data from the USB storage device.
[0009] In another possible implementation, the terminal device sends the CBW reply message to the cloud desktop virtual machine, so that the cloud desktop virtual machine can continue to complete the process of reading data from the USB storage device.
[0010] In another possible implementation, the terminal device generates a first command status packet CSW request message in response to the read reply message, and the first CSW request message is used to indicate the acquisition of the first state, and the first state is the state of the USB storage device after reading the first data. The terminal device sends the first CSW request message to the USB storage device. The terminal device receives the CSW reply message sent by the USB storage device, and the CSW reply message includes the first state. The terminal device sends the CSW reply message to the cloud desktop virtual machine. In this way, the terminal device can send the CSW request message to the USB storage device without waiting to send the read reply message to the cloud desktop virtual machine and waiting to receive the CSW request message, thereby improving the efficiency of acquiring the first state.
[0011] In the second aspect, the present application provides a communication method, which is applied to a universal serial bus USB server included in a cloud desktop virtual machine, and the cloud desktop virtual machine also includes a virtual USB bus driver module, and the virtual USB bus driver module needs to read the first data saved in a USB storage device, and the USB storage device is connected to a terminal device. In the method, the USB server receives a CBW request message sent by the virtual USB bus driver module, and the CBW request message includes the storage location information of the first data in the USB storage device. The USB server sends the CBW request message to the terminal device, and the CBW request message is used to trigger the terminal device to generate a first read request message and send the CBW request message and the first read request message to the USB storage device, and the first read request message is used to instruct the USB storage device to read the first data based on the storage location information. The USB server receives a read reply message sent by the terminal device, and the read reply message includes the first data. The USB server sends the read reply message to the virtual USB bus driver module.
[0012] Since the CBW request message sent by the USB server to the USB storage device is used to trigger the terminal device to generate a first read request message and send the CBW request message and the first read request message to the USB storage device, the terminal device can send a read request message to the USB storage device without waiting for sending a CBW response message to the cloud desktop virtual machine and waiting for receiving a read request message sent by the cloud desktop virtual machine, and send a read reply message including the first data to the USB server, thereby improving the efficiency of reading data from the USB storage device, that is, improving the efficiency of the cloud desktop virtual machine accessing the USB storage device.
[0013] In a possible implementation, the USB server receives a CBW reply message sent by the terminal device, and the CBW reply message is used to instruct the USB storage device to obtain the storage location information. The USB server sends the CBW reply message to the virtual USB bus driver module. The USB server receives a second read request message sent by the virtual USB bus driver module in response to the CBW reply message, and the second read request message is used to instruct to read the first data. The USB server sends the read reply message to the virtual USB bus driver module in response to the second read request message. In this way, after the virtual USB bus driver module issues a read request, the first data is sent to the virtual USB bus driver module, avoiding modification of the implementation logic of the virtual USB bus driver module.
[0014] In another possible implementation, the USB server receives a CSW reply message sent by the terminal device, and the CSW reply message includes a first state, and the first state is the state of the USB storage device after reading the first data. The USB server receives a second CSW request message sent by the virtual USB bus driver module in response to the read reply message, and the second CSW request message is used to indicate the state of the USB storage device after reading the first data. The USB server sends the CSW reply message to the virtual USB bus driver module in response to the second CSW request message. In this way, after the virtual USB bus driver module sends the CSW request, the CSW reply message is sent to the virtual USB bus driver module, avoiding modification of the implementation logic of the virtual USB bus driver module.
[0015] In a third aspect, the present application provides a communication method, which is applied to a universal serial bus USB server included in a cloud desktop virtual machine, and the cloud desktop virtual machine also includes a virtual USB bus driver module, and the virtual USB bus driver module includes first data to be written to a USB storage device. In the method, the USB server receives a command block packet CBW request message sent by the virtual USB bus driver module, and the CBW request message includes storage location information where the first data needs to be written to the USB storage device. The USB server sends the CBW request message to the USB storage device. In response to the CBW request message, the USB server generates a first CBW reply message, and the first CBW reply message is used to instruct the USB storage device to obtain the storage location information. The USB server sends a first CBW reply message to the virtual USB bus driver module. The USB server receives a write request message sent by the virtual USB bus driver module in response to the first CBW reply message, and the write request message includes the first data. The USB server sends a write request message to the USB storage device, and the write request message is used to instruct the USB storage device to save the first data based on the storage location information.
[0016] Since the USB server generates a first CBW reply message in response to the CBW request message and sends the first CBW reply message to the virtual USB bus driver module, the USB server does not need to wait for the CBW request message to be sent, and does not need to wait for the CBW reply message sent by the USB storage device to be received, and can reply to the virtual USB bus driver module to request the virtual USB bus driver module to send the first data to be written, thereby improving the efficiency of writing data to the USB storage device, that is, improving the efficiency of the cloud desktop virtual machine accessing the USB storage device.
[0017] In a possible implementation, the USB server generates a first write reply message in response to the write request message, and the first write reply message is used to indicate that the USB storage device successfully saves the first data. The USB server sends the first write reply message to the virtual USB bus driver module. Since the USB server generates the first write reply message in response to the write request message, the USB server can reply to the virtual USB bus driver module without waiting for the USB storage device to return the write reply message, thereby improving communication efficiency.
[0018] In another possible implementation, the USB server receives a command status packet CSW request message sent by the virtual USB bus driver module in response to the first write reply message, and the CSW request message is used to indicate the state of the USB storage device after saving the first data. In response to the CSW request message, the USB server generates a first CSW reply message, and the first CSW reply message includes a specified state, and the specified state indicates that the USB storage device is normal. The USB server sends the first CSW reply message to the virtual USB bus driver module. Since the USB server sends the CSW request message in response to the first write reply message, the USB server can reply to the virtual USB bus driver module without waiting for the USB storage device to return the CSW reply message, thereby improving communication efficiency.
[0019] In another possible implementation, the USB server sends the CSW request message to the USB storage device.
[0020] In another possible implementation, the USB server receives a second CBW reply message and a second write reply message sent by the USB storage device, the second CBW reply message is used to indicate whether the USB storage device obtains the storage location information, and the second write reply message is used to indicate whether the USB storage device successfully saves the first data. The USB server notifies the virtual USB bus driver module when the second CBW reply message indicates that the USB storage device has not obtained the storage location information or the second write reply message indicates that the USB storage device has not successfully saved the first data. In this way, when a failure occurs in writing data, the virtual USB bus driver module can be notified to abandon writing the first data or rewrite the first data.
[0021] In another possible implementation, the USB server receives a second CSW reply message sent by the USB storage device, the second CSW reply message includes a first state, and the first state is a state after the USB storage device saves the first data. When the first state is different from the specified state, the USB server notifies the virtual USB bus driver module. In this way, when a failure occurs in writing data, the virtual USB bus driver module can be notified to abandon writing the first data or rewrite the first data.
[0022] In a fourth aspect, the present application provides a communication device, configured to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the device includes a unit configured to execute the method in the first aspect or any possible implementation of the first aspect.
[0023] In a fifth aspect, the present application provides a communication device, configured to execute the method in the second aspect or any possible implementation of the second aspect. Specifically, the device includes a unit configured to execute the method in the second aspect or any possible implementation of the second aspect.
[0024] In a sixth aspect, the present application provides a communication device for executing the method in the third aspect or any possible implementation of the third aspect. Specifically, the device includes a unit for executing the method in the third aspect or any possible implementation of the third aspect.
[0025] In the seventh aspect, the present application provides a terminal device comprising at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the terminal device executes the method in the first aspect or any possible implementation of the first aspect.
[0026] In an eighth aspect, the present application provides a computing device cluster, wherein the computing device cluster includes at least one computing device, each device in the at least one computing device includes at least one processor and at least one memory, and computer-readable instructions are stored in the at least one memory; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method in the second aspect or any possible implementation of the second aspect.
[0027] In a ninth aspect, the present application provides a computing device cluster, the computing device cluster comprising at least one computing device, each device in the at least one computing device comprising at least one processor and at least one memory, the at least one memory storing computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method in the third aspect or any possible implementation of the third aspect.
[0028] In the tenth aspect, the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the method in the above-mentioned first aspect, second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.
[0029] In the eleventh aspect, the present application provides a computer-readable storage medium for storing a computer program, which is loaded by a processor to execute the method in the above-mentioned first aspect, second aspect, third aspect, any possible implementation of the first aspect, any possible implementation of the second aspect, or any possible implementation of the third aspect.
[0030] In the twelfth aspect, the present application provides a chip comprising a memory and a processor, the memory being used to store computer instructions, and the processor being used to call and run the computer instructions from the memory to execute the method in the above-mentioned first aspect, second aspect, third aspect, any possible implementation of the first aspect, any possible implementation of the second aspect, or any possible implementation of the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a structural diagram of a cloud desktop system provided in an embodiment of the present application;
[0032] Figure 2 It is a structural diagram of another cloud desktop system provided in an embodiment of the present application;
[0033] Figure 3 is a flow chart of a method for reading data provided by an embodiment of the present application;
[0034] Figure 4 This is a flow chart of a method for writing data provided by an embodiment of the present application;
[0035] Figure 5 It is a flow chart of a communication method provided by an embodiment of the present application;
[0036] Figure 6 is a flow chart of another communication method provided in an embodiment of the present application;
[0037] Figure 7 It is a schematic diagram of the structure of a communication device provided in an embodiment of the present application;
[0038] Figure 8 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application;
[0039] Fig. 9 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application;
[0040] Fig.10 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0041] Fig.11 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0042] Fig.12 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;
[0043] Fig.13 is a schematic diagram of the structure of another computing device provided in an embodiment of the present application;
[0044] Fig.14 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;
[0045] Fig.15 It is a structural diagram of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] See also Figure 1 , an embodiment of the present application provides a cloud desktop system 10, wherein the cloud desktop system 10 includes a cloud service platform 101, a terminal device 102 and a USB storage device 103.
[0047] The cloud service platform 101 communicates with the terminal device 102 , the terminal device 102 is connected to the USB storage device 103 , and a cloud desktop virtual machine runs in the cloud service platform 101 .
[0048] Optionally, the terminal device 102 includes a first USB interface, and the USB storage device 103 includes a second USB interface compatible with the first USB interface. The second USB interface of the USB storage device 103 is plugged into the first USB interface of the terminal device 102 to achieve connection between the terminal device 102 and the USB storage device 103.
[0049] The cloud service platform 101 includes a cloud desktop virtual machine. Optionally, the cloud desktop virtual machine can be a remote virtual desktop.
[0050] When the USB storage device 103 is connected to the terminal device 102, the cloud service platform 101 can map the USB storage device 103 to the cloud desktop virtual machine. The cloud service platform 101 can deliver the interface of the cloud desktop virtual machine to the terminal device 102 through the remote interface protocol, and the terminal device 102 can display the interface of the cloud desktop virtual machine.
[0051] In some embodiments, the cloud service platform 101 in the cloud desktop system 10 may be a data center that centralizes server resources and storage resources 100 .
[0052] The remote desktop protocol consists of a client and a server, and is divided into different service implementations according to different functions. For example, the USB / serial-parallel port service client and server interact to implement the mapping and redirection of various peripherals; the display service client and server interact to implement the interface of the remote cloud desktop virtual machine to the terminal display; the audio service client and server interact to implement two-way audio mapping; the multimedia service client and server interact to implement the playback and recording of multimedia services; the keyboard and mouse service client and server implement the mapping of the keyboard and mouse to the interface of the remote cloud desktop virtual machine.
[0053] In some embodiments, the cloud service platform 101 can access the USB storage device 103, that is, the cloud service platform 101 can read and write the USB storage device 103. In implementation, the cloud service platform 101 can read data stored in the USB storage device 103, and / or the cloud service platform 101 can write data to the USB storage device 103.
[0054] See also Figure 2 The cloud desktop virtual machine may include an application layer 1011, a virtual USB bus driver module 1012 and a USB server 1013, and the terminal device 102 includes a USB client 1021 and a virtual USB driver module 1022. The cloud desktop virtual machine included in the cloud service platform 101 can read and write the USB storage device 103 through the remote desktop protocol.
[0055] A path can be established between the cloud desktop virtual machine included in the cloud service platform 101 and the USB storage device 103. The path passes through the virtual USB bus driver module 1012 and the USB server 1013 located in the cloud service platform 101, and passes through the USB client 1021 and the virtual USB driver 1022 located in the terminal device 102, and then reaches the USB storage device 103.
[0056] See also Figure 3 , the cloud desktop virtual machine can read data from the USB storage device 103 through this path. The process of reading data can be:
[0057] 301: The virtual USB bus driver 1012 sends a command block wrapper (CBW) request message to the USB server 1013. The CBW request message includes storage location information of first data to be read in the USB storage device 103.
[0058] In some embodiments, the application layer 1011 may need to read the first data stored in the USB storage device 103. The application layer 1011 may input the storage location information of the first data in the USB storage device 103 to the virtual USB bus driver module 1012. The virtual USB bus driver module 1012 receives the storage location information of the first data and sends a CBW request message to the USB server 1013, where the CBW request message includes the storage location information of the first data.
[0059] In some embodiments, the storage location information of the first data may include the starting storage location of the first data in the USB storage device 103 and the data volume of the first data.
[0060] 302 : The USB server 1013 receives the CBW request message, and sends the CBW request message to the terminal device 102 .
[0061] 303 : The terminal device 102 receives the CBW request message, and sends the CBW request message to the USB storage device 103 .
[0062] In some embodiments, see Figure 3 The CBW request message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the USB client 1021 receives the CBW request message and sends the CBW request message to the virtual USB driver module 1022. The virtual USB driver module 1022 receives the CBW request message and sends the CBW request message to the USB storage device 103.
[0063] 304: The USB storage device 103 receives the CBW request message and sends a CBW reply message to the terminal device 102. The CBW reply message is used to indicate the storage location information of the first data obtained by the USB storage device 103.
[0064] In some embodiments, after receiving the CBW request message, the USB storage device 103 can obtain the storage location information of the first data from the CBW request message, and in response to the CBW request message, send the CBW reply message to the terminal device 102.
[0065] 305: The terminal device 102 receives the CBW reply message and sends the CBW reply message to the USB server 1013.
[0066] In some embodiments, refer to Figure 3 , the CBW reply message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the virtual USB driver module 1022 receives the CBW reply message and sends the CBW reply message to the USB client 1021. The USB client 1021 receives the CBW reply message and sends the CBW reply message to the USB server 1013.
[0067] 306: The USB server 1013 receives the CBW reply message and sends the CBW reply message to the virtual USB bus driver module 1022.
[0068] 307: The virtual USB bus driver module 1012 receives the CBW reply message and, in response to the CBW reply message, sends a read request message to the USB server 1013. The read request message is used to indicate reading the first data.
[0069] In some embodiments, the read request message may be an input packet (data for input, Data-in) request message.
[0070] When the virtual USB bus driver module 1012 receives the CBW reply message, it indicates that the CBW transaction process is completed, and then the Data-in process starts to be executed.
[0071] 308: The USB server 1013 receives the read request message and sends the read request message to the terminal device 102.
[0072] 309: The terminal device 102 receives the read request message and sends the read request message to the USB storage device 103.
[0073] In some embodiments, refer to Figure 3The read request message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the USB client 1021 receives the read request message and sends the read request message to the virtual USB driver module 1022. The virtual USB driver module 1022 receives the read request message and sends the read request message to the USB storage device 103.
[0074] 310: The USB storage device 103 receives the read request message, and sends a read reply message to the terminal device 102. The read reply message includes the first data read by the USB storage device 103 based on the storage location information of the first data.
[0075] In some embodiments, the USB storage device 103 receives the read request message, reads the first data based on the storage location information of the first data in response to the read request message, and sends a read reply message to the terminal device 102, where the read reply message includes the first data.
[0076] In some embodiments, if the amount of the first data is large, the USB storage device 103 may send multiple read response messages continuously, each of which includes a portion of the first data.
[0077] In some embodiments, the read reply message may be a Data-in reply message.
[0078] 311: The terminal device 102 receives the read reply message and sends the read reply message to the USB server 1013.
[0079] In some embodiments, see Figure 3 The read reply message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the virtual USB driver module 1022 receives the read reply message and sends the read reply message to the USB client 1021. The USB client 1021 receives the read reply message and sends the read reply message to the USB server 1013.
[0080] In some embodiments, if the USB storage device 103 sends multiple read reply messages, the multiple read reply messages are transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. In other words, the terminal device 102 receives the multiple read reply messages and sends the multiple read reply messages to the USB server 1013.
[0081] 312: The USB server 1013 receives the read reply message, and sends the read reply message to the virtual USB bus driver module 1022.
[0082] In some embodiments, if the USB server 1013 receives multiple read reply messages, the USB server 1013 sends the multiple read reply messages to the virtual USB bus driver module 1012 .
[0083] 313: The virtual USB bus driver module 1012 receives the read reply message, and in response to the read reply message, sends a command status wrapper (CSW) request message to the USB server 1013, where the CSW request message is used to indicate obtaining a first state, which is a state after the USB storage device 103 reads the first data.
[0084] In some embodiments, the virtual USB bus driver module 1012 reads the first data from the read reply message and sends the first data to the application layer 1011 .
[0085] In some embodiments, if the virtual USB bus driver module 1012 receives multiple read reply messages, the USB server 1013 reads partial data belonging to the first data from each read reply message, that is, reads multiple partial data belonging to the first data, combines the multiple partial data into first data, and sends the first data to the application layer 1011.
[0086] When the virtual USB bus driver module 1012 obtains the first data, it indicates that the data reading process is completed, and then the CSW transaction process begins to be executed.
[0087] 314 : The USB server 1013 receives the CSW request message, and sends the CSW request message to the terminal device 102 .
[0088] 315 : The terminal device 102 receives the CSW request message, and sends the CSW request message to the USB storage device 103 .
[0089] In some embodiments, see Figure 3 The CSW request message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the USB client 1021 receives the CSW request message and sends the CSW request message to the virtual USB driver module 1022. The virtual USB driver module 1022 receives the CSW request message and sends the CSW request message to the USB storage device 103.
[0090] 316: The USB storage device 103 receives the CSW request message, and sends a CSW reply message to the terminal device 102, where the CSW reply message includes the first status.
[0091] In some embodiments, after receiving the CSW request message, the USB storage device 103 obtains the current state, takes the current state as the first state, and sends the CSW reply message including the first state to the terminal device 102 in response to the CSW request message.
[0092] 317 : The terminal device 102 receives the CSW reply message, and sends the CSW reply message to the USB server 1013 .
[0093] In some embodiments, see Figure 3 The CSW reply message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the virtual USB driver module 1022 receives the CSW reply message and sends the CSW reply message to the USB client 1021. The USB client 1021 receives the CSW reply message and sends the CSW reply message to the USB server 1013.
[0094] 318 : The USB server 1013 receives the CSW reply message, and sends the CSW reply message to the virtual USB bus driver module 1022 .
[0095] The virtual USB bus driver module 1012 receives the CSW reply message, and ends when the first state included in the CSW reply message is a normal state.
[0096] When the virtual USB bus driver module 1012 receives the CSW reply message, it indicates that the CSW transaction process is completed.
[0097] In the above reading process, the virtual USB bus driver module 1012 needs to wait for receiving the CBW reply message before sending the read request message, and the CBW reply message requires a long network delay when transmitted on the network between the terminal device 102 and the cloud desktop virtual machine. Therefore, the virtual USB bus driver module 1012 needs to wait for a long time before sending the read request message, which reduces the efficiency of reading data from the USB storage device 103.
[0098] Before sending the CSW request message, the virtual USB bus driver module 1012 needs to wait for receiving a read reply message, and the read reply message requires a long network delay when transmitted on the network between the terminal device 102 and the cloud desktop virtual machine. Therefore, the virtual USB bus driver module 1012 needs to wait for a long time before sending the CSW request message, which reduces the efficiency of obtaining the status of the USB storage device 103.
[0099] See also Figure 4 , the cloud desktop virtual machine can write data to the USB storage device 103 through this path. The process of writing data can be:
[0100] 401 : the virtual USB bus driver 1012 sends a CBW request message to the USB server 1013 , where the CBW request message includes storage location information for writing the second data to be written into the USB storage device 103 .
[0101] In some embodiments, the application layer 1011 may include second data to be written into the USB storage device 103. The application layer 1011 may input the second data and the storage location information of the second data to the virtual USB bus driver module 1012. The virtual USB bus driver module 1012 receives the second data and the storage location information of the second data, and sends a CBW request message to the USB server 1013, where the CBW request message includes the storage location information of the second data.
[0102] In some embodiments, the storage location information of the second data may include the starting storage location of the second data in the USB storage device 103. Optionally, the storage location information of the second data may also include the data volume of the second data.
[0103] 402 : The USB server 1013 receives the CBW request message and sends the CBW request message to the terminal device 102 .
[0104] 403 : The terminal device 102 receives the CBW request message, and sends the CBW request message to the USB storage device 103 .
[0105] In some embodiments, see Figure 4 The CBW request message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the USB client 1021 receives the CBW request message and sends the CBW request message to the virtual USB driver module 1022. The virtual USB driver module 1022 receives the CBW request message and sends the CBW request message to the USB storage device 103.
[0106] 404: The USB storage device 103 receives the CBW request message and sends a CBW reply message to the terminal device 102. The CBW reply message is used to instruct the USB storage device 103 to obtain the storage location information of the second data.
[0107] In some embodiments, after receiving the CBW request message, the USB storage device 103 may obtain the storage location information of the second data from the CBW request message, and send the CBW reply message to the terminal device 102 in response to the CBW request message.
[0108] 405 : The terminal device 102 receives the CBW reply message, and sends the CBW reply message to the USB server 1013 .
[0109] In some embodiments, see Figure 4 The CBW reply message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the virtual USB driver module 1022 receives the CBW reply message and sends the CBW reply message to the USB client 1021. The USB client 1021 receives the CBW reply message and sends the CBW reply message to the USB server 1013.
[0110] 406 : The USB server 1013 receives the CBW reply message, and sends the CBW reply message to the virtual USB bus driver module 1022 .
[0111] 407: The virtual USB bus driver module 1012 receives the CBW reply message, and in response to the CBW reply message, sends a write request message to the USB server 1013, where the write request message includes the second data.
[0112] The write request message is used to instruct the USB storage device 103 to save the second data.
[0113] In some embodiments, when the amount of the second data is large, the virtual USB bus driver module 1012 continuously sends a plurality of write request messages to the USB server 1013, and each write request message includes a portion of the second data.
[0114] In some embodiments, the write request message may be an output packet (data for output, Data-out) request message.
[0115] When the virtual USB bus driver module 1012 receives the CBW reply message, it indicates that the CBW transaction process is completed, and then the Data-out process begins to be executed.
[0116] 408 : The USB server 1013 receives the write request message, and sends the write request message to the terminal device 102 .
[0117] In some embodiments, if the USB server 1013 receives multiple write request messages, the USB server 1013 sends the multiple write request messages to the terminal device 102 .
[0118] 409 : The terminal device 102 receives the write request message, and sends the write request message to the USB storage device 103 .
[0119] In some embodiments, see Figure 4The write request message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the USB client 1021 receives the write request message and sends the write request message to the virtual USB driver module 1022. The virtual USB driver module 1022 receives the write request message and sends the write request message to the USB storage device 103.
[0120] In some embodiments, if the USB server 1013 sends multiple write request messages, the multiple write request messages are transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. In other words, the terminal device 102 receives the multiple write request messages and sends the multiple write request messages to the USB storage device 103.
[0121] 410: The USB storage device 103 receives the write request message, and sends a write reply message to the terminal device 102, where the write reply message is used to indicate that the USB storage device 103 successfully saves the second data.
[0122] In some embodiments, the USB storage device 103 receives the write request message, reads the second data from the write request message, saves the second data based on the storage location information of the second data, and sends a write reply message to the terminal device 102 in response to the write request message.
[0123] In some embodiments, if the USB storage device 103 receives multiple write request messages, the USB storage device 103 reads partial data belonging to the second data from each write request message, that is, reads multiple partial data belonging to the second data, composes the multiple partial data into the second data, and saves the second data based on the storage location information of the second data.
[0124] In some embodiments, the write reply message may be a Data-out reply message.
[0125] 411: The terminal device 102 receives the write reply message and sends the write reply message to the USB server 1013.
[0126] In some embodiments, see Figure 4 The write reply message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the virtual USB driver module 1022 receives the write reply message and sends the write reply message to the USB client 1021. The USB client 1021 receives the write reply message and sends the write reply message to the USB server 1013.
[0127] 412 : The USB server 1013 receives the write reply message, and sends the write reply message to the virtual USB bus driver module 1022 .
[0128] In some embodiments, if the USB server 1013 receives multiple write reply messages, the USB server 1013 sends the multiple write reply messages to the virtual USB bus driver module 1012 .
[0129] 413: The virtual USB bus driver module 1012 receives the write reply message, and in response to the write reply message, sends a CSW request message to the USB server 1013, where the CSW request message is used to instruct to obtain the second state, where the second state is the state after the USB storage device 103 saves the second data.
[0130] When the virtual USB bus driver module 1012 receives the write reply message, it indicates that the data write process is completed, and then starts to execute the CSW transaction process.
[0131] 414 : The USB server 1013 receives the CSW request message, and sends the CSW request message to the terminal device 102 .
[0132] 415 : The terminal device 102 receives the CSW request message, and sends the CSW request message to the USB storage device 103 .
[0133] In some embodiments, see Figure 4 The CSW request message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the USB client 1021 receives the CSW request message and sends the CSW request message to the virtual USB driver module 1022. The virtual USB driver module 1022 receives the CSW request message and sends the CSW request message to the USB storage device 103.
[0134] 416: The USB storage device 103 receives the CSW request message, and sends a CSW reply message to the terminal device 102, where the CSW reply message includes the second status.
[0135] In some embodiments, after receiving the CSW request message, the USB storage device 103 obtains the current state, takes the current state as the second state, and sends the CSW reply message including the second state to the terminal device 102 in response to the CSW request message.
[0136] 417 : The terminal device 102 receives the CSW reply message, and sends the CSW reply message to the USB server 1013 .
[0137] In some embodiments, see Figure 4The CSW reply message is transparently transmitted on the USB client 1021 and the virtual USB driver module 1022 included in the terminal device 102. That is, the virtual USB driver module 1022 receives the CSW reply message and sends the CSW reply message to the USB client 1021. The USB client 1021 receives the CSW reply message and sends the CSW reply message to the USB server 1013.
[0138] 418 : The USB server 1013 receives the CSW reply message, and sends the CSW reply message to the virtual USB bus driver module 1022 .
[0139] Wherein: the virtual USB bus driver module 1012 receives the CSW reply message, and ends when the second state included in the CSW reply message is a normal state.
[0140] When the virtual USB bus driver module 1012 receives the CSW reply message, it indicates that the CSW transaction process is completed.
[0141] In the above writing process, the virtual USB bus driver module 1012 needs to wait for receiving the CBW reply message before sending the write request message, and the CBW reply message requires a long network delay when transmitted on the network between the terminal device 102 and the cloud desktop virtual machine. Therefore, the virtual USB bus driver module 1012 needs to wait for a long time before sending the write request message, which reduces the efficiency of writing data to the USB storage device 103.
[0142] Before sending the CSW request message, the virtual USB bus driver module 1012 needs to wait for receiving a write reply message, and the write reply message requires a long network delay when transmitted on the network between the terminal device 102 and the cloud desktop virtual machine. Therefore, the virtual USB bus driver module 1012 needs to wait for a long time before sending the CSW request message, which reduces the efficiency of obtaining the status of the USB storage device 103.
[0143] In summary, the efficiency of writing data and reading data is low, that is, the efficiency of the cloud desktop virtual machine accessing the USB storage device 103 is low. To this end, the efficiency of the cloud desktop virtual machine accessing the USB storage device 103 can be improved by any of the following embodiments.
[0144] See also Figure 5 The present application embodiment provides a communication method 500, the method 500 is applied to Figure 1 or Figure 2 The cloud desktop system 10 shown. The method 500 is used to read the first data stored in the USB storage device. The method 500 includes the following process.
[0145] Step 501: The virtual USB bus driver module sends a CBW request message to the USB server. The CBW request message includes storage location information of first data to be read in the USB storage device.
[0146] In some embodiments, the application layer may need to read the first data stored in the USB storage device. The application layer may input the storage location information of the first data in the USB storage device to the virtual USB bus driver module. The virtual USB bus driver module receives the storage location information of the first data and sends a CBW request message to the USB server, where the CBW request message includes the storage location information of the first data.
[0147] In some embodiments, the storage location information of the first data may include a starting storage location of the first data in the USB storage device and a data volume of the first data.
[0148] Step 502: The USB server receives the CBW request message and sends the CBW request message to the terminal device.
[0149] Step 503: The terminal device receives the CBW request message, and sends the CBW request message to the USB storage device.
[0150] In some embodiments, see Figure 5 The CBW request message is transparently transmitted on the USB client and the virtual USB driver module included in the terminal device. That is, the USB client receives the CBW request message and sends the CBW request message to the virtual USB driver module. The virtual USB driver module receives the CBW request message and sends the CBW request message to the USB storage device.
[0151] Step 504: The USB storage device receives the CBW request message and sends a CBW reply message to the terminal device. The CBW reply message is used to indicate that the USB storage device has obtained the storage location information.
[0152] In some embodiments, after receiving the CBW request message, the USB storage device may obtain the storage location information of the first data from the CBW request message, and send the CBW reply message to the terminal device in response to the CBW request message.
[0153] Step 505: The terminal device receives the CBW reply message, and generates a first read request message in response to the CBW reply message, where the first read request message is used to instruct to read the first data.
[0154] In some embodiments, after receiving the CBW request message, the terminal device may generate a first read request message and send the first read request message to the USB storage device, or after receiving the CBW reply message, send the first read request message to the USB storage device.
[0155] Since there is no need to wait for sending a CBW reply message and a read request message to the cloud desktop virtual machine, the first read request message can be sent to the USB storage device, thereby saving the network delay of transmitting the CBW reply message and the read request message on the network between the cloud desktop virtual machine and the terminal device, and improving the efficiency of reading data.
[0156] In some embodiments, the terminal device may also send the CBW reply message to the USB server.
[0157] In some embodiments, see Figure 5 The virtual USB driver module receives the CBW reply message and sends the CBW reply message to the USB client. The USB client receives the CBW reply message and generates a first read request message in response to the CBW reply message.
[0158] In some embodiments, the USB client sends the CBW reply message to the USB server. Alternatively, the USB client may not send the CBW reply message to the USB server, but temporarily cache the CBW reply message.
[0159] In some embodiments, the first read request message may be a Data-in request message.
[0160] Step 506: The terminal device sends a first read request message to the USB storage device.
[0161] In some embodiments, see Figure 5 The USB client sends a first read request message to the virtual USB driver module. The virtual USB driver module receives the first read request message and sends the first read request message to the USB storage device.
[0162] Step 507: The USB storage device receives the first read request message, and sends a read reply message to the terminal device. The read reply message includes the first data read by the USB storage device based on the storage location information of the first data.
[0163] In some embodiments, the USB storage device receives a first read request message, reads the first data based on the storage location information of the first data in response to the first read request message, and sends a read reply message to the terminal device, where the read reply message includes the first data.
[0164] In some embodiments, if the amount of the first data is large, the USB storage device may send multiple read response messages continuously, each read response message including a portion of the first data.
[0165] In some embodiments, the read reply message may be a Data-in reply message.
[0166] Step 508: The terminal device receives the read reply message, and generates a first CSW request message in response to the read reply message. The first CSW request message is used to indicate obtaining a first state, which is a state after the USB storage device reads the first data.
[0167] In some embodiments, the terminal device may also send the read reply message to the USB server.
[0168] Since there is no need to wait for sending a read reply message and a CSW request message to the cloud desktop virtual machine, the first CSW request message can be sent to the USB storage device, thereby saving the network delay of transmitting the read reply message and the CSW request message on the network between the cloud desktop virtual machine and the terminal device, and improving the efficiency of obtaining the first state.
[0169] In some embodiments, see Figure 5 The virtual USB driver module receives the read reply message and sends the read reply message to the USB client. The USB client receives the read reply message and generates a first CSW request message in response to the read reply message.
[0170] In some embodiments, the USB client sends the read reply message to the USB server. Alternatively, the USB client may not send the read reply message to the USB server, but temporarily cache the read reply message.
[0171] In some embodiments, if the USB storage device sends multiple read reply messages, the terminal device 102 receives the multiple read reply messages, and generates a first CSW request message after receiving the multiple read reply messages.
[0172] Step 509: The terminal device sends a first CSW request message to the USB storage device.
[0173] In some embodiments, see Figure 5 The USB client sends a first CSW request message to the virtual USB driver module. The virtual USB driver module receives the first CSW request message and sends the first CSW request message to the USB storage device.
[0174] Step 510: The USB storage device receives the first CSW request message, and sends a CSW reply message to the terminal device, where the CSW reply message includes a first status.
[0175] In some embodiments, after receiving the first CSW request message, the USB storage device obtains the current state, takes the current state as the first state, and sends the CSW reply message including the first state to the terminal device in response to the CSW request message.
[0176] Step 511: the terminal device receives the CSW reply message and sends a first message to the USB server, where the first message includes the CBW reply message, the read reply message and the CSW reply message.
[0177] In some embodiments, see Figure 5 The virtual USB driver module receives the CSW reply message and sends the CSW reply message to the USB client. The USB client receives the CBW reply message, obtains the temporarily cached CSW reply message and the read reply message, and sends a first message including the CBW reply message, the read reply message and the CSW reply message to the USB server.
[0178] In some embodiments, if the USB client has sent the CBW reply message and the read reply message to the USB server, the USB client sends the CSW reply message to the USB server upon receiving the CSW reply message.
[0179] Step 512: The USB server receives the first message and sends the CBW reply message to the virtual USB bus driver module.
[0180] In some embodiments, the USB server receives the first message, splits the first message, obtains the CBW reply message, the read reply message and the CSW reply message, and sends the CBW reply message to the virtual USB bus driver module.
[0181] In some embodiments, the USB server receives the CBW reply message, the read reply message and the CSW reply message successively, that is, the USB server may receive the CBW reply message, the read reply message and the CSW reply message at different times. When the USB server receives the CBW reply message, it sends the CBW reply message to the virtual USB bus driver module.
[0182] Step 513: The virtual USB bus driver module receives the CBW reply message, and in response to the CBW reply message, sends a second read request message to the USB server, where the second read request message is used to instruct to read the first data.
[0183] In some embodiments, the first read request message is a message generated by simulating the second read request message.
[0184] In some embodiments, the second read request message may be a Data-in request message.
[0185] Step 514: The USB server receives the second read request message and sends the read reply message to the virtual USB bus driver module.
[0186] In some embodiments, if the USB server splits the first message to obtain multiple read reply messages, the USB server sends the multiple read reply messages to the virtual USB bus driver module.
[0187] In some embodiments, if the USB server receives the CSW reply message, the read reply message and the CSW reply message at different times, after the USB server receives the second read request message, when the read reply message is received, the USB server sends the read reply message to the virtual USB bus driver module; or, when the multiple read reply messages are received, the multiple read reply messages are sent to the virtual USB bus driver module.
[0188] Step 515: The virtual USB bus driver module receives the read reply message, and in response to the read reply message, sends a second CSW request message to the USB server, where the second CSW request message is used to instruct to obtain the first state.
[0189] In some embodiments, the first CSW request message is a message generated by simulating the second CSW request message.
[0190] In some embodiments, the virtual USB bus driver module reads the first data from the read reply message and sends the first data to the application layer.
[0191] In some embodiments, if the virtual USB bus driver module receives multiple read reply messages, the USB server reads partial data belonging to the first data from each read reply message, that is, reads multiple partial data belonging to the first data, assembles the multiple partial data into first data, and sends the first data to the application layer.
[0192] Step 516: The USB server receives the second CSW request message and sends the CSW reply message to the virtual USB bus driver module.
[0193] In some embodiments, if the USB server splits the CSW reply message from the first message, the USB server sends the CSW reply message to the virtual USB bus driver module.
[0194] In some embodiments, if the USB server receives the CSW reply message, the read reply message and the CSW reply message at different times, after the USB server receives the second CSW request message, when it receives the CSW reply message, it sends the CSW reply message to the virtual USB bus driver module.
[0195] The virtual USB bus driver module receives the CSW reply message, and ends when the first state included in the CSW reply message is a normal state.
[0196] In an embodiment of the present application, when the terminal device receives the CBW reply message sent by the USB storage device in response to the CBW request message, it does not need to wait for receiving the read request message from the cloud desktop virtual machine, but simulates generating the first read request message and sends the first read request message to the USB storage device. The USB storage device reads the first data in response to the first read request message and sends a read reply message to the terminal device, and the read reply message includes the first data. In this way, the USB storage device does not need to wait for the network delay of the CBW reply message transmitted on the network between the terminal device and the cloud desktop virtual machine, and does not need to wait for the network delay of the read request message transmitted on the network. After receiving the CBW request message, the USB storage device can quickly read the saved first data and send the first data to the cloud desktop virtual machine, thereby improving the efficiency of the cloud desktop virtual machine reading data from the USB storage device. The terminal device also does not need to wait for receiving the CSW request message from the cloud desktop virtual machine, but simulates generating the first CSW request message and sending the first CSW request message to the USB storage device. The USB storage device obtains the first state in response to the first CSW request message and sends a CSW reply message to the terminal device, and the CSW reply message includes the first state. In this way, the USB storage device does not need to wait for the network delay of the read reply message being transmitted on the network between the terminal device and the cloud desktop virtual machine, and does not need to wait for the network time of the CSW request message being transmitted on the network. After reading the first data, the USB storage device can quickly obtain the first state and send the first state to the cloud desktop virtual machine, thereby improving the efficiency of the cloud desktop virtual machine in obtaining the state of the USB storage device.
[0197] See also Figure 6 , the present application embodiment provides a communication method 600, the method 600 is applied to Figure 1 or Figure 2 The cloud desktop system 10 shown. The method 600 is used to write the second data into the USB storage device. The method 600 includes the following process.
[0198] Step 601: The virtual USB bus driver module sends a CBW request message to the USB server, where the CBW request message includes storage location information of second data to be written in the USB storage device.
[0199] In some embodiments, the application layer may include second data to be written into the USB storage device. The application layer may input the second data and the storage location information of the second data to the virtual USB bus driver module. The virtual USB bus driver module receives the second data and the storage location information of the second data, and sends a CBW request message to the USB server, where the CBW request message includes the storage location information of the second data.
[0200] In some embodiments, the storage location information of the second data may include the starting storage location where the second data needs to be written in the USB storage device. Optionally, the storage location information of the second data may also include the data volume of the second data.
[0201] Step 602: The USB server receives the CBW request message and sends the CBW request message to the terminal device.
[0202] Step 603: The USB server generates a first CBW reply message in response to the CBW request message, where the first CBW reply message is used to indicate that the USB storage device has received the CBW request message.
[0203] Step 604: The USB server sends a first CBW reply message to the virtual USB bus driver module.
[0204] Step 605: The virtual USB bus driver module receives the first CBW reply message and sends a write request message to the USB server, where the write request message includes the second data.
[0205] Since there is no need to wait for the USB server to transmit the CBW request message to the terminal device, and for the terminal device to transmit the CBW reply message to the USB server, the USB server can send the first CBW reply message to the virtual USB bus driver module, and the virtual USB bus driver module receives the first CBW reply message and sends a write request message including the second data to the USB server. This saves the network delay of transmitting the CBW request message and the network delay of transmitting the CBW reply message on the network between the cloud desktop virtual machine and the terminal device, and improves the efficiency of writing data.
[0206] In some embodiments, when the amount of the second data is large, the virtual USB bus driver module sends a plurality of write request messages to the USB server, each write request message including a portion of the second data.
[0207] Step 606: The USB server receives the write request message and sends the write request message to the terminal device.
[0208] In some embodiments, the USB server may receive multiple write request messages and send the multiple write request messages to the terminal device.
[0209] Step 607: The USB server generates a first write reply message in response to the write request message, where the first write reply message is used to indicate that the second data is successfully saved to the USB storage device.
[0210] In some embodiments, after receiving multiple write request messages, the USB server generates a first write reply message in response to the multiple write request messages.
[0211] Step 608: The USB server sends a first write reply message to the virtual USB bus driver module.
[0212] Step 609: the virtual USB bus driver module receives the first write reply message, and sends a CSW request message to the USB server, where the CSW request message is used to instruct to obtain a second state, where the second state is a state after the USB storage device saves the second data.
[0213] Step 610: The USB server receives the CSW request message and sends the CSW request message to the terminal device.
[0214] Step 611: The USB server generates a first CSW reply message in response to the CSW request message, where the first CSW reply message includes a specified status, and the specified status indicates that the USB storage device is in a normal state.
[0215] Step 612: The USB server sends a first CSW reply message to the virtual USB bus driver module.
[0216] The virtual USB bus driver module receives the first CSW reply message and obtains the specified state from the first CSW reply message.
[0217] Step 613: The terminal device receives the CBW request message, and sends the CBW request message to the USB storage device.
[0218] Since there is no need to wait for the USB server to transmit the write request message to the terminal device, and the terminal device to transmit the write reply message to the USB server, the USB server can send the write reply message to the virtual USB bus driver module, the virtual USB bus driver module receives the write reply message, sends the CSW request message to the USB server, and the USB server sends the CSW reply message including the specified status to the virtual USB bus driver module. This saves the network delay of transmitting the write request message, the network delay of transmitting the write reply message, the network delay of transmitting the CSW request message, and the network delay of transmitting the CSW reply message on the network between the cloud desktop virtual machine and the terminal device, and improves the efficiency of obtaining the status of the USB storage device.
[0219] In some embodiments, see Figure 6 The CBW request message is transparently transmitted on the USB client and the virtual USB driver module included in the terminal device. That is, the USB client receives the CBW request message and sends the CBW request message to the virtual USB driver module. The virtual USB driver module receives the CBW request message and sends the CBW request message to the USB storage device.
[0220] Step 614: The terminal device receives the write request message and sends the write request message to the USB storage device.
[0221] In some embodiments, see Figure 6 The write request message is transparently transmitted on the USB client and the virtual USB driver module included in the terminal device. That is, the USB client receives the write request message and sends the write request message to the virtual USB driver module. The virtual USB driver module receives the write request message and sends the write request message to the USB storage device.
[0222] In some embodiments, the terminal device receives multiple write request messages and sends the multiple write request messages to the USB storage device.
[0223] Step 615: The terminal device receives the CSW request message, and sends the CSW request message to the USB storage device.
[0224] In some embodiments, see Figure 6 The CSW request message is transparently transmitted on the USB client and the virtual USB driver module included in the terminal device. That is, the USB client receives the CSW request message and sends the CSW request message to the virtual USB driver module. The virtual USB driver module receives the CSW request message and sends the CSW request message to the USB storage device.
[0225] Step 616: The USB storage device receives the CBW request message and sends a second CBW reply message to the terminal device. The second CBW reply message is used to indicate whether the USB storage device has obtained the storage location information.
[0226] In some embodiments, after receiving the CBW request message, the USB storage device may obtain the storage location information of the second data from the CBW request message, and send a second CBW reply message to the terminal device 2 in response to the CBW request message.
[0227] Step 617: The terminal device receives the second CBW reply message and sends the second CBW reply message to the USB server.
[0228] In some embodiments, see Figure 6 The second CBW reply message is transparently transmitted on the USB client and the virtual USB driver module included in the terminal device. That is, the virtual USB driver module receives the second CBW reply message and sends the second CBW reply message to the USB client. The USB client receives the second CBW reply message and sends the second CBW reply message to the USB server.
[0229] Step 618: The USB storage device receives the write request message, and sends a second write reply message to the terminal device, where the second write reply message is used to indicate whether the USB storage device successfully saves the second data.
[0230] In some embodiments, the USB storage device receives the write request message, reads the second data from the write request message, saves the second data based on the storage location information of the second data, and sends a second write reply message to the terminal device in response to the write request message.
[0231] In some embodiments, the USB storage device receives multiple write request messages, reads a portion of the second data from each write request message, composes the second data from the multiple portions of the read second data, saves the second data based on the storage location information of the second data, and sends a second write reply message to the terminal device in response to the write request message.
[0232] In some embodiments, the second write reply message may be a Data-out reply message.
[0233] Step 619: The terminal device receives the second write reply message and sends the second write reply message to the USB server.
[0234] In some embodiments, see Figure 6The second write reply message is transparently transmitted on the USB client and the virtual USB driver module included in the terminal device. That is, the virtual USB driver module receives the second write reply message and sends the second write reply message to the USB client. The USB client receives the second write reply message and sends the second write reply message to the USB server.
[0235] Step 620: The USB storage device receives the CSW request message and sends a second CSW reply message to the terminal device, where the second CSW reply message includes a second status.
[0236] In some embodiments, after receiving the CSW request message, the USB storage device obtains the current state, takes the current state as the second state, and sends a second CSW reply message including the second state to the terminal device in response to the CSW request message.
[0237] Step 621: The terminal device receives the second CSW reply message and sends the second CSW reply message to the USB server.
[0238] In some embodiments, see Figure 6 The second CSW reply message is transparently transmitted on the USB client and the virtual USB driver module included in the terminal device. That is, the virtual USB driver module receives the second CSW reply message and sends the second CSW reply message to the USB client. The USB client receives the second CSW reply message and sends the second CSW reply message to the USB server.
[0239] Step 622: The USB server receives a second CBW reply message, a second write response message and a second CSW reply message. When the second CBW reply message indicates that the USB storage device has not obtained the storage location information, the second write response message indicates that the USB storage device has not successfully saved the second data, or the second state in the second CSW reply message is different from the specified state, the virtual USB bus driver module is notified.
[0240] After receiving the notification, the virtual USB bus driver module may re-execute the above data writing process, or cancel writing the second data.
[0241] When the second CBW reply message indicates that the USB storage device obtains the storage location information, the second write response message indicates that the USB storage device successfully saves the second data, or the second state in the second CSW reply message is the same as the specified state, the data write process ends.
[0242] In an embodiment of the present application, after receiving the CBW request message sent by the virtual USB bus driver module, the USB server sends the CBW request message to the USB storage device, generates a first CBW reply message in response to the CBW request message, and sends the first CBW reply message to the virtual USB bus driver module. In this way, the USB server does not need to wait for the CBW reply message from the USB storage device, but simulates the generation of the first CBW reply message and sends it to the virtual USB driver module, so that the virtual USB driver module sends a write request message. The USB server does not need to wait for the network delay of the CBW request message and the CBW reply message transmitted on the network between the terminal device and the cloud desktop virtual machine, and can receive the write request message and send the write request message to the USB storage device, thereby improving the efficiency of the cloud desktop virtual machine writing data to the USB storage device. The USB server also does not need to wait for the write reply message sent from the USB storage device, but simulates the generation of the first write reply message and sends it to the virtual USB driver module, so that the virtual USB driver module sends a CSW request message. The USB server does not need to wait for the network delay of the write request message and the write reply message being transmitted on the network between the terminal device and the cloud desktop virtual machine, and can receive the CSW request message and send the CSW request message to the USB storage device, thereby improving the efficiency of the cloud desktop virtual machine in obtaining the status of the USB storage device.
[0243] See also Figure 7 The present application embodiment provides a communication device 700, wherein the device 700 is deployed in Figure 1 or Figure 2 The cloud desktop system 10 shown in the figure includes a terminal device, or the device 700 is deployed on Figure 5 The terminal device of the method 500 is shown. The device 700 is connected to a universal serial bus USB storage device, and the USB storage device stores the first data to be read by the cloud desktop virtual machine, including:
[0244] The receiving unit 701 is used to receive a command block packet CBW request message sent by the cloud desktop virtual machine, where the CBW request message includes storage location information of the first data in the USB storage device;
[0245] The sending unit 702 is used to send the CBW request message to the USB storage device;
[0246] The processing unit 703 is used to generate a first read request message, where the first read request message is used to instruct to read the first data;
[0247] The sending unit 702 is further configured to send a first read request message to the USB storage device;
[0248] The receiving unit 701 is further configured to receive a read reply message sent by the USB storage device, where the read reply message includes first data read by the USB storage device based on the storage location information;
[0249] The sending unit 702 is further configured to send the read reply message to the cloud desktop virtual machine.
[0250] Optionally, the detailed implementation process of the receiving unit 701 receiving the CBW request message can be found in Figure 5 The relevant contents of step 503 of the method 500 are not described in detail here.
[0251] Optionally, the detailed implementation process of the sending unit 702 sending the CBW request message is shown in Figure 5 The relevant contents of step 503 of the method 300 are not described in detail here.
[0252] Optionally, the detailed implementation process of the processing unit 703 generating the first read request message can be found in Figure 5 The relevant contents of step 505 of the method 500 are not described in detail here.
[0253] Optionally, the detailed implementation process of the sending unit 702 sending the first read request message can be found in Figure 5 The relevant contents of step 506 of the method 500 are not described in detail here.
[0254] Optionally, the detailed implementation process of receiving the read reply message by the receiving unit 701 is shown in Figure 5 The relevant contents of step 508 of the method 500 are not described in detail here.
[0255] Optionally, the detailed implementation process of the sending unit 702 sending the read reply message can be found in Figure 5 The relevant contents of step 5011 of the method 500 are not described in detail here.
[0256] Optionally, the receiving unit 701 is further configured to receive a CBW reply message sent by the USB storage device, where the CBW reply message is used to instruct the USB storage device to obtain the storage location information;
[0257] The processing unit 703 is configured to generate a first read request message in response to the CBW reply message.
[0258] Optionally, the detailed implementation process of the receiving unit 701 receiving the CBW reply message can be found in Figure 5 The relevant contents of step 505 of the method 500 are not described in detail here.
[0259] Optionally, the detailed implementation process of the processing unit 703 generating the first read request message can be found in Figure 5The relevant contents of step 505 of the method 500 are not described in detail here.
[0260] Optionally, the sending unit 702 is further configured to send the CBW reply message to the cloud desktop virtual machine.
[0261] Optionally, the detailed implementation process of the sending unit 702 sending the CBW reply message is shown in Figure 5 The relevant contents of step 511 of the method 500 are not described in detail here.
[0262] Optionally, the processing unit 703 is further configured to generate a first command status packet CSW request message in response to the read reply message, where the first CSW request message is used to instruct to obtain a first status, where the first status is a status after the USB storage device reads the first data;
[0263] The sending unit 702 is further configured to send a first CSW request message to the USB storage device;
[0264] The receiving unit 701 is further configured to receive a CSW reply message sent by the USB storage device, where the CSW reply message includes a first status;
[0265] The sending unit 702 is further configured to send the CSW reply message to the cloud desktop virtual machine.
[0266] Optionally, the processing unit 703 generates a first command status packet CSW request message in response to the read reply message. Figure 5 The relevant contents of step 508 of the method 500 are not described in detail here.
[0267] Optionally, the detailed implementation process of the sending unit 702 sending the first CSW request message can be found in Figure 5 The relevant contents of step 509 of the method 500 are not described in detail here.
[0268] Optionally, the detailed implementation process of the receiving unit 701 receiving the CSW reply message can be found in Figure 5 The relevant contents of step 510 of the method 500 are not described in detail here.
[0269] Optionally, the detailed implementation process of the sending unit 702 sending the CSW reply message can be found in Figure 5 The relevant contents of step 511 of the method 500 are not described in detail here.
[0270] In an embodiment of the present application, since the processing unit generates a first read request message and the sending unit sends the first read request message to the USB storage device after the receiving unit receives the CBW request message, the read request message can be sent to the USB storage device without waiting for sending a CBW response message to the cloud desktop virtual machine and waiting for receiving the read request message sent by the cloud desktop virtual machine, thereby improving the efficiency of reading data from the USB storage device, that is, improving the efficiency of the cloud desktop virtual machine accessing the USB storage device.
[0271] See also Figure 8 The present application embodiment provides a communication device 800, wherein the device 800 is deployed in Figure 1 or Figure 2 The cloud desktop system 10 shown in the figure includes a cloud desktop virtual machine, or the device 800 is deployed on Figure 5 The cloud desktop virtual machine of the method 500 is shown. The cloud desktop virtual machine includes a virtual universal serial bus USB bus driver module, and the virtual USB bus driver module needs to read the first data stored in the USB storage device, and the USB storage device is connected to the terminal device. The device 800 includes:
[0272] The receiving unit 801 is configured to receive a CBW request message sent by a virtual USB bus driver module, where the CBW request message includes storage location information of the first data in the USB storage device;
[0273] A sending unit 802 is configured to send the CBW request message to the terminal device, where the CBW request message is used to trigger the terminal device to generate a first read request message and send the CBW request message and the first read request message to the USB storage device, where the first read request message is used to instruct the USB storage device to read the first data based on the storage location information;
[0274] The receiving unit 801 is further configured to receive a read reply message sent by a terminal device, where the read reply message includes first data;
[0275] The sending unit 802 is further configured to send the read reply message to the virtual USB bus driver module.
[0276] Optionally, the detailed implementation process of the receiving unit 801 receiving the CBW request message can be found in Figure 5 The relevant contents of step 502 of the method 500 are not described in detail here.
[0277] Optionally, the detailed implementation process of the sending unit 802 sending the CBW request message is shown in Figure 5 The relevant contents of step 503 of the method 500 are not described in detail here.
[0278] Optionally, the detailed implementation process of receiving the read reply message by the receiving unit 801 is shown in Figure 5 The relevant contents of step 512 of the method 500 are not described in detail here.
[0279] Optionally, the detailed implementation process of the sending unit 802 sending the read reply message can be found in Figure 5 The relevant contents of step 512 of the method 500 are not described in detail here.
[0280] Optionally, the receiving unit 801 is further configured to receive a CBW reply message sent by the terminal device, where the CBW reply message is used to instruct the USB storage device to obtain the storage location information;
[0281] The sending unit 802 is further configured to send the CBW reply message to the virtual USB bus driver module;
[0282] The receiving unit 801 is further configured to receive a second read request message sent by the virtual USB bus driver module in response to the CBW reply message, where the second read request message is used to instruct to read the first data;
[0283] The sending unit 802 is used to send the read reply message to the virtual USB bus driver module in response to the second read request message.
[0284] Optionally, the detailed implementation process of the receiving unit 801 receiving the CBW reply message is as follows: Figure 5 The relevant contents of step 512 of the method 500 are not described in detail here.
[0285] Optionally, the detailed implementation process of the sending unit 802 sending the CBW reply message is shown in Figure 5 The relevant contents of step 512 of the method 500 are not described in detail here.
[0286] Optionally, the detailed implementation process of the receiving unit 801 receiving the second read request message can be found in Figure 5 The relevant contents of step 514 of the method 500 are not described in detail here.
[0287] Optionally, the detailed implementation process of the sending unit 802 sending the read reply message can be found in Figure 5 The relevant contents of step 514 of the method 500 are not described in detail here.
[0288] Optionally, the receiving unit 801 is further configured to receive a CSW reply message sent by the terminal device, where the CSW reply message includes a first state, where the first state is a state after the USB storage device reads the first data;
[0289] The receiving unit 801 is further configured to receive a second CSW request message sent by the virtual USB bus driver module in response to the read reply message, where the second CSW request message is used to indicate the state of the USB storage device after reading the first data;
[0290] The sending unit 802 is further configured to send a CSW reply message to the virtual USB bus driver module in response to the second CSW request message.
[0291] In an embodiment of the present application, since the CBW request message sent by the sending unit to the USB storage device is used to trigger the terminal device to generate a first read request message and send the CBW request message and the first read request message to the USB storage device, the terminal device can send a read request message to the USB storage device without waiting for sending a CBW response message to the cloud desktop virtual machine and waiting for receiving a read request message sent by the cloud desktop virtual machine, and send a read reply message including the first data to the device, thereby improving the efficiency of reading data from the USB storage device, that is, improving the efficiency of the cloud desktop virtual machine accessing the USB storage device.
[0292] See also Fig. 9 The present application embodiment provides a communication device 900, wherein the device 900 is deployed in Figure 1 or Figure 2 The cloud desktop system 10 shown in the figure includes a cloud desktop virtual machine, or the device 900 is deployed on Figure 6 The cloud desktop virtual machine of the method 600 is shown. The cloud desktop virtual machine includes a virtual universal serial bus USB bus driver module, and the virtual USB bus driver module includes first data to be written to the USB storage device. The device 900 includes:
[0293] The receiving unit 901 is used to receive a command block packet CBW request message sent by a virtual USB bus driver module, where the CBW request message includes storage location information of first data to be written to a USB storage device;
[0294] The sending unit 902 is used to send the CBW request message to the USB storage device;
[0295] The processing unit 903 is used to generate a first CBW reply message in response to the CBW request message, where the first CBW reply message is used to instruct the USB storage device to obtain the storage location information;
[0296] The sending unit 902 is further configured to send a first CBW reply message to the virtual USB bus driver module;
[0297] The receiving unit 901 is further configured to receive a write request message sent by the virtual USB bus driver module in response to the first CBW reply message, where the write request message includes the first data;
[0298] The sending unit 902 is further configured to send the write request message to the USB storage device, where the write request message is used to instruct the USB storage device to save the first data based on the storage location information.
[0299] Optionally, the detailed implementation process of the receiving unit 901 receiving the CBW request message can be found in Figure 6 The relevant contents of step 602 of the method 600 are not described in detail here.
[0300] Optionally, the detailed implementation process of the sending unit 902 sending the CBW request message can be found in Figure 6 The relevant contents of step 602 of the method 600 are not described in detail here.
[0301] Optionally, the processing unit 903 generates a first CBW reply message in response to the CBW request message. Figure 6 The relevant contents of step 603 of the method 600 are not described in detail here.
[0302] Optionally, the detailed implementation process of the sending unit 902 sending the first CBW reply message can be found in Figure 6 The relevant contents of step 604 of the method 600 are not described in detail here.
[0303] Optionally, the detailed implementation process of the receiving unit 901 receiving the write request message can be found in Figure 6 The relevant contents of step 606 of the method 600 are not described in detail here.
[0304] Optionally, the detailed implementation process of the sending unit 902 sending the write request message can be found in Figure 6 The relevant contents of step 606 of the method 600 are not described in detail here.
[0305] Optionally, the processing unit 903 is further configured to generate a first write reply message in response to the write request message, where the first write reply message is used to indicate that the USB storage device successfully saves the first data;
[0306] The sending unit 902 is further configured to send a first write reply message to the virtual USB bus driver module.
[0307] Optionally, the processing unit 903 generates a first write reply message in response to the write request message. Figure 6 The relevant contents of step 607 of the method 600 are not described in detail here.
[0308] Optionally, the detailed implementation process of the sending unit 902 sending the first write reply message can be found in Figure 6The relevant contents of step 608 of the method 600 are not described in detail here.
[0309] Optionally, the receiving unit 901 is further used to receive a command status packet CSW request message sent by the virtual USB bus driver module in response to the first write reply message, where the CSW request message is used to indicate obtaining a status of the USB storage device after saving the first data;
[0310] The processing unit 903 is further configured to generate a first CSW reply message in response to the CSW request message, wherein the first CSW reply message includes a specified status, and the specified status indicates that the USB storage device is normal;
[0311] The sending unit 902 is further configured to send a first CSW reply message to the virtual USB bus driver module.
[0312] Optionally, the processing unit 903 generates a first CSW reply message in response to the CSW request message. Figure 6 The relevant contents of step 611 of the method 600 are not described in detail here.
[0313] Optionally, the detailed implementation process of the sending unit 902 sending the first CSW reply message can be found in Figure 6 The relevant contents of step 612 of the method 600 are not described in detail here.
[0314] Optionally, the sending unit 902 is further configured to send a CSW request message to the USB storage device.
[0315] Optionally, the detailed implementation process of the sending unit 902 sending the CSW request message can be found in Figure 6 The relevant contents of step 615 of the method 600 are not described in detail here.
[0316] Optionally, the receiving unit 901 is further used to receive a second CBW reply message and a second write reply message sent by the USB storage device, the second CBW reply message is used to indicate whether the USB storage device obtains the storage location information, and the second write reply message is used to indicate whether the USB storage device successfully saves the first data;
[0317] The sending unit 902 is further configured to notify the virtual USB bus driver module when the second CBW reply message indicates that the USB storage device has not obtained the storage location information or the second write reply message indicates that the USB storage device has not successfully saved the first data.
[0318] Optionally, the detailed implementation process of the receiving unit 901 receiving the second CBW reply message and the second write reply message can be found in Figure 6The relevant contents of step 622 of the method 600 are not described in detail here.
[0319] Optionally, the detailed implementation process of the sending unit 902 notifying the virtual USB bus driver module is shown in Figure 6 The relevant contents of step 622 of the method 600 are not described in detail here.
[0320] Optionally, the receiving unit 901 is further configured to receive a second CSW reply message sent by the USB storage device, where the second CSW reply message includes a first state, where the first state is a state of the USB storage device after the first data is saved;
[0321] The sending unit 902 is further configured to notify the virtual USB bus driver module when the first state is different from the specified state.
[0322] Optionally, the detailed implementation process of the receiving unit 901 receiving the second CSW reply message can be found in Figure 6 The relevant contents of step 622 of the method 600 are not described in detail here.
[0323] Optionally, the detailed implementation process of the sending unit 902 notifying the virtual USB bus driver module is shown in Figure 6 The relevant contents of step 622 of the method 600 are not described in detail here.
[0324] In an embodiment of the present application, since the processing unit generates a first CBW reply message in response to the CBW request message, the sending unit sends the first CBW reply message to the virtual USB bus driver module. In this way, there is no need to wait for the CBW request message to be sent and no need to wait for the CBW reply message sent by the USB storage device to be received. The sending unit can reply to the virtual USB bus driver module and request the virtual USB bus driver module to send the first data to be written, thereby improving the efficiency of writing data to the USB storage device, that is, improving the efficiency of the cloud desktop virtual machine accessing the USB storage device.
[0325] See also Fig.10 , the present application embodiment provides a computing device 1000. For example, the computing device 1000 may be Figure 1 or Figure 2 The cloud desktop system 10 shown includes terminal devices.
[0326] like Fig.10As shown, computing device 1000 includes: bus 1002, processor 1004, memory 1006 and communication interface 1008. Processor 1004, memory 1006 and communication interface 1008 communicate through bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 1000.
[0327] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 The bus 1002 may include a path for transmitting information between various components of the computing device 1000 (eg, the processor 1004, the memory 1006, and the communication interface 1008).
[0328] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0329] The memory 1006 may include a volatile memory, such as a random access memory (RAM). The memory 1006 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0330] See also Fig.10 , the memory 1006 stores executable program codes, and the processor 1004 executes the executable program codes to respectively implement Figure 7The functions of the receiving unit 701, the sending unit 702 and the processing unit 703 in the device 700 shown in the figure are implemented to realize the method provided by any of the above embodiments. That is, the memory 1006 stores instructions for executing the method provided by any of the above embodiments. Or,
[0331] The communication interface 1008 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1000 and other devices or a communication network.
[0332] The embodiment of the present application also provides a cluster. The cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0333] like Fig.11 As shown, the cluster includes at least one computing device 1000. The memory 1006 in one or more computing devices 1000 in the cluster may store the same instructions for executing the method provided in any of the above embodiments.
[0334] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the cluster may also store some instructions for executing the above communication method. In other words, the combination of one or more computing devices 1000 can jointly execute instructions for executing the method provided in any of the above embodiments.
[0335] In some possible implementations, one or more computing devices in the cluster may be connected via a network, which may be a wide area network or a local area network. Fig.12 A possible implementation is shown. Fig.12 As shown, two computing devices 1000A and 1000B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.
[0336] In this type of possible implementation, the memory 1006 in the computing device 1000A stores the execution Figure 7 Instructions for the functions of the processing unit 703 in the embodiment shown. At the same time, the memory 1006 in the computing device 1000B stores instructions for executing the following Figure 7 Instructions for the functions of the receiving unit 701 and the sending unit 702 in the illustrated embodiment.
[0337] It should be understood that Fig.12The functions of the computing device 1000A shown in FIG. 1000A may also be completed by multiple computing devices 1000. Similarly, the functions of the computing device 1000B may also be completed by multiple computing devices 1000.
[0338] The present application embodiment also provides another cluster. The connection relationship between the computing devices in the cluster can be similar to that of Fig.12 The difference is that the memory 1006 in one or more computing devices 1000 in the cluster may store the same instructions for executing the method provided in any of the above embodiments.
[0339] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the cluster may also store partial instructions for executing the method provided in any of the above embodiments. In other words, the combination of one or more computing devices 1000 may jointly execute instructions for executing the method provided in any of the above embodiments.
[0340] See also Fig.13 , the present application embodiment provides a computing device 1300. For example, the computing device 1300 may be Figure 1 or Figure 2 The devices included in the cloud desktop system 10 shown, for example, the computing device 1300 may be a device in the cloud service platform 101 in the cloud desktop system 10 .
[0341] like Fig.13 As shown, the computing device 1300 includes: a bus 1302, a processor 1304, a memory 1306, and a communication interface 1308. The processor 1304, the memory 1306, and the communication interface 1308 communicate through the bus 1302. The computing device 1300 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 1300.
[0342] The bus 1302 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 The bus 1302 may include a path for transmitting information between various components of the computing device 1300 (eg, the processor 1304, the memory 1306, and the communication interface 1308).
[0343] The processor 1304 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0344] The memory 1306 may include a volatile memory, such as a random access memory (RAM). The memory 1306 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0345] See also Fig.13 , the memory 1306 stores executable program codes, and the processor 1304 executes the executable program codes to respectively implement Figure 8 The functions of the receiving unit 801 in the device 800 shown in the figure are implemented to implement the method provided by any of the above embodiments, that is, the memory 1306 stores instructions for executing the method provided by any of the above embodiments. Alternatively, the memory 1306 stores executable program codes, and the processor 1304 executes the executable program codes to respectively implement Fig. 9 The functions of the receiving unit 901, the sending unit 902 and the processing unit 903 in the device 900 shown in the figure are implemented to implement the method provided by any of the above embodiments, that is, the memory 1306 stores instructions for executing the method provided by any of the above embodiments. Or,
[0346] The communication interface 1308 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1300 and other devices or communication networks.
[0347] The embodiment of the present application also provides a cluster. The cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0348] like Fig.14As shown, the cluster includes at least one computing device 1300. The memory 1306 in one or more computing devices 1300 in the cluster may store the same instructions for executing the method provided in any of the above embodiments.
[0349] In some possible implementations, the memory 1306 of one or more computing devices 1300 in the cluster may also store some instructions for executing the above communication method. In other words, the combination of one or more computing devices 1300 can jointly execute instructions for executing the method provided in any of the above embodiments.
[0350] In some possible implementations, one or more computing devices in the cluster may be connected via a network, which may be a wide area network or a local area network. Fig.15 A possible implementation is shown. Fig.15 As shown, two computing devices 1300A and 1300B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.
[0351] In this type of possible implementation, the memory 1306 in the computing device 1300A stores the execution Fig. 9 Instructions for the functions of the processing unit 903 in the illustrated embodiment. Meanwhile, the memory 1306 in the computing device 1300B stores instructions for executing the functions of the processing unit 903 in the illustrated embodiment. Figure 8 Instructions for the functions of the receiving unit 801 and the sending unit 902 in the embodiment shown; or, the memory 1306 in the computing device 1300B stores instructions for executing the functions of the receiving unit 801 and the sending unit 902 in the embodiment shown; Fig. 9 Instructions for the functions of the receiving unit 901 and the sending unit 902 in the illustrated embodiment.
[0352] It should be understood that Fig.15 The functions of the computing device 1300A shown in FIG. 1300A may also be completed by multiple computing devices 1300. Similarly, the functions of the computing device 1300B may also be completed by multiple computing devices 1300.
[0353] The present application embodiment also provides another cluster. The connection relationship between the computing devices in the cluster can be similar to that of Fig.15 The connection mode of the cluster is different in that the memory 1306 in one or more computing devices 1300 in the cluster may store the same instructions for executing the method provided in any of the above embodiments.
[0354] In some possible implementations, the memory 1306 of one or more computing devices 1300 in the cluster may also store partial instructions for executing the method provided in any of the above embodiments. In other words, the combination of one or more computing devices 1300 may jointly execute instructions for executing the method provided in any of the above embodiments.
[0355] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the method provided in any of the above embodiments.
[0356] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the method provided in any of the above embodiments.
[0357] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0358] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A communication method, characterized in that: The method is applied to a terminal device, the terminal device is connected to a universal serial bus (USB) storage device, and the USB storage device stores first data to be read by a cloud desktop virtual machine, including: The terminal device receives a command block packet CBW request message sent by the cloud desktop virtual machine, where the CBW request message includes storage location information of the first data in the USB storage device; The terminal device sends the CBW request message to the USB storage device; The terminal device generates a first read request message, where the first read request message is used to instruct reading of the first data; The terminal device sends the first read request message to the USB storage device; The terminal device receives a read reply message sent by the USB storage device, where the read reply message includes the first data read by the USB storage device based on the storage location information; The terminal device sends the read reply message to the cloud desktop virtual machine.
2. The method according to claim 1, characterized in that The method further comprises: The terminal device receives a CBW reply message sent by the USB storage device, where the CBW reply message is used to instruct the USB storage device to obtain the storage location information; The terminal device generates a first read request message, including: The terminal device generates the first read request message in response to the CBW reply message.
3. The method according to claim 2, characterized in that The method further comprises: The terminal device sends the CBW reply message to the cloud desktop virtual machine.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The terminal device generates a first command status packet CSW request message in response to the read reply message, wherein the first CSW request message is used to instruct to obtain a first status, where the first status is a status after the USB storage device reads the first data; The terminal device sends the first CSW request message to the USB storage device; The terminal device receives a CSW reply message sent by the USB storage device, where the CSW reply message includes the first status; The terminal device sends the CSW reply message to the cloud desktop virtual machine.
5. A communication method, characterized in that: The method is applied to a universal serial bus USB server included in a cloud desktop virtual machine, wherein the cloud desktop virtual machine also includes a virtual USB bus driver module, and the virtual USB bus driver module includes first data to be written to a USB storage device, including: The USB server receives a command block packet CBW request message sent by the virtual USB bus driver module, wherein the CBW request message includes storage location information of the first data to be written to the USB storage device; The USB server sends the CBW request message to the USB storage device; The USB server generates a first CBW reply message in response to the CBW request message, wherein the first CBW reply message is used to instruct the USB storage device to obtain the storage location information; The USB server sends the first CBW reply message to the virtual USB bus driver module; The USB server receives a write request message sent by the virtual USB bus driver module in response to the first CBW reply message, where the write request message includes the first data; The USB server sends the write request message to the USB storage device, where the write request message is used to instruct the USB storage device to save the first data based on the storage location information.
6. The method according to claim 5, characterized in that The method further comprises: The USB server generates a first write reply message in response to the write request message, wherein the first write reply message is used to indicate that the USB storage device successfully saves the first data; The USB server sends the first write reply message to the virtual USB bus driver module.
7. The method according to claim 6, characterized in that The method further comprises: The USB server receives a command status packet CSW request message sent by the virtual USB bus driver module in response to the first write reply message, wherein the CSW request message is used to indicate obtaining a status of the USB storage device after saving the first data; The USB server generates a first CSW reply message in response to the CSW request message, wherein the first CSW reply message includes a specified status, and the specified status indicates that the USB storage device is normal; The USB server sends the first CSW reply message to the virtual USB bus driver module.
8. The method according to claim 7, characterized in that The method further comprises: The USB server sends the CSW request message to the USB storage device.
9. The method according to any one of claims 5 to 8, characterized in that: The method further comprises: The USB server receives a second CBW reply message and a second write reply message sent by the USB storage device, wherein the second CBW reply message is used to indicate whether the USB storage device obtains the storage location information, and the second write reply message is used to indicate whether the USB storage device successfully saves the first data; The USB server notifies the virtual USB bus driver module when the second CBW reply message indicates that the USB storage device has not obtained the storage location information or the second write reply message indicates that the USB storage device has not successfully saved the first data.
10. The method according to claim 9, characterized in that The method further comprises: The USB server receives a second CSW reply message sent by the USB storage device, where the second CSW reply message includes a first state, where the first state is a state of the USB storage device after the first data is saved; The USB server notifies the virtual USB bus driver module when the first state is different from the specified state.
11. A communication device, characterized in that: The device is connected to a universal serial bus USB storage device, and the USB storage device stores first data to be read by the cloud desktop virtual machine, including: A receiving unit, configured to receive a command block packet CBW request message sent by the cloud desktop virtual machine, wherein the CBW request message includes storage location information of the first data in the USB storage device; A sending unit, configured to send the CBW request message to the USB storage device; A processing unit, configured to generate a first read request message, wherein the first read request message is used to instruct to read the first data; The sending unit is further configured to send the first read request message to the USB storage device; The receiving unit is further configured to receive a read reply message sent by the USB storage device, wherein the read reply message includes the first data read by the USB storage device based on the storage location information; The sending unit is further used to send the read reply message to the cloud desktop virtual machine.
12. The device according to claim 11, characterized in that The receiving unit is further used to receive a CBW reply message sent by the USB storage device, where the CBW reply message is used to instruct the USB storage device to obtain the storage location information; The processing unit is configured to generate the first read request message in response to the CBW reply message.
13. The device according to claim 12, characterized in that The sending unit is further used to send the CBW reply message to the cloud desktop virtual machine.
14. The device according to any one of claims 11 to 13, characterized in that: The processing unit is further configured to generate a first command status packet CSW request message in response to the read reply message, wherein the first CSW request message is used to instruct to obtain a first status, where the first status is a status after the USB storage device reads the first data; The sending unit is further configured to send the first CSW request message to the USB storage device; The receiving unit is further configured to receive a CSW reply message sent by the USB storage device, wherein the CSW reply message includes a first status; The sending unit is also used to send the CSW reply message to the cloud desktop virtual machine.
15. A communication device, characterized in that: The device is deployed on a cloud desktop virtual machine, the cloud desktop virtual machine includes a virtual universal serial bus (USB) bus driver module, and the virtual USB bus driver module includes first data to be written to a USB storage device, including: A receiving unit, configured to receive a command block packet CBW request message sent by the virtual USB bus driver module, wherein the CBW request message includes storage location information for writing the first data to the USB storage device; A sending unit, configured to send the CBW request message to the USB storage device; a processing unit, configured to generate a first CBW reply message in response to the CBW request message, wherein the first CBW reply message is used to instruct the USB storage device to obtain the storage location information; The sending unit is further used to send the first CBW reply message to the virtual USB bus driver module; The receiving unit is further configured to receive a write request message sent by the virtual USB bus driver module in response to the first CBW reply message, wherein the write request message includes the first data; The sending unit is further used to send the write request message to the USB storage device, where the write request message is used to instruct the USB storage device to save the first data based on the storage location information.
16. The device according to claim 15, characterized in that The processing unit is further configured to generate a first write reply message in response to the write request message, wherein the first write reply message is used to indicate that the USB storage device successfully saves the first data; The sending unit is further configured to send the first write reply message to the virtual USB bus driver module.
17. The device according to claim 16, characterized in that The receiving unit is further used to receive a first command status packet CSW request message sent by the virtual USB bus driver module in response to the first write reply message, wherein the CSW request message is used to indicate obtaining a status of the USB storage device after saving the first data; The processing unit is further configured to generate a first CSW reply message in response to the CSW request message, wherein the first CSW reply message includes a specified status, and the specified status indicates that the USB storage device is normal; The sending unit is further configured to send the first CSW reply message to the virtual USB bus driver module.
18. The device according to claim 17, characterized in that The sending unit is further configured to send the CSW request message to the USB storage device.
19. The device according to any one of claims 15 to 18, characterized in that The receiving unit is further configured to receive a second CBW reply message and a second write reply message sent by the USB storage device, wherein the second CBW reply message is used to indicate whether the USB storage device obtains the storage location information, and the second write reply message is used to indicate whether the USB storage device successfully saves the first data; The sending unit is further configured to notify the virtual USB bus driver module when the second CBW reply message indicates that the USB storage device has not obtained the storage location information or the second write reply message indicates that the USB storage device has not successfully saved the first data.
20. The device according to claim 19, characterized in that The receiving unit is further configured to receive a second CSW reply message sent by the USB storage device, wherein the second CSW reply message includes a first state, and the first state is a state of the USB storage device after saving the first data; The sending unit is further configured to notify the virtual USB bus driver module when the first state is different from the specified state.
21. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 10.
22. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a computer, the method according to any one of claims 1 to 10 is implemented.
23. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.