Metadata management method and device, equipment, storage medium and program product

By generating and managing target metadata in the storage system, using the frequency of storage space and the mapping tree of storage structure, the problem of inefficient metadata management in the prior art is solved, and efficient metadata management and extended service life of solid-state hard disks are achieved.

CN119960676APending Publication Date: 2025-05-09DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411984415.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-09

Smart Images

  • Figure CN119960676A_ABST
    Figure CN119960676A_ABST
Patent Text Reader

Abstract

The invention relates to a metadata management method and device, equipment, a storage medium and a program product. The method comprises the following steps: in response to a data management request in a storage system, generating target metadata of user data according to the user data carried in the data management request and a plurality of storage spaces pre-divided for a solid state disk in the storage system; writing the target metadata into the storage spaces according to the plurality of storage spaces and the use frequency of the target metadata; and executing corresponding management operation on the target metadata based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system. By adopting the method, the metadata can be managed on the basis of the solid state disk adopting the ZNS, the erasing frequency of the solid state disk to which the storage space belongs is reduced, and the service life of the solid state disk is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of storage systems, and in particular to a metadata management method, apparatus, device, storage medium and program product. Background Art

[0002] In the storage system, the solid state disk (SSD) is a basic storage device for storing data. Its service life and performance are key indicators that affect the overall capabilities of the storage system.

[0003] In the related technology, in order to improve the service life and performance of SSD, considering the physical characteristics of solid state drives, SSD hard drives based on zoned name space (Zoned Name Space, ZNS) technology are introduced, using Zone as a data management unit, so that an SSD hard drive can provide a large number of zones to users.

[0004] However, in the related art, SSD hard disks based on ZNS are often used to manage the recorded data actually generated in the storage system, and lack a technical solution for managing metadata that describes data attribute information. Summary of the invention

[0005] Based on this, it is necessary to provide a metadata management method, device, equipment, storage medium and program product for managing metadata on an SSD hard disk using ZNS in response to the above technical problems.

[0006] In a first aspect, the present application provides a metadata management method, the method comprising:

[0007] In response to a data management request in the storage system, generating target metadata of the user data according to the user data carried in the data management request and a plurality of storage spaces pre-divided on the solid state drive in the storage system;

[0008] Writing the target metadata into the storage space according to the usage frequencies of the multiple storage spaces and the target metadata;

[0009] Based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system, corresponding management operations are performed on the target metadata.

[0010] In the technical solution provided by the embodiment of the present application, in response to a data management request in a storage system, the target metadata of the user data is generated according to the user data carried in the data management request and the multiple storage spaces pre-divided on the solid state hard disk in the storage system; the target metadata is written into the storage space according to the usage frequency of the multiple storage spaces and the target metadata; based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system, the corresponding management operation is performed on the target metadata. In this method, on the basis of pre-dividing the solid state hard disk in the storage system into multiple storage spaces, the user data is processed based on the multiple storage spaces to obtain the target metadata, and then the target metadata is managed again based on the multiple storage spaces, so as to realize two-stage data management, so as to give full play to the performance of the solid state hard disk under the zns architecture. Moreover, when storing the target metadata, the storage space for storing the target metadata is determined based on the usage frequency of the target metadata. Such a determination method can make the usage frequency of the metadata stored in the same storage space relatively close, so as to facilitate the unified management of the stored data in the same storage space, such as erasing, updating and other operations, thereby reducing the number of erasures and writes of the solid state hard disk to which the storage space belongs, and improving the service life of the solid state hard disk. In addition, when managing the target metadata, multi-level management of the target metadata is achieved through the corresponding storage structure mapping tree in the storage system to achieve closed-loop management of the metadata management process, thereby improving the management efficiency of metadata and reducing the complexity of the internal mechanism of the solid-state drive.

[0011] In one embodiment, writing the target metadata into the storage space according to the plurality of storage spaces and the usage frequency of the target metadata includes:

[0012] Get the lifecycle of multiple storage spaces;

[0013] The usage frequency of the target metadata is matched with the life cycle of each storage space, and the target metadata is written into the storage space with successful matching.

[0014] In the technical solution provided in the embodiment of the present application, on the basis of obtaining the life cycles of multiple storage spaces, the usage frequency of the target metadata is matched with the life cycle of each storage space, and a metadata storage space suitable for storing the target metadata is determined, and the target metadata is further written into the successfully matched metadata storage space. This method of determining the storage space is suitable for the scenario where the target metadata is initially written after the storage system is started.

[0015] In one embodiment, writing the target metadata into the storage space according to the plurality of storage spaces and the usage frequency of the target metadata includes:

[0016] Get the usage frequency of historical metadata in multiple storage spaces;

[0017] Comparing the usage frequency of the target metadata with the usage frequency of the historical metadata in the plurality of storage spaces, and determining the storage space having the smallest difference in usage frequency with the target metadata from the plurality of storage spaces;

[0018] The target metadata is written to the storage space with the smallest usage frequency difference.

[0019] In the technical solution provided by the embodiment of the present application, based on obtaining the usage frequencies of historical metadata in multiple storage spaces, the usage frequency difference between the usage frequency of the target metadata and the usage frequency of the historical metadata in each storage space is calculated, and the storage space with the smallest usage frequency difference is used as the metadata storage space for storing the target metadata, so that the usage frequencies of the metadata stored in the same storage space are relatively close, so as to facilitate unified management of the stored data in the same storage space, such as erasing, updating and other operations, thereby reducing the number of erasures and writes of the solid-state hard disk to which the storage space belongs, and improving the service life of the solid-state hard disk. In addition, compared with the above embodiment, the method of determining the storage space in this embodiment is suitable for the scenario where the target metadata is written after the storage system has been running for a period of time.

[0020] In one embodiment, based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system, performing corresponding management operations on the target metadata includes:

[0021] Based on the metadata in the storage space and the management type of the data management request, the node information of each node in the storage structure mapping tree is updated accordingly;

[0022] When the node information of each node in the storage structure mapping tree is updated, a management success response of the target metadata is returned.

[0023] In the technical solution provided by the embodiment of the present application, based on the metadata in the storage space and the management type of the data management request, the node information of each node in the storage structure mapping tree is updated accordingly, and when the node information of each node in the storage structure mapping tree is updated, a management success response of the target metadata is returned to maintain the consistency of the node information of the storage structure mapping tree and the metadata stored in the storage space, so as to avoid data inconsistency problems when subsequent users locate user data through the node information of the nodes in the storage structure mapping tree.

[0024] In one embodiment, based on the metadata in the storage space and the management type of the data management request, the node information of each node in the storage structure mapping tree is updated accordingly, including:

[0025] Get the amount of metadata in the storage space and the timeout period before the metadata in the storage space is synchronized to the storage structure mapping tree;

[0026] When the amount of metadata reaches a first preset threshold and / or the timeout period reaches a first time threshold, the node information of each node in the storage structure mapping tree is updated accordingly according to the management type of the data management request and the metadata in the storage space.

[0027] In the technical solution provided in the embodiment of the present application, based on the amount of metadata in the storage space that is not recorded in the storage structure mapping tree and the timeout period during which the metadata in the storage space is not synchronized to the storage structure mapping tree, the node information of each node in the storage structure mapping tree is updated accordingly in a timely manner, and multiple metadata in the storage space are aggregated and synchronously modified to the storage structure mapping tree, which reduces the number of interactions between the storage space and the system memory to a certain extent, improves system performance, and ensures the data management response speed.

[0028] In one embodiment, according to the management type of the data management request, the node information of each node in the storage structure mapping tree is updated accordingly, including:

[0029] If the management type of the data management request is a data write type, the node to be updated is determined according to the usage frequency of the target metadata and the level of the storage structure mapping tree, and the target metadata is written into the node to be updated;

[0030] If the management type of the data management request is a data deletion type, the node to be updated is determined according to the logical address of the target metadata, and the target metadata in the node to be updated is deleted;

[0031] If the management type of the data management request is a data modification type, the initial metadata corresponding to the target metadata is determined in the storage structure mapping tree according to the logical address of the target metadata, and the initial metadata is replaced with the target metadata.

[0032] In the technical solution provided in the embodiment of the present application, the node information of each node in the storage structure mapping tree is updated accordingly according to the different management types of the data management requests, so as to ensure the consistency of the node information of the storage structure mapping tree and the metadata stored in the storage space, and avoid data inconsistency when subsequent users locate user data through the node information of the nodes in the storage structure mapping tree.

[0033] In one embodiment, the management type of the data management request is a data write type; and the node information of each node in the storage structure mapping tree is updated accordingly, further comprising:

[0034] Detect the number of node information of each node in the storage structure mapping tree;

[0035] The nodes whose node information quantity is greater than the node quantity splitting threshold are determined as nodes to be split;

[0036] Split the node to be split.

[0037] In the technical solution provided in the embodiment of the present application, the amount of node information of each node in the storage structure mapping tree is detected, and the nodes in which the amount of node information is greater than the node number splitting threshold are determined as nodes to be split, and the nodes to be split are split in time so that the metadata in the storage space can be synchronized to the storage structure mapping tree in time.

[0038] In one embodiment, splitting the node to be split includes:

[0039] According to the level of the node to be split in the storage structure mapping tree, two splitting nodes corresponding to the node to be split are determined in the same level of the node to be split;

[0040] The node information in the node to be split is split and stored in two split nodes.

[0041] In the technical solution provided by the embodiment of the present application, two corresponding splitting nodes are generated at the same level in the node to be split, and the node information stored in the node to be split is stored together by the two splitting nodes, which means that the number of nodes in the storage structure mapping tree will increase by at least one for each node to be split. Such a splitting method maintains the height of the storage structure mapping tree unchanged, increases the width of the storage structure mapping tree at the level where the node to be split is located, and speeds up the query of user data through the storage structure mapping tree while supporting the smooth synchronization of metadata to the storage structure mapping tree.

[0042] In one embodiment, splitting and storing node information in a node to be split into two split nodes includes:

[0043] Writing the node information of the node to be split into two idle data resource blocks in the storage space, and obtaining the resource block information of the two idle data resource blocks in which the node information is written;

[0044] According to the node information in the two idle data resource blocks, determining the splitting nodes corresponding to the two idle data resource blocks in the two splitting nodes;

[0045] The resource block information of each idle data resource block is recorded in the corresponding split node.

[0046] In the technical solution provided by the embodiment of the present application, the node information in the node to be split is written into two idle data resource blocks in the storage space, and the resource block information of the two idle data resource blocks in which the node information is written is obtained. According to the node information in the two idle data resource blocks, the splitting nodes corresponding to the two idle data resource blocks in the two splitting nodes are determined, and the resource block information of each idle data resource block is recorded in the corresponding splitting node, so as to realize the splitting in the node to be split from two dimensions: the form of the node and the content of the node.

[0047] In one embodiment, the method further comprises:

[0048] Obtain the physical address of each idle data resource block into which the node information is written;

[0049] For any idle data resource block, establishing a first mapping relationship between the physical address of the idle data resource block and the node information;

[0050] The first mapping relationship is recorded in the node at the upper level of the split node corresponding to the idle data resource block.

[0051] In the technical solution provided in the embodiment of the present application, for any idle data resource block, a first mapping relationship between the physical address of the idle data resource block and the node information is established, and the first mapping relationship is recorded in the upper-level node of the split node corresponding to the idle data resource block. Without relying on the internal mechanism of the solid-state drive, automatic update of the node information of each node in the storage structure mapping tree is achieved, thereby reducing the internal processing pressure of the solid-state drive under zns.

[0052] In one embodiment, the management type of the data management request is a data deletion type; and the node information of each node in the storage structure mapping tree is updated accordingly, further comprising:

[0053] Detect the number of node information of each node in the storage structure mapping tree;

[0054] For any node of the storage structure mapping tree, if the node information quantity of the node is less than the preset node quantity lower limit, and the sum of the node information quantity of the node and the node information quantity of the adjacent nodes is less than the preset node quantity merging threshold, the node information and the adjacent nodes are merged.

[0055] In the technical solution provided in the embodiment of the present application, the number of node information of each node in the storage structure mapping tree is detected. If the number of node information of the node is less than the preset lower limit of the number of nodes, and the sum of the number of node information of the node and the number of node information of adjacent nodes is less than the preset node number merging threshold, the node information of the node and the adjacent nodes is merged in time to avoid redundant nodes in the storage structure mapping tree and improve the node validity of the storage structure mapping tree.

[0056] In one embodiment, merging node information of a node and an adjacent node includes:

[0057] Writing the node information of the node and the node information of the adjacent node into the same idle data resource block in the storage space, and obtaining the resource block information of the idle data resource block;

[0058] According to the adjacent nodes and the levels of the nodes in the storage structure mapping tree, the merged nodes are determined in the same level;

[0059] Record resource block information into the merge node.

[0060] In the technical solution provided by the embodiment of the present application, the node information of the node and the node information of the adjacent node are written into the same free data resource block in the storage space, and the resource block information of the free data resource block is obtained. The merged node is determined according to the adjacent nodes and the levels of the nodes in the storage structure mapping tree, and the resource block information is recorded in the merged node. While ensuring that the architecture of the storage structure mapping tree remains unchanged, the nodes are merged from two dimensions: the form of the node and the content of the node.

[0061] In one embodiment, the method further comprises:

[0062] Obtaining the physical address of the idle data resource block of the write node information and the node information of the adjacent node, and obtaining the node information of the merged node;

[0063] Establishing a second mapping relationship between the physical address of the idle data resource block and the node information of the merged node;

[0064] The second mapping relationship is recorded in the node at the previous level of the merged node.

[0065] In the technical solution provided in the embodiment of the present application, the physical address of the free data resource block of the write node information and the adjacent node node information is obtained, and the node information of the merged node is obtained without relying on the internal mechanism of the solid-state drive, thereby realizing the automatic update of the node information of each node in the storage structure mapping tree, and reducing the internal processing pressure of the solid-state drive under zns.

[0066] In one embodiment, the method further comprises:

[0067] When the node information of each node in the storage structure mapping tree is updated, the node information quantity of each node and the uncured time of each node are obtained;

[0068] According to the amount of node information of each node and the uncured time of each node, the metadata stored in the storage space is recycled to release the storage space.

[0069] In the technical solution provided by the embodiment of the present application, when the node information of each node in the storage structure mapping tree is updated, the node information quantity of each node and the unsolidified time of each node are obtained, and when the node information quantity and the unsolidified time meet the metadata recycling conditions, the metadata stored in the storage space is recycled to release the storage space in time, avoid insufficient storage space of the storage system, and ensure the security and integrity of the data in the storage system.

[0070] In one embodiment, metadata stored in the storage space is recycled according to the amount of node information of each node and the uncured time of each node, including:

[0071] For any node, when the amount of node information of the node reaches a second preset threshold, and / or the uncured time reaches a second time threshold, the node information in the node is cured;

[0072] If all node information is solidified, the metadata stored in the storage space is recycled.

[0073] In the technical solution provided by the embodiment of the present application, when the amount of node information reaches a second preset threshold and / or the unsolidified time reaches a second time threshold, the node information in the node is solidified, and when the node information is solidified, the metadata stored in the storage space is promptly recovered. On the basis of persistent processing of the node information, the solidification frequency of the node information is reduced as much as possible to improve system performance.

[0074] In one embodiment, target metadata is generated according to user data carried in the data management request and a plurality of storage spaces pre-divided on a solid state drive in a storage system, including:

[0075] Determine a storage space for user data from a plurality of storage spaces;

[0076] The target metadata is generated according to the logical address of the user data and the storage space of the user data.

[0077] In the technical solution provided in the embodiment of the present application, a storage space for user data is determined from multiple storage spaces, and then target metadata is generated according to the logical address and the storage space for the user data. The process of determining the target metadata includes two stages: determining the logical address of the user data and determining the storage position of the user data in the storage space. The two stages are tightly coupled, which improves the accuracy of the target metadata and provides a reliable positioning basis for subsequent modification of the user data in the target storage space.

[0078] In one embodiment, determining a storage space for user data from a plurality of storage spaces includes:

[0079] When there is non-free space in multiple storage spaces, obtain the data type and size of the user data;

[0080] A storage space among the multiple storage spaces that matches the data type and size of the user data is determined as the storage space for the user data.

[0081] In the technical solution provided in the embodiment of the present application, when determining the storage space for storing user data, based on the data type and size of the user data, the storage space for storing user data is preferentially determined from the non-free space to avoid storage space fragmentation. At the same time, the physical characteristics of the solid-state drive data appending writing under the zone architecture are adapted to maximize the performance of the solid-state drive.

[0082] In one embodiment, determining a storage space for user data from a plurality of storage spaces includes:

[0083] When multiple storage spaces are all free spaces, a life count of each storage space is obtained; the life count is used to represent the number of times the candidate storage space is erased and written;

[0084] The storage space corresponding to the minimum life count is determined as the storage space for user data.

[0085] In the technical solution provided in the embodiment of the present application, when multiple storage spaces are all free spaces, the life count of each storage space is obtained to determine the number of erase and write times of the candidate storage space, and then the storage space corresponding to the minimum life count is determined as the storage space for user data, thereby ensuring to the greatest extent that the number of erase and write times of each storage space in the storage system is balanced and improving the performance of the storage system.

[0086] In one embodiment, generating target metadata of user data according to a logical address of the user data and a storage space of the user data includes:

[0087] Writing the user data into an idle data resource block in the storage space of the user data, and obtaining the physical address of the idle data resource block into which the user data is written;

[0088] Establish a mapping relationship between logical addresses and physical addresses;

[0089] The mapping relationship is determined as target metadata of the user data.

[0090] In the technical solution provided in the embodiment of the present application, user data is written into a free data resource block in the storage space, and the physical address of the free data resource block where the user data is written is obtained, a mapping relationship between the logical address and the physical address of the user data is established, and target metadata is obtained. In this way, the logical address perceived by the front end and the physical address perceived by the back end of the same user data are associated to support rapid query through the logical address and locate the data at the corresponding physical address, thereby improving the data processing speed.

[0091] In one embodiment, the method further comprises:

[0092] According to the logical volume identifier carried in the data management request, the storage structure mapping tree corresponding to the logical volume identifier is determined as the storage structure mapping tree corresponding to the user data in the storage system; a storage structure mapping tree is pre-configured for each logical volume in the storage system.

[0093] In the technical solution provided in the embodiment of the present application, on the basis of pre-configuring a storage structure mapping tree for each logical volume, the logical volume corresponding to the user data in the storage system is determined according to the logical volume identifier carried in the data management request, and the storage structure mapping tree corresponding to the logical volume in the storage system is determined as the storage structure mapping tree corresponding to the user data in the storage system. The entire determination process has clear logic and is easy to implement, which is conducive to accurately determining the logical volume to which the user data belongs in the storage system.

[0094] In one embodiment, the method further comprises:

[0095] When a corresponding management operation is performed on the target metadata, if an abnormality occurs in the storage system or storage service, the management operation on the target metadata is interrupted.

[0096] In the technical solution provided in the embodiment of the present application, when an abnormality occurs in the storage system or storage service, the management operation of the target metadata is interrupted in time to avoid wasting the management resources of the storage system.

[0097] In one embodiment, the method further comprises:

[0098] If it is detected that the storage system or storage service has returned to normal, the storage service is instructed to continue to perform management operations on the target metadata, and replay the metadata in the storage space to the memory structure of the storage system, and synchronize the metadata content in the memory structure to the storage structure mapping tree that matches the metadata content.

[0099] In the technical solution provided in the embodiment of the present application, when it is detected that the storage system or storage service has returned to normal, the storage service is automatically started to instruct the storage service to continue to perform management operations on the target metadata, play back and synchronize the metadata, and ensure the data security and consistency of the storage system.

[0100] In one embodiment, the method further comprises:

[0101] In response to a data read request in the storage system, obtaining a target logical volume to which the data to be read belongs in the storage system according to a logical address of the data to be read carried in the data read request;

[0102] Determine the physical address corresponding to the logical address of the data to be read from the storage structure mapping tree of the target logical volume;

[0103] Displays the data in the physical address corresponding to the logical address of the data to be read.

[0104] In the technical solution provided in the embodiment of the present application, in response to a data read request in the storage system, according to the logical address of the data to be read carried in the data read request, the target logical volume to which the data to be read belongs in the storage system is obtained, the physical address corresponding to the logical address of the data to be read is determined from the storage structure mapping tree of the target logical volume, and the data in the physical address corresponding to the logical address of the data to be read is displayed. The storage structure mapping tree is used to clearly display the index relationship between the metadata of the target logical volume in a hierarchical manner, so as to quickly locate the physical address of the data to be read, and then quickly and accurately locate the data to be read, thereby improving the data reading response speed.

[0105] In a second aspect, the present application further provides a metadata management device, the device comprising:

[0106] A metadata acquisition module, for responding to a data management request in the storage system, and generating target metadata of the user data according to the user data carried in the data management request and a plurality of storage spaces pre-divided on the solid state hard disk in the storage system;

[0107] A metadata writing module, used for writing target metadata into a storage space according to the plurality of storage spaces and the usage frequency of the target metadata;

[0108] The metadata management module is used to perform corresponding management operations on the target metadata based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system.

[0109] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the embodiments of the first aspect are implemented.

[0110] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in any one of the embodiments of the first aspect above.

[0111] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method in any one of the embodiments of the first aspect above.

[0112] The above-mentioned metadata management method, device, equipment, storage medium and program product, in response to a data management request in a storage system, generates target metadata of user data according to the user data carried in the data management request and the multiple storage spaces pre-divided on the solid state hard disk in the storage system; writes the target metadata into the storage space according to the usage frequency of the multiple storage spaces and the target metadata; performs corresponding management operations on the target metadata based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system. In this method, on the basis of pre-dividing the solid state hard disk in the storage system into multiple storage spaces, first, based on the multiple storage spaces, the user data is processed to obtain the target metadata, and then the target metadata is managed again based on the multiple storage spaces, so as to realize two-stage data management, so as to give full play to the performance of the solid state hard disk under the zns architecture. In addition, when storing the target metadata, the storage space for storing the target metadata is determined based on the usage frequency of the target metadata. Such a determination method can make the usage frequency of the metadata stored in the same storage space relatively close, so as to facilitate the unified management of the stored data in the same storage space, such as erasing, updating and other operations, thereby reducing the number of erasures and writes of the solid state hard disk to which the storage space belongs, and prolonging the service life of the solid state hard disk. In addition, when managing the target metadata, multi-level management of the target metadata is achieved through the corresponding storage structure mapping tree in the storage system to achieve closed-loop management of the metadata management process, thereby improving the management efficiency of metadata and reducing the complexity of the internal mechanism of the solid-state drive. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0114] Figure 1 A schematic diagram of the structure of a storage system in one embodiment;

[0115] Figure 2 A flowchart of a metadata management method in one embodiment;

[0116] Figure 3 A schematic diagram of a process of writing target metadata in one embodiment;

[0117] Figure 4 A schematic flow chart of a target metadata writing step in another embodiment;

[0118] Figure 5 A schematic diagram of a process of updating the mapping tree node information in one embodiment;

[0119] Figure 6 A schematic diagram of a flowchart of a step of updating mapping tree node information in another embodiment;

[0120] Figure 7 A schematic diagram of a process of splitting a mapping tree node in one embodiment;

[0121] Figure 8 It is a flowchart of the steps of updating the mapping tree node information in a split scenario in one embodiment;

[0122] Fig. 9 It is a flowchart of a step of updating mapping tree node information in a split scenario in another embodiment;

[0123] Fig.10 A schematic diagram of a process of merging mapping tree nodes in one embodiment;

[0124] Fig.11 A schematic diagram of a process of updating the mapping tree node information in a merging scenario in one embodiment;

[0125] Fig.12 It is a flowchart of the step of updating the mapping tree node information in a merging scenario in another embodiment;

[0126] Fig.13 A schematic diagram of a flow chart of a data recovery step in an embodiment;

[0127] Fig.14 is a flow chart of a data recovery step in another embodiment;

[0128] Fig.15 A schematic diagram of a process of generating metadata in one embodiment;

[0129] Fig.16 A schematic diagram of a flow chart of a metadata determination step in one embodiment;

[0130] Fig.17 A schematic diagram of a flow chart of a data reading step in an embodiment;

[0131] Fig.18 A first schematic diagram of a storage system data writing process in one embodiment;

[0132] Fig.19 A second schematic diagram of a storage system data writing process in one embodiment;

[0133] Fig. 20 A schematic diagram of storing log information before a system abnormality in one embodiment;

[0134] Fig.21 It is a schematic diagram of an instantiation of storing system log information in one embodiment;

[0135] Fig. 22 A schematic diagram of the playback steps of the storage system log information in one embodiment;

[0136] Fig.23 A schematic diagram of the layout of storage space of a storage system in one embodiment;

[0137] Fig.24 A third schematic diagram of a storage system data writing process in one embodiment;

[0138] Fig.25 A timing diagram of a storage system log writing process in one embodiment;

[0139] Fig.26 A schematic diagram of the timing of applying a storage system log to a memory data structure in one embodiment;

[0140] Fig. 27 A schematic diagram of the structure of a storage system mapping tree in one embodiment;

[0141] Fig.28 is a structural block diagram of a metadata management device in an embodiment;

[0142] Fig.29 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0143] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0144] In the field of storage systems, SSDs based on silicon-based semiconductors are widely used as storage devices in storage systems due to their low latency and high bandwidth.

[0145] Next, the physical characteristics of SSD are explained: the physical operations on the same storage unit include "read" operation, "write" operation and "erase" operation. After a "write" operation is performed on a storage unit, an "erase" operation is required before writing again. In essence, it is necessary to use a higher voltage to implement the "erase" operation because the information in a "written" storage unit is changed. However, the number of "erase" operations that the semiconductor structure used by SSD can withstand is limited, ranging from hundreds to thousands. It is precisely based on the above physical characteristics that SSD hard disks must use internal software (firmware) to shield the details of the internal mechanism such as the "erase" operation before the "write" operation in order to achieve the same operating functions as mechanical disks based on magnetic materials. At the same time, the balance of the number of "erase" operations between storage units must also be taken into account, making the internal software of SSD hard disks very complex.

[0146] SSD hard drives usually use the mechanism of append-write and garbage collection (GC). When the application behavior does not take the characteristics of the SSD hard drive into consideration, it will have a significant impact on the performance and service life of the SSD hard drive.

[0147] In practical applications, considering that SSD hard disks are the basic storage devices in storage systems, their service life and performance are key indicators that affect the overall capabilities of the system. In related technologies, SSD hard disks based on ZNS technology have been introduced, which changes the previous method of using SSD disks through the same address space to using Zone as a management unit, using the same address space within the Zone and using the append writing method, so that an SSD hard disk can provide a large number of Zones to users.

[0148] However, in the related art, SSD hard disks based on ZNS are often used to manage the recorded data actually generated in the storage system, and lack a technical solution for managing metadata that describes data attribute information.

[0149] Based on this, the present application provides a metadata management method, apparatus, device, storage medium and program product, which use ZNS's SSD hard drive to manage the metadata of the storage system.

[0150] The metadata management method provided in the embodiment of the present application can be applied to Figure 1 In the storage system shown, Figure 1 In the present invention, the storage system includes a controller and multiple memories at different levels. The controller is responsible for storing the data in the storage system in the memories and realizing the data management in the storage system.

[0151] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will be combined with the accompanying drawings, with the controller of the storage system as the execution body, to describe the embodiments of the present application.

[0152] In an exemplary embodiment, Figure 2 As shown, a metadata management method is provided, comprising the following steps:

[0153] S201, in response to a data management request in a storage system, generating target metadata of user data according to user data carried in the data management request and a plurality of storage spaces pre-divided on a solid state drive in the storage system.

[0154] Among them, the storage system includes multiple solid-state hard drives. In an embodiment of the present application, the ZNS architecture is used to divide the storage space of each solid-state hard drive into multiple storage spaces (zones), and different zones store different types of data. For example, the data zone stores recorded user data, and the log zone stores metadata that describes the recorded data attribute information.

[0155] It should be emphasized that when each zone is completely idle, the type of data stored is determined according to actual needs. For example, the zone initially stores recorded user data, and when it is completely released, it can be used to store metadata.

[0156] A data management request is a request triggered by a user or a storage system, which may be a data write request, a data delete request, a data modification request, etc. In actual applications, a data management request carries user data and a logical address so that the storage system can clearly identify the management object of the data management.

[0157] In a scenario where different storage spaces store different types of data, in response to a data management request, a target storage space for storing user data is determined from different types of storage spaces, and then the physical address of the target storage space storing the user data is associated with the logical address of the user data as the target metadata of the user data.

[0158] S202: Write the target metadata into the storage space according to the plurality of storage spaces and the usage frequency of the target metadata.

[0159] The usage frequency of the target metadata refers to the number of operations on the target metadata per unit time. For the storage system, after generating the target metadata, the usage frequency of the target metadata can be obtained by counting the number of operations on the target metadata per unit time, or the usage frequency of the target metadata can be determined according to the metadata judgment rule of the storage system.

[0160] For any target metadata, a higher usage frequency means that the user queries, modifies or reads the user data corresponding to the target metadata more frequently; conversely, a lower usage frequency means that the user queries, modifies or reads the user data corresponding to the target metadata less frequently.

[0161] Optionally, a usage frequency range can be pre-set for each storage space. In this scenario, the usage frequency of the target metadata is matched with the usage frequency ranges of each storage space, and a target usage frequency range that matches the usage frequency of the target metadata is determined. The storage space corresponding to the target usage frequency range is then determined as the metadata storage space for storing the target metadata, and the target metadata is written into the metadata storage space.

[0162] S203: Based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system, perform corresponding management operations on the target metadata.

[0163] The storage structure mapping tree corresponds to the logical volumes in the storage system one by one. The storage structure mapping tree of each logical volume is used to characterize the mapping relationship between the logical address and the physical address of the user data in the logical volume. The storage structure mapping tree can be a B+ tree with a fixed tree height and node width, and has the following characteristics: (1) The leaf node of the storage structure mapping tree records the mapping relationship between the logical address (Logical Block Address, LBA) of the logical volume and the physical location where the user data is stored. The mapping relationship includes at least the LBA, Zone ID, offset and length of the logical volume, and necessary description information. (2) The nodes between the leaf node of the storage structure mapping tree and the root node of the storage structure mapping tree are collectively referred to as intermediate nodes. Each node in the storage structure mapping tree corresponds to a continuous LBA range of a logical volume, and the LBA ranges corresponding to all nodes belonging to the same layer cover the complete address space of the logical volume and have no intersection with each other. (3) For the nodes at each layer of the storage structure mapping tree, except for the node with the largest address range, the address ranges corresponding to other nodes are all in a left-closed and right-open manner.

[0164] In an exemplary embodiment, the process of determining the storage structure mapping tree corresponding to user data in the storage system includes the following steps: based on the logical volume identifier carried in the data management request, the storage structure mapping tree corresponding to the logical volume identifier is determined as the storage structure mapping tree corresponding to the user data in the storage system; a storage structure mapping tree is pre-configured for each logical volume in the storage system.

[0165] In the storage system, a storage structure mapping tree is configured for each logical volume in the storage system, and the storage structure mapping tree is used to represent the metadata of the user data stored in the logical volume. On this basis, the storage structure mapping trees of each logical volume in the storage system are traversed, and the storage structure mapping tree that matches the logical volume identifier to which the user data belongs in the storage system is determined as the storage structure mapping tree corresponding to the user data in the storage system.

[0166] In another determination scenario, the logical volume address field in the logical address can also be extracted according to the characteristics of the logical address carrying the logical volume identification field and the address field to obtain the logical volume identification, and then the logical volume to which the user data belongs in the storage system is determined according to the logical volume identification, and then the storage structure mapping tree corresponding to the logical volume is determined, that is, the storage structure mapping tree corresponding to the user data in the storage system.

[0167] In an embodiment of the present application, on the basis of pre-configuring a storage structure mapping tree for each logical volume, the logical volume corresponding to the user data in the storage system is determined according to the logical volume identifier carried in the data management request, and the storage structure mapping tree corresponding to the logical volume in the storage system is determined as the storage structure mapping tree corresponding to the user data in the storage system. The entire determination process has clear logic and is easy to implement, which is conducive to accurately determining the logical volume to which the user data belongs in the storage system.

[0168] The metadata in the storage space refers to the set of metadata written to the storage space and not synchronized to the storage structure mapping tree, including the target metadata.

[0169] In one scenario, the metadata of the storage space may be the target metadata corresponding to the current data management request. Then, each time a target metadata is written to the storage space, the target node of the storage mapping relationship is determined in the storage structure mapping tree according to the logical address of the target metadata, and the target metadata is recorded in the target node until the root node information in the storage structure mapping tree is updated, thereby completing the closed-loop processing of the entire target metadata management and realizing the automatic update of the metadata in the logical volume.

[0170] In another scenario, the metadata of the storage space may include the target metadata corresponding to the current data management request and the historical metadata corresponding to the historical data management request. Then, each time a target metadata is written to the storage space, the number of metadata in the storage space is recorded until the number of metadata reaches a preset threshold, and the metadata of the storage space is aggregated and uniformly written into the storage structure mapping tree. For each metadata of the storage space, the target node of the storage mapping relationship is determined in the storage structure mapping tree according to the logical address of the metadata, and the target metadata is recorded in the target node until the root node information in the storage structure mapping tree is updated, completing the closed-loop processing of the entire target metadata management, and realizing the automatic update of the metadata in the logical volume.

[0171] In the embodiment of the present application, in response to a data management request in a storage system, target metadata of user data is generated according to the user data carried in the data management request and the multiple storage spaces pre-divided in the storage system solid state hard disk; the target metadata is written into the storage space according to the usage frequency of the multiple storage spaces and the target metadata; based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system, the corresponding management operation is performed on the target metadata. In this method, on the basis of pre-dividing the solid state hard disk in the storage system into multiple storage spaces, first, based on the multiple storage spaces, the user data is processed to obtain the target metadata, and then the target metadata is managed again based on the multiple storage spaces, so as to realize two-stage data management, so as to give full play to the performance of the solid state hard disk under the zns architecture. Moreover, when storing the target metadata, the storage space for storing the target metadata is determined based on the usage frequency of the target metadata. Such a determination method can make the usage frequency of the metadata stored in the same storage space relatively close, so as to facilitate the unified management of the stored data in the same storage space, such as erasing, updating and other operations, thereby reducing the number of erasures and writes of the solid state hard disk to which the storage space belongs, and improving the service life of the solid state hard disk. In addition, when managing the target metadata, multi-level management of the target metadata is achieved through the corresponding storage structure mapping tree in the storage system to achieve closed-loop management of the metadata management process, thereby improving the management efficiency of metadata and reducing the complexity of the internal mechanism of the solid-state drive.

[0172] When managing metadata, it can be divided into two stages: writing metadata into storage space; writing metadata in the storage space into the storage structure mapping tree. Based on this, a possible implementation method of writing metadata into storage space is described below.

[0173] In an exemplary embodiment, Figure 3 As shown, according to multiple storage spaces and the usage frequency of the target metadata, writing the target metadata into the storage space includes the following steps:

[0174] S301, obtaining life cycles of multiple storage spaces.

[0175] The life cycle of each storage space refers to a quantitative value that characterizes the remaining service life of the storage space. It can be expressed in terms of time, such as two years, one year, etc., or in terms of the remaining number of erase and write times, such as 5000 times, 2000 times, etc.

[0176] In the embodiment of the present application, the life cycle of the storage space is stored in the hard disk under the non-zns architecture, and in-situ modification is supported. Based on this, the life cycle of each storage space can be directly read from the hard disk under the non-zns architecture.

[0177] S302, matching the usage frequency of the target metadata with the life cycle of each storage space, and writing the target metadata into the storage space with successful matching.

[0178] It should be known that the higher the frequency of use of the target metadata, the more frequent the operations on the target metadata. At this time, in order to facilitate the operations on the target metadata, that is, to process the user data corresponding to the target metadata, the target metadata can be stored in a storage space with a shorter life cycle; the lower the frequency of use of the target metadata, the fewer the operations on the target metadata. At this time, in order to facilitate the long-term storage of the target metadata, the target metadata can be stored in a storage space with a longer life cycle.

[0179] The frequency of use of the target metadata is matched with the life cycle of each storage space. The life cycle corresponding to the frequency of use of the target metadata can be determined according to the mapping relationship between the frequency of use and the life cycle, and then the storage space corresponding to the life cycle is determined as the metadata storage space for storing the target metadata, and the target metadata is written into the metadata storage space.

[0180] In an embodiment of the present application, based on obtaining the life cycles of multiple storage spaces, the usage frequency of the target metadata is matched with the life cycles of each storage space to determine a metadata storage space suitable for storing the target metadata, and the target metadata is further written into the successfully matched metadata storage space. This method of determining the storage space is suitable for a scenario in which the target metadata is initially written after the storage system is started.

[0181] As an embodiment parallel to the above embodiment, another possible implementation method of writing metadata into the storage space is described below.

[0182] In an exemplary embodiment, Figure 4 As shown, according to multiple storage spaces and the usage frequency of the target metadata, writing the target metadata into the storage space includes the following steps:

[0183] S401, obtaining usage frequencies of historical metadata in multiple storage spaces.

[0184] For each storage space, when one or more historical metadata are stored, the usage frequency of the historical metadata in the plurality of storage spaces may be determined according to the usage frequency of each historical metadata in the storage space.

[0185] If the storage space includes one historical metadata, the usage frequency of the historical metadata in the storage space is the usage frequency of the historical metadata; if the storage space includes multiple historical metadata, the mean, median, or mode of the usage frequencies of the multiple historical metadata can be determined as the usage frequency of the historical metadata in the storage space.

[0186] S402, comparing the usage frequency of the target metadata with the usage frequency of the historical metadata in the plurality of storage spaces, and determining the storage space having the smallest usage frequency difference with the target metadata from the plurality of storage spaces.

[0187] The usage frequency of the target metadata is compared with the usage frequency of the historical metadata in multiple storage spaces. The difference between the usage frequency of the target metadata and the usage frequency of the historical metadata in each storage space is calculated respectively, and then the storage space with the smallest difference is determined as the metadata storage space for storing the target metadata.

[0188] S403: Write the target metadata into the storage space with the smallest usage frequency difference.

[0189] In the embodiment of the present application, based on obtaining the usage frequencies of historical metadata in multiple storage spaces, the usage frequency difference between the usage frequency of the target metadata and the usage frequency of the historical metadata in each storage space is calculated, and the storage space with the smallest usage frequency difference is used as the metadata storage space for storing the target metadata, so that the usage frequencies of the metadata stored in the same storage space are relatively close, so as to facilitate unified management of the stored data in the same storage space, such as erasing, updating and other operations, thereby reducing the number of erasures and writes of the solid-state hard disk to which the storage space belongs, and improving the service life of the solid-state hard disk. In addition, compared with the above embodiment, the method of determining the storage space in this embodiment is suitable for the scenario where the target metadata is written after the storage system has been running for a period of time.

[0190] The above-mentioned embodiment describes the implementation method of the first stage of metadata management "writing metadata into storage space", and then describes the implementable method of the second stage of metadata management "writing metadata in storage space into storage structure mapping tree".

[0191] In an exemplary embodiment, Figure 5As shown, based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system, performing corresponding management operations on the target metadata includes the following steps:

[0192] S501, based on the metadata in the storage space and the management type of the data management request, the node information of each node in the storage structure mapping tree is updated accordingly.

[0193] Based on the logical address in the metadata in the storage space, the node to be updated is determined from the storage structure mapping tree, and then based on the management type of the data management request, the metadata in the storage space is synchronously written into the node to be updated to implement the update of the storage structure mapping tree node information.

[0194] When updating the storage structure mapping tree, the node corresponding to the metadata in the storage structure mapping tree may be updated once for each metadata stored in the storage space, or, after a preset number of metadata are stored in the storage space, the node corresponding to the metadata in the storage structure mapping tree may be updated once; or, when metadata is stored in the storage space, the node corresponding to the metadata in the storage structure mapping tree may be updated once at a preset time interval.

[0195] S502: When the node information of each node in the storage structure mapping tree is updated, a management success response of the target metadata is returned.

[0196] The node information of each node in the storage structure mapping tree is updated, which means that the physical location of the user data can be queried in the storage structure mapping tree later, which can support subsequent operations such as querying or modifying the user data, and a successful management response of the target metadata can be returned.

[0197] In an embodiment of the present application, based on the metadata in the storage space and the management type of the data management request, the node information of each node in the storage structure mapping tree is updated accordingly, and when the node information of each node in the storage structure mapping tree is updated, a management success response of the target metadata is returned to maintain the consistency of the node information of the storage structure mapping tree (data in the memory structure) and the metadata stored in the storage space (hard disk data), so as to avoid data inconsistency problems when subsequent users locate user data through the node information of the nodes in the storage structure mapping tree.

[0198] Next, the update timing of the aforementioned step S501 "update the node information of each node in the storage structure mapping tree accordingly based on the metadata in the storage space and the management type of the data management request" is described through an embodiment. Figure 6 As shown, the following steps are included:

[0199] S601, obtaining the amount of metadata in the storage space and the timeout period during which the metadata in the storage space is not synchronized to the storage structure mapping tree.

[0200] The storage space includes metadata that has been recorded in the storage structure mapping tree and metadata that has not been recorded in the storage structure mapping tree. In an embodiment of the present application, the number of metadata that has not been recorded in the storage structure mapping tree is counted as the number of metadata in the storage space.

[0201] After updating the node information of each node in the storage structure mapping tree, record the time when the next metadata is stored in the storage space, and continue to record the waiting time when the storage space is not synchronized to the storage structure mapping tree as the timeout time when the metadata in the storage space is not synchronized to the storage structure mapping tree.

[0202] S602, when the amount of metadata reaches a first preset threshold, and / or the timeout period reaches a first time threshold, the node information of each node in the storage structure mapping tree is updated accordingly according to the management type of the data management request and the metadata in the storage space.

[0203] If the amount of metadata reaches a first preset threshold, the metadata in the storage space that is not recorded in the storage structure mapping tree is aggregated, and the node information of each node in the storage structure mapping tree is updated accordingly based on the management type of the data management request corresponding to each metadata.

[0204] If the timeout reaches the first time threshold, the metadata in the storage space that is not recorded in the storage structure mapping tree is aggregated, and the node information of each node in the storage structure mapping tree is updated accordingly based on the management type of the data management request corresponding to each metadata.

[0205] In an embodiment of the present application, based on the amount of metadata in the storage space that has not been recorded in the storage structure mapping tree and the timeout period during which the metadata in the storage space has not been synchronized to the storage structure mapping tree, the node information of each node in the storage structure mapping tree is updated accordingly in a timely manner, and multiple metadata in the storage space are aggregated and synchronously modified to the storage structure mapping tree, thereby reducing the number of interactions between the storage space and the system memory to a certain extent, improving system performance, and ensuring the data management response speed.

[0206] The above embodiment describes the update timing of the storage structure mapping tree. Next, the node update operation of the storage structure mapping tree will be further described.

[0207] In an exemplary embodiment, according to the management type of the data management request, the node information of each node in the storage structure mapping tree is updated accordingly, including:

[0208] If the management type of the data management request is a data write type, the node to be updated is determined according to the usage frequency of the target metadata and the hierarchy of the storage structure mapping tree, and the target metadata is written into the node to be updated; if the management type of the data management request is a data deletion type, the node to be updated is determined according to the logical address of the target metadata, and the target metadata in the node to be updated is deleted; if the management type of the data management request is a data modification type, the initial metadata corresponding to the target metadata is determined in the storage structure mapping tree according to the logical address of the target metadata, and the initial metadata is replaced with the target metadata.

[0209] For any data management request, when the data management request is of data write type, the node to be updated in the storage structure mapping tree is determined according to the frequency of use of metadata in the storage space and the level of the storage structure mapping tree, and then the metadata in the storage space is written into the node to be updated.

[0210] It should be noted that the update frequency of the metadata stored in different levels of the storage structure mapping tree is different. For example, the update frequency of the leaf nodes of the storage structure mapping tree is the highest, the update frequency of the intermediate nodes decreases as the level increases, and the update frequency of the root node is the lowest. In the embodiment of the present application, the usage frequency of the metadata in the storage space corresponds to the level of the storage structure mapping tree. The higher the usage frequency of the metadata, the lower the level of the storage structure mapping tree corresponding to the node to be updated to which the metadata belongs.

[0211] For any data management request, when the data management request is of data deletion type, the node to be updated is queried in the storage structure mapping tree according to the logical address of the metadata in the storage space, and the metadata stored in the node to be updated is deleted.

[0212] For any data management request, when the data management request is of data modification type, the initial metadata corresponding to the metadata in the storage space is determined in the storage structure mapping tree according to the logical address in the metadata, and the node storing the initial metadata in the storage structure mapping tree is determined as the node to be updated, and then the initial metadata in the node to be updated is deleted, and then the metadata in the storage space is written to the node to be updated.

[0213] In an embodiment of the present application, the node information of each node in the storage structure mapping tree is updated accordingly according to the different management types of the data management request to ensure the consistency of the node information of the storage structure mapping tree and the metadata stored in the storage space, so as to avoid data inconsistency when subsequent users locate user data through the node information of the nodes in the storage structure mapping tree.

[0214] It can be seen from the above embodiments that when the data management request is of the data write type, the node information of the node in the storage structure mapping tree is monotonically increasing, and the width of the node in the storage structure mapping tree is limited. Based on this, in order to ensure that the metadata can be smoothly synchronized to the storage structure mapping tree, it is necessary to split the node in the storage structure mapping tree when the node information of the node meets the preset conditions.

[0215] In an exemplary embodiment, Figure 7 As shown, the management type of the data management request is a data write type; the node information of each node in the storage structure mapping tree is updated accordingly, including the following steps:

[0216] S701, detecting the amount of node information of each node in the storage structure mapping tree.

[0217] For each node in the storage structure mapping tree, whenever a new piece of node information is added to the node, the node information quantity of the node is updated once.

[0218] S702: Determine the nodes whose node information quantity is greater than the node quantity splitting threshold as nodes to be split.

[0219] The node number splitting threshold may be determined based on the total capacity of the node and a preset ratio, for example, the node number splitting threshold is 4 / 5 of the total capacity of the node.

[0220] For any node, if the amount of node information in the node is greater than a preset node quantity classification threshold, which means that the amount of node information in the node is close to saturation, the node is determined as a node to be split.

[0221] S703: Split the node to be split.

[0222] Optionally, the node to be split is split into several child nodes, and the several child nodes obtained by the splitting jointly store the node information in the node to be split.

[0223] In an exemplary embodiment, splitting a node to be split includes:

[0224] According to the level of the node to be split in the storage structure mapping tree, two splitting nodes corresponding to the node to be split are determined in the same level of the node to be split; and the node information in the node to be split is split and stored in the two splitting nodes.

[0225] At the same level of the node to be split, two corresponding split nodes are generated, and the node information stored in the node to be split is stored through the two split nodes. This means that for each node to be split, the number of nodes in the storage structure mapping tree will increase by at least one. This splitting method maintains the height of the storage structure mapping tree unchanged, increases the width of the storage structure mapping tree at the level where the node to be split is located, and supports the smooth synchronization of metadata to the storage structure mapping tree, while speeding up the query of user data through the storage structure mapping tree.

[0226] In an embodiment of the present application, the amount of node information of each node in the storage structure mapping tree is detected, and the nodes in which the amount of node information is greater than the node amount splitting threshold are determined as nodes to be split, and the nodes to be split are split in a timely manner so that the metadata in the storage space can be synchronized to the storage structure mapping tree in a timely manner.

[0227] In an exemplary embodiment, Figure 8 As shown, the node information in the node to be split is split and stored in two split nodes, including the following steps:

[0228] S801, writing node information of a node to be split into two idle data resource blocks in a storage space, and obtaining resource block information of the two idle data resource blocks into which the node information is written.

[0229] The sum of the capacities of the two idle data resource blocks is greater than the capacity of the node information in the node to be split, so as to support writing the node information in the node to be split into the two idle data resource blocks in the storage space respectively, and obtain the resource block information of each idle data resource block. In other words, the resource block information of each idle data resource block includes multiple pieces of node information.

[0230] Optionally, the node information in the node to be split is evenly divided into two parts to obtain two parts of child node information, and then the two parts of child node information are respectively written into two idle data resource blocks to obtain resource block information of each idle data resource block.

[0231] Optionally, according to the capacity of the idle data resource blocks, the node information in the node to be split is divided into target node information that matches the capacity of one of the idle data resource blocks, the target node information is stored in the idle data resource block, and then the remaining node information in the node to be split except the target node information is stored in another idle data resource block, so as to obtain the resource block information of each idle data resource block.

[0232] S802: Determine the splitting nodes corresponding to the two idle data resource blocks in the two splitting nodes according to the node information in the two idle data resource blocks.

[0233] Each idle data resource block includes multiple pieces of node information, and the content of each piece of node information includes a logical address and a physical address. In addition, in the embodiment of the present application, the multiple pieces of node information in each idle data resource block are correspondingly stored in one split node.

[0234] According to the node information in each idle data resource block, determine the logical address range corresponding to each idle data resource block, determine the logical address range corresponding to the two split nodes using the logical address ranges corresponding to the two idle data resource blocks, establish a corresponding relationship between the two idle data resource blocks and the two split nodes, and determine the split node corresponding to each idle data resource block.

[0235] S803, recording resource block information of each idle data resource block into the corresponding split node.

[0236] After determining the split node corresponding to each idle data resource block, the node information stored in each idle data resource block is recorded in the split node corresponding to the idle data resource block.

[0237] In an embodiment of the present application, the node information in the node to be split is written into two idle data resource blocks in the storage space, and the resource block information of the two idle data resource blocks of which the node information is written is obtained. According to the node information in the two idle data resource blocks, the splitting nodes corresponding to the two idle data resource blocks in the two splitting nodes are determined, and the resource block information of each idle data resource block is recorded in the corresponding splitting node, so as to realize the splitting in the node to be split from two dimensions: the form of the node and the content of the node.

[0238] In the process of splitting the nodes in the storage structure mapping tree, since there is an index relationship between the nodes in adjacent levels of the storage structure mapping tree, after the node is split, the node information in the upper node of the split node also needs to be synchronously updated.

[0239] In an exemplary embodiment, Fig. 9 As shown, the method further comprises the following steps:

[0240] S901, obtaining the physical address of each idle data resource block into which the node information is written.

[0241] In the process of writing the node information in the node to be split into two idle data resource blocks, for each idle data resource block, the physical position (starting position) of the first node information written in each idle data resource block and the physical position (ending position) of the last node information written in the idle data resource block are determined as the physical addresses corresponding to the node information written in the idle data resource block.

[0242] In another scenario, considering that the SSD under zns writes node information in the form of append write, in this case, for each free data resource block, the physical position (starting position) of the first node information written in each free data resource block and the offset length of the node information written in the free data resource block can be determined as the physical address corresponding to the node information written in the free data resource block.

[0243] S902: For any idle data resource block, establish a first mapping relationship between the physical address of the idle data resource block and the node information.

[0244] It should be known that an idle data resource block stores multiple pieces of node information of the node to be split, each piece of node information is a set of metadata, corresponding to a logical address, so the multiple pieces of node information stored in an idle data resource block also correspond to a logical address range.

[0245] For any idle data resource block, the physical address of the idle data resource block is associated with the logical address corresponding to the node information to obtain a first mapping relationship.

[0246] S903: Record the first mapping relationship in a node at an upper level of the split node corresponding to the idle data resource block.

[0247] In the node of the previous level of the split node, the mapping relationship of the node to be split is replaced with the first mapping relationship of each idle data resource block. Further, the number of node information of the node of the previous level of the split node is detected, and when the number of node information is greater than the node number splitting threshold, the node of the previous level is split. The specific implementation process can be seen in the above Figure 7 and Figure 8 In the illustrated embodiment, the above steps are executed in a loop until the root node of the storage structure mapping tree is modified, and the updating of the node information is terminated.

[0248] In an embodiment of the present application, for any idle data resource block, a first mapping relationship between the physical address of the idle data resource block and the node information is established, and the first mapping relationship is recorded in the upper-level node of the split node corresponding to the idle data resource block. Without relying on the internal mechanism of the solid-state drive, automatic update of the node information of each node in the storage structure mapping tree is achieved, thereby reducing the internal processing pressure of the solid-state drive under zns.

[0249] It can be seen from the above embodiments that when the data management request is of the data deletion type, the node information of the nodes in the storage structure mapping tree is monotonically decreasing, which will cause the nodes in the storage structure mapping tree to be empty and redundant nodes to appear. Based on this, it is necessary to merge the nodes in the storage structure mapping tree when the node information of the nodes meets the preset conditions.

[0250] In an exemplary embodiment, Fig.10 As shown, the management type of the data management request is a data deletion type; the node information of each node in the storage structure mapping tree is updated accordingly, and also includes:

[0251] S1001, detecting the amount of node information of each node in the storage structure mapping tree.

[0252] For each node in the storage structure mapping tree, whenever node information is added or deleted in the node, the node information quantity of the node is updated once.

[0253] S1002, for any node of the storage structure mapping tree, if the node information quantity of the node is less than the preset node quantity lower limit, and the sum of the node information quantity of the node and the node information quantity of the adjacent nodes is less than the preset node quantity merge threshold, then the node information of the node and the adjacent nodes is merged.

[0254] The lower limit of the number of nodes and the node number merging threshold can also be determined based on the total capacity of the nodes and a preset ratio. For example, the lower limit of the number of nodes is 1 / 5 of the total capacity of the nodes, and the node number merging threshold is 3 / 5 of the total capacity of the nodes.

[0255] For any node, if the amount of node information in the node is less than the preset lower limit of the node number, and the sum of the node information amount of the node and the node information amount of the adjacent nodes is less than the preset node number merging threshold, it means that the amount of node information in the node is close to empty, and the node information of the node and the adjacent nodes of the level to which the node belongs can be further merged.

[0256] In an embodiment of the present application, the number of node information of each node in the storage structure mapping tree is detected. If the number of node information of the node is less than a preset lower limit of the number of nodes, and the sum of the number of node information of the node and the number of node information of adjacent nodes is less than a preset node number merge threshold, the node information of the node and the adjacent nodes are merged in time to avoid redundant nodes in the storage structure mapping tree and improve the node validity of the storage structure mapping tree.

[0257] In an exemplary embodiment, Fig.11 As shown, merging the node information of a node and its adjacent nodes includes the following steps:

[0258] S1101, write node information of a node and node information of an adjacent node into the same idle data resource block in a storage space, and obtain resource block information of the idle data resource block.

[0259] The capacity of the idle data resource block is greater than the sum of the capacity of the node information of the node and the node information of the adjacent nodes, so as to support writing the node information of the node and the node information of the adjacent nodes into the idle data resource block, and determining the multiple node information written into the idle data resource block as the resource block information of the idle data resource block.

[0260] S1102, determining a merge node in the same level according to adjacent nodes and levels of the nodes in the storage structure mapping tree.

[0261] It should be noted that if the adjacent node and the node belong to the same level in the storage structure mapping tree, then the node after the adjacent node and the node are merged is also at the same level. Based on this, a merge node is determined at the same level of the adjacent node and the node.

[0262] S1103, record the resource block information into the merge node.

[0263] All resource block information of the idle data resource blocks is recorded in the merging node. For example, the resource block information is written into the merging node in order according to the order of the logical addresses in the resource block information from small to large.

[0264] In an embodiment of the present application, the node information of a node and the node information of an adjacent node are written into the same free data resource block in the storage space, and the resource block information of the free data resource block is obtained. The merged node is determined based on the adjacent nodes and the levels of the nodes in the storage structure mapping tree, and the resource block information is recorded in the merged node. While ensuring that the architecture of the storage structure mapping tree remains unchanged, the nodes are merged from two dimensions: the form of the node and the content of the node.

[0265] In the process of merging nodes in the storage structure mapping tree, since there is an index relationship between nodes in adjacent levels of the storage structure mapping tree, after the nodes are merged, the node information in the upper nodes of the merged nodes also needs to be synchronously updated.

[0266] In an exemplary embodiment, Fig.12 As shown, the method also includes:

[0267] S1201, obtaining the physical address of the idle data resource block of the write node information and the node information of the adjacent node, and obtaining the node information of the merged node.

[0268] In the process of writing the node information of the node and the adjacent nodes into the idle data resource block, the physical position (starting position) of the first node information written into the idle data resource block and the offset length of the node information written into the idle data resource block are determined as the physical address corresponding to the node information written into the idle data resource block.

[0269] Each piece of node information is a set of metadata, corresponding to a logical address. Obtaining the node information of the merged node means obtaining the logical address range corresponding to the node information stored in the merged node.

[0270] S1202: Establish a second mapping relationship between the physical address of the idle data resource block and the node information of the merged node.

[0271] It is emphasized again that a free data resource block stores multiple pieces of node information of a node and adjacent nodes. Each piece of node information is a set of metadata, corresponding to a logical address. Therefore, multiple pieces of node information stored in a free data resource block correspond to a logical address range.

[0272] The physical address of the idle data resource block is associated with the logical address corresponding to the node information to obtain a second mapping relationship.

[0273] S1203: Record the second mapping relationship in the node at the previous level of the merged node.

[0274] In the node of the previous level of the merged node, the mapping relationship of the node and the mapping relationship of the adjacent nodes are deleted, and the second mapping relationship is written. Further, the number of node information of the node of the previous level of the merged node is detected, and when the number of node information meets the node merging condition (the number of node information is less than the preset lower limit of the number of nodes, and the sum of the number of node information of the node and the number of node information of the adjacent nodes is less than the preset node number merging threshold), the node of the previous level and the adjacent nodes of the node of the previous level are merged. The specific implementation process can be found in the aforementioned Fig.10 and Fig.11 In the illustrated embodiment, the above steps are executed in a loop until the root node of the storage structure mapping tree is modified, and the updating of the node information is terminated.

[0275] In the embodiment of the present application, the physical address of the free data resource block of the write node information and the adjacent node node information is obtained, as well as the node information of the merged node, without relying on the internal mechanism of the solid-state drive, thereby realizing the automatic update of the node information of each node in the storage structure mapping tree, and reducing the internal processing pressure of the solid-state drive under zns.

[0276] In the metadata management process, for the front end, after writing the metadata of the storage space into the storage structure mapping tree, a successful data management response can be returned to the user. For the back end, it is necessary to further store the node information in the storage structure mapping tree in a node-like manner and record it in the hard disk. In this way, the physical address of the user data can be queried through the storage structure mapping tree, and the metadata stored in the storage space can be recycled to release the storage space in time.

[0277] In an exemplary embodiment, Fig.13 As shown, the method further comprises the following steps:

[0278] S1301, when the node information of each node in the storage structure mapping tree is updated, the node information quantity of each node and the uncured time of each node are obtained.

[0279] The number of node information of each node refers to the number of node information that has not been solidified in the node. The more node information there is, the more node information there is to be solidified. Correspondingly, the amount of metadata stored in the storage space is larger, and the more node information needs to be solidified. Conversely, the fewer node information there is, the less node information there is to be solidified. Correspondingly, the amount of metadata stored in the storage space is smaller, and the timing for solidifying the node information can be appropriately extended.

[0280] The uncured time of each node refers to the time period from the last curing of each node. The longer the uncured time is, the longer the metadata is stored in the storage space, and the more necessary it is to curate the node information. Conversely, the shorter the uncured time is, the shorter the metadata is stored in the storage space, and the timing for curing the node information can be appropriately extended.

[0281] In practical applications, the number of node information of each node and the uncured time of each node can be re-counted and stored in the hard disk of the storage system without ZNS after each node curing is completed. In this way, when the node information of each node in the storage structure mapping tree is updated, the number of node information of the node and the uncured time of each node can be directly read from the hard disk.

[0282] S1302: Reclaim metadata stored in the storage space according to the amount of node information of each node and the uncured time of each node to release the storage space.

[0283] The node information quantity of each node and the unsolidified time of each node are compared with the metadata recycling conditions. If both the node information quantity and the unsolidified time meet the recycling conditions, the node information is solidified and the metadata stored in the storage space is recycled.

[0284] Optionally, the recycling condition includes that the number of node information is not 0, which is equivalent to solidifying the node information for each new node information added, and deleting the log record (ie, metadata) of the solidified node information in the storage space.

[0285] Optionally, the recycling condition includes a solidification interval of 10 seconds, which is equivalent to solidifying the newly added node information within 10 seconds from the current time every 10 seconds, and deleting the log record (ie, metadata) of the solidified node information in the storage space.

[0286] In an embodiment of the present application, when the node information of each node in the storage structure mapping tree is updated, the node information quantity of each node and the unsolidified time of each node are obtained, and when the node information quantity and the unsolidified time meet the metadata recycling conditions, the metadata stored in the storage space is recycled to release the storage space in time, avoid insufficient storage space of the storage system, and ensure the security and integrity of the data in the storage system.

[0287] The determination of metadata recycling in the storage space is further described below through an embodiment.

[0288] In an exemplary embodiment, Fig.14 As shown, according to the amount of node information of each node and the uncured time of each node, the metadata stored in the storage space is recycled, including the following steps:

[0289] S1401, for any node, when the amount of node information of the node reaches a second preset threshold, and / or the uncured time reaches a second time threshold, the node information in the node is cured.

[0290] For any node, if the amount of node information of the node reaches the second preset threshold, and the unsolidified time does not reach the second time threshold, the unsolidified node information in the node will be aggregated, and the aggregated node information will be uniformly persisted to the hard disk to realize the solidification of the node information.

[0291] If the unsolidified time reaches the second time threshold, and the number of node information does not reach the second preset threshold, the unsolidified node information in the node is aggregated, and the aggregated node information is uniformly persisted to the hard disk to realize the solidification of the node information.

[0292] S1402: If all node information is solidified, the metadata stored in the storage space is recycled.

[0293] During the solidification process of the node information, the solidification progress of the node information in the node is monitored in real time or periodically. When the solidification of all the node information is completed, the metadata stored in the storage space is uniformly recovered.

[0294] In an embodiment of the present application, when the amount of node information reaches a second preset threshold, and / or the unsolidified time reaches a second time threshold, the node information in the node is solidified, and when the node information is solidified, the metadata stored in the storage space is promptly recovered. On the basis of persistent processing of the node information, the solidification frequency of the node information is reduced as much as possible to improve system performance.

[0295] The metadata management method includes two stages: metadata generation and management. The above embodiment describes the metadata management stage (metadata writing into storage space, writing into storage structure mapping tree, and solidification) in detail. Next, the metadata generation process is described.

[0296] In an exemplary embodiment, Fig.15 As shown, generating target metadata according to the user data carried in the data management request and the multiple storage spaces pre-divided on the solid state hard disk in the storage system includes the following steps:

[0297] S1501, determining a storage space for user data from multiple storage spaces.

[0298] The storage system maintains a bitmap index information for each storage space, which is used to characterize the busy or idle state of each resource block in the storage space. In this case, by querying the bitmap information of each storage space, the storage space with idle resource blocks can be selected as the storage space for storing user data.

[0299] In an exemplary scenario, determining a storage space for user data from multiple storage spaces includes the following steps: when there is non-free space in the multiple storage spaces, obtaining the data type and size of the user data; and determining a storage space in the multiple storage spaces that matches the data type and size of the user data as the storage space for the user data.

[0300] In the case that there is non-free space in the plurality of storage spaces, the non-free storage space includes a data storage space for storing user data and a storage space for storing metadata.

[0301] When determining the storage space for user data, candidate data storage space can be determined from the non-free data storage space based on the data type of the user data (i.e., the user data type), and then based on the remaining space of the candidate data storage space, a target data storage space whose remaining space is greater than the size of the user data is determined as the storage space for the user data.

[0302] Alternatively, candidate data storage spaces with remaining space larger than the user data size may be determined based on the remaining space of each non-free space, and then target data storage space of the user data type may be determined from the candidate data storage space as the storage space for the user data.

[0303] In an embodiment of the present application, when determining the storage space for storing user data, based on the data type and size of the user data, the storage space for storing user data is preferentially determined from the non-free space to avoid storage space fragmentation. At the same time, the physical characteristics of the solid-state drive data appending writing under the zone architecture are adapted to maximize the performance of the solid-state drive.

[0304] In another exemplary scenario, determining a storage space for user data from multiple storage spaces includes the following steps: when multiple storage spaces are all free spaces, obtaining a life count of each storage space; the life count is used to characterize the number of erase and write times of the candidate storage space; and determining the storage space corresponding to the minimum life count as the storage space for user data.

[0305] It should be known that the number of erasures of a solid-state drive is limited, that is, the number of erasures of the storage space divided by the solid-state drive is limited. Based on this, the number of erasures of each storage space in the storage system is recorded. For example, for each candidate storage space, the life count of the candidate storage space is updated once each time it is fully allocated and before being erased. In an embodiment of the present application, the life count of each storage space in the storage system is stored on a preset non-zone SSD hard disk or disk, and the storage area supports in-situ modification of the corresponding information.

[0306] Optionally, the life count may be recorded starting from 0, and each time allocation is completed, the life count increases by 1. The smaller the life count of the storage space, the less times the storage space is erased, and the storage space can be given priority as the target storage space for storing user data; the larger the life count of the storage space, the more times the storage space is erased, and the more it is necessary to avoid over-allocation of the storage space.

[0307] When multiple storage spaces are all free spaces, since the completely empty storage spaces do not store data and thus have no preset data type, the determined completely empty storage spaces can be used as multiple candidate storage spaces that match the data type of the user data.

[0308] When there are multiple free storage spaces, the life counts of the storage spaces are compared to determine the storage space corresponding to the minimum life count, that is, the free storage space that has been erased the least number of times, as the target storage space for storing user data.

[0309] In an embodiment of the present application, when multiple storage spaces are all free spaces, the life count of each storage space is obtained to determine the number of erase and write times of the candidate storage space, and then the storage space corresponding to the minimum life count is determined as the storage space for user data, thereby ensuring to the greatest extent possible that the number of erase and write times of each storage space in the storage system is balanced, thereby improving the performance of the storage system.

[0310] S1502: Generate target metadata according to the logical address of the user data and the storage space of the user data.

[0311] The logical address of the user data is carried in the data management request, so that the storage system can process the target data user data based on the logical address.

[0312] The user data is written into the target storage space to obtain a physical address for storing the user data, and then a mapping relationship between the physical address and the logical address is determined as the target metadata of the user data.

[0313] In an embodiment of the present application, a storage space for user data is determined from multiple storage spaces, and then target metadata is generated according to the logical address of the user data and the storage space of the user data. The process of determining the target metadata includes two stages: determining the logical address of the user data and determining the storage location of the user data in the storage space. The two stages are tightly coupled, which improves the accuracy of the target metadata and provides a reliable positioning basis for subsequent modification of the user data in the target storage space.

[0314] In an exemplary embodiment, Fig.16 As shown, the aforementioned step S1502 "generating target metadata according to the logical address of the user data and the storage space of the user data" includes the following steps:

[0315] S1601, write user data into an idle data resource block in a storage space for user data, and obtain a physical address of the idle data resource block into which the user data is written.

[0316] If the storage space for user data is a non-completely empty storage space currently in use, the user data is written to the free data resource block of the storage space in an append-write manner, and the identification information (Zone ID) of the storage space and the offset starting position and length information of the user data in the storage space are recorded as the physical address of the user data.

[0317] If the storage space for user data is completely empty, the starting point of the storage space is determined as the offset start position of the user data in the storage space, and the identification information (Zone ID) of the storage space and the offset length information of the user data in the storage space are recorded as the physical address of the user data.

[0318] S1602: Establish a mapping relationship between the logical address and the physical address.

[0319] The logical address of the user data is associated with the physical address obtained in the above step S1601 to obtain a mapping relationship about the user data. The logical address in the mapping relationship is oriented to the user and is used to record the user data storage location perceived by the user. The physical address in the mapping relationship is oriented to the storage system backend and is used to record the actual storage location of the user data in the storage system.

[0320] S1603: Determine the mapping relationship as target metadata.

[0321] In an embodiment of the present application, user data is written into a free data resource block in a storage space, and the physical address of the free data resource block where the user data is written is obtained, a mapping relationship between the logical address and the physical address is established, and target metadata is obtained. In this way, the logical address perceived by the front end and the physical address perceived by the back end of the same user data are associated to support rapid query through the logical address and locate the data at the corresponding physical address, thereby improving data processing speed.

[0322] In actual applications, abnormal situations may occur randomly during the management of target metadata, such as power outages, service terminations, system restarts, etc. In this case, in order to avoid data loss in the storage system, it is necessary to back up the data in a timely manner to ensure data integrity and security.

[0323] In an exemplary embodiment, the method includes:

[0324] When a corresponding management operation is performed on the target metadata, if an abnormality occurs in the storage system or storage service, the management operation on the target metadata is interrupted.

[0325] During the process of executing corresponding management operations on the target metadata, once an abnormality is detected in the storage system, such as abnormal shutdown or power failure of the storage system, or abnormal conditions such as storage service disconnection, the management operation on the target metadata is interrupted.

[0326] The embodiments of the present application do not limit the monitoring method of the storage system or storage service. For example, the response time of the storage system or storage service is monitored. If the response time is greater than a preset time threshold, it is determined that an abnormality has occurred in the storage system or storage service, or abnormal information automatically reported by the storage system or storage service when an abnormality occurs is received. If the abnormal information is received, it is determined that an abnormality has occurred in the storage system or storage service.

[0327] In the embodiment of the present application, when an abnormality occurs in the storage system or storage service, the management operation on the target metadata is interrupted in time to avoid wasting the management resources of the storage system.

[0328] In an exemplary embodiment, the method further comprises:

[0329] If it is detected that the storage system or storage service has returned to normal, the storage service is instructed to continue to perform management operations on the target metadata, and replay the metadata in the storage space to the memory structure of the storage system, and synchronize the metadata content in the memory structure to the storage structure mapping tree that matches the metadata content.

[0330] When it is detected that the storage system has returned to normal, such as the storage system has been restarted, or the storage service has returned to normal, such as the storage service has been put online, the storage service is automatically started to continue the management operations on the target metadata before the interruption, and the validity of the metadata content in the memory structure is judged to determine the valid metadata content, and the determined metadata content is synchronized to the storage structure mapping tree.

[0331] In an embodiment of the present application, when it is detected that the storage system or storage service has returned to normal, the storage service is automatically started to instruct the storage service to continue to perform management operations on the target metadata, play back and synchronize the metadata, and ensure the data security and consistency of the storage system.

[0332] While managing user data and target metadata of the user data, the storage system may also receive a data read request to the storage system to support the user to read the user data recorded in the storage system.

[0333] In an exemplary embodiment, Fig.17 As shown, the method includes:

[0334] S1701, in response to a data read request in a storage system, obtaining a target logical volume to which the data to be read belongs in the storage system according to a logical address of the data to be read carried in the data read request.

[0335] The data read request carries the logical address of the data to be read, so that the storage system can verify the validity of the logical address. If the verification passes, the physical address of the data to be read is determined based on the logical address, and the data stored corresponding to the physical address is used as the data read response.

[0336] In response to a data read request in the storage system, a field analysis is performed on a logical address of the to-be-read data carried in the data read request to determine a target logical volume to which the to-be-read data belongs in the storage system.

[0337] S1702: Determine the physical address corresponding to the logical address of the data to be read from the storage structure mapping tree of the target logical volume.

[0338] Traverse each node in the storage structure mapping tree of the target logical volume to determine the node information corresponding to the logical address of the data to be read. If it exists, determine the physical address in the node information as the storage address for storing the data to be read.

[0339] S1703, displaying the data in the physical address corresponding to the logical address of the data to be read.

[0340] The data stored corresponding to the physical address is presented to the user as the data to be read.

[0341] In an embodiment of the present application, in response to a data read request in a storage system, according to the logical address of the data to be read carried in the data read request, the target logical volume to which the data to be read belongs in the storage system is obtained, the physical address corresponding to the logical address of the data to be read is determined from the storage structure mapping tree of the target logical volume, and the data in the physical address corresponding to the logical address of the data to be read is displayed. The storage structure mapping tree is used to clearly display the index relationship between the metadata of the target logical volume in a hierarchical manner, so as to quickly locate the physical address of the data to be read, and then quickly and accurately locate the data to be read, thereby improving the data reading response speed.

[0342] In an exemplary embodiment, a storage system for implementing the above-mentioned metadata management method is also provided, the storage system includes a resource management module, a resource allocation module, a log management module, a disk layout management module, and a metadata management module. Next, each module is described in detail:

[0343] (1) Resource management module.

[0344] The resource management module is mainly used to manage the zones of each SSD hard disk in the storage system, record the life count management of all zones, use Bitmap information to record the usage of resource blocks (Block) in each zone, and manage the index Bidx of the Bitmap location, as well as the GC management of the zone.

[0345] It should be noted that due to the append-write feature of Zone, the Bidx information describing the life count of a Zone and the location of the Zone's Bitmap, as well as the inode information of the logical volume and the information of the Zone currently used for logging are not recorded on the Zone, that is, the ZLC RG, Bidx RG, Inode RG and JNLZ RG are all located on a non-Zone SSD hard disk or disk. These four areas can support in-situ modification of the corresponding information.

[0346] Take the write process as an example, see Figure 18-Figure 19 This is a resource usage management flowchart of the resource management module in the write process. Taking writing three data as an example, the resource allocator obtains idle resources such as Fig.18 The three idle data resource blocks 1801-1803 in Figure 1Write data (which can be user data or metadata) to the data storage space in the log storage space, then record log items 1901-1903 in the log storage space, and record resource information such as 1801-1803 in it. After log items 1901-1903 are written successfully, it marks that the three copies of data are stored successfully. After log items 1901-1903 are written successfully, further modify the mapping information in the corresponding mapping tree, such as Fig.18 In the above example, they correspond to modifying nodes 2001, 2002, and 2003 respectively.

[0347] Next, the nodes to which 2001 belongs, and the nodes to which 2002 and 2003 belong also need to be written to the hard disk and allocated. Fig.19 The two free data resource blocks 1804 and 1805 shown are written to the hard disk, and then log items 1904 and 1905 are recorded to record the corresponding resource information containing 1804 and 1805 respectively, and then log items 1906 and 1907 containing the mapping relationship between the above two nodes and 1904 and 1905 are also included in the log storage space.

[0348] When each storage space in the storage system bootstraps, the current resource management information is obtained, including: the management information of the used Zone: bitmap index. On this basis, the resource management module is responsible for the resource recycling management of the Zone and the life cycle management of the Zone.

[0349] The resource recycling management steps of the zone include: checking the resource usage of the specified zone according to the bitmap information of the specified zone. If there is no valid data stored, the specified zone can be directly recycled; checking the resource usage of the specified zone according to the bitmap information of the specified zone. If the valid data stored is less than the preset threshold, the GC process is started. After the data migration is completed, the specified zone can be recycled;

[0350] The life cycle management steps of a zone include: the life count is increased every time a zone is completely written and erased; when an idle zone is selected for use, the idle zone with the smallest life count is preferred.

[0351] (2) Resource allocation module.

[0352] According to the zone information provided by the resource management module and the bitmap of the block usage in the zone, the idle zone and the idle block information in the zone are selected according to the needs of the resource usage request for user IO or system resource turnover.

[0353] (3) Log management module.

[0354] The log management module mainly completes the rapid recording of the following information, completes the rapid response to write operations and major information in the system, and completely saves the information, including the following management contents:

[0355] Resource statistics log: used to record the log of bitmap modifications of the specified zone.

[0356] Mapping management log: a log used to modify mapping relationships.

[0357] Log transaction management: There are two types of log transactions: ① user transactions; ② transactions written to the log zone's disk; multiple user transactions are saved in one disk transaction.

[0358] Self-explanatory characteristics of disk information: ① The mapped log information includes at least the LUN ID information, LBA, target Zone ID, offset within the Zone, and length information; ② The Zone bitmap log information includes at least the Zone ID, offset within the Zone and length, as well as the occupied / released flag; ③ User transactions include at least transaction description information and log items: transaction UUID, total transaction length, number of log items, and log items; ④ Disk transactions: at least include transaction description information, number of user transactions, user transactions, and consistent head and tail identifiers.

[0359] It should be noted that since the log is self-explanatory, the log zone does not need to use a bitmap to record the usage of the zone.

[0360] In the management process of the log management module, a two-stage management method is adopted: the first stage: write user data and confirm its completion, and report an error if it fails; the second stage: if the user data is written successfully, the metadata log of the written user data is recorded, and if it fails, the user data writing error is reported to the writer of the previous user data; otherwise, the user data writing success is returned to the writer of the user data.

[0361] In actual application scenarios, under normal circumstances, the recorded logs will be recycled after the information in the logs is saved to a preset location, by recording the smallest ID of a currently valid user transaction of a disk transaction.

[0362] In the event of system or service exceptions or service migration, it is necessary to replay the unprocessed logs, parse out valid user transactions by scanning the log zone, and reconstruct the log contents into the relevant memory structure.

[0363] When the system or service restarts abnormally (service migration is equivalent to abnormal service restart), there are residual logs on the hard disk that record certain operations that have occurred, such as user write operations. In order to ensure that subsequent users can read the previously written data information, the location information of the user-written data recorded in the log needs to be restored to the Mapping tree for easy search; the log zone also records information related to resource management, which is a modification of information related to resource management. Fig. 20 The figure shows the log items 2001-2005 recorded before the exception occurs. After the exception occurs, the log service starts and reads 2001-2005 from the log zone. After necessary verification, the validity of 2001-2005 is confirmed, and then the Fig.21 During playback.

[0364] Fig.21 After 2001-2005 is read out, it will be instantiated into the system memory and exist in the form of a queue (QUEUE in the figure), such as Fig.21 As shown in 2101-2105, then according to the information recorded in the log items 2101-2105, such as LBA information or Zone bitmap modification information, the location of the corresponding modified data is found and loaded.

[0365] In the case of an abnormal restart of the system or service, the log items are played back to the system memory. Before starting to provide services, the modification information in these log items is synchronized to the mapping information or bitmap resource management structure loaded from the hard disk. In the case of an abnormal restart, the log items in the queue are restored to the mapping tree. Fig. 22 As shown, three log items in the queue are restored to the intermediate node, and two log items in the queue are restored to the root node.

[0366] (4) Disk layout management module.

[0367] Fig.23 This example shows how to use Zone. Fig.23 The log storage space (Zone-JNL) records the location information of user data Blk0, Blk1 to Blkm and the LBA information of the corresponding logical volume, such as Fig.23 The log storage space is shown as Tp 1, Tp2, and Tp3; Fig.23 The storage space A records the mapping relationships Mp that directly index to the free data resource blocks. These mapping relationships Mp are arranged in the order of LBA and stored in a free data resource block in the storage space A. Fig.23The storage space B records the correspondence information between the range of LBAs spanned by the mapping relationship shown in the storage space A and the position of the Block in the storage space A of the mapping relationship shown.

[0368] (5) Metadata management module.

[0369] Resource allocation: Allocate free resource blocks from the specified zone for writing data. Since writing data to the zone is an append operation, the zone's resources are allocated monotonically.

[0370] Resource mapping management: create mapping, delete mapping, modify mapping.

[0371] Memory structure:

[0372] Mapping tree: Each LUN has a Mapping tree, whose only entry is recorded in the LUN's Inode, which is used to quickly find the memory cache structure from the user's LBA to the data storage location; the Mapping tree adopts a B+ tree structure, and nodes at different levels of the Mapping tree are usually not stored in the same zone. This is because the update frequency of nodes at different levels is different. In comparison, the update frequency of the root node gradually decreases from the leaf node of the Mapping tree. The reason is the two-stage method of log management adopted.

[0373] Figure 24-28 A schematic diagram of a normal writing process is shown. Fig.24 This is a schematic diagram of the data writing process. Fig.24 It shows a new data write 2401, two modification writes 2402 and 2403, there is no mapping relationship corresponding to 2401 in the Mapping tree shown in 24, 242 and 243 are the mapping relationships for 2402 and 2403 in the Mapping tree, but because 2402 and 2403 can only be written to new locations, it constitutes a modification write of 242 and 243.

[0374] Fig.25 This is a schematic diagram of the metadata log writing process. After 2401, 2402 and 2403 are successfully written, the corresponding log items 2501-2503 are generated. At this time, the persistence process of data 2501-2503 has been completed. In this case, the log items 2501-2503 can be further modified and synchronized to the mapping tree. See Fig.25 251-253 in the , and after the synchronization is successful, the data writer is returned a reply message indicating that the data has been written successfully. In this way, the new location of the newly written data can be found in the Mapping tree to avoid data inconsistency errors.

[0375] like Fig.26As shown, Fig.26 The schematic diagram of log application to the memory data structure is as follows: log items 2501-2503 are synchronously modified to the mapping tree, corresponding to 251-253 in the node. At this time, the node information 251-253 in the node can be further saved to the hard disk, and the information in the modified node of the Mapping tree is also recorded in the hard disk, so as to recycle the log items in the log storage space.

[0376] Based on the above storage system, the modification method of the Mapping tree in the metadata management method is further explained: Taking the modification of the Mapping tree triggered by the user write operation as an example, the order of modifying the Mapping tree starts from the leaf node, such as Fig. 27 When the Mp2701 record in the middle node 2700 is modified, a modification log of 2701 in 2700 will be recorded in the log storage space first. At this time, the 2700 with the modified 2701 is not written to the hard disk (a zone) in real time. Instead, the 2700 with the modified 2701 is written to the hard disk only after the preset conditions are met. The usual conditions are that multiple Mp modifications are gathered in 2700 or the Mp in 2700 is modified and reaches a certain timeout period, or it needs to be forced to write to the hard disk, such as before the system shuts down. By analogy, writing 2700 to the hard disk will cause the modification of 2800, and 2800 also needs to meet the same conditions as writing 2700 to the disk. Repeat the same process, and finally cause the root information of the root node 2900 of the Mapping in the Inode to be modified.

[0377] Next, the iterative update process of the Mapping tree is further explained, including the following steps:

[0378] (1) Allocate the required free data resource blocks on a zone through the resource allocator.

[0379] When selecting a zone, you can give priority to the zone currently in use according to the required type; or, when the current service is just started, select the zone from the selected Zone RG plus the zone whose resources have not been fully allocated when the service was last running, and select the required zone according to the required type; or select the completely empty zone with the smallest life count from all currently known zones and record it in the Zone RG.

[0380] When the life count is updated, the number of times all zones have been erased (queried through relevant commands of the SSD) can be recorded in the ZLC RG when the system is initialized; the life count in the ZLCRG is updated once every complete allocation and before erasure.

[0381] When allocating idle data resource blocks, you can obtain the Zone usage resources and allocate idle resources on demand from the Zone's current resource allocation point; if the remaining idle resources are sufficient, adjust the Zone's resource allocation point according to the allocated quantity and return the allocation result; if they are insufficient, return allocation failure.

[0382] When counting the resources used by a zone, it is necessary to record the resource change log of the zone involved when data is written or the mapping is deleted - the modification log of the bitmap; resources released before the resource allocation point of the zone do not record the allocatable resources.

[0383] (2) Write the data written to the LBA covered by the node into the free data resource block.

[0384] It should be noted that deleting mapping information can be regarded as a special write, and the node can be a leaf node, an intermediate node or a root node.

[0385] If the write fails, when the node is a leaf node, it will reply failure, and non-leaf nodes will try again later.

[0386] If the write is successful, the LBA, Zone ID, offset and length within the Zone of the LUN involved and necessary description information are recorded in the log zone in the form of log items. If the log item is recorded successfully, the data write is replied successfully.

[0387] (3) Repeat the above writing steps for the node in (2) for multiple times. If the mapping information contained in the node is greater than the preset number threshold, or the mapping information in the node has not been recorded in the hard disk in the form of the node's hard disk storage for a long time, after the preset timeout period is reached, the node information is saved to the hard disk according to the two-stage log method. The two-stage method used here will generate a modification log entry for the upper node of the current node. If successful, the log entry in step (2) is recycled. If failed, it will be retried later.

[0388] (4) During the mapping tree update process, if the amount of mapping information in a node is less than a preset threshold, and the amount of mapping information in a node (pre-order or post-order) among the adjacent nodes in the same layer is still less than a certain threshold after the amount of mapping information in the current node, the node merging method can be called according to the strategy.

[0389] Among them, the node merging strategy includes: checking whether the LBA address spaces covered by the two nodes to be merged are adjacent; judging whether the sum of the number of mapping information in the two nodes is greater than a preset threshold, if it is greater than the threshold, no merging will be performed and a merging failure will be returned; if it is less than the threshold, a free resource block will be allocated, and the merged lower node data will be written to the free resource block, and then a log entry for recording the allocated free resource block will be prepared; if the merged node data is successfully written, the log entry pointing to the mapping information of the two nodes in the Mapping tree will be modified, otherwise an error will be returned.

[0390] (5) During the mapping tree update process, if the amount of mapping information in a node is greater than a preset threshold, the node splitting method can be called according to the strategy.

[0391] Among them, the node splitting strategy includes: checking whether the amount of mapping information of the node to be split is greater than a preset threshold. If it is less than the threshold, no splitting will be performed and a splitting failure will be returned; if it is greater than the threshold, two free resource blocks will be allocated, and the data of the next node after the split will be written to the corresponding free resource blocks respectively, and then a log entry for recording the allocated free resource blocks will be prepared; if the data of the node after the split is successfully written, the log entry pointing to the mapping information of this node in the Mapping tree will be modified. If it fails, an error will be returned.

[0392] (6) Repeat the process of (2) to (5) for the Mapping tree nodes involved in the log entries generated by the two-stage log method described in (5) until the modification of the root node is recorded in the Inode of the LUN.

[0393] In the embodiment of the present application, on the basis of pre-dividing the solid-state hard disk in the storage system into different types of storage space, based on different types of storage space, the user data is processed to obtain the target metadata, and then the target metadata is managed again based on different types of storage space, so as to realize two-stage data management, so as to give full play to the performance of the solid-state hard disk under the zns architecture. In addition, since different types of storage spaces store different types of data, it is equivalent to storing the user data and the target metadata in different storage spaces in consideration of the different life cycles of the user data and the target metadata, so as to manage different types of data respectively using different storage spaces. In addition, when the target metadata is managed by the storage space obtained after the solid-state hard disk is divided, the storage structure mapping tree corresponding to the user data is further combined to realize the multi-level management of the target metadata, and then realize the closed loop of the metadata management process, while improving the management efficiency of the metadata, reducing the complexity of the internal mechanism of the solid-state hard disk.

[0394] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0395] Based on the same inventive concept, the embodiment of the present application also provides a metadata management device for implementing the metadata management method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more metadata management device embodiments provided below can refer to the limitations of the metadata management method above, and will not be repeated here.

[0396] In an exemplary embodiment, Fig.28 As shown, a metadata management device is provided, including: a metadata acquisition module 2801, a metadata writing module 2802 and a metadata management module 2803, wherein:

[0397] The metadata acquisition module 2801 is used to respond to a data management request in the storage system and generate target metadata of the user data according to the user data carried in the data management request and a plurality of storage spaces pre-divided on the solid state drive in the storage system;

[0398] The metadata writing module 2802 is used to write the target metadata into the storage space according to the plurality of storage spaces and the usage frequency of the target metadata;

[0399] The metadata management module 2803 is used to perform corresponding management operations on the target metadata based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system.

[0400] In an exemplary embodiment, the metadata acquisition module 2801 includes: a life cycle acquisition unit and a life cycle matching unit, wherein:

[0401] A life cycle acquisition unit, used to acquire the life cycles of multiple storage spaces;

[0402] The life cycle matching unit is used to match the usage frequency of the target metadata with the life cycle of each storage space, and write the target metadata into the storage space with successful matching.

[0403] In an exemplary embodiment, the metadata acquisition module 2801 includes: a historical frequency acquisition unit, a frequency comparison unit and a frequency matching unit, wherein:

[0404] A historical frequency acquisition unit, used to acquire the usage frequency of historical metadata in multiple storage spaces;

[0405] A frequency comparison unit, used to compare the usage frequency of the target metadata with the usage frequency of the historical metadata in the plurality of storage spaces, and determine the storage space with the smallest usage frequency difference with the target metadata from the plurality of storage spaces;

[0406] The frequency matching unit is used to write the target metadata into the storage space with the smallest usage frequency difference.

[0407] In an exemplary embodiment, the metadata management module 2803 includes: a node update unit and a management response unit, wherein:

[0408] A node updating unit, used to update the node information of each node in the storage structure mapping tree accordingly based on the metadata in the storage space and the management type of the data management request;

[0409] The management response unit is used to return a management success response of the target metadata when the node information of each node in the storage structure mapping tree is updated.

[0410] In an exemplary embodiment, the node update unit includes: an update information acquisition subunit and an update operation execution subunit, wherein:

[0411] An update information acquisition subunit is used to acquire the amount of metadata in the storage space and the timeout period during which the metadata in the storage space is not synchronized to the storage structure mapping tree;

[0412] The update operation execution subunit is used to update the node information of each node in the storage structure mapping tree accordingly according to the management type of the data management request and the metadata in the storage space when the amount of metadata reaches a first preset threshold and / or the timeout period reaches a first time threshold.

[0413] In an exemplary embodiment, the update operation execution subunit is used to determine the node to be updated according to the usage frequency of the target metadata and the hierarchy of the storage structure mapping tree, and write the target metadata into the node to be updated if the management type of the data management request is a data write type; if the management type of the data management request is a data deletion type, determine the node to be updated according to the logical address of the target metadata, and delete the target metadata in the node to be updated; if the management type of the data management request is a data modification type, determine the initial metadata corresponding to the target metadata in the storage structure mapping tree according to the logical address of the target metadata, and replace the initial metadata with the target metadata.

[0414] In an exemplary embodiment, the management type of the data management request is a data write type; the update operation execution subunit further includes: a split information detection subunit, a split node determination subunit and a node split subunit, wherein:

[0415] A split information detection subunit, used to detect the amount of node information of each node in the storage structure mapping tree;

[0416] A split node determination subunit, used to determine nodes whose node information quantity is greater than a node quantity splitting threshold among the nodes as nodes to be split;

[0417] The node splitting subunit is used to split the node to be split.

[0418] In an exemplary embodiment, the node splitting subunit is also used to determine two splitting nodes corresponding to the node to be split in the same level of the node to be split according to the level of the node to be split in the storage structure mapping tree; and split the node information in the node to be split and store it in the two splitting nodes.

[0419] In an exemplary embodiment, the node splitting sub-unit is also used to write the node information in the node to be split into two idle data resource blocks in the storage space, and obtain the resource block information of the two idle data resource blocks in which the node information is written; determine the splitting nodes corresponding to the two idle data resource blocks in the two split nodes according to the node information in the two idle data resource blocks; and record the resource block information of each idle data resource block in the corresponding splitting node.

[0420] In an exemplary embodiment, the node splitting sub-unit is also used to obtain the physical address of each idle data resource block in which the node information is written; for any idle data resource block, establish a first mapping relationship between the physical address of the idle data resource block and the node information; and record the first mapping relationship in the upper-level node of the split node corresponding to the idle data resource block.

[0421] In an exemplary embodiment, the management type of the data management request is a data deletion type; the update operation execution subunit further includes: a merge information detection subunit and a node merge subunit, wherein:

[0422] A merge information detection subunit is used to detect the amount of node information of each node in the storage structure mapping tree;

[0423] The node merging subunit is used to merge the node information of any node in the storage structure mapping tree if the node information quantity of the node is less than the preset node quantity lower limit, and the sum of the node information quantity of the node and the node information quantity of the adjacent nodes is less than the preset node quantity merging threshold.

[0424] In an exemplary embodiment, the node merging subunit is also used to write the node information of the node and the node information of the adjacent node into the same free data resource block in the storage space, and obtain the resource block information of the free data resource block; determine the merged node in the same level according to the levels of the adjacent nodes and the nodes in the storage structure mapping tree; and record the resource block information in the merged node.

[0425] In an exemplary embodiment, the node merging subunit is also used to obtain the physical address of the idle data resource block of the write node information and the node information of the adjacent node, and to obtain the node information of the merged node; establish a second mapping relationship between the physical address of the idle data resource block and the node information of the merged node; and record the second mapping relationship in the upper-level node of the merged node.

[0426] In an exemplary embodiment, the metadata management device further includes: a fixed information acquisition module and a metadata recovery module, wherein:

[0427] A solidification information acquisition module, used to acquire the node information quantity of each node and the unsolidified time of each node when the node information of each node in the storage structure mapping tree is updated;

[0428] The metadata recycling module is used to recycle the metadata stored in the storage space according to the amount of node information of each node and the uncured time of each node to release the storage space.

[0429] In an exemplary embodiment, the metadata recovery module includes: a fixed information determination unit and a recovery operation execution unit, wherein:

[0430] A solidification information judgment unit, configured to solidify the node information in any node when the amount of node information in the node reaches a second preset threshold value and / or the unsolidified time reaches a second time threshold value;

[0431] The recycling operation execution unit is used to recycle the metadata stored in the storage space if the node information is completely solidified.

[0432] In an exemplary embodiment, the metadata acquisition module 2801 includes: a storage space determination unit and a metadata generation unit, wherein:

[0433] a storage space determining unit, configured to determine a storage space for user data from a plurality of storage spaces;

[0434] The metadata generation unit is used to generate target metadata according to the logical address of the user data and the storage space of the user data.

[0435] In an exemplary embodiment, the storage space determination unit includes: an attribute information acquisition subunit and an attribute information matching subunit, wherein:

[0436] The attribute information acquisition subunit is used to obtain the data type and size of the user data when there is non-free space in the multiple storage spaces;

[0437] The attribute information matching subunit is used to determine the storage space that matches the data type and size of the user data among the multiple storage spaces as the storage space of the user data.

[0438] In an exemplary embodiment, the storage space determination unit includes: a life count acquisition subunit and a life count comparison subunit, wherein:

[0439] A life count acquisition subunit is used to acquire the life count of each storage space when multiple storage spaces are all free spaces; the life count is used to represent the number of times the candidate storage space is erased and written;

[0440] The life count comparison subunit is used to determine the storage space corresponding to the minimum life count as the storage space for user data.

[0441] In an exemplary embodiment, the metadata generation unit includes: a user data writing subunit, a mapping relationship establishment subunit and a metadata determination subunit, wherein:

[0442] A user data writing subunit, used to write user data into an idle data resource block in the user data storage space, and obtain a physical address of the idle data resource block into which the user data is written;

[0443] A mapping relationship establishing subunit, used to establish a mapping relationship between a logical address and a physical address;

[0444] The metadata determination subunit is used to determine the mapping relationship as the target metadata of the user data.

[0445] In an exemplary embodiment, a metadata management device includes: a mapping tree determination module, which is used to determine the storage structure mapping tree corresponding to the logical volume identifier as the storage structure mapping tree corresponding to the user data in the storage system based on the logical volume identifier carried in the data management request; a storage structure mapping tree is pre-configured for each logical volume in the storage system.

[0446] In an exemplary embodiment, the metadata management device further includes: a management interruption module, which is used to interrupt the management operation on the target metadata if an abnormality occurs in the storage system or storage service when performing corresponding management operations on the target metadata.

[0447] In an exemplary embodiment, the metadata management device also includes: a log playback module, which is used to instruct the storage service to continue to perform management operations on the target metadata when it is detected that the storage system or storage service has returned to normal, and to play back the metadata in the storage space to the memory structure of the storage system, and synchronize the metadata content in the memory structure to the storage structure mapping tree that matches the metadata content.

[0448] In an exemplary embodiment, the metadata management device further includes: a request receiving module, an address determining module and a data display module, wherein:

[0449] A request receiving module, used to respond to a data read request in the storage system and obtain a target logical volume to which the data to be read belongs in the storage system according to a logical address of the data to be read carried in the data read request;

[0450] An address determination module, used to determine the physical address corresponding to the logical address of the data to be read from the storage structure mapping tree of the target logical volume;

[0451] The data display module is used to display the data in the physical address corresponding to the logical address of the data to be read.

[0452] Each module in the above metadata management device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0453] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.29As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store metadata management data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a metadata management method is implemented.

[0454] Those skilled in the art will understand that Fig.29 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0455] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0456] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0457] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0458] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0459] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0460] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0461] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A metadata management method, characterized in that: The method comprises: In response to a data management request in the storage system, generating target metadata of the user data according to the user data carried in the data management request and a plurality of storage spaces pre-divided on the solid state drive in the storage system; Writing the target metadata into a storage space according to the plurality of storage spaces and the usage frequency of the target metadata; Based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system, a corresponding management operation is performed on the target metadata.

2. The method according to claim 1, characterized in that The step of writing the target metadata into the storage space according to the plurality of storage spaces and the usage frequency of the target metadata comprises: Obtaining life cycles of the multiple storage spaces; The usage frequency of the target metadata is matched with the life cycle of each storage space, and the target metadata is written into the storage space with successful matching.

3. The method according to claim 1, characterized in that The step of writing the target metadata into the storage space according to the plurality of storage spaces and the usage frequency of the target metadata comprises: Obtaining usage frequencies of historical metadata in the plurality of storage spaces; Comparing the usage frequency of the target metadata with the usage frequency of the historical metadata in the multiple storage spaces, and determining a storage space having the smallest usage frequency difference with the target metadata from the multiple storage spaces; The target metadata is written into the storage space with the smallest usage frequency difference.

4. The method according to any one of claims 1 to 3, characterized in that: The performing corresponding management operations on the target metadata based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system includes: Based on the metadata in the storage space and the management type of the data management request, correspondingly updating the node information of each node in the storage structure mapping tree; When the node information of each node in the storage structure mapping tree is updated, a management success response of the target metadata is returned.

5. The method according to claim 4, characterized in that The updating of the node information of each node in the storage structure mapping tree based on the metadata in the storage space and the management type of the data management request includes: Acquire the amount of metadata in the storage space and the timeout period during which the metadata in the storage space is not synchronized to the storage structure mapping tree; When the amount of metadata reaches a first preset threshold and / or the timeout period reaches a first time threshold, the node information of each node in the storage structure mapping tree is updated accordingly according to the management type of the data management request and the metadata in the storage space.

6. The method according to claim 5, characterized in that The updating of the node information of each node in the storage structure mapping tree according to the management type of the data management request includes: If the management type of the data management request is a data write type, determining a node to be updated according to the usage frequency of the target metadata and the level of the storage structure mapping tree, and writing the target metadata into the node to be updated; If the management type of the data management request is a data deletion type, determining a node to be updated according to a logical address of the target metadata, and deleting the target metadata in the node to be updated; If the management type of the data management request is a data modification type, initial metadata corresponding to the target metadata is determined in the storage structure mapping tree according to the logical address of the target metadata, and the initial metadata is replaced with the target metadata.

7. The method according to claim 5, characterized in that The management type of the data management request is a data write type; the node information of each node in the storage structure mapping tree is updated accordingly, and further includes: Detecting the amount of node information of each node in the storage structure mapping tree; Determine the nodes whose node information quantity is greater than the node quantity splitting threshold as nodes to be split; The node to be split is split.

8. The method according to claim 7, characterized in that The step of splitting the node to be split includes: According to the level of the node to be split in the storage structure mapping tree, determining two splitting nodes corresponding to the node to be split in the same level of the node to be split; The node information in the node to be split is split and stored in the two split nodes.

9. The method according to claim 8, characterized in that The step of splitting the node information in the node to be split and storing it in the two split nodes includes: Writing the node information in the node to be split into two idle data resource blocks in the storage space, and obtaining resource block information of the two idle data resource blocks in which the node information is written; Determine, according to the node information in the two idle data resource blocks, the splitting nodes corresponding to the two idle data resource blocks in the two splitting nodes; The resource block information of each of the idle data resource blocks is recorded in the corresponding split node.

10. The method according to claim 9, characterized in that The method further comprises: Obtaining the physical address of each of the idle data resource blocks into which the node information is written; For any idle data resource block, establishing a first mapping relationship between the physical address of the idle data resource block and the node information; The first mapping relationship is recorded in a node at an upper level of the split node corresponding to the idle data resource block.

11. The method according to claim 5, characterized in that The management type of the data management request is a data deletion type; the node information of each node in the storage structure mapping tree is updated accordingly, and further includes: Detecting the amount of node information of each node in the storage structure mapping tree; For any node of the storage structure mapping tree, if the node information quantity of the node is less than the preset lower limit of the node quantity, and the sum of the node information quantity of the node and the node information quantity of the adjacent nodes is less than the preset node quantity merging threshold, the node information of the node and the adjacent nodes are merged.

12. The method according to claim 11, characterized in that The merging of the node information of the node and the adjacent node includes: Writing the node information of the node and the node information of the adjacent node into the same idle data resource block in the storage space, and acquiring resource block information of the idle data resource block; Determine a merge node in the same level according to the adjacent nodes and the levels of the nodes in the storage structure mapping tree; The resource block information is recorded in the merging node.

13. The method according to claim 12, characterized in that The method further comprises: Acquire the physical address of the idle data resource block into which the node information of the node and the node information of the adjacent node are written, and acquire the node information of the merged node; Establishing a second mapping relationship between the physical address of the idle data resource block and the node information of the merged node; The second mapping relationship is recorded in the node at the previous level of the merged node.

14. The method according to claim 4, characterized in that The method further comprises: When the node information of each node in the storage structure mapping tree is updated, the node information quantity of each node and the uncured time of each node are obtained; According to the amount of node information of each of the nodes and the uncured time of each of the nodes, the metadata stored in the storage space is recycled to release the storage space.

15. The method according to claim 14, characterized in that The recovering the metadata stored in the storage space according to the amount of node information of each node and the uncured time of each node includes: For any node, when the amount of node information of the node reaches a second preset threshold, and / or the uncured time reaches a second time threshold, curing the node information in the node; If the node information is completely solidified, the metadata stored in the storage space is recycled.

16. The method according to any one of claims 1 to 3, characterized in that: The generating target metadata according to the user data carried in the data management request and the plurality of storage spaces pre-divided on the solid state hard disk in the storage system includes: Determining a storage space for the user data from the plurality of storage spaces; The target metadata is generated according to the logical address of the user data and the storage space of the user data.

17. The method according to claim 16, characterized in that The determining the storage space of the user data from the multiple storage spaces includes: In the case where there is non-free space in the multiple storage spaces, obtaining the data type and size of the user data; A storage space among the multiple storage spaces that matches the data type and size of the user data is determined as the storage space of the user data.

18. The method according to claim 16, characterized in that The determining the storage space of the user data from the multiple storage spaces includes: In the case that the plurality of storage spaces are all free spaces, obtaining a life count of each of the storage spaces; the life count is used to represent the number of times the storage space is erased and written; The storage space corresponding to the minimum life count is determined as the storage space for the user data.

19. The method according to claim 16, characterized in that The generating target metadata of the user data according to the logical address of the user data and the storage space of the user data includes: Writing the user data into an idle data resource block in the storage space of the user data, and acquiring a physical address of the idle data resource block into which the user data is written; Establishing a mapping relationship between the logical address and the physical address; The mapping relationship is determined as target metadata of the user data.

20. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: According to the logical volume identifier carried in the data management request, the storage structure mapping tree corresponding to the logical volume identifier is determined as the storage structure mapping tree corresponding to the user data in the storage system; a storage structure mapping tree is pre-configured for each logical volume in the storage system.

21. A metadata management device, characterized in that: The device comprises: A metadata acquisition module, configured to respond to a data management request in the storage system and generate target metadata of the user data according to the user data carried in the data management request and a plurality of storage spaces pre-divided on the solid state hard disk in the storage system; A metadata writing module, used for writing the target metadata into the storage space according to the plurality of storage spaces and the usage frequency of the target metadata; The metadata management module is used to perform corresponding management operations on the target metadata based on the metadata in the storage space and the storage structure mapping tree corresponding to the user data in the storage system.

22. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 20 are implemented.

23. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 20 are implemented.

24. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 20 are implemented.