Massive small file storage method and system based on index

By establishing cache object indexes in a massive small file storage system, recording file aging and deletion, the problem of low space recycling efficiency of cache pools is solved, and efficient storage and performance improvement is achieved.

CN119148944BActive Publication Date: 2025-02-21SANDSTONE DATA TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411594313.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-09
Publication Date
2025-02-21
Estimated Expiration
2044-11-09

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently manage and recycle cache pool space in massive small file storage systems, especially in small file deletion scenarios, resulting in system performance bottlenecks.

Method used

An index-based method is adopted to establish a cache object index to record the aging degree and deletion of files. Through indicators such as data aging degree and reading heat, cache objects are reasonably locked and recycled to improve storage efficiency.

Benefits of technology

It greatly improves the storage utilization efficiency of cached object data space, reduces the time overhead of writing large objects on the backend, reduces disk wear, and improves system performance and data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148944B_ABST
    Figure CN119148944B_ABST
Patent Text Reader

Abstract

A method and system for storing a large number of small files based on an index. When writing a small file, a cache process writes the cache object in sequence, and increases the number of cached small files of the cache object in the cache object index; the size of the small file and the start position of the storage are recorded in the small file index; when writing a small file, the size of the small file and the start position of the storage are recorded in the small file index; a data aging statistical process counts the time length of data caching in the cache object to obtain the data aging of each cache object, and the data aging is equal to the time length of data writing in the cache object; a backend storage process K locks the cache object whose aging time is greater than the set one; the backend storage process K writes the locked data into the backend large object, and the corresponding relationship between the small file and the backend large object is updated in the small file index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of big data technology, and in particular to an index-based storage system and method for massive small files. Background Art

[0002] The storage medium of a solid state drive generally uses flash memory (FLASH chip) as the storage medium.

[0003] Mechanical hard disks use magnetic disks as storage media. The read and write speeds of mechanical hard disks depend on the rotation speed of the motor, because the motor needs to drive the magnetic disk to rotate at high speed so that the magnetic head can find the designated position for reading and writing.

[0004] Chinese patent application number "2024100198586", application name "Index-based massive small file storage system and method" proposes a system and method for storing massive small files.

[0005] Chinese patent application number is "2024100198586". The main features of this technology are: using an online merging method, the user's file is first written into the cache object of the cache layer, and the mapping relationship between the client file and the cache object is recorded in the index object (meta object) associated with the user file; after the master node receives the client's file write request, it selects a cache object in combination with the HASH value of the file name, writes the data into the cache object in an append-write manner, and records the mapping relationship between the client file and the cache object in the local index database; after the master node receives the write request, if the current cache object has written data exceeding the threshold (default 4M), a new cache object is created to carry the data write operation; the master node packages the current operation log (PGLog) and data and writes them to the local storage, and sends them to the slave node through the network. After all slave nodes write successfully, they reply to the client with a successful write response; the write operation log (PGLog) records the operation type of the cache object while also recording the client file name associated with this write operation.

[0006] Chinese patent application number "2024100198586" is mainly aimed at object storage scenarios, but does not support file system scenarios, and cannot support massive small file scenarios where the cache pool is flushed back to the backend pool. In order to improve read and write efficiency, small files are first written into the cache pool composed of the all-flash array. In the scenario of small file deletion, it is necessary to rely on logs to determine the length of valid data of valid cache objects, which results in the need to traverse the data each time, and the cache pool space cannot be quickly reclaimed.

[0007] With the widespread application of large-scale small file network storage, the storage efficiency of small files has become a major bottleneck of the system. For example, a large number of users in China have begun to widely use cloud services to store and manage text files. During the text editing process, different storage versions correspond to a temporary file. After the final version is finalized, the previously stored temporary files need to be deleted. In this application scenario, how to improve the cache and storage efficiency of temporary small files is a technical problem that needs to be solved urgently.

[0008] Definitions of Abbreviations and Key Terms

[0009] MB, the abbreviation of English, is a storage unit in computers, and its full name is MByte. MB (full name MByte): A storage unit in computers, pronounced "Mega". Summary of the invention

[0010] The present invention establishes a cache object index corresponding to the cache object, and uses the cache object index to record the aging degree of files in the cache object and the remaining number of files after deletion. According to the information recorded in the cache object index, the storage utilization efficiency of the cache object data space is improved. For small files deleted during the caching period, there is no need to write them into the backend large object, which greatly improves the system performance. For cache objects with partially deleted small files, they are merged into a new backend large object during the writing process of the backend large object, which improves the storage efficiency of the backend large object.

[0011] A method for storing a large number of small files based on an index. When writing a small file, a cache process A writes a cache object A in sequence, increases the number of cached small files of the cache object A in the cache object index A, and records the corresponding relationship between the small file and the cache object A in the small file index; the size of the small file and the starting position of the storage are recorded in the small file index; when writing a small file, a cache process B writes a cache object B in sequence, increases the number of cached small files of the cache object B in the cache object index B, and records the corresponding relationship between the small file and the cache object B in the small file index; the size of the small file and the starting position of the storage are recorded in the small file index; when writing a small file, a cache process C writes a cache object C in sequence, increases the number of cached small files of the cache object C in the cache object index C The number of small files cached, the correspondence between small files and cache object C is recorded in the small file index; the size of small files and the starting position of storage are recorded in the small file index; the data aging statistics process counts the length of time the data is cached in the cache object, and obtains the data aging of each cache object, where the data aging is equal to the length of time the data is written to the cache object; the back-end storage process K sorts the data aging of cache objects A, B, and C, and locks the cache objects whose data aging reaches the set value or whose written data size exceeds the threshold, and stops writing new data; the back-end storage process K writes the data in the locked cache object to the back-end large object, and updates the correspondence between small files and the back-end large object in the small file index.

[0012] According to the above-mentioned index-based method for storing massive small files, the read heat of the cache objects that have completed writing to the backend large objects is counted; the above-mentioned read heat is equal to the number of times the small files in the cache objects are read within a set time; the cache object clearing process Q clears the data cached by the cache objects whose read heat is zero to release storage space.

[0013] The data aging is equal to the time when the last data in the cache object was written or the time when the first data was written.

[0014] According to the above-mentioned index-based method for storing massive small files, upon receiving a command to delete small files, the cache server queries the small file index and finds the small file cache object. If the small file is not written into the backend large object, the small file is marked as deleted in the small file index, and the number of cached small files is updated in the cache object index. When the number of small files in the cache object is equal to zero, the cache object is deleted. If the cache object has a corresponding backend large object, the backend large object associated with the cache object is deleted.

[0015] According to the above-mentioned index-based method for storing massive small files, if the data aging degree of the above-mentioned cache object is greater than the setting, a new cache object index is created, a new backend large object is created corresponding to the above-mentioned newly created cache object index, and the small files in the undeleted cache object are written into the newly created backend large object; if the above-mentioned small file is a non-deleted small file, the above-mentioned small file index is updated.

[0016] According to the above-mentioned index-based method for storing massive small files, when a command to delete small files is received, the small file index is queried, and if the above-mentioned small files have been written into the backend large object, the cache object index is obtained, and the number of small files recorded in the above-mentioned cache object index is reduced; if the above-mentioned cache object still caches the data of the above-mentioned small files, the corresponding data is deleted; and the index record of the above-mentioned small file is deleted in the above-mentioned small file index mark.

[0017] According to the above-mentioned index-based method for storing massive small files, the backend large object disk defragmentation process periodically reads the cache object index, reads the backend large object with deleted small files into the memory, and forms a memory object, wherein the memory object includes the undeleted small file data in one or more backend large objects; writes the memory object into a new backend large object; for the backend large object that has been written, establishes a new cache object index and updates the small file index; deletes the original cache object index and the original backend large object, and releases the memory object.

[0018] According to the above-mentioned index-based method for storing a large number of small files, the space size of the above-mentioned memory object is equal to the space size of the above-mentioned backend large object.

[0019] According to the above-mentioned index-based method for storing massive small files, the size of the cache space corresponding to the above-mentioned cache object is 4MB, 8MB, 16MB, 32MB or 64MB; the size of the cache space corresponding to the above-mentioned backend large object is an integer multiple of the cache object.

[0020] A massive small file storage system based on index comprises more than two storage servers; one storage server comprises at least one cache device and at least one storage device, the cache device is used to store cache objects and cache object indexes, and the storage device is used to store backend large objects; when writing small files, the cache objects are written in sequence, and the corresponding relationship between the small files and the cache objects is recorded in the small file index; the size of the small files and the starting position of the cache objects are recorded in the small file index; the number of small files of the cache objects is recorded in the cache object index; the time length of data cache in the corresponding cache object is recorded in the cache object index to obtain the data aging degree of each cache object; the cache objects whose data aging degree reaches a set value or whose written data size exceeds a threshold are locked for writing, and new data is stopped from being written; the data in the locked cache objects are written to the backend large objects, and the corresponding relationship between the small files and the backend large objects is updated in the small file index; the statistical reading heat of the cache objects that have completed writing to the backend large objects is recorded in the cache object index; the above reading heat is equal to the number of times the small files in the cache objects are read within the set time; the cache object clearing process Q clears the data cached by the cache objects whose reading heat is equal to zero, and releases the storage space.

[0021] According to the above-mentioned index-based massive small file storage system, the cache server receives a small file deletion command, queries the small file index, finds the small file cache object, and if the small file is not written to the backend large object; marks the small file as deleted in the small file index, and updates the number of cached small files in the cache object index; when the number of small files in the cache object is equal to zero, deletes the cache object; if the cache object has a corresponding backend large object, deletes the backend large object associated with the cache object.

[0022] According to the above-mentioned index-based massive small file storage system, the cache server receives a small file deletion command, queries the small file index, and finds the small file cache object. If the above-mentioned small file has not been written to the backend large object; the above-mentioned small file is marked as deleted in the above-mentioned small file index, and the number of cached small files is updated in the cache object index; if the data aging degree of the above-mentioned cache object is greater than the setting, a new cache object index is created, a new backend large object is created corresponding to the above-mentioned newly created cache object index, and the small files in the non-deleted cache object are written into the newly created backend large object; if the above-mentioned small file is a non-deleted small file, the above-mentioned small file index is updated.

[0023] According to the above-mentioned index-based massive small file storage system, the cache server receives a small file deletion command, queries the small file index, and if the small file has been written into the backend large object, obtains the cache object index, and reduces the number of small files recorded in the cache object index; if the cache object still caches the data of the small file, deletes the corresponding data; deletes the index record of the small file in the small file index mark; the backend large object disk defragmentation process periodically reads the cache object index, reads the backend large object with deleted small files into the memory, and forms a memory object, the memory object includes the undeleted small file data in one or more backend large objects; writes the memory object into a new backend large object; for the backend large object that has been written, establishes a new cache object index, and updates the small file index; deletes the original cache object index and the original backend large object, and releases the memory object.

[0024] One of the technical effects of the above technical solution is: establishing a cache object index corresponding to the cache object, using the cache object index to record the aging degree of files in the cache object and the remaining number of files after deletion, and based on the information recorded in the cache object index, improving the storage utilization efficiency of the cache object data space.

[0025] One of the technical effects of the above technical solution is: for small files deleted during caching, there is no need to write them into the backend large object, which greatly improves the system performance. For cache objects where some small files are deleted, they are merged into a new backend large object during the process of writing into the backend large object, which improves the storage efficiency of the backend large object.

[0026] One of the technical effects of the above technical solution is that the cache object is deleted before it is written to the backend large object, which can greatly save the time overhead of writing the backend large object and also reduce the wear of the disk.

[0027] One of the technical effects of the above technical solution is: for the command to delete small files, the small file index is queried, the cache object index is obtained, and the deletion of the small file is marked in the cache object index, without actually deleting the file in the backend large object, nor is there any need to read the file of the backend large object into the cache object, which greatly improves the operation efficiency.

[0028] One of the technical effects of the above technical solution is: for the backend large object with deleted small files, the backend large object is regenerated through memory reading and merging, and the index relationship of the remaining small files is modified, thereby improving the disk utilization efficiency of the backend large object.

[0029] One of the technical effects of the above technical solution is that after regenerating the backend large object, the old backend large object is deleted, so that the data will not be lost, thereby improving the security performance of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic block diagram of an index-based storage system;

[0031] Figure 2 Small files are written to cache objects online, and cache object indexes count cache object information;

[0032] Figure 3 This is a diagram of data distribution in the first phase of data writing;

[0033] Figure 4 This is a diagram of data distribution in the second phase of data writing;

[0034] Figure 5 This is a diagram of data distribution in the third phase of data writing;

[0035] Figure 6 This is a diagram of data distribution in the first phase of data deletion;

[0036] Figure 7 This is a diagram of data distribution in the second phase of data deletion;

[0037] Figure 8 It is a diagram of data distribution in the third stage of data deletion;

[0038] Fig. 9 This is the data distribution diagram of the first phase of deleting small files in large objects on the backend;

[0039] Fig.10 It is the data distribution diagram of the second phase of deleting small files in large objects in the backend;

[0040] Fig.11 It is the data distribution diagram of the third stage of deleting small files in large objects in the backend;

[0041] Fig.12 It is the data distribution diagram of the fourth stage of deleting small files in large objects in the backend;

[0042] Fig.13 This is a diagram of data distribution in the fifth phase of backend large object and small file deletion. DETAILED DESCRIPTION

[0043] The content of this application is further described in detail below in conjunction with the accompanying drawings. It should be noted that the following is a description of the preferred embodiments of the present invention and does not constitute any limitation to the present invention. The description of the preferred embodiments of the present invention is only an illustration of the general principles of the present invention. The numbers such as "first", "second" and "A" and "B" involved in the present invention are only for the convenience of explanation and do not represent the order relationship in time or space. The combination of letters and numbers "TA", "TB" and "H" involved in the present invention are only for the convenience of explanation, and the meaning is determined by the vocabulary referred to.

[0044] A method for storing massive small files based on indexes, such as Figure 3 , 3 users or 3 businesses write small files A1 and A2 respectively; small files B1 and B2; small files C1, C2 and C3; when writing small files, cache process A writes to cache object A in sequence, increases the number of cached small files of cache object A in cache object index A, and records the correspondence between small files and cache object A in the small file index; the size of the small file and the starting position of storage are recorded in the small file index; when writing small files, cache process B writes to cache object B in sequence, increases the number of cached small files of cache object B in cache object index B, and records the correspondence between small files and cache object B in the small file index; the size of the small file and the starting position of storage are recorded in the small file index; when writing small files, cache process C writes to cache object C in sequence, increases the number of cached small files of cache object C in cache object index C, and records the correspondence between small files and cache object C in the small file index; the size of the small file and the starting position of storage are recorded in the small file index. Figure 4 The data aging statistics process counts the length of time the data is cached in the cache object, and obtains the data aging of each cache object. The data aging is equal to the length of time the data in the cache object is written. The backend storage process K sorts the data aging of cache objects A, B, and C, and locks the cache objects whose data aging reaches the set value or whose written data size exceeds the threshold, such as Figure 4 In the process, the aging degree of the cache objects of cached small files A1 and A2 and cached small files C1 and C2 reaches the set value, and new data writing stops; the backend storage process K locks the data in the cache objects being written, writes it to the backend large object, and updates the correspondence between the small files and the backend large objects in the small file index.

[0045] like Figure 5 , the read heat of the cache objects that have completed writing the backend large object is counted, and the read heat of the cache objects of small file A1 and small file A2 is equal to zero; the cache object clearing process Q clears the cached data of the cache objects with read heat equal to zero to release storage space.

[0046] According to the above-mentioned index-based method for storing a large number of small files, a command to delete small files is received, such as Figure 6 At this time, the cache object has not been written into the backend large object. For example, when a user edits a file, a temporary file is generated. By querying the small file index, the small file cache object is found; the small file index marks the small file as deleted. Figure 7 , files A1 and A2 in the cache object are deleted. In the cache object index, the number of cached small files is equal to zero; the cache objects equal to zero are deleted; at this time, the cache objects have not been written to the backend large objects, which can greatly save the time overhead of writing to the backend large objects and also reduce disk wear.

[0047] like Figure 8 For cache objects where small files are not completely deleted, for example, file C2 is deleted, in the cache object index, mark C2 as deleted without actually deleting file C2 in the object. If the data aging degree of the cache object is greater than the setting, a new cache object index is created, a new backend large object is created corresponding to the newly created cache object index, and the small files in the cache object that have not been deleted are written to the newly created backend large object; the small files are small files that have not been deleted, and the small file index is updated, such as Figure 8 In the example, small files B1, B2, C1, and C3 are stored in a large backend object.

[0048] like Fig. 9 , receiving a command to delete small files, querying the small file index, the above small files have been written into the backend large object, and the cache object has been deleted. By obtaining the cache object index, the number of small files recorded in the cache object index is reduced without actually deleting the files in the backend large object or reading the files of the backend large object into the cache object; if the cache object still caches the data of the above small files, delete the corresponding data; delete the index record of the above small file in the small file index mark.

[0049] like Fig.10 , the backend large object disk defragmentation process periodically reads the cache object index and deletes the backend large objects of small files, such as Fig.10 , small files D2 and E1 have been deleted, and only small files D1 and E2 need to be read into memory to form memory objects. The above memory objects include undeleted small file data in one or more backend large objects. Fig.11 , write the new memory object composed of small files D1 and small files E2 into the new backend large object; for the backend large object including small files D1 and small files E2 that has been written, create a new cache object index, such as Fig.12 , update the small file index. Fig.13, delete the original cache object index and the original backend large object, and release the above memory objects. In the above process, the original backend large object is not deleted before the new object is written to the backend large object. If an operation error occurs, the data will not be lost and the original data can be restored according to the log.

[0050] The size of the cache space corresponding to the above cache object is 4MB, 8MB, 16MB, 32MB or 64MB; the size of the cache space corresponding to the above backend large object is an integer multiple of the cache object.

[0051] like Figure 1 A massive small file storage system based on indexing includes more than two storage servers, such as storage server 1 and storage server 2 in the figure; a storage server includes at least one cache device and at least one storage device, the cache device is generally an SSD disk, the storage device is generally an HD hard disk, the cache device is used to store cache objects and cache object indexes, and the storage device is used to store backend large objects; when writing small files, write cache objects in sequence, and record the corresponding relationship between small files and cache objects in the small file index; record the size of the small file in the small file index and the starting position in the cache object; record the number of small files of the cache object in the cache object index; in The cache object index records the length of time the data in the corresponding cache object is cached, and the data aging of each cache object is obtained; the cache object whose data aging reaches the set value or the written data size exceeds the threshold is locked for writing, and new data writing is stopped; the data in the locked cache object is written to the backend large object, and the correspondence between the small file and the backend large object is updated in the small file index; the cache object index records the statistical read heat of the cache object that has completed writing to the backend large object; the above read heat is equal to the number of reads of the small file in the cache object within the set time; the cache object clearing process Q clears the data cached by the cache object whose read heat is equal to zero, and releases storage space.

[0052] Data aging is equal to the time when the last data in the cache object was written or the time when the first data was written.

[0053] like Figure 2 ,In the SSD disk, two types of objects are stored. One is a cache object of fixed length, for example, a cache object with a space size of 4M. Small files 1, 2, 3, and K are placed in the cache object. The subsequent abandoned space is insufficient to store the files and are abandoned.

[0054] Corresponding to the cache object, a cache object index is saved. The cache object index is also of fixed length and is used to save the operation data of the cache object, such as the number of files. When small file 3 in the cache object is deleted, there is no need to actually delete the data of small file 3. It only needs to record the deletion of small file 3 in the cache object index and the number of files after deletion as 3. When the number of files recorded is equal to zero, it means that all files in the cache object have been deleted, and the cache object is empty and can be deleted to release space.

[0055] According to the above-mentioned index-based massive small file storage system, the cache server receives a small file deletion command, queries the small file index, finds the small file cache object, and if the small file is not written to the backend large object; marks the small file as deleted in the small file index, and updates the number of cached small files in the cache object index; when the number of small files in the cache object is equal to zero, deletes the cache object; if the cache object has a corresponding backend large object, deletes the backend large object associated with the cache object.

[0056] According to the above-mentioned index-based massive small file storage system, the cache server receives a small file deletion command, queries the small file index, and finds the small file cache object. If the above-mentioned small file has not been written to the backend large object; the above-mentioned small file is marked as deleted in the above-mentioned small file index, and the number of cached small files is updated in the cache object index; if the data aging degree of the above-mentioned cache object is greater than the setting, a new cache object index is created, a new backend large object is created corresponding to the above-mentioned newly created cache object index, and the small files in the non-deleted cache object are written into the newly created backend large object; if the above-mentioned small file is a non-deleted small file, the above-mentioned small file index is updated.

[0057] According to the above-mentioned index-based massive small file storage system, the cache server receives a small file deletion command, queries the small file index, and if the small file has been written into the backend large object, obtains the cache object index, and reduces the number of small files recorded in the cache object index; if the cache object still caches the data of the small file, deletes the corresponding data; deletes the index record of the small file in the small file index mark; the backend large object disk defragmentation process periodically reads the cache object index, reads the backend large object with deleted small files into the memory, and forms a memory object, the memory object includes the undeleted small file data in one or more backend large objects; writes the memory object into a new backend large object; for the backend large object that has been written, establishes a new cache object index, and updates the small file index; deletes the original cache object index and the original backend large object, and releases the memory object.

[0058] Although the present invention is illustrated and described according to the preferred embodiment and several alternatives, the invention is not limited by the specific description in this specification. Other additional replacement or equivalent components can also be used to practice the present invention.

Claims

1. A method for storing a large number of small files based on an index, characterized in that: When writing small files, cache process A writes cache object A in order, increases the number of cached small files of cache object A in cache object index A, and records the corresponding relationship between small files and cache object A in the small file index; the small file index records the size of the small file and the starting position of storage; When writing small files, cache process B writes cache object B in order, increases the number of cached small files of cache object B in cache object index B, and records the corresponding relationship between small files and cache object B in the small file index; the small file index records the size of the small file and the starting position of storage; When writing small files, cache process C writes cache object C in order, increases the number of cached small files of cache object C in cache object index C, and records the corresponding relationship between small files and cache object C in the small file index; the small file index records the size of the small file and the starting position of storage; The data aging statistics process counts the length of time the data is cached in the cache object, and obtains the data aging of each cache object. The data aging is equal to the length of time the data in the cache object is written. The backend storage process K sorts the data aging of cache objects A, B, and C, locks the cache objects whose data aging reaches the set value or whose written data size exceeds the threshold, and stops writing new data; The backend storage process K locks the data in the cache object to be written, writes it to the backend large object, and updates the correspondence between the small file and the backend large object in the small file index; Upon receiving a small file deletion command, the cache server queries the small file index to find the small file cache object. If the small file is not written into the backend large object, the small file is marked as deleted in the small file index, and the number of cached small files is updated in the cache object index. When the number of small files in the cache object is equal to zero, deleting the cache object; If the cache object has a corresponding backend large object, delete the backend large object associated with the cache object; If the data aging degree of the cache object is greater than the setting, a new cache object index is created, a new backend large object is created corresponding to the newly created cache object index, and the small files in the undeleted cache object are written into the newly created backend large object; if the small file is a undeleted small file, the small file index is updated.

2. The index-based mass small file storage method according to claim 1, characterized in that: Count the read heat of the cache object that has completed writing the backend large object; the read heat is equal to the number of times the small files in the cache object are read within a set time; The cache object clearing process Q clears the cached data of the cache objects whose read heat is equal to zero, and releases the storage space; The data aging degree is equal to the time length when the last data in the cache object is written or the time length when the first data is written.

3. The index-based mass small file storage method according to claim 1, characterized in that: Upon receiving a command to delete small files, query the small file index. If the small file has been written into the backend large object, obtain the cache object index and reduce the number of small files recorded in the cache object index. If the cache object still caches the data of the small file, delete the corresponding data. The index record of the small file is deleted from the small file index mark.

4. The index-based mass small file storage method according to claim 3 is characterized in that: The backend large object disk defragmentation process periodically reads the cache object index, reads the backend large object with deleted small files into the memory, and forms a memory object, wherein the memory object includes the undeleted small file data in one or more backend large objects; Writing the memory object into a new backend large object; For the backend large objects that have been written, a new cache object index is created and the small file index is updated; The original cache object index and the original backend large object are deleted to release the memory object.

5. The index-based mass small file storage method according to claim 4 is characterized in that: The space size of the memory object is equal to the space size of the backend large object.

6. The index-based method for storing a large number of small files according to claim 1, characterized in that: The size of the cache space corresponding to the cache object is 4MB, 8MB, 16MB, 32MB or 64MB; The size of the cache space corresponding to the backend large object is an integer multiple of the cache object.

7. An index-based storage system for massive small files, characterized in that: Used to perform the method described in any one of claims 1 to 6; comprising more than two storage servers; A storage server includes at least one cache device and at least one storage device, the cache device is used to store cache objects and cache object indexes, and the storage device is used to store backend large objects; When writing small files, write them to the cache object in order, record the correspondence between small files and cache objects in the small file index; record the size of the small file and the starting position of the cache object in the small file index; and record the number of small files in the cache object in the cache object index; The length of time for data caching in the corresponding cache object is recorded in the cache object index to obtain the data aging of each cache object; the cache object whose data aging reaches the set value or the written data size exceeds the threshold is locked for writing, and new data is stopped from being written; Write the data in the locked cache object to the backend large object, and update the correspondence between the small file and the backend large object in the small file index; Record the cache object statistics reading heat of the cache object that has completed writing the backend large object in the cache object index; the reading heat is equal to the number of times the small files in the cache object are read within a set time; The cache object clearing process Q clears the data cached by the cache objects whose read heat is equal to zero, and releases the storage space.

8. The index-based massive small file storage system according to claim 7, characterized in that: Includes any one or more of the following features: Feature TA: When the cache server receives a small file deletion command, it queries the small file index and finds the small file cache object. If the small file is not written into the backend large object, it marks the small file as deleted in the small file index and updates the number of cached small files in the cache object index. When the number of small files in the cache object is equal to zero, it deletes the cache object. If the cache object has a corresponding backend large object, it deletes the backend large object associated with the cache object. Feature TB: The cache server receives a small file deletion command, queries the small file index, finds the small file cache object, and if the small file is not written into the backend large object; marks the small file as deleted in the small file index, and updates the number of cached small files in the cache object index; if the data aging degree of the cache object is greater than the setting, creates a new cache object index, creates a new backend large object corresponding to the newly created cache object index, and writes the small files in the undeleted cache object into the newly created backend large object; if the small file is an undeleted small file, the small file index is updated; feature TC: The cache server receives a small file deletion command, queries the small file index, obtains the cache object index if the small file has been written into the backend large object, and reduces the number of small files recorded in the cache object index; if the cache object still caches the data of the small file, deletes the corresponding data; and deletes the index record of the small file in the small file index mark; The backend large object disk defragmentation process periodically reads the cache object index, reads the backend large object with deleted small files into the memory, and forms a memory object, wherein the memory object includes the undeleted small file data in one or more backend large objects; writes the memory object into a new backend large object; for the backend large object that has been written, establishes a new cache object index and updates the small file index; deletes the original cache object index and the original backend large object, and releases the memory object.

Citation Information

Patent Citations

  • Mass small file storage system and method based on index online splicing

    CN117519612A

  • Access optimization method, apparatus and device for large quantity of small files, and storage medium

    WO2022228458A1