File processing method, system and equipment for cloud desktop and storage medium
By obtaining and setting the attribute information of virtual storage devices, the problem of inaccurate display of files and folders under cloud terminal disk redirection is solved, and accurate display is achieved across operating system scenarios is achieved, improving user experience.
Patent Information
- Application Number
- CN202310773357.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2024-12-27
AI Technical Summary
In the existing disk redirection mode, files and folders stored locally in the cloud terminal cannot be accurately displayed after being redirected to the virtual machine in the cloud, especially in cross-operating system scenarios, resulting in poor user experience.
By obtaining the attribute information of virtual storage devices in a cloud terminal, displaying or hiding redirection objects based on file system type, it can accurately display file and folder attributes, and supports different file system types (such as NTFS, FAT, and exFAT) Attribute information acquisition and setting.
In the use scenario of cloud desktop, the same user experience as on a Windows PC is achieved, reducing the troubles and misoperation during user use, and ensuring that the properties of files and folders are correctly displayed or hidden after redirection.
Smart Images

Figure CN119201304A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud desktop technology, and in particular to a file processing method, system, device and storage medium. Background Art
[0002] Cloud desktop, also known as desktop virtualization or cloud computer, is a new model to replace traditional computers. After adopting cloud desktop, users no longer need to buy computer hosts. The CPU, memory, hard disk and other components contained in the host are all virtualized in the server in the cloud (also known as the backend). A single high-performance server can virtualize 1 to 50 virtual hosts (referred to as virtual machines). Cloud terminal usually refers to the terminal device of cloud desktop technology. As the carrier of cloud desktop, its main function is to display the desktop in the cloud and redirect the input and output data of the cloud terminal to the virtual machine in the cloud.
[0003] Disk redirection is a commonly used redirection technology. It is widely popular due to its advantages of stable file transfer and high efficiency. Generally, cloud terminals provide this function. Since disk redirection depends on local terminal mounting, the files and folders stored locally on the cloud terminal cannot be accurately displayed after being redirected to the virtual machine on the cloud under the existing disk redirection method. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a file processing method, system and device for a cloud desktop to solve the problem that files and folders stored locally on a cloud terminal cannot be accurately displayed after being redirected to a virtual machine on the cloud under the existing disk redirection method.
[0005] In order to achieve the above objectives, the present application embodiment adopts the following technical solutions:
[0006] In a first aspect, a file processing method of a cloud desktop is provided, which is applied to a virtual machine of the cloud desktop, comprising:
[0007] In response to a display instruction for a redirected object in a virtual storage device on a cloud desktop, based on a file system type corresponding to the virtual storage device, attribute information of an object corresponding to the redirected object is obtained from a cloud terminal run by a cloud desktop client; wherein the redirected object includes a redirected file and / or a redirected folder, the attribute information includes file attributes and / or folder attributes, and the virtual storage device is obtained by mapping a storage device connected to the cloud terminal to the virtual machine in a disk redirection manner;
[0008] Based on the acquired attribute information, the corresponding redirection object in the virtual storage device is displayed on the cloud desktop client.
[0009] In a second aspect, a file processing system for a cloud desktop is provided, comprising a cloud desktop virtual machine and a cloud desktop client, wherein the cloud desktop client is deployed and runs on a front-end cloud terminal, and the virtual machine is deployed and runs in a cloud server, wherein:
[0010] The virtual machine is used to respond to a display instruction for a redirected object in a virtual storage device on a cloud desktop, and based on the file system type corresponding to the virtual storage device, obtain attribute information of an object corresponding to the redirected object from the cloud terminal; based on the obtained attribute information, display the corresponding redirected object in the virtual storage device on the cloud desktop client; wherein the redirected object includes a redirected file and / or a redirected folder, the attribute information includes file attributes and / or folder attributes, and the virtual storage device is obtained by mapping a storage device connected to the cloud terminal to the virtual machine by disk redirection;
[0011] The cloud desktop client is used to present the corresponding redirection object in the virtual storage device at the front end.
[0012] According to a third aspect, an electronic device is provided, including:
[0013] processor;
[0014] a memory for storing instructions executable by the processor;
[0015] The processor is configured to execute the instructions to implement the method as described in the first aspect.
[0016] According to a fourth aspect, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method described in the first aspect.
[0017] The cloud desktop file processing solution provided by the embodiment of the present application has a cloud desktop client deployed and running on the cloud terminal, a storage device is connected to the physical port of the cloud terminal, and the cloud desktop client maps the storage device to the virtual machine using disk redirection to obtain the corresponding virtual storage device; for the display instruction of the redirected object in the virtual storage device, the virtual machine first obtains the attribute information of the object corresponding to the redirected object from the cloud terminal based on the file system type corresponding to the virtual storage device, and then displays the corresponding redirected object on the cloud desktop client based on the obtained attribute information. Since disk redirection depends on local terminal mounting, the files and folders stored locally in the cloud terminal cannot be accurately displayed after being redirected to the virtual machine in the cloud under the existing disk redirection method. In response to the above problems, the embodiments of the present application provide corresponding attribute information acquisition methods for different file system types, so that the attribute information of the object corresponding to the redirected object can be obtained from the cloud terminal, and the redirected object can be displayed based on the obtained attribute information, so that files and folders with hidden attributes under the Windows operating system can be normally hidden when displayed on a Linux cloud terminal or an Android cloud terminal after disk redirection, which can effectively solve the problem that the redirected objects cannot be accurately displayed in cross-operating system scenarios. In the use scenario of the cloud desktop, the same user experience as on a Windows PC can be achieved, reducing the troubles of the user during use and preventing user misoperation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 A schematic diagram of an implementation environment applicable to a cloud desktop file processing method provided by an embodiment of the present application;
[0020] Figure 2 A flowchart of a file processing method for a cloud desktop provided by an embodiment of the present application;
[0021] Figure 3 A schematic diagram of the functional design architecture of a file processing system for a cloud desktop provided in one embodiment of the present application;
[0022] Figure 4 A schematic diagram of the structure of a file processing system for a cloud desktop provided by an embodiment of the present application;
[0023] Figure 5 A schematic diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of this application.
[0025] The terms "first", "second", etc. in this specification and claims are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in this specification and claims means at least one of the connected objects, and the character " / " generally means that the objects associated with each other are in an "or" relationship.
[0026] As mentioned above, cloud terminals generally use disk redirection, and disk redirection relies on local terminal mounting. Redirection means that the cloud terminal connected to the storage device intercepts the device data reported by the bus driver and forwards the intercepted device data to the virtual machine in the cloud, so that the local storage device of the cloud terminal can be mapped to the virtual machine in the cloud. Mounting refers to the process by which the operating system makes the files and directories on a storage device accessible to users through the file system.
[0027] Since cloud terminals do not need to be responsible for computing, they only need to connect to the cloud virtual machine (deployed and running on the cloud server), so they do not need a powerful processor. For this reason, cloud terminal processing generally uses the ARM architecture, which has a simple structure and lower power consumption, which is sufficient to meet the requirements of cloud terminals. Since cloud terminals use ARM architecture processors and cannot run Windows operating systems, cloud terminals generally use Linux operating systems or Android operating systems. Compared with the Android operating system, which is relatively bloated, the embedded Linux operating system starts faster and is more conducive to the use of cloud terminals. The virtual machines in the cloud generally use Windows operating systems or Linux operating systems.
[0028] The inventor discovered during the invention process that when the Linux operating system or Android operating system is used locally on the cloud terminal, since disk redirection depends on local mounting of the terminal, after the files stored locally on the cloud terminal are redirected to the cloud, the virtual machine of the cloud desktop cannot obtain the file attributes of the files stored locally on the cloud terminal in the Windows operating system, and the content of the file attributes is generally hidden or non-hidden. In other words, under the disk redirection mode, after the files stored locally on the cloud terminal are redirected to the virtual machine on the cloud, all redirected files will be displayed, even if the file attributes are hidden files in the Windows operating system, they will be displayed, resulting in the problem that under the existing disk redirection mode, the files stored locally on the cloud terminal cannot be accurately displayed after being redirected to the virtual machine on the cloud. The same problem also exists for the folders stored locally on the cloud terminal.
[0029] Take the storage device connected to the cloud terminal as a USB flash drive as an example. The full name of the USB flash drive is a miniature high-capacity mobile storage device that uses a USB (Universal Serial Bus) interface and does not require a physical drive. The USB flash drive can be connected to the cloud terminal through the USB interface.
[0030] There are two redirection technologies for USB flash drives: disk redirection and USB redirection. Disk redirection uses a protocol similar to USB over IP, which has high requirements for network quality and is generally used in local area networks. USB redirection uses a high-level mapping channel of RDP (Remote Desktop Protocol), which is similar to network sharing and has low requirements for network quality. For a comparison of the two redirection methods, please refer to Table 1. USB redirection does not rely on local terminal mounting, and the file operation write device is determined by the virtual machine system IO (input and output) refresh mechanism. Disk redirection is different from USB redirection. Disk redirection relies on local terminal mounting. In terms of transmission content, all file transfers of disk redirection rely on file read and write operations. In terms of file operations, the write device is determined by the terminal local system IO refresh mechanism. In terms of file display, the acquisition of file attributes depends on the local terminal. When the terminal uses the Linux operating system or Android operating system locally, the virtual machine of the cloud desktop cannot obtain the file attributes (hidden or non-hidden) of the files in the local U disk of the cloud terminal, resulting in that in the disk redirection mode, the files stored locally on the U disk will be displayed after being redirected to the virtual machine in the cloud, including hidden files viewed under Windows PC. The same problem exists for folders, which will not be repeated.
[0031]
[0032] Table 1
[0033] In view of this, the embodiment of the present application aims to provide a file processing method for a cloud desktop, so that when the cloud terminal adopts disk redirection, the files and folders of the cloud desktop can be displayed normally. The files with hidden attributes and the folders with hidden attributes stored locally in the cloud terminal can be not displayed after redirecting to the virtual machine in the cloud to avoid causing trouble to the user. At the same time, it also supports setting the file attributes and folder attributes of the local cloud terminal. That is to say, in the use scenario of the cloud desktop, the same user experience as on a Windows PC can be achieved.
[0034] The implementation environment of the cloud desktop file processing method provided in the embodiment of the present application is as follows: Figure 1 As shown, it includes a cloud terminal 101 at the front end and a server 102 at the cloud end (or back end). Cloud desktop is a new model to replace traditional computers. After adopting cloud desktop, the CPU, memory, hard disk and other components contained in the host of traditional computers are all virtualized in the server in the cloud. A single server can virtualize multiple virtual hosts (referred to as virtual machines). Cloud desktop not only supports the replacement of traditional computers, but also supports other smart devices such as smart phones and tablets to access on the Internet. Cloud terminal 101 is connected to server 102 through a wireless network or a wired network, and a cloud desktop client is deployed and run on cloud terminal 101; a virtual machine of cloud desktop is deployed and run on server 102. Cloud terminal 101 is a terminal device of cloud desktop technology, which uses cloud desktop technology to remotely access server 102 in the cloud. Cloud desktop technology generally refers to cloud desktop technology communication protocols such as VDI, RDS, SPICE, etc. Cloud terminal 101 connects to the desktop in the cloud end through the above communication protocol and displays it to the front end, and redirects the output and input data of cloud terminal 101 to the virtual machine in the cloud end. Cloud terminal 101 does not bear the operation of cloud desktop locally. The applicable hardware of cloud terminal 101 includes any one of cloud terminal devices, tablet computers, smart phones, thin clients, laptop computers, PC (personal computer) hosts, etc. A thin client is a device similar to a TV set-top box, which can be connected to a display, keyboard, mouse, etc. to realize interactive operation. The local physical port of cloud terminal 101 can be connected to various storage devices, such as USB flash drives, mobile hard disks based on USB interfaces or other interfaces, and built-in hard disks based on SATA interfaces. By using disk redirection, the local storage device of cloud terminal 101 can be mapped to the virtual machine of cloud desktop to obtain the corresponding virtual storage device.
[0035] In the embodiment of the present application, the cloud terminal 101 generally uses a Linux operating system or an Android operating system, and the virtual machine of the cloud desktop deployed and run in the server 102 generally uses a Windows operating system or a Linux operating system. The cloud desktop file processing method provided in the embodiment of the present application is applicable to various usage scenarios of the cloud desktop in Linux cloud terminals and Android cloud terminals, and is also applicable to the usage scenario of cloud games using external storage devices.
[0036] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0037] Please refer to Figure 2 , which is a flow chart of a file processing method for a cloud desktop provided by an embodiment of the present application, applied to a virtual machine of a cloud desktop, the method may include:
[0038] S201. In response to a display instruction for a redirected object in a virtual storage device on a cloud desktop, based on a file system type corresponding to the virtual storage device, obtain attribute information of an object corresponding to the redirected object in the display instruction from a cloud terminal run by a cloud desktop client.
[0039] The virtual storage device is obtained by mapping the storage device connected to the cloud terminal to the virtual machine by disk redirection. There is a corresponding relationship between the virtual storage device and the storage device connected to the cloud terminal. The storage device can be a USB flash drive, a mobile hard disk based on a USB interface or other interfaces, a built-in hard disk based on a SATA interface, etc. By using the disk redirection method, the local storage device of the cloud terminal is mapped to the virtual machine of the cloud desktop, and the corresponding virtual storage device can be obtained. Correspondingly, the objects in the storage device are mapped to the redirected objects in the virtual storage device.
[0040] In an optional implementation, when the cloud desktop client performs disk redirection on the storage device, it obtains disk information such as the disk size and file system type corresponding to the storage device, and carries the disk information corresponding to the storage device in the redirection message and sends it to the virtual machine. Correspondingly, the virtual machine adds the corresponding disk information such as the disk size and file system type to the virtual storage device based on the redirection message sent by the cloud desktop client. It can be understood that the virtual storage device here refers to the virtual storage device in the virtual machine that corresponds to the storage device currently performing disk redirection.
[0041] Specifically, the file system types generally include NTFS (New Technology File System), FAT (File Allocation Table), exFAT (Extended File Allocation Table File System), and the like.
[0042] In the embodiment of the present application, the object in the storage device includes files or folders in the storage device, and the files and folders in the storage device have attribute information, the content of the attribute information includes hidden or non-hidden, and the attribute information indicates whether the corresponding file or folder is displayed. Accordingly, based on actual display requirements, the redirection object in the display instruction can be at least one redirected file, or at least one redirected folder, or at least one redirected file and at least one redirected folder, the attribute information of the redirected file is file attributes, the attribute information of the redirected folder is folder attributes, and the content of the file attributes and the folder attributes both include hidden or non-hidden.
[0043] In a specific implementation, the cloud desktop client monitors user operations. If the cloud desktop client monitors the user's operation of opening a virtual storage device, or the user's operation of opening any redirected folder in the virtual storage device, the above-mentioned display instruction for the redirected object in the virtual storage device on the cloud desktop is generated.
[0044] For the operation of opening a virtual storage device, the redirection object corresponding to the generated display instruction is: all redirected files and / or redirected folders in the root directory of the virtual storage device. For the operation of opening any redirected folder in the virtual storage device, the redirection object corresponding to the generated display instruction is: all redirected files and / or redirected folders in the next-level directory entered by opening the current redirected folder.
[0045] Exemplarily, if a U disk is locally connected to the cloud terminal, the U disk is mapped to the virtual machine of the cloud desktop by disk redirection to obtain the corresponding virtual U disk. Since the desktop in the cloud can be displayed on the front end, the user can see the virtual U disk on the cloud terminal. Assume that the user initiates the operation of opening the virtual U disk, such as double-clicking the virtual U disk, and the root directory of the virtual U disk can be entered by double-clicking the virtual U disk. The cloud desktop client will monitor the operation. If the root directory of the virtual U disk includes three redirection folders, and the folder names are a, b, and c, respectively, then the redirection objects corresponding to the generated display instruction are: the above three redirection folders a, b, and c; if the root directory of the virtual U disk includes two redirection folders and one redirection file, and the folder names are d and e, and the file name is f, then the redirection objects corresponding to the generated display instruction are: the above two redirection folders d and e and one redirection file f. Assume that the user initiates an operation to open a redirected folder (folder name is a) under the current directory (i.e., the current folder) in the virtual U disk. By double-clicking the redirected folder a, the current redirected folder a can be opened to enter the next-level directory. If the next-level directory entered by opening the current redirected folder a includes three redirected files, and the file names are a1, a2, and a3 respectively, then the redirection objects corresponding to the generated display instruction are: the above three redirection files a1, a2, and a3; if the next-level directory entered by opening the current redirected folder a includes two redirection files and one redirection folder, and the file names are a4 and a5 respectively, and the folder name is a6, then the redirection objects corresponding to the generated display instruction are: the above two redirection files a4, a5 and the redirection folder a6.
[0046] In an optional implementation, the step S201 of acquiring the attribute information of the object corresponding to the redirection object in the presentation instruction from the cloud terminal run by the cloud desktop client based on the file system type corresponding to the virtual storage device may include the following steps:
[0047] S2011. Obtain the file system type corresponding to the virtual storage device.
[0048] Specifically, since the virtual machine has added corresponding disk information such as disk size and file system type for the virtual storage device, the file system type corresponding to the virtual storage device can be directly obtained from the disk information corresponding to the virtual storage device. The obtained file system type can be any of the following: NTFS, FAT, exFAT.
[0049] S2012. Based on the file system type corresponding to the virtual storage device, the cloud desktop client calls the system interface of the cloud terminal or calls the kernel newly added interface to obtain the attribute information of the object corresponding to the redirection object in the display instruction in the cloud terminal.
[0050] Specifically, the virtual machine calls the file handle operation interface of the cloud desktop client through the callback interface, and the cloud desktop client obtains the attribute information of the object in the storage device connected to the physical port of the cloud terminal through the underlying interface. When the user opens the virtual storage device or opens any redirected folder in the virtual storage device, the file redirector in the virtual machine obtains the IO operation, and the virtual machine transfers the above IO operation to the cloud terminal. The cloud terminal completes the IO operation and returns the operation result to the virtual machine.
[0051] For the exFAT file system, since the underlying kernel does not support the acquisition of file attributes and folder attributes in the Windows operating system, it is necessary to add a first setting interface to the operating system kernel of the cloud terminal in advance. The first setting interface is an interface for obtaining exFAT file system attribute information. On this basis:
[0052] When the file system type is FAT or NTFS, the cloud desktop client calls the attribute information acquisition interface provided by the operating system of the cloud terminal to obtain the value of the attribute flag in the function return value;
[0053] When the file system type is exFAT, the cloud desktop client calls the first setting interface newly added to the operating system kernel of the cloud terminal to obtain the value of the attribute flag in the function return value;
[0054] The content of the attribute information is determined based on the value of the attribute flag; wherein the value of the attribute flag is a set first value, indicating that the content of the attribute information is hidden, and the value of the attribute flag is a set second value, indicating that the content of the attribute information is not hidden.
[0055] For example, for different file system types, the implementation is as follows:
[0056] For FAT format: ioctl(fd,FAT_IOCTL_GET_ATTRIBUTES,&flag);
[0057] For NTFS format: getxattr(path,"system.ntfs_attrib",&flag,sizeof(flag));
[0058] For exFAT format: ioctl(fd,EXFAT_IOCTL_GET_ATTRIBUTES,&flag);
[0059] Among them, ioctl (input / output control) is a system call dedicated to device input and output operations. The call passes in a request code related to the device. The function of the system call depends entirely on the request code. fd represents the file descriptor; getxattr is used to obtain the value corresponding to the attribute information. For exFAT, the interface "EXFAT_IOCTL_GET_ATTRIBUTES" for obtaining the attribute information of the exFAT file system can be added in advance in the operating system kernel of the cloud terminal.
[0060] The content of the attribute information can be determined by the value of a specific bit in the function return value flag, that is, the specific bit in flag can be used as the attribute flag bit described in the embodiment of the present application. For example, for a file, if the value of the second bit in flag is 1, it indicates that it is a hidden file, and if the value of the second bit in flag is 0, it indicates that it is a non-hidden file.
[0061] S202: Based on the acquired attribute information, display the corresponding redirection object in the virtual storage device on the cloud desktop client.
[0062] Specifically, when the content of the obtained attribute information is not hidden, the corresponding redirection object is displayed on the cloud desktop client; when the content of the obtained attribute information is hidden, based on the pre-set folder options for the virtual machine, the corresponding redirection object in the virtual storage device is displayed on the cloud desktop client.
[0063] Users can set folder options for virtual machines and change the set folder options as needed. The folder options set by users are fixed configurations in the virtual machine, specifying whether to display hidden files or folders, and are effective for each virtual storage device in the virtual machine. Specifically, if the content of the acquired attribute information is hidden, if the folder option is not to display hidden files or folders, the corresponding redirection object will not be displayed on the cloud desktop client; if the folder option is to display hidden files or folders, the corresponding redirection object will be displayed on the cloud desktop client.
[0064] In an optional implementation, the setting of the attribute information of the object in the storage device of the cloud terminal is supported, that is, the user can modify the attribute information of the object in the storage device through the cloud terminal client. The file processing method of the cloud desktop also includes the following steps:
[0065] S203, in response to the attribute setting instruction for the redirection object in the virtual storage device on the cloud desktop, obtaining the file system type corresponding to the virtual storage device;
[0066] In a specific implementation, the cloud desktop client monitors user operations. If the cloud desktop client monitors the user's operation of setting the file attributes of any redirected file in the virtual storage device, or setting the folder attributes of any redirected folder in the virtual storage device, the above-mentioned attribute setting instruction for the redirected object in the virtual storage device on the cloud desktop is generated.
[0067] For the operation of setting the file attributes of a redirected file, the redirection object corresponding to the generated attribute setting instruction is: the currently set redirected file; for the operation of setting the folder attributes of a redirected folder, if the user further specifies that the attribute change should be applied to all subfolders and files, the redirection object corresponding to the generated attribute setting instruction is: the currently set redirected folder, and all subfolders and files under the redirected folder; if the user further specifies that the attribute change should not be applied to all subfolders and files, the redirection object corresponding to the generated attribute setting instruction is: the currently set redirected folder.
[0068] Exemplarily, if a USB flash drive is locally connected to the cloud terminal, the disk redirection method is used to map the USB flash drive to the virtual machine of the cloud desktop to obtain the corresponding virtual USB flash drive. Since the desktop in the cloud can be displayed on the front end, the user can see the virtual USB flash drive on the cloud terminal. Suppose the user initiates an operation to set the file properties of a redirected file (file name a), such as checking "Hide" or unchecking "Hide" on the property setting page of the current redirected file; the cloud desktop client will monitor the operation, and the redirection object corresponding to the generated property setting instruction is: the above-mentioned redirected file a. Suppose the user initiates an operation to set the folder properties of a redirected folder (folder name b), such as checking "Hide" or unchecking "Hide" on the property setting page of the current redirected folder, and selecting "No" when the system asks whether to apply the changes to all subfolders and files; the cloud desktop client will monitor the operation, and the redirection object corresponding to the generated property setting instruction is: the above-mentioned redirected folder b. Assume that a user initiates an operation to set the folder properties of a redirected folder (folder name is b), for example, checking or unchecking "Hide" on the property setting page of the current redirected folder, and selecting "Yes" when the system asks whether to apply the changes to all subfolders and files; the cloud desktop client will monitor the operation, and the redirection object corresponding to the generated property setting instruction is: the above-mentioned redirected folder b, and all subfolders and files under the redirected folder b.
[0069] S204: Based on the file system type, the cloud desktop client calls the system interface of the cloud terminal or calls the kernel newly added interface to set the attribute information of the object corresponding to the redirection object in the attribute setting instruction in the cloud terminal.
[0070] Specifically, the virtual machine calls the file handle operation interface of the cloud desktop client through the callback interface, and the cloud desktop client sets the attribute information of the object in the storage device connected to the physical port of the cloud terminal through the underlying interface. When the user sets the file attribute of the redirected file or the folder attribute of the redirected folder, the file redirector in the virtual machine obtains the IO operation, and the virtual machine transfers the above IO operation to the cloud terminal. The cloud terminal completes the IO operation and returns the operation result to the virtual machine.
[0071] For the exFAT file system, since the underlying kernel does not support the setting of file attributes and folder attributes in the Windows operating system, it is necessary to add a second setting interface in the operating system kernel of the cloud terminal in advance. The second setting interface is an interface for setting the attribute information of the exFAT file system. On this basis:
[0072] When the file system type is FAT or NTFS, the cloud terminal client calls the attribute information setting interface provided by the operating system of the cloud terminal to set the value of the attribute flag corresponding to the target path to set the content of the corresponding attribute information;
[0073] When the file system type is exFAT, the cloud terminal client calls the second setting interface newly added to the operating system kernel of the cloud terminal to set the value of the attribute flag bit corresponding to the target path to set the content of the corresponding attribute information;
[0074] Among them, the target path is the absolute path of the object corresponding to the redirection object in the attribute setting instruction, the attribute flag is set to the set first value, indicating that the content of the attribute information is hidden, and the attribute flag is set to the set second value, indicating that the content of the attribute information is not hidden.
[0075] In a computer, the storage path of a file refers to the storage location of the file in the computer. In an operating system, each file has a unique storage path to identify the location of the file. A storage path usually consists of multiple folder names and file names, which are separated by " / " or "\". The storage path is usually used to specify the absolute path of a file. The absolute path refers to the complete path of a file in a computer, including the root directory, folder name, and file name of the file. For example, in a Windows operating system, the root directory of a file is usually C:\, while in a Linux operating system, the root directory of a file is usually / . If you want to specify the storage path of a file in a Windows operating system, you can use a format similar to "C:\user\username\Documents\file.txt".
[0076] For example, for different file system types, the implementation is as follows:
[0077] For FAT format: ioctl(fd,FAT_IOCTL_SET_ATTRIBUTES,&flag);
[0078] For NTFS format: setxattr(path,"system.ntfs_attrib",&flag,sizeof(flag));
[0079] For exFAT format: ioctl(fd,EXFAT_IOCTL_SET_ATTRIBUTES,&flag);
[0080] Among them, ioctl (input / output control) is a system call dedicated to device input and output operations. The call passes in a request code related to the device, and the function of the system call depends entirely on the request code; setxattr is used to set the value corresponding to the attribute information. For exFAT, the interface "EXFAT_IOCTL_SET_ATTRIBUTES" for setting the attribute information of the exFAT file system can be added in advance in the operating system kernel of the cloud terminal.
[0081] By setting the value of a specific bit in the parameter flag, the content of the attribute information can be set, that is, the specific bit in the flag can be used as the attribute flag bit described in the embodiment of the present application. For example, for a file, if the second bit in the flag is set to 1, it indicates that the file is set as a hidden file, and if the second bit in the flag is set to 0, it indicates that the file is set as a non-hidden file.
[0082] It should be noted that in the embodiment of the present application, step numbers are given only for the convenience of description. There is no strict timing relationship between step S201 and step S203. It can be understood that the display instructions and property setting instructions are generally generated in real time by the cloud desktop client based on the operations initiated by the user. The user can initiate any operation on the redirected files or redirected folders in the virtual storage device at any time according to actual needs.
[0083] The cloud desktop file processing method provided by the embodiment of the present application is that a cloud desktop client is deployed and run on the cloud terminal, a storage device is connected to the physical port of the cloud terminal, and the cloud desktop client maps the storage device to the virtual machine by disk redirection to obtain the corresponding virtual storage device; for the display instruction of the redirected object in the virtual storage device, the virtual machine first obtains the attribute information of the object corresponding to the redirected object from the cloud terminal based on the file system type corresponding to the virtual storage device, and then displays the corresponding redirected object on the cloud desktop client based on the obtained attribute information. Since disk redirection depends on the local mounting of the terminal, the files and folders stored locally in the cloud terminal cannot be accurately displayed after being redirected to the virtual machine in the cloud under the existing disk redirection method. In response to the above problems, the embodiments of the present application provide corresponding attribute information acquisition methods for different file system types, so that the attribute information of the object corresponding to the redirected object can be obtained from the cloud terminal, and the redirected object can be displayed based on the obtained attribute information, so that files and folders with hidden attributes under the Windows operating system can be normally hidden when displayed on a Linux cloud terminal or an Android cloud terminal after disk redirection, which can effectively solve the problem that the redirected objects cannot be accurately displayed in cross-operating system scenarios. In the use scenario of the cloud desktop, the same user experience as on a Windows PC can be achieved, reducing the troubles of the user during use and preventing user misoperation.
[0084] In an embodiment of the present application, a method for obtaining and setting attribute information is provided for storage devices with file system types of FAT and NTFS. In particular, for storage devices with file system type of exFAT, an interface for obtaining and setting attribute information is added to the underlying kernel, so that the attribute information (hidden or non-hidden) of files and folders can be obtained and set directly through the application layer, thereby improving the versatility of the solution.
[0085] In addition, Figure 2 Corresponding to the file processing method of the cloud desktop shown, the embodiment of the present application also provides a file processing system of the cloud desktop.
[0086] First, the functional design architecture of the file processing system of the cloud desktop is explained, such as Figure 3As shown, the functions of the file processing system of the cloud desktop are designed as a hierarchical structure, in which: the local operating system of the cloud terminal uses the Linux operating system or the Android operating system; the virtual machine of the cloud desktop uses the Windows operating system or the Linux operating system; the cloud desktop client is deployed and runs on a local terminal device based on the Linux operating system or the Android operating system, namely the cloud terminal, and the local physical port of the cloud terminal is connected to hardware storage devices such as USB flash drives and hard disks; the cloud desktop client is associated with the virtual machine on the cloud through a redirection channel; when the redirected object in the virtual storage device needs to be displayed, the virtual machine calls the file handle operation interface of the cloud desktop client through the callback interface, and the cloud desktop client obtains the attribute information of the object corresponding to the redirected object in the storage device connected to the physical port through the system interface call or the kernel new interface call according to the file system type (FAT, NTFS or exFAT), and based on the obtained attribute information, the corresponding redirected object in the virtual storage device is displayed on the cloud desktop client.
[0087] Figure 4 4 is a structural diagram of a cloud desktop file processing system 400 provided in an embodiment of the present application, including a cloud desktop virtual machine 402 and a cloud desktop client 401, the cloud desktop client 401 is deployed and runs on a front-end cloud terminal, and the virtual machine 402 is deployed and runs in a cloud server, wherein:
[0088] The virtual machine 402 is used to respond to a display instruction for a redirected object in a virtual storage device on a cloud desktop, and based on the file system type corresponding to the virtual storage device, obtain attribute information of an object corresponding to the redirected object in the display instruction from a cloud terminal; based on the obtained attribute information, display the corresponding redirected object in the virtual storage device on the cloud desktop client 401; wherein the redirected object includes a redirected file and / or a redirected folder, the attribute information includes file attributes and / or folder attributes, and the virtual storage device is obtained by mapping a storage device connected to the cloud terminal to the virtual machine 402 in a disk redirection manner;
[0089] The cloud desktop client 401 is used to present the corresponding redirection object in the virtual storage device at the front end.
[0090] In an optional implementation, the cloud desktop client 401 is further used to obtain the file system type corresponding to the storage device when performing disk redirection on the storage device, and carry the file system type corresponding to the storage device in the redirection message and send it to the virtual machine 402;
[0091] Correspondingly, the virtual machine 402 is also used to receive the redirection message sent by the cloud desktop client 401, and add a corresponding file system type to the virtual storage device based on the received redirection message.
[0092] In an optional implementation, the cloud desktop client 401 is also used to generate and send a display instruction for the redirection object when monitoring an operation of opening a virtual storage device or any redirected folder in the virtual storage device; wherein the redirection object corresponding to the display instruction is: all redirected files and / or redirected folders in the root directory of the virtual storage device or in the next-level directory entered by opening the current redirected folder.
[0093] Correspondingly, virtual machine 402 is specifically used to obtain the file system type corresponding to the virtual storage device; based on the file system type, the cloud desktop client 401 calls the system interface of the cloud terminal or calls the kernel new interface to obtain the attribute information of the object corresponding to the redirected object in the cloud terminal.
[0094] Specifically, when the file system type is FAT or NTFS, the cloud desktop client 401 calls the attribute information acquisition interface provided by the operating system of the cloud terminal to obtain the value of the attribute flag in the function return value; when the file system type is exFAT, the cloud desktop client 401 calls the first setting interface newly added to the operating system kernel of the cloud terminal to obtain the value of the attribute flag in the function return value; wherein the first setting interface is an interface for obtaining exFAT file system attribute information; the content of the attribute information is determined based on the value of the attribute flag.
[0095] In an optional implementation, the virtual machine 402 is specifically used to display the corresponding redirection object on the cloud desktop client 401 when the content of the obtained attribute information is not hidden; when the content of the obtained attribute information is hidden, based on the pre-set folder options for the virtual machine, the corresponding redirection object in the virtual storage device is displayed on the cloud desktop client 401.
[0096] Specifically, when the folder option is not to display hidden files or folders, the corresponding redirection object is not displayed on the cloud desktop client 401, and when the folder option is to display hidden files or folders, the corresponding redirection object is displayed on the cloud desktop client 401.
[0097] In an optional implementation, the cloud desktop client 401 is also used to generate a property setting instruction for the redirection object when an operation of setting the file attributes of any redirected file in the virtual storage device is monitored; wherein the redirection object corresponding to the property setting instruction is: the currently set redirected file; or, when an operation of setting the folder attributes of any redirected folder in the virtual storage device is monitored, a property setting instruction for the redirection object is generated; wherein the redirection object corresponding to the property setting instruction is: the currently set redirected folder, or the currently set redirected folder and all subfolders and files under the redirected folder.
[0098] Correspondingly, virtual machine 402 is also used to respond to the attribute setting instruction for the redirected object in the virtual storage device on the cloud desktop, and obtain the file system type corresponding to the virtual storage device; based on the file system type, through the cloud desktop client to the cloud terminal system interface call or kernel new interface call, set the attribute information of the object corresponding to the redirected object in the attribute setting instruction in the cloud terminal.
[0099] Specifically, when the file system type is FAT or NTFS, the cloud terminal client calls the attribute information setting interface provided by the operating system of the cloud terminal to set the value of the attribute flag corresponding to the target path to set the content of the corresponding attribute information; when the file system type is exFAT, the cloud terminal client calls the second setting interface newly added to the operating system kernel of the cloud terminal to set the value of the attribute flag corresponding to the target path to set the content of the corresponding attribute information; wherein the second setting interface is an interface for setting the attribute information of the exFAT file system, and the target path is the absolute path of the object corresponding to the redirection object in the attribute setting instruction.
[0100] The file processing system of the cloud desktop provided in the embodiment of the present application can effectively solve the problem that redirected objects cannot be accurately displayed in cross-operating system scenarios. In the use scenario of the cloud desktop, the same user experience as on a Windows PC can be achieved, reducing the troubles of the user during the use process and preventing user misoperation.
[0101] Obviously, the virtual machine in the file processing system of the cloud desktop in the embodiment of the present application can be used as the above Figure 2 The execution body of the cloud desktop file processing method shown in FIG. Figure 2 The functions realized are as follows. Since the principles are the same, they will not be described here.
[0102] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0103] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0104] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0105] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, realizing the virtual machine of the cloud desktop at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0106] In response to a display instruction for a redirected object in a virtual storage device on a cloud desktop, based on a file system type corresponding to the virtual storage device, attribute information of an object corresponding to the redirected object is obtained from a cloud terminal run by a cloud desktop client; wherein the redirected object includes a redirected file and / or a redirected folder, the attribute information includes file attributes and / or folder attributes, and the virtual storage device is obtained by mapping a storage device connected to the cloud terminal to the virtual machine in a disk redirection manner;
[0107] Based on the acquired attribute information, the corresponding redirection object in the virtual storage device is displayed on the cloud desktop client.
[0108] The above application Figure 2The file processing method of the cloud desktop disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in software form. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0109] Of course, in addition to software implementation methods, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0110] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to execute Figure 2 The method of the embodiment shown is specifically used to perform the following operations:
[0111] In response to a display instruction for a redirected object in a virtual storage device on a cloud desktop, based on a file system type corresponding to the virtual storage device, attribute information of an object corresponding to the redirected object is obtained from a cloud terminal run by a cloud desktop client; wherein the redirected object includes a redirected file and / or a redirected folder, the attribute information includes file attributes and / or folder attributes, and the virtual storage device is obtained by mapping a storage device connected to the cloud terminal to the virtual machine in a disk redirection manner;
[0112] Based on the acquired attribute information, the corresponding redirection object in the virtual storage device is displayed on the cloud desktop client.
[0113] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0114] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0115] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0116] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0117] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0118] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A file processing method for a cloud desktop, characterized in that: Virtual machines used for cloud desktops include: In response to a display instruction for a redirected object in a virtual storage device on a cloud desktop, based on a file system type corresponding to the virtual storage device, attribute information of an object corresponding to the redirected object is obtained from a cloud terminal run by a cloud desktop client; wherein the redirected object includes a redirected file and / or a redirected folder, the attribute information includes file attributes and / or folder attributes, and the virtual storage device is obtained by mapping a storage device connected to the cloud terminal to the virtual machine in a disk redirection manner; Based on the acquired attribute information, the corresponding redirection object in the virtual storage device is displayed on the cloud desktop client.
2. The method according to claim 1, characterized in that: The method further comprises: Receiving a redirection message sent by the cloud desktop client when performing disk redirection on the storage device; wherein the redirection message carries a file system type corresponding to the storage device and obtained by the cloud desktop client; Based on the received redirection message, a corresponding file system type is added to the virtual storage device.
3. The method according to claim 2, characterized in that The acquiring, based on the file system type corresponding to the virtual storage device, attribute information of an object corresponding to the redirection object from a cloud terminal run by a cloud desktop client, includes: Obtaining a file system type corresponding to the virtual storage device; Based on the file system type, the cloud desktop client calls the system interface of the cloud terminal or calls the kernel new interface to obtain the attribute information of the object corresponding to the redirected object in the cloud terminal; wherein the content of the attribute information includes hidden or non-hidden.
4. The method according to claim 3, characterized in that: The acquiring, based on the file system type, the attribute information of the object corresponding to the redirection object in the cloud terminal by calling the system interface or the kernel newly added interface of the cloud terminal by the cloud desktop client, includes: In the case where the file system type is a file allocation table FAT or a new technology file system NTFS, the cloud desktop client calls an attribute information acquisition interface provided by the operating system of the cloud terminal to obtain the value of the attribute flag in the function return value; In the case where the file system type is the extended file configuration table exFAT, the cloud desktop client calls a first setting interface newly added to the operating system kernel of the cloud terminal to obtain the value of the attribute flag in the function return value; wherein the first setting interface is an interface for obtaining exFAT file system attribute information; The content of the attribute information is determined based on the value of the attribute flag; wherein the value of the attribute flag is a set first value, indicating that the content of the attribute information is hidden, and the value of the attribute flag is a set second value, indicating that the content of the attribute information is not hidden.
5. The method according to claim 2, characterized in that: The step of displaying the corresponding redirection object in the virtual storage device on the cloud desktop client based on the acquired attribute information includes: In the case where the content of the acquired attribute information is not hidden, displaying a corresponding redirection object on the cloud desktop client; In the case that the content of the acquired attribute information is hidden, based on the preset folder options for the virtual machine, the corresponding redirection object in the virtual storage device is displayed on the cloud desktop client.
6. The method according to claim 5, characterized in that The displaying, based on the pre-set folder option for the virtual machine, the corresponding redirection object in the virtual storage device on the cloud desktop client includes: When the folder option is not to display hidden files or folders, the corresponding redirection object is not displayed on the cloud desktop client. When the folder option is to display hidden files or folders, the corresponding redirection object is displayed on the cloud desktop client.
7. The method according to claim 2, characterized in that The method further comprises: In response to an instruction for setting a property of a redirection object in a virtual storage device on a cloud desktop, obtaining a file system type corresponding to the virtual storage device; Based on the file system type, the cloud desktop client calls the system interface of the cloud terminal or calls the kernel new interface, and sets the attribute information of the object corresponding to the redirected object in the cloud terminal; wherein the content of the attribute information includes hidden or non-hidden.
8. The method according to claim 7, characterized in that The step of setting attribute information of an object corresponding to the redirection object in the cloud terminal by calling a system interface or a kernel newly added interface of the cloud terminal through the cloud desktop client based on the file system type includes: In the case where the file system type is FAT or NTFS, the cloud terminal client calls the attribute information setting interface provided by the operating system of the cloud terminal to set the value of the attribute flag corresponding to the target path to set the content of the corresponding attribute information; In the case where the file system type is exFAT, the cloud terminal client calls a second setting interface newly added to the operating system kernel of the cloud terminal to set the value of the attribute flag corresponding to the target path to set the content of the corresponding attribute information; wherein the second setting interface is an interface for setting the attribute information of the exFAT file system; Among them, the target path is the absolute path of the object corresponding to the redirected object, the attribute flag is set to a set first value, indicating that the content of the attribute information is hidden, and the attribute flag is set to a set second value, indicating that the content of the attribute information is not hidden.
9. The method according to any one of claims 1 to 8, characterized in that: The cloud terminal uses a Linux operating system or an Android operating system, and the virtual machine uses a Windows operating system or a Linux operating system; The storage device includes at least one of a universal serial bus (USB) flash drive, a mobile hard disk, and a built-in hard disk.
10. A file processing system for a cloud desktop, characterized in that: It includes a cloud desktop virtual machine and a cloud desktop client, wherein the cloud desktop client is deployed and runs on a front-end cloud terminal, and the virtual machine is deployed and runs in a cloud server, wherein: The virtual machine is used to respond to a display instruction for a redirected object in a virtual storage device on a cloud desktop, and based on the file system type corresponding to the virtual storage device, obtain attribute information of an object corresponding to the redirected object from the cloud terminal; based on the obtained attribute information, display the corresponding redirected object in the virtual storage device on the cloud desktop client; wherein the redirected object includes a redirected file and / or a redirected folder, the attribute information includes file attributes and / or folder attributes, and the virtual storage device is obtained by mapping a storage device connected to the cloud terminal to the virtual machine by disk redirection; The cloud desktop client is used to present the corresponding redirection object in the virtual storage device at the front end.
11. The system according to claim 10, characterized in that The cloud desktop client is also used to generate and send a display instruction of the redirection object when monitoring an operation of opening the virtual storage device or any redirected folder in the virtual storage device; wherein the redirection object corresponding to the display instruction is: all redirected files and / or redirected folders in the root directory of the virtual storage device or in the next-level directory entered by opening the current redirected folder.
12. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method as claimed in any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 9.
Citation Information
Cited By
Redirection method, cloud terminal, cloud desktop and computer readable storage medium
CN120750922A