Backup storage device, metadata management method, apparatus, and storage medium

By completely decoupling metadata from file content data in the backup storage device and storing metadata messages and update messages in a sequential writing manner, the problem of write performance degradation caused by frequent metadata updates is solved, thereby improving the lifespan and performance of the device.

CN117331486BActive Publication Date: 2026-03-24ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing backup storage devices suffer from degraded write performance and reduced device lifespan due to frequent random write operations during metadata updates.

Method used

Metadata is completely decoupled from file content data. A design that separates metadata area and content data area is adopted. Metadata messages and update messages are stored through superblock and sub-log area to achieve sequential writing.

Benefits of technology

It improves the write performance of backup storage devices, extends device lifespan, and reduces write amplification factor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117331486B_ABST
    Figure CN117331486B_ABST
Patent Text Reader

Abstract

The application discloses a backup storage device, a metadata management method and device, and a storage medium. The device comprises a content data area and a metadata area. The content data area stores file content data and first summary information. A sub-area in the metadata area comprises a super block and a sub-log area. The sub-log area stores a first log and a second log. The first log carries metadata messages corresponding to the file content data. The metadata messages carry metadata. The second log carries update messages for the metadata. The application provides a sub-log area for storing the first log carrying metadata messages and the second log carrying update messages for the metadata. Based on this, data related to the metadata can be sequentially written in the form of logs in the sub-log area. Compared with a scheme requiring multiple addressing random writes of different types of metadata areas in the backup storage device, the writing performance of the backup storage device can be improved, thereby prolonging the service life of the backup storage device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to, but is not limited to, the technical field of storage, and in particular to a backup storage device, a metadata management method and device, and a storage medium. BACKGROUND

[0002] The backup storage device refers to a storage device with the characteristic of persistent storage, which can continuously save data after power failure. At present, there are many types of file systems applied to the backup storage device, resulting in various storage space management layout modes of the backup storage device. In the backup storage device in the related art, the storage space layout for storing to-be-operated data (for example, metadata) is scattered and fixed. For example, in the fourth extended file system (EXT4), different metadata regions are divided according to different types of metadata in the backup storage device. When the metadata needs to be updated, the type information of the metadata needs to be determined first, and the target metadata region is determined through the type information addressing. The changed metadata is randomly written into the target metadata region. For frequently updated metadata types, frequent random write operations will be performed on the backup storage device, thereby reducing the write performance of the file system on the backup storage device and affecting the service life of the backup storage device. SUMMARY

[0003] Embodiments of the present application provide a backup storage device, a metadata management method and device, and a storage medium, which can effectively improve the write performance of metadata operation on the backup storage device and improve the service life of the backup storage device.

[0004] In a first aspect, embodiments of the present application provide a backup storage device, comprising:

[0005] a content data region, the content data region comprising a plurality of data segments, each data segment being configured to store file content data and first summary information corresponding to the data segment;

[0006] a metadata region, the metadata region comprising a plurality of sub-regions, each sub-region comprising a superblock and a sub-log region, wherein the superblock is configured to store second summary information corresponding to the backup storage device, the sub-log region is configured to store a first log and a second log, the first log carries a metadata message corresponding to the file content data, the metadata message carries metadata, and the second log carries an update message for the metadata.

[0007] In a second aspect, embodiments of the present application provide a metadata management method, comprising:

[0008] When the operation instruction is acquired, metadata update information is generated according to the operation instruction, and update processing is performed on the to-be-processed metadata according to the metadata update information, to obtain to-be-stored metadata, wherein the to-be-processed metadata is metadata stored in the memory;

[0009] An update message is generated, and the update message carries the metadata update information;

[0010] When a first preset condition is met, a first log is generated, and the first log is saved to a sub-log area, wherein the sub-log area belongs to the backup storage device of the first aspect embodiment, the first log carries the metadata message, and the metadata message is generated by the to-be-stored metadata;

[0011] When a second preset condition is met, a second log is generated, and the second log is saved to the sub-log area, wherein the second log carries the update message.

[0012] In a third aspect, an embodiment of the present application provides a metadata management apparatus, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the metadata management method of the second aspect when executing the computer program.

[0013] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium storing computer executable instructions, and the computer executable instructions are used to execute the metadata management method of the second aspect.

[0014] The embodiment of the present application provides a backup storage device, a metadata management method and device, and a storage medium, wherein the backup storage device comprises: a content data area, the content data area comprising a plurality of data segments, each data segment being used for storing file content data and first summary information corresponding to the data segment; a metadata area, the metadata area comprising a plurality of sub-areas, each sub-area comprising a super block and a sub-log area, wherein the super block is used for storing second summary information corresponding to the backup storage device, the sub-log area is used for storing a first log and a second log, the first log carries metadata messages corresponding to the file content data, the metadata messages carry metadata, and the second log carries update messages for the metadata. The backup storage device provided by the embodiment of the present application comprises a metadata area and a content data area, that is, the metadata is completely decoupled from the storage of the file content data, and the sub-log area for storing the first log carrying the metadata messages and the second log carrying the update messages for the metadata is provided, based on which, the data related to the metadata in the embodiment of the present application can be sequentially written in the form of message logs, compared with the backup storage device in the related art which divides different metadata areas according to different types of metadata, and the technical solution of the metadata area of the random write target which needs multiple addressing, the present application can effectively improve the write performance of the metadata operation on the backup storage device, thereby effectively prolonging the service life of the backup storage device. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 FIG. 1 is a schematic diagram of a backup storage device provided by an embodiment of the present application;

[0016] Figure 2 FIG. 2 is a step flowchart of a metadata management method provided by an embodiment of the present application;

[0017] Figure 3 FIG. 3 is a step flowchart of saving the first log to the sub-log area provided by another embodiment of the present application;

[0018] Figure 4 FIG. 4 is a step flowchart of saving the first log to the sub-log area provided by another embodiment of the present application;

[0019] Figure 5 FIG. 5 is a step flowchart of saving the second log to the sub-log area provided by another embodiment of the present application;

[0020] Figure 6 FIG. 6 is a step flowchart of obtaining a new target metadata provided by another embodiment of the present application;

[0021] Figure 7 FIG. 7 is a step flowchart of obtaining a new target metadata provided by another embodiment of the present application;

[0022] Figure 8 This is a flowchart of the steps of a metadata management method provided in another embodiment of this application;

[0023] Figure 9 This is a structural diagram of a metadata management device provided in another embodiment of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0025] It is understandable that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, or the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0026] This application provides a backup storage device, a metadata management method, an apparatus, and a storage medium. The backup storage device includes: a content data area, which includes multiple data segments, each data segment storing file content data and first summary information corresponding to the data segment; and a metadata area, which includes multiple sub-areas, each sub-area including a superblock and a sub-log area. The superblock stores second summary information corresponding to the backup storage device, and the sub-log area stores a first log and a second log. The first log carries a metadata message corresponding to the file content data, the metadata message carrying metadata, and the second log carries an update message for the metadata. The backup storage device provided in this application includes a metadata area and a content data area, which completely decouples the storage of metadata from the storage of file content data. It also provides a sub-log area for storing a first log carrying metadata messages and a second log carrying update messages for metadata. Based on this, metadata-related data in this application embodiment can be written sequentially in the form of message logs. Compared with the backup storage device in related technologies that divides different metadata areas according to different types of metadata, and the technical solution of metadata requiring multiple addressing and random writing to the target metadata area, this application can effectively improve the write performance of metadata operations on the backup storage device, thereby effectively improving the service life of the backup storage device.

[0027] The embodiments of this application will be further described below with reference to the accompanying drawings.

[0028] likeFigure 1 As shown, Figure 1 This is a schematic diagram of a backup storage device provided in one embodiment of this application. The backup storage device in this embodiment includes:

[0029] The content data area includes multiple data segments, each of which stores the file content data and the first summary information corresponding to the data segment.

[0030] The metadata area comprises multiple sub-areas, each including a superblock and a sub-log area. The superblock stores second summary information corresponding to the backup storage device, while the sub-log area stores a first log and a second log. The first log carries metadata messages corresponding to the file content data, and the metadata messages carry metadata. The second log carries update messages for the metadata.

[0031] The first summary information includes at least:

[0032] The index number of the target file corresponding to the file content data;

[0033] The offset of the file content data within the target file;

[0034] The checksum of the data segment.

[0035] To more clearly describe the backup storage device provided in the embodiments of this application, the specific structure and formatting operations of the metadata area and content data area in the backup storage device are described in detail below:

[0036] It is understood that, in this embodiment of the application, the logical space of the backup storage device is first logically numbered by blocks, where a block is a sequence of bytes of a specific length used to store data transferred between the kernel and the backup storage device; then the backup storage device is divided into two areas in logical order, namely the metadata area and the content data area.

[0037] The metadata area is internally divided into N sub-regions of equal size (the value of N is set according to the requirements of the file system, and this embodiment does not impose any restrictions here). Following a logical order from front to back, the sub-regions are named Meta0, Meta1...MetaN-1. A sub-region (meta0 in this case) is selected, and its first K (or last K) logical blocks are used to store the superblock. The superblock stores the second summary information corresponding to the backup storage device. The second summary information may include the used space of the backup storage device, the available space of data blocks, inode information, and other file system global information. The superblock within the sub-region... It can be the default superblock of the backup storage device, or a backup superblock of the default superblock, used to avoid the risk that an error in the superblock will cause the entire file system to malfunction. In each sub-region, the remaining space other than the superblock or backup superblock is the sub-log area. The sub-log areas of all sub-regions constitute the log area of ​​the backup storage device. The sub-log area is used to store the first log and the second log. The first log carries metadata messages corresponding to the file content data, and the metadata messages carry metadata. The second log carries update messages for the metadata. The sub-log areas of each sub-region are named log0...logN-1.

[0038] It is understandable that the update messages carried in the second log stored in the sub-log area are generated successively based on the metadata of the metadata messages carried in the first log that is sorted before the second log. These update messages can be update messages for the metadata corresponding to the first log, or they can be update messages for the new metadata after the metadata corresponding to the first log in memory has been updated.

[0039] The content data area is the logical space outside the metadata area in the backup storage device. The content data area is composed of data segments of equal size and identical structure. The embodiments of this application do not limit the specific number of data segments in the content data area. Each data segment contains a large number of blocks. Most of the blocks in a data segment are used to store file content data, and the remaining blocks are used to record the first summary information of the data segment. The first summary information mainly includes the index number (ino) of the target file to which the file content data in each block belongs, the offset (ofs) of the file content data in the target file, and the CRC checksum of the entire data segment.

[0040] It is understood that, based on the backup storage device provided in this application embodiment, the metadata to be stored in memory that meets the conditions (corresponding to the first log) and the file system operation records, i.e., the update messages corresponding to the metadata (corresponding to the second log), can be sequentially stored in the same structure, i.e., saved in the sub-log area of ​​the sub-region of the backup storage device. This application embodiment does not limit the specific type of metadata in the first log stored in the sub-log area, i.e., the first log corresponding to all types of metadata can be stored in the sub-log area. The backup storage device provided in this application embodiment records the file system log while updating the metadata. The structure is simple and efficient, and it is convenient to maintain data consistency in abnormal situations. Compared with the related technology, which requires multiple addressing and random writing to different types of metadata areas in the backup storage device, this application can effectively improve the write performance of metadata operations on the backup storage device, thereby effectively improving the service life of the backup storage device.

[0041] The embodiments of this application do not limit the specific structure of the backup storage device. The backup storage device can be a disk, a solid state disk (SSD), or an embedded multi-media card (eMMC).

[0042] in addition, Figure 1 The formatting method for the backup storage device shown may include the following steps: clearing the entire metadata area; writing the superblock initialization data into the header of the sub-region meta0 according to the corresponding data structure.

[0043] like Figure 2 As shown, Figure 2 This is a flowchart illustrating the steps of a metadata management method provided in one embodiment of this application. The method includes, but is not limited to, the following steps:

[0044] Step S210: When an operation instruction is obtained, metadata update information is generated according to the operation instruction, and the metadata to be processed is updated according to the metadata update information to obtain the metadata to be stored, wherein the metadata to be processed is the metadata stored in memory.

[0045] Step S220: Generate an update message, which corresponds to the metadata update information;

[0046] It is understandable that metadata is the descriptive information of the resources managed by the current file system, which plays an important role in the self-maintenance and management of the file system. During the operation of the file system, the metadata of the entire disk is continuously resident in memory until the file system is unloaded. Metadata to be processed is the metadata stored in memory before the file system executes new operation instructions, which can be the metadata recently restored to memory from the backup storage device.

[0047] The operation instructions in this application embodiment can be operation instructions such as file creation, file deletion, and file modification involved during the operation of the file system. When a new operation instruction is obtained, metadata update information is generated according to the operation instruction. The metadata to be processed stored in memory will be updated according to the metadata update information to obtain the metadata to be stored. An update message corresponding to the metadata update information is generated and stored in memory after the update message is generated.

[0048] The embodiments of this application do not limit the specific content of the metadata update information, and may include local information in the metadata to be processed that needs to be changed.

[0049] Step S230: When the first preset condition is met, a first log is generated and saved to a sub-log area, wherein the sub-log area belongs to Figure 1 In the backup storage device of the illustrated embodiment, the first log carries metadata messages, which are generated from the metadata to be stored.

[0050] Step S240: When the second preset condition is met, a second log is generated and saved to the sub-log area. The second log carries an update message.

[0051] Understandably, based on Figure 1 The backup storage device provided in the illustrated embodiment, under frequent file system operations (i.e., the metadata to be processed in memory is frequently updated within a time period according to the metadata update information carried in new operation instructions), obtains the metadata to be stored, and generates update messages corresponding to the metadata update information, which are stored in memory; when a first preset condition is met, the metadata to be stored needs to be saved to the backup storage device in the form of a message log, i.e., a first log carrying the metadata message to be stored is generated and saved to the sub-log area of ​​the backup storage device; when a second preset condition is met, the update messages currently stored in memory are saved to the backup storage device in the form of message logs, i.e., a second log carrying the update messages is generated and saved to the sub-log area of ​​the backup storage device; based on Figure 1 The backup storage device and message log characteristics of the embodiment shown allow the first log to be sequentially written to the sub-log area under the constraint of a first preset condition, and the second log to be sequentially written to the sub-log area under the constraint of a second preset condition. Compared with the related technology, which requires multiple addressing and random writing to different types of metadata areas in the backup storage device, this embodiment can effectively improve the write performance of the backup storage device, thereby increasing the lifespan of the backup storage device. When the backup storage device is an SSD, it can also reduce the write amplification factor.

[0052] In addition, the embodiments of this application set a preset condition for the first log and the second log respectively, namely the first preset condition and the second preset condition, so that the storage time of the first log in the sub-log area is limited by the first preset condition, and the storage time of the second log in the sub-log area is limited by the second preset condition. For frequently updated metadata, such as metadata related to file content data, the number of writes to the backup storage device within a time period can be effectively reduced.

[0053] In addition, the embodiments of this application do not limit the specific method of generating the first log from the metadata to be stored in memory. It can be that the metadata to be stored is first compressed to generate a metadata message, and then the first log is generated based on the metadata message. This can reduce the amount of data stored in the first log in the backup storage device and compress the storage space occupied by the backup storage device.

[0054] The embodiments of this application do not limit the specific form of the update messages carried in the second log. The content of the second log in the embodiments of this application can be a single update message, a combination of multiple update messages, or a combination of one or more update messages after data compression. No further restrictions are imposed here.

[0055] Additionally, refer to Figure 3 , Figure 2 Step S240 in the illustrated embodiment also includes, but is not limited to, the following steps:

[0056] Step S310: When the first log has not been stored in the sub-log area, obtain the first quantity; when the first quantity is greater than or equal to the preset first quantity threshold, generate the first log carrying metadata messages and save the first log to the sub-log area. The first quantity is the sum of the number of update messages carried in all the second logs stored in the sub-log area and the number of update messages currently stored in memory.

[0057] or,

[0058] Step S320: When the first log has been stored in the sub-log area, obtain the second quantity. When the second quantity is greater than or equal to the first quantity threshold, generate the first log carrying the metadata to be stored, and save the first log to the sub-log area. The second quantity is the number of update messages generated in memory after the first log was saved to the sub-log area.

[0059] Understandably, when the first log has not been stored in the sub-log area, the number of update messages generated in memory up to the current moment is determined, i.e., the first number. When the first number is greater than or equal to the preset first number threshold, a metadata message is generated based on the metadata to be stored in memory, and the first log carrying the metadata message is saved to the sub-log area. When the first log has been stored in the sub-log area, after the first log carrying the metadata message in memory was saved to the sub-log area in the previous step, the number of update messages generated in memory up to the current moment is determined, i.e., the second number. When the second number is greater than or equal to the preset first number threshold, a metadata message is generated based on the metadata to be stored in memory, and the first log carrying the metadata message is saved to the sub-log area.

[0060] Additionally, refer to Figure 4 , Figure 2 Step S240 in the illustrated embodiment also includes, but is not limited to, the following steps:

[0061] Step S410: Determine the target sub-region from multiple sub-regions, the target sub-region including the target sub-log area;

[0062] Step S420: When the remaining storage capacity of the target sub-log area is less than the size of the log to be stored, a new target sub-region is determined from multiple sub-regions.

[0063] Step S430: Regenerate a new first log and save the new first log to a new target sub-log area. The new sub-log area belongs to the new target sub-region.

[0064] Understandably, the metadata in memory and the corresponding update messages will be saved to the determined target sub-log area in turn, provided that their respective preset conditions are met. When it is detected that the remaining storage capacity of the target sub-log area is less than the size of the log to be stored, that is, the target sub-log area that is currently storing log data is full, it is necessary to determine a new target sub-region from the remaining sub-regions in the metadata area, generate a new metadata message based on the current metadata to be stored in memory, and save the new first log carrying the new metadata message to the new target sub-log area corresponding to the new target sub-region.

[0065] Additionally, referring to a reference numeral, in one embodiment... Figure 2 Step S250 in the illustrated embodiment also includes, but is not limited to, the following steps:

[0066] Step S510: Obtain the third quantity. When the third quantity is greater than or equal to the preset second quantity threshold, generate a second log carrying the update message and save the second log to the sub-log area. The third quantity is the number of update messages currently saved in memory.

[0067] or,

[0068] Step S520: When the first reference duration exceeds the preset period, a second log carrying the update message is generated and the second log is saved to the sub-log area, wherein the first reference duration is the storage duration of the update message in memory.

[0069] It is understood that in this embodiment, the timing of saving the second log corresponding to the update message to the sub-log area may be limited by the following conditions: determining the number of each accumulated update message in memory, i.e., the third number; when the third number is greater than or equal to the preset second number threshold, it indicates that the number of update messages accumulated this time has reached the upper limit; generating the second log based on the update messages currently stored in memory; and saving the second log to the sub-log area; or, timing the process of memory starting to accumulate update messages again to obtain the first reference duration; if the first reference duration exceeds the preset period, it indicates that the current accumulation has reached the time limit; ending the current accumulation; generating the second log based on all update messages accumulated this time; saving the second log to the sub-log area; and then restarting the accumulation of the next update message.

[0070] Additionally, refer to Figure 6 In execution Figure 2 Following step S250 in the illustrated embodiment, the metadata management method provided in this application embodiment further includes, but is not limited to, the following steps:

[0071] Step S610: When a data recovery request is received, the target first log and the target second log are obtained from the sub-log area according to the data recovery request. The target first log is the first log with the shortest storage time in the sub-log area, and the target second log is all the second logs in the sub-log area that are sorted after the target first log.

[0072] Step S620: Obtain target metadata based on the target's first log;

[0073] Step S630: Obtain the target update message based on the target's second log;

[0074] Step S640: Update the target metadata according to the target update message to obtain new target metadata.

[0075] It is understood that, referring to the description of the above embodiments, data synchronization between memory and backup storage device is achieved by saving the first log carrying metadata messages and the second log carrying update messages in memory to the sub-log area of ​​the backup storage device. When a data recovery request is obtained, such as when the file system is unmounted and then remounted, it is necessary to obtain the target first log and the target second log from the sub-log area of ​​the backup storage device. The target first log is the first log with the shortest storage time in the sub-log area, and the target second log is all the second logs in the sub-log area that are sorted after the target first log. The target metadata is obtained from the target first log by parsing the target first log to obtain the target metadata message, further parsing the target metadata message to obtain the target metadata, obtaining the target update message from the target second log, obtaining the content update information for the target metadata by parsing the target update message, and updating the target metadata to obtain the new target metadata. This achieves the desynchronization of the latest metadata stored in the backup storage device to memory, thereby ensuring that the latest metadata is continuously stored in memory after the file system is mounted.

[0076] Additionally, when a data recovery request is received, the sub-log area in the backup storage device may be empty. In this case, the target metadata in memory is empty, and the operations such as generating update messages described in the above embodiments are performed directly based on the empty target metadata. Alternatively, after formatting the backup storage device, if the backup storage device has been used for a short time, the first log is not stored in the sub-log area, only the second log is stored. In this case, the second log in the sub-log area is restored to memory, the second log is parsed to obtain update messages, and the metadata is reconstructed based on the metadata update information carried in each update message to generate target metadata. Then, the operations such as generating update messages described in the above embodiments are performed based on the reconstructed target metadata.

[0077] Additionally, refer to Figure 7 In one embodiment, there are multiple target update messages, each including a message sequence number, a message type, and metadata update information. The message sequence number changes according to the order in which the target update messages are generated. Figure 6 Step S640 in the illustrated embodiment also includes, but is not limited to, the following steps:

[0078] Step S710: According to the order of message sequence numbers, update the target metadata based on the message type and metadata update information in each target update message to obtain new target metadata.

[0079] In this embodiment, the target update message includes a message sequence number, a message type, and metadata update information. The message sequence number changes according to the order in which the target update messages are generated. When there are multiple target update messages, the target metadata is updated in memory according to the message type and metadata update information of each target update message in the order of the message sequence number, so as to obtain new target metadata, thereby realizing the desynchronization of the metadata of the backup storage device with memory.

[0080] In addition, to provide a more detailed explanation of the metadata management method provided in this application, the technical solution of the present invention is described below with a specific example.

[0081] The metadata management method in Example 1 of this application is based on Figure 1 The backup storage device shown has a logical storage space structure; Example 1, see reference. Figure 9 , Figure 9 This is a flowchart of a metadata management method provided in another embodiment of this application. The metadata management method includes, but is not limited to, the following steps:

[0082] Step S810: Restore the metadata to be processed from the backup storage device to memory;

[0083] Step S820: When an operation instruction is received, i.e., the file system performs a basic operation, the metadata to be processed is updated according to the metadata update information generated by the operation instruction to obtain the metadata to be stored. The metadata to be processed is the metadata stored in memory.

[0084] Step S830: Generate an update message corresponding to the metadata update information, store the generated update message, time the storage operation, record the number of update messages during the storage process, and record the number of update messages generated in memory in real time.

[0085] Step S840: When the number of update messages in a single flow reaches the upper limit, or the duration of a single flow reaches the upper limit, all update messages in memory during this flow are compressed to obtain the second log and saved to the sub-log area of ​​the backup storage device.

[0086] Step S850: After the first log carrying metadata messages was previously saved to the sub-log area of ​​the backup storage device, if it is detected that the number of update messages generated in memory up to the current time exceeds the number threshold, or if it is detected that the number of update messages generated in memory up to the current time exceeds the number threshold before the first log is saved to the backup storage device for the first time, or if it is detected that the sub-log area of ​​the backup storage device that is currently storing data is full and it is necessary to switch to a new sub-log area, a new metadata message is generated again based on the latest metadata to be stored resident in memory, and a new first log carrying the new metadata message is saved to the new sub-log area.

[0087] Step S860: When a data recovery request is received, the target first log and the target second log are obtained from the sub-log area of ​​the backup storage device. The target first log is parsed to obtain the target metadata, and the target second log is parsed to obtain the target update message, wherein the target update message corresponds to the target metadata.

[0088] Step S870: Obtain new target metadata synchronized with the backup storage device based on the target metadata and the target update message.

[0089] Additionally, refer to Figure 9 An embodiment of this application also provides a metadata management device 900, which includes a memory 910, a processor 920, and a computer program stored in the memory 910 and executable on the processor 920.

[0090] The processor 920 and memory 910 can be connected via a bus or other means.

[0091] The non-transitory software program and instructions required to implement the metadata management method of the above embodiments are stored in the memory 910. When executed by the processor 920, the metadata management method in the above embodiments is executed, for example, the method described above is executed. Figure 2 Method steps S210 to S250 Figure 3 Method steps S310 to S320, Figure 4 Method steps S410 to S430, Figure 5 Method steps S510 to S520 Figure 6 Method steps S610 to S640 Figure 7 Method step S710.

[0092] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0093] Furthermore, one embodiment of this application also provides a computer-readable storage medium storing computer-executable instructions that are executed by a processor 920 or a controller, for example, by a processor 920 in the above-described metadata management device 900 embodiment, causing the processor 920 to perform the metadata management method in the above-described embodiment, for example, to perform the above-described... Figure 2 Method steps S210 to S250 Figure 3 Method steps S310 to S320, Figure 4 Method steps S410 to S430, Figure 5 Method steps S510 to S520 Figure 6 Method steps S610 to S640 Figure 7 Method step S710. Those skilled in the art will understand that all or some of the steps in the methods disclosed above, and the system, can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A backup storage device, comprising: The content data area includes multiple data segments, each of which stores file content data and first summary information corresponding to the data segment. The metadata area includes multiple sub-areas, each of which includes a superblock and a sub-log area. The superblock is used to store second summary information corresponding to the backup storage device. The sub-log area is used to store a first log and a second log. The first log carries metadata messages corresponding to the file content data, and the metadata messages carry metadata. The second log carries update messages for the metadata.

2. The backup storage device according to claim 1, characterized in that, The first summary information includes at least: The index number of the target file corresponding to the file content data; The offset of the file content data in the target file; The checksum of the data segment.

3. A metadata management method, comprising: When an operation instruction is received, metadata update information is generated according to the operation instruction, and the metadata to be processed is updated according to the metadata update information to obtain metadata to be stored, wherein the metadata to be processed is metadata stored in memory; An update message is generated, the update message carrying the metadata update information; When the first preset condition is met, a first log is generated and the first log is saved to a sub-log area, wherein the sub-log area belongs to the backup storage device as described in any one of claims 1 to 2, and the first log carries the metadata message, the metadata message being generated by the metadata to be stored; When the second preset condition is met, a second log is generated and saved to the sub-log area, wherein the second log carries the update message.

4. The method according to claim 3, characterized in that, When the first preset condition is met, the first log is generated and saved to the sub-log area, including: When the first log has not been stored in the sub-log area, a first quantity is obtained. When the first quantity is greater than or equal to a preset first quantity threshold, a first log carrying the metadata message is generated, and the first log is saved to the sub-log area. The first quantity is the sum of the number of update messages carried in all the second logs stored in the sub-log area and the number of update messages currently stored in the memory. or, When the first log has been stored in the sub-log area, a second quantity is obtained. When the second quantity is greater than or equal to the first quantity threshold, the first log carrying the metadata message is generated, and the first log is saved to the sub-log area. The second quantity is the number of update messages generated in memory after the first log was saved to the sub-log area.

5. The method according to claim 3, characterized in that, Saving the first log to the sub-log area includes: A target sub-region is determined from multiple sub-regions, the target sub-log region including a target sub-log region; When the remaining storage capacity of the target sub-log area is less than the size of the log to be stored, a new target sub-region is determined from the multiple sub-regions, wherein the log to be stored is the first log or the second log; A new first log is regenerated and saved to a new target sub-log area, which belongs to the new target sub-region.

6. The method according to claim 3, characterized in that, The step of generating a second log and saving the second log to the sub-log area in the backup storage device when the second preset condition is met includes: Obtain a third quantity; when the third quantity is greater than or equal to a preset second quantity threshold, generate a second log carrying the update message, and save the second log to the sub-log area, wherein the third quantity is the number of update messages currently saved in the memory; or, When the first reference duration exceeds a preset period, a second log carrying the update message is generated, and the second log is saved to the sub-log area, wherein the first reference duration is the storage duration of the update message in memory.

7. The method according to claim 3, characterized in that, The method further includes: When a data recovery request is received, the target first log and the target second log are obtained from the sub-log area according to the data recovery request. The target first log is the first log with the shortest storage time in the sub-log area, and the target second log is all the second logs in the sub-log area that are sorted after the target first log. Obtain the target metadata based on the target's first log; The target update message is obtained based on the target's second log. The target metadata is updated based on the target update message to obtain new target metadata.

8. The method according to claim 7, characterized in that, The number of target update messages is multiple, and each target update message includes a message sequence number, a message type, and the metadata update information. The message sequence number changes according to the order in which the target update messages are generated. The step of updating the target metadata according to the target update messages to obtain new target metadata includes: According to the order of the message sequence numbers, the target metadata is updated based on the message type and metadata update information of each target update message to obtain the new target metadata.

9. A metadata management device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the metadata management method as described in any one of claims 3 to 8.

10. A computer-readable storage medium storing computer-executable instructions for performing the metadata management method as described in any one of claims 3 to 8.

Citation Information

Patent Citations

  • Log data organization of solid-state storage devices

    CN109976664A

  • High-concurrency file storage method and system, medium and electronic terminal

    CN113050893A