Cross-terminal file unified management method and system and storage medium
By establishing a communication connection between the cloud server and the terminal device, unified file management on multiple terminal devices is achieved, and the problems of complex file management and privacy leakage in the existing technology are solved, and efficient and secure file management is achieved.
Patent Information
- Application Number
- CN202310988204.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to achieve unified management of files on multiple terminal devices, and the operation is complex and cumbersome. Since files are stored on public external terminal devices, privacy leakage is easily caused.
By establishing a communication connection between the cloud server and the terminal device, the unified display and management of the file directory structure is realized. Users can see a unified directory structure on any terminal device, performing file search, deletion, viewing, moving and copying operations. File metadata and directory metadata are maintained on terminal devices and the cloud at the same time to ensure privacy and security.
It realizes unified file management across terminals, simplifies operational processes, improves management efficiency, and ensures data security and privacy protection through cloud metadata synchronization.
Smart Images

Figure CN119441139A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of file management technology, and in particular to a unified file management method, system and storage medium across terminals. Background Technology
[0002] Existing file management solutions can basically solve the problem of users managing files in the operating system in a graphical way, lowering the barrier to entry for users to use computers. However, with the widespread use of personal terminals (PCs and smartphones), most people use multiple terminal devices simultaneously, such as home computers, office computers, and smartphones. Therefore, how to manage files on multiple terminal devices in a unified manner has become an urgent problem to be solved.
[0003] Existing solutions commonly address cross-device file sharing through LAN NAS storage and shared cloud disks. However, both shared cloud disks and LAN NAS storage create an external storage space outside the device as a supplement to the local device storage. This makes the process of managing files on different devices complex, cumbersome, and inefficient. Furthermore, storing files on public external devices can easily lead to privacy leaks, thereby harming users' personal interests. Summary of the Invention
[0004] The purpose of this application is to provide a unified file management method, system, and storage medium across terminals. Users can see files in a unified directory structure on any terminal device. Users can achieve unified management across terminals under this file directory structure, such as file search, batch file deletion, file viewing, batch file moving, and batch file copying. Furthermore, file metadata and directory metadata can be maintained on both the terminal device and the cloud. When the terminal metadata is damaged, it can be quickly restored through the cloud. The file content of the terminal device will not be placed on external terminal devices, thus ensuring privacy and security.
[0005] In a first aspect, embodiments of the present invention provide a cross-terminal unified file management method, applied to a unified file management system, the unified file management system including a cloud server and a plurality of terminal devices, the cloud server being communicatively connected to the plurality of terminal devices; the method includes:
[0006] A file directory structure is displayed on each of the terminal devices, wherein the file directory structure has at least two hierarchical directories and at least one file content under each hierarchical directory, the hierarchical directories are associated with directory metadata, the file content is associated with file metadata, and the file content is stored in the local database of at least one of the terminal devices;
[0007] When the first terminal device receives a management operation instruction triggered based on the hierarchical directory or the file content, it generates an event stream based on the management operation instruction, the hierarchical directory and the directory metadata or the file content and the file metadata.
[0008] The first terminal device synchronizes the event stream to the cloud server;
[0009] The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device can perform management operations on the hierarchical directory or the file content according to the management operation instructions.
[0010] In some embodiments, the directory metadata includes at least one of the following: hierarchical directory ID, directory owner user ID, directory parent directory ID, directory type, unique ID of the terminal where the directory is located, directory download status, and directory name;
[0011] The file metadata includes at least one of the following: file ID, terminal device ID where the file content is located, file content identifier, file owner ID, parent directory ID, file name, file size, file type, file description information, and file status information.
[0012] In some embodiments, when the first terminal device receives a management operation instruction triggered based on the hierarchical directory or the file content, generating an event stream based on the management operation instruction, the hierarchical directory and the directory metadata, or the file content and the file metadata, includes:
[0013] When the first terminal device detects a data change in the hierarchical directory or the file content, it generates a first data change event based on the first directory metadata corresponding to the hierarchical directory and the first file metadata corresponding to the file content.
[0014] The first terminal device stores the first data change event in a local event queue and persists the first data change event to the local database of the first terminal device.
[0015] In some embodiments, the first terminal device synchronizes the event stream to the cloud server, including:
[0016] When the first terminal device communicates with the cloud server, the cloud server receives the first data change event and writes the first data change event into the cloud event queue to synchronize the first data change event to the cloud database of the cloud server.
[0017] The cloud server replays the first data change event to generate a second data change event;
[0018] The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs management operations on the first directory metadata associated with the directory entry and the associated first file content according to the management operation instructions, including:
[0019] The cloud server writes the second data change event into the cloud event queue;
[0020] When the second terminal device corresponding to the second data change event connects to the cloud server, the cloud server sends the second data change event to the second terminal device in the cloud event queue;
[0021] The second terminal device receives the second data change event and replays the second data change event to obtain the third data change event, so as to synchronize the metadata corresponding to the second data change event to the second terminal device.
[0022] In some embodiments, after writing the first data change event to a cloud event queue, the method further includes:
[0023] The first terminal device marks the first data change event in the local database as sent.
[0024] In some embodiments, the management operation instruction is a file deletion instruction. When the first terminal device receives a management operation instruction triggered based on the file content, an event stream is generated based on the management operation instruction, the file content, and the file metadata, including:
[0025] When the first terminal device receives a file deletion instruction triggered based on the file content, it generates a deletion event stream based on the second target metadata corresponding to the file content;
[0026] The event stream is synchronized to each second terminal device via the cloud server, so that each second terminal device can perform management operations on the file content according to the management operation instructions, including:
[0027] The first terminal device reports the deletion event stream to the cloud server, so that the cloud server can send the deletion event stream to the second terminal device corresponding to the file deletion instruction;
[0028] The second terminal device deletes the corresponding metadata tag based on the deletion event stream, and deletes the local file corresponding to the metadata tag.
[0029] In some embodiments, after deleting the local file corresponding to the metadata tag, the method further includes:
[0030] The second terminal device generates a first metadata change synchronization event and reports the first metadata change synchronization event to the cloud server, so that after receiving the first metadata change synchronization event, the cloud server marks and deletes the first metadata corresponding to the first metadata change synchronization event in the cloud database.
[0031] In some embodiments, the method further includes:
[0032] When the third terminal device receives a cross-terminal file query instruction, it initiates a file query request to the cloud server;
[0033] After receiving the file query request, the cloud server searches the cloud database and retrieves the relevant secondary metadata.
[0034] The cloud server returns the second metadata to the third terminal device so that the third terminal device can display the second metadata.
[0035] In some embodiments, the method further includes:
[0036] Upon receiving a cross-terminal file move operation instruction on the fourth terminal device, a copy metadata event stream is generated.
[0037] The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs management operations on the first directory metadata associated with the directory entry and the associated first file content according to the management operation instructions, including:
[0038] The fourth terminal device reports the copied metadata event stream to the cloud server;
[0039] The cloud server sends the replicated metadata event stream to the corresponding fifth terminal device;
[0040] The fifth terminal device adds corresponding metadata based on the copy metadata event, and downloads the file corresponding to the copy metadata event to the local database of the fifth terminal device.
[0041] In some embodiments, after generating the replication metadata event stream, the method further includes:
[0042] The fourth terminal device deletes the metadata corresponding to the file move instruction.
[0043] In some embodiments, the method further includes:
[0044] The fifth terminal device generates a second metadata change synchronization event and reports the second metadata change synchronization event to the cloud server, so that after receiving the second metadata change synchronization event, the cloud server will incrementally update the metadata in the cloud server's database.
[0045] Secondly, embodiments of the present invention provide a unified file management system across terminals, including a cloud server and several terminal devices, wherein the cloud server is communicatively connected to the several terminal devices.
[0046] Thirdly, embodiments of the present invention provide a non-volatile computer-readable storage medium storing computer-executable instructions, which, when executed by a unified file management system, implement the steps of the cross-terminal unified file management method as described in any of the first aspects.
[0047] The cross-terminal unified file management method, system, and storage medium of this invention displays a file directory structure on each terminal device. This file directory structure has at least two hierarchical directories, and each hierarchical directory contains at least one file content for easy viewing by the user. The hierarchical directories are associated with directory metadata, and the file content is associated with file metadata. The file content is stored in a local database on at least one of the terminal devices, thereby enabling the file content in the local database of at least one terminal device to be displayed on all terminal devices. When a terminal device receives a management operation instruction for a hierarchical directory or file content in the file directory structure, a corresponding event stream is generated and synchronized to a cloud server. The cloud server then synchronizes the event stream to other terminal devices, allowing each terminal device to perform management operations on the hierarchical directory or file content according to the management operation instruction. This enables unified file management for users on terminal devices other than their local terminal devices, avoiding metadata conflicts. Furthermore, since file metadata and directory metadata are maintained simultaneously on both the cloud server and the terminal devices, metadata corruption on a terminal device can be quickly recovered through the cloud server. Attached Figure Description
[0048] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0049] Figure 1This is a schematic diagram of the structure of a unified document management system according to an embodiment of this application;
[0050] Figure 2 This is a schematic block diagram of storage resources according to an embodiment of this application;
[0051] Figure 3 This is a flowchart illustrating one embodiment of the cross-terminal unified file management method of this application.
[0052] Figure 4 This is a schematic diagram of the file directory structure according to an embodiment of this application;
[0053] Figure 5 This is a schematic diagram illustrating the uplink synchronization of metadata from a terminal device to a cloud server according to an embodiment of this application.
[0054] Figure 6 This is a schematic diagram illustrating the downlink synchronization of metadata from a terminal device to a cloud server according to an embodiment of this application;
[0055] Figure 7 This is a schematic diagram illustrating cross-terminal batch file deletion according to an embodiment of this application;
[0056] Figure 8 This is a schematic diagram illustrating cross-terminal file search according to an embodiment of this application;
[0057] Figure 9 This is a schematic diagram illustrating the movement or copying of files across terminals according to an embodiment of this application;
[0058] Figure 10 This is a schematic diagram of the structure of one embodiment of the cross-terminal unified file management device of this application;
[0059] Figure 11 This is a schematic diagram of the hardware structure of the controller in one embodiment of the terminal device of this application. Detailed Implementation
[0060] The present application will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. In addition, the terms "first," "second," and "third" used herein do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0063] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0064] Furthermore, the technical features involved in the various embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0065] In existing file management solutions, users manage files on multiple devices separately, making unified management of files across different devices inconvenient. Even solutions with LAN NAS storage and shared cloud disks to address cross-device file sharing still require supplementary storage outside the devices, making file management on each device complex. Furthermore, storing files on third-party storage can easily lead to privacy breaches.
[0066] To address the aforementioned issues, this application proposes a cross-terminal unified file management method, system, and storage medium. The unified file management system includes a cloud server and several terminal devices, with the cloud server communicatively connected to the terminal devices. The cross-terminal unified file management method includes: displaying a file directory structure on each terminal device, wherein the file directory structure has at least two hierarchical directories, and each hierarchical directory contains at least one file content. The hierarchical directories are associated with directory metadata, and the file content is associated with file metadata. The file content is stored in a local database on at least one terminal device. When a first terminal device receives a management operation instruction triggered based on the hierarchical directory or the file content, it generates an event stream based on the management operation instruction, the hierarchical directory, and the directory metadata, or the file content and the file metadata. The first terminal device synchronizes the event stream to the cloud server. The cloud server synchronizes the event stream to each second terminal device, enabling each second terminal device to perform management operations on the hierarchical directory or the file content according to the management operation instruction.
[0067] Through the cross-terminal unified file management method, system and storage medium of this application, users of the present invention can see a unified directory structure on any terminal device, realizing unified management across terminals. Furthermore, file metadata and directory metadata can be maintained simultaneously on the terminal device and in the cloud. When the terminal metadata is damaged, it can be quickly restored through the cloud. The file content of the terminal device will not be placed on an external terminal device, thus ensuring privacy and security.
[0068] Furthermore, the cross-terminal unified file management system of this application, such as Figure 1 As shown, the unified file management system includes a cloud server and several terminal devices, and the cloud server is communicatively connected to the several terminal devices.
[0069] The terminal device can be a computer, mobile terminal, public cloud disk, local area network NAS storage, etc., and is not limited thereto. Any electronic device with storage function can be considered as the terminal device of this application.
[0070] The terminal device has three components: a file manager, a terminal storage service, and a storage driver, and these three components are packaged into a single APP (Application).
[0071] The file manager helps users manage directories and files in the operating system in a graphical way, and the file manager establishes a websocket connection with the terminal storage service.
[0072] Terminal storage services are used to maintain the metadata of local files and directories on terminal devices, implement directory tree management on terminal devices, and simultaneously establish WebSocket connections with file managers and storage drivers.
[0073] The terminal device also has a local database for storing metadata related to files and directories in the terminal storage service.
[0074] The storage driver is responsible for file upload and download operations. All file-related operations of the terminal storage service are submitted to the terminal storage driver for completion.
[0075] The cloud server is equipped with cloud storage services and a storage gateway. The cloud storage service is used to maintain the metadata related to files and directories on all terminal devices, and achieves bidirectional data synchronization between the cloud storage service and the terminal storage service through event stream synchronization.
[0076] The storage gateway is deployed in the cloud and acts as a relay station for cross-terminal file transfer. It does not persistently store files. The file sending terminal (a terminal device) uploads the file to the storage gateway, and the file receiving terminal (a terminal device) downloads the file from the storage gateway.
[0077] Storage gateways can be deployed in the cloud or on edge servers, depending on the scenario. When deployed on an edge server, file synchronization is performed on the intranet, which provides higher security.
[0078] The terminal storage service and the cloud storage service are connected via HTTPS to synchronize file and directory metadata. The storage gateway registers with the cloud storage service via HTTPS and reports file synchronization-related status information. The terminal storage service can obtain the address information of the storage gateway from the cloud storage service and notify the storage driver.
[0079] The cross-terminal unified file management system of this application uses the storage resources of various terminal devices as the storage resources of users. It converts the physical storage space of various terminal devices (such as computers, mobile terminals, public cloud disks and local area network NAS storage, etc.) into a unified virtual storage space, with each storage space as an independent directory tree.
[0080] like Figure 2 As shown, the storage resources of home computers, office computers, mobile terminals, public cloud drives, and LAN NAS terminal devices are converted into unified virtual storage spaces, namely home space, shared space, work space, and custom space, with each virtual storage space as an independent directory tree.
[0081] Alternatively, each virtual space can contain a directory tree of multiple storage resources, so that the storage space and its directory tree result seen by the user on any terminal device are the same, enabling the user to manage files across terminals or storage resources in various storage spaces.
[0082] A unified file management system across terminals displays a file directory structure on each terminal device. This file directory structure has at least two hierarchical directories, and each hierarchical directory contains at least one file. The hierarchical directories are associated with directory metadata, and the file content is associated with file metadata. The file content is stored in the local database of at least one terminal device. When a first terminal device receives a management operation instruction triggered based on the hierarchical directory or the file content, it generates an event stream based on the management operation instruction, the hierarchical directory, and the directory metadata, or the file content and the file metadata. The event stream is synchronized to the cloud server. The cloud server then synchronizes the event stream to each second terminal device, enabling each second terminal device to perform management operations on the hierarchical directory or the file content according to the management operation instruction.
[0083] With a unified file management system across terminals, users can see files in a unified directory structure on any terminal device. Users can perform unified management across terminals under this directory structure, such as file search, batch file deletion, file viewing, batch file moving, and batch file copying. Furthermore, file metadata and directory metadata can be maintained on both the terminal device and the cloud. When the terminal metadata is damaged, it can be quickly restored through the cloud. The file content of the terminal device will not be placed on external terminal devices, ensuring privacy and security.
[0084] Please see Figure 3 , Figure 3 This is a flowchart illustrating a cross-terminal unified file management method provided in an embodiment of this application. The method is applied to a unified file management system and can be executed by the processor 111 of a terminal device within the unified file management system. Figure 3 As shown, the method includes the following steps S301 to S304.
[0085] S301: Display a file directory structure on each of the terminal devices, wherein the file directory structure has at least two hierarchical directories, and each hierarchical directory has at least one file content, the hierarchical directories are associated with directory metadata, the file content is associated with file metadata, and the file content is stored in the local database of at least one of the terminal devices.
[0086] like Figure 4As shown, each terminal device is equipped with a file manager. The file manager displays a file directory structure with at least two levels of directories, and each level of directory contains at least one file. For example, the first level of directories are workspace and home space, and the second level of directories are learning documents, training documents, and tools. The document contents are 11.pdf, 11.ppt, and 11.exe.
[0087] The hierarchical directory is associated with directory metadata, the file content is associated with file metadata, and the file content is stored in the local database of at least one of the terminal devices. For example, document 11.pdf is stored in the local database of terminal device A.
[0088] Directory metadata is stored in the local database of the terminal device in the form of a directory table, including at least one of the following: hierarchical directory ID, user ID to which the directory belongs, parent directory ID to which the directory belongs, directory type, unique ID of the terminal where the directory is located, directory download status, and directory name.
[0089] Among them, the hierarchical directory ID is a uid, which is a row-unique ID and a unique identifier for the directory. The uid of the directory created by different terminal devices is also different, which facilitates the synchronization of metadata based on event streams.
[0090] The directory's owner user ID is user_uid. Since each terminal device is managed through an app, and users log in to their accounts via the app to access the file manager interface of the unified file management system, the directory's owner user ID is required for account login.
[0091] The ID of the parent directory to which the directory belongs is parent_dir_uid. For example, if the first-level directory is the workspace, which is the top-level directory, then the ID of its parent directory is 0; if the second-level directory is the learning documents, then the ID of its parent directory is the workspace level directory.
[0092] The directory type is dir_type. In this application, the directory types include ordinary directories, shared spaces, workspaces, home spaces, etc., and the icons for different directory types are different.
[0093] The unique ID of the terminal where the directory is located is device_id, which is the unique ID of the terminal device where the directory is located. If the directory at this level is on a cloud drive or NAS, then this field is the unique ID of the user's cloud drive space or NAS space.
[0094] The directory download status indicates whether the directory at this level has been downloaded to the terminal device's file system; 0 indicates not downloaded, and 1 indicates downloaded.
[0095] The directory name is dir_name. For example, if the first-level directory is the workspace, its directory name is workspace.
[0096] Directory metadata is used to represent the relevant attribute information and status information of each directory level, and to represent the relationship between each directory level and each terminal device.
[0097] The file metadata includes at least one of the following: file ID, terminal device ID where the file content is located, file content identifier, file owner ID, parent directory ID, file name, file size, file type, file description information, and file status information.
[0098] The terminal device ID where the file content is located is device_id, which is a unique ID of the terminal device where the file is located. If the file is on a cloud drive or NAS, this field is a unique ID of the user's cloud drive space or NAS space.
[0099] The file ID, or uid, is a unique ID for each line and is a unique identifier for the file. This field is unrelated to the file content. Even if files created by different terminal devices have the same cid, their uids will be different. This facilitates metadata synchronization based on event streams, eliminating the need for database-based metadata synchronization and avoiding metadata conflicts.
[0100] The file content identifier (file_cid, file content ID) is a unique identifier for the file content, and file_cid changes as the file content changes.
[0101] The file's owner's user ID is user_uid, similar to the directory's owner's user ID. Since each terminal device is managed through an app, and users log in to their accounts via the app to access the file manager interface of the unified file management system, the file's owner's user ID is required for account login.
[0102] The ID of the parent directory to which the file belongs is parent_dir_uid. Similar to the ID of the parent directory to which a directory belongs, the ID of the parent directory to which the file 11.pdf belongs is the directory at the level of "learning documents".
[0103] The file name is the name of the file in the file manager.
[0104] File size refers to the size of the file content.
[0105] File type refers to the type of file content, such as image / jpg, or for example... Figure 4 The file type of 11.pdf is PDF.
[0106] The file description information describes the contents of the file.
[0107] The file status information indicates whether the file has been downloaded to the terminal file system. Once downloaded, the user can open the file directly. 0 indicates that it has not been downloaded; 1 indicates that it has been downloaded.
[0108] Of course, file metadata can also include the file content update time, file creation time, and whether the file has been deleted from storage space; it is not limited to these.
[0109] By associating directory metadata with hierarchical directories and file metadata with file content, and storing the file content in the local database of at least one terminal device, users can see a virtual file directory structure on their terminal devices. Under this virtual file directory structure, there are also file contents in the local databases of each terminal device. Users can manage the hierarchical directories or file contents, thereby realizing cross-terminal file management.
[0110] S302: When the first terminal device receives a management operation instruction triggered based on the hierarchical directory or the file content, it generates an event stream based on the management operation instruction, the hierarchical directory and the directory metadata or the file content and the file metadata.
[0111] S303: Synchronize the event stream to the cloud server;
[0112] S304: The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs management operations on the hierarchical directory or the file content according to the management operation instructions.
[0113] Specifically, when a terminal device receives a management operation instruction, an event stream is generated based on the management operation instruction, the hierarchical directory and the directory metadata, or the file content and the file metadata.
[0114] Management operation commands include commands for managing file content such as metadata synchronization commands, file deletion commands, file query commands, and file movement commands, as well as commands for managing directories, such as modifying, adding, and deleting hierarchical directories, which are not limited here.
[0115] In some of these implementations, such as Figure 5 As shown, if the metadata of the terminal device is synchronized to the cloud server, then step S302 may include:
[0116] When the first terminal device detects a data change in the hierarchical directory or the file content, it generates a first data change event based on the first directory metadata corresponding to the hierarchical directory and the first file metadata corresponding to the file content.
[0117] The first terminal device stores the first data change event in a local event queue and persists the first data change event to the local database of the first terminal device.
[0118] Specifically, the first terminal device can be any terminal device. After logging into the APP on a terminal device, the user will see the file directory structure displayed on the file manager of the terminal device, such as... Figure 4 As shown, when a user performs operations on the hierarchical directory or file content on the first terminal device, a management operation command is triggered, causing the terminal storage service of the first terminal device to detect the change in the hierarchical directory or file content. Based on the first directory metadata corresponding to the hierarchical directory and the first file metadata corresponding to the file content, a first data change event is generated.
[0119] Then, the first terminal device stores the first data change event in the local event queue of the first terminal device. At the same time, in order to prevent the first data change event from being lost, the first data change event is persistently stored in the local database of the first terminal device.
[0120] Since the first data change event is persistently stored in the local database of the first terminal device, it can be synchronized to the cloud server in real time when the first terminal device is connected to the cloud server; if the first terminal device is not currently connected to the cloud server, it can be synchronized to the cloud server with a delay when the first terminal device is connected to the cloud server.
[0121] The event queue refers to all file-related events used to manage the storage service, and is divided into cloud event queues and local event queues. In this embodiment, the local event queue refers to all file-related events for the first terminal device to manage its own terminal storage service.
[0122] The cloud server is equipped with an event receiver, which is a functional component in the storage service used to receive events from the event queue. It is divided into cloud event receivers and terminal event receivers.
[0123] When the first terminal device is connected to the cloud server (i.e., connected to the internet), the cloud event receiver receives the first data change event uploaded by the first terminal device. Step S303 can include: when the first terminal device is connected to the cloud server, the cloud server receives the first data change event and writes it into the cloud event queue; subsequently, the first terminal device marks the first data change event in its local database as sent, thus achieving local marking by the first terminal device.
[0124] The cloud server replays the first data change event to generate a second data change event. That is, the cloud server re-executes the first data change event, thereby updating it and obtaining the second data change event. This enables the metadata of the first terminal device to be synchronized to the cloud server, completing the entire process of synchronizing local data changes from the first terminal device to the cloud server.
[0125] Then step S304 may include:
[0126] The cloud server writes the second data change event into the cloud event queue;
[0127] When the second terminal device corresponding to the second data change event connects to the cloud server, the cloud server sends the second data change event to the second terminal device in the cloud event queue;
[0128] The second terminal device receives the second data change event and replays the second data change event to obtain the third data change event, so as to synchronize the metadata corresponding to the second data change event to the second terminal device.
[0129] Specifically, such as Figure 6 As shown, it also includes downlink synchronization processing of metadata between terminal devices and cloud servers. That is, when data changes, if the cloud server receives a second data change event, it will encapsulate the second data change event and then write it into the cloud event queue.
[0130] Similarly, when the second terminal device corresponding to the second data change event connects to the cloud server, that is, when connecting to the network, the cloud server retrieves the second data change events that are not corresponding to the local service from the cloud queue in sequence and sends the second data change events to the second terminal device.
[0131] The second terminal device receives the second data change event and replays it, meaning it re-executes the second data change event to update it and obtain the third data change event. This allows it to synchronize the metadata corresponding to the second data change event to the second terminal device, thus completing the transfer of cloud-based data changes to the local data on the second terminal device.
[0132] In some implementations, the management operation command is a file deletion command, such as... Figure 7 As shown, step S302 may include:
[0133] When the first terminal device receives a file deletion instruction triggered based on the file content, it generates a deletion event stream based on the second target metadata corresponding to the file content.
[0134] Then step S304 may include:
[0135] The cloud server reports the deletion event stream to the cloud server so that the cloud server can send the deletion event stream to the second terminal device corresponding to the file deletion instruction;
[0136] The second terminal device deletes the corresponding metadata tag based on the deletion event stream, and deletes the local file corresponding to the metadata tag.
[0137] Specifically, after a user sees the file directory structure on the first terminal device, they wish to delete the file content under a certain level directory. At this time, the user performs a deletion operation on the file content under a certain level directory. Then, the first terminal device receives a file deletion instruction triggered based on the file content. The terminal storage service of the first terminal device then generates a deletion event stream based on the second target metadata corresponding to the file content to be deleted.
[0138] Then, the first terminal device uploads the deletion event stream to the cloud server. After receiving the deletion event stream, the cloud server distributes it to the target terminal device corresponding to the file deletion instruction, which is the second terminal device. The terminal storage service of the second terminal device deletes the corresponding metadata tag based on the deletion event stream, that is, deletes the corresponding file content identifier and other related metadata, and deletes the local file corresponding to the metadata tag. This achieves batch file deletion across terminals.
[0139] In some embodiments, after deleting the local file corresponding to the metadata tag, the method further includes:
[0140] The second terminal device generates a first metadata change synchronization event and reports the first metadata change synchronization event to the cloud server, so that after receiving the first metadata change synchronization event, the cloud server marks and deletes the first metadata corresponding to the first metadata change synchronization event in the cloud database.
[0141] The cloud storage service on the cloud server deletes the relevant metadata by marking and deleting the metadata corresponding to the first metadata change synchronization event.
[0142] In some of these implementations, such as Figure 8 As shown, cross-terminal file searching can also be achieved, and the methods may also include:
[0143] When the third terminal device receives a cross-terminal file query instruction, it initiates a file query request to the cloud server;
[0144] After receiving the file query request, the cloud server searches the cloud database and retrieves the relevant secondary metadata.
[0145] The cloud server returns the second metadata to the third terminal device so that the third terminal device can display the second metadata.
[0146] Specifically, the storage service of the third terminal device initiates a file query request to the cloud server. After receiving the file query request, the cloud storage service of the cloud server searches in the cloud database, finds the second metadata, and returns the found second metadata to the terminal storage service of the third terminal device. The terminal storage service of the third terminal device pushes the file search results to the display of the third terminal device so that the user can view the file search results.
[0147] Understandably, this second metadata includes directory metadata and file metadata related to the file to be queried. The second metadata returned and displayed includes not only the relevant metadata of the file in the query result, such as the file name and file size, but also the terminal device ID where the file content is located.
[0148] In some of these implementations, such as Figure 9 As shown, it can also include cross-terminal file cut and copy-paste operations. The method may also include:
[0149] Upon receiving a cross-terminal file move operation instruction on the fourth terminal device, a copy metadata event stream is generated.
[0150] The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs management operations on the first directory metadata associated with the directory entry and the associated first file content according to the management operation instructions, including:
[0151] The fourth terminal device reports the copied metadata event stream to the cloud server;
[0152] The cloud server sends the replicated metadata event stream to the corresponding fifth terminal device;
[0153] The fifth terminal device adds corresponding metadata based on the copy metadata event, and downloads the file corresponding to the copy metadata event to the local database of the fifth terminal device.
[0154] Specifically, users can perform cross-terminal file cutting in this system. When a user moves a file from a local device to another device (such as a fifth device) on a fourth device, the fourth device receives the file move instruction, generates a copy metadata event stream, performs the copying of the file content, and then reports it to the cloud server. The cloud server then sends the event stream to the fifth device corresponding to the file content.
[0155] Since it involves cutting and pasting files, such as Figure 9 The dashed line indicates that the fourth terminal device deletes the metadata corresponding to the file move instruction. If the file is copied and pasted, there is no need to delete the local metadata.
[0156] The fifth terminal device adds corresponding metadata based on the copy metadata event and downloads the file corresponding to the copy metadata event to the local database of the fifth terminal device, thereby realizing cross-terminal file movement or pasting.
[0157] In some embodiments, the method may further include:
[0158] The fifth terminal device generates a second metadata change synchronization event and reports the second metadata change synchronization event to the cloud server, so that after receiving the second metadata change synchronization event, the cloud server will incrementally update the metadata in the cloud server's database.
[0159] Specifically, when metadata is added to the fifth terminal device, a second metadata change synchronization event is generated simultaneously. This event is reported to the cloud server, and the cloud server's storage service performs incremental updates in the cloud database to synchronize the metadata to the cloud server.
[0160] If the metadata of a terminal device is corrupted, it can be quickly restored through the cloud server because the cloud server stores the relevant metadata.
[0161] In this embodiment of the invention, a file directory structure is displayed on each terminal device. This file directory structure has at least two hierarchical directories, and each hierarchical directory contains at least one file, facilitating user viewing. The hierarchical directories are associated with directory metadata, and the file contents are associated with file metadata. The file contents are stored in the local database of at least one terminal device, thus enabling the display of file contents from the local database of at least one terminal device on each terminal device. When a terminal device receives a management operation instruction for a hierarchical directory or file content within the file directory structure, a corresponding event stream is generated. This event stream is then synchronized to a cloud server, which in turn synchronizes the event stream to other terminal devices. This allows each terminal device to perform management operations on the hierarchical directory or file content according to the management operation instruction, such as file search, batch file deletion, file viewing, batch file movement, and batch file copying. This enables unified file management for users on all terminal devices other than their local devices, avoiding metadata conflicts. Furthermore, since file metadata and directory metadata are maintained simultaneously on both the cloud server and the terminal devices, data can be quickly recovered from the cloud server if the metadata on a terminal device is corrupted.
[0162] Correspondingly, such as Figure 10 As shown, this embodiment of the invention also provides a cross-terminal unified file management device, applied to a unified file management system, the unified file management system including a cloud server and several terminal devices, the cloud server being communicatively connected to the several terminal devices; the cross-terminal unified file management device 500 includes:
[0163] Display module 501 is used to display a file directory structure on each of the terminal devices, wherein the file directory structure has at least two hierarchical directories, and each hierarchical directory has at least one file content, the hierarchical directories are associated with directory metadata, the file content is associated with file metadata, and the file content is stored in the local database of at least one of the terminal devices;
[0164] The event stream generation module 502 is used to generate an event stream based on the management operation instruction, the hierarchical directory and the directory metadata or the file content and the file metadata when the first terminal device receives a management operation instruction triggered based on the hierarchical directory or the file content;
[0165] Uplink module 503 is used by the first terminal device to synchronize the event stream to the cloud server;
[0166] Downlink module 504 is used by the cloud server to synchronize the event stream to each second terminal device, so that each second terminal device can perform management operations on the hierarchical directory or the file content according to the management operation instructions.
[0167] In this embodiment, a file directory structure is displayed on each terminal device. This file directory structure has at least two hierarchical directories, and each hierarchical directory contains at least one file, facilitating user viewing. The hierarchical directories are associated with directory metadata, and the file contents are associated with file metadata. The file contents are stored in the local database of at least one terminal device, enabling the display of file contents from the local database of at least one terminal device on each terminal device. When a terminal device receives a management operation instruction for a hierarchical directory or file content within the file directory structure, a corresponding event stream is generated. This event stream is then synchronized to a cloud server, which in turn synchronizes the event stream to other terminal devices. This allows each terminal device to perform management operations on the hierarchical directory or file content according to the management operation instruction, such as file search, batch file deletion, file viewing, batch file movement, and batch file copying. This enables unified file management for users on all terminal devices other than their local devices, avoiding metadata conflicts. Furthermore, since file metadata and directory metadata are maintained simultaneously on both the cloud server and the terminal devices, data can be quickly recovered from the cloud server if the metadata on a terminal device is corrupted.
[0168] In other embodiments, the directory metadata includes at least one of the following: hierarchical directory ID, user ID to which the directory belongs, parent directory ID to which the directory belongs, directory type, unique ID of the terminal where the directory is located, directory download status, and directory name;
[0169] The file metadata includes at least one of the following: file ID, terminal device ID where the file content is located, file content identifier, file owner ID, parent directory ID, file name, file size, file type, file description information, and file status information.
[0170] In other embodiments, the event stream generation module 502 is further configured to:
[0171] When the first terminal device detects a data change in the hierarchical directory or the file content, it generates a first data change event based on the first directory metadata corresponding to the hierarchical directory and the first file metadata corresponding to the file content.
[0172] The first terminal device stores the first data change event in a local event queue and persists the first data change event to the local database of the first terminal device.
[0173] In other embodiments, the uplink module 503 is further configured to:
[0174] When the first terminal device communicates with the cloud server, the cloud server receives the first data change event and writes the first data change event into the cloud event queue to synchronize the first data change event to the cloud database of the cloud server.
[0175] The cloud server replays the first data change event to generate a second data change event;
[0176] Downlink module 504 is also used for:
[0177] The cloud server writes the second data change event into the cloud event queue;
[0178] When the second terminal device corresponding to the second data change event connects to the cloud server, the cloud server sends the second data change event to the second terminal device in the cloud event queue;
[0179] The second terminal device receives the second data change event and replays the second data change event to obtain the third data change event, so as to synchronize the metadata corresponding to the second data change event to the second terminal device.
[0180] In other embodiments, a marking module 505 is also included, for:
[0181] The first terminal device marks the first data change event in the local database as sent.
[0182] In other embodiments, the uplink module 503 is further configured to:
[0183] When the first terminal device receives a file deletion instruction triggered based on the file content, it generates a deletion event stream based on the second target metadata corresponding to the file content;
[0184] Downlink module 504 is also used for:
[0185] The first terminal device reports the deletion event stream to the cloud server, so that the cloud server can send the deletion event stream to the second terminal device corresponding to the file deletion instruction;
[0186] The second terminal device deletes the corresponding metadata tag based on the deletion event stream, and deletes the local file corresponding to the metadata tag.
[0187] In other embodiments, a deletion marker module 506 is also included, for:
[0188] The second terminal device generates a first metadata change synchronization event and reports the first metadata change synchronization event to the cloud server, so that after receiving the first metadata change synchronization event, the cloud server marks and deletes the first metadata corresponding to the first metadata change synchronization event in the cloud database.
[0189] In other embodiments, a search module 507 is also included, for:
[0190] When the third terminal device receives a cross-terminal file query instruction, it initiates a file query request to the cloud server;
[0191] After receiving the file query request, the cloud server searches the cloud database and retrieves the relevant secondary metadata.
[0192] The cloud server returns the second metadata to the third terminal device so that the third terminal device can display the second metadata.
[0193] In other embodiments, a moving module 508 is also included, for:
[0194] Upon receiving a cross-terminal file move operation instruction on the fourth terminal device, a copy metadata event stream is generated.
[0195] Downlink module 504 is also used for:
[0196] The fourth terminal device reports the copied metadata event stream to the cloud server;
[0197] The cloud server sends the replication metadata event stream to the corresponding fifth terminal device.
[0198] The fifth terminal device adds corresponding metadata based on the copy metadata event, and downloads the file corresponding to the copy metadata event to the local database of the fifth terminal device.
[0199] In other embodiments, a deletion module 509 is also included, for:
[0200] The fourth terminal device deletes the metadata corresponding to the file move instruction.
[0201] In other embodiments, an update module 510 is also included, for:
[0202] The fifth terminal device generates a second metadata change synchronization event and reports the second metadata change synchronization event to the cloud server, so that after receiving the second metadata change synchronization event, the cloud server will incrementally update the metadata in the cloud server's database.
[0203] It should be noted that the above-described apparatus can execute the method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the apparatus embodiments can be found in the method provided in the embodiments of this application.
[0204] Figure 11 This is a schematic diagram of the hardware structure of the controller in one embodiment of the terminal device, such as... Figure 11 As shown, the controller 110 includes:
[0205] One or more processors 111 and memory 112. Figure 11 The example uses a processor 111 and a memory 112.
[0206] Processor 111 and memory 112 can be connected via a bus or other means. Figure 11 Taking the example of a connection between China and Israel via a bus.
[0207] The memory 112, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the cross-terminal unified file management method in the embodiments of this application (e.g., attached...). Figure 10 The components shown are display module 501, event stream generation module 502, uplink module 503, downlink module 504, tagging module 505, tag deletion module 506, search module 507, move module 508, delete module 509, and update module 510. The processor 111 executes various functional applications and data processing of the controller by running non-volatile software programs, instructions, and modules stored in the memory 112, thereby realizing the cross-terminal unified file management method of the above method embodiment.
[0208] The memory 112 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the charging station, etc. Furthermore, the memory 112 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 112 may optionally include memory remotely located relative to the processor 111, and these remote memories can be connected to a signal long-term recording device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0209] The one or more modules are stored in the memory 112. When executed by the one or more processors 111, they perform the cross-terminal unified file management method in any of the above method embodiments, for example, the method described above. Figure 3 The method steps S301 to S304 in the method are implemented. Figure 10 The functions of modules 501-510 in the document.
[0210] The above-described product can perform the methods provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for performing the methods. Technical details not described in detail in this embodiment can be found in the methods provided in the embodiments of this application.
[0211] This application provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors, for example... Figure 11 One of the processors 111 can enable the one or more processors to execute the cross-terminal unified file management method in any of the above method embodiments, for example, to execute the method described above. Figure 3 The method steps S301 to S304 in the method are implemented. Figure 10 The functions of modules 501-510 in the document.
[0212] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0213] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0214] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for unified management of files across terminals, characterized in that: Applied to a unified file management system, the unified file management system includes a cloud server and a plurality of terminal devices, the cloud server is communicatively connected with the plurality of the terminal devices; the method includes: Displaying a file directory structure on each of the terminal devices, wherein the file directory structure has at least two hierarchical directories, and each hierarchical directory has at least one file content, the hierarchical directory is associated with directory metadata, the file content is associated with file metadata, and the file content is stored in a local database of at least one of the terminal devices; When the first terminal device receives a management operation instruction triggered based on the hierarchical directory or the file content, an event stream is generated based on the management operation instruction, the hierarchical directory and the directory metadata or the file content and the file metadata; The first terminal device synchronizes the event stream to the cloud server; The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs a management operation on the hierarchical directory or the file content according to the management operation instruction.
2. The method according to claim 1, characterized in that: The directory metadata includes at least one of a hierarchical directory ID, a user ID to which the directory belongs, an ID of a parent directory to which the directory belongs, a directory type, a unique ID of a terminal where the directory is located, a directory download status, and a directory name; The file metadata includes at least one of the file ID, the terminal device ID where the file content is located, the file content identifier, the user ID to which the file belongs, the parent directory ID to which the file belongs, the file name, the file size, the file type, the file description information, and the file status information.
3. The method according to claim 1, characterized in that When the first terminal device receives a management operation instruction triggered by the hierarchical directory or the file content, generating an event stream based on the management operation instruction, the hierarchical directory and the directory metadata or the file content and the file metadata, including: When the first terminal device detects that data change occurs in the hierarchical directory or the file content, a first data change event is generated based on first directory metadata corresponding to the hierarchical directory and first file metadata corresponding to the file content; The first terminal device stores the first data change event in a local event queue, and persistently stores the first data change event in a local database of the first terminal device.
4. The method according to claim 3, characterized in that The first terminal device synchronizes the event stream to the cloud server, including: When the first terminal device is in communication connection with the cloud server, the cloud server receives the first data change event and writes the first data change event into a cloud event queue to synchronize the first data change event to a cloud database of the cloud server; The cloud server replays the first data change event to generate a second data change event; The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs a management operation on the first directory metadata associated with the directory item and the associated first file content according to the management operation instruction, including: The cloud server writes the second data change event into the cloud event queue; When a second terminal device corresponding to the second data change event is connected to the cloud server, the cloud server sends the second data change event to the second terminal device in the cloud event queue; The second terminal device receives the second data change event, and replays the second data change event to obtain a third data change event, so as to synchronize metadata corresponding to the second data change event to the second terminal device.
5. The method according to claim 4, characterized in that After writing the first data change event into the cloud event queue, the method further includes: The first terminal device marks the first data change event in the local database as sent.
6. The method according to claim 1, characterized in that The management operation instruction is a file deletion instruction. When the first terminal device receives the management operation instruction triggered by the file content, an event stream is generated based on the management operation instruction, the file content and the file metadata, including: When the first terminal device receives a file deletion instruction triggered based on the file content, generating a deletion event stream based on second target metadata corresponding to the file content; The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs a management operation on the file content according to the management operation instruction, including: The first terminal device reports the deletion event stream to the cloud server, so that the cloud server sends the deletion event stream to the second terminal device corresponding to the file deletion instruction; The second terminal device deletes the corresponding metadata tag based on the deletion event stream, and deletes the local file corresponding to the metadata tag.
7. The method according to claim 6, characterized in that After deleting the local file corresponding to the metadata tag, the method further includes: The second terminal device generates a first metadata change synchronization event and reports the first metadata change synchronization event to the cloud server, so that after the cloud server receives the first metadata change synchronization event, it marks the first metadata corresponding to the first metadata change synchronization event in the cloud database for deletion.
8. The method according to claim 1, characterized in that The method further comprises: When the third terminal device receives the cross-terminal file query instruction, it initiates a file query request to the cloud server; After receiving the file query request, the cloud server searches the cloud database to find relevant second metadata; The cloud server returns the second metadata to the third terminal device so that the third terminal device displays the second metadata.
9. The method according to claim 1, characterized in that: The method further comprises: When the fourth terminal device receives the cross-terminal file move operation instruction, a copy metadata event stream is generated; The cloud server synchronizes the event stream to each second terminal device, so that each second terminal device performs a management operation on the first directory metadata associated with the directory item and the associated first file content according to the management operation instruction, including: The fourth terminal device reports the replication metadata event stream to the cloud server; The cloud server sends the replicated metadata event stream to the corresponding fifth terminal device; The fifth terminal device adds corresponding metadata based on the metadata copy event, and downloads the file corresponding to the metadata copy event to the local database of the fifth terminal device.
10. The method according to claim 9, characterized in that After generating the replication metadata event stream, the method further includes: The fourth terminal device deletes the metadata corresponding to the file move instruction.
11. The method according to claim 9, characterized in that The method further comprises: The fifth terminal device generates a second metadata change synchronization event, and reports the second metadata change synchronization event to the cloud server, so that the cloud server incrementally updates the metadata in the database of the cloud server after receiving the second metadata change synchronization event.
12. A unified file management system across terminals, characterized in that: It includes a cloud server and several terminal devices, and the cloud server is communicatively connected with the several terminal devices.
13. A non-volatile computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by the unified file management system, the steps of the cross-terminal unified file management method as described in any one of claims 1 to 11 are implemented.