Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The technical scheme of the application is described in the following with the accompanying drawings and various embodiments of the specification.
The method comprises the steps of establishing a virtual disk on a cloud desktop presented by a virtual machine, and enabling the virtual disk on the cloud desktop to be in data communication with a disk of remote equipment through network connection, so that the disk of the remote equipment is completely equivalent to a local disk in function and using effect, and flexibility of remotely accessing the disk is improved. The principle is shown in fig. 2.
Referring to fig. 2, the technical solution of the present application mainly relates to two roles, namely, a remote device and a virtual machine.
And the remote equipment is a computer where a disk to be remotely accessed is located. In the application, in order to enable the remote device to complete the operation of remotely accessing the disk in cooperation with the virtual machine, an application module may be installed on an application layer of the remote device, and the application module is configured to capture disk data on a specified disk of the remote device and transmit the captured disk data from the application layer of the remote device to a drive layer of the virtual machine through a network.
And the virtual machine is responsible for presenting the cloud desktop. The virtual machine runs on the cloud server, and all computing resources and data storage of the virtual machine are provided by the cloud server. The user can use the terminal device to access the cloud desktop provided by the virtual machine through the network, and the terminal device is only used as a display terminal and is responsible for receiving and feeding back the operation of external devices such as a mouse and a keyboard. In the application, a virtual disk driver is installed on a drive layer of a virtual machine, and the virtual disk driver is responsible for establishing a virtual disk on a cloud desktop, receiving disk data sent by remote equipment, and caching the received disk data in a data storage distributed to the virtual machine by a cloud server.
As to how to access the disk of the remote device through the virtual machine, the following will be explained by the method flow shown in fig. 3. For any remote device, the virtual machine may implement remote access to the disk on the remote device according to the method shown in fig. 3. As shown in fig. 3, the method may include steps 301 to 303, wherein steps 301 and 302 are implemented at a driver layer of the virtual machine, and step 303 is implemented at a driver layer and an application layer of the virtual machine. Next, the respective steps included in the method will be described.
Step 301: and establishing a virtual disk corresponding to the specified disk on the remote equipment on the cloud desktop presented by the virtual machine.
Optionally, the virtual machine may determine a specified disk to be accessed on the remote device according to a control instruction sent by the remote device; the specified disk to be accessed on the remote device can also be determined according to a manual configuration instruction received from a terminal interface, wherein the terminal interface refers to an external interface of the terminal device which logs in a cloud desktop, and can be a command line interface, a human-computer interface or an interface in other forms. The virtual machine may then establish a virtual disk at its driver layer that corresponds to the specified disk on the remote device.
When there are multiple designated disks to be accessed on the remote device, the virtual machine may establish multiple virtual disks corresponding to the multiple designated disks on the cloud desktop.
Optionally, when the virtual disk is established, the following method can be implemented: the virtual machine may find back a drive Object (Driver Object) corresponding to a virtual DISK Driver included in the virtual machine according to a generated Root DEVICE Object (Root DEVICE Object) of a FILE _ DEVICE _ UNKNOWN type, then establish a virtual DISK of a FILE _ DEVICE _ DISK type according to the found back drive Object, and specify a drive letter for the established virtual DISK. After the virtual disk is created, a local disk icon as shown in fig. 4 is displayed in the cloud desktop, and in fig. 4, "local disk (X:)" is an icon corresponding to the virtual disk, and at this time, no data exists in the local disk (X:).
The virtual disk driver may be an nt (new technology) type driver commonly used in the existing implementation, and is generally loaded when the virtual machine is started, and the driver entry function (drivernetry) may be called during loading to create a DEVICE Object (DEVICE Object) of FILE _ DEVICE _ UNKNOWN type, which is the root DEVICE Object. The root device object is located in a drive layer of the virtual machine, contains important information of a virtual disk drive program, and mainly plays a role in realizing dynamic loading of the virtual disk.
Step 302: and after the virtual disk is established, acquiring the file list of the specified disk from the remote equipment and caching the file list.
Before step 302, the remote device may obtain partition information of a specified disk to be accessed on the remote device through an API (Application Programming Interface) function, determine a position of the specified disk to be accessed according to the obtained disk partition information, define a file pointer at the determined disk position, and read and write the disk in a file pointer manner, thereby obtaining a file list of the specified disk to be accessed. The mode of reading and writing the disk data by the file pointer can bypass a file management system of the computer, and the bypass of the file management system means that the read and write disk data can pass through fewer process modules, so that the complexity of a link can be reduced, and the read and write efficiency of the disk can be improved.
Another task of the remote device is to create a network connection, and encapsulate disk data such as the read file list into an appropriate data structure to be sent to the virtual machine through the network connection, where the encapsulated data structure can indicate the offset and length of each file list in the entity of the data structure in the data header, so that the virtual machine can read the file list of the specified disk to be accessed on the remote device from the entity of the data structure according to the indication of the data header of the data structure.
In order to ensure the security of Data transmission, the remote device may encrypt the disk Data before sending the disk Data through the network connection, and commonly used Encryption algorithms include a Data Encryption Standard (DES) algorithm and the like.
Specifically, the network connection may be a TCP (Transmission Control Protocol) connection, and the network connection may be established between an application layer of the remote device and a driver layer of the virtual machine, so that the disk data may be directly transmitted from the application layer of the remote device to the driver layer of the virtual machine, and does not need to pass through the application layer of the virtual machine. In addition, the application does not limit the establishment timing of the network connection between the remote device and the virtual machine, for example, the virtual machine may establish the network connection with the remote device after the virtual disk is established, or may establish the network connection with the remote device before the virtual disk is established (e.g., after a specified disk to be accessed on the remote device is determined). Alternatively, the network connection may be a TCP long connection, i.e. the network connection is not interrupted even when there is no data transfer between the virtual machine and the remote device.
Step 303: and when an instruction for accessing the virtual disk is received, displaying a window on the cloud desktop, and displaying the cached file list in the window, wherein the address bar of the window displays a local path.
Specifically, the virtual machine may receive an instruction for accessing a specified virtual disk through an external interface of the terminal device logged in the cloud desktop, then, an application layer of the virtual machine requests a file list associated with the specified virtual disk from a driver layer of the virtual machine, the driver layer reads a corresponding file list according to the request of the application layer and returns the file list to the application layer, and the application layer displays the file list in a window.
For example, assume a virtual disk is established on the cloud desktop of the virtual machine, the drive letter of the virtual disk is "local disk (X:)", and the local disk (X:) is associated with a file list of a certain disk on a local cache remote device. When the virtual machine receives an access instruction to the local disk (X:), for example, a double-click instruction of a mouse to the local disk (X:), the application layer of the virtual machine can request a file list of the disk on the remote device associated with the local disk (X:) from the drive layer of the virtual machine, and after the drive layer returns the corresponding file list, the application layer can present a window as shown in FIG. 5, display the file list in the window, and display a local path "computer \ local disk (X:)" in an address bar of the window. In the application, the application program on the virtual machine can access the disk of the remote device through the local path, so that the disk of the remote device can be equivalent to the local disk in terms of function and use effect, and the problem of limited remote access can be avoided under some scenes related to file path identification, such as scenes of saving a file to the disk of the remote device or opening a certain file on the disk of the remote device.
When there are multiple designated disks to be accessed on the remote device, the virtual machine may parse multiple file lists from the received disk data, and the virtual machine may store the multiple file lists in the corresponding virtual disks respectively.
According to the method shown in fig. 3, the virtual machine can load data of one or more disks on one or more remote devices to the virtual machine at the same time, which improves the flexibility of accessing the disks remotely.
After the disk file list of the remote device is displayed in a window of the cloud desktop by the virtual machine, if a read instruction for an object included in the file list is received, content corresponding to the object can be acquired from the specified disk and displayed on the cloud desktop. And if a write instruction for an object included in the file list is received, the write instruction can be sent to the remote device, so that the remote device performs a write operation on the specified disk according to the write instruction. The object may be a file or a folder.
For example, when the virtual machine receives a read instruction for a certain folder in the file list, a file list further included in the folder may be obtained from a specified disk of the remote device and displayed on the cloud desktop; when the virtual machine receives a read instruction for a certain file in the file list, the content of the file can be acquired from a specified disk of the remote device and displayed on a cloud desktop, and the remote device side can read the file from a local specified disk in a file pointer mode.
Optionally, in order to enable the display effect of the disk of the remote device on the cloud desktop to be closer to the local disk, the remote device may obtain partition information of the specified disk to be accessed on the device through the API function, and send the obtained disk partition information to the virtual machine, where the disk partition information is mainly used to indicate information of the remaining capacity, available capacity, total capacity, and the like of the specified disk to be accessed on the remote device. The virtual machine can display the received disk partition information on the cloud desktop. For example, in FIG. 6, "local disk (X:)", indicates the icon of the virtual disk provided in the present application, and "C on D12371F" and "D on D12371F" indicate the disk icon mapped to the local disk by RDP mapping, and the display effect is closer to the local disk than the display effect obtained by displaying the information such as the available capacity, total capacity, and capacity bar of the remote device disk corresponding to the virtual disk around the icon of the virtual disk provided in the present application.
To sum up, according to the technical scheme of the application, the virtual disk is established on the cloud desktop presented by the virtual machine, and the virtual disk on the cloud desktop and the disk of the remote device are communicated with each other through network connection, so that the virtual disk and the disk of the remote device are not limited by a network path, and a user can use the local path to access the disk data of the remote device stored in the virtual disk as accessing the local disk on the cloud desktop, so that the disk of the remote device can be equivalent to the local disk in terms of functions and use effects, and the flexibility of remotely accessing the disk is improved.
The methods provided herein are described above. The apparatus provided in the present application is described below.
Referring to fig. 7, this figure is a functional block diagram of a remote disk access apparatus provided in an embodiment of the present application, where the apparatus is applied to a virtual machine, and the apparatus may include:
a virtual disk establishing unit 701, configured to establish a virtual disk corresponding to a specified disk on a remote device on a cloud desktop presented by a virtual machine.
A disk data obtaining unit 702, configured to obtain and cache the file list of the specified disk from the remote device after the disk establishing unit 701 establishes the virtual disk.
The disk data processing unit 703 is configured to display a window on the cloud desktop and display the cached file list in the window when receiving an instruction to access the virtual disk, where an address bar of the window displays a local path.
Optionally, when a virtual disk corresponding to a specified disk on a remote device is established on a cloud desktop presented by a virtual machine, the virtual disk establishing unit 701 is specifically configured to:
according to the generated FILE _ DEVICE _ UNKNOWN type root DEVICE object, searching a driving object corresponding to a virtual disk driver included in the virtual machine; and establishing a FILE _ DEVICE _ DISK type virtual DISK according to the searched drive object, and assigning a drive letter to the established virtual DISK.
Optionally, the disk data obtaining unit 702 may be further configured to obtain partition information of the specified disk from the remote device, where the partition information includes a remaining capacity, an available capacity, and a total capacity of the specified disk.
The disk data processing unit 703 may be further configured to display the partition information on the cloud desktop.
Optionally, the disk data obtaining unit 702 may be further configured to, when a read instruction for an object included in the file list is received, obtain, from the specified disk, content corresponding to the object, and display the content on the cloud desktop; and when a write instruction for an object included in the file list is received, sending the write instruction to the remote equipment so that the remote equipment performs write operation on the specified disk according to the write instruction.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
It should be noted that the division of the unit in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
As shown in fig. 8, the embodiment of the present application further provides a remote access disk device, which includes a communication interface 801, a processor 802, a memory 803, and a bus 804; the communication interface 801, the processor 802, and the memory 803 communicate with each other via a bus 804.
Among other things, a communication interface 801 for communicating with remote devices. The processor 802 may be a CPU, the memory 803 may be a non-volatile memory (non-volatile memory), and the memory 803 stores remote disk access logic instructions, and the processor 802 may execute the remote disk access logic instructions stored in the memory 803 to implement the remote disk access method shown in fig. 3, which may be specifically referred to as the flow shown in fig. 3.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.