Local file management method, system and device and storage medium

By introducing a synthesis processing mechanism of planetary file system between the file manager and the terminal storage service, the problem of repeated file storage is solved and efficient utilization of storage space is achieved.

CN119441158APending Publication Date: 2025-02-14GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310990131.8
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

Technical Problem

The existing file manager causes files to be stored repeatedly during file operations, resulting in wasted storage space.

Method used

Receive file operations through the file manager and send file operation instructions to the terminal storage service. The terminal storage service operates the target file according to the instructions. The target file is driven by the storage to synthesize multiple file blocks based on the planetary file system. The file blocks are filed. Correspond to one or more files.

Benefits of technology

Effectively reduces the duplicate storage of files in the file system and saves storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441158A_ABST
    Figure CN119441158A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a local file management method, system and device and a storage medium. According to the technical scheme provided by the embodiment of the invention, the file manager receives the file operation on the target file, the file operation instruction is sent to the terminal storage service, the terminal storage service performs the file operation according to the file operation instruction, and the target file is loaded to the operation system through the storage driver. The target file is obtained by the storage drive based on a plurality of file blocks stored in the planetary file system, each file block in the planetary file system corresponds to one or more files, the planetary file system is configured in the local storage drive, files of different versions can share the file blocks with the same content, and the file blocks can share the same content. Repeated storage of different files in a file system is effectively reduced, and waste of storage space by the files is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of file management technology, and in particular to a local file management method, system, device and storage medium. Background Art

[0002] In order to facilitate file management, each operating system generally provides a file manager for managing files, such as Explorer in Windows, the default file manager (Nautilus) in the GNOME desktop environment of Linux, the default file manager (Dolphin) in the KDE desktop environment, and the default file manager (Thunar) in the Xfce desktop environment.

[0003] File managers generally provide functions such as creating, copying, pasting, moving, deleting and searching files. Existing file managers are just graphical encapsulation of the file system functions of the operating system. The files and directories seen in the file manager correspond one-to-one to the files and directories in the file system. Users often download files repeatedly or copy files from one directory to another, which causes files to be stored repeatedly in the file system, resulting in a waste of storage space. Summary of the invention

[0004] The embodiments of the present application provide a local file management method, system, device and storage medium to solve the technical problem in the related art that files are repeatedly stored in the file system, resulting in waste of storage space, and effectively reduce the waste of storage space by files.

[0005] In a first aspect, an embodiment of the present application provides a local file management method, which is applied to a local file management system, wherein the local file management system includes a file manager, a terminal storage service, and a storage driver, wherein the storage driver is configured with a planetary file system, and the local file management method includes:

[0006] The file manager receives the file operation and sends a file operation instruction to the terminal storage service according to the file operation;

[0007] The terminal storage service performs file operations on a target file loaded into the operating system through the storage driver according to the file operation instructions. The target file is obtained by the storage driver synthesizing multiple file blocks based on the planetary file system. The file blocks correspond to one or more files.

[0008] In a second aspect, an embodiment of the present application provides a local file management system, the local file management system includes a file manager, a terminal storage service and a storage driver, the storage driver is configured with a planetary file system, wherein:

[0009] The file manager is used to receive a file operation and send a file operation instruction to the terminal storage service according to the file operation;

[0010] The terminal storage service is used to perform file operations on the target file loaded into the operating system through the storage driver according to the file operation instructions. The target file is obtained by the storage driver synthesizing multiple file blocks based on the planetary file system, and the file blocks correspond to one or more files.

[0011] In a third aspect, an embodiment of the present application provides a local file management device, including: a memory and one or more processors;

[0012] The memory is used to store one or more programs;

[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the local file management method as described in the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a storage medium storing computer executable instructions, which, when executed by a computer processor, are used to execute the local file management method as described in the first aspect.

[0015] In an embodiment of the present application, a file manager receives file operations on a target file, sends file operation instructions to a terminal storage service, and the terminal storage service performs file operations according to the file operation instructions, wherein the target file is loaded into an operating system through a storage driver, and the target file is obtained by the storage driver based on multiple file blocks stored in a planetary file system, each file block in the planetary file system corresponds to one or more files, and the planetary file system is configured in a local storage driver, and files of different versions can share file blocks with the same content, effectively reducing duplicate storage of different files in the file system and reducing the waste of storage space by files. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a structural diagram of a local file management system provided by an embodiment of the present application;

[0017] Figure 2 is a flow chart of a local file management method provided by an embodiment of the present application;

[0018] Figure 3 This is a schematic diagram of an operation flow for opening a target file provided by an embodiment of the present application;

[0019] Figure 4This is a schematic diagram of a target file deletion operation process provided by an embodiment of the present application;

[0020] Figure 5 This is a schematic diagram of a file change response process provided by an embodiment of the present application;

[0021] Figure 6 It is a structural diagram of a local file management device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The above process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The above process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0023] For an operating system, the file manager is an important part of the operating system. It can help users manage directories and files in the operating system in a graphical way. Existing file managers generally provide functions such as creating, copying, pasting, moving, deleting and searching files and folders. Since the existing file manager only graphically encapsulates the file system function of the operating system and does not optimize the file storage process, the files and directories seen in the file manager correspond one-to-one with the files and directories in the file system. When users repeatedly download files or copy files from one directory to another, the files will be stored repeatedly in the file system, and the existing file manager will not automatically deduplicate the repeatedly stored files, resulting in repeated storage of files in the file system, repeated occupation of disk space, and a large waste of disk space.

[0024] Based on this, the present application proposes a local file management method, system, device and storage medium, which receives file operations on target files through a file manager, sends file operation instructions to a terminal storage service, and the terminal storage service performs file operations according to the file operation instructions, wherein the target file is loaded into the operating system through a storage driver, and the target file is obtained by the storage driver based on multiple file blocks saved in a planetary file system, each file block in the planetary file system corresponds to one or more files, and the planetary file system is configured in a local storage driver. Files of different versions can share file blocks with the same content, effectively reducing repeated storage of different files in the file system and reducing the waste of storage space by files.

[0025] Figure 1 A schematic diagram of the structure of a local file management system provided in an embodiment of the present application is given, such as Figure 1 As shown, the local file management system provided by this solution includes a file manager, a terminal storage service and a storage driver, wherein a planetary file system is installed in the storage driver.

[0026] Among them, the file manager provided by this solution is used to receive file operations and send file operation instructions to the terminal storage service according to the file operations; the terminal storage service is used to perform file operations on the target file loaded into the operating system through the storage driver according to the file operation instructions, and the target file is obtained by the storage driver synthesizing multiple file blocks based on the planetary file system, and the file block corresponds to one or more files.

[0027] In the above, the file operation on the target file is received through the file manager, and the file operation instruction is sent to the terminal storage service, and the terminal storage service performs the file operation according to the file operation instruction, wherein the target file is loaded into the operating system through the storage driver, and the target file is obtained by the storage driver based on multiple file blocks saved in the planetary file system. Each file block in the planetary file system corresponds to one or more files. The planetary file system is configured in the local storage driver, and different versions of files can share file blocks with the same content, which effectively reduces the repeated storage of different files in the file system and reduces the waste of storage space by files.

[0028] In one possible embodiment, the file blocks are stored in the Planet File System, and the file metadata of the file is stored in a local database.

[0029] In a possible embodiment, the terminal storage service performs a file operation on a target file loaded into the operating system through a storage driver according to the file operation instruction, including:

[0030] When the file operation instruction is a file opening instruction and the operating system does not have a corresponding target file, the terminal storage service sends a file download instruction to the storage driver based on the file opening instruction, obtains the target file from the planetary file system according to the file metadata corresponding to the file download instruction through the storage driver, and downloads the target file to the operating system as a temporary file. The target file is obtained by synthesizing multiple file blocks by the planetary file system based on the file metadata corresponding to the file download instruction;

[0031] The terminal storage service opens the target file in the operating system.

[0032] In a possible embodiment, the terminal storage service performs a file operation on a target file loaded into the operating system through a storage driver according to the file operation instruction, including:

[0033] When the file operation instruction is a file move instruction, the terminal storage service modifies the parent directory in the file metadata of the target file loaded into the operating system through the storage driver in the local database.

[0034] In a possible embodiment, the terminal storage service performs a file operation on a target file loaded into the operating system through a storage driver according to the file operation instruction, including:

[0035] When the file operation instruction is a file deletion instruction, the terminal storage service marks the file metadata corresponding to the target file loaded into the operating system through the storage driver as deleted in the local database;

[0036] The terminal storage service notifies the storage driver to delete the target file, and the storage driver deletes the target file in the operating system and marks the file block corresponding to the target file as deleted in the planetary file system.

[0037] In a possible embodiment, the terminal storage service performs a file operation on a target file loaded into the operating system through a storage driver according to the file operation instruction, including:

[0038] When the file operation instruction is a file rename instruction, the terminal storage service modifies the file name in the file metadata of the target file loaded into the operating system through the storage driver in the local database.

[0039] In a possible embodiment, the terminal storage service performs a file operation on a target file loaded into the operating system through a storage driver according to the file operation instruction, including:

[0040] When the file operation instruction is a file copy instruction, the terminal storage service creates new file metadata in the local database for the target file loaded into the operating system through the storage driver.

[0041] In a possible embodiment, after the terminal storage service performs a file operation on the target file loaded into the operating system through the storage driver according to the file operation instruction, the terminal storage service further includes:

[0042] The terminal storage service monitors the file changes of the target file;

[0043] When a target file changes, the terminal storage service adds the changed file blocks to the Planet File System through the storage driver and creates file metadata for the target file after the file change.

[0044] In a possible embodiment, the local file management method further includes:

[0045] The file manager receives the directory opening operation, and sends a directory list acquisition instruction to the terminal storage service according to the directory opening operation;

[0046] The terminal storage service obtains the file metadata of each file and the directory metadata corresponding to the subdirectory under the parent directory corresponding to the directory list acquisition instruction from the local database according to the directory list acquisition instruction, and returns the directory list to the file manager based on the file metadata and directory metadata.

[0047] The file manager, terminal storage service and storage driver provided by this solution can execute the corresponding steps in the local file management method provided by this application and achieve the corresponding technical effects. The steps of the file manager, terminal storage service and storage driver to execute the local file management method can refer to the local file management method provided by any embodiment of this application, and this solution will not repeat them. It is worth noting that in the above-mentioned embodiment of the local file management system, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the embodiments of the present invention.

[0048] Figure 2 A flowchart of a local file management method provided in an embodiment of the present application is given. The local file management method provided in an embodiment of the present application can be applied to a local file management system, which can be implemented by hardware and / or software and integrated in a local file management device.

[0049] The following description takes the local file management method executed by the local file management system as an example. Figure 2 , the local file management method includes:

[0050] S110: The file manager receives the file operation and sends a file operation instruction to the terminal storage service according to the file operation.

[0051] The local file management system provided by this solution includes a file manager, a terminal storage service, and a storage driver. The storage driver provided by this solution is configured with the InterPlanetary File System (IPFS). Among them, the InterPlanetary File System can be used as a distributed file transfer protocol and network system to divide files into blocks, use a hash algorithm to calculate a unique identifier (CID) for each block, and store these blocks in a distributed manner. This solution utilizes the file storage-related functions of the InterPlanetary File System, encapsulates the file storage-related functions in the InterPlanetary File System in the storage driver, and the storage driver provides the communication interface of the InterPlanetary File System (such as a websocket interface).

[0052] Optionally, the file manager can be developed using the web front-end Electron framework, the terminal storage service and the terminal storage driver can be developed using the Golang language, and the local database uses an SQLite database, so that the local file management device has cross-platform features and improves the scalability and applicability of the local file management device.

[0053] The file manager and the terminal storage service, as well as the terminal storage service and the storage driver can communicate based on a set communication protocol, such as a websocket protocol. Among them, the file manager provided by this solution allows users to manage directories and files in the operating system in a graphical manner. As the entry point for user operations, it receives user operations and converts each operation into a corresponding instruction and submits it to the terminal storage service. In this solution, the file manager can establish a websocket connection with the terminal storage service. The terminal storage service can be used to maintain file metadata and implement directory tree management. It is responsible for file and directory metadata-related operations, file opening operations, and as the initiator of file upload, download, and delete operations. The terminal storage service can establish a websocket connection with the file manager and the storage driver at the same time. The terminal storage driver can be used to be responsible for file upload and download operations, receive file upload, download, and delete related instructions from the terminal storage service, and complete these operations. The storage driver decouples the terminal storage service and the planetary file system. The terminal storage service can submit operations related to file lifecycle management to the storage driver for completion.

[0054] In one embodiment, when a user needs to operate a target file, he can initiate a file operation to the file manager through the file management interface provided by the file manager. The file operation on the target file provided by this solution can be a file open operation, a file move operation, a file delete operation, a file rename operation, a file copy operation, a file edit operation, and other operation types.

[0055] After receiving the file operation, the file manager generates a file operation instruction according to the target file and operation type corresponding to the file operation, and sends the file operation instruction to the terminal storage service. The file operation instructions provided by this solution may include file open instructions, file move instructions, file delete instructions, file rename instructions, file copy instructions and other instruction types.

[0056] S120: The terminal storage service performs a file operation on a target file loaded into the operating system through a storage driver according to a file operation instruction. The target file is obtained by the storage driver synthesizing multiple file blocks based on the planetary file system. The file block corresponds to one or more files.

[0057] The storage driver provided by this solution can synthesize multiple file blocks based on the Planet File System to obtain files. The storage driver can also load the synthesized files into the operating system of the local file management device (for example, save the files in a storage location pre-set by the operating system for saving files provided by the storage driver).

[0058] It needs to be explained that the file blocks provided by this solution are obtained by the planetary file system by dividing the files into blocks. For example, when the storage driver provides the file to the planetary file system for storage, the planetary file system divides the file into multiple file blocks and saves them, and records the file blocks corresponding to each file. When it is necessary to read the file, the storage driver calls the planetary file system, and the planetary file system determines the corresponding multiple file blocks according to the file to be read, and sums the multiple file blocks into corresponding files, and submits them to the storage driver.

[0059] After obtaining the synthesized file, the storage driver can load (download) the synthesized file into a storage location set by the operating system for storing files. The file targeted by the file operation is the target file.

[0060] Each file block corresponds to one or more files, and the target file can be one of the one or more files. For example, if there is the same content between multiple files or different versions of files based on the same file, the file blocks corresponding to this part of the same content are blocks with the same file content. These blocks can be de-reintegrated into the same file block, and there is no need to repeatedly save file blocks with the same file content. That is, multiple files can share the same file block, which reduces the storage space occupied by files and saves storage resources.

[0061] In one embodiment, after receiving the file operation instruction sent by the file manager, the terminal storage service performs the corresponding file operation on the target file corresponding to the file operation instruction in the operating system according to the file operation instruction, for example, opening the corresponding target file, moving the storage location (directory) of the target file, deleting the target file, renaming the target file, copying the target file, etc.

[0062] It needs to be explained that, since the file blocks provided by this solution correspond to one or more files, multiple files can share the same file blocks. When file operations such as renaming, copying, and moving the target file that do not change the file content of the target file occur, there is no need to change the file content of the file blocks, nor is there a need to repeatedly save file blocks with the same file content. It is only necessary to update the file metadata corresponding to the target file after the file operation is performed on the target file. The file metadata of the file can be used to record the file name, file storage location (directory), version information, file content identifier (the unique identifier of the file in the planetary file system), file type, file size, whether it has been downloaded to the operating system, etc. When copying the target file, a new file metadata can be created, and the file storage location recorded by the file metadata is different from the file storage location recorded by the file metadata of the original target file.

[0063] In one embodiment, the file blocks provided by this solution are stored in the planetary file system, and the file metadata of the file is stored in the local database. Among them, corresponding storage spaces can be configured in the operating system for the planetary file system, the local database, and the file (the file loaded into the operating system by the storage driver). This solution stores files, file blocks, and file metadata separately, and files, file blocks, and file metadata do not need to be stored in the same location. The planetary file system can deduplicate the file blocks according to the file content of the file blocks, and while simplifying file and directory operations, it realizes file-level deduplication and reduces the waste of storage resources.

[0064] In a possible embodiment, the local file management method provided by the present solution also includes: the file manager receives a directory opening operation, and sends a directory list acquisition instruction to the terminal storage service according to the directory opening operation; the terminal storage service obtains the file metadata of each file and the directory metadata corresponding to the subdirectory under the parent directory corresponding to the directory list acquisition instruction from the local database according to the directory list acquisition instruction, and returns the directory list to the file manager based on the file metadata and directory metadata.

[0065] In one embodiment, the user can initiate a directory opening operation to the file manager. When the file manager receives the directory opening operation, it sends a directory list acquisition instruction to the terminal storage service according to the directory opening operation. Further, after receiving the directory list acquisition instruction, the terminal storage service obtains the file metadata of each file and the directory metadata corresponding to the subdirectory under the parent directory corresponding to the directory list acquisition instruction from the local database according to the directory list acquisition instruction, and returns the directory list to the file manager based on the file metadata and directory metadata. The file manager can display the file name and the corresponding directory information of the corresponding file under the corresponding parent directory to the user according to the directory list. The user can initiate file operations on the file through the directory list, for example, take the selected file in the file directory as the target file, and initiate a file opening operation, a file moving operation, a file deleting operation, a file renaming operation, a file copying operation, etc. on the target file.

[0066] When a user needs to view a file directory, this solution obtains the file metadata of each file under the parent directory and the directory metadata corresponding to the subdirectory from the local database, and returns the directory list to the file manager based on the file metadata and directory metadata, so as to realize the query and display of the file directory and improve the efficiency of file management. In addition, by querying the metadata to realize the query and display of the file directory, the query and display of the file directory can be quickly applied across platforms, improving the configuration efficiency of local file management.

[0067] In one embodiment, Figure 3 As shown in the schematic diagram of the process of opening the target file, the terminal storage service provided by the solution performs file operations on the target file loaded into the operating system through the storage driver according to the file operation instruction, including:

[0068] S121: When the file operation instruction is a file open instruction and the operating system does not have a corresponding target file, the terminal storage service sends a file download instruction to the storage driver based on the file open instruction. The storage driver obtains the target file from the planetary file system according to the file metadata corresponding to the file download instruction, and downloads the target file to the operating system as a temporary file. The target file is obtained by synthesizing multiple file blocks by the planetary file system based on the file metadata corresponding to the file download instruction.

[0069] S122: The terminal storage service opens the target file in the operating system.

[0070] In one embodiment, when the file operation received by the file manager is a file opening operation, the file manager sends a file opening instruction to the terminal storage service. When the terminal storage service receives the file opening instruction, it first determines whether there is a target file corresponding to the file operation instruction in the operating system (the storage space corresponding to the file loaded by the storage driver in the operating system). If the target file corresponding to the file operation instruction already exists in the operating system, the terminal storage service can directly open the target file, and the user can view, edit, and perform other operations on the opened target file.

[0071] When the operating system does not have the corresponding target file, the terminal storage service sends a file download instruction to the storage driver according to the target file indicated by the file open instruction. After receiving the file download instruction, the storage driver obtains the target file from the planetary file system according to the file metadata corresponding to the file download instruction, and downloads the obtained target file as a temporary file to the operating system (the storage space corresponding to the file loaded by the storage driver in the operating system). After downloading the target file to the operating system, the storage driver can return the file download result to the terminal storage service, and the terminal storage service can open the target file from the operating system in response to the file download result.

[0072] Optionally, the target file provided by the present solution can be obtained by synthesizing multiple file blocks based on the file metadata corresponding to the file download instruction by the Planetary File System. For example, the Planetary File System determines the multiple file blocks corresponding to the target file according to the file metadata corresponding to the file download instruction, and synthesizes the determined multiple blocks into the target file. Among them, the file download instruction can indicate the version information, file content identification, etc. corresponding to the target file, and the Planetary File System can record one or more version information corresponding to each file block. The Planetary File System can obtain the multiple file blocks corresponding to the version information and file content identification according to the version information, file content identification, etc. indicated by the file download instruction, and synthesize the target file.

[0073] When this solution receives a file opening operation and the target file is not saved in the operating system, the storage driver synthesizes the corresponding multiple file blocks into a target file through the planetary file system and downloads it to the operating system. It is not necessary for each file to be saved in the operating system at the same time. When the target file is needed and the target file is not cached, the target file is synthesized and downloaded to reduce the storage space occupied by the file. And when there is the same content between different files, the file blocks with the same corresponding file content can be deduplicated to further reduce the storage space occupied by the file. At the same time, this solution downloads the target file as a temporary file to the operating system (the temporary storage space corresponding to the file loaded by the storage driver in the operating system). The file exists in the operating system as a temporary file, which can effectively improve the file opening speed. And as a temporary file, it can be cleaned up on demand, reducing the storage space occupied and providing efficient use of storage space.

[0074] In one possible embodiment, the terminal storage service provided by the present solution performs file operations on the target file loaded into the operating system through the storage driver according to the file operation instruction, including: when the file operation instruction is a file move instruction, the terminal storage service modifies the parent directory in the file metadata of the target file loaded into the operating system through the storage driver in the local database.

[0075] In one embodiment, when the file operation received by the file manager is a file move operation, the file manager sends a file move instruction to the terminal storage service. When the terminal storage service receives the file move instruction, it modifies the parent directory in the file metadata of the target file in the local database. Optionally, after completing the modification of the parent directory in the file metadata of the target file, it sends a refresh directory instruction to the terminal storage service to notify the terminal storage service to refresh the directory information corresponding to the target file and feedback the result of the move operation on the target file to the user.

[0076] When receiving a move operation on a target file, this solution only needs to modify the parent directory in the file metadata of the target file in the local database without modifying the content or file blocks of the target file or moving the location of the target file or file blocks, thereby facilitating the file move operation on the target file and making the file move operation more efficient.

[0077] In one possible embodiment, Figure 4 As shown in the schematic diagram of a target file deletion process provided, the terminal storage service provided by the present solution performs file operations on the target file loaded into the operating system through the storage driver according to the file operation instruction, including:

[0078] S123: When the file operation instruction is a file deletion instruction, the terminal storage service marks the file metadata corresponding to the target file loaded into the operating system through the storage driver as deleted in the local database.

[0079] S124: The terminal storage service notifies the storage driver to delete the target file, and the storage driver deletes the target file in the operating system and marks the file block corresponding to the target file as deleted in the planetary file system.

[0080] In one embodiment, when the file operation received by the file manager is a file deletion operation, the file manager sends a file deletion instruction to the terminal storage service. When the terminal storage service receives the file deletion instruction, it marks the file metadata corresponding to the target file in the operating system as deleted in the local database.

[0081] Furthermore, the terminal storage service sends a file deletion instruction to the storage driver to notify the storage driver to delete the target file. When the storage driver receives the file deletion instruction, it deletes the target file in the operating system and calls the planetary file system to mark the file block corresponding to the target file as deleted in the planetary file system. Among them, the marking and deletion of the file block can be to add the file block to the cleanable list, and the unreferenced file blocks will be cleaned up when the planetary file system cleans up the file blocks. Among them, the file can record the referenced file blocks through file metadata. For example, the referenced situation of each file block is recorded in the planetary file system (that is, the file that records the referenced file block can be indicated by the file content identifier). When deleting the target file, the planetary file system deletes the reference of the target file to the file block. If the file block is still referenced by the file, the file block will not be deleted to ensure that the file that references the file block is opened correctly.

[0082] When receiving a deletion operation on a target file, this solution deletes the target file as a temporary file in the operating system through the storage driver, and marks the file metadata and file blocks corresponding to the target file as deleted, so there is no need to delete the corresponding file metadata and file blocks, thereby improving the deletion efficiency of the target file. Furthermore, when the target file is deleted by mistake, the deleted target file can still be restored through the corresponding file metadata and file blocks, thereby improving the file management efficiency.

[0083] In one possible embodiment, the terminal storage service provided by the present solution performs file operations on the target file loaded into the operating system through the storage driver according to the file operation instruction, including: when the file operation instruction is a file rename instruction, the terminal storage service modifies the file name in the file metadata of the target file loaded into the operating system through the storage driver in the local database.

[0084] In one embodiment, when the file operation received by the file manager is a file rename operation, the file manager sends a file rename instruction to the terminal storage service. When the terminal storage service receives the file rename instruction, it modifies the file name in the file metadata of the target file in the local database. Optionally, after completing the modification of the file name in the file metadata of the target file, it sends a refresh directory instruction to the terminal storage service to notify the terminal storage service to refresh the directory information corresponding to the target file and feedback the rename operation result of the target file to the user.

[0085] When receiving a renaming operation for a target file, this solution only needs to modify the file name in the file metadata of the target file in the local database without modifying the content or file blocks of the target file, thereby facilitating the file renaming operation for the target file and making the file renaming operation more efficient.

[0086] In one possible embodiment, the terminal storage service provided by the present solution performs file operations on the target file loaded into the operating system through the storage driver according to the file operation instruction, including: when the file operation instruction is a file copy instruction, the terminal storage service creates new file metadata in the local database for the target file loaded into the operating system through the storage driver.

[0087] In one embodiment, when the file operation received by the file manager is a file copy operation, the file manager sends a file copy instruction to the terminal storage service. When the terminal storage service receives the file copy instruction, it creates new file metadata for the target file in the local database.

[0088] When receiving a copy operation for a target file, this solution only needs to create new file metadata for the target file in the local database, without waiting for the file content to be copied. The copied file references the same file block as the original target file, and the copy operation for the target file does not need to copy the content of the target file, which effectively reduces the storage space occupied by the file, facilitates the file copy operation for the target file, and makes the file copy operation more efficient.

[0089] In one possible embodiment, Figure 5 As shown in a file change response process diagram provided, the local file management method provided by the present solution further includes:

[0090] S130: The terminal storage service monitors file changes of the target file.

[0091] S140: When a target file is changed, the terminal storage service adds the changed file blocks to the planetary file system through the storage driver, and creates file metadata for the target file after the file change.

[0092] In one embodiment, after the terminal storage service opens the target file in response to the file manager's file opening instruction, it monitors the file changes of the target file. The file changes of the target file can be understood as changes in the file content of the target file. For example, the user adds, deletes, modifies, etc. the file content in the target file, and the target file changes at this time.

[0093] When the terminal storage service detects that a target file has changed, it adds the changed file blocks to the planetary file system through the storage driver, and the terminal storage service creates file metadata for the target file after the file change. Since the target file has changed, its corresponding file blocks will change relative to the corresponding file blocks in the planetary file system. It is necessary to add the changed file blocks in the planetary file system, and determine the file blocks referenced by the target file after the file change through the file metadata (including file blocks with unchanged content and file blocks with changed content).

[0094] Optionally, the changed file blocks are added to the Planetary File System. The file blocks with changed content can be directly added to the Planetary File System, or the target file after the file change is submitted to the Planetary File System, which divides the target file after the file change into multiple file blocks and deletes the file blocks with duplicate content based on the automatic deduplication of the file blocks, thereby realizing the addition of the file blocks with changed content.

[0095] Among them, the file metadata generated when the same target file changes correspond to different version information, and the file metadata of different version information corresponds to multiple file blocks of different combinations in the planetary file system. These file metadata of different version information can form a version chain of the file, and the file content identifier of the file can correspond to a certain version of the file. While supporting the version chain management of the file, the strong consistency of the file version and the file version content is guaranteed. Even if the content of a certain version of the file is maliciously tampered with, the file corresponding to the file version can be restored through the file content identifier corresponding to the version, reducing the loss of data due to malicious tampering and ensuring data security. This solution monitors the file changes of the target file, adds file blocks and creates file metadata according to the file changes of the target file, forms a version chain of different file versions, realizes the version chain management of the file, and improves the security of the file and the efficiency of file management.

[0096] In the above, the file manager receives the file operation of the target file, sends the file operation instruction to the terminal storage service, and the terminal storage service performs the file operation according to the file operation instruction, wherein the target file is loaded into the operating system through the storage driver, and the target file is obtained by the storage driver based on multiple file blocks stored in the planetary file system, each file block in the planetary file system corresponds to one or more files, and the planetary file system is configured in the local storage driver, and different versions of files can share the same content of the file block, effectively reducing the repeated storage of different files in the file system, and reducing the waste of storage space for files. At the same time, this solution integrates the characteristics of the planetary file system in terms of file storage by block, automatic deduplication and content addressing, realizes deduplication based on the file block level, supports file block level reuse, and the same blocks in the same file and different versions of the same file will not repeatedly occupy storage space, which greatly saves terminal storage space. And the file content of the file is identified with the version of the corresponding file, while supporting the management of the file version chain, ensuring the strong consistency of the file version and the file version content, and can quickly restore different versions of files, reduce the loss of files due to malicious tampering, and improve file security. The file content and file metadata are stored separately, which simplifies file and directory operations while achieving file-level deduplication, further reducing the storage space occupied by files.

[0097] The embodiment of the present application also provides a local file management device, which can integrate the local file management system provided by the embodiment of the present application. Figure 6 Schematic diagram of a local file management device provided by an embodiment of the present application. Figure 6 The local file management device includes: an input device 63, an output device 64, a memory 62 and one or more processors 61; the memory 62 is used to store one or more programs; when one or more programs are executed by one or more processors 61, the one or more processors 61 implement the local file management method provided in the above embodiment. The input device 63, the output device 64, the memory 62 and the processor 61 can be connected by a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0098] The memory 62, as a computing device readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the local file management method provided in any embodiment of the present application (for example, a file manager, a terminal storage service and a storage driver in a local file management system). The memory 62 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 62 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 62 may further include a memory remotely arranged relative to the processor 61, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0099] The input device 63 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 64 may include a display device such as a display screen.

[0100] The processor 61 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 62, that is, implements the above-mentioned local file management method.

[0101] The local file management system, device and computer provided above can be used to execute the local file management method provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0102] The embodiment of the present application also provides a storage medium storing computer executable instructions, which are used to execute the local file management method provided in the above embodiment when executed by a computer processor. The local file management method can be applied to a local file management system, which includes a file manager, a terminal storage service and a storage driver, and the storage driver is configured with a planetary file system. The local file management method includes: the file manager receives a file operation and sends a file operation instruction to the terminal storage service according to the file operation; the terminal storage service performs a file operation on a target file loaded into the operating system through the storage driver according to the file operation instruction, and the target file is obtained by the storage driver synthesizing multiple file blocks based on the planetary file system, and the file block corresponds to one or more files.

[0103] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0104] Of course, the computer executable instructions of a storage medium storing computer executable instructions provided in an embodiment of the present application are not limited to the local file management method provided above, and can also execute related operations in the local file management method provided in any embodiment of the present application.

[0105] The local file management system, device and storage medium provided in the above embodiments can execute the local file management method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the local file management method provided in any embodiment of the present application.

[0106] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments provided herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A local file management method, applied to a local file management system, characterized in that: The local file management system includes a file manager, a terminal storage service and a storage driver, the storage driver is configured with a planetary file system, and the local file management method includes: The file manager receives the file operation and sends a file operation instruction to the terminal storage service according to the file operation; The terminal storage service performs file operations on a target file loaded into the operating system through the storage driver according to the file operation instructions. The target file is obtained by the storage driver synthesizing multiple file blocks based on the planetary file system. The file blocks correspond to one or more files.

2. The local file management method according to claim 1, characterized in that: The file blocks are stored in the planetary file system, and the file metadata of the file is stored in a local database.

3. The local file management method according to claim 1, characterized in that: The terminal storage service performs a file operation on a target file loaded into the operating system through the storage driver according to the file operation instruction, including: The terminal storage service sends a file download instruction to the storage driver based on the file open instruction when the file operation instruction is a file open instruction and the operating system does not have a corresponding target file, and the storage driver obtains the target file from the planetary file system according to the file metadata corresponding to the file download instruction, and downloads the target file to the operating system as a temporary file, wherein the target file is obtained by synthesizing multiple file blocks by the planetary file system based on the file metadata corresponding to the file download instruction; The terminal storage service opens the target file in the operating system.

4. The local file management method according to claim 1, characterized in that: The terminal storage service performs a file operation on a target file loaded into the operating system through the storage driver according to the file operation instruction, including: When the file operation instruction is a file move instruction, the terminal storage service modifies, in a local database, a parent directory in the file metadata of the target file loaded into the operating system through the storage driver.

5. The local file management method according to claim 1, characterized in that: The terminal storage service performs a file operation on a target file loaded into the operating system through the storage driver according to the file operation instruction, including: The terminal storage service marks the file metadata corresponding to the target file loaded into the operating system through the storage driver as deleted in the local database when the file operation instruction is a file deletion instruction; The terminal storage service notifies the storage driver to delete the target file, and the storage driver deletes the target file in the operating system and marks the file block corresponding to the target file as deleted in the planetary file system.

6. The local file management method according to claim 1, characterized in that: The terminal storage service performs a file operation on a target file loaded into the operating system through the storage driver according to the file operation instruction, including: When the file operation instruction is a file rename instruction, the terminal storage service modifies the file name in the file metadata of the target file loaded into the operating system through the storage driver in the local database.

7. The local file management method according to claim 1, characterized in that: The terminal storage service performs a file operation on a target file loaded into the operating system through the storage driver according to the file operation instruction, including: When the file operation instruction is a file copy instruction, the terminal storage service creates new file metadata in a local database for the target file loaded into the operating system through the storage driver.

8. The local file management method according to claim 1, characterized in that: After the terminal storage service performs a file operation on the target file loaded into the operating system through the storage driver according to the file operation instruction, the terminal storage service further includes: The terminal storage service monitors file changes of the target file; When a file change occurs to the target file, the terminal storage service adds the changed file blocks to the planetary file system through the storage driver, and creates file metadata for the target file after the file change occurs.

9. The local file management method according to any one of claims 1 to 8, characterized in that: The local file management method further includes: The file manager receives a directory opening operation, and sends a directory list acquisition instruction to the terminal storage service according to the directory opening operation; The terminal storage service obtains the file metadata of each file and the directory metadata corresponding to the subdirectory under the parent directory corresponding to the directory list acquisition instruction from the local database according to the directory list acquisition instruction, and returns the directory list to the file manager based on the file metadata and the directory metadata.

10. A local file management system, characterized in that: The local file management system includes a file manager, a terminal storage service and a storage driver, and the storage driver is configured with a planetary file system, wherein: The file manager is used to receive a file operation and send a file operation instruction to the terminal storage service according to the file operation; The terminal storage service is used to perform file operations on the target file loaded into the operating system through the storage driver according to the file operation instruction, and the target file is obtained by the storage driver based on multiple file blocks saved in the planetary file system, and the file blocks correspond to one or more files.

11. A local file management device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the local file management method as described in any one of claims 1-9.

12. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the local file management method as described in any one of claims 1 to 9.