A notation file system, device, and storage medium
By managing files through a note-based file system, and using notes to mark files and describe information, the problem of low efficiency in file querying and synchronization is solved, enabling fast querying and efficient synchronization.
Patent Information
- Application Number
- CN202111647737.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In existing technologies, file management systems struggle to efficiently query and synchronize files across multiple categories, especially in directory structures where file queries are slow and synchronization processes are time-consuming and resource-intensive.
It adopts an annotation file system, manages files through an annotation database, uses annotations to mark files and file description information, realizes the association between files and description information, adopts a bottom-up design philosophy, first the files are created and then the annotations are added, and uses special annotations to mark the files that need to be synchronized.
It improves file retrieval speed, simplifies the management of multi-category files, reduces the search time for synchronized files, and improves file synchronization efficiency.
Smart Images

Figure HDA0003445629680000011 
Figure HDA0003445629680000021 
Figure HDA0003445629680000031
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of electronic file management, in particular to a note file system, equipment and storage medium. BACKGROUND
[0002] With the development of computer technology, the number of files contained in the device is increasing, whether on the computer side or the mobile side. Whether the files store documents in work and study or digital files of audio and video in daily life, their growth brings more and more difficulty for users to manage. At the same time, file management is closely related to information management, library and information science, information behavior, information retrieval and other fields.
[0003] The management of files under the directory structure has the problems of difficulty in creating a multi-classification file directory structure and difficulty in file query. This is because the directory system adopts a tree structure, a top-down design philosophy, and the file is managed with the structure as the center. The file management system based on metadata can associate rich metadata with files and effectively improve the file query speed through metadata retrieval, but the metadata management service is independent of the directory system, and the two systems are difficult to synchronize.
[0004] The file synchronization process can be divided into two steps: the first step is to find the file to be synchronized, and the second step is to merge the file found in the previous step with the server. In the directory system, the file to be synchronized can be found by traversing the folder, comparing file information, or monitoring the file, but these two methods either need to spend a lot of time comparing files that have not changed or need to monitor additional files, resulting in additional resource occupation.
[0005] Therefore, there is currently no universally applicable method that can ensure efficient file query while easily managing multi-classification files, and quickly query the files that need to be synchronized under the file system, so a new technical solution is needed to solve the above problems. SUMMARY
[0006] Therefore, the present application provides a note file system, equipment and storage medium, which can improve the file query speed and easily manage multi-classification files, and a file synchronization method is proposed under the file system to solve the problem of quickly screening the files that need to be synchronized.
[0007] The technical scheme of the present application is as follows:
[0008] In a first aspect, the present application provides a note file system, which specifically comprises: the note file system manages files in a management note manner.
[0009] On the basis of the above technical scheme, preferably, the relationship between the note and the file is represented in the form of a note database, that is, the file and the note data are first marked with the note; the file mark identifies the note entity, and the note data mark the general note, representing the attribute of the entity.
[0010] On the basis of the above technical scheme, preferably, the note data is the description information of the file, which is divided into two types, one of which is the same as the directory, serving as the information required for positioning the file, and can be regarded as the directory name at each level of the position of the file, and is marked with the note representing the directory level, so that the mutual conversion of the directory system and the note system can be realized; the other is the self-defined description information, which does not need to be marked as the note of the directory level, and is assigned other meanings for the file, so as to facilitate the file retrieval and classification.
[0011] On the basis of the above technical scheme, preferably, the file system comprises a file module, a marking module, a storage module, a file operation module and a note operation module.
[0012] On the basis of the above technical scheme, preferably, the file module is used for managing the disk block information occupied by the file, the system adopts inode to describe the file, the inode contains the metadata information of the file, one inode corresponds to one file, and the inode number of the file is taken as the unique identifier of the file;
[0013] The marking module is used for adding notes to the file and the description information of the file. The inode number representing the file and the data representing the description information of the file are allocated with an id, which is recorded as Did, and are marked with the note and allocated with a note id, which is recorded as Zid; if it is the inode number representing the file, the note Zid representing the file is marked, if it is the description information of the file, the note representing the directory level is marked, if the directory level is not marked, it is identified as the general file description; and the description information of the file needs to be associated with the file, so that the file and the description information thereof are associated;
[0014] The storage module is used for storing the information after the marking processing in the disk, and is divided into a data storage area, a note storage area and a relationship storage area according to the storage content; the data storage area stores the inode number representing the file and the string representing the description information of the file, the note storage area stores all the note information in the system, and the relationship storage area records the association information between the file and the description information thereof;
[0015] The file operation module is used for processing the addition, deletion, modification and query of the file content and the file description information;
[0016] The note operation module is used for processing the addition, deletion, modification and query of the data mark.
[0017] On the basis of the above technical scheme, preferably, the operations on the file include: file content operation and file description information operation.
[0018] The file content operation includes:
[0019] Adding a file: the file description information needs to be associated with the file when the file is added, the file is stored in the disk when the file is added, and the inode of the file is created; the ID of the file inode number and the file description information is allocated, and the note is added, the file and the description information and the ordinary description information and the directory information are distinguished, the note and the note modification data are stored; the relationship between the file description information and the file is stored at the same time;
[0020] Querying a file: the Did of the file description information is obtained, the Did of the file inode number containing all the file description information Did is screened out, the inode number of the file is obtained, and the disk information occupied by the file is obtained, and the file is queried;
[0021] Deleting a file: based on the file query, the inode number of the file and the Did of the file description information are queried, the disk occupied by the file is recycled, and the association relationship between the description information and the file is deleted;
[0022] Modifying a file: based on the file query, the file content is updated to the disk;
[0023] The file description information operation includes:
[0024] Adding description information: when a user adds description information for a file, the description information is stored in the data storage area, and the Did of the data is associated with the file;
[0025] Querying description information: when a user views the description information of a file, the Did of the inode number representing the file is obtained, the Did of all the description information of the file is obtained from the relationship storage area, and the description information corresponding to the Did is queried;
[0026] Deleting description information: when a user needs to delete the description information of a file, the association between the file and the description information is removed;
[0027] Modifying description information: modifying the file description information can be regarded as deleting the description information and then adding the description information.
[0028] In a second aspect, the present application provides a file synchronization scheme, which is based on the annotation file system, and adds special attributes with synchronization meaning to files that need to be synchronized, and all files that need to be synchronized can be quickly queried from the special attributes; the special annotations include: a "synchronization" annotation for marking files that need to be backed up, and a "modified" annotation for marking files that have been changed; when a file marked by the "synchronization" annotation is modified, the system associates the file with the "modified" annotation, and all files that need to be synchronized can be quickly queried from the "modified" annotation.
[0029] In a third aspect, the present application provides an electronic device, which includes at least one processor, at least one memory, a communication interface and a bus; wherein the processor, the memory and the communication interface complete communication with each other through the bus; the memory stores an annotation file system program that can be executed by the processor, and the annotation file system program is configured to implement the function of the annotation file system according to the first aspect of the present application.
[0030] In a third aspect, the present application provides a storage medium, which stores an annotation file system program; when the annotation file system program is executed, the function of the annotation file system according to the first aspect of the present application is implemented.
[0031] The annotation file management system, the device and the storage medium according to the present application have the following beneficial effects compared with the prior art:
[0032] (1) In the annotation file system according to the present application, there is no directory structure, and the annotations are associated with the files; when facing multiple classification files, only multiple annotations need to be added to the files, and there is no need to create a complex directory structure;
[0033] (2) In the annotation file system according to the present application, the annotation group of each file is unique, and the annotations can be used as the basis for file query; the annotation system converts the directory result into data and manages the data in the form of a database, and the query speed is faster than that of the directory;
[0034] (3) The file synchronization scheme according to the present application is based on the annotation file system, and uses special annotations to mark the files that have been changed; when the user initiates synchronization, all changed files can be queried from the annotations, and the time for searching files is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some embodiments of the present application, and for those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0036] Figure 1 An instance diagram of a file in a directory structure of a file system according to the present application;
[0037] Figure 2 An instance diagram of a file in a directory structure of a file system according to the present application; Figure 1 An instance diagram of a file in a directory structure of a file system according to the present application;
[0038] Figure 3 An instance diagram of a file in a directory structure of a file system according to the present application; Figure 1 An instance diagram of a file in a directory structure of a file system according to the present application;
[0039] Figure 4 An instance diagram of a file in a directory structure of a file system according to the present application; Figure 1 An instance diagram of a file in a directory structure of a file system according to the present application;
[0040] Figure 5 A file synchronization flowchart of a file synchronization scheme according to the present application. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the scope of protection of the present application.
[0042] EMBODIMENT
[0043] The present application provides a specific embodiment of a file system, and the specific content of the embodiment is as follows.
[0044] An annotation is added to a file and file description information in a file system, and the file is managed by managing the annotation, wherein the annotation includes an annotation representing a file, a directory level annotation representing file description information, and a common annotation.
[0045] It should be understood that, on the basis of the above scheme, an annotation is added to a file and file description information, and the file is managed by managing the annotation, and the specific steps include:
[0046] S1, storing the file into the disk and creating inode of the file;
[0047] S2, assigning ID to the inode number of the file and the file description information, and adding mark to them, realizing the distinction between the file and its description information and the distinction between the general description information and the directory information, storing the mark and the mark modification data; meanwhile, storing the file description information and the relationship between the file;
[0048] S3, managing the file by managing the mark through the operation on the file, the file description information or the mark.
[0049] It should be understood that, on the basis of the above scheme, step S2 specifically includes:
[0050] S2-1, assigning ID to the inode number of the file and the file description information, i.e. Did; meanwhile, marking them and assigning mark ID, i.e. Zid;
[0051] S2-2, storing the data and the mark and the management between them in the data storage area, the mark storage area and the relationship storage area respectively;
[0052] S2-3, meanwhile, regarding the inode number of the file as the file, using "file" mark modification, regarding the file description information using other mark annotation and associating to the file inode number described by it, and then storing into the relationship storage area.
[0053] It should be understood that, on the basis of the above scheme, step S2-2 specifically includes:
[0054] The data is the inode number of the file and the file description information, and the data and the assigned Did are stored in the data storage unit of the data storage area in the form of binary tuple (Did, data); the Did of the data and the mark Zid annotated to him are stored in the mark relationship storage unit of the data storage area in the form of binary tuple (Did, Zid);
[0055] The mark id (Zid) and the mark name (Zname) are stored in the mark storage area;
[0056] The association information between the inode number representing the file and the file description information representing the file attribute is stored in the relationship storage area, and for each non-file data (Didn), it must be associated to a file data (Didf), and is stored in the form of multi-tuple (Didf, Did1, Did2, …).
[0057] It should be understood that, on the basis of the above scheme, step S3 specifically includes:
[0058] Operating on the file:
[0059] Add file: When adding a file, the file description information needs to be associated with the file, and steps S1 to S2 are performed at the time of adding;
[0060] Query file: The Did of the file is obtained from the file description information, the Did with the file inode number containing all file description information Did is screened out, the inode number of the file is obtained, the disk information occupied by the file is obtained, and the file is queried;
[0061] Delete file: Based on file query, the inode number of the file and the Did of the file description information are queried, the disk occupied by the file is recycled, and the association between the description information and the file is deleted;
[0062] Modify file: Based on file query, the file content is updated to the disk;
[0063] Operation on file description information:
[0064] Add description information: When a user adds description information for a file, the description information is stored in the data storage area, and the Did of the data is associated with the file;
[0065] Query description information: When a user views the description information of a file, the Did of the inode number representing the file is obtained, the Did of all description information of the file is obtained from the relationship storage area, and the description information corresponding to the Did is queried;
[0066] Delete description information: When a user needs to delete the description information of a file, the association between the file and the description information is removed;
[0067] Modify description information: Modifying file description information can be regarded as deleting description information and then adding description information.
[0068] It should be understood that, on the basis of the above scheme, the file description information in the annotation file system is marked as a directory level, so that the mutual conversion between the directory system and the annotation file system can be realized.
[0069] The annotation file system provided by the application comprises the following modules:
[0070] File module: The file content to be stored is recorded in the disk, the first disk block is recorded, and the inode is created for the file, and the inode number is taken as the identifier of the file;
[0071] Tagging module: used for adding tags to files and file description information. Assign an id (denoted as Did) to the inode number representing the file and the data of file description information, and then mark the tags and assign a tag id (denoted as Zid); if it is the inode number representing the file, mark the tag Zid representing the file, if it is the file description information, mark the tag representing the directory level, and if no directory level is marked, identify it as a general file description. Moreover, the file description information needs to be associated with the file, so that the file and its description information are associated;
[0072] Storage module: used for storing the information after the tagging process in the disk. According to the storage content, it is divided into a data storage area, a tag storage area, and a relationship storage area; the data storage area stores the inode number representing the file and the string representing the file description information, the tag storage area stores all the tag information in the system, and the relationship storage area records the association information between the file and its description information;
[0073] File operation module: used for processing the addition, deletion, modification, and query of file content and file description information;
[0074] Tag operation module: used for processing the addition, deletion, modification, and query of data tags.
[0075] It should be understood that, on the basis of the above scheme, the storage module specifically includes:
[0076] Data storage area: including inode numbers representing files and description information, collectively referred to as data, the data storage area includes data storage units and tag relationship storage units, and the data and the assigned Did are stored in the data storage units; the Did of the data and the tag Zid marked for it are stored in the tag relationship storage units in the form of a binary tuple (Did, Zid);
[0077] Tag storage area: the tag name (Zname) and the Zid assigned to the tag are stored in the form of a binary tuple (Zid, Zname);
[0078] Relationship storage area: the association information between the inode number representing the file and the file description information representing the file attribute is stored in the relationship storage area, and for each non-file data (Didn), it must be associated with a file data (Didf), and is stored in the form of a multi-tuple (Didf, Did1, Did2, …).
[0079] The file synchronization scheme provided by the present application is based on the note file system, and the note file system reserves two special attributes for file synchronization, which are represented by private notes and cannot be used at will by users. The two attributes are respectively used to represent files that need to be backed up and files that have been modified in the backup files. When the user performs file synchronization, the files that have been changed are obtained through file query based on the special attributes, and the synchronization is performed on these files.
[0080] It should be understood that, on the basis of the above scheme, the two special attributes are "synchronization" and "modified", "synchronization" is used to mark the backup file, and "modified" is used to mark the changed file. When synchronizing, the "modified" attribute is queried to obtain all changed files to be synchronized, and then synchronization is initiated. The note file system can be converted from the directory system. It is assumed that there is a directory structure as shown in Figure 1 The five files file_1, file_2, file_3, file_4 and file_5, and the directory names dir_1, dir_2, dir_3, dir_4 and dir_5 are respectively file names A, B, C, D, E and F. The directory name and the file name are used as the description information of the file, and the note of the directory level information is extracted and marked, and is converted into the note system.
[0081] As shown in Figure 2 The data storage area in the system is divided into a data storage unit and a relationship storage unit. The inode number and the file description information of the file are recorded in the data storage unit, and the file description information and the level information thereof are recorded in the relationship storage unit.
[0082] As shown in Figure 3 The note storage area records all the note information in the system.
[0083] As shown in Figure 4 The description information of the file and the file are associated by using id.
[0084] The present application provides a specific embodiment of a file synchronization scheme, and the specific content of the embodiment is as follows.
[0085] The flow of file synchronization is as shown in Figure 5The user first selects the files to be backed up, and the system marks these files with a "synchronization" note, and then initiates synchronization, uploading all files with the "synchronization" note to the server. When the client user modifies the files with the "synchronization" note, the system marks these files with a "modified" note. When the user initiates synchronization, the system filters the files to be synchronized through the "modified" note, and then uploads these files. After the server completes the synchronization task, the result is returned to the client, and the "modified" note of the synchronized files is deleted, and the files are considered to have completed synchronization.
[0086] In summary, the note file system adopts a bottom-up design philosophy, i.e., the file is first created and then the note is added. The note is used to manage the file without considering the location of the file and the directory structure of the file, making the storage of multiple classification files in the file system more convenient. Secondly, the system is file-centered, and the directory information is converted into data information, which is stored and managed in a database manner, improving the efficiency of file query. Finally, the note can classify and quickly query the file, and the special note can mark the files to be synchronized, which can shorten the filtering time of the files to be synchronized, thereby improving the file synchronization efficiency.
[0087] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An inscription file system, characterized by, The file system manages files in a way of managing notes; The relationship between the notes and the files is represented in a way of note database, that is, first there are files and note data, and then the notes are marked to them; the file mark identifies the note representation entity, and the note data marks the general note, representing the entity attribute; The note data is the description information of the file, which is divided into two types. One is the same as the directory, which is the information needed for positioning the file, and can be regarded as the directory name at each level of the file location, and is marked with notes representing the directory level, so as to realize the mutual conversion of the directory system and the note system. The other is the self-defined description information, which does not have to be marked as the note of the directory level, and is given other meanings for the file, which is used for file retrieval and classification The file system includes a file module, a marking module, a storage module, a file operation module and a note operation module: The file module is used to manage the disk block information occupied by the file. The system uses inode to describe the file, and the inode contains the metadata information of the file. One inode corresponds to one file, and the inode number of the file is taken as the unique identifier of the file; The marking module is used to add notes to the file and the description information of the file. The inode number representing the file and the data representing the file description information are allocated with id, recorded as Did, and then marked with notes and allocated with note id, recorded as Zid. If it is the inode number representing the file, the note Zid representing the file is marked. If it is the description information of the file, the note representing the directory level is marked. If the directory level is not marked, it is identified as a general file description. And the description information of the file needs to be associated with the file, so that the file and its description information are associated; The storage module is used to store the information processed by the marking in the disk. According to the storage content, it is divided into data storage area, note storage area and relationship storage area. The data storage area stores the inode number representing the file and the string representing the file description information. The note storage area stores all note information in the system. The relationship storage area records the association information between the file and its description information. The association information between the inode number representing the file and the file description information representing the file attribute is stored in the relationship storage area. For each non-file data, it is associated with a file data, and is stored in the form of multiple tuples; The file operation module is used to process the addition, deletion, modification and query of the file content and the file description information; The operations on the file include: file content operation and file description information operation; the file content operation includes: adding a file; the file description information needs to be associated with the file while adding the file; the file is stored in the disk when adding, and the inode of the file is created; the ID of the file inode number and the file description information is allocated, and the note is added, so as to realize the distinction of the file and the description information and the ordinary description information and the directory information; the note and the note modification data are stored; the file description information and the file are stored; querying a file; the file description information is obtained, the Did is screened out, the file inode number is obtained, the disk information occupied by the file is obtained, and the file is queried; deleting a file; based on the file query, the inode number of the file and the Did of the file description information are queried, the disk occupied by the file is recycled, and the association relationship between the description information and the file is deleted; modifying a file; based on the file query, the file content is updated to the disk; the file description information operation includes: adding description information; when the user adds new description information for a file, the description information is stored in the data storage area, and the Did of the data is associated with the file; querying description information; when the user views the description information of a file, the Did of the inode number representing the file is obtained, the Did of all description information of the file is obtained from the relationship storage area, and then the description information corresponding to the Did is queried; deleting description information; when the user needs to delete the description information of a file, the association between the file and the description information is removed; modifying description information; modifying the file description information can be regarded as deleting the description information and then adding the description information. The note operation module is used for processing the increase, deletion, modification and query of the data mark.
2. A file synchronization scheme, characterized by, The file synchronization scheme is established on the basis of the note file system in claim 1, special properties with synchronization meaning are added to the files needing synchronization, and all files needing synchronization can be quickly queried from the special properties.
3. A file synchronization scheme as claimed in claim 2, characterized in that, The special notes include: the "synchronization" note is used for marking the files needing backup, and the "modified" note is used for marking the files having changes; when the file marked by the "synchronization" note is modified, the system associates the file with the "modified" note, and all files needing synchronization can be quickly queried from the "modified" note.
4. An electronic device, comprising: The device comprises at least one processor, at least one memory, a communication interface and a bus; wherein the processor, the memory and the communication interface complete the communication among each other through the bus; the memory stores a note file system program which can be executed by the processor, and the note file system program is configured to realize the function of the note file system in claim 1.
5. A computer readable storage medium, characterized in that, The storage medium stores a note file system program, and the note file system program realizes the function of the note file system in claim 1 when being executed.
Citation Information
Patent Citations
Computer file management method
CN105468785A
Metadata management method, file storage system and server
CN113190505A