WO2014101420A1 - System for constructing metadata and method therefor - Google Patents

System for constructing metadata and method therefor Download PDF

Info

Publication number
WO2014101420A1
WO2014101420A1 PCT/CN2013/080710 CN2013080710W WO2014101420A1 WO 2014101420 A1 WO2014101420 A1 WO 2014101420A1 CN 2013080710 W CN2013080710 W CN 2013080710W WO 2014101420 A1 WO2014101420 A1 WO 2014101420A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
logical address
physical address
mapping relationship
index
Prior art date
Application number
PCT/CN2013/080710
Other languages
French (fr)
Chinese (zh)
Inventor
代海军
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014101420A1 publication Critical patent/WO2014101420A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation

Definitions

  • the present invention relates to the field of storage technologies, and in particular, to a metadata construction system and method thereof.
  • TP Thin Provisioning
  • TP Thin Provisioning
  • LUN Logical Unit Number
  • metadata is mainly used to store the Logic Address and Physical Address Mapping (LPM) of the reduced LUN.
  • the automatic thin provisioning technology uses the B-tree to store metadata, which can effectively improve the access efficiency of metadata and has good scalability.
  • B-tree to store metadata
  • the key value of the metadata is fixed to the logical address of the thin LUN, which cannot satisfy the metadata based on other information.
  • the need to find, the existing metadata storage method lacks flexibility. Summary of the invention
  • embodiments of the present invention provide a metadata construction system and method thereof to solve the problem of lack of flexibility in metadata storage.
  • a first aspect provides a method for constructing metadata, comprising the steps of: receiving a request to read data or writing data; querying an index area of the metadata according to a logical address in the request, and determining an index of the logical address in the metadata Whether there is a zone, where the metadata includes an index area, a logical address And the physical address mapping relationship area, the index area records the storage address of the logical address and the physical address mapping relationship in the logical address and the physical address mapping relationship area; if yes, according to the logical address and the physical address corresponding to the logical address in the index area The mapping relationship between the logical address and the physical address mapping relationship area, the logical address and the physical address mapping relationship area are searched for the mapping relationship between the logical address and the physical address, and the physical address corresponding to the logical address is obtained, and the data is obtained.
  • the physical address reads data or writes data; if it does not exist, when the request is a read data request, the read data is all 0; when the request is a write data request, the physical address is assigned to the logical address, and
  • the mapping relationship between the logical address and the assigned physical address is stored in the logical address and the physical address mapping relationship area, and the corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, according to the physical address. data input.
  • the method further includes: setting an index type of the index area when creating the thin volume Thin LUN.
  • a corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, including:
  • the mapping relationship between the newly added logical address and the assigned physical address is established according to the set index type.
  • different key values KEY are established in the index area for the mapping relationship between the same logical address and the physical address. At least two indexes.
  • establishing, in the index area, a corresponding index record for the mapping relationship between the newly added logical address and the allocated physical address includes: A mapping relationship between the newly added logical address and the assigned physical address is sequentially established in at least two indexes.
  • a second aspect provides a metadata construction system, comprising: 10 units, configured to receive a request for reading data or writing data; and a processing unit, configured to query metadata according to a logical address in a request acquired by 10 units
  • the index area determines whether the logical address exists in the index area of the metadata, wherein the metadata includes an index area, a logical address, and a physical address mapping relationship area, and the index area records a mapping relationship between the logical address and the physical address at the logical address and
  • the physical address maps the storage address in the relational area; if the logical address exists in the index area of the metadata, the processing unit is further configured to map the logical address and the physical address according to the logical address and the physical address in the index area in the logical address and the physical Address Mapping the storage address in the relational area, querying the mapping relationship between the logical address and the physical address in the logical address and the physical address mapping relationship area, acquiring the physical address corresponding to the logical address, and reading data or writing data according to the physical address
  • the 10 unit When the request is a read data request, the 10 unit is also used to read the data as all 0s; when the request is a write data request, the processing unit also uses The physical address is assigned to the logical address, and the mapping relationship between the logical address and the assigned physical address is stored in the logical address and the physical address mapping relationship area, and the newly added logical address and the assigned physical address are mapped in the index area. The relationship establishes the corresponding index record; 10 units are also used to write data based on the physical address.
  • the processing unit is further configured to set an index type of the index area when creating the thin volume.
  • a corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, specifically:
  • mapping relationship between the newly added logical address and the assigned physical address in the index area is based on the set index type to establish a corresponding index record.
  • the mapping between the same logical address and the physical address in the index area establishes at least a different key value KEY Two indexes.
  • a corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, specifically:
  • mapping relationship between the newly added logical address and the assigned physical address in the index area sequentially establishes corresponding index records in at least two indexes.
  • the present invention records the logical relationship between the logical address and the physical address in the index area by dividing the metadata into an index area, a logical address, and a physical address mapping relationship area.
  • the physical address maps the storage address in the relational area, so that the query metadata can be satisfied under various search conditions, and the performance of the index is improved according to the different application scenarios, and the flexibility of the metadata is increased.
  • FIG. 1 is a flow chart showing a method of constructing metadata according to a first embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of metadata in FIG. 1;
  • FIG. 3 is a flow chart showing setting an index type of an index area in a method of constructing metadata according to a second embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of an index area in a method for constructing metadata according to a third embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a metadata construction system according to a first embodiment of the present invention
  • Fig. 6 is a block diagram showing the structure of a metadata construction system in accordance with a fourth embodiment of the present invention. detailed description
  • FIG. 1 is a flowchart of a method of constructing metadata according to a first embodiment of the present invention. As shown in FIG. 1, the construction method disclosed in this embodiment includes the following steps:
  • Step 101 Receive a request to read data or write data.
  • Step 102 Query the index area of the metadata according to the logical address in the request, and determine whether the logical address exists in the index area of the metadata.
  • the metadata includes a logical address and a physical address mapping area (MP) and an index part (IP), as shown in FIG. 2.
  • the mapping between the logical address and the physical address includes a mapping relationship between multiple logical addresses and physical addresses.
  • the LPM can be stored in the first segment of each physical space of the physical disk.
  • the index area IP records logical addresses and physical addresses. Address mapping relationship The storage address of the LPM in the logical address and physical address mapping relationship area MP.
  • Step 103 If yes, according to the mapping relationship between the logical address and the physical address corresponding to the logical address in the index area, the storage address in the logical address and the physical address mapping relationship area, in the logical address Query the mapping relationship between the logical address and the physical address in the physical address mapping relationship area, obtain the physical address corresponding to the logical address, and read data or write data according to the physical address.
  • the mapping relationship between the logical address and the physical address corresponding to the logical address is searched in the index area IP according to the logical address.
  • the logical address and the physical address mapping relationship area MP The storage address in the logical address and the physical address mapping relationship area MP reads the mapping relationship LPM of the corresponding logical address and the physical address according to the storage address, to obtain the physical address corresponding to the logical address, and reads according to the physical address Data or write data.
  • Step 104 If it does not exist, determine that the request is a read data request or a write data request. Step 105: When the request is a data read request, the read data is all 0;
  • Step 106 When the request is a write data request, assign a physical address to the logical address, and store the mapping relationship between the logical address and the allocated physical address in the logical address and physical address mapping relationship area of the metadata, in the metadata In the index area, a corresponding index record is established for the mapping relationship between the newly added logical address and the assigned physical address, and data is written according to the physical address.
  • the present embodiment divides the metadata into an index area IP, a logical address, and a physical address mapping relationship area MP, and records a mapping relationship between the logical address and the physical address in the index area IP at the logical address and
  • the physical address maps the storage address in the relational area MP, so that the query metadata can be satisfied under various search conditions, and the flexibility of the metadata is increased.
  • the present invention also provides a method of constructing metadata of the second embodiment, which is described in detail based on the method disclosed in the first embodiment.
  • the method disclosed in this embodiment further includes: when creating a thin volume, setting an index type of the index area.
  • a corresponding index record is established in the index area of the metadata for the mapping relationship between the newly added logical address and the allocated physical address, including: a newly added logical address and a location in the index area of the metadata
  • the mapping relationship of the assigned physical addresses establishes a corresponding index record according to the index type.
  • the method disclosed in this embodiment further includes a method of setting an index type of an index area.
  • setting the index type of the index area includes the following steps:
  • Step 301 Set the LUN-related parameters; for example, the size of the LUN, the write-back policy, and other parameters.
  • Step 302 prompt the user to select a type of the index
  • Step 303 Create a thin LUN and set the index type according to the user selection.
  • the user selects the type of the index according to different application scenarios and the size of the thinned volume. For example, when the thinned volume is small, and the index of the metadata can be stored in the memory, the structure of the balanced binary tree can be selected to store the index; The thin volume is large, and when the write data is small, the hash table structure can be selected to store the index; when the thin volume is large, and the write data is large, the linear table structure can be selected to store the index; Larger, when the amount of write data is uncertain, you can choose the structure of the B-tree and its variants to store the index.
  • different index types are set according to the unused application scenarios and the size of the thinned volume, so that the performance of the thinned volume in various application scenarios is optimized.
  • the present invention also provides a method of constructing metadata of the third embodiment, which is described in detail based on the method disclosed in the second embodiment.
  • the method disclosed in this embodiment further includes: establishing at least two indexes of different key values KEY for the mapping relationship between the same logical address and the physical address in the index area. That is, for the mapping relationship between the same logical address and the physical address LPM, the user can select multiple indexes to improve performance according to the needs of the service, and preferably, establish indexes of different key values KEY.
  • the index area 400 includes an index 401 of a logical address and an index 402 of a physical address. Among them, the use of different indexes for different query requirements of metadata can significantly improve the performance of query metadata.
  • the index 402 of the physical address can be directly Query metadata to obtain logical addresses, which in turn improves the performance of query metadata.
  • the types of the multiple indexes may be different or the same, for example, one index is a B-tree with a logical address as a key value, and the other index is a B-tree with a physical address as a key value.
  • a corresponding index record is established in the index area of the metadata for the mapping relationship between the newly added logical address and the allocated physical address, including: a newly added logical address in the index area of the metadata
  • the mapping relationship with the assigned physical address sequentially establishes corresponding index records in at least two indexes, that is, the corresponding index records are respectively established in the index 401 of the logical address and the index 402 of the physical address.
  • At least two indexes of different key values KEY are established by mapping the same logical address and the physical address in the index area, which can improve the performance of the query metadata, and increase the application scenarios and metadata of the thin volume. Flexibility.
  • the present invention also provides a metadata construction system of the first embodiment, which is disclosed in the first embodiment The method is described in detail based on the method.
  • the construction system 50 disclosed in this embodiment includes: 10 (Input/Output) unit 501 and processing unit 502.
  • 10 unit 501 is configured to receive a request to read data or write data.
  • the processing unit 502 is configured to obtain a request from the 10 unit 501, query the index area IP of the metadata according to the logical address in the request, and determine whether the logical address exists in the index area IP of the metadata.
  • the processing unit 502 is configured to search, in the index area IP, the mapping relationship between the logical address and the physical address corresponding to the logical address according to the logical address, the logical address and the physical Addressing the storage address in the relational area MP, and further searching the mapping relationship LPM of the corresponding logical address and the physical address in the logical address and the physical address mapping relationship area MP according to the storage address, to obtain the physical address corresponding to the logical address, and Read data or write data based on physical address.
  • the 10 unit 501 is also used to read data of all 0s; when the request is a write data request, the processing unit 502.
  • the physical address is further allocated to the logical address, and the mapping relationship between the logical address and the allocated physical address is stored in the logical address and the physical address mapping relationship area of the metadata, and is newly added in the index area of the metadata.
  • the mapping relationship between the logical address and the assigned physical address establishes a corresponding index record, and the 10 unit 501 is also used to write data according to the physical address.
  • the metadata includes a logical address and a physical address mapping relationship area and an index area, as shown in FIG. 2.
  • the mapping between the logical address and the physical address includes a mapping relationship between multiple logical addresses and physical addresses.
  • the LPM is stored in the first segment of each physical space of the physical disk.
  • the IP address of the index area records the mapping between logical addresses and physical addresses.
  • the processing unit 502 divides the metadata into an index area IP, a logical address, and a physical address mapping relationship area MP, and records a mapping relationship between the logical address and the physical address in the index area IP.
  • the logical address and the physical address map the storage address in the relationship area MP, so that the query metadata can be satisfied under various search conditions, and the flexibility of the metadata is increased.
  • the present invention also provides a metadata construction system of the second embodiment, which is described in detail based on the system 50 disclosed in the first embodiment.
  • the processing unit 502 Also used to set the index type of the index area when creating a thin volume.
  • the user can select the type of the index according to different application scenarios and the size of the reduced LU.
  • the index of the metadata can be stored in the memory, and the structure of the balanced binary tree can be selected to store the index;
  • the LUN is large.
  • the Hash table structure can be selected to store the index.
  • the thin LUN is large, when the data is written, the linear table structure can be selected to store the index.
  • the data is written.
  • the amount is uncertain, you can choose the structure of the B-tree and its variants to store the index.
  • the processing unit 502 establishes a corresponding index record in the index area for the mapping relationship between the newly added logical address and the assigned physical address, specifically: the processing unit 502 is in the metadata.
  • the index area is a mapping relationship between the newly added logical address and the assigned physical address, and the corresponding index record is established according to the index type.
  • the present invention also provides a metadata construction system of the third embodiment, which is different from the system disclosed in the second embodiment in that: in the index area, different key values KEY are established for the mapping relationship between the same logical address and the physical address. At least two indexes.
  • the processing unit 502 can significantly improve the performance of the query metadata by establishing multiple indexes and using different indexes for different query requirements of the metadata.
  • the processing unit 502 establishes a corresponding index record for the mapping relationship between the newly added logical address and the allocated physical address in the index area, specifically: the processing unit 502 is a mapping of the newly added logical address and the allocated physical address in the index area. The relationship in turn establishes a corresponding index record in at least two indexes.
  • FIG. 6 is a system for constructing metadata according to a fourth embodiment of the present invention.
  • the system 60 disclosed in this embodiment includes a 10 interface 603 and a processor 601, a memory 604, and a communication bus 602.
  • the 10 interface 603 is for receiving a request for reading data or writing data
  • the memory 604 stores execution instructions
  • the processor 601 is in communication with the memory 604, and the processor 601 executes execution instructions to construct the system.
  • 60 is a method for constructing metadata of the first to third embodiments of the present invention. The implementation principle and technical effects are similar to those described in the previous embodiments, and are not described herein again.
  • the present invention records the storage address in the logical address and the physical address mapping relationship area by recording the mapping relationship between the logical address and the physical address in the index area, thereby satisfying the query metadata under various search conditions, and supporting the basis Setting different indexes without using the application scenario makes the performance better, and can include multiple indexes in the index area, so that the query metadata can be satisfied under various conditions, and And increased the flexibility of metadata.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed are a system for constructing metadata and a method therefor. The method comprises the following steps: receiving a request for reading data or writing data (101); querying an index area of metadata according to a logical address in the request, and judging whether the logical address exists in the index area of the metadata (102); if so, querying a mapping relationship between the logical address and a physical address in a mapping relationship area of logical addresses and physical addresses, acquiring the physical address corresponding to the logical address, and reading data or writing data according to the physical address (103); otherwise, when the request is a data reading request, all the read data being zero (105); and when the request is a data writing request, allocating a physical address for the logical address, and writing the data according to the physical address (106). The method and system can meet the requirements for querying metadata under various conditions, and support setting different index types according to different application scenarios to enable the performance to be better, thereby increasing the flexibility of the metadata.

Description

一种元数据的构建系统及其方法  Metadata construction system and method thereof
技术领域 Technical field
本发明涉及存储技术领域, 特别是涉及一种元数据的构建系统及其方 法。  The present invention relates to the field of storage technologies, and in particular, to a metadata construction system and method thereof.
背景技术 Background technique
随着信息科学和技术的不断发展、 因特网的广泛应用、 云计算的不断普 及, 存储的数据量迅猛增长, 对存储系统资源的合理分配和利用也提出了更 高的要求。 现有技术中自动精简配置技术( Thin Provisioning, TP )将所有物 理存储空间汇集到精简池中进行统一管理,通过在精简池上创建的精简 LUN ( Logical Unit Number, 逻辑单元号)按需从精简池获得物理存储空间, 精 简 LUN, 即精简卷, 也称为 Thin LUN。 自动精简配置技术的使用可以简化 存储资源的配置管理, 节约物理存储资源。 在自动精简配置技术中, 元数据 主要用于保存精简 LUN逻辑地址和物理地址的映射关系 ( A Logic Address And Physical Address Mapping, LPM ) 。  With the continuous development of information science and technology, the widespread use of the Internet, and the continuous popularization of cloud computing, the amount of stored data is growing rapidly, and higher requirements are placed on the rational allocation and utilization of storage system resources. In the prior art, Thin Provisioning (TP) aggregates all physical storage space into a thin pool for unified management, and reduces the pool by using a thin LUN (Logical Unit Number) created on the thin pool as needed. Obtain physical storage space, thin LUNs, that is, thin volumes, also known as Thin LUNs. The use of thin provisioning technology simplifies configuration management of storage resources and conserves physical storage resources. In the thin provisioning technology, metadata is mainly used to store the Logic Address and Physical Address Mapping (LPM) of the reduced LUN.
现有技术中, 自动精简配置技术釆用 B树来存储元数据, 可以有效提高 元数据的访问效率, 具有很好的扩展性。 但是, 在某些场景下 (例如元数据 量较少时) , 釆用 B树存储元数据并不合适, 而且元数据的键值固定为精简 LUN的逻辑地址, 不能满足根据其他信息进行元数据查找的需求, 现有的元 数据存储方式缺少灵活性。 发明内容  In the prior art, the automatic thin provisioning technology uses the B-tree to store metadata, which can effectively improve the access efficiency of metadata and has good scalability. However, in some scenarios (such as when the amount of metadata is small), it is not appropriate to use B-tree to store metadata, and the key value of the metadata is fixed to the logical address of the thin LUN, which cannot satisfy the metadata based on other information. The need to find, the existing metadata storage method lacks flexibility. Summary of the invention
有鉴于此, 本发明实施例提供了一种元数据的构建系统及其方法, 以解 决元数据存储缺少灵活性的问题。  In view of this, embodiments of the present invention provide a metadata construction system and method thereof to solve the problem of lack of flexibility in metadata storage.
第一方面, 提供一种元数据的构建方法, 其包括以下步骤: 接收读取数 据或写入数据的请求; 根据请求中的逻辑地址查询元数据的索引区, 判断逻 辑地址在元数据的索引区中是否存在, 其中, 元数据包括索引区、 逻辑地址 和物理地址映射关系区, 索引区记录有逻辑地址和物理地址的映射关系在逻 辑地址和物理地址映射关系区中的存储地址; 若存在, 则根据索引区中逻辑 地址对应的逻辑地址和物理地址的映射关系在逻辑地址和物理地址映射关系 区中的存储地址, 在逻辑地址和物理地址映射关系区中查询逻辑地址和物理 地址的映射关系, 获取与逻辑地址对应的物理地址, 并才艮据物理地址读取数 据或写入数据; 若不存在, 则当请求为读取数据请求时, 读取到的数据为全 0; 当请求为写入数据请求时, 为逻辑地址分配物理地址, 并将逻辑地址和分 配的物理地址的映射关系存储在逻辑地址和物理地址映射关系区中, 在索引 区中为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索引记 录, 根据物理地址写入数据。 A first aspect provides a method for constructing metadata, comprising the steps of: receiving a request to read data or writing data; querying an index area of the metadata according to a logical address in the request, and determining an index of the logical address in the metadata Whether there is a zone, where the metadata includes an index area, a logical address And the physical address mapping relationship area, the index area records the storage address of the logical address and the physical address mapping relationship in the logical address and the physical address mapping relationship area; if yes, according to the logical address and the physical address corresponding to the logical address in the index area The mapping relationship between the logical address and the physical address mapping relationship area, the logical address and the physical address mapping relationship area are searched for the mapping relationship between the logical address and the physical address, and the physical address corresponding to the logical address is obtained, and the data is obtained. The physical address reads data or writes data; if it does not exist, when the request is a read data request, the read data is all 0; when the request is a write data request, the physical address is assigned to the logical address, and The mapping relationship between the logical address and the assigned physical address is stored in the logical address and the physical address mapping relationship area, and the corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, according to the physical address. data input.
结合第一方面, 在第一种可能的实现方式中, 方法还包括: 在创建精简 卷 Thin LUN时, 设置索引区的索引类型。  In combination with the first aspect, in a first possible implementation, the method further includes: setting an index type of the index area when creating the thin volume Thin LUN.
结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式中, 在索引区为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索引 记录, 包括: 在索引区为新增加的逻辑地址和分配的物理地址的映射关系根 据设置的索引类型建立相应的索引记录。  With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, a corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, including: The mapping relationship between the newly added logical address and the assigned physical address is established according to the set index type.
结合第一方面或第一方面的第一种或第二种可能的实现方式, 在第三种 可能的实现方式中, 索引区中针对同一逻辑地址和物理地址的映射关系建立 不同键值 KEY的至少两个索引。  With reference to the first aspect or the first or second possible implementation manner of the first aspect, in a third possible implementation manner, different key values KEY are established in the index area for the mapping relationship between the same logical address and the physical address. At least two indexes.
结合第一方面的第三种可能的实现方式, 在第四种可能的实现方式中, 在索引区为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索引 记录包括: 在索引区为新增加的逻辑地址和分配的物理地址的映射关系依次 在至少两个索引中分别建立相应的索引记录。  With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, establishing, in the index area, a corresponding index record for the mapping relationship between the newly added logical address and the allocated physical address includes: A mapping relationship between the newly added logical address and the assigned physical address is sequentially established in at least two indexes.
第二方面, 提供一种元数据的构建系统, 其包括: 10单元, 用于接收读 取数据或写入数据的请求; 处理单元, 用于根据 10单元获取的请求中的逻 辑地址查询元数据的索引区, 判断逻辑地址在元数据的索引区中是否存在, 其中, 元数据包括索引区、 逻辑地址和物理地址映射关系区, 索引区记录有 逻辑地址和物理地址的映射关系在逻辑地址和物理地址映射关系区中的存储 地址; 若逻辑地址在元数据的索引区中存在, 则处理单元, 还用于根据索引 区中逻辑地址对应的逻辑地址和物理地址的映射关系在逻辑地址和物理地址 映射关系区中的存储地址, 在逻辑地址和物理地址映射关系区中查询逻辑地 址和物理地址的映射关系, 获取与逻辑地址对应的物理地址, 并根据物理地 址读取数据或写入数据; 若逻辑地址在元数据的索引区中不存在, 则当请求 为读取数据请求时, 10单元, 还用于读取为全 0的数据; 当请求为写入数据 请求时, 处理单元, 还用于为逻辑地址分配物理地址, 并将逻辑地址和分配 的物理地址的映射关系存储在逻辑地址和物理地址映射关系区中, 并在索引 区中为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索引记 录; 10单元, 还用于根据物理地址写入数据。 A second aspect provides a metadata construction system, comprising: 10 units, configured to receive a request for reading data or writing data; and a processing unit, configured to query metadata according to a logical address in a request acquired by 10 units The index area determines whether the logical address exists in the index area of the metadata, wherein the metadata includes an index area, a logical address, and a physical address mapping relationship area, and the index area records a mapping relationship between the logical address and the physical address at the logical address and The physical address maps the storage address in the relational area; if the logical address exists in the index area of the metadata, the processing unit is further configured to map the logical address and the physical address according to the logical address and the physical address in the index area in the logical address and the physical Address Mapping the storage address in the relational area, querying the mapping relationship between the logical address and the physical address in the logical address and the physical address mapping relationship area, acquiring the physical address corresponding to the logical address, and reading data or writing data according to the physical address; The logical address does not exist in the index area of the metadata. When the request is a read data request, the 10 unit is also used to read the data as all 0s; when the request is a write data request, the processing unit also uses The physical address is assigned to the logical address, and the mapping relationship between the logical address and the assigned physical address is stored in the logical address and the physical address mapping relationship area, and the newly added logical address and the assigned physical address are mapped in the index area. The relationship establishes the corresponding index record; 10 units are also used to write data based on the physical address.
结合第二方面, 在第一种可能的实现方式中, 处理单元, 还用于在创建 精简卷时, 设置索引区的索引类型。  In conjunction with the second aspect, in a first possible implementation, the processing unit is further configured to set an index type of the index area when creating the thin volume.
结合第二方面的第一种可能的实现方式, 在第二种可能的实现方式中, 在 索引区为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索引记 录, 具体为:  With reference to the first possible implementation of the second aspect, in a second possible implementation manner, a corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, specifically:
在索引区为新增加的逻辑地址和分配的物理地址的映射关系根据设置的 索引类型建立相应的索引记录。  The mapping relationship between the newly added logical address and the assigned physical address in the index area is based on the set index type to establish a corresponding index record.
结合第二方面或第二方面的第一或第二种可能的实现方式, 在第三种可 能的实现方式中, 索引区中针对同一逻辑地址和物理地址的映射关系建立不 同键值 KEY的至少两个索引。  With reference to the second aspect or the first or second possible implementation manner of the second aspect, in a third possible implementation, the mapping between the same logical address and the physical address in the index area establishes at least a different key value KEY Two indexes.
结合第二方面的第三种可能的实现方式, 在第四种可能的实现方式中, 在 索引区为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索引记 录, 具体为:  With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation manner, a corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address, specifically:
在索引区为新增加的逻辑地址和分配的物理地址的映射关系依次在至少 两个索引中分别建立相应的索引记录。  The mapping relationship between the newly added logical address and the assigned physical address in the index area sequentially establishes corresponding index records in at least two indexes.
通过上述方案, 本发明的有益效果是: 本发明通过将元数据分为索引区、 逻辑地址和物理地址映射关系区, 在索引区中记录逻辑地址和物理地址的映 射关系在所述逻辑地址和物理地址映射关系区中的存储地址, 从而可以满足 各种搜索条件下查询元数据, 并且支持根据不用应用场景设置不同的索引使 性能较优, 增加了元数据的灵活性。  Through the foregoing solution, the beneficial effects of the present invention are: The present invention records the logical relationship between the logical address and the physical address in the index area by dividing the metadata into an index area, a logical address, and a physical address mapping relationship area. The physical address maps the storage address in the relational area, so that the query metadata can be satisfied under various search conditions, and the performance of the index is improved according to the different application scenarios, and the flexibility of the metadata is increased.
附图说明 为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中 所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本 发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的 前提下, 还可以根据这些附图获得其他的附图。 其中: DRAWINGS In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described. It is obvious that the drawings in the following description are only some embodiments of the present invention. Other drawings may also be obtained from those of ordinary skill in the art in view of the drawings. among them:
图 1是本发明第一实施例的元数据的构建方法的流程图;  1 is a flow chart showing a method of constructing metadata according to a first embodiment of the present invention;
图 2是图 1中元数据的结构示意图;  2 is a schematic structural diagram of metadata in FIG. 1;
图 3是本发明第二实施例的元数据的构建方法中设置索引区的索引类型 的流程图;  3 is a flow chart showing setting an index type of an index area in a method of constructing metadata according to a second embodiment of the present invention;
图 4是本发明第三实施例的元数据的构建方法中索引区的结构示意图; 图 5是本发明第一实施例的元数据的构建系统的结构示意图;  4 is a schematic structural diagram of an index area in a method for constructing metadata according to a third embodiment of the present invention; FIG. 5 is a schematic structural diagram of a metadata construction system according to a first embodiment of the present invention;
图 6是本发明第四实施例的元数据的构建系统的结构示意图。 具体实施方式  Fig. 6 is a block diagram showing the structure of a metadata construction system in accordance with a fourth embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出 创造性的劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
参阅图 1 , 图 1是本发明第一实施例的元数据的构建方法的流程图。 如 图 1所示, 本实施例所揭示的构建方法包括以下步骤:  Referring to FIG. 1, FIG. 1 is a flowchart of a method of constructing metadata according to a first embodiment of the present invention. As shown in FIG. 1, the construction method disclosed in this embodiment includes the following steps:
步骤 101 : 接收读取数据或写入数据的请求。  Step 101: Receive a request to read data or write data.
步骤 102: 根据请求中的逻辑地址查询元数据的索引区, 判断逻辑地址 在元数据的索引区中是否存在。  Step 102: Query the index area of the metadata according to the logical address in the request, and determine whether the logical address exists in the index area of the metadata.
优选的,元数据包括逻辑地址和物理地址映射关系区( Mapping Partition, MP )和索引区 ( Index Partition, IP ) , 如图 2所示。 逻辑地址和物理地址映 射关系区包括多条逻辑地址与物理地址的映射关系 LPM, 优选的, LPM可 以存储在物理磁盘的每 1G物理空间的最前面一段区域, 索引区 IP记录有逻 辑地址和物理地址的映射关系 LPM在逻辑地址和物理地址映射关系区 MP 中的存储地址。  Preferably, the metadata includes a logical address and a physical address mapping area (MP) and an index part (IP), as shown in FIG. 2. The mapping between the logical address and the physical address includes a mapping relationship between multiple logical addresses and physical addresses. Preferably, the LPM can be stored in the first segment of each physical space of the physical disk. The index area IP records logical addresses and physical addresses. Address mapping relationship The storage address of the LPM in the logical address and physical address mapping relationship area MP.
步骤 103 : 若存在, 则根据索引区中逻辑地址对应的逻辑地址和物理地 址的映射关系在逻辑地址和物理地址映射关系区中的存储地址, 在逻辑地址 和物理地址映射关系区中查询逻辑地址和物理地址的映射关系 , 获取与逻辑 地址对应的物理地址, 并根据物理地址读取数据或写入数据。 Step 103: If yes, according to the mapping relationship between the logical address and the physical address corresponding to the logical address in the index area, the storage address in the logical address and the physical address mapping relationship area, in the logical address Query the mapping relationship between the logical address and the physical address in the physical address mapping relationship area, obtain the physical address corresponding to the logical address, and read data or write data according to the physical address.
优选的, 若逻辑地址在元数据的索引区 IP中存在, 则根据逻辑地址在索 引区 IP中查找该逻辑地址对应的逻辑地址和物理地址的映射关系 LPM在逻 辑地址和物理地址映射关系区 MP中的存储地址, 根据存储地址在逻辑地址 和物理地址映射关系区 MP中读取对应的逻辑地址和物理地址的映射关系 LPM, 以获取与逻辑地址对应的物理地址, 并根据物理地址进行读取数据或 写入数据。  Preferably, if the logical address exists in the index area IP of the metadata, the mapping relationship between the logical address and the physical address corresponding to the logical address is searched in the index area IP according to the logical address. The logical address and the physical address mapping relationship area MP The storage address in the logical address and the physical address mapping relationship area MP reads the mapping relationship LPM of the corresponding logical address and the physical address according to the storage address, to obtain the physical address corresponding to the logical address, and reads according to the physical address Data or write data.
步骤 104: 若不存在, 则判断请求为读取数据请求或写入数据请求。 步骤 105: 当请求为读取数据请求时, 读取到的数据为全 0;  Step 104: If it does not exist, determine that the request is a read data request or a write data request. Step 105: When the request is a data read request, the read data is all 0;
步骤 106: 当请求为写入数据请求时, 为逻辑地址分配物理地址, 并将 逻辑地址和分配的物理地址的映射关系存储在元数据的逻辑地址和物理地址 映射关系区中, 在元数据的索引区中为新增加的逻辑地址和分配的物理地址 的映射关系建立相应的索引记录, 根据物理地址写入数据。  Step 106: When the request is a write data request, assign a physical address to the logical address, and store the mapping relationship between the logical address and the allocated physical address in the logical address and physical address mapping relationship area of the metadata, in the metadata In the index area, a corresponding index record is established for the mapping relationship between the newly added logical address and the assigned physical address, and data is written according to the physical address.
在本实施例中, 本实施例通过将元数据分为索引区 IP、 逻辑地址和物理 地址映射关系区 MP, 在索引区 IP中记录逻辑地址和物理地址的映射关系 LPM在所述逻辑地址和物理地址映射关系区 MP中的存储地址, 从而可以满 足各种搜索条件下查询元数据, 增加了元数据的灵活性。  In this embodiment, the present embodiment divides the metadata into an index area IP, a logical address, and a physical address mapping relationship area MP, and records a mapping relationship between the logical address and the physical address in the index area IP at the logical address and The physical address maps the storage address in the relational area MP, so that the query metadata can be satisfied under various search conditions, and the flexibility of the metadata is increased.
本发明还提供第二实施例的元数据的构建方法, 其在第一实施例所揭示 的方法的基础上进行详细描述。 本实施例所揭示的方法还包括: 在创建精简 卷时, 设置索引区的索引类型。 相应的, 在步骤 106中, 在元数据的索引区 为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索引记录, 包 括: 在元数据的索引区为新增加的逻辑地址和所述分配的物理地址的映射关 系根据索引类型建立相应的索引记录。  The present invention also provides a method of constructing metadata of the second embodiment, which is described in detail based on the method disclosed in the first embodiment. The method disclosed in this embodiment further includes: when creating a thin volume, setting an index type of the index area. Correspondingly, in step 106, a corresponding index record is established in the index area of the metadata for the mapping relationship between the newly added logical address and the allocated physical address, including: a newly added logical address and a location in the index area of the metadata The mapping relationship of the assigned physical addresses establishes a corresponding index record according to the index type.
本实施例所揭示的方法还包括设置索引区的索引类型的方法。 如图 3所 示, 在创建精简卷时, 设置索引区的索引类型包括以下步骤:  The method disclosed in this embodiment further includes a method of setting an index type of an index area. As shown in Figure 3, when creating a thin volume, setting the index type of the index area includes the following steps:
步骤 301 : 设置精简 LUN相关参数; 例如, 精简 LUN的大小、 回透写 策略等参数。  Step 301: Set the LUN-related parameters; for example, the size of the LUN, the write-back policy, and other parameters.
步骤 302: 提示用户选择索引的类型;  Step 302: prompt the user to select a type of the index;
步骤 303 : 创建精简 LUN, 并根据用户选择设置索引类型。 在步骤 302中, 用户根据不同的应用场景和精简卷的大小选择索引的类 型, 例如, 在精简卷较小, 元数据的索引可以存储在内存时, 可以选择平衡 二叉树的结构来存储索引; 在精简卷较大, 写入数据较少时, 可以选择哈希 ( Hash )表结构来存储索引; 在精简卷较大, 且写入数据较多时, 可以选择 线性表结构来存储索引; 在精简卷较大, 写入数据量不确定时, 可以选择 B 树及其变体的结构来存储索引。 Step 303: Create a thin LUN and set the index type according to the user selection. In step 302, the user selects the type of the index according to different application scenarios and the size of the thinned volume. For example, when the thinned volume is small, and the index of the metadata can be stored in the memory, the structure of the balanced binary tree can be selected to store the index; The thin volume is large, and when the write data is small, the hash table structure can be selected to store the index; when the thin volume is large, and the write data is large, the linear table structure can be selected to store the index; Larger, when the amount of write data is uncertain, you can choose the structure of the B-tree and its variants to store the index.
在本实施例中, 通过根据不用的应用场景和精简卷的大小, 设置不同的 索引类型, 以使精简卷在各种应用场景下性能达到最优。  In this embodiment, different index types are set according to the unused application scenarios and the size of the thinned volume, so that the performance of the thinned volume in various application scenarios is optimized.
本发明还提供第三实施例的元数据的构建方法, 其在第二实施例所揭示 的方法的基础上进行详细描述。 本实施例所揭示的方法还包括: 索引区中针 对同一逻辑地址和物理地址的映射关系建立不同键值 KEY的至少两个索引。 即, 针对同一个逻辑地址和物理地址的映射关系 LPM, 用户可以根据业务的 需要, 选择建立多个索引以提升性能, 优选的, 建立不同键值 KEY的索引。 如图 4所示, 索引区 400包括逻辑地址的索引 401和物理地址的索引 402。 其中, 对元数据不同的查询需求使用不同的索引, 可以显著提高查询元数据 的性能。例如,根据物理地址查询逻辑地址时,如果只有逻辑地址的索引 401 , 则必须查询所有的元数据, 以获取逻辑地址; 如果索引区包括物理地址的索 引 402 , 则能够通过物理地址的索引 402直接查询元数据, 以获取逻辑地址, 进而提高查询元数据的性能。 进一步的, 多个索引的类型可以不同, 也可以 相同, 比如一个索引是以逻辑地址为键值的 B树, 另一个索引是以物理地址 为键值的 B树。  The present invention also provides a method of constructing metadata of the third embodiment, which is described in detail based on the method disclosed in the second embodiment. The method disclosed in this embodiment further includes: establishing at least two indexes of different key values KEY for the mapping relationship between the same logical address and the physical address in the index area. That is, for the mapping relationship between the same logical address and the physical address LPM, the user can select multiple indexes to improve performance according to the needs of the service, and preferably, establish indexes of different key values KEY. As shown in FIG. 4, the index area 400 includes an index 401 of a logical address and an index 402 of a physical address. Among them, the use of different indexes for different query requirements of metadata can significantly improve the performance of query metadata. For example, when the logical address is queried according to the physical address, if there is only the index 401 of the logical address, all the metadata must be queried to obtain the logical address; if the index area includes the index 402 of the physical address, the index 402 of the physical address can be directly Query metadata to obtain logical addresses, which in turn improves the performance of query metadata. Further, the types of the multiple indexes may be different or the same, for example, one index is a B-tree with a logical address as a key value, and the other index is a B-tree with a physical address as a key value.
则, 相应的, 在步骤 106中, 在元数据的索引区为新增加的逻辑地址和 分配的物理地址的映射关系建立相应的索引记录, 包括: 在元数据的索引区 为新增加的逻辑地址和分配的物理地址的映射关系依次在至少两个索引中分 别建立相应的索引记录, 即, 依次在逻辑地址的索引 401和物理地址的索引 402中分别建立相应的索引记录。  Then, in step 106, a corresponding index record is established in the index area of the metadata for the mapping relationship between the newly added logical address and the allocated physical address, including: a newly added logical address in the index area of the metadata The mapping relationship with the assigned physical address sequentially establishes corresponding index records in at least two indexes, that is, the corresponding index records are respectively established in the index 401 of the logical address and the index 402 of the physical address.
在本实施例中, 通过索引区中针对同一逻辑地址和物理地址的映射关系 建立不同键值 KEY的至少两个索引, 可以提高查询元数据的性能, 并且增 加了精简卷的应用场景和元数据的灵活性。  In this embodiment, at least two indexes of different key values KEY are established by mapping the same logical address and the physical address in the index area, which can improve the performance of the query metadata, and increase the application scenarios and metadata of the thin volume. Flexibility.
本发明还提供第一实施例的元数据的构建系统, 其在第一实施例所揭示 的方法的基础上进行详细描述。 如图 5所示, 本实施例所揭示的构建系统 50 包括: 10 ( Input/Output, 输入 /输出 ) 单元 501以及处理单元 502。 The present invention also provides a metadata construction system of the first embodiment, which is disclosed in the first embodiment The method is described in detail based on the method. As shown in FIG. 5, the construction system 50 disclosed in this embodiment includes: 10 (Input/Output) unit 501 and processing unit 502.
在本实施例中, 10单元 501 , 用于接收读取数据或写入数据的请求。 处理单元 502, 用于从 10单元 501获取请求, 根据请求中的逻辑地址查 询元数据的索引区 IP, 判断逻辑地址在元数据的索引区 IP中是否存在。  In this embodiment, 10 unit 501 is configured to receive a request to read data or write data. The processing unit 502 is configured to obtain a request from the 10 unit 501, query the index area IP of the metadata according to the logical address in the request, and determine whether the logical address exists in the index area IP of the metadata.
若该逻辑地址在元数据的索引区中存在, 则, 处理单元 502 , 用于根据 该逻辑地址在索引区 IP中查找该逻辑地址对应的逻辑地址和物理地址的映 射关系 LPM在逻辑地址和物理地址映射关系区 MP中的存储地址,并进一步 根据存储地址在逻辑地址和物理地址映射关系区 MP中查找对应的逻辑地址 和物理地址的映射关系 LPM, 以获取与逻辑地址对应的物理地址, 并根据物 理地址进行读取数据或写入数据。  If the logical address exists in the index area of the metadata, the processing unit 502 is configured to search, in the index area IP, the mapping relationship between the logical address and the physical address corresponding to the logical address according to the logical address, the logical address and the physical Addressing the storage address in the relational area MP, and further searching the mapping relationship LPM of the corresponding logical address and the physical address in the logical address and the physical address mapping relationship area MP according to the storage address, to obtain the physical address corresponding to the logical address, and Read data or write data based on physical address.
若该逻辑地址在元数据的索引区中不存在,则当请求为读取数据请求时, 10单元 501 , 还用于读取为全 0的数据; 当请求为写入数据请求时, 处理单 元 502 , 还用于为逻辑地址分配物理地址, 并将逻辑地址和分配的物理地址 的映射关系存储在元数据的逻辑地址和物理地址映射关系区中, 并在元数据 的索引区中为新增加的逻辑地址和分配的物理地址的映射关系建立相应的索 引记录, 10单元 501还用于根据物理地址写入数据。  If the logical address does not exist in the index area of the metadata, when the request is a read data request, the 10 unit 501 is also used to read data of all 0s; when the request is a write data request, the processing unit 502. The physical address is further allocated to the logical address, and the mapping relationship between the logical address and the allocated physical address is stored in the logical address and the physical address mapping relationship area of the metadata, and is newly added in the index area of the metadata. The mapping relationship between the logical address and the assigned physical address establishes a corresponding index record, and the 10 unit 501 is also used to write data according to the physical address.
在本实施例中, 元数据包括逻辑地址和物理地址映射关系区和索引区, 如图 2所示。 逻辑地址和物理地址映射关系区包括多条逻辑地址与物理地址 的映射关系 LPM , LPM存储在物理磁盘的每 1 G物理空间的最前面一段区域, 索引区 IP记录有逻辑地址和物理地址的映射关系 LPM在逻辑地址和物理地 址映射关系区 MP中的存储地址。  In this embodiment, the metadata includes a logical address and a physical address mapping relationship area and an index area, as shown in FIG. 2. The mapping between the logical address and the physical address includes a mapping relationship between multiple logical addresses and physical addresses. The LPM is stored in the first segment of each physical space of the physical disk. The IP address of the index area records the mapping between logical addresses and physical addresses. The storage address of the relational LPM in the logical address and physical address mapping relationship area MP.
值得注意的是, 在本发明的其他实施例中, 本领域普通技术人员完全可 以将 10单元 501设置为读取单元和写入单元。  It should be noted that in other embodiments of the present invention, those skilled in the art can fully set 10 units 501 as read units and write units.
在本实施例中, 本实施例通过处理单元 502将元数据分为索引区 IP、 逻 辑地址和物理地址映射关系区 MP, 在索引区 IP中记录逻辑地址和物理地址 的映射关系 LPM在所述逻辑地址和物理地址映射关系区 MP中的存储地址, 从而可以满足各种搜索条件下查询元数据, 增加了元数据的灵活性。  In this embodiment, the processing unit 502 divides the metadata into an index area IP, a logical address, and a physical address mapping relationship area MP, and records a mapping relationship between the logical address and the physical address in the index area IP. The logical address and the physical address map the storage address in the relationship area MP, so that the query metadata can be satisfied under various search conditions, and the flexibility of the metadata is increased.
本发明还提供第二实施例的元数据的构建系统, 其在第一实施例所揭示 的系统 50的基础上进行详细描述。本实施例所揭示的系统中,处理单元 502 , 还用于在创建精简卷时, 设置索引区的索引类型。 优选的, 用户可以根据不 同的应用场景和精简 LU 的大小选择索引的类型, 例如, 在精简 LUN较小 时, 元数据的索引可以存储在内存时, 可以选择平衡二叉树的结构来存储索 引; 在精简 LUN较大, 写入数据较少时, 可以选择 Hash表结构来存储索引; 在精简 LUN较大, 写入数据较多时, 可以选择线性表结构来存储索引; 在 精简 LUN较大, 写入数据量不确定时, 可以选择 B树及其变体的结构来存 储索引。 The present invention also provides a metadata construction system of the second embodiment, which is described in detail based on the system 50 disclosed in the first embodiment. In the system disclosed in this embodiment, the processing unit 502, Also used to set the index type of the index area when creating a thin volume. Preferably, the user can select the type of the index according to different application scenarios and the size of the reduced LU. For example, when the reduced LUN is small, the index of the metadata can be stored in the memory, and the structure of the balanced binary tree can be selected to store the index; The LUN is large. When the data is written less, the Hash table structure can be selected to store the index. When the thin LUN is large, when the data is written, the linear table structure can be selected to store the index. In the thin LUN, the data is written. When the amount is uncertain, you can choose the structure of the B-tree and its variants to store the index.
在本实施例中, 若请求为写入数据, 则处理单元 502在索引区为新增加 的逻辑地址和分配的物理地址的映射关系建立相应的索引记录, 具体为: 处 理单元 502在元数据的索引区为新增加的逻辑地址和分配的物理地址的映射 关系根据索引类型建立相应的索引记录。  In this embodiment, if the request is to write data, the processing unit 502 establishes a corresponding index record in the index area for the mapping relationship between the newly added logical address and the assigned physical address, specifically: the processing unit 502 is in the metadata. The index area is a mapping relationship between the newly added logical address and the assigned physical address, and the corresponding index record is established according to the index type.
本发明还提供第三实施例的元数据的构建系统, 其与第二实施例所揭示 的系统的不同之处在于: 索引区中针对同一逻辑地址和物理地址的映射关系 建立不同键值 KEY的至少两个索引。 处理单元 502通过建立多个索引, 对 元数据不同的查询需求使用不同的索引, 可以显著提高查询元数据的性能。 此外, 处理单元 502在索引区为新增加的逻辑地址和分配的物理地址的映射 关系建立相应的索引记录, 具体为: 处理单元 502在索引区为新增加的逻辑 地址和分配的物理地址的映射关系依次在至少两个索引中分别建立相应的索 引记录。  The present invention also provides a metadata construction system of the third embodiment, which is different from the system disclosed in the second embodiment in that: in the index area, different key values KEY are established for the mapping relationship between the same logical address and the physical address. At least two indexes. The processing unit 502 can significantly improve the performance of the query metadata by establishing multiple indexes and using different indexes for different query requirements of the metadata. In addition, the processing unit 502 establishes a corresponding index record for the mapping relationship between the newly added logical address and the allocated physical address in the index area, specifically: the processing unit 502 is a mapping of the newly added logical address and the allocated physical address in the index area. The relationship in turn establishes a corresponding index record in at least two indexes.
请参见图 6 , 图 6是本发明第四实施例的元数据的构建系统。 如图 6所 示,本实施例所揭示的系统 60包括 10接口 603以及处理器 601、存储器 604、 通信总线 602。 其中, 10接口 603用于接收读取数据或写入数据的请求, 存 储器 604存储执行指令, 当构建系统 60运行时, 处理器 601与存储器 604 之间通信,处理器 601执行执行指令使得构建系统 60用于实现本发明第一实 施例至第三实施例的元数据的构建方法。 实现原理和技术效果与前面实施例 中所述的方法类似, 此处不再赘述。  Referring to FIG. 6, FIG. 6 is a system for constructing metadata according to a fourth embodiment of the present invention. As shown in FIG. 6, the system 60 disclosed in this embodiment includes a 10 interface 603 and a processor 601, a memory 604, and a communication bus 602. Wherein, the 10 interface 603 is for receiving a request for reading data or writing data, the memory 604 stores execution instructions, when the construction system 60 is running, the processor 601 is in communication with the memory 604, and the processor 601 executes execution instructions to construct the system. 60 is a method for constructing metadata of the first to third embodiments of the present invention. The implementation principle and technical effects are similar to those described in the previous embodiments, and are not described herein again.
综上所述, 本发明通过在索引区中记录逻辑地址和物理地址的映射关系 在逻辑地址和物理地址映射关系区中的存储地址, 从而可以满足各种搜索条 件下查询元数据, 并且支持根据不用应用场景设置不同的索引使性能较优, 以及可以在索引区包括多个索引, 从而可以满足各种条件下查询元数据, 并 且增加了元数据的灵活性。 In summary, the present invention records the storage address in the logical address and the physical address mapping relationship area by recording the mapping relationship between the logical address and the physical address in the index area, thereby satisfying the query metadata under various search conditions, and supporting the basis Setting different indexes without using the application scenario makes the performance better, and can include multiple indexes in the index area, so that the query metadata can be satisfied under various conditions, and And increased the flexibility of metadata.
以上所述仅为本发明的实施例, 并非因此限制本发明的专利范围, 凡是 利用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直接或间 接运用在其他相关的技术领域, 均同理包括在本发明的专利保护范围内。  The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present invention may be directly or indirectly applied to other related technologies. The scope of the invention is included in the scope of patent protection of the present invention.

Claims

权 利 要 求 Rights request
1、 一种元数据的构建方法, 其特征在于, 所述方法包括以下步骤: 接收读取数据或写入数据的请求; 1. A method for constructing metadata, characterized in that the method includes the following steps: receiving a request to read data or write data;
根据所述请求中的逻辑地址查询元数据的索引区,判断所述逻辑地址在 所述元数据的索引区中是否存在, 其中, 所述元数据包括所述索引区、 逻辑 地址和物理地址映射关系区,所述索引区记录有逻辑地址和物理地址的映射 关系在所述逻辑地址和物理地址映射关系区中的存储地址; 地址的映射关系在所述逻辑地址和物理地址映射关系区中的存储地址,在所 述逻辑地址和物理地址映射关系区中查询所述逻辑地址和物理地址的映射 关系, 获取与所述逻辑地址对应的物理地址, 并根据所述物理地址读取数据 或写入数据; Query the index area of metadata according to the logical address in the request, and determine whether the logical address exists in the index area of the metadata, where the metadata includes the index area, logical address and physical address mapping The relationship area, the index area records the storage address of the mapping relationship between the logical address and the physical address in the mapping relationship area between the logical address and the physical address; the mapping relationship of the address in the mapping relationship between the logical address and the physical address. To store an address, query the mapping relationship between the logical address and the physical address in the mapping relationship area between the logical address and the physical address, obtain the physical address corresponding to the logical address, and read or write data according to the physical address. data;
若不存在, 则当所述请求为读取数据请求时, 读取到的数据为全 0; 当 所述请求为写入数据请求时, 为所述逻辑地址分配物理地址, 并将所述逻辑 地址和所述分配的物理地址的映射关系存储在所述逻辑地址和物理地址映 射关系区中,在所述索引区中为新增加的所述逻辑地址和所述分配的物理地 址的映射关系建立相应的索引记录, 根据所述物理地址写入数据。 If it does not exist, then when the request is a read data request, the read data is all 0; when the request is a write data request, a physical address is assigned to the logical address, and the logical address is The mapping relationship between the address and the allocated physical address is stored in the mapping relationship area between the logical address and the physical address, and a mapping relationship between the newly added logical address and the allocated physical address is established in the index area. The corresponding index record writes data according to the physical address.
2、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 2. The method according to claim 1, characterized in that, the method further includes:
在创建精简卷 Thin LUN时, 设置所述索引区的索引类型。 When creating a thin volume Thin LUN, set the index type of the index area.
3、 根据权利要求 2所述的方法, 其特征在于, 所述在所述索引区为新增 加的所述逻辑地址和所述分配的物理地址的映射关系建立相应的索引记录, 包括: 3. The method according to claim 2, characterized in that: establishing a corresponding index record in the index area for the mapping relationship between the newly added logical address and the allocated physical address includes:
在所述索引区为新增加的所述逻辑地址和所述分配的物理地址的映射 关系根据所述设置的索引类型建立相应的索引记录。 A corresponding index record is established in the index area for the mapping relationship between the newly added logical address and the allocated physical address according to the set index type.
4、 根据权利要求 1至 3任一所述的方法, 其特征在于, 4. The method according to any one of claims 1 to 3, characterized in that,
所述索引区中针对同一逻辑地址和物理地址的映射关系建立不同键值 KEY的至少两个索引。 In the index area, at least two indexes of different key values KEY are established for the mapping relationship between the same logical address and physical address.
5、 根据权利要求 4所述的方法, 其特征在于, 所述在所述索引区为新增 加的所述逻辑地址和所述分配的物理地址的映射关系建立相应的索引记录 包括: 在所述索引区为新增加的所述逻辑地址和所述分配的物理地址的映射 关系依次在所述至少两个索引中分别建立相应的索引记录。 5. The method according to claim 4, wherein establishing a corresponding index record in the index area for the mapping relationship between the newly added logical address and the allocated physical address includes: In the index area, corresponding index records are respectively established in the at least two indexes for the mapping relationship between the newly added logical address and the allocated physical address.
6、 一种元数据的构建系统, 其特征在于, 包括: 6. A metadata construction system, characterized by including:
10单元, 用于接收读取数据或写入数据的请求; 10 units, used to receive requests to read data or write data;
处理单元, 用于根据所述 10单元获取的所述请求中的逻辑地址查询元 数据的索引区,判断所述逻辑地址在所述元数据的索引区中是否存在,其中, 所述元数据包括所述索引区、 逻辑地址和物理地址映射关系区, 所述索引区 记录有逻辑地址和物理地址的映射关系在所述逻辑地址和物理地址映射关 系区中的存储地址; The processing unit is configured to query the index area of metadata according to the logical address in the request obtained by the 10 unit, and determine whether the logical address exists in the index area of the metadata, wherein the metadata includes The index area, the logical address and the physical address mapping relationship area, the index area records the storage address of the mapping relationship between the logical address and the physical address in the logical address and physical address mapping relationship area;
若所述逻辑地址在所述元数据的索引区中存在, 则所述处理单元, 还用 关系在所述逻辑地址和物理地址映射关系区中的存储地址,在所述逻辑地址 和物理地址映射关系区中查询所述逻辑地址和物理地址的映射关系,获取与 所述逻辑地址对应的物理地址, 并根据所述物理地址读取数据或写入数据; 若所述逻辑地址在所述元数据的索引区中不存在, 则 If the logical address exists in the index area of the metadata, the processing unit also uses the storage address in the mapping relationship area between the logical address and the physical address to map the logical address and the physical address. Query the mapping relationship between the logical address and the physical address in the relationship area, obtain the physical address corresponding to the logical address, and read or write data according to the physical address; if the logical address is in the metadata does not exist in the index area, then
当所述请求为读取数据请求时, When the request is a read data request,
所述 10单元, 还用于读取为全 0的数据; The 10 units are also used to read data that is all 0;
当所述请求为写入数据请求时, When the request is a write data request,
所述处理单元, 还用于为所述逻辑地址分配物理地址, 将所述逻辑地址 和所述分配的物理地址的映射关系存储在所述逻辑地址和物理地址映射关 系区中,并在所述索引区中为新增加的所述逻辑地址和所述分配的物理地址 的映射关系建立相应的索引记录; The processing unit is further configured to allocate a physical address to the logical address, store the mapping relationship between the logical address and the allocated physical address in the logical address and physical address mapping relationship area, and store the mapping relationship between the logical address and the physical address in the mapping relationship area. Establish a corresponding index record in the index area for the mapping relationship between the newly added logical address and the allocated physical address;
所述 10单元, 还用于根据所述物理地址写入数据。 The 10 unit is also used to write data according to the physical address.
7、 根据权利要求 6所述的系统, 其特征在于, 7. The system according to claim 6, characterized in that,
所述处理单元, 还用于在创建精简卷时, 设置所述索引区的索引类型。 The processing unit is also used to set the index type of the index area when creating a thin volume.
8、 根据权利要求 7所述的系统, 其特征在于, 所述在所述索引区为新增 加的所述逻辑地址和所述分配的物理地址的映射关系建立相应的索引记录, 具体为: 8. The system according to claim 7, characterized in that, in the index area, a corresponding index record is established for the mapping relationship between the newly added logical address and the allocated physical address, specifically:
所述在所述索引区为新增加的所述逻辑地址和所述分配的物理地址的 映射关系根据所述设置的索引类型建立相应的索引记录。 The mapping relationship between the newly added logical address and the allocated physical address in the index area is to establish a corresponding index record according to the set index type.
9、 根据权利要求 6至 8任一所述的系统, 其特征在于, 9. The system according to any one of claims 6 to 8, characterized in that,
所述索引区中针对同一逻辑地址和物理地址的映射关系建立不同键值 KEY的至少两个索引。 In the index area, at least two indexes of different key values KEY are established for the mapping relationship between the same logical address and physical address.
10、 根据权利要求 9所述的系统, 其特征在于, 所述在所述索引区为新 增加的所述逻辑地址和所述分配的物理地址的映射关系建立相应的索引记 录, 具体为: 10. The system according to claim 9, characterized in that, in the index area, a corresponding index record is established for the mapping relationship between the newly added logical address and the allocated physical address, specifically:
在所述索引区为新增加的所述逻辑地址和所述分配的物理地址的映射关系 依次在所述至少两个索引中分别建立相应的索引记录。 In the index area, corresponding index records are respectively established in the at least two indexes for the mapping relationship between the newly added logical address and the allocated physical address.
PCT/CN2013/080710 2012-12-28 2013-08-02 System for constructing metadata and method therefor WO2014101420A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210584334.9 2012-12-28
CN201210584334.9A CN103019953B (en) 2012-12-28 2012-12-28 Construction system and construction method for metadata

Publications (1)

Publication Number Publication Date
WO2014101420A1 true WO2014101420A1 (en) 2014-07-03

Family

ID=47968578

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/080710 WO2014101420A1 (en) 2012-12-28 2013-08-02 System for constructing metadata and method therefor

Country Status (2)

Country Link
CN (1) CN103019953B (en)
WO (1) WO2014101420A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555020A (en) * 2018-03-26 2019-12-10 阿里巴巴集团控股有限公司 Mapping relation establishing and data querying methods, devices and equipment
CN111352594A (en) * 2020-03-12 2020-06-30 上海路虹电子科技有限公司 Method and device for writing data and reading data in eFuse
CN111782632A (en) * 2020-06-28 2020-10-16 百度在线网络技术(北京)有限公司 Data processing method, device, equipment and storage medium

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019953B (en) * 2012-12-28 2015-06-03 华为技术有限公司 Construction system and construction method for metadata
CN103984640B (en) * 2014-05-14 2017-06-20 华为技术有限公司 Realize data prefetching method and device
US20160063021A1 (en) * 2014-08-28 2016-03-03 Futurewei Technologies, Inc. Metadata Index Search in a File System
CN104407935B (en) * 2014-11-07 2018-05-18 华为数字技术(成都)有限公司 Snapshot rollback method and storage device
US9942324B2 (en) * 2015-08-05 2018-04-10 Futurewei Technologies, Inc. Rebalancing and elastic storage scheme with elastic named distributed circular buffers
CN105955893B (en) * 2016-05-05 2019-07-26 捷开通讯(深圳)有限公司 Wiring method, read method and the intelligent terminal of storing data
CN108628893A (en) * 2017-03-21 2018-10-09 华为技术有限公司 Metadata access method and storage device in a kind of storage device
CN111061655B (en) * 2017-12-28 2022-06-17 贵阳忆芯科技有限公司 Address translation method and device for storage device
CN108845764A (en) * 2018-05-30 2018-11-20 郑州云海信息技术有限公司 A kind of processing method and processing device of I/O data
CN111435331B (en) * 2019-01-14 2022-08-26 杭州宏杉科技股份有限公司 Data writing method and device for storage volume, electronic equipment and machine-readable storage medium
CN110018998B (en) * 2019-04-12 2023-05-12 深信服科技股份有限公司 File management method and system, electronic equipment and storage medium
CN110532201B (en) * 2019-08-23 2021-08-31 北京浪潮数据技术有限公司 Metadata processing method and device
CN113392040B (en) * 2021-06-23 2023-03-21 锐捷网络股份有限公司 Address mapping method, device and equipment
CN113868155B (en) * 2021-11-30 2022-03-08 苏州浪潮智能科技有限公司 Memory space expansion method and device, electronic equipment and storage medium
CN115576956B (en) * 2022-12-07 2023-03-10 苏州浪潮智能科技有限公司 Data processing method, system, equipment and storage medium
CN116880780A (en) * 2023-09-08 2023-10-13 合肥康芯威存储技术有限公司 Tree data writing method, device, machine-readable medium and memory

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060064568A1 (en) * 2004-09-21 2006-03-23 Pak-Lung Seto Integrated circuit capable of mapping logical block address data across multiple domains
US20100070729A1 (en) * 2008-09-18 2010-03-18 Seagate Technology Llc System and method of managing metadata
CN102473082A (en) * 2009-07-27 2012-05-23 株式会社巨晶片 Display system and image reproduction device
CN103019953A (en) * 2012-12-28 2013-04-03 华为技术有限公司 Construction system and construction method for metadata

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102651009B (en) * 2011-02-28 2014-09-24 国际商业机器公司 Method and equipment for retrieving data in storage system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060064568A1 (en) * 2004-09-21 2006-03-23 Pak-Lung Seto Integrated circuit capable of mapping logical block address data across multiple domains
US20100070729A1 (en) * 2008-09-18 2010-03-18 Seagate Technology Llc System and method of managing metadata
CN102473082A (en) * 2009-07-27 2012-05-23 株式会社巨晶片 Display system and image reproduction device
CN103019953A (en) * 2012-12-28 2013-04-03 华为技术有限公司 Construction system and construction method for metadata

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555020A (en) * 2018-03-26 2019-12-10 阿里巴巴集团控股有限公司 Mapping relation establishing and data querying methods, devices and equipment
CN110555020B (en) * 2018-03-26 2023-04-11 阿里巴巴集团控股有限公司 Mapping relation establishing and data querying methods, devices and equipment
CN111352594A (en) * 2020-03-12 2020-06-30 上海路虹电子科技有限公司 Method and device for writing data and reading data in eFuse
CN111352594B (en) * 2020-03-12 2023-06-20 湖州旻合科技有限公司 Method and device for writing data and reading data in eFuse
CN111782632A (en) * 2020-06-28 2020-10-16 百度在线网络技术(北京)有限公司 Data processing method, device, equipment and storage medium
US11847161B2 (en) 2020-06-28 2023-12-19 Baidu Online Network Technology (Beijing) Co., Ltd. Data processing method and apparatus, device, and storage medium

Also Published As

Publication number Publication date
CN103019953B (en) 2015-06-03
CN103019953A (en) 2013-04-03

Similar Documents

Publication Publication Date Title
WO2014101420A1 (en) System for constructing metadata and method therefor
US10324832B2 (en) Address based multi-stream storage device access
US10866905B2 (en) Access parameter based multi-stream storage device access
US9229826B2 (en) Volatile memory representation of nonvolatile storage device set
US9298384B2 (en) Method and device for storing data in a flash memory using address mapping for supporting various block sizes
US20220261377A1 (en) Scalable multi-tier storage structures and techniques for accessing entries therein
CN114860163B (en) Storage system, memory management method and management node
WO2014089828A1 (en) Method for accessing storage device and storage device
KR20170088933A (en) File access method and apparatus and storage device
WO2013004136A1 (en) Distributed storage method, device and system
EP2891051A1 (en) Block-level access to parallel storage
WO2021159711A1 (en) B+ tree access method and apparatus, and computer-readable storage medium
WO2014089981A1 (en) Data processing method and storing system for applied metadata
US9110820B1 (en) Hybrid data storage system in an HPC exascale environment
US8447947B2 (en) Method and interface for allocating storage capacities to plural pools
WO2024078429A1 (en) Memory management method and apparatus, computer device, and storage medium
WO2023035646A1 (en) Method and apparatus for expanding memory, and related device
TW202203033A (en) Storage device and system and method of managing namespaces in storage device
CN111274259A (en) Data updating method for storage nodes in distributed storage system
WO2022262381A1 (en) Data compression method and apparatus
WO2017128802A1 (en) Architecture and method for managing storage space
CN111190867A (en) Storage layering system for file storage
US20200363976A1 (en) Multithreading for Rotation Operations in a File System
CN115470154A (en) Data access method, management equipment, address management device and storage system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13867488

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13867488

Country of ref document: EP

Kind code of ref document: A1