CN112199341A - File storage system, method and equipment - Google Patents

File storage system, method and equipment Download PDF

Info

Publication number
CN112199341A
CN112199341A CN202011419290.5A CN202011419290A CN112199341A CN 112199341 A CN112199341 A CN 112199341A CN 202011419290 A CN202011419290 A CN 202011419290A CN 112199341 A CN112199341 A CN 112199341A
Authority
CN
China
Prior art keywords
file
identifier
storage
management table
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011419290.5A
Other languages
Chinese (zh)
Inventor
曾熙
李审霖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Fangduoduo Network Technologies Co ltd
Original Assignee
Shenzhen Fangduoduo Network Technologies Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Fangduoduo Network Technologies Co ltd filed Critical Shenzhen Fangduoduo Network Technologies Co ltd
Priority to CN202011419290.5A priority Critical patent/CN112199341A/en
Publication of CN112199341A publication Critical patent/CN112199341A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms

Abstract

The embodiment of the invention relates to the technical field of information data management, in particular to a file storage system, a file storage method and file storage equipment, wherein the system comprises a body storage module, a reference file generation module and a file management table; the body storage module is used for storing the file body of the file in a special area when the file is imported into a file directory of the system, and generating a file identifier of the file and a storage path of the file body in a file management table; the reference file generation module is used for generating a reference file corresponding to the file in a file directory and associating the reference file with the file identifier of the file; and the reference file generating module is also used for generating a new reference file in the new file directory and associating the new reference file with the file identifier of the file when the reference file is copied to the new file directory. Through the mode, the embodiment of the invention can effectively reduce the waste of storage space generated by classifying and storing the same file, and avoids data redundancy.

Description

File storage system, method and equipment
Technical Field
The embodiment of the invention relates to the technical field of information data management, in particular to a file storage system, method and device.
Background
After entering the internet era, when a user uses electronic equipment such as a computer and a mobile phone, various data files can be acquired, and when the user saves the files, the files can be classified according to the required category and dimension. For example, for a photo, the user may be categorized according to dimensions such as time, location, people, etc. The current scheme for classifying files is mainly to copy the same files in folders of different classes for storage.
In the process of implementing the embodiment of the present invention, the inventors found that: the existing method for storing the same files in a classified manner wastes file storage space.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present invention provide a file storage system, method, and device, which are used to solve the problem in the prior art that a file storage space is wasted when the same file is classified and stored.
According to an aspect of an embodiment of the present invention, there is provided a file storage system, including an ontology storage module, a reference file generation module, and a file management table;
the body storage module is used for storing a file body of a file in a special area when the file is imported into a file directory of the system, and generating a file identifier of the file and a storage path of the file body in the file management table;
the reference file generating module is used for generating a reference file corresponding to the file in the file directory and associating the reference file with the file identifier of the file;
the reference file generating module is further configured to generate a new reference file corresponding to the file in a new file directory when the reference file is copied to the new file directory, and associate the new reference file with the file identifier of the file.
In an optional manner, the system further comprises:
and the positioning module is used for searching the storage path of the file body in the file management table through the file identification of the file when any cited file is opened, positioning the file body of the file according to the storage path of the file body, and opening the file body of the file.
In an optional manner, the reference file generating module includes:
and the reference counting unit is used for counting the reference files corresponding to the file identifications and recording reference counting results in the file management table.
In an optional manner, the system further comprises:
a deleting module, configured to delete any of the referenced files, and adjust a reference count result corresponding to the file identifier in the file management table after deleting the any referenced file;
and if the adjusted reference counting result corresponding to the file identification is 0, deleting the file body corresponding to the file identification under the storage path.
In an optional manner, the ontology storage module is further configured to generate file information corresponding to a file identifier of the file in the file management table.
In an optional manner, the file management table is configured to record a storage path and file information of the file body corresponding to a file identifier of the file;
the file information of any reference file and the file body is the same and is the value of the file information field corresponding to the file identifier in the file management table; the system further comprises:
and the file information updating module is used for changing the value of the file information field corresponding to the file identifier in the file management table into the changed file information when the file information of any reference file is changed.
In an optional manner, the file information includes: file name, file authority, file type, file size, or modification time.
In an optional manner, the system further comprises:
and the storage path updating module is used for changing the value of the storage path field of the file body corresponding to the file identifier in the file management table into the changed storage path when the system changes the storage path of the file body.
According to another aspect of the embodiments of the present invention, there is provided a file storage method applied to a file storage system, the method including:
when a file is imported into a file directory of the system, storing a file body of the file in a special area, and generating a file identifier of the file and a storage path of the file body in a file management table of the system;
generating a reference file corresponding to the file in the file directory, and associating the reference file with the file identifier of the file;
when the reference file is copied to a new file directory, a new reference file corresponding to the file is generated under the new file directory, and the new reference file is associated with the file identifier of the file.
According to still another aspect of an embodiment of the present invention, there is provided a file storage apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation of the file storage method.
In the file storage system provided by the embodiment of the present invention, when a user imports a file into a file directory, a file body of the file is stored in a dedicated area, a reference file corresponding to the file is generated under the file directory and is associated with a file identifier of the file, and when the user copies the reference file into a new file directory, a new reference file corresponding to the file is generated under the new file directory, and the new reference file is associated with the file identifier of the file. Through the system, the file body is stored in the special area of the system under the condition that the same file is respectively stored in different file directories by a user, and only the reference file corresponding to the file is generated in each file directory without occupying the storage space, so that the file storage space is only occupied once for the same file, the waste of the file storage space generated by classified storage of the same file can be effectively reduced, the data redundancy is avoided, the classified storage management of the file is optimized, and a large amount of storage space is saved.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
Drawings
The drawings are only for purposes of illustrating embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a schematic structural diagram of a file storage system according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a file storage method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a file storage device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein.
The embodiment of the invention is mainly applied to scenes of storing the same data files in electronic equipment such as computers, mobile terminals, servers and the like in a classified manner. Fig. 1 shows a schematic structural diagram of a file storage system according to an embodiment of the present invention. As shown in fig. 1, the system 100 includes: an ontology storage module 110, a reference file generation module 120, and a file management table 130.
The entity storage module 110 is configured to store a file entity of a file in a dedicated area when the file is imported into a file directory of the system, and generate a file identifier of the file and a storage path of the file entity in the file management table 130;
the cited file generating module 120 is configured to generate a cited file corresponding to the file in the file directory, and associate the cited file with a file identifier of the file;
the cited file generating module 120 is further configured to generate a new cited file corresponding to the file in a new file directory when the cited file is copied to the new file directory, and associate the new cited file with the file identifier of the file.
The special area is a specific storage space of a file body used for storing the file by the system, such as a hidden partition of a magnetic disk or a hidden folder of an operating system disk, so that a user cannot easily find the file body, and the situation that a quote file of the file is unavailable due to the fact that the user deletes the file body by misoperation is prevented.
The file management table 130 is used to record the storage path and the file information of the file body of the file corresponding to the file identifier of the file. The file information includes: file name, file rights, file type, file size and/or modification time, etc. The file identifier may be used to uniquely mark a file.
In an optional embodiment, the ontology storage module 110 is further configured to generate file information corresponding to the file identifier of the file in the file management table 130. Specifically, several fields, such as a file identification field, a file name field, a storage path field of a file body, a file authority field, a file type field, a file size field, and/or a modification time field, may be included in the file management table 130 for a file to record related information of the file. When generating the file identifier of the file, the storage path of the file ontology, and the file information, the ontology storage module 110 may write a specific value in the corresponding field.
The reference file is an index of the file and is associated with the file identifier of the file. In particular, the file identifier of the file may be included in the reference file. The reference file is not a copy of the file, and does not occupy a certain file storage space like a file body of the file, and the reference file can only include the file identifier of the file, so that the occupied storage space is small and can be ignored.
It should be noted that, in addition to the two reference files, the user may copy and generate more reference files in more different file directories to perform detailed classified storage management on the files. For example, for a video file a, a user can import the file in the time a folder, the body storage module 110 stores the file body of the file a in a dedicated area, and generates a file identifier 0001 of the file a and a storage path of the file body in the file management table 130, such as C: \ System \ RealFile \ 0001; the reference file generating module 120 generates a first reference file corresponding to the file a in the time a folder, and associates the first reference file with the file identifier 0001 of the file a, for example, writes the file identifier 0001 in the first reference file; when the user copies the first reference file to the place b folder, the reference file generating module 120 generates a second reference file corresponding to the file a under the place b folder, and associates the second reference file with the file identifier 0001 of the file a, for example, writes the file identifier 0001 in the second reference file; similarly, when the user copies the second reference file to the person c folder, the reference file generating module 120 generates a third reference file corresponding to the file a under the person c folder, and associates the third reference file with the file identifier 0001 of the file a, for example, writes the file identifier 0001 in the third reference file.
In an optional manner, the system 100 further comprises:
the positioning module 140 is configured to, when any of the cited files is opened, search the storage path of the file body in the file management table 130 through the file identifier of the file, position the file body of the file according to the storage path of the file body, and open the file body of the file.
Specifically, when the user needs to open any one of the reference files, for example, when the user opens the third reference file, the positioning module 140 finds the storage path C: \ System \ RealFile \0001 of the file body in the file management table 130 through the file identifier 0001 included in the third reference file, positions the file body of the file a according to the storage path, and opens the file body.
In an optional manner, the reference file generating module 120 includes:
a reference counting unit 121, configured to count reference files corresponding to the file identifiers, and record a reference counting result in the file management table 130.
Specifically, the file management table 130 is further configured to record a reference count result corresponding to a file identifier of the file. For example, a reference count field corresponding to the file identification of the file may also be included for the file in the file management table 130. The initial value of the reference count field is 0.
Correspondingly, the reference counting unit 121 is configured to, when a reference file corresponding to the file is generated in the file directory, add one to a value of a reference count field corresponding to a file identifier of the file in the file management table 130; the reference count unit 121 is further configured to, when the new directory generates a new reference file corresponding to the file, add one more to a value of a reference count field corresponding to a file identifier of the file in the file management table 130.
In the above example of the video file a, when the reference file generation module 120 generates the first, second, and third reference files, the reference count unit 121 modifies the values of the reference count fields corresponding to the file identifier 0001 into 1, 2, and 3 in the file management table 130, respectively.
In an alternative, the system 100 further comprises:
a deleting module 150, configured to delete any reference file, and after deleting the any reference file, adjust a reference count result corresponding to the file identifier in the file management table 130;
and if the adjusted reference counting result corresponding to the file identification is 0, deleting the file body corresponding to the file identification under the storage path.
Specifically, when a user deletes a reference file, the deletion module 150 deletes the reference file, and decreases the value of the reference count field corresponding to the file identifier by one in the file management table 130 according to the file identifier associated with the reference file; and if the value of the reference count field is 0, deleting the file body corresponding to the file identifier under the storage path.
In the above example, if the user deletes the first, second, and third reference files in sequence, the deleting module 150 deletes the corresponding reference files, and modifies the values of the reference count field corresponding to the file identifier 0001 to be 2, 1, and 0 in the file management table 130. When the deleting module 150 deletes the first and second reference files, the deleting module 150 does not delete the file body because the value of the reference count field is not 0, but when deleting the third reference file, the deleting module 150 judges that the value of the reference count field corresponding to the file identifier 0001 is 0, queries the storage path of the file body according to the file identifier 0001, and deletes the file body corresponding to the file identifier 0001 under the storage path.
Further, the deleting module 150 may clear all field records corresponding to the file identifier in the file management table 130 after deleting the file body corresponding to the file identifier.
In an optional manner, any of the file information of the reference file and the file body is the same and is a value of a file information field corresponding to the file identifier in the file management table 130; the system 100 further comprises:
a file information updating module 160, configured to, when the file information of any of the referenced files is changed, change the value of the file information field corresponding to the file identifier in the file management table 130 into the changed file information.
Specifically, when the user changes the file information of any reference file, the file information updating module 160 changes the value of the file information field corresponding to the file identifier associated with the reference file into the changed file information in the file management table 130 according to the operation of the user. As described above, the file information may include a file name, file authority, file type, file size, modification time, and/or the like. Taking the video file a as an example, when the entity storage module 110 generates the file identifier 0001 of the file a and the storage path of the file entity in the file management table 130, various file information of the file a may be generated, for example, a specific value is written in a corresponding field in the file management table 130, and one example is shown in table 1.
TABLE 1
File identification File name Document body storage path File type File size File rights Modifying time Reference counting
0001 A C:\System\RealFile\0001 video 100MB public 11 months, 5 days, 18 hours and 12 minutes 0
The file information of the three reference files and the file body of the file A are the same and are the values of the file information fields corresponding to the file identifier 0001 in the table 1. The file information in table 1 is displayed when the user views a certain reference file attribute. Subsequently, when the user changes the file information of one of the referenced files of file a, if the second referenced file is operated to change the file name to a1, the file information updating module 160 changes the value of the file name field corresponding to the file identifier 0001 associated with the second referenced file to the changed file name a1 in table 1 according to the user operation, and may update the value of the modification time field to 11 months, 6 days, 17 hours, 26 minutes. The file information of the remaining referenced files and the file body is updated to the changed file information in the file management table 130.
In an alternative, the system 100 further comprises:
the storage path updating module 170 is configured to, when the system 100 changes the storage path of the file ontology, change the value of the storage path field of the file ontology corresponding to the file identifier in the file management table 130 into the changed storage path.
Specifically, the storage path of the file body of the file is not easily changed, but in some special cases, if the disk storage space is not enough, the storage path of the file needs to be adjusted, the file storage system 100 may change the storage path of the file body, the storage path updating module 170 stores the file body of the file in the new storage path, and changes the value of the storage path field of the file body corresponding to the file identifier in the file management table 130 into the changed storage path. For example, for a video file a, the System 100 needs to store the video file a in a New dedicated area, the storage path updating module 170 stores the file body of the file in a New storage path C \ System \ RealFile \ New \0001, and changes the value of the storage path field of the corresponding file body into C \ System \ RealFile \ New \0001 in the file management table 130 according to the file identifier 0001 of the file a.
In summary, in the file storage system provided in the embodiment of the present invention, when a user imports a file into a file directory, a file body of the file is stored in a dedicated area, a reference file corresponding to the file is generated in the file directory and is associated with a file identifier of the file, and when the user copies the reference file into a new file directory, a new reference file corresponding to the file is generated in the new file directory, and the new reference file is associated with the file identifier of the file. Through the system, the file body is stored in the special area of the system under the condition that the same file is respectively stored in different file directories by a user, and only the reference file corresponding to the file is generated in each file directory without occupying the storage space, so that the file storage space is only occupied once for the same file, the waste of the file storage space generated by classified storage of the same file can be effectively reduced, the data redundancy is avoided, the classified storage management of the file is optimized, and a large amount of storage space is saved. In addition, the file storage system provided by the embodiment of the invention can be directly embedded into an operating system of the electronic equipment and directly run in the operating system, so that the classification management of the files by a user is facilitated, the files are not required to be checked, marked and classified by some special management software, the user operation is simplified, and the user experience is improved.
Fig. 2 is a flowchart illustrating a file storage method according to an embodiment of the present invention. The file storage method can be applied to the file storage system. As shown in fig. 2, the method comprises the steps of:
step 210: when a file is imported into a file directory of the system, storing a file body of the file in a special area, and generating a file identifier of the file and a storage path of the file body in a file management table of the system.
Specifically, the file management table is configured to record a storage path and file information of a file body of the file corresponding to the file identifier of the file. The file information may include: file name, file rights, file type, file size and/or modification time, etc.
In an optional embodiment, after the generating the file identifier of the file and the storage path of the file ontology in the file management table of the system, the method includes:
and generating file information corresponding to the file identification of the file in the file management table.
Step 220: and generating a reference file corresponding to the file in the file directory, and associating the reference file with the file identifier of the file.
Step 230: when the reference file is copied to a new file directory, a new reference file corresponding to the file is generated under the new file directory, and the new reference file is associated with the file identifier of the file.
The reference file is an index of the file and is associated with the file identifier of the file. In particular, the file identifier of the file may be included in the reference file.
In an optional embodiment, the generating, under the file directory, a reference file corresponding to the file includes:
step 240: when any cited file is opened, searching the storage path of the file body in the file management table through the file identification of the file, positioning the file body of the file according to the storage path, and opening the file body of the file.
In an optional embodiment, the step 220 of generating a reference file corresponding to the file under the file directory includes:
step 221: and counting the reference files corresponding to the file identifications, and recording counting results in the file management table.
Specifically, the file management table is further configured to record a reference count result corresponding to a file identifier of the file. For example, a reference count field corresponding to the file identification of the file may also be included for the file in the file management table.
In an optional manner, when a reference file corresponding to the file is generated in the file directory, in the file management table, a value of a reference count field corresponding to a file identifier of the file is incremented by one;
and when the new directory generates a new reference file corresponding to the file, adding one more to the value of the reference count field corresponding to the file identifier of the file in the file management table.
In an optional embodiment, after counting the reference files corresponding to the file identifiers and recording the counting result in the file management table, the method includes:
step 250: when any reference file is deleted, adjusting a reference counting result corresponding to the file identifier in the file management table; and if the adjusted reference counting result corresponding to the file identification is 0, deleting the file body corresponding to the file identification under the storage path.
Specifically, when a user deletes a reference file, the system deletes the reference file, and subtracts one from the value of a reference count field corresponding to the file identifier in the file management table according to the file identifier associated with the reference file; and if the value of the reference count field is 0, deleting the file body under the storage path corresponding to the file identifier.
Further, after deleting the file body corresponding to the file identifier, all field records corresponding to the file identifier in the file management table can be cleared.
In an optional embodiment, any of the file information of the reference file and the file body is the same and is a value of a file information field corresponding to the file identifier in the file management table; step 230 includes, after the new file directory generates a new reference file corresponding to the file:
step 260: and when the file information of any reference file is changed, changing the value of the file information field corresponding to the file identifier in the file management table into the changed file information.
Specifically, when a user changes the file information of any reference file, the value of the file information field corresponding to the file identifier associated with the reference file is changed into the changed file information in the file management table according to the operation of the user.
In an optional embodiment, step 220 includes, after generating the reference file corresponding to the file under the file directory:
step 270: and when the system changes the storage path of the file body, changing the value of the storage path field of the file body corresponding to the file identifier in the file management table into the changed storage path.
It should be noted that the above file storage method and the file storage system provided in the embodiment of the present invention are based on the same concept, and details can be referred to the description in the above file storage system embodiment, and are not described herein again.
In summary, in the file storage method provided in the embodiments of the present invention, when a user imports a file into a file directory, a file body of the file is stored in a dedicated area, a reference file corresponding to the file is generated in the file directory and is associated with a file identifier of the file, and when the user copies the reference file into a new file directory, a new reference file corresponding to the file is generated in the new file directory, and the new reference file is associated with the file identifier of the file. By the method, the file body is stored in the special area of the system under the condition that the same file is respectively stored in different file directories by a user, and only the reference file corresponding to the file is generated in each file directory without occupying storage space, so that the file storage space is occupied for the same file only once, waste of the file storage space generated by classified storage of the same file can be effectively reduced, data redundancy is avoided, classified storage management of the file is optimized, and a large amount of storage space is saved. In addition, the file storage method provided by the embodiment of the invention can be directly embedded into an operating system of the electronic equipment and directly executed in the operating system, so that the classification management of the files by a user is facilitated, the files are not required to be checked, marked and classified by some special management software, the user operation is simplified, and the user experience is improved.
Fig. 3 is a schematic structural diagram of a file storage device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the file storage device.
As shown in fig. 3, the file storage device may include: a processor (processor)302, a communication Interface 304, a memory 306, and a communication bus 308.
Wherein: the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 308. A communication interface 304 for communicating with network elements of other devices, such as clients or other servers. The processor 302 is configured to execute the program 310, and may specifically perform the relevant steps in the embodiment of the file storage method described above.
In particular, program 310 may include program code comprising computer-executable instructions.
The processor 302 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The file storage device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Specifically, the program 310 may be invoked by the processor 302 to cause the file storage device to perform the following operations:
when a file is imported into a file directory of a file storage system, storing a file body of the file in a special area, and generating a file identifier of the file and a storage path of the file body in a file management table of the system;
generating a reference file corresponding to the file in the file directory, and associating the reference file with the file identifier of the file;
when the reference file is copied to a new file directory, a new reference file corresponding to the file is generated under the new file directory, and the new reference file is associated with the file identifier of the file.
In an optional manner, after generating the reference file corresponding to the file under the file directory, the method includes:
when any cited file is opened, searching the storage path of the file body in the file management table through the file identification of the file, positioning the file body of the file according to the storage path, and opening the file body of the file.
In an optional manner, the generating, under the file directory, a reference file corresponding to the file includes:
and counting the reference files corresponding to the file identifications, and recording counting results in the file management table.
In an optional manner, after counting the reference files corresponding to the file identifiers and recording the counting result in the file management table, the method includes:
when any reference file is deleted, adjusting a reference counting result corresponding to the file identifier in the file management table;
and if the adjusted reference counting result corresponding to the file identification is 0, deleting the file body corresponding to the file identification under the storage path.
In an optional manner, after the generating of the file identifier of the file and the storage path of the file ontology in the file management table of the system, the method includes:
and generating file information corresponding to the file identification of the file in the file management table.
In an optional manner, the file management table is configured to record a storage path and file information of the file body corresponding to a file identifier of the file;
the file information of any reference file and the file body is the same and is the value of the file information field corresponding to the file identifier in the file management table; after the new file directory generates a new reference file corresponding to the file, the method comprises the following steps:
and when the file information of any reference file is changed, changing the value of the file information field corresponding to the file identifier in the file management table into the changed file information.
In an optional manner, the file information includes: file name, file authority, file type, file size, or modification time.
In an optional manner, after generating the reference file corresponding to the file under the file directory, the method includes: and when the system changes the storage path of the file body, changing the value of the storage path field of the file body corresponding to the file identifier in the file management table into the changed storage path.
The file storage device may specifically be an electronic device such as a computer, a mobile terminal, a server, and the like, and may have the file storage system provided in the embodiment of the present invention, and execute the file storage method provided in the embodiment of the present invention, and have corresponding functional modules and beneficial effects. For technical details that are not described in detail in this embodiment, reference may be made to the above-described embodiments of the file storage system and method.
In summary, in the file storage device provided in the embodiment of the present invention, when a user imports a file into a file directory, a file body of the file is stored in a dedicated area, a reference file corresponding to the file is generated in the file directory and is associated with a file identifier of the file, and when the user copies the reference file into a new file directory, a new reference file corresponding to the file is generated in the new file directory, and the new reference file is associated with the file identifier of the file. Through the equipment, for the condition that a user respectively stores the same file in different file directories, the file body is stored in the special area of the system, only the reference file corresponding to the file is generated in each file directory, and the storage space is not occupied, so that the file storage space is only occupied once for the same file, the waste of the file storage space generated by classified storage of the same file can be effectively reduced, the data redundancy is avoided, the classified storage management of the file is optimized, and a large amount of storage space is saved. In addition, the program executed by the file storage device provided by the embodiment of the invention can be directly embedded into the operating system of the file storage device and directly run in the operating system, so that the classification management of the files by a user is facilitated, the files are not required to be checked, marked and classified by some special management software, the user operation is simplified, and the user experience is improved.
An embodiment of the present invention provides a computer-readable storage medium, where the storage medium stores at least one executable instruction, and when the executable instruction runs on a file storage device, the file storage device is enabled to execute the file storage method in any of the above embodiments. For details of the file storage system and method provided by the present invention, reference may be made to the embodiments of the file storage system and method not described in detail in the present embodiment.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.

Claims (10)

1. A file storage system is characterized by comprising a body storage module, a reference file generation module and a file management table;
the body storage module is used for storing a file body of a file in a special area when the file is imported into a file directory of the system, and generating a file identifier of the file and a storage path of the file body in the file management table;
the reference file generating module is used for generating a reference file corresponding to the file in the file directory and associating the reference file with the file identifier of the file;
the reference file generating module is further configured to generate a new reference file corresponding to the file in a new file directory when the reference file is copied to the new file directory, and associate the new reference file with the file identifier of the file.
2. The system of claim 1, further comprising:
and the positioning module is used for searching the storage path of the file body in the file management table through the file identification of the file when any cited file is opened, positioning the file body of the file according to the storage path of the file body, and opening the file body of the file.
3. The system of claim 1, wherein the reference file generation module comprises:
and the reference counting unit is used for counting the reference files corresponding to the file identifications and recording reference counting results in the file management table.
4. The system of claim 3, further comprising:
a deleting module, configured to delete any of the referenced files, and adjust a reference count result corresponding to the file identifier in the file management table after deleting the any referenced file;
and if the adjusted reference counting result corresponding to the file identification is 0, deleting the file body corresponding to the file identification under the storage path.
5. The system according to claim 1, wherein the ontology storage module is further configured to generate file information corresponding to the file identifier of the file in the file management table.
6. The system according to claim 5, wherein the file management table is configured to record a storage path and file information of the file body corresponding to a file identifier of the file;
the file information of any reference file and the file body is the same and is the value of the file information field corresponding to the file identifier in the file management table; the system further comprises:
and the file information updating module is used for changing the value of the file information field corresponding to the file identifier in the file management table into the changed file information when the file information of any reference file is changed.
7. The system of claim 6, wherein the file information comprises: file name, file authority, file type, file size, or modification time.
8. The system of claim 1, further comprising:
and the storage path updating module is used for changing the value of the storage path field of the file body corresponding to the file identifier in the file management table into the changed storage path when the system changes the storage path of the file body.
9. A file storage method is applied to a file storage system, and comprises the following steps:
when a file is imported into a file directory of the system, storing a file body of the file in a special area, and generating a file identifier of the file and a storage path of the file body in a file management table of the system;
generating a reference file corresponding to the file in the file directory, and associating the reference file with the file identifier of the file;
when the reference file is copied to a new file directory, a new reference file corresponding to the file is generated under the new file directory, and the new reference file is associated with the file identifier of the file.
10. A file storage device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction which causes the processor to execute the operation of the file storage method according to claim 9.
CN202011419290.5A 2020-12-07 2020-12-07 File storage system, method and equipment Pending CN112199341A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011419290.5A CN112199341A (en) 2020-12-07 2020-12-07 File storage system, method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011419290.5A CN112199341A (en) 2020-12-07 2020-12-07 File storage system, method and equipment

Publications (1)

Publication Number Publication Date
CN112199341A true CN112199341A (en) 2021-01-08

Family

ID=74034479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011419290.5A Pending CN112199341A (en) 2020-12-07 2020-12-07 File storage system, method and equipment

Country Status (1)

Country Link
CN (1) CN112199341A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102332008A (en) * 2011-08-31 2012-01-25 北京邦诺存储科技有限公司 Standard file access protocol-based file management method and equipment
CN102663076A (en) * 2012-03-31 2012-09-12 福建榕基软件股份有限公司 Method for processing file data
CN102970358A (en) * 2012-11-08 2013-03-13 百度在线网络技术(北京)有限公司 Method and device for controlling local cache of mobile client in network disc
CN105306564A (en) * 2015-10-20 2016-02-03 浪潮集团有限公司 Database-based network disk file replication method and server
CN109635829A (en) * 2018-10-23 2019-04-16 惠州Tcl移动通信有限公司 A kind of classification method of picture, mobile terminal and computer storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102332008A (en) * 2011-08-31 2012-01-25 北京邦诺存储科技有限公司 Standard file access protocol-based file management method and equipment
CN102663076A (en) * 2012-03-31 2012-09-12 福建榕基软件股份有限公司 Method for processing file data
CN102970358A (en) * 2012-11-08 2013-03-13 百度在线网络技术(北京)有限公司 Method and device for controlling local cache of mobile client in network disc
CN105306564A (en) * 2015-10-20 2016-02-03 浪潮集团有限公司 Database-based network disk file replication method and server
CN109635829A (en) * 2018-10-23 2019-04-16 惠州Tcl移动通信有限公司 A kind of classification method of picture, mobile terminal and computer storage medium

Similar Documents

Publication Publication Date Title
US20220043830A1 (en) Versioned hierarchical data structures in a distributed data store
US7966603B2 (en) Systems and methods for context-based content management
CN110162525B (en) B+ tree-based read-write conflict resolution method, device and storage medium
US20150302110A1 (en) Decoupling front end and back end pages using tags
CN106446044B (en) Storage space recovery method and device
US20090254585A1 (en) Method for Associating Administrative Policies with User-Definable Groups of Files
CN111881223A (en) Data management method, device, system and storage medium
WO2020041950A1 (en) Data update method, device, and storage device employing b+ tree indexing
US20130085997A1 (en) Information search system, search server and program
WO2020192663A1 (en) Data management method and related device
CN112257005A (en) Form component generation method and device
WO2016192057A1 (en) Updating method and device for index table
CN112199341A (en) File storage system, method and equipment
US11023418B2 (en) Keyword-based data management system and method
CN113641686B (en) Data processing method, data processing apparatus, electronic device, storage medium, and program product
WO2021196957A1 (en) Storage management method and apparatus, and storage system
US11580128B2 (en) Preventing DBMS deadlock by eliminating shared locking
CN110825715B (en) Multi-object data second combination implementation method based on Ceph object storage
CN112632266B (en) Data writing method and device, computer equipment and readable storage medium
Ruldeviyani et al. Enhancing query performance of library information systems using NoSQL DBMS: Case study on library information systems of Universitas Indonesia
US7647362B1 (en) Content-based file versioning
JP3769775B2 (en) Distributed link information maintenance method
CN113254470A (en) Data change method and device, computer equipment and storage medium
WO2024016789A1 (en) Log data query method and apparatus, and device and medium
WO2022171291A1 (en) Method for cataloguing data items in a data storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210108

RJ01 Rejection of invention patent application after publication