Metadata management method and device and electronic equipment
By determining the unit storage space range and address pointer in the io write request, the problems of high b+ tree level and uneven volume address are solved, efficient metadata management is realized, and access efficiency and storage space utilization are improved.
Patent Information
- Application Number
- CN202510559891.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, when the level of the b+ tree is high, the number of mapping queries increases, efficiency decreases, and the volume address distribution is uneven, resulting in resource waste and search times increase.
By obtaining the io write request, the first offset address pointer is determined based on the logical address and the predefined unit storage space range, the destination address pointer is extracted from the pre-constructed address pointer array, metadata is inserted into the target data structure, and without increasing the data structure level, the node structure is simplified and the number of mapping queries is reduced.
It realizes uniform distribution of volume addresses, reduces the number of mapping queries, improves access efficiency, saves performance overhead, and makes full use of storage space to avoid waste of resources.
Smart Images

Figure CN120492453A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a metadata management method, device, and electronic device. Background Art
[0002] In the related art, when metadata is saved in the cache, the addition, deletion, modification and query of metadata is usually managed using the organizational form of a b+ tree. The process of querying and obtaining the lower-level address (P) of a certain volume address (L) on the constructed b+ tree includes: starting the query from the root node according to the corresponding L, obtaining all the kv information on the root node, and judging the address of its child node based on the range of L on k to obtain the child node, and then obtaining all the kv information on the child node, and obtaining the next node corresponding to its v value in the range of L value on all k values, until the leaf node is queried, thereby obtaining the v value of the corresponding lower-level address (P). In addition to the query process, when inserting and deleting mapping relationships in the b+ tree, it may involve the splitting and merging of the b+ tree, that is, the addition and deletion operations of leaf nodes.
[0003] The above operation may have the following problems: As the b+ tree level increases, the space occupied by its leaf nodes and intermediate nodes increases exponentially. When the b+ tree level is high, the number of queries for all mappings on the b+ tree will increase, resulting in reduced efficiency and additional performance consumption. Furthermore, if there is an uneven distribution of volume addresses, that is, multiple write accesses to similar areas will cause more mapping relationships to be inserted, causing the b+ tree to be filled with a large number of mapping relationships in similar locations. This will result in the access range of certain areas of the b+ tree being too small, while other areas of the b+ tree still have free space, resulting in resource waste and other problems. Moreover, if you want to increase the access range of a certain similar area, you must inevitably increase the b+ tree level, resulting in an increase in the number of searches. Summary of the Invention
[0004] The present application provides a metadata management method, device, and electronic device to at least solve the above technical problems.
[0005] In a first aspect, the present application provides a metadata management method, comprising: obtaining an IO write request, the IO write request including metadata to be inserted into a data structure, the metadata including a key-value pair consisting of a logical address and a physical address;
[0006] Determine a first offset address pointer according to the logical address in the key-value pair and a predetermined unit storage space range, wherein the unit storage space range is determined according to the total storage space range corresponding to the IO write request and the number of unit storage spaces to be divided;
[0007] Extracting a destination address pointer corresponding to a target data structure to which the logical address belongs from a pre-built address pointer array according to a predetermined start address pointer and a first offset address pointer;
[0008] After determining the target data structure according to the destination address pointer, the metadata is inserted into the target data structure.
[0009] Secondly, this application also provides another metadata management method, including:
[0010] Get an IO read request, which includes the logical address corresponding to the physical address to be read;
[0011] determining a first offset address pointer according to the logical address and the unit storage space range, wherein the unit storage space range is determined according to the total storage space range corresponding to the IO write request and the number of unit storage spaces to be divided;
[0012] Determine a destination address pointer corresponding to the data structure to which the logical address belongs according to the predetermined starting address pointer and the first offset address pointer;
[0013] According to the destination address pointer, selecting a target data structure corresponding to the destination address pointer from the data structure of the first aspect;
[0014] Read the physical address corresponding to the logical address from the target data structure;
[0015] Feedback the physical address to the requester corresponding to the IO read request.
[0016] In a third aspect, the present application provides a metadata management device, the device comprising:
[0017] An acquisition module is used to obtain an IO write request, where the IO write request includes metadata to be inserted into the data structure, where the metadata includes a key-value pair consisting of a logical address and a physical address;
[0018] a processing module, configured to determine a first offset address pointer based on a logical address in the key-value pair and a predetermined unit storage space range, wherein the unit storage space range is determined based on a total storage space range corresponding to the IO write request and a number of unit storage spaces to be divided;
[0019] an extraction module, configured to extract, from a pre-built address pointer array, a destination address pointer corresponding to a target data structure to which the logical address belongs, based on a predetermined start address pointer and a first offset address pointer;
[0020] The processing module is further configured to determine the target data structure according to the destination address pointer and then insert the metadata into the target data structure.
[0021] In a fourth aspect, the present application further provides another metadata management device, comprising:
[0022] An acquisition module is used to obtain an IO read request, where the IO read request includes a logical address corresponding to a physical address to be read;
[0023] a processing module configured to determine a first offset address pointer based on the logical address and a unit storage space range, wherein the unit storage space range is determined based on a total storage space range corresponding to the IO write request and a number of unit storage spaces to be divided; and to determine a destination address pointer corresponding to a data structure to which the logical address belongs based on a predetermined start address pointer and the first offset address pointer;
[0024] a screening module, configured to screen a target data structure corresponding to the destination address pointer from the data structure of the first aspect according to the destination address pointer;
[0025] A reading module, configured to read a physical address corresponding to a logical address from a target data structure;
[0026] The sending module is used to feed back the physical address to the requester corresponding to the IO read request.
[0027] In a fifth aspect, the present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any one of the above-mentioned metadata management methods when executing the computer program.
[0028] In a sixth aspect, the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program implements the steps of any of the above-mentioned metadata management methods when executed by a processor.
[0029] In a seventh aspect, the present application also provides a computer program product, comprising a computer program, which implements the steps of any of the above-mentioned metadata management methods when executed by a processor.
[0030] In this application, the unit storage space range is determined based on the total storage space range corresponding to the I / O write request and the number of unit storage spaces to be divided. For each data structure, the storage space is uniform and fixed, thus avoiding uneven volume address distribution. When mapping relationships are distributed across more unit storage spaces corresponding to data structures, the number of mapping relationships handled by each unit storage space is reduced, minimizing the need to increase the number of data structure hierarchies, reducing the number of mapping queries, improving access efficiency, and reducing performance overhead.
[0031] Moreover, the mapping relationship corresponding to the access to the adjacent areas is placed in the storage range corresponding to the same data structure, which will inevitably make full use of the storage space of the storage range without increasing the data hierarchy. In addition, the first offset address pointer is determined according to the logical address and the predetermined unit storage space range, and then the destination address pointer corresponding to the target data structure to which the logical address belongs is determined from the pre-built address pointer array according to the predetermined starting address pointer and the first offset address pointer; the target data structure is determined according to the destination address pointer. In this process, the destination address pointer corresponding to the target data structure only exists in the array, and there is no need to store the pointer nodes for performing the backtracking operation in each node of the data structure, thereby simplifying the node structure. Each node in the data structure reduces the space of one (backtracking) pointer. When the number of nodes in the data structure is relatively large, the space saved will be considerable, thereby increasing the access range of the data structure without increasing the hierarchy of the data structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0033] Figure 1 A simplified schematic diagram of the basic structure of a storage system provided in this application;
[0034] Figure 2 Schematic diagram of the B+ tree structure provided for this application;
[0035] Figure 3 A flowchart of a metadata management method provided in an embodiment of the present application;
[0036] Figure 4 A flowchart of another metadata management method provided in an embodiment of the present application;
[0037] Figure 5 A flowchart of another metadata management method provided in an embodiment of the present application;
[0038] Figure 6 A flowchart of another metadata management method provided in an embodiment of the present application;
[0039] Figure 7 A schematic diagram of the structure of the values in the aggregated metadata provided for this application;
[0040] Figure 8 A flowchart of another metadata management method provided in an embodiment of the present application;
[0041] Figure 9 A schematic diagram of a simplified structure for overall insertion and querying data provided in an embodiment of the present application;
[0042] Figure 10 A schematic diagram of the structure of a metadata management device provided in an embodiment of the present application;
[0043] Figure 11 A schematic diagram of the structure of another metadata management device provided in an embodiment of the present application;
[0044] Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0046] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0047] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0048] With the continuous development of storage systems, the application scenarios of centralized multi-controller storage systems are becoming more and more extensive. At the data management level, users can store and manage data by creating multiple volumes in the storage pool and read and write data on the volumes. Figure 1 As shown, Figure 1This is a simplified diagram of the basic structure of a storage system. Multiple volumes form a storage pool, which includes multiple Redundant Array of Independent Disks (RAID). RAID is responsible for partitioning the storage space on physical hard drives, creating stripes, the smallest unit of storage data recovery, and generating continuous space at the granularity of an mdisk, which appears to upper layers as a single block. A storage pool can select the contiguous space of multiple mdisks to form a continuous storage space and provide it to upper layers. An mdisk is the smallest unit of storage space that can be allocated on a single physical hard drive or logical drive (usually created using RAID technology) in a storage system.
[0049] In fact, a volume is a logical storage space allocated to a user or application in a storage pool. Volumes are usually formed by creating and formatting in a storage pool. It is further divided on the basis of the storage pool to provide an interface for data storage and access. RAID is a storage technology that improves performance, reliability, and fault tolerance by combining multiple physical hard disks into a single logical unit. RAID is a way to organize physical hard disks within a volume. In other words, RAID is usually selected as the underlying technology of a volume when creating a volume and is used to build the foundation of the volume. Therefore, from Figure 1 As can be seen from the figure, the storage pool includes multiple RAIDs. For multiple RAIDs, the total capacity can be managed, allocated, and used by one or more storage pools. Figure 1 As shown, RAID is created by arranging and organizing disk arrays for storage, so Figure 1 Multiple hard disks are also shown.
[0050] For data read and write operations:
[0051] Among them, if the volume-storage pool-RAID (the layer below the storage pool) is defined as the upper layer, middle layer, and lower layer respectively, during data reading and writing operations, first, the volume read and written on the pool is mapped by the host to generate read and write data and an address offset position at the volume level is corresponding to this read and write. This address is passed to the lower layer (storage pool layer) and needs to undergo three address conversions, namely, the volume logical address is converted to the spatial address at the pool level, and then the address at the pool level is converted to the address at the RAID level, and then mapped to a specific block on a certain disk through the RAID disk array partitioning selection algorithm to obtain the address on the disk, so as to read data or write to the disk, thereby realizing data reading and writing operations based on additional storage functions (data redundancy, fault tolerance, data tiering, data deduplication and compression, etc.).
[0052] At the thin storage pool level, the space provided by the lower layer is divided into basic units of a block (128M). At the same time, during the IO process, based on the volume ID when the volume sends IO and the address (Logical address) of the IO processing, the pool-level address, that is, the physical address (Physical address) at the storage pool level is obtained through a mapping relationship and passed to the lower layer for IO processing.
[0053] As described above, centralized storage devices involve hierarchical address translation during the I / O read and write processes. At the storage pool level, there are scenarios where the used area increases as users create or expand volumes. In these scenarios, to achieve wear leveling (IO appending, evenly distributed across the disk) and reuse of invalid areas, the storage pool layer uses metadata to record the mapping between the upper and lower layer addresses continuously generated during the I / O process. This metadata is stored on disk along with the data, and metadata read and write caches are set up to achieve high-speed reads when a cache hit occurs.
[0054] In the related art, when metadata is stored in the cache, the addition, deletion, modification and query of metadata are usually managed using the organizational form of a b+ tree; for each node of the b+ tree, the kv key-value pair information of the volume address (Logicaladdress, hereinafter referred to as L) - the lower-level address (Physical address, hereinafter referred to as P) within the maximum ordinal number (m) of the b+ tree is stored. In each non-leaf node: the value of the key-value pair corresponds to the address of the next node within the corresponding k value range, and the cycle continues until the leaf nodes of all branches. For the leaf nodes, the meaning of the k value is the same as that of the other nodes, which is the combination of the logical address of the issued IO and the volume ID (this combination can ensure that each key is unique because it takes into account the relative position of the data (logical address) and the storage volume to which it belongs (volume ID). The meaning of the v value is its actual corresponding lower-level address (P) rather than the node address.
[0055] In summary, the process of querying and obtaining the lower layer address (P) of a certain volume address (L) on the constructed b+ tree is detailed in Figure 2 Shown, including:
[0056] Start the query from the root node according to the corresponding L, obtain all the kv information on the root node, and judge the address of its child node according to the range of L on k to obtain the child node, and then obtain all the kv information on the child node. Then, perform the range of L value on all k values and obtain the next node corresponding to its v value until the leaf node is queried, thereby obtaining the v value of the corresponding lower-level address (P).
[0057] The related technology adopts a one-to-one mapping in the mapping relationship, that is, one logical starting address (L) corresponds to one lower-level address (P), and organizes these mapping relationships by establishing a b+ tree with a limited maximum ordinal number m, achieving a time complexity of O(log m N) (m is the maximum number of kv in the b+ tree node, N is the total number of nodes), when searching on the b+ tree, all searches for k have the same number of searches (that is, the height of the tree).
[0058] The defects in the above-mentioned related technologies include:
[0059] 1) When the b+ tree level is high, the number of queries for all mapping queries on the b+ tree will increase, resulting in reduced efficiency and additional performance consumption;
[0060] 2) In the scenario where the recorded volume addresses are unevenly distributed, that is, multiple write accesses to similar areas result in the insertion of more mapping relationships, causing the B+ tree to be filled with a large number of mapping relationships in similar locations. Either the access range is too small, or the B+ tree level is increased, resulting in an increase in the number of searches and a waste of resources.
[0061] To solve the above problems, the present invention provides a metadata management method. Figure 3 As shown, the method includes the following steps:
[0062] Step S301: Obtain an IO write request.
[0063] Specifically, the IO write request includes metadata to be inserted into the data structure, and the metadata includes a key-value pair consisting of a logical address and a physical address.
[0064] Step S302: determining a first offset address pointer according to the logical address in the key-value pair and a predetermined unit storage space range.
[0065] Step S303 : extracting a destination address pointer corresponding to the target data structure to which the logical address belongs from the pre-built address pointer array according to the predetermined start address pointer and the first offset address pointer.
[0066] Step S304 : extracting a destination address pointer corresponding to the target data structure to which the logical address belongs from the pre-built address pointer array according to the predetermined start address pointer and the first offset address pointer.
[0067] Specifically, before executing the method steps, first set an array A of fixed length, divide the total volume space, that is, the total storage space range, evenly according to the number of unit storage spaces to be divided, and obtain the unit storage space range.
[0068] For example, the volume space is divided into k equal portions, with each portion corresponding to a data structure. Array A is used to store destination address pointers indicating the destination address of each data structure. The destination address pointers are determined based on the actual address and first offset address pointer in the predetermined address pointer array. The first offset address pointer is determined based on the logical address in the aforementioned key-value pair and a predetermined unit storage space range.
[0069] For example, if the total volume space is 100 bytes and is divided into five equal parts, each part is 20 bytes. This means that data structure 1 has storage space from bytes 0 to 20, data structure 2 has storage space from bytes 21 to 40, and so on. The starting position in the address pointer array is a, and the destination address pointer position of each data structure in the address pointer array is a+i, where i is the first offset address pointer, and a+i points to the destination address of the data structure stored.
[0070] Step S305: After determining the target data structure according to the destination address pointer, the metadata is inserted into the target data structure.
[0071] Specifically, according to the destination address pointer, the destination address corresponding to the target data structure can be found, and then the target data structure can be found according to the destination address, and then the metadata can be inserted into the target data structure.
[0072] In an optional example, the target data structure may be, for example, a B+ tree or other data structure with branch nodes, which is not limited here.
[0073] In a metadata management method provided by an embodiment of the present application, the unit storage space range is determined based on the total storage space range corresponding to an IO write request and the number of unit storage spaces to be divided. For each data structure, the storage space is uniform and fixed, thus avoiding uneven volume address distribution. When mapping relationships are distributed across more unit storage spaces corresponding to data structures, the number of mapping relationships handled by each unit storage space is reduced, minimizing the need to increase the number of data structure hierarchies, reducing the number of mapping queries, improving access efficiency, and saving performance overhead.
[0074] Moreover, the mapping relationship corresponding to the access to the adjacent areas is placed in the storage range corresponding to the same data structure, which will inevitably make full use of the storage space of the storage range without increasing the data hierarchy. In addition, the first offset address pointer is determined according to the logical address and the predetermined unit storage space range, and then the destination address pointer corresponding to the target data structure to which the logical address belongs is determined from the pre-built address pointer array according to the predetermined starting address pointer and the first offset address pointer; the target data structure is determined according to the destination address pointer. In this process, the destination address pointer corresponding to the target data structure only exists in the array, and there is no need to store the pointer nodes for performing the backtracking operation in each node of the data structure, thereby simplifying the node structure. Each node in the data structure reduces the space of one (backtracking) pointer. When the number of nodes in the data structure is relatively large, the space saved will be considerable, thereby increasing the access range of the data structure without increasing the hierarchy of the data structure.
[0075] On the basis of any of the aforementioned optional embodiments, when the target data structure is a B+ tree, and after the target data structure is determined according to the destination address pointer and the metadata is inserted into the target data structure, it is detected that an old root node of the target B+ tree is split to generate a new root node, the method may further include the following method steps, see Figure 4 As shown, the method includes:
[0076] Step S401: Obtain a ratio between the total storage space range and the number of unit storage spaces to be divided.
[0077] Step S402: Determine the second offset address pointer corresponding to the new root node using the key value and the ratio in the first key-value pair of the new root node.
[0078] Specifically, inserting metadata into the target data structure may cause a node in the B+ tree to need to be split. This may in turn directly cause the root node to be sorted, meaning the old root node needs to be split into two parent nodes, naturally requiring the generation of a new root node. At this point, the destination address pointer corresponding to the new root node needs to be re-determined and updated in the address pointer array.
[0079] Therefore, it is necessary to first obtain the ratio between the total storage space range and the number of unit storage spaces to be divided. For example, if the total storage space range is M and the number of unit storage spaces to be divided is K, then the ratio is M / K, which physically represents the size of the unit storage space. Each node in the B+ tree is responsible for one or more intervals in the hash space. The starting position of the new root node is determined by its first key (k[0]). When a new root node is created, it is necessary to allocate a position for it in array A. Since the index of the address pointer array A is allocated according to the interval of the aforementioned unit storage space, it is necessary to calculate the index of the interval where the new root node is located. Therefore, it is necessary to use the key value and ratio in the first key-value pair of the new root node to determine the second offset address pointer corresponding to the new root node. Then, based on the second offset address pointer and the starting address pointer in the address pointer array, the address pointer of the new root node is determined.
[0080] Step S403: Determine the address pointer of the new root node according to the second offset address pointer and the start address pointer, and update the address pointer array with the new root node address pointer as the new destination address pointer of the target B+ tree.
[0081] Specifically, after the address pointer of the new root node is determined based on the second offset address pointer and the starting address pointer, the address pointer will serve as the new destination address pointer of the B+ tree that generates the new root node. The destination address pointer needs to be updated to the address pointer array to facilitate subsequent direct calls.
[0082] In an optional example, the B+ tree not only includes splitting nodes or merging nodes, but may also delete nodes or even delete the B+ tree in some cases. In a specific example, if a B+ tree is deleted, in order to ensure the accuracy of each destination address pointer in the address pointer array, based on the above embodiment, when it is detected that the target B+ tree is deleted, the method further includes the following method steps, see Figure 5 As shown:
[0083] Step S501 : determining a third offset address pointer according to the key value and the ratio in the first key-value pair of the root node of the target B+ tree.
[0084] Specifically, since the width of each interval is fixed (M / k), by dividing k[0] by this width, we can always get a unique offset position between 0 and k-1, which corresponds to the index of the root node pointer in array A. Therefore, when deleting a B+ tree, it is also necessary to determine the third offset address pointer based on the key value and ratio in the first key-value pair of the root node of the target B+ tree.
[0085] Step S502: According to the start address pointer and the third offset address pointer, the destination address pointer corresponding to the target B+ tree is determined and deleted from the address pointer array.
[0086] Specifically, because the B+ tree has been deleted, the destination address pointer of the target B+ tree also needs to be deleted. Therefore, the destination address pointer corresponding to the target B+ tree can be determined from the address pointer array based on the start address pointer and the third offset address pointer and then deleted.
[0087] Furthermore, based on any of the above embodiments, according to the destination address pointer, the metadata is inserted before the data structure corresponding to the destination address pointer. The method further includes the following method steps, see Figure 6 Shown, including:
[0088] Step S601: insert metadata into a pre-built linked list.
[0089] Specifically, in order to save data read and write times and improve read and write frequency and performance, the embodiment of the present application also includes inserting the metadata into a pre-built linked list after obtaining the metadata, which is equivalent to the end of the IO write operation and subsequent IO read and write operations can be performed. After the obtained metadata is added to the linked list, when the number of metadata in the linked list reaches the preset number requirement, it can be batch written to the B+ tree.
[0090] Step S602: When the amount of metadata in the linked list reaches a preset amount requirement, an aggregation operation is triggered on the metadata in the linked list to obtain aggregated metadata.
[0091] Specifically, the aggregate metadata key is the logical address of the first metadata in the linked list. The value in the aggregate metadata consists of the number of metadata in the aggregate metadata, the aggregate identifier corresponding to the aggregation operation, and the address pointer used to indicate the acquisition of all physical addresses in the linked list.
[0092] See Figure 7 As shown, Figure 7 The structure diagram of the value in the aggregated metadata is shown in the figure, that is, the PBA (value) aggregation setting example includes an L-count field, which is used to indicate the number of metadata to be aggregated (0-4 bytes), a special tag aggregation field (5-32 bytes), and an address pointer of the physical address of the first key-value pair (33-64 bytes), which can be used to find the storage location of the physical address of the first metadata according to the address pointer, and the storage location also includes a pointer for indicating the physical address of the next metadata, and so on, the physical addresses of all metadata in the linked list can be obtained.
[0093] Step S603: insert the aggregated metadata into the data structure.
[0094] Specifically, after inserting the aggregated metadata into the data structure, subsequent queries can retrieve the physical addresses corresponding to a series of aggregated logical addresses based on a single logical address. This reduces the number of subsequent queries and improves access efficiency and system performance.
[0095] In an optional example, considering that in some cases, some metadata may not be accessed frequently, in order to save resources, it may not be necessary to perform the aggregation operation. Therefore, the embodiment of the present application may also include: dynamically adjusting the aggregation strategy according to the changes in the metadata.
[0096] The specific implementation process may include the following method steps:
[0097] Step 1: Count metadata access and update frequencies.
[0098] Specifically, we first need to record the number of accesses and timestamps for each metadata entry, as well as the timestamps for each update. We then use time series analysis and machine learning algorithms to analyze access and update frequencies. We then calculate the average access frequency for each metadata entry. Finally, we use this average access frequency to determine the metadata update frequency.
[0099] Step 2: Define different aggregation frequencies based on the average access frequency and update frequency.
[0100] For metadata that is frequently accessed and infrequently updated, a lower aggregation frequency can be set.
[0101] For metadata that is accessed infrequently but updated frequently, a higher aggregation frequency can be set.
[0102] For metadata that is frequently accessed, real-time aggregation may cause unnecessary performance burden due to frequent user queries. Reducing the aggregation frequency can reduce the use of computing resources, thereby improving overall system performance. For metadata that is frequently updated, aggregated data will quickly become outdated. Increasing the aggregation frequency can ensure that the aggregation results are closer to the latest data status and maintain data timeliness. Therefore, for metadata that is frequently accessed and infrequently updated, a lower aggregation frequency can be set. For metadata that is infrequently accessed but frequently updated, a higher aggregation frequency can be set. By adjusting the aggregation frequency based on the access and update characteristics of the metadata, system resources can be allocated more reasonably. For example, more computing resources can be used to process critical data that is infrequently accessed but frequently updated. The specific access frequency and update frequency thresholds can be set according to actual conditions, such as customized settings based on customer needs.
[0103] Step 3. Cache frequently used aggregate metadata through the intelligent caching system.
[0104] Specifically, an LRU (least recently used) or LFU (least frequently used) cache algorithm may be used to dynamically adjust the cache size according to system resources to optimize performance and storage.
[0105] 4. Set specific aggregation conditions and perform operations such as partial aggregation or re-aggregation.
[0106] For example, when metadata updates are detected, partial aggregation or re-aggregation is triggered based on the update frequency. For metadata with low update frequency, partial aggregation is performed, where partial aggregation only aggregates the updated metadata, rather than re-aggregating the entire dataset. For metadata with high update frequency, full data aggregation is triggered periodically.
[0107] In a specific example, specific examples of the above method steps include the following:
[0108] Record the timestamp and access count when metadata is accessed or updated. Analyze metadata access and update patterns monthly or quarterly. Adjust aggregation frequency and caching strategies based on the analysis results. Specific actions based on the specific caching strategy might include performing partial aggregation daily or every few days, or performing full aggregation weekly or monthly. Monitor the performance and resource usage of aggregation operations in real time. Regularly collect user feedback on aggregation results for further optimization. Through this process, the system can dynamically adapt to changes in data access patterns, providing efficient and real-time aggregation services.
[0109] Based on any of the aforementioned optional embodiments, the pointer length of the non-leaf node in the target B+ tree is configured to be 32 bits.
[0110] Specifically, for the traditional data structure of intermediate nodes and leaf nodes, there are m 64-bit k and m 64-bit v, arranged in ascending order. Leaf nodes at the same level have two 32-bit forward and backward pointers, prev and next, pointing to their previous and next sibling nodes, a 32-bit pointer to the parent node, and an 8-bit Boolean value to indicate whether the node is a leaf node.
[0111] In this application, the following adjustments are made:
[0112] On the b+ tree data structure:
[0113] 1) The length of the v value of non-leaf nodes is changed from 64 bits to 32 bits (pointer length). Because the address recorded by the intermediate node is a pointer address, it does not occupy a lot of storage space. In order to save storage space, the length of the v value can be changed from 64 bits to 32 bits, which can save storage space to a certain extent and avoid waste of resources. In addition, it is an important space optimization for large databases or file systems because the storage space of each node will be reduced. In the B+ tree, each node can store more key-value pairs, thereby reducing the height of the tree and helping to improve search efficiency.
[0114] 2) According to the characteristics of the volume address, the address length is shortened. On the leaf node, the maximum length of 56 bits of LBA is divided by 8k, which can shorten the occupied length to 52 bits.
[0115] Shortening the LBA (Logical Block Address) length on leaf nodes from 56 bits to 52 bits further saves space. Shortening the address length also reduces the size of pointers pointing to data blocks, which reduces the total size of pointers in each node, thereby saving space. Furthermore, the simplified index structure may be easier to maintain because the size and number of pointers are reduced, which helps simplify index building and updating. By reducing the amount of data per node, the overall height of the B+ tree may be reduced, reducing the number of comparisons required when looking up data, thereby improving query efficiency. Since the node size is reduced, more nodes can be stored in memory, which helps reduce disk I / O operations and improve cache efficiency. By reducing the space occupied by each node, storage requirements and costs can be reduced. By optimizing the data structure and indexes, the efficiency of query and update operations can be improved. The simplified data structure may be easier to implement and maintain.
[0116] This application embodiment also provides another metadata management method. Figure 8 As shown, the method includes the following steps:
[0117] Step S801: Obtain an IO read request.
[0118] The IO read request includes a logical address corresponding to the physical address to be read.
[0119] Specifically, the previous embodiment describes the process of writing metadata into a data structure. In this embodiment, the process is to read data based on the metadata. Therefore, the first step is to obtain an IO read request, and the IO includes the logical address corresponding to the physical address to be read.
[0120] Step S802: Determine a first offset address pointer according to the logical address and the unit storage space range.
[0121] The unit storage space range is determined according to the total storage space range corresponding to the io write request and the number of unit storage spaces to be divided.
[0122] Step S803: Determine the destination address pointer corresponding to the data structure to which the logical address belongs according to the predetermined start address pointer and the first offset address pointer.
[0123] Specifically, this principle is similar to the aforementioned process of writing metadata to a data structure. In this method step, it is also necessary to determine the offset address pointer based on the logical address and the unit storage space range, and then determine the destination address pointer corresponding to the data structure to which the logical address belongs based on the first offset address pointer and the predetermined starting address pointer.
[0124] Step S804: According to the destination address pointer, a target data structure corresponding to the destination address pointer is selected from the data structures introduced in the above method embodiments.
[0125] Specifically, as described above, each data structure corresponds to an address pointer. Therefore, based on the destination address pointer, a target data structure corresponding to the destination address pointer can be selected from the multiple data structures constructed above.
[0126] Step S805: Read the physical address corresponding to the logical address from the target data structure.
[0127] Specifically, the metadata in the target data structure itself is composed of a logical address and a physical address corresponding to the logical address, so the physical address corresponding to the logical address can be directly read from the target data structure.
[0128] Step S806: Feedback the physical address to the requester corresponding to the IO read request.
[0129] A metadata management method provided by an embodiment of the present application obtains an IO read request, determines a first offset address pointer based on the logical address and unit storage space range in the IO read request, and then, based on the predetermined starting address pointer and the first offset address, can quickly and accurately determine the destination address pointer corresponding to the data structure of the tree of the logical address, and directly determine the target data structure based on the destination address pointer. This method reduces the time for data access. Since the data is located directly according to the offset address pointer, the complexity of the data structure that needs to be maintained can be reduced. For example, there is no need to store a pointer to the parent node in the data structure. Moreover, by reducing data access latency and simplifying the address mapping process, the performance of the entire system can be improved, especially when processing a large number of data read requests. Since the reference to the parent node stored in each node is reduced, memory consumption can be reduced, which is especially important when processing large data sets. Since the address mapping process is simplified, error handling is also more direct and clear, which helps to quickly locate and solve problems.
[0130] Optionally, based on any of the foregoing embodiments, before reading the physical address corresponding to the logical address from the target data structure, the method further includes the following method steps, as shown in detail below, including:
[0131] Step a1: insert the logical address into the pre-built linked list.
[0132] Step a2: When the number of logical addresses in the linked list reaches a preset number requirement, an aggregation operation is triggered on the logical addresses in the linked list to obtain aggregated logical address pairs.
[0133] Specifically, in order to reduce the number of IO reads and writes, when reading data, the obtained logical address can also be inserted into the pre-built linked list.
[0134] Then, when the number of logical addresses in the linked list reaches a preset number, an aggregation operation on the logical addresses in the linked list is triggered to generate aggregated logical address pairs.
[0135] Step a3: Look up multiple physical addresses from the target data structure according to the aggregated logical address pair.
[0136] Step a4: Feedback multiple physical addresses in batches to the requesting party.
[0137] Optionally, based on any of the foregoing embodiments, searching for multiple physical addresses from the target data structure according to the aggregated logical address pair specifically includes the following method steps:
[0138] Step b1: According to the aggregated logical address pair, searching the data structure for aggregated metadata corresponding to the aggregated logical address pair.
[0139] Specifically, the aggregated logical address pair is an interval range formed by the union of multiple logical address interval ranges, wherein the aggregated metadata with a k value equal to the first logical address can be searched from the data structure according to the first logical address of the interval range.
[0140] Step b2: Identify the number of metadata in the aggregated metadata.
[0141] Step b3: When it is determined that the number of metadata is equal to the total number of logical addresses corresponding to the physical addresses to be read, it is determined that multiple physical addresses corresponding to the aggregated logical address pairs have been acquired.
[0142] or,
[0143] Step b4: when it is determined that the amount of metadata is less than the total amount of logical addresses corresponding to the physical addresses to be read, search downward in order from the data structure to obtain a preset number of physical addresses not included in the aggregated metadata.
[0144] The sum of the preset number and the number of metadata is equal to the total number of logical addresses.
[0145] Specifically, when you want to obtain a batch of physical addresses, there may be a situation where the number of physical addresses in the aggregated metadata is not equal to the number of logical addresses in the aggregated logical address pair. For example, when aggregating zone metadata, the number of physical addresses in an aggregated metadata is 3, and the number of physical addresses currently to be obtained is also 3. In this case, it means that the aggregated metadata covers all the physical addresses currently required to be obtained;
[0146] In another case, if the number of physical addresses in a piece of aggregated metadata is 3, and the number of physical addresses currently to be obtained is also 5, this means that the physical addresses covered by the current aggregated metadata are not all the physical addresses currently requested, and further queries need to be performed in sequence at the next level of the node to which the aggregated metadata belongs to obtain the preset number of physical addresses not included in the aggregated metadata.
[0147] Step b5: Determine that all acquired physical addresses are multiple physical addresses corresponding to the aggregated logical address pair.
[0148] In the above method steps, by directly searching for the corresponding aggregated metadata through aggregating logical addresses, the one-by-one queries on individual physical addresses can be reduced, thereby improving the overall efficiency of data access. Since multiple physical addresses can be obtained at one time, the number of I / O operations on the disk or storage medium can be reduced, which is particularly important for improving system performance. Managing physical addresses through aggregated metadata can simplify the data management and indexing process, making the data structure clearer and easier to maintain. By ensuring that the number of physical addresses obtained matches the total number of logical addresses, the possibility of query errors can be reduced and the accuracy of the data can be improved. This logical to physical address mapping method is particularly friendly for processing large-scale data sets because it can effectively support batch data operations. Moreover, this method can enhance the overall performance and reliability of the system.
[0149] Figure 9 The schematic diagram of the simplified structure of overall insertion and query data in the aforementioned embodiment of the present application is shown in FIG. The left side is the host IO read operation, and the right side is the host IO write operation.
[0150] During the write operation, the metadata, that is, the LP mapping relationship, is inserted into the B+ tree according to the aforementioned method steps. If there is insertion aggregation, the count number needs to be determined to generate the L(count)P relationship pair, that is, the aggregated metadata, and then the insertion operation is performed from the B+ tree.
[0151] On the left, when data needs to be read, P is first queried based on L. Specifically, L can be aggregated to obtain L(count), which aggregates the logical address pairs. Then, the query is performed from the B+ tree.
[0152] In an alternative example, whether querying or inserting, as previously described, the address length is shortened based on the characteristics of the volume address. At the leaf node, the maximum length of the 56-bit LBA is divided by 8KB, reducing the occupied length to 52 bits. Therefore, the address shortening is illustrated here: dividing by 8KB to obtain the address at the leaf node.
[0153] The figure also illustrates the process of determining the destination address pointer of the data structure to be inserted / queried based on the logical address and the starting address in the fixed array A, as well as the range of each unit storage space, that is, the process of obtaining the address pointer of the root node of the target B+ tree. Figure 9 As shown in the figure, each node on the B+ tree is configured with multiple key-value pairs. When inserting, taking the leaf node as an example, the aggregate insertion process is the same as the non-aggregate insertion process. Both obtain the first target k value that is greater than the k value to be inserted, and insert the k value to be inserted before the target k value.
[0154] For the reading process, the actual kv key-value pair is obtained, and then the v value contains an aggregation identifier to confirm whether the aggregation operation is performed. If the aggregation operation has been performed, the PBA also includes count to represent the number of metadata that have performed the aggregation operation in the PBA. Similarly, the LBA also includes the number of physical addresses to be obtained, or the number of aggregated logical addresses. You can first compare these two numbers to determine whether the number of physical addresses in the first PBA is equal to the number of counts in the LBA. If they are equal, directly feedback is given. If not, continue to query backward, for example, query Figure 9 If it is determined by the high bit of PBA that it is not an aggregation operation, the next kv is searched backward until a physical address equal to the count in L is obtained and fed back.
[0155] The above process has been described in detail in the previous embodiment and will not be described in detail here.
[0156] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0157] The embodiment of the present application provides a metadata management device, see Figure 10 As shown, it includes: an acquisition module 1001, a processing module 1002 and an extraction module 1003.
[0158] An acquisition module 1001 is configured to acquire an IO write request, wherein the IO write request includes metadata to be inserted into a data structure, wherein the metadata includes a key-value pair consisting of a logical address and a physical address;
[0159] Processing module 1002, configured to determine a first offset address pointer based on the logical address in the key-value pair and a predetermined unit storage space range, wherein the unit storage space range is determined based on a total storage space range corresponding to the IO write request and a number of unit storage spaces to be divided;
[0160] An extraction module 1003 is configured to extract a destination address pointer corresponding to a target data structure to which the logical address belongs from a pre-built address pointer array according to a predetermined start address pointer and a first offset address pointer;
[0161] The processing module 1002 is further configured to determine the target data structure according to the destination address pointer and then insert the metadata into the target data structure.
[0162] In an optional embodiment, the target data structure is a target B+ tree, and the processing module 1002 is further configured to:
[0163] When the target data structure is determined according to the destination address pointer and the metadata is inserted into the target data structure, when it is detected that the target B+ tree has an old root node split to generate a new root node, the ratio between the total storage space range and the number of unit storage spaces to be divided is obtained;
[0164] Determine the second offset address pointer corresponding to the new root node using the key value and the ratio in the first key-value pair of the new root node;
[0165] The address pointer of the new root node is determined according to the second offset address pointer and the starting address pointer, and the address pointer of the new root node is updated into the address pointer array as the new destination address pointer of the target B+ tree.
[0166] In an optional embodiment, the processing module 1002 is further configured to determine a third offset address pointer based on the key value and the ratio in the first key-value pair of the root node of the target B+ tree when it is detected that the target B+ tree is deleted;
[0167] According to the starting address pointer and the third offset address pointer, a destination address pointer corresponding to the target B+ tree is determined and deleted from the address pointer array.
[0168] In an optional embodiment, the processing module 1002 is further configured to insert the metadata into a pre-built linked list;
[0169] When the number of metadata in the linked list reaches a preset number requirement, an aggregation operation is triggered on the metadata in the linked list to obtain the aggregated metadata, wherein the aggregated metadata key is the logical address of the first metadata in the linked list, the number of metadata in the aggregated metadata, the aggregation identifier corresponding to the aggregation operation, and the address pointer used to indicate the acquisition of all physical addresses in the linked list constitute the value in the aggregated metadata;
[0170] Insert aggregate metadata into the data structure.
[0171] In an optional embodiment, the pointer length of the non-leaf node in the target B+ tree is configured to be 32 bits.
[0172] The examples provided in this application refer to Figure 10 The description of the features of the corresponding metadata management device embodiment can be found in Figures 3 to 6 The relevant descriptions of the metadata management method embodiments corresponding to any embodiment will not be repeated here one by one.
[0173] An embodiment of the present application provides a metadata management device in which the unit storage space range is determined based on the total storage space range corresponding to the IO write request and the number of unit storage spaces to be divided. For each data structure, the storage space is uniform and fixed, thus avoiding uneven volume address distribution. When mapping relationships are distributed across more unit storage spaces corresponding to data structures, the number of mapping relationships handled by each unit storage space is reduced, minimizing the need to increase the number of data structure hierarchies, reducing the number of mapping queries, improving access efficiency, and saving performance overhead.
[0174] Moreover, the mapping relationship corresponding to the access to the adjacent areas is placed in the storage range corresponding to the same data structure, which will inevitably make full use of the storage space of the storage range without increasing the data hierarchy. In addition, the first offset address pointer is determined according to the logical address and the predetermined unit storage space range, and then the destination address pointer corresponding to the target data structure to which the logical address belongs is determined from the pre-built address pointer array according to the predetermined starting address pointer and the first offset address pointer; the target data structure is determined according to the destination address pointer. In this process, the destination address pointer corresponding to the target data structure only exists in the array, and there is no need to store the pointer nodes for performing the backtracking operation in each node of the data structure, thereby simplifying the node structure. Each node in the data structure reduces the space of one (backtracking) pointer. When the number of nodes in the data structure is relatively large, the space saved will be considerable, thereby increasing the access range of the data structure without increasing the hierarchy of the data structure.
[0175] The embodiment of the present application also provides another metadata management device, see Figure 11 As shown, it includes: an acquisition module 1101, a processing module 1102, a screening module 1103, a reading module 1104 and a sending module 1105.
[0176] An acquisition module 1101 is configured to acquire an IO read request, where the IO read request includes a logical address corresponding to a physical address to be read;
[0177] Processing module 1102 is configured to determine a first offset address pointer based on the logical address and a unit storage space range, wherein the unit storage space range is determined based on a total storage space range corresponding to the IO write request and the number of unit storage spaces to be divided; and determine a destination address pointer corresponding to a data structure to which the logical address belongs based on a predetermined start address pointer and the first offset address pointer.
[0178] A screening module 1103 is configured to screen a target data structure corresponding to the destination address pointer from the data structure of the first aspect according to the destination address pointer;
[0179] A reading module 1104 is configured to read a physical address corresponding to a logical address from a target data structure;
[0180] The sending module 1105 is configured to feed back the physical address to the requester corresponding to the IO read request.
[0181] In an optional example, the processing module 1102 is further configured to insert the logical address into a pre-built linked list;
[0182] When the number of logical addresses in the linked list reaches a preset number requirement, an aggregation operation is triggered on the logical addresses in the linked list to obtain an aggregated logical address pair;
[0183] According to the aggregated logical address pair, multiple physical addresses are checked from the target data structure;
[0184] The sending module 1105 is further configured to feed back multiple physical addresses in batches to the requesting party.
[0185] In an optional example, the processing module 1102 is specifically configured to search the data structure for aggregation metadata corresponding to the aggregation logical address pair according to the aggregation logical address pair;
[0186] identifying the amount of metadata in the aggregated metadata;
[0187] When it is determined that the number of metadata is equal to the total number of logical addresses corresponding to the physical addresses to be read, determining that a plurality of physical addresses corresponding to the aggregated logical address pairs have been acquired;
[0188] or,
[0189] When it is determined that the number of metadata is less than the total number of logical addresses corresponding to the physical address to be read, searching downward in order from the data structure to obtain a preset number of physical addresses not included in the aggregated metadata, wherein the sum of the preset number and the number of metadata is equal to the total number of logical addresses;
[0190] It is determined that all acquired physical addresses are multiple physical addresses corresponding to the aggregated logical address pair.
[0191] The examples provided in this application refer to Figure 11 The description of the features of the corresponding metadata management device embodiment can be found in Figure 7 The relevant descriptions of the metadata management method embodiments corresponding to the subsequent method embodiments will not be repeated here one by one.
[0192] An embodiment of the present application provides a metadata management device that obtains an IO read request, determines a first offset address pointer based on the logical address and unit storage space range in the IO read request, and then, based on the predetermined starting address pointer and the first offset address, can quickly and accurately determine the destination address pointer corresponding to the data structure of the tree where the logical address is located, and directly determines the target data structure based on the destination address pointer. This method reduces the time for data access. Since data is located directly based on the offset address pointer, the complexity of the data structure that needs to be maintained can be reduced. For example, there is no need to store a pointer to the parent node in the data structure. Moreover, by reducing data access latency and simplifying the address mapping process, the performance of the entire system can be improved, especially when processing a large number of data read requests. Since the reference to the parent node stored in each node is reduced, memory consumption can be reduced, which is especially important when processing large data sets. Since the address mapping process is simplified, error handling is also more direct and clear, which helps to quickly locate and solve problems.
[0193] The embodiment of the present application also provides an electronic device, such as Figure 12 As shown, it includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above metadata management method embodiments.
[0194] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned metadata management method embodiments when running.
[0195] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0196] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned metadata management method embodiments are implemented.
[0197] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned metadata management method embodiments are implemented.
[0198] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0199] The above describes in detail the metadata management method, device, and electronic device provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. It should be noted that for ordinary technicians in this technical field, without departing from the principles of this application, various improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
Claims
1. A metadata management method, characterized in that: include: Obtaining an IO write request, wherein the IO write request includes metadata to be inserted into the data structure, wherein the metadata includes a key-value pair consisting of a logical address and a physical address; determining a first offset address pointer according to the logical address in the key-value pair and a predetermined unit storage space range, wherein the unit storage space range is determined according to a total storage space range corresponding to the IO write request and a number of unit storage spaces to be divided; Extracting a destination address pointer corresponding to the target data structure to which the logical address belongs from a pre-built address pointer array according to a predetermined starting address pointer and the first offset address pointer; After determining the target data structure according to the destination address pointer, the metadata is inserted into the target data structure.
2. The metadata management method according to claim 1, characterized in that: The target data structure is a target B+ tree. When the target data structure is determined according to the destination address pointer and the metadata is inserted into the target data structure, if it is detected that an old root node of the target B+ tree is split to generate a new root node, the method further includes: Obtaining a ratio between the total storage space range and the number of unit storage spaces to be divided; Determine a second offset address pointer corresponding to the new root node using the key value in the first key-value pair of the new root node and the ratio; The address pointer of the new root node is determined according to the second offset address pointer and the starting address pointer, and the address pointer of the new root node is updated into the address pointer array as the new destination address pointer of the target B+ tree.
3. The metadata management method according to claim 2, characterized in that: When it is detected that the target B+ tree is deleted, the method further includes: Determine a third offset address pointer according to the key value in the first key-value pair of the root node of the target B+ tree and the ratio; According to the starting address pointer and the third offset address pointer, a destination address pointer corresponding to the target B+ tree is determined and deleted from the address pointer array.
4. The metadata management method according to any one of claims 1 to 3, characterized in that: The method further comprises inserting the metadata before the data structure corresponding to the destination address pointer according to the destination address pointer: Inserting the metadata into a pre-built linked list; When the number of metadata in the linked list reaches a preset number requirement, an aggregation operation is triggered on the metadata in the linked list to obtain aggregated metadata, wherein the aggregated metadata key is the logical address of the first metadata in the linked list, the number of metadata in the aggregated metadata, the aggregation identifier corresponding to the aggregation operation, and the address pointer for indicating the acquisition of all physical addresses in the linked list constitute the value in the aggregated metadata; The aggregate metadata is inserted into the data structure.
5. The metadata management method according to claim 2 or 3, characterized in that: The pointer length of the non-leaf node in the target B+ tree is configured to be 32 bits.
6. A metadata management method, characterized in that: include: Obtain an IO read request, wherein the IO read request includes a logical address corresponding to a physical address to be read; determining a first offset address pointer according to the logical address and a unit storage space range, wherein the unit storage space range is determined according to a total storage space range corresponding to the IO write request and a number of unit storage spaces to be divided; Determining a destination address pointer corresponding to the data structure to which the logical address belongs according to a predetermined start address pointer and the first offset address pointer; According to the destination address pointer, selecting a target data structure corresponding to the destination address pointer from the data structure according to any one of claims 1 to 5; Reading a physical address corresponding to the logical address from the target data structure; Feedback the physical address to a requester corresponding to the IO read request.
7. The metadata management method according to claim 6, characterized in that: Before reading the physical address corresponding to the logical address from the target data structure, the method further includes: Inserting the logical address into a pre-built linked list; When the number of logical addresses in the linked list reaches a preset number requirement, triggering an aggregation operation on the logical addresses in the linked list to obtain an aggregated logical address pair; According to the aggregated logical address pair, query a plurality of physical addresses from the target data structure; Feedback the plurality of physical addresses in batches to the requesting party.
8. The metadata management method according to claim 7, characterized in that: The step of searching the target data structure for multiple physical addresses based on the aggregated logical address pair specifically includes: According to the aggregated logical address pair, searching the data structure for aggregated metadata corresponding to the aggregated logical address pair; identifying a quantity of metadata in the aggregated metadata; When it is determined that the number of the metadata is equal to the total number of logical addresses corresponding to the physical addresses to be read, determining that a plurality of physical addresses corresponding to the aggregated logical address pairs have been acquired; or, When it is determined that the number of metadata is less than the total number of logical addresses corresponding to the physical addresses to be read, searching downward in order from the data structure to obtain a preset number of physical addresses not included in the aggregated metadata, wherein the sum of the preset number and the number of metadata is equal to the total number of logical addresses; It is determined that all the acquired physical addresses are a plurality of physical addresses corresponding to the aggregated logical address pair.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the metadata management method according to any one of claims 1 to 5 when executing the computer program; Alternatively, when the computer program is executed, the steps of the metadata management method according to any one of claims 6 to 8 are implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the metadata management method according to any one of claims 1 to 5; or, when executed by the processor, implements the steps of the metadata management method according to any one of claims 6 to 8.