WO2014089981A1 - Data processing method and storing system for applied metadata - Google Patents

Data processing method and storing system for applied metadata Download PDF

Info

Publication number
WO2014089981A1
WO2014089981A1 PCT/CN2013/080973 CN2013080973W WO2014089981A1 WO 2014089981 A1 WO2014089981 A1 WO 2014089981A1 CN 2013080973 W CN2013080973 W CN 2013080973W WO 2014089981 A1 WO2014089981 A1 WO 2014089981A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
mapping
write request
data
mapping relationship
Prior art date
Application number
PCT/CN2013/080973
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 WO2014089981A1 publication Critical patent/WO2014089981A1/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/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a data processing method and a storage system for applying metadata.
  • the storage system needs to meet the needs of the current business, and can manage the storage of massive data through simple configuration; on the other hand, in the process of not growing the business, the storage system can be expanded and pressed as the business grows. Need to allocate storage resources. As a result, thin provisioning technology has emerged.
  • Thin provisioning technology is a storage virtualization technology that evolves directly from the traditional spatial allocation method. It combines all storage space into a thin pool for unified management, creating thin logical units on the thin pool, and streamlining them on demand. The pool gets physical storage space.
  • the use of thin provisioning technology simplifies configuration management of storage resources and saves physical storage resources.
  • metadata is mainly used to store the mapping relationship between logical addresses and physical addresses. The reliability of metadata is the core technology in thin provisioning technology.
  • the storage system reads and writes data by using metadata having a B-tree or B-tree variant (such as a B+tree) structure.
  • the mapping between the logical address and the physical address is stored in the node of the B-tree metadata, and the B-tree structure can effectively improve the access efficiency of the metadata, and has good scalability.
  • the logical address and physical address mapping relationship stored by the node is lost, and the storage system searches for the underlying node of the damaged node, resulting in the storage system being unable to be affected by the metadata.
  • the stored logical address is processed on the physical address corresponding to the physical address mapping relationship.
  • an embodiment of the present invention provides a data processing method and a storage system for applying metadata, so as to prevent a logical address and a physical address mapping of a storage system from being stored in other parts of the metadata when the metadata is partially damaged.
  • the data is processed at the physical address corresponding to the relationship.
  • an embodiment of the present invention provides a data processing method for applying metadata.
  • the metadata includes: a mapping area for storing a mapping relationship between a logical address and a physical address, and an index area for querying a location of a logical address and a physical address mapping relationship in the mapping area; the method includes: storing Receiving a read or write request of the data, the read or write request carrying a logical address; querying, by the index information of the index area, whether the logical address and the physical address are saved in the mapping area according to the logical address Mapping relationship between
  • mapping relationship is saved in the mapping area, the data is read or written on the physical address corresponding to the mapping relationship.
  • the mapping area includes multiple areas, and each area reserves a space for storing a logical address and a physical address mapping relationship.
  • the method further includes: if the mapping relationship is not saved in the mapping area, and the read or write request is Writing a request, assigning a physical address to a logical address carried by the write request; performing write processing on the data on the allocated physical address; and mapping the mapping corresponding to the write request according to the allocated physical address And storing in the mapping area; according to the logical address carried by the write request, combining the first possible implementation manner of the first aspect in the index area, and in the third possible implementation manner, whether the mapped area is saved Having the mapping relationship between the logical address and the physical address, detecting the metadata; if the area in the mapping area storing the mapping relationship is damaged, and the read or write request is a write request, the write request is The carried logical address reallocates the physical address; writes the data on the reallocated physical address; according to the reassigned physical Address, the write request corresponding to the mapping relationship stored in the map area; logical address according to the write request carried
  • the method further includes: if the index area is partially or completely damaged, according to the saving of each area in the mapping area The logical address in the mapping relationship restores the index area.
  • an embodiment of the present invention provides a storage system that applies metadata.
  • the metadata includes: a mapping area for storing a logical address and a physical address mapping relationship, and an index area for querying a location of the logical address and the physical address mapping relationship in the mapping area; the storage system includes:
  • a receiving unit configured to receive a read or write request of the data, where the read or write request carries a logical address
  • the query unit is configured to query, according to the logical address, the index information in the index area to query whether the mapping area is saved There is a mapping relationship between the logical address and the physical address
  • a processing unit configured to: if the mapping relationship is saved in the mapping area, perform read or write processing on the data at a physical address corresponding to the mapping relationship.
  • the mapping area includes multiple areas, and each area reserves a space for storing a logical address and a physical address mapping relationship.
  • the storage system further includes: an allocation unit, configured to: if the mapping relationship is not saved in the mapping area, The read or write request is a write request, and the physical address is allocated to the logical address carried by the write request; the element is configured to save the mapping relationship corresponding to the write request to the mapping area according to the allocated physical address. And storing, in the index area, a location in the mapping area that saves a mapping relationship between the logical address and the allocated physical address according to the logical address carried by the write request.
  • the storage system further includes: a detecting unit, configured to pass, by the query unit, the index area according to the logical address The index information queries whether the logical address and the physical address are saved in the mapping area.
  • mapping the metadata is configured to: if the area in the mapping area that holds the mapping relationship is damaged, and the read or write request is a write request, the logical address carried by the write request Redistributing a physical address; the processing unit is further configured to perform write processing on the data on the reassigned physical address; and a recording unit, configured to: correspond to the write request according to the reassigned physical address
  • the mapping relationship is saved in the mapping area, and the location in the mapping area that saves the mapping relationship between the logical address and the reassigned physical address is recorded in the index area according to the logical address carried by the write request.
  • the storage system further includes: a recovery unit, configured to: if the index area is partially or completely damaged, according to each of the mapping areas The logical address in the mapping relationship saved by the area restores the index area.
  • the storage system searches for the position of the logical address and the physical address mapping relationship corresponding to the read or write request for saving the data in the mapping area through the index area, if the mapping area is Partially damaged, only the damaged logical address and physical address mapping relationship of the damaged part will be lost, and the storage system will not affect the mapping between the logical address and the physical address stored in other parts of the mapping area through the index area, thereby not affecting the storage system.
  • the undamaged partially stored logical address is read or written to the physical address corresponding to the physical address mapping relationship.
  • FIG. 1 is a schematic structural diagram of metadata applied to an embodiment of the present invention
  • FIG. 2 is a flowchart of a data processing method for applying metadata according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic structural diagram of a storage system for applying metadata according to Embodiment 2 of the present invention
  • FIG. 5 is a schematic structural diagram of a storage system according to Embodiment 3 of the present invention
  • FIG. 1 is a schematic diagram of a metadata structure applied to an embodiment of the present invention.
  • the metadata includes a mapping area (MP, hereinafter referred to as MP area) and an index area (IP, hereinafter referred to as an IP area).
  • MP area is used to store a logical address and a physical address mapping relationship (Log ic addres s and Phys i ca l addres s Mapping , LPM ).
  • the MP area includes a plurality of areas. Specifically, an LPM is reserved for each 1G physical space on the physical disk. As shown in FIG.
  • each 1G is an area, and the black part in each area is a stored LPM, and each black space represents an LPM.
  • the white portion is the data on the physical address corresponding to the LPM stored in the area.
  • the size of each area of the MP area is 1G, which is only one case of the embodiment of the present invention, and the MP area can be infinitely expanded.
  • the IP area is used to query the location of the LPM corresponding to the logical address in the MP area according to the logical address.
  • the IP area can be a B-tree structure, but not limited to the B-tree structure, and the IP area can be other structures that can implement the search function.
  • the IP area and the MP area of the metadata are two independent areas.
  • the IP area does not affect the LPM of the undamaged area of the MP area.
  • the IP area can be restored according to the MP area. Therefore, when the metadata is applied in the storage system, when part of the LPM is lost due to damage of the MP area, the storage system does not affect the LPM stored in other parts of the MP data area by using the IP area, thereby not affecting the storage system.
  • Data read and write processing is performed on the physical address corresponding to the LPM stored in other parts of the MP area. When the IP area is damaged, it does not affect the processing of the entire storage system.
  • FIG. 2 is a flow chart of a data processing method for applying metadata according to Embodiment 1 of the present invention.
  • the execution body of the data processing method of the application metadata is a storage system, and the metadata is applied to the storage system.
  • the data processing method of the application metadata includes the following steps:
  • Step S201 The storage system receives a read or write request for data.
  • the read request and the write request of each data carry the same logical address.
  • the storage system After receiving the read or write request of the data, the storage system searches for the corresponding LPM according to the logical address carried by the read or write request, thereby finding the corresponding logical address.
  • Physical address which reads or writes to the data at the physical address.
  • Step S202 The logical address carried by the read or write request of the data is used to query whether the logical address and the physical address LPM carried by the read or write request of the data are stored in the MP area through the index information of the IP area.
  • the storage system first queries the area of the MP area corresponding to the read or write request of the data by the logical address carried by the read or write request of the data, and then determines whether the data is read in the area. Or write the LPM associated with the logical address carried by the request. If the LPM associated with the logical address carried by the read or write request of the data is queried, the LPM corresponding to the read or write request of the data is stored in the MP area, and step S203 is performed. If the LPM associated with the logical address carried by the read or write request of the data is not queried, the LPM corresponding to the read or write request of the data is not stored in the MP area, and step S204 is performed.
  • the data structure of the IP zone can be a variety of structures such as a hash Ha sh table, a B tree and its variants, a sorted linked list, and the like.
  • the following uses the Ha sh table as an example to describe the method of searching for a physical address according to a logical address.
  • the Key value is a logical address
  • the Va lue value is an address of the LPM in the MP area.
  • Step S203 If the LPM corresponding to the read or write request of the data is saved in the MP area,
  • the data is read or written on the physical address corresponding to the LPM.
  • the physical address corresponding to the logical address carried by the read or write request of the data is obtained according to the LPM, and then the data is read or read at the physical address. Write processing.
  • Step S204 if there is no LPM corresponding to the read or write request of the data in the MP area, and the read or write request of the data is a write request of the data, the logical address share carried in the write request of the data With a physical address.
  • the LPM corresponding to the data read or write request is not saved in the MP area, and the read or write request of the data is a read request of the data, all 0 data is returned to notify the device that reads the data in the storage system. The corresponding data was not saved.
  • Step S205 Write data to the allocated physical address.
  • the storage system After the storage system assigns a physical address to the logical address carried by the write request for the data, the data can be written at the physical address. After the data is written on the physical address, in order to ensure that the physical address can be found through the metadata, and the data written on the physical address is processed, the LPM corresponding to the write request of the data needs to be recorded in the metadata. Therefore, the storage system also needs to perform the following steps.
  • Step S206 Save, according to the allocated physical address, the LPM corresponding to the write request of the data.
  • the mapping between the logical address carried in the write request and the assigned physical address and the LPM and LPM are stored in the specific location of the MP area.
  • This patent does not limit, for example, the MP area can be divided into continuous physical spaces of 1 G.
  • the 1 G continuous space is recorded as an area, and the first fixed area of each area is used to store the LPM corresponding to all physical addresses of the area.
  • the storage system first determines the area in which the LPM is saved in the MP area based on the assigned physical address, and then allocates space in the area to save the LPM.
  • Step S207 Record, according to the logical address carried by the write request of the data, the location of the LPM corresponding to the write request for saving the data in the MP area in the IP zone.
  • the Ha sh table Take the data structure of the IP area as the Ha sh table.
  • the Key value is the logical address
  • the Va l ue value is the address of the LPM in the MP area.
  • This step is to add a record to the Ha s h table.
  • the storage system receives the read or write request of the data again, the logical address carried according to the read or write request is used to query the data stored in the MP through the correspondence between the Key value and the Va lue value in the Ha sh table of the IP area.
  • the address of the LPM corresponding to the request is read or written, so that the data is read or written on the physical address corresponding to the LPM corresponding to the read or write request of the data.
  • the data is read.
  • it also includes a method of processing the data by the storage system and a method of restoring the metadata when the metadata is damaged.
  • step S202 the logical address carried by the read or write request of the data is used to query whether the LPM corresponding to the read or write request of the data is saved in the MP area by using the index information of the IP area, and the storage system detects the metadata. . If the metadata is not damaged, the above steps S203-S207 are performed.
  • the logical address carried by the write request of the data is re-allocated.
  • the physical address is written to the redistributed physical address to ensure that the data can be written normally when a part of the MP area is damaged.
  • the LPM corresponding to the write request of the data needs to be recorded in the metadata, and the recording method is the same as the step. S206-S207, will not be described here.
  • the storage system sequentially accesses the space for storing the LPM in each 1G space of the physical disk, and reads the LPM. Since the LPM includes a logical address carried by the read or write request of the data, the storage system reconstructs the IP region according to the read LPM. Specifically, the hash Ha sh table, the B tree and its variant, the sorted linked list, etc. may be used. A variety of structures reconstruct an IP zone based on logical addresses. After the recovery is completed, the IP zone can be indexed normally.
  • the storage system searches the LPM stored in the MP area by using the IP area of the metadata, because the IP area and the MP area are independent. Therefore, when part of the data is lost due to partial damage of the MP area, the storage system does not affect the LPM of the undamaged part of the MP area by using the IP area of the metadata, so that the storage system does not affect the data that is not lost. Or write processing. And, when the IP area of the metadata is damaged, it can be rooted. According to the LPM saved in the MP area, the storage system does not affect the LPM in the MP area by using the IP area, and then the data is read or written.
  • the second embodiment of the present invention provides a storage system for implementing the method of the first embodiment.
  • FIG. 3 it is a schematic structural diagram of a storage system using metadata provided by Embodiment 2 of the present invention.
  • the metadata applied in the storage system includes an MP area for storing the LPM and an IP area for querying the location of the LPM in the MP area.
  • the MP area includes multiple areas, and each area reserves a space for storing the LPM.
  • the storage system includes: a receiving unit 31 0 , a query unit 320, and a processing unit 330.
  • the receiving unit 31 0 is for receiving a read or write request for data.
  • a read or write request of the same data carries the same logical address.
  • the query unit 320 is configured to query, according to the logical information carried in the read or write request of the data received by the receiving unit 31 0, the logical address and the physical address carried in the read/write request of the data in the MP area through the index information of the IP area. LPM.
  • the query unit 320 first queries the area of the MP area corresponding to the read or write request of the data by using the IP address according to the logical address carried by the read or write request of the data, and then determines whether a read or write request with the data is saved in the area. The logical address associated with the LPM. If the query unit 320 queries the LPM associated with the logical address carried by the read or write request of the data, then the LPM corresponding to the read or write request of the data is stored in the MP area. If the query unit 320 does not query the LPM associated with the logical address carried by the read or write request of the data, then the LPM corresponding to the read or write request holding the data is not in the MP area.
  • the processing unit 330 is configured to read or write the data on the physical address corresponding to the LPM corresponding to the read or write request of the data if the LPM corresponding to the read or write request of the data is stored in the MP area.
  • FIG. 4 is a schematic structural diagram of another storage system for applying metadata according to Embodiment 2 of the present invention.
  • the allocating unit 340 is configured to: if the LPM corresponding to the read or write request of the data is not saved in the MP, And the read or write request of the data is a write request for the data, and a physical address is assigned to the logical address carried by the write request of the data.
  • the processing unit 330 is further configured to perform write processing on the data at the physical address allocated by the allocating unit 340.
  • the recording unit 350 is configured to save the LPM corresponding to the write request of the data in the MP area according to the physical address allocated by the allocation unit 340, and save the IP address in the IP area record according to the logical address carried by the write request of the data.
  • the write request for this data corresponds to the location of the LPM.
  • the query unit 320 can find the assigned physical address through the metadata according to the logical address carried by the read or write request of the data, so that the processing unit 330 processes the data written on the physical address.
  • the storage system may further include: a detecting unit 360 and a restoring unit 370.
  • the detecting unit 360 is configured to query, according to the logical information carried in the read/write request of the data, whether the LPM corresponding to the read or write request of the data is saved in the MP area by using the index information of the IP area, and the metadata is performed. Detection, so that when the metadata is damaged, the data is processed accordingly and the damaged metadata is restored. Then, the allocating unit 340 is further configured to: if the area of the LPM corresponding to the read or write request for saving the data in the MP area is damaged, and the read or write request of the data is a write request of the data, the logic carried by the write request for the data The address is reassigned to the physical address.
  • the processing unit 330 is further configured to perform write processing on the data at the reassigned physical address.
  • the recording unit 350 is further configured to save the LPM corresponding to the write request of the data in the MP area according to the reassigned physical address, and then save the data in the IP area record MP area according to the logical address carried in the write request of the modified data.
  • the write request of the data corresponds to the location of the LPM.
  • the recovery unit 370 is used to recover the IP area according to the LPM saved in each area of the MP area if the IP area is partially or completely damaged. Specifically, the recovery unit 370 sequentially accesses the space for storing the LPM in each 1G space of the physical disk, and reads the LPM. Since the LPM includes a logical address carried by a read or write request of data, the recovery unit 370 reconstructs the IP region based on the logical address in the read LPM. After the recovery is completed, the IP zone can be indexed normally.
  • each unit included in the storage system using the metadata provided by this embodiment is only divided according to functional logic, but is not limited to the foregoing division, as long as it can be implemented.
  • the corresponding functions may be used; in addition, the specific names of the functional units are only for the purpose of distinguishing from each other, and are not intended to limit the scope of protection of the present invention.
  • the storage system searches the LPM stored in the MP area by using the IP area of the metadata, because the IP area and the MP area are independent. Therefore, when part of the data is lost due to partial damage of the MP area, the storage system does not affect the LPM of the undamaged part of the MP area by using the IP area of the metadata, so that the storage system does not affect the data that is not lost. Or write processing. Moreover, when the IP area of the metadata is damaged, the recovery can be performed according to the LPM saved in the MP area, and the storage system does not affect the LPM in the MP area by using the IP area, and then the data is read or written.
  • the above receiving unit 310 can be a receiver or a transceiver.
  • the other units except the receiving unit 310 may be embedded in or independent of the processor of the storage system in hardware, or may be stored in the memory of the storage system in software, so that the processor calls to execute the corresponding modules. operating.
  • the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
  • FIG. 5 is a schematic structural diagram of a storage system according to Embodiment 3 of the present invention.
  • the storage system includes a transceiver 510, a memory 520, and a processor 530 coupled to the transceiver 510 and the memory 520, respectively.
  • the storage system may also include a common component such as an antenna, a baseband processing component, a medium frequency processing component, and an input/output device.
  • the embodiment of the present invention is not limited herein.
  • the memory 520 stores a set of program codes
  • the processor 530 is configured to call the program code stored in the memory 520 for performing the following operations:
  • mapping relationship is saved in the mapping area, the data is read or written on the physical address corresponding to the mapping relationship.
  • a set of program codes is stored in the memory 520, and the processor 530 is used to call the storage.
  • the program code stored in the device 520 can also be used to perform the following operations:
  • mapping relationship is not saved in the mapping area, and the read or write request is a write request, assign a physical address to the logical address carried by the write request;
  • a set of program codes is stored in the memory 520, and the processor 530 is configured to call the program code stored in the memory 520, and can also be used to perform the following operations: No saving the mapping relationship between the logical address and the physical address Detecting the metadata; if the area in the mapping area that holds the mapping relationship is damaged, and the read or write request is a write request, reallocating the physical address for the logical address carried by the write request;
  • mapping relationship corresponding to the write request in a mapping area
  • a set of program codes is stored in the memory 520, and the processor 530 is configured to call the program code stored in the memory 520, and can also be used to perform the following operations:
  • the index area is restored according to a logical address in the mapping relationship held by each area in the mapping area.
  • the storage systems provided in the second embodiment and the third embodiment can be used to implement the method provided in the first embodiment, and the description about the metadata and the like is the same as that in the second embodiment, and is no longer described herein. Narration.
  • the storage system provided by the third embodiment of the present invention after receiving the read or write request of the data, the storage system uses the IP area of the metadata to search for the LPM stored in the MP area. Since the IP area and the MP area are independent, therefore, When part of the data is lost due to partial damage of the MP area, the storage system does not affect the LPM stored in the undamaged portion of the MP area by using the IP area of the metadata, so that the storage system does not affect the read or write processing of the data that has not been lost. Moreover, when the IP area of the metadata is damaged, the recovery can be performed according to the LPM stored in the MP area, and the storage system does not affect the LPM in the MP area by using the IP area, and then the data is read or written.

Abstract

A data processing method and storing system for applied metadata. The applied metadata includes a mapping partition that is used for storing a mapping relation of a logic address and a physical address, and an index partition that is used for querying the position of the mapping relation of the logic address and the physical address in the mapping partition. The method includes, the storage system receives a read or write request of data, the read or write request carries the logic address, whether the mapping relation of the logic address and the physical address is stored in the mapping partition is queried through the index information in the index partition according to the logic address, if the mapping relation is stored in the mapping partition, the data is subjected to read or write processing on the physical address corresponding to the mapping relation.

Description

应用元数据的数据处理方法及存储系统  Data processing method and storage system using application metadata
技术领域 Technical field
本发明涉及计算机技术领域, 尤其涉及一种应用元数据的数据处理方法 及存储系统。  The present invention relates to the field of computer technologies, and in particular, to a data processing method and a storage system for applying metadata.
背景技术 Background technique
随着信息科学和技术的发展, 需要存储的数据量以令人难以置信的速度迅 猛增长, 因此对存储系统资源的合理分类和利用也提出了更高的要求。 一方面, 存储系统需要满足当前业务的需求, 通过简单的配置就能管理海量数据的存储; 另一方面, 在业务不算增长的过程中, 存储系统能够扩充, 并随着业务的增长 而按需分配存储资源。 由此, 自动精简配置技术应运而生。  With the development of information science and technology, the amount of data that needs to be stored is growing at an incredible rate, so higher requirements are placed on the rational classification and utilization of storage system resources. On the one hand, the storage system needs to meet the needs of the current business, and can manage the storage of massive data through simple configuration; on the other hand, in the process of not growing the business, the storage system can be expanded and pressed as the business grows. Need to allocate storage resources. As a result, thin provisioning technology has emerged.
自动精简配置技术是从传统的空间分配方式直接演化而来的一种存储虚拟 化技术, 该技术将所有存储空间汇集到精简池中进行统一管理, 在精简池上创 建精简逻辑单元, 按需从精简池获得物理存储空间。 自动精简配置技术的使用 可简化存储资源的配置管理, 节约物理存储资源。 在自动精简配置技术中, 元数据主要用于存储逻辑地址和物理地址的映射 关系。 元数据的可靠性是自动精简配置技术中最核心的技术。 而现有的数据处 理方法中, 存储系统利用具有 B树或 B树变体(如 B+树)结构的元数据对数据 进行读写处理。 在 B树元数据的节点中会存储有逻辑地址与物理地址映射关系, 利用 B树结构可以有效提高元数据的访问效率, 具有很好的扩展性。 但是, 一 旦 B树元数据的一个节点损坏, 会丟失该节点存储的逻辑地址与物理地址映射 关系, 同时会影响存储系统查找该损坏节点的下层节点, 导致存储系统无法在 元数据受影响的部分存储的逻辑地址与物理地址映射关系对应的物理地址上对 数据进行处理。 发明内容 有鉴于此, 本发明实施例提供了一种应用元数据的数据处理方法及存储系 统, 以实现当元数据部分损坏时, 不会影响存储系统在元数据其他部分存储的 逻辑地址与物理地址映射关系对应的物理地址上对数据进行处理。 Thin provisioning technology is a storage virtualization technology that evolves directly from the traditional spatial allocation method. It combines all storage space into a thin pool for unified management, creating thin logical units on the thin pool, and streamlining them on demand. The pool gets physical storage space. The use of thin provisioning technology simplifies configuration management of storage resources and saves physical storage resources. In the thin provisioning technology, metadata is mainly used to store the mapping relationship between logical addresses and physical addresses. The reliability of metadata is the core technology in thin provisioning technology. In the existing data processing method, the storage system reads and writes data by using metadata having a B-tree or B-tree variant (such as a B+tree) structure. The mapping between the logical address and the physical address is stored in the node of the B-tree metadata, and the B-tree structure can effectively improve the access efficiency of the metadata, and has good scalability. However, once a node of the B-tree metadata is damaged, the logical address and physical address mapping relationship stored by the node is lost, and the storage system searches for the underlying node of the damaged node, resulting in the storage system being unable to be affected by the metadata. The stored logical address is processed on the physical address corresponding to the physical address mapping relationship. Summary of the invention In view of this, an embodiment of the present invention provides a data processing method and a storage system for applying metadata, so as to prevent a logical address and a physical address mapping of a storage system from being stored in other parts of the metadata when the metadata is partially damaged. The data is processed at the physical address corresponding to the relationship.
在第一方面, 本发明实施例提供了一种应用元数据的数据处理方法。 其中, 所述元数据包括: 用于存储逻辑地址与物理地址映射关系的映射区和用于查询 逻辑地址与物理地址映射关系在所述映射区中的位置的索引区; 所述方法包括: 存储系统接收数据的读或写请求, 所述读或写请求中携带逻辑地址; 根据所述逻辑地址通过所述索引区的索引信息查询所述映射区中是否保存 有所述逻辑地址与物理地址之间的映射关系;  In a first aspect, an embodiment of the present invention provides a data processing method for applying metadata. The metadata includes: a mapping area for storing a mapping relationship between a logical address and a physical address, and an index area for querying a location of a logical address and a physical address mapping relationship in the mapping area; the method includes: storing Receiving a read or write request of the data, the read or write request carrying a logical address; querying, by the index information of the index area, whether the logical address and the physical address are saved in the mapping area according to the logical address Mapping relationship between
如果所述映射区中保存有所述映射关系, 在所述映射关系对应的物理地址 上对所述数据进行读或写处理。  If the mapping relationship is saved in the mapping area, the data is read or written on the physical address corresponding to the mapping relationship.
在第一方面的第一种可能的实现方式中, 所述映射区包括多个区域, 每 个区域预留一段空间用于存储逻辑地址与物理地址映射关系。  In a first possible implementation manner of the first aspect, the mapping area includes multiple areas, and each area reserves a space for storing a logical address and a physical address mapping relationship.
结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所 述方法还包括: 如果所述映射区中没有保存所述映射关系, 且所述读或写请求 为写请求, 则为所述写请求携带的逻辑地址分配物理地址; 在分配的物理地址 上对所述数据进行写处理; 根据所述分配的物理地址, 将所述写请求对应的所 述映射关系保存于映射区中; 根据所述写请求携带的逻辑地址, 在所述索引区 结合第一方面的第一种可能的实现方式, 在第三种可能的实现方式中, 所 映射区中是否保存有所述逻辑地址与物理地址的映射关系的同时, 对元数据进 行检测; 如果映射区中保存所述映射关系的区域损坏, 且所述读或写请求为写 请求, 则为所述写请求携带的逻辑地址重新分配物理地址; 在重新分配的物理 地址上对所述数据进行写处理; 根据所述重新分配的物理地址, 将所述写请求 对应的所述映射关系保存于映射区中; 根据所述写请求携带的逻辑地址, 在所 述索引区记录中映射区中保存所述逻辑地址与重新分配的物理地址之间的映射 关系的位置。 With reference to the first possible implementation of the first aspect, in a second possible implementation, the method further includes: if the mapping relationship is not saved in the mapping area, and the read or write request is Writing a request, assigning a physical address to a logical address carried by the write request; performing write processing on the data on the allocated physical address; and mapping the mapping corresponding to the write request according to the allocated physical address And storing in the mapping area; according to the logical address carried by the write request, combining the first possible implementation manner of the first aspect in the index area, and in the third possible implementation manner, whether the mapped area is saved Having the mapping relationship between the logical address and the physical address, detecting the metadata; if the area in the mapping area storing the mapping relationship is damaged, and the read or write request is a write request, the write request is The carried logical address reallocates the physical address; writes the data on the reallocated physical address; according to the reassigned physical Address, the write request corresponding to the mapping relationship stored in the map area; logical address according to the write request carried in the A location in the mapping area in which the mapping relationship between the logical address and the reallocated physical address is saved in the mapping area record.
结合第一方面的第三种可能的实现方式, 在第四种可能的实现方式中, 所 述方法还包括: 如果所述索引区局部或全部损坏, 根据映射区中每个区域保存 的所述映射关系中的逻辑地址恢复所述索引区。  In conjunction with the third possible implementation of the first aspect, in a fourth possible implementation, the method further includes: if the index area is partially or completely damaged, according to the saving of each area in the mapping area The logical address in the mapping relationship restores the index area.
在第二方面, 本发明实施例提供了一种应用元数据的存储系统。 其中, 所 述元数据包括: 用于存储逻辑地址与物理地址映射关系的映射区和用于查询逻 辑地址与物理地址映射关系在所述映射区中的位置的索引区; 所述存储系统包 括:  In a second aspect, an embodiment of the present invention provides a storage system that applies metadata. The metadata includes: a mapping area for storing a logical address and a physical address mapping relationship, and an index area for querying a location of the logical address and the physical address mapping relationship in the mapping area; the storage system includes:
接收单元, 用于接收数据的读或写请求, 所述读或写请求中携带逻辑地址; 查询单元, 用于根据所述逻辑地址通过所述索引区的索引信息查询所述映 射区中是否保存有所述逻辑地址与物理地址之间的映射关系;  a receiving unit, configured to receive a read or write request of the data, where the read or write request carries a logical address; the query unit is configured to query, according to the logical address, the index information in the index area to query whether the mapping area is saved There is a mapping relationship between the logical address and the physical address;
处理单元, 用于如果所述映射区中保存有所述映射关系, 在所述映射关系 对应的物理地址上对所述数据进行读或写处理。  And a processing unit, configured to: if the mapping relationship is saved in the mapping area, perform read or write processing on the data at a physical address corresponding to the mapping relationship.
在第二方面的第一种可能的实现方式中, 所述映射区包括多个区域, 每 个区域预留一段空间用于存储逻辑地址与物理地址映射关系。  In a first possible implementation manner of the second aspect, the mapping area includes multiple areas, and each area reserves a space for storing a logical address and a physical address mapping relationship.
结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所 述存储系统还包括: 分配单元, 用于如果所述映射区中没有保存所述映射关系, 且所述读或写请求为写请求, 则为所述写请求携带的逻辑地址分配物理地址; 元, 用于根据所述分配的物理地址, 将所述写请求对应的所述映射关系保存于 映射区中, 根据所述写请求携带的逻辑地址, 在所述索引区中记录映射区中保 存所述逻辑地址与分配的物理地址之间的映射关系的位置。  With reference to the first possible implementation of the first aspect, in a second possible implementation, the storage system further includes: an allocation unit, configured to: if the mapping relationship is not saved in the mapping area, The read or write request is a write request, and the physical address is allocated to the logical address carried by the write request; the element is configured to save the mapping relationship corresponding to the write request to the mapping area according to the allocated physical address. And storing, in the index area, a location in the mapping area that saves a mapping relationship between the logical address and the allocated physical address according to the logical address carried by the write request.
结合第二方面的第一种可能的实现方式, 在第三种可能的实现方式中, 所 述存储系统还包括: 检测单元, 用于在所述查询单元根据所述逻辑地址通过所 述索引区的索引信息查询所述映射区中是否保存有所述逻辑地址与物理地址的 映射关系的同时, 对元数据进行检测; 分配单元, 用于如果映射区中保存所述 映射关系的区域损坏, 且所述读或写请求为写请求, 则为所述写请求携带的逻 辑地址重新分配物理地址; 所述处理单元还用于在重新分配的物理地址上对所 述数据进行写处理; 记录单元, 用于根据所述重新分配的物理地址, 将所述写 请求对应的所述映射关系保存于映射区中, 根据所述写请求携带的逻辑地址, 在所述索引区中记录映射区中保存所述逻辑地址与重新分配的物理地址之间的 映射关系的位置。 With reference to the first possible implementation of the second aspect, in a third possible implementation, the storage system further includes: a detecting unit, configured to pass, by the query unit, the index area according to the logical address The index information queries whether the logical address and the physical address are saved in the mapping area. And mapping the metadata; the allocation unit is configured to: if the area in the mapping area that holds the mapping relationship is damaged, and the read or write request is a write request, the logical address carried by the write request Redistributing a physical address; the processing unit is further configured to perform write processing on the data on the reassigned physical address; and a recording unit, configured to: correspond to the write request according to the reassigned physical address The mapping relationship is saved in the mapping area, and the location in the mapping area that saves the mapping relationship between the logical address and the reassigned physical address is recorded in the index area according to the logical address carried by the write request.
结合第二方面的第三种可能的实现方式, 在第四种可能的实现方式中, 所 述存储系统还包括: 恢复单元, 用于如果所述索引区局部或全部损坏, 根据映 射区中每个区域保存的所述映射关系中的逻辑地址恢复所述索引区。 通过上述方案, 由于元数据的索引区和映射区是独立的, 存储系统通过索 引区查找映射区中保存数据的读或写请求对应的逻辑地址与物理地址映射关 系的位置时, 如果映射区的部分发生损坏, 只会丟失损坏部分的存储的逻辑地 址与物理地址映射关系, 不会影响存储系统通过索引区查找映射区其它部分存 储的逻辑地址与物理地址映射关系, 从而不会影响存储系统在未损坏部分保存 的逻辑地址与物理地址映射关系对应的物理地址上对数据进行读或写处理。 附图说明  With the third possible implementation of the second aspect, in a fourth possible implementation, the storage system further includes: a recovery unit, configured to: if the index area is partially or completely damaged, according to each of the mapping areas The logical address in the mapping relationship saved by the area restores the index area. According to the above solution, since the index area and the mapping area of the metadata are independent, the storage system searches for the position of the logical address and the physical address mapping relationship corresponding to the read or write request for saving the data in the mapping area through the index area, if the mapping area is Partially damaged, only the damaged logical address and physical address mapping relationship of the damaged part will be lost, and the storage system will not affect the mapping between the logical address and the physical address stored in other parts of the mapping area through the index area, thereby not affecting the storage system. The undamaged partially stored logical address is read or written to the physical address corresponding to the physical address mapping relationship. DRAWINGS
图 1为本发明实施例应用的元数据结构示意图;  1 is a schematic structural diagram of metadata applied to an embodiment of the present invention;
图 2为本发明实施例一提供的一种应用元数据的数据处理方法的流程图; 图 3为本发明实施例二提供的一种应用元数据的存储系统的结构示意图; 图 4为本发明实施例二提供的另一种应用元数据的存储系统的结构示意图; 图 5为本发明实施例三提供的一种存储系统的结构示意图。 具体实施方式  2 is a flowchart of a data processing method for applying metadata according to Embodiment 1 of the present invention; FIG. 3 is a schematic structural diagram of a storage system for applying metadata according to Embodiment 2 of the present invention; FIG. 5 is a schematic structural diagram of a storage system according to Embodiment 3 of the present invention; FIG. detailed description
为了使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发 明作进一步地详细描述, 显然, 所描述的实施例仅仅是本发明一部份实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其它实施例, 都属于本发明保护的范围。 The present invention will be further described in detail with reference to the accompanying drawings, in which FIG. Rather than 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为本发明实 施例应用的元数据结构示意图。 该元数据包括映射区 (Mapping Par t i tn, MP, 以下简称 MP区)和索引区 ( Index Par t i tn, IP, 以下简称 IP区) 。 其中, MP 区用于存储還辑地址和物理地址映射关系 (Log ic addres s and Phys i ca l addres s Mapping , LPM ) 。 MP区包括多个区域。 具体的, 在物理磁盘上的每 1G 物理空间预留一段区域保存 LPM, 如图 1所示, 每 1G为一个区域, 每个区域中 黑色部分为存储的 LPM,每个黑格代表一个 LPM,白色部分为存储的该区域中 LPM 对应的物理地址上的数据。需要说明的是,本发明不限制 MP区每个区域的大小, MP区每个区域的大小为 1G仅为本发明实施例的一种情况, 并且 MP区可无限扩 展。 IP区用于根据逻辑地址查询该逻辑地址对应的 LPM在 MP区中的位置。 IP 区可以为 B树结构, 但不仅限于 B树结构, IP区可为其他能够实现引索功能 的结构。  First, the metadata structure applied in the embodiment of the present invention is introduced by taking FIG. 1 as an example. FIG. 1 is a schematic diagram of a metadata structure applied to an embodiment of the present invention. The metadata includes a mapping area (MP, hereinafter referred to as MP area) and an index area (IP, hereinafter referred to as an IP area). The MP area is used to store a logical address and a physical address mapping relationship (Log ic addres s and Phys i ca l addres s Mapping , LPM ). The MP area includes a plurality of areas. Specifically, an LPM is reserved for each 1G physical space on the physical disk. As shown in FIG. 1 , each 1G is an area, and the black part in each area is a stored LPM, and each black space represents an LPM. The white portion is the data on the physical address corresponding to the LPM stored in the area. It should be noted that the present invention does not limit the size of each area of the MP area. The size of each area of the MP area is 1G, which is only one case of the embodiment of the present invention, and the MP area can be infinitely expanded. The IP area is used to query the location of the LPM corresponding to the logical address in the MP area according to the logical address. The IP area can be a B-tree structure, but not limited to the B-tree structure, and the IP area can be other structures that can implement the search function.
由图 1可以看出, 该元数据的 IP区和 MP区是两个独立的区域, 当 MP区的 部分区域损坏时, 不会影响 IP区查找 MP区未损坏区域的 LPM。 并且, 当 IP区 发生损坏时, 还可根据 MP区进行恢复。 因此, 在存储系统中应用该元数据, 当 因 MP区的部分发生损坏导致部分 LPM丟失时, 不会影响存储系统利用 IP区查 找元数据 MP区其它部分存储的 LPM,从而不会影响存储系统在 MP区其它部分存 储的 LPM对应的物理地址上进行数据读写处理。 当 IP区发生损坏时, 不会影响 整个存储系统对数据的处理。  It can be seen from Fig. 1 that the IP area and the MP area of the metadata are two independent areas. When a part of the MP area is damaged, the IP area does not affect the LPM of the undamaged area of the MP area. Also, when the IP area is damaged, it can be restored according to the MP area. Therefore, when the metadata is applied in the storage system, when part of the LPM is lost due to damage of the MP area, the storage system does not affect the LPM stored in other parts of the MP data area by using the IP area, thereby not affecting the storage system. Data read and write processing is performed on the physical address corresponding to the LPM stored in other parts of the MP area. When the IP area is damaged, it does not affect the processing of the entire storage system.
下面以图 1为例详细说明本发明实施例一提供的一种应用元数据的数据处 理方法, 图 2 为本发明实施例一提供的一种应用元数据的数据处理方法的流程 图。 该应用元数据的数据处理方法的执行主体为存储系统, 该存储系统中应用 上述元数据。 如图 2所示, 该应用元数据的数据处理方法包括以下步骤:  The following is a detailed description of a data processing method for applying metadata according to the first embodiment of the present invention. FIG. 2 is a flow chart of a data processing method for applying metadata according to Embodiment 1 of the present invention. The execution body of the data processing method of the application metadata is a storage system, and the metadata is applied to the storage system. As shown in FIG. 2, the data processing method of the application metadata includes the following steps:
步骤 S201 , 存储系统接收数据的读或写请求。 每个数据的读请求和写请求携带相同的逻辑地址, 存储系统在接收到数据 的读或写请求后, 会根据读或写请求携带的逻辑地址查找相应的 LPM, 从而查找 到逻辑地址对应的物理地址, 在物理地址上对该数据进行读或写操作。 Step S201: The storage system receives a read or write request for data. The read request and the write request of each data carry the same logical address. After receiving the read or write request of the data, the storage system searches for the corresponding LPM according to the logical address carried by the read or write request, thereby finding the corresponding logical address. Physical address, which reads or writes to the data at the physical address.
步骤 S202 , 根据数据的读或写请求携带的逻辑地址通过 I P 区的索引信 息查询 MP 区中是否保存有该数据的读或写请求携带的逻辑地址与物理地址 的 LPM。  Step S202: The logical address carried by the read or write request of the data is used to query whether the logical address and the physical address LPM carried by the read or write request of the data are stored in the MP area through the index information of the IP area.
存储系统首先根据数据的读或写请求携带的逻辑地址通过 IP 区的索引 信息查询 'J该数据的读或写请求对应的 M P区的区域,然后判断该区域中是否 保存有与该数据的读或写请求携带的逻辑地址相关的 LPM。 如果查询到与该 数据的读或写请求携带的逻辑地址相关的 LPM , 则说明 MP区中保存有该数据 的读或写请求对应的 LPM , 执行步骤 S 203。 如果没查询到与该数据的读或写 请求携带的逻辑地址相关的 LPM , 则说明 MP区中没有保存该数据的读或写请 求对应的 LPM , 执行步骤 S 204。  The storage system first queries the area of the MP area corresponding to the read or write request of the data by the logical address carried by the read or write request of the data, and then determines whether the data is read in the area. Or write the LPM associated with the logical address carried by the request. If the LPM associated with the logical address carried by the read or write request of the data is queried, the LPM corresponding to the read or write request of the data is stored in the MP area, and step S203 is performed. If the LPM associated with the logical address carried by the read or write request of the data is not queried, the LPM corresponding to the read or write request of the data is not stored in the MP area, and step S204 is performed.
例如, IP区的数据结构可以是哈希 Ha sh表、 B树及其变体、 排序链表等 多种结构。 下面以 Ha sh表为例来描述根据逻辑地址查找物理地址的方法, 该 Ha s h表中 Key值为逻辑地址, Va lue值为 LPM在 MP区的地址。该首先根据逻 应的 LPM在 MP区的地址, 然后对 LPM在 MP区的地址进行读取即可获取读或 写请求对应的 LPM , 从而根据 LPM获取相应的物理地址。  For example, the data structure of the IP zone can be a variety of structures such as a hash Ha sh table, a B tree and its variants, a sorted linked list, and the like. The following uses the Ha sh table as an example to describe the method of searching for a physical address according to a logical address. In the Ha s h table, the Key value is a logical address, and the Va lue value is an address of the LPM in the MP area. First, according to the address of the LPM of the logic in the MP area, and then reading the address of the LPM in the MP area, the LPM corresponding to the read or write request can be obtained, thereby obtaining the corresponding physical address according to the LPM.
步骤 S 203 , 如果 MP 区中保存有该数据的读或写请求对应的 LPM , 在该 Step S203: If the LPM corresponding to the read or write request of the data is saved in the MP area,
LPM对应的物理地址上对该数据进行读或写处理。 The data is read or written on the physical address corresponding to the LPM.
如果 MP区中保存有该数据的读或写请求对应的 LPM ,则根据 LPM获知该 数据的读或写请求携带的逻辑地址所对应的物理地址, 然后在该物理地址上 对该数据进行读或写处理。  If the LPM corresponding to the read or write request of the data is stored in the MP area, the physical address corresponding to the logical address carried by the read or write request of the data is obtained according to the LPM, and then the data is read or read at the physical address. Write processing.
步骤 S204 , 如果 MP区中没有保存该数据的读或写请求对应的 LPM, 且该 数据的读或写请求为该数据的写请求, 为该数据的写请求携带的逻辑地址分 配物理地址。 Step S204, if there is no LPM corresponding to the read or write request of the data in the MP area, and the read or write request of the data is a write request of the data, the logical address share carried in the write request of the data With a physical address.
另外, 如果 MP区中没有保存该数据读或写请求对应的 LPM , 且该数据的 读或写请求为该数据的读请求, 则返回全 0数据, 以告知读取数据的设备该 存储系统中没有保存相应的数据。  In addition, if the LPM corresponding to the data read or write request is not saved in the MP area, and the read or write request of the data is a read request of the data, all 0 data is returned to notify the device that reads the data in the storage system. The corresponding data was not saved.
步骤 S205 , 在分配的物理地址上对该数据进行写处理。  Step S205: Write data to the allocated physical address.
存储系统在为该数据的写请求携带的逻辑地址分配物理地址后, 便可在该 物理地址上写入该数据。 在该物理地址上完成写入数据后, 为保证之后能够通 过元数据查找到该物理地址, 对该物理地址上写入的数据进行处理, 需要将该 数据的写请求对应的 LPM记录在元数据中, 因此存储系统还需要执行以下步骤。  After the storage system assigns a physical address to the logical address carried by the write request for the data, the data can be written at the physical address. After the data is written on the physical address, in order to ensure that the physical address can be found through the metadata, and the data written on the physical address is processed, the LPM corresponding to the write request of the data needs to be recorded in the metadata. Therefore, the storage system also needs to perform the following steps.
步骤 S206 , 根据分配的物理地址, 将该数据的写请求对应的 LPM保存于 Step S206: Save, according to the allocated physical address, the LPM corresponding to the write request of the data.
MP区中。 In the MP area.
将写请求中携带的逻辑地址与分配的物理地址组成映射关系 LPM , LPM 保存在 MP 区的具体哪个位置, 本专利不做限制, 例如可以将 MP 区分成 1 G 为单位的连续物理空间,每 1 G连续空间记为一个区域,将每个区域最前面的 固定区域用于保存该区域所有物理地址对应的 LPM。  The mapping between the logical address carried in the write request and the assigned physical address and the LPM and LPM are stored in the specific location of the MP area. This patent does not limit, for example, the MP area can be divided into continuous physical spaces of 1 G. The 1 G continuous space is recorded as an area, and the first fixed area of each area is used to store the LPM corresponding to all physical addresses of the area.
存储系统首先根据分配的物理地址确定在 MP 区中保存该 LPM的区域, 然后在该区域中分配空间保存该 LPM。  The storage system first determines the area in which the LPM is saved in the MP area based on the assigned physical address, and then allocates space in the area to save the LPM.
步骤 S207 , 根据该数据的写请求携带的逻辑地址, 在 IP区中记录 MP区中 保存该数据的写请求对应的 LPM的位置。  Step S207: Record, according to the logical address carried by the write request of the data, the location of the LPM corresponding to the write request for saving the data in the MP area in the IP zone.
以 IP区的数据结构为 Ha sh表为例,该 Ha sh表中 Key值为逻辑地址, Va l ue 值为 LPM在 MP区的地址。 该步骤即是在 Ha s h表中增加一条记录。 以便于存 储系统再接收到该数据的读或写请求时, 根据读或写请求携带的逻辑地址通过 IP区的 Ha sh表中的 Key值与 Va lue值的对应关系查询 MP中保存该数据的读或 写请求对应的 LPM的地址, 从而在该数据的读或写请求对应的 LPM所对应的物 理地址上对该数据进行读或写处理。  Take the data structure of the IP area as the Ha sh table. In the Ha sh table, the Key value is the logical address, and the Va l ue value is the address of the LPM in the MP area. This step is to add a record to the Ha s h table. When the storage system receives the read or write request of the data again, the logical address carried according to the read or write request is used to query the data stored in the MP through the correspondence between the Key value and the Va lue value in the Ha sh table of the IP area. The address of the LPM corresponding to the request is read or written, so that the data is read or written on the physical address corresponding to the LPM corresponding to the read or write request of the data.
本实施例提供的应用元数据的处理方法中, 除上述存储系统对数据进行读 或写处理的方法之外, 还包括当元数据发生损坏时, 存储系统对数据的处理方 法及恢复元数据的方法。 In the processing method of the application metadata provided by this embodiment, in addition to the foregoing storage system, the data is read. In addition to the method of writing processing, it also includes a method of processing the data by the storage system and a method of restoring the metadata when the metadata is damaged.
具体的, 步骤 S202 , 根据数据的读或写请求携带的逻辑地址通过 IP区的索 引信息查询 MP区中是否保存有该数据的读或写请求对应的 LPM的同时, 存储系 统对元数据进行检测。 如果元数据没有损坏, 则执行上述步骤 S203-S207。  Specifically, in step S202, the logical address carried by the read or write request of the data is used to query whether the LPM corresponding to the read or write request of the data is saved in the MP area by using the index information of the IP area, and the storage system detects the metadata. . If the metadata is not damaged, the above steps S203-S207 are performed.
如果元数据的 MP区中保存该数据的读或写请求对应的 LPM的区域损坏, 且 该数据的读或写请求为数据的写请求, 则重新为该数据的写请求携带的逻辑地 址重新分配物理地址, 在重新分配的物理地址上对该数据进行写处理, 以保证 在 MP区部分区域发生损坏时, 该数据能够正常写入。  If the area of the LPM corresponding to the read or write request of the data in the MP area of the metadata is damaged, and the read or write request of the data is a write request of the data, the logical address carried by the write request of the data is re-allocated. The physical address is written to the redistributed physical address to ensure that the data can be written normally when a part of the MP area is damaged.
为使得之后存储系统能够通过元数据查找到该重新分配的物理地址, 对该 物理地址上写入的数据进行处理, 需要将该数据的写请求对应的 LPM记录在元 数据中, 记录方法同步骤 S206-S207 , 在此不再赘述。  In order to enable the storage system to find the reassigned physical address through the metadata, and process the data written on the physical address, the LPM corresponding to the write request of the data needs to be recorded in the metadata, and the recording method is the same as the step. S206-S207, will not be described here.
另外, 如果元数据的 MP区中保存该数据的读或写请求对应的 LPM的区域损 坏, 且该数据的读或写请求为数据的读请求, 则向读取该数据的设备返回错误 消息。  Further, if the area of the LPM corresponding to the read or write request for storing the data in the MP area of the metadata is damaged, and the read or write request of the data is a read request for the data, an error message is returned to the device that reads the data.
如果元数据的 IP区发生损坏, 则根据 MP区中每个区域保存的 LPM中逻辑 地址恢复 IP区。 具体的, 存储系统依次访问物理磁盘每 1G空间中用于存储 LPM 的空间, 读取 LPM。 由于 LPM中包括数据的读或写请求携带的逻辑地址, 则存储 系统根据读取的 LPM重建 IP区,具体的,可以釆用哈希 Ha sh表、 B树及其变体、 排序链表等的多种结构根据逻辑地址重建 IP区。 完成恢复后, IP区可正常进行 索引。  If the IP area of the metadata is corrupted, the IP area is restored according to the logical address in the LPM saved in each area of the MP area. Specifically, the storage system sequentially accesses the space for storing the LPM in each 1G space of the physical disk, and reads the LPM. Since the LPM includes a logical address carried by the read or write request of the data, the storage system reconstructs the IP region according to the read LPM. Specifically, the hash Ha sh table, the B tree and its variant, the sorted linked list, etc. may be used. A variety of structures reconstruct an IP zone based on logical addresses. After the recovery is completed, the IP zone can be indexed normally.
利用本发明实施例一提供的应用元数据的处理方法, 存储系统在接收到数 据的读或写请求后, 利用元数据的 IP区查找 MP区中存储的 LPM, 由于 IP区和 MP区是独立的, 因此, 当因 MP区部分损坏导致部分数据丟失时, 不会影响存储 系统利用元数据的 IP区查找 MP区未损坏部分保存的 LPM,从而不会影响存储系 统对未丟失的数据进行读或写处理。 并且, 当元数据的 IP区发生损坏时, 可根 据 MP区中保存的 LPM进行恢复,不会影响存储系统利用 IP区查询 MP区中的 LPM, 然后对数据进行读或写处理。 With the processing method of the application metadata provided by the first embodiment of the present invention, after receiving the read or write request of the data, the storage system searches the LPM stored in the MP area by using the IP area of the metadata, because the IP area and the MP area are independent. Therefore, when part of the data is lost due to partial damage of the MP area, the storage system does not affect the LPM of the undamaged part of the MP area by using the IP area of the metadata, so that the storage system does not affect the data that is not lost. Or write processing. And, when the IP area of the metadata is damaged, it can be rooted. According to the LPM saved in the MP area, the storage system does not affect the LPM in the MP area by using the IP area, and then the data is read or written.
相应的,本发明实施例二提供一种用以实现实施例一所述方法的存储系统。 如图 3 所示, 其为本发明实施例二提供的一种应用元数据的存储系统的结构示 意图。 该存储系统中应用的元数据包括用于存储 LPM的 MP 区和用于查询 LPM 在所述 MP区中的位置的 I P区。 其中, MP区包括多个区域, 每个区域预留一 段空间用于存储 LPM。 该存储系统包括: 接收单元 31 0 , 查询单元 320和处理 单元 330。  Correspondingly, the second embodiment of the present invention provides a storage system for implementing the method of the first embodiment. As shown in FIG. 3, it is a schematic structural diagram of a storage system using metadata provided by Embodiment 2 of the present invention. The metadata applied in the storage system includes an MP area for storing the LPM and an IP area for querying the location of the LPM in the MP area. The MP area includes multiple areas, and each area reserves a space for storing the LPM. The storage system includes: a receiving unit 31 0 , a query unit 320, and a processing unit 330.
接收单元 31 0用于接收数据的读或写请求。 同一数据的读或写请求中携 带有相同的逻辑地址。  The receiving unit 31 0 is for receiving a read or write request for data. A read or write request of the same data carries the same logical address.
查询单元 320用于根据接收单元 31 0接收到的数据的读或写请求携带的 逻辑地址通过 IP区的索引信息查询 MP区中是否保存有该数据的读或写请求 携带的逻辑地址与物理地址的 LPM。  The query unit 320 is configured to query, according to the logical information carried in the read or write request of the data received by the receiving unit 31 0, the logical address and the physical address carried in the read/write request of the data in the MP area through the index information of the IP area. LPM.
查询单元 320首先根据数据的读或写请求携带的逻辑地址利用 I P 区查 询到该数据的读或写请求对应的 MP区的区域,然后判断该区域中是否保存有 与该数据的读或写请求携带的逻辑地址相关的 LPM。 如果查询单元 320查询 到与该数据的读或写请求携带的逻辑地址相关的 LPM , 则说明 MP区中保存有 该数据的读或写请求对应的 LPM。 如果查询单元 320没查询到与该数据的读 或写请求携带的逻辑地址相关的 LPM , 则说明 MP区中没有保存该数据的读或 写请求对应的 LPM。  The query unit 320 first queries the area of the MP area corresponding to the read or write request of the data by using the IP address according to the logical address carried by the read or write request of the data, and then determines whether a read or write request with the data is saved in the area. The logical address associated with the LPM. If the query unit 320 queries the LPM associated with the logical address carried by the read or write request of the data, then the LPM corresponding to the read or write request of the data is stored in the MP area. If the query unit 320 does not query the LPM associated with the logical address carried by the read or write request of the data, then the LPM corresponding to the read or write request holding the data is not in the MP area.
处理单元 330用于如果 MP区中保存有该数据的读或写请求对应的 LPM , 在该数据的读或写请求对应的 LPM所对应的物理地址上对该数据进行读或写 处理。  The processing unit 330 is configured to read or write the data on the physical address corresponding to the LPM corresponding to the read or write request of the data if the LPM corresponding to the read or write request of the data is stored in the MP area.
另外, 该存储系统还包括: 分配单元 340及记录单元 350。 如图 4所示, 其 为本发明实施例二提供的另一种应用元数据的存储系统的结构示意图。  In addition, the storage system further includes: an allocating unit 340 and a recording unit 350. FIG. 4 is a schematic structural diagram of another storage system for applying metadata according to Embodiment 2 of the present invention.
分配单元 340用于如果 MP中没有保存该数据的读或写请求对应的 LPM , 且该数据的读或写请求为该数据的写请求, 为该数据的写请求携带的逻辑地 址分配物理地址。 则处理单元 330还用于在分配单元 340分配的物理地址上 对该数据进行写处理。 The allocating unit 340 is configured to: if the LPM corresponding to the read or write request of the data is not saved in the MP, And the read or write request of the data is a write request for the data, and a physical address is assigned to the logical address carried by the write request of the data. The processing unit 330 is further configured to perform write processing on the data at the physical address allocated by the allocating unit 340.
记录单元 350用于根据分配单元 340分配的物理地址, 将该数据的写请 求对应的 LPM保存于 MP区中,根据该数据的写请求携带的逻辑地址,在所述 IP区记录 MP区中保存该数据的写请求对应的 LPM的位置。 记录完成后, 查 询单元 320便可根据该数据的读或写请求携带的逻辑地址通过元数据查找到该 分配的物理地址, 以使得处理单元 330对该物理地址上写入的数据进行处理。  The recording unit 350 is configured to save the LPM corresponding to the write request of the data in the MP area according to the physical address allocated by the allocation unit 340, and save the IP address in the IP area record according to the logical address carried by the write request of the data. The write request for this data corresponds to the location of the LPM. After the recording is completed, the query unit 320 can find the assigned physical address through the metadata according to the logical address carried by the read or write request of the data, so that the processing unit 330 processes the data written on the physical address.
该存储系统还可以包括: 检测单元 360和恢复单元 370。  The storage system may further include: a detecting unit 360 and a restoring unit 370.
检测单元 360用于在查询单元 320根据数据的读或写请求携带的逻辑地址 通过 IP 区的索引信息查询 MP 区中是否保存有该数据的读或写请求对应的 LPM 的同时, 对元数据进行检测, 以使得当元数据发生损坏时, 对数据做相应的处 理及恢复损坏的元数据。 则分配单元 340还用于如果 MP区中保存该数据的读或 写请求对应的 LPM 的区域损坏, 且该数据的读或写请求为该数据的写请求, 为 该数据的写请求携带的逻辑地址重新分配物理地址。 相应的, 处理单元 330还 用于在重新分配的物理地址上对该数据进行写处理。 而记录单元 350还用于根 据重新分配的物理地址, 将该数据的写请求对应的 LPM保存于 MP区中, 然后根 据改数据的写请求携带的逻辑地址, 在 IP区记录 MP区中保存该数据的写请求 对应的 LPM的位置。  The detecting unit 360 is configured to query, according to the logical information carried in the read/write request of the data, whether the LPM corresponding to the read or write request of the data is saved in the MP area by using the index information of the IP area, and the metadata is performed. Detection, so that when the metadata is damaged, the data is processed accordingly and the damaged metadata is restored. Then, the allocating unit 340 is further configured to: if the area of the LPM corresponding to the read or write request for saving the data in the MP area is damaged, and the read or write request of the data is a write request of the data, the logic carried by the write request for the data The address is reassigned to the physical address. Correspondingly, the processing unit 330 is further configured to perform write processing on the data at the reassigned physical address. The recording unit 350 is further configured to save the LPM corresponding to the write request of the data in the MP area according to the reassigned physical address, and then save the data in the IP area record MP area according to the logical address carried in the write request of the modified data. The write request of the data corresponds to the location of the LPM.
恢复单元 370用于如果 IP区局部或全部损坏, 根据 MP区中每个区域保存 的 LPM恢复 IP区。 具体的, 恢复单元 370依次访问物理磁盘每 1G空间中用于 存储 LPM的空间,读取 LPM。由于 LPM中包括数据的读或写请求携带的逻辑地址, 所以恢复单元 370根据读取的 LPM中的逻辑地址重建 IP区。 完成恢复后, IP区 可正常进行索引。  The recovery unit 370 is used to recover the IP area according to the LPM saved in each area of the MP area if the IP area is partially or completely damaged. Specifically, the recovery unit 370 sequentially accesses the space for storing the LPM in each 1G space of the physical disk, and reads the LPM. Since the LPM includes a logical address carried by a read or write request of data, the recovery unit 370 reconstructs the IP region based on the logical address in the read LPM. After the recovery is completed, the IP zone can be indexed normally.
需要说明的是, 本实施例提供的一种应用元数据的存储系统所包括的各个 单元只是按照功能逻辑进行划分的, 但并不局限于上述的划分, 只要能够实现 相应的功能即可; 另外, 各功能单元的具体名称也只是为了便于相互区分, 并 不用于限制本发明的保护范围。 It should be noted that each unit included in the storage system using the metadata provided by this embodiment is only divided according to functional logic, but is not limited to the foregoing division, as long as it can be implemented. The corresponding functions may be used; in addition, the specific names of the functional units are only for the purpose of distinguishing from each other, and are not intended to limit the scope of protection of the present invention.
利用本发明实施例二提供的应用元数据的存储系统, 存储系统在接收到数 据的读或写请求后, 利用元数据的 IP区查找 MP区中存储的 LPM, 由于 IP区和 MP区是独立的, 因此, 当因 MP区部分损坏导致部分数据丟失时, 不会影响存储 系统利用元数据的 IP区查找 MP区未损坏部分保存的 LPM,从而不会影响存储系 统对未丟失的数据进行读或写处理。 并且, 当元数据的 IP区发生损坏时, 可根 据 MP区中保存的 LPM进行恢复,不会影响存储系统利用 IP区查询 MP区中的 LPM, 然后对数据进行读或写处理。  With the storage system of the application metadata provided by the second embodiment of the present invention, after receiving the read or write request of the data, the storage system searches the LPM stored in the MP area by using the IP area of the metadata, because the IP area and the MP area are independent. Therefore, when part of the data is lost due to partial damage of the MP area, the storage system does not affect the LPM of the undamaged part of the MP area by using the IP area of the metadata, so that the storage system does not affect the data that is not lost. Or write processing. Moreover, when the IP area of the metadata is damaged, the recovery can be performed according to the LPM saved in the MP area, and the storage system does not affect the LPM in the MP area by using the IP area, and then the data is read or written.
在硬件实现上, 以上接收单元 310可以为接收机或收发机。 以上除接收 单元 310以外的其它单元可以以硬件形式内嵌于或独立于存储系统的处理器 中, 也可以以软件形式存储于存储系统的存储器中, 以便于处理器调用执行 以上各个模块对应的操作。 该处理器可以为中央处理单元 (CPU ) 、 微处理 器、 单片机等。  In hardware implementation, the above receiving unit 310 can be a receiver or a transceiver. The other units except the receiving unit 310 may be embedded in or independent of the processor of the storage system in hardware, or may be stored in the memory of the storage system in software, so that the processor calls to execute the corresponding modules. operating. The processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
如图 5所示, 其为本发明实施例三提供的一种存储系统的结构示意图。 该存储系统包括收发机 510、存储器 520以及分别与收发机 510和存储器 520 连接的处理器 530。 当然, 存储系统还可以包括天线、 基带处理部件、 中射 频处理部件、 输入输出装置等通用部件, 本发明实施例在此不再任何限制。  FIG. 5 is a schematic structural diagram of a storage system according to Embodiment 3 of the present invention. The storage system includes a transceiver 510, a memory 520, and a processor 530 coupled to the transceiver 510 and the memory 520, respectively. Of course, the storage system may also include a common component such as an antenna, a baseband processing component, a medium frequency processing component, and an input/output device. The embodiment of the present invention is not limited herein.
其中, 存储器 520中存储一组程序代码, 且处理器 530用于调用存储器 520 中存储的程序代码, 用于执行以下操作:  The memory 520 stores a set of program codes, and the processor 530 is configured to call the program code stored in the memory 520 for performing the following operations:
接收数据的读或写请求, 所述读或写请求中携带逻辑地址;  Receiving a read or write request for data, the read or write request carrying a logical address;
根据所述逻辑地址通过所述索引区的索引信息查询所述映射区中是否保存 有所述逻辑地址与物理地址之间的映射关系;  Querying, by the index information of the index area, whether the mapping relationship between the logical address and the physical address is saved in the mapping area according to the logical address;
如果所述映射区中保存有所述映射关系, 在所述映射关系对应的物理地址 上对所述数据进行读或写处理。  If the mapping relationship is saved in the mapping area, the data is read or written on the physical address corresponding to the mapping relationship.
进一步地, 存储器 520中存储一组程序代码, 且处理器 530用于调用存储 器 520中存储的程序代码, 还可以用于执行以下操作: Further, a set of program codes is stored in the memory 520, and the processor 530 is used to call the storage. The program code stored in the device 520 can also be used to perform the following operations:
如果所述映射区中没有保存所述映射关系, 且所述读或写请求为写请求, 则为所述写请求携带的逻辑地址分配物理地址;  If the mapping relationship is not saved in the mapping area, and the read or write request is a write request, assign a physical address to the logical address carried by the write request;
在分配的物理地址上对所述数据进行写处理;  Writing data to the allocated physical address;
根据所述分配的物理地址, 将所述写请求对应的所述映射关系保存于映射 区中;  And saving the mapping relationship corresponding to the write request in the mapping area according to the allocated physical address;
根据所述写请求携带的逻辑地址, 在所述索引区中记录映射区中保存所述 逻辑地址与分配的物理地址之间的映射关系的位置。  And storing, in the index area, a location in the mapping area that saves a mapping relationship between the logical address and the allocated physical address according to the logical address carried by the write request.
进一步地, 存储器 520中存储一组程序代码, 且处理器 530用于调用存储 器 520中存储的程序代码, 还可以用于执行以下操作: 否保存有所述逻辑地址与物理地址的映射关系的同时, 对元数据进行检测; 如果映射区中保存所述映射关系的区域损坏, 且所述读或写请求为写请求, 则为所述写请求携带的逻辑地址重新分配物理地址;  Further, a set of program codes is stored in the memory 520, and the processor 530 is configured to call the program code stored in the memory 520, and can also be used to perform the following operations: No saving the mapping relationship between the logical address and the physical address Detecting the metadata; if the area in the mapping area that holds the mapping relationship is damaged, and the read or write request is a write request, reallocating the physical address for the logical address carried by the write request;
在重新分配的物理地址上对所述数据进行写处理;  Writing data to the reassigned physical address;
根据所述重新分配的物理地址, 将所述写请求对应的所述映射关系保存于 映射区中;  And saving, according to the reassigned physical address, the mapping relationship corresponding to the write request in a mapping area;
根据所述写请求携带的逻辑地址, 在所述索引区中记录映射区中保存所述 逻辑地址与重新分配的物理地址之间的映射关系的位置。  And storing, in the index area, a location in the mapping area that saves a mapping relationship between the logical address and the reassigned physical address according to the logical address carried by the write request.
进一步地, 存储器 520中存储一组程序代码, 且处理器 530用于调用存储 器 520中存储的程序代码, 还可以用于执行以下操作:  Further, a set of program codes is stored in the memory 520, and the processor 530 is configured to call the program code stored in the memory 520, and can also be used to perform the following operations:
如果所述索引区局部或全部损坏, 根据映射区中每个区域保存的所述映射 关系中的逻辑地址恢复所述索引区。  If the index area is partially or completely corrupted, the index area is restored according to a logical address in the mapping relationship held by each area in the mapping area.
需要说明的是, 实施例二和实施例三中所提供的存储系统均可以用于实现 实施例一所提供的方法, 且关于元数据等的描述同实施例二中的描述, 在此不 再赘述。 利用本发明实施例三提供的存储系统, 存储系统在接收到数据的读或写请 求后,利用元数据的 IP区查找 MP区中存储的 LPM,由于 IP区和 MP区是独立的, 因此, 当因 MP区部分损坏导致部分数据丟失时, 不会影响存储系统利用元数据 的 IP区查找 MP区未损坏部分保存的 LPM,从而不会影响存储系统对未丟失的数 据进行读或写处理。 并且, 当元数据的 IP区发生损坏时, 可根据 MP区中保存 的 LPM进行恢复, 不会影响存储系统利用 IP区查询 MP区中的 LPM, 然后对数据 进行读或写处理。 It should be noted that the storage systems provided in the second embodiment and the third embodiment can be used to implement the method provided in the first embodiment, and the description about the metadata and the like is the same as that in the second embodiment, and is no longer described herein. Narration. With the storage system provided by the third embodiment of the present invention, after receiving the read or write request of the data, the storage system uses the IP area of the metadata to search for the LPM stored in the MP area. Since the IP area and the MP area are independent, therefore, When part of the data is lost due to partial damage of the MP area, the storage system does not affect the LPM stored in the undamaged portion of the MP area by using the IP area of the metadata, so that the storage system does not affect the read or write processing of the data that has not been lost. Moreover, when the IP area of the metadata is damaged, the recovery can be performed according to the LPM stored in the MP area, and the storage system does not affect the LPM in the MP area by using the IP area, and then the data is read or written.
专业人员应该还可以进一步意识到, 结合本文中所公开的实施例描述的各 示例的单元及算法步骤, 能够以电子硬件、 计算机软件或者二者的结合来实现, 为了清楚地说明硬件和软件的可互换性, 在上述说明中已经按照功能一般性地 描述了各示例的组成及步骤。 这些功能究竟以硬件还是软件方式来执行, 取决 于技术方案的特定应用和设计约束条件。 专业技术人员可以对每个特定的应用 来使用不同方法来实现所描述的功能, 但是这种实现不应认为超出本发明的范 围。  A person skilled in the art should further appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, in order to clearly illustrate hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、 处理器 执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器( RAM ) , 内存、 只读存储器(ROM ) 、 电可编程 R0M、 电可擦除可编程 R0M、 寄存器、 硬 盘、 可移动磁盘、 CD-R0M、 或技术领域内所公知的任意其它形式的存储介质中。 以上所述的具体实施方式, 对本发明的目的、 技术方案和有益效果进行了 进一步详细说明, 所应理解的是, 以上所述仅为本发明的具体实施方式而已, 并不用于限定本发明的保护范围, 凡在本发明的精神和原则之内, 所做的任何 修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。  The steps of a method or algorithm described in connection with the embodiments disclosed herein may be implemented in hardware, a software module executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field Any other form of storage medium known. The above described embodiments of the present invention are further described in detail, and the embodiments of the present invention are intended to be illustrative only. The scope of the protection, any modifications, equivalents, improvements, etc., made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims

权 利 要 求 Rights request
1、 一种应用元数据的数据处理方法, 其特征在于, 所述元数据包括: 用于 存储逻辑地址与物理地址映射关系的映射区和用于查询逻辑地址与物理地址映 射关系在所述映射区中的位置的索引区; 所述方法包括: 1. A data processing method using metadata, characterized in that the metadata includes: a mapping area for storing the mapping relationship between logical addresses and physical addresses, and a mapping area for querying the mapping relationship between logical addresses and physical addresses in the mapping area. an index area of a location in the area; the method includes:
存储系统接收数据的读或写请求, 所述读或写请求中携带逻辑地址; 根据所述逻辑地址通过所述索引区的索引信息查询所述映射区中是否保存 有所述逻辑地址与物理地址之间的映射关系; The storage system receives a read or write request for data, and the read or write request carries a logical address; according to the logical address, it queries whether the logical address and the physical address are stored in the mapping area through the index information of the index area. the mapping relationship between;
如果所述映射区中保存有所述映射关系, 在所述映射关系对应的物理地址 上对所述数据进行读或写处理。 If the mapping relationship is stored in the mapping area, the data is read or written at the physical address corresponding to the mapping relationship.
2、 根据权利要求 1所述的方法, 其特征在于, 所述映射区包括多个区域, 每个区域预留一段空间用于存储所述映射关系。 2. The method according to claim 1, characterized in that the mapping area includes multiple areas, and each area reserves a space for storing the mapping relationship.
3、 根据权利要求 2所述的方法, 其特征在于, 所述方法还包括: 如果所述映射区中没有保存所述映射关系, 且所述读或写请求为写请求, 则为所述写请求携带的逻辑地址分配物理地址; 3. The method according to claim 2, wherein the method further includes: if the mapping relationship is not saved in the mapping area and the read or write request is a write request, then the write request is The logical address carried by the request is assigned a physical address;
在分配的物理地址上对所述数据进行写处理; Write the data at the allocated physical address;
根据所述分配的物理地址, 将所述写请求对应的所述映射关系保存于映射 区中; According to the allocated physical address, save the mapping relationship corresponding to the write request in the mapping area;
根据所述写请求携带的逻辑地址, 在所述索引区中记录映射区中保存所述 逻辑地址与分配的物理地址之间的映射关系的位置。 According to the logical address carried by the write request, the location in the mapping area where the mapping relationship between the logical address and the allocated physical address is saved is recorded in the index area.
4、 根据权利要求 2所述的方法, 其特征在于, 所述方法还包括: 是否保存有所述逻辑地址与物理地址的映射关系的同时, 对元数据进行检测; 如果映射区中保存所述映射关系的区域损坏,且所述读或写请求为写请求, 则为所述写请求携带的逻辑地址重新分配物理地址; 4. The method according to claim 2, characterized in that the method further includes: detecting metadata while saving the mapping relationship between the logical address and the physical address; if the mapping relationship is saved in the mapping area If the area of the mapping relationship is damaged and the read or write request is a write request, the physical address will be reallocated for the logical address carried by the write request;
在重新分配的物理地址上对所述数据进行写处理; Write the data at the reallocated physical address;
根据所述重新分配的物理地址, 将所述写请求对应的所述映射关系保存于 映射区中; According to the reassigned physical address, the mapping relationship corresponding to the write request is saved in in the mapping area;
根据所述写请求携带的逻辑地址, 在所述索引区中记录映射区中保存所述 逻辑地址与重新分配的物理地址之间的映射关系的位置。 According to the logical address carried by the write request, the location in the mapping area where the mapping relationship between the logical address and the reallocated physical address is saved is recorded in the index area.
5、 根据权利要求 4所述的方法, 其特征在于, 所述方法还包括: 如果所述索引区局部或全部损坏, 根据映射区中每个区域保存的所述映射 关系中的逻辑地址恢复所述索引区。 5. The method according to claim 4, characterized in that, the method further includes: if the index area is partially or completely damaged, restoring the index area according to the logical address in the mapping relationship saved in each area in the mapping area. The index area.
6、 一种应用元数据的存储系统, 其特征在于, 所述元数据包括: 用于存储 逻辑地址与物理地址映射关系的映射区和用于查询逻辑地址与物理地址映射关 系在所述映射区中的位置的索引区; 所述存储系统包括: 6. A storage system for applying metadata, characterized in that the metadata includes: a mapping area for storing the mapping relationship between logical addresses and physical addresses, and a mapping area for querying the mapping relationship between logical addresses and physical addresses in the mapping area. The index area of the location in; The storage system includes:
接收单元,用于接收数据的读或写请求, 所述读或写请求中携带逻辑地址; 查询单元, 用于根据所述逻辑地址通过所述索引区的索引信息查询所述映 射区中是否保存有所述逻辑地址与物理地址之间的映射关系; A receiving unit, used to receive a read or write request for data, where the read or write request carries a logical address; A query unit, used to query whether the mapping area is saved according to the logical address through the index information of the index area There is a mapping relationship between the logical address and the physical address;
处理单元, 用于如果所述映射区中保存有所述映射关系, 在所述映射关系 对应的物理地址上对所述数据进行读或写处理。 A processing unit, configured to read or write the data at the physical address corresponding to the mapping relationship if the mapping relationship is stored in the mapping area.
7、根据权利要求 6所述的存储系统, 其特征在于, 所述映射区包括多个区 域, 每个区域预留一段空间用于存储所述映射关系。 7. The storage system according to claim 6, wherein the mapping area includes multiple areas, and each area reserves a section of space for storing the mapping relationship.
8、根据权利要求 7所述的存储系统, 其特征在于, 所述存储系统还包括: 分配单元, 用于如果所述映射区中没有保存所述映射关系, 且所述读或写 请求为写请求, 则为所述写请求携带的逻辑地址分配物理地址; 记录单元, 用于根据所述分配的物理地址, 将所述写请求对应的所述映射 关系保存于映射区中, 根据所述写请求携带的逻辑地址, 在所述索引区中记录 8. The storage system according to claim 7, characterized in that, the storage system further includes: an allocation unit, configured to: if the mapping relationship is not saved in the mapping area, and the read or write request is a write request, allocate a physical address to the logical address carried by the write request; a recording unit, configured to save the mapping relationship corresponding to the write request in the mapping area according to the allocated physical address, and store the mapping relationship corresponding to the write request in the mapping area according to the write request. The logical address carried by the request is recorded in the index area
9、 根据权利要求 7所述的存储系统, 其特征在于, 所述存储系统还包括: 检测单元,用于在所述查询单元根据所述逻辑地址通过所述索引区的索引 信息查询所述映射区中是否保存有所述逻辑地址与物理地址的映射关系的同 时, 对元数据进行检测; 9. The storage system according to claim 7, characterized in that, the storage system further includes: a detection unit, configured to query the mapping through the index information of the index area according to the logical address in the query unit Whether the mapping relationship between the logical address and the physical address is stored in the area. When, detect metadata;
分配单元, 用于如果映射区中保存所述映射关系的区域损坏, 且所述读或 写请求为写请求, 则为所述写请求携带的逻辑地址重新分配物理地址; An allocation unit, configured to re-allocate a physical address to the logical address carried by the write request if the area storing the mapping relationship in the mapping area is damaged and the read or write request is a write request;
所述处理单元还用于在重新分配的物理地址上对所述数据进行写处理; 记录单元, 用于根据所述重新分配的物理地址, 将所述写请求对应的所述 映射关系保存于映射区中, 根据所述写请求携带的逻辑地址, 在所述索引区中 记录映射区中保存所述逻辑地址与重新分配的物理地址之间的映射关系的位 置。 The processing unit is also used to write the data at the reallocated physical address; the recording unit is used to save the mapping relationship corresponding to the write request in the mapping according to the reallocated physical address. In the area, according to the logical address carried by the write request, the location in the mapping area where the mapping relationship between the logical address and the reallocated physical address is saved is recorded in the index area.
10、根据权利要求 9所述的存储系统,其特征在于, 所述存储系统还包括: 恢复单元, 用于如果所述索引区局部或全部损坏, 根据映射区中每个区域 保存的所述映射关系中的逻辑地址恢复所述索引区。 10. The storage system according to claim 9, characterized in that, the storage system further includes: a recovery unit, configured to restore the mapping stored in each area in the mapping area if the index area is partially or completely damaged. The logical address in the relationship is restored to the index area.
PCT/CN2013/080973 2012-12-14 2013-08-07 Data processing method and storing system for applied metadata WO2014089981A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210541231.4 2012-12-14
CN201210541231.4A CN103049390B (en) 2012-12-14 2012-12-14 The data processing method of apply metadata and storage system

Publications (1)

Publication Number Publication Date
WO2014089981A1 true WO2014089981A1 (en) 2014-06-19

Family

ID=48062037

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/080973 WO2014089981A1 (en) 2012-12-14 2013-08-07 Data processing method and storing system for applied metadata

Country Status (2)

Country Link
CN (1) CN103049390B (en)
WO (1) WO2014089981A1 (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049390B (en) * 2012-12-14 2016-03-09 华为技术有限公司 The data processing method of apply metadata and storage system
CN104182508B (en) * 2014-08-19 2018-10-30 华为技术有限公司 A kind of data processing method and data processing equipment
CN105516001A (en) * 2014-09-22 2016-04-20 中兴通讯股份有限公司 Method and device for controlling data recovery after soft reset, and packet transport network equipment
CN106201923B (en) * 2016-07-20 2019-05-07 杭州宏杉科技股份有限公司 Method for reading and writing data and device
CN107885456B (en) * 2016-09-29 2022-09-16 北京忆恒创源科技股份有限公司 Reducing conflicts for IO command access to NVM
US11644992B2 (en) * 2016-11-23 2023-05-09 Samsung Electronics Co., Ltd. Storage system performing data deduplication, method of operating storage system, and method of operating data processing system
CN107329909B (en) * 2017-06-27 2020-07-07 郑州云海信息技术有限公司 Data management method and device
CN107480010A (en) * 2017-08-21 2017-12-15 郑州云海信息技术有限公司 A kind of method and device for recovering metadata
CN107632944B (en) * 2017-09-22 2021-06-18 郑州云海信息技术有限公司 Method and device for reading data
CN107704208B (en) * 2017-10-13 2021-08-10 郑州云海信息技术有限公司 Method, device and medium for repairing metadata
CN110019073A (en) * 2017-12-29 2019-07-16 北京忆恒创源科技有限公司 The method and its file system of file system are provided using KV storage equipment
CN109101194A (en) * 2018-07-26 2018-12-28 郑州云海信息技术有限公司 One kind writing with a brush dipped in Chinese ink performance optimization method and storage system
CN109508150B (en) * 2018-11-13 2022-02-18 郑州云海信息技术有限公司 Method and device for allocating storage space
CN111125447A (en) * 2019-12-22 2020-05-08 北京浪潮数据技术有限公司 Metadata access method, device and equipment and readable storage medium
CN111881064A (en) * 2020-07-24 2020-11-03 北京浪潮数据技术有限公司 Method, device and equipment for processing access request in full flash memory storage system
CN113282249B (en) * 2021-07-19 2021-10-29 苏州浪潮智能科技有限公司 Data processing method, system, device and medium
CN113568582B (en) * 2021-07-30 2023-05-26 重庆紫光华山智安科技有限公司 Data management method, device and storage equipment
CN115185723B (en) * 2022-06-02 2023-06-02 广州市玄武无线科技股份有限公司 Region meta-information restoration method, system, device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656094A (en) * 2009-09-25 2010-02-24 杭州华三通信技术有限公司 Data storage method and storage device
CN101814044A (en) * 2010-04-19 2010-08-25 中兴通讯股份有限公司 Method and device for processing metadata
CN102024044A (en) * 2010-12-08 2011-04-20 华为技术有限公司 Distributed file system
US8005792B2 (en) * 2004-05-14 2011-08-23 Oracle International Corporation System and method for managing versions of metadata
US20110238716A1 (en) * 2010-03-25 2011-09-29 International Business Machiness Corporation File index, metadata storage, and file system management for magnetic tape
CN102629247A (en) * 2011-12-31 2012-08-08 成都市华为赛门铁克科技有限公司 Method, device and system for data processing
CN102779080A (en) * 2012-06-18 2012-11-14 上海爱数软件有限公司 Method for generating snapshot, method and device for data recovery by using snapshot
CN103049390A (en) * 2012-12-14 2013-04-17 华为技术有限公司 Applied metadata processing method and storing system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7774575B2 (en) * 2004-09-21 2010-08-10 Intel Corporation Integrated circuit capable of mapping logical block address data across multiple domains
CN101510144B (en) * 2009-03-24 2011-04-13 中国科学院计算技术研究所 Distributed cache system based on distributed virtual machine manager and working method thereof
US8468293B2 (en) * 2009-07-24 2013-06-18 Apple Inc. Restore index page
CN102651009B (en) * 2011-02-28 2014-09-24 国际商业机器公司 Method and equipment for retrieving data in storage system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8005792B2 (en) * 2004-05-14 2011-08-23 Oracle International Corporation System and method for managing versions of metadata
CN101656094A (en) * 2009-09-25 2010-02-24 杭州华三通信技术有限公司 Data storage method and storage device
US20110238716A1 (en) * 2010-03-25 2011-09-29 International Business Machiness Corporation File index, metadata storage, and file system management for magnetic tape
CN101814044A (en) * 2010-04-19 2010-08-25 中兴通讯股份有限公司 Method and device for processing metadata
CN102024044A (en) * 2010-12-08 2011-04-20 华为技术有限公司 Distributed file system
CN102629247A (en) * 2011-12-31 2012-08-08 成都市华为赛门铁克科技有限公司 Method, device and system for data processing
CN102779080A (en) * 2012-06-18 2012-11-14 上海爱数软件有限公司 Method for generating snapshot, method and device for data recovery by using snapshot
CN103049390A (en) * 2012-12-14 2013-04-17 华为技术有限公司 Applied metadata processing method and storing system

Also Published As

Publication number Publication date
CN103049390B (en) 2016-03-09
CN103049390A (en) 2013-04-17

Similar Documents

Publication Publication Date Title
WO2014089981A1 (en) Data processing method and storing system for applied metadata
US9229826B2 (en) Volatile memory representation of nonvolatile storage device set
US9996266B2 (en) Physical address management in solid state memory
US11243706B2 (en) Fragment management method and fragment management apparatus
WO2017201977A1 (en) Data writing and reading method and apparatus, and distributed object storage cluster
US8456972B2 (en) Efficient access to storage devices with usage bitmaps
US20150234669A1 (en) Memory resource sharing among multiple compute nodes
WO2014101420A1 (en) System for constructing metadata and method therefor
EP2891051A1 (en) Block-level access to parallel storage
TW201321980A (en) Method for tracking memory usages of a data processing system
WO2014089828A1 (en) Method for accessing storage device and storage device
WO2018094704A1 (en) Data check method and storage system
WO2021159711A1 (en) B+ tree access method and apparatus, and computer-readable storage medium
US11640244B2 (en) Intelligent block deallocation verification
US8347293B2 (en) Mutual exclusion domains to perform file system processes on stripes
WO2019072250A1 (en) Document management method, document management system, electronic device and storage medium
WO2017054636A1 (en) Method and apparatus for processing virtual machine snapshots
Kwon et al. {Vigil-KV}:{Hardware-Software}{Co-Design} to Integrate Strong Latency Determinism into {Log-Structured} Merge {Key-Value} Stores
US11822804B2 (en) Managing extent sharing between snapshots using mapping addresses
CN111625477B (en) Processing method and device for read request for accessing erase block
CN111831589A (en) Method and device for improving IO command processing parallelism
CN114442934A (en) Data processing method and device and storage engine
WO2018075676A1 (en) Efficient flash management for multiple controllers

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: 13862662

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: 13862662

Country of ref document: EP

Kind code of ref document: A1