WO2015055033A1 - Metadata protection method and device - Google Patents

Metadata protection method and device Download PDF

Info

Publication number
WO2015055033A1
WO2015055033A1 PCT/CN2014/083034 CN2014083034W WO2015055033A1 WO 2015055033 A1 WO2015055033 A1 WO 2015055033A1 CN 2014083034 W CN2014083034 W CN 2014083034W WO 2015055033 A1 WO2015055033 A1 WO 2015055033A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage unit
unit group
metadata
hard disk
type
Prior art date
Application number
PCT/CN2014/083034
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 WO2015055033A1 publication Critical patent/WO2015055033A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2211/00Indexing scheme relating to details of data-processing equipment not covered by groups G06F3/00 - G06F13/00
    • G06F2211/10Indexing scheme relating to G06F11/10
    • G06F2211/1002Indexing scheme relating to G06F11/1076
    • G06F2211/104Metadata, i.e. metadata associated with RAID systems with parity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2211/00Indexing scheme relating to details of data-processing equipment not covered by groups G06F3/00 - G06F13/00
    • G06F2211/10Indexing scheme relating to G06F11/10
    • G06F2211/1002Indexing scheme relating to G06F11/1076
    • G06F2211/1045Nested RAID, i.e. implementing a RAID scheme in another RAID scheme

Definitions

  • the present invention relates to the field of computers, and in particular, to a method and an apparatus for protecting metadata.
  • the logical hard disk is composed of multiple independent physical hard disks or hard disk blocks.
  • the hard disk block refers to the physical hard disk group according to a certain granularity (a number of physical hard disk combinations). Together, the hard disk space implements block virtualization, and the physical addresses of the virtualized hard disk blocks are continuous.
  • the metadata stored in the logical hard disk is generated during the user service configuration and running process, and is used to express key information such as spatial information, mapping relationship, and configuration information of the user stored data. Metadata Once the compromised logical hard drive is not working properly, metadata protection is critical.
  • Redundant Array of Independent Disks data storage method is to store data on a storage unit group composed of a plurality of independent physical hard disks or hard disk blocks, by storing the same or different data in Data backup or redundancy protection is implemented on multiple physical hard disks or hard disk blocks.
  • RAID1 mirrors the data of one hard disk block to another hard disk block. That is to say, when data is written to one hard disk block, an image file is generated on another idle hard disk block, which maximizes the performance without affecting performance. Assuring the reliability and repairability of the system, as long as at least one of the hard disk blocks in any pair of mirrored hard disk blocks in the system can be used, even when half of the number of hard disk blocks have problems, the system can operate normally, when a hard disk block When it fails, the system ignores the hard disk block and uses the remaining mirrored hard disk block to read and write data, which has good disk redundancy.
  • the metadata is backed up and protected by the data protection method of the established RAID1, and the protection mode is relatively simple. When one or more hard disk blocks fail, the correct data may be indistinguishable or the data recovery may exist. There is a risk that it takes a long time to read the correct metadata information even if the data can be recovered.
  • Embodiments of the present invention provide a method and an apparatus for protecting metadata, which solves the problem that a single protection mode may cause a failure to distinguish between correct data or a risk of data recovery.
  • a method for protecting metadata is provided, where the method includes:
  • the metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first RAID storage mode;
  • the first type of RAID storage method includes: storing metadata belonging to different user data in the metadata in each physical storage unit or hard disk block in the corresponding first type of storage unit group;
  • a type of storage unit group includes at least two physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity.
  • At least two storage unit groups are selected in the first type of storage unit group, and according to the at least two storage units Forming the third storage unit group includes: selecting one physical storage unit or hard disk block in the first category;
  • L disk blocks constitute the third storage unit group
  • the third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity.
  • generating, by the third storage unit group, the at least two metadata belonging to different user data, the first parity code and storing further includes:
  • the at least one other parity code is a parity code other than the third metadata of the second type of memory cell group stored in the different user data.
  • the first RAID storage mode is RAID1
  • the second RAID storage mode is RAID5.
  • a second aspect provides a protection device for metadata, where the device includes: a storage module, configured to acquire metadata, and store metadata belonging to different user data in the metadata in a corresponding first class
  • the first type of storage unit group uses a first type of storage mode
  • the protection module is configured to select at least two storage unit groups in the first type of storage unit group, and Forming, according to the at least two storage unit groups, a third storage unit group, wherein the third storage unit group stores at least two metadata belonging to different user data, and the third storage unit group belongs to the second type storage unit group
  • the second type of storage unit group uses the second RAID storage mode
  • the parity code module is configured to generate, for the third storage unit group, the at least two metadata belonging to different user data.
  • a parity code is stored and stored.
  • the storage module is specifically configured to: store metadata belonging to different user data in the metadata in a corresponding first type of storage unit group
  • the protection module is specifically configured to:
  • L disk blocks constitute the third storage unit group
  • the second type of storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity.
  • the parity code module is further configured to: generate a second parity for the first parity code and the at least one other parity code Code and store;
  • the at least one other parity code is other than the third storage unit group except the third storage unit group.
  • the first RAID storage mode is RAID1
  • the second RAID storage mode is RAID5.
  • An embodiment of the present invention provides a method and an apparatus for protecting metadata, first acquiring metadata, and storing metadata belonging to different user data in the metadata in a corresponding first type of storage unit group.
  • the first type of storage unit group uses the first RAID storage mode, and then selects at least two storage unit groups in the first type of storage unit group, and forms a third storage unit according to the at least two storage unit groups.
  • the third storage unit group stores at least two metadata belonging to different user data, the third storage unit group belongs to the second type storage unit group, and the second type storage unit group uses the second type.
  • FIG. 1 is a schematic flowchart 1 of a method for protecting metadata according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart 2 of a method for protecting metadata according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram 2 of a method for protecting a metadata according to an embodiment of the present invention
  • FIG. 5 is a diagram of protection of metadata according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram 2 of a metadata protection device according to an embodiment of the present invention.
  • DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The technical solutions in the embodiments of the present invention will be clarified in the following with reference to the accompanying drawings in the embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS It is apparent that the described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without departing from the inventive scope are the scope of the present invention.
  • An embodiment of the present invention provides a method for protecting metadata. As shown in FIG. 1, the method includes:
  • the metadata belonging to different user data in the metadata is respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first type of RAID storage manner.
  • the embodiment of the present invention provides a method for protecting metadata, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit uses the first RAID storage method. And then selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the selected at least two storage unit groups, the third storage unit group storing at least two belonging to different user data. Metadata, the third storage unit group belongs to the second type of storage unit group, the second type of storage unit group uses the second RAID storage mode, and then the third storage unit group stores at least two metadata belonging to different user data. A first parity code is generated and stored. This adds a layer of protection to the metadata and improves security.
  • An embodiment of the present invention further provides a method for protecting metadata, as shown in FIG. 2, the method includes:
  • the metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first type of RAID storage manner.
  • the hard disk block (Chunk) is a hard disk space obtained by dividing the hard disk space according to a certain granularity, and the physical address of the hard disk in the hard disk block is continuous.
  • the first type of storage unit group is composed of physical storage units, the first type of storage unit group includes at least two physical storage units, and if the first type of storage unit group is composed of a hard disk The first type of storage unit group includes at least two hard disk blocks.
  • a logical space composed of a plurality of hard disk blocks according to a specified RAID type is called a hard disk block group (Chunk Group), and therefore, One type of storage unit group is called the first type of Chunk Group, and the second type of storage unit group is also applicable.
  • the physical storage unit may be a physical hard disk, such as a disk or an SSD (Solid State Disk), or may be a flash memory, or may be a compact disk or other physical storage. Therefore, the metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the specific metadata may be: storing each metadata belonging to different user data in each physical medium of the corresponding first type storage unit group.
  • the storage unit or the hard disk block; the first type of storage unit group includes at least two physical storage units or hard disk blocks.
  • the hard disk block is obtained by dividing a physical storage unit group according to a preset granularity.
  • the first RAID storage mode mentioned in the embodiment of the present invention may be RAID1.
  • the physical storage unit group may be composed of multiple large-capacity physical hard disks, for example, four 500G physical technologies.
  • the hard disks form a physical storage unit group.
  • RAID1 is a technology for mirroring data of one physical storage unit or hard disk block to another physical storage unit or hard disk block, that is, data is idle while being written to one physical storage unit or hard disk block.
  • An image file is generated on a physical storage unit or a hard disk block to ensure the reliability and repairability of the system to the utmost extent without affecting performance.
  • the unit or hard disk block can be used, and the system can operate normally even when there are problems in half of the physical storage unit or the hard disk block.
  • the system ignores the physical storage unit or the hard disk block. Turn instead Use the remaining mirrored physical storage unit or hard disk block to read and write data, with good disk redundancy.
  • a physical storage unit or a hard disk block is selected from each of the at least two storage unit groups;
  • the third storage unit group belongs to the second type storage unit group, and the third storage unit group stores at least two belonging to different user data.
  • Metadata the second type of storage unit group uses the second RAID storage method.
  • the second type of storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk block is obtained by dividing a physical storage unit group according to a preset granularity, so the third storage unit group also includes at least three physical storage units. Or hard disk block.
  • the second RAID storage method mentioned in the embodiment of the present invention may be RAID 5.
  • the RAID 5 is a physical storage unit (or a hard disk block) in which the data is stored, and a physical storage unit (or a hard disk block) in which the corresponding parity code is located is formed into a storage unit group. technology. When the data of one physical storage unit (or hard disk block) of RAID5 is damaged, the remaining data and the corresponding parity code can be used to recover the damaged data.
  • the RAID5 data storage method requires at least three physical storage units or hard disk blocks, and stores the data and the corresponding parity code on each physical storage unit or hard disk block that constitutes RAID5, and the odd-numbered n-1 (n is composed of RAID5).
  • the physical storage unit or the number of hard disk blocks) the physical storage unit or the hard disk block stores complete data, that is, equivalent to one physical storage unit or hard disk block capacity
  • the amount of space is used to store the parity code. Therefore, when a physical storage unit or hard disk block of RAID5 is damaged, the integrity of the data is not affected, thereby ensuring data security.
  • RAID automatically uses the remaining parity code to reconstruct the data on the physical storage unit or hard disk block, maintaining high reliability of data storage.
  • the parity code may be a vertical parity code, a horizontal parity code, or a horizontal vertical parity code.
  • the at least one other parity code is a parity code other than the third metadata belonging to different user data in the second type of storage unit group.
  • the black and white part of the figure is the first memory cell group and the second memory cell group using the first type of storage mode RAID1, wherein the first memory cell group is composed of hard disk blocks A, B, C composition, the same metadata 1 is stored on the hard disk blocks A, B, and C, and the second storage unit group is composed of hard disk blocks 0, E, and Z, and the same metadata 2 is stored on the hard disk blocks D, E, and Z.
  • the hard disk blocks A and D are selected in the first storage unit group and the second storage unit group, and the metadata 1 and the metadata 2 stored on the hard disk blocks A and D are XORed to obtain the metadata 1 and the metadata 2 Parity code 1, the obtained parity code 1 is stored on the hard disk block Z, the parity code 1 belongs to the first parity code, and the hard disk blocks A, D, Z are stored in the storage mode of the RAID 5 to form the third storage.
  • Unit group, the third storage unit group belongs to the Type memory cell groups. Thereby adding a layer of protection to the metadata, which is better Protection metadata.
  • Example 2 as shown in FIG. 4, the hard disk blocks G, H, and I form a fourth storage unit group, the hard disk blocks J, K, and L form a fifth storage unit group, and the hard disk blocks 0, P, and Q form a sixth storage unit group.
  • the hard disk blocks R, S, and T constitute a seventh storage unit group, and the fourth, fifth, sixth, and seventh storage unit groups respectively store metadata 3, 4, 5, 6, fourth, fifth, sixth, and seventh storage unit groups.
  • the RAID 1 storage mode is used and both belong to the first type of storage unit group, and the parity code 2 of the metadata 3 and the metadata 4 and the parity code of the metadata 5 and the metadata 6 are obtained according to the method in the first example. 4.
  • the parity code 2 and the parity code 3 are XORed to obtain the parity code 2 of the parity code 2 and the parity code 3, and the parity code 2 and the parity code 3 belong to the a parity check code
  • the parity check code 4 belongs to the second parity check code
  • the hard disk blocks 0, M, and J constitute the eighth storage unit group
  • the hard disk blocks 0, R, and N constitute the ninth storage unit group
  • the hard disk block M , N, U form the tenth storage unit group
  • the eighth, ninth, tenth storage unit group In RAID5 storage composition, eighth, ninth, tenth memory cell group belong to the second memory cell group. This also protects the parity code, further enhancing the protection of the metadata.
  • the hard disk block M storing the parity code of the metadata 3 and the metadata 4 in this example is not specifically used for storing the parity code, and may be stored by a hard disk block storing other metadata.
  • the parity code for example, may be the hard disk block P storing the metadata 5. This is because, for the RAID5 storage mode, the parity code of the metadata and the metadata are separately stored on different hard disk blocks, and different metadata and corresponding different parity codes are separately stored and stored in different hard disk blocks. In the above, as long as the metadata and the parity code corresponding to the metadata are not stored on the same hard disk block, the effect of the storage is equivalent to storing the parity code separately by using one hard disk block.
  • the parity codes in the above examples 1 and 2 can be used to verify whether the metadata stored on the hard disk block is correct. For example, in the example 1, it is assumed that the metadata 1 stored on the hard disk block A is incorrectly verified by the check calculation, then the correct metadata 1 is re-stored on the hard disk block A, and if the hard disk block A is damaged, the new healthy state is good. The hard disk block replaces hard disk block A and stores the correct metadata 1 on the new hard disk block.
  • the parity codes in the above examples 1 and 2 can also be used to recover corrupted metadata. For example, in Example 2, it is assumed that the metadata 3 stored on the hard disk blocks G, H, and I is all wrong and stored.
  • the parity code 2 stored on the hard disk block M is also incorrect, the parity can be calculated by redundancy recovery according to the parity code 3 stored on the hard disk block N and the parity code 4 stored on the hard disk block U.
  • the code 2 is stored on the hard disk block M. If the hard disk block M is damaged, the hard disk block M is replaced with a new healthy hard disk block and the correct parity code 2 is stored on the new hard disk block, and then according to the parity table.
  • the verification code 2 and the metadata 4 stored on the hard disk blocks K, J, and L are calculated by redundancy recovery to obtain the correct metadata 3 and correspondingly stored on the hard disk blocks G, H, and I, if the hard disk blocks G, H, I If there is damage, replace the damaged one with a new healthy hard disk block and store the correct metadata 3 on the new hard disk block. In this way, a layer of protection is added to the metadata to better protect the metadata, and it is easier to recover lost data in the event of an accident.
  • the embodiment of the present invention provides a method for protecting metadata, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit uses the first RAID storage method. And then selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the selected at least two storage unit groups, the third storage unit group having at least two elements belonging to different user data. Data, the third storage unit group belongs to the second type of storage unit group, and the second type of storage unit group uses the second RAID storage mode, and then generates at least two metadata belonging to different user data stored in the third storage unit group.
  • the first parity code is stored. This adds a layer of protection to the metadata, improves security, and reduces redundancy with the same redundancy.
  • the embodiment of the present invention further provides a metadata protection device 00. As shown in FIG. 5, the protection device includes:
  • the storage module 10 is configured to store metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit group uses a first type of RAID storage manner.
  • the storage module 10 is specifically configured to: store metadata belonging to different user data on each physical storage unit or hard disk block in the corresponding first type of storage unit group; the first type of storage unit group includes At least two physical storage units or hard disk blocks obtained by dividing physical storage unit groups according to a preset granularity.
  • the protection module 20 is configured to select at least two storage unit groups in the first type of storage unit group, and form a third storage unit group according to the at least two storage unit groups, where the third storage unit group stores at least two belonging to different users.
  • the protection module 20 can be specifically configured to: a physical storage unit or a hard disk block;
  • the third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity.
  • the parity code module 30 is configured to generate and store a first parity code for at least two metadata belonging to different user data stored by the third storage unit group. Specifically, the module is further configured to generate and store a second parity code for the first parity code and the at least one other parity code.
  • the at least one other parity code is a parity code other than the third metadata stored in different user data in the second type of memory cell group.
  • the above parity code may be a vertical parity code, a horizontal parity code or a horizontal vertical parity code.
  • Embodiments of the present invention provide a metadata protection apparatus, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit group uses the first type.
  • Embodiments of the present invention also provide a metadata protection device 90. As shown in FIG.
  • the device 90 includes: a bus 94; and a processor 91, a memory 92, and an interface 93 connected to the bus 94, wherein the interface 93 For communication; the memory 92 is for storing instructions, and the processor 91 is configured to execute the instructions for:
  • the metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first independent redundant disk array RAID storage mode; At least two storage unit groups, and forming a third storage unit group according to at least two storage unit groups, the third storage unit group storing at least two metadata belonging to different user data, and the third storage unit group belongs to the second type storage
  • the second group of storage unit groups uses the second RAID storage mode; the first parity code is generated and stored for at least two metadata belonging to different user data stored in the third storage unit group.
  • the executing the instruction by the processor 91 may be specifically used to:
  • the first type of storage unit group includes at least two physical storage units Or a hard disk block, where the hard disk block is obtained by dividing a physical storage unit group according to a preset granularity.
  • the executing the instruction by the processor 91 may also be specifically used to:
  • the third storage unit group is formed according to the physical storage unit or the hard disk block selected in each storage unit group; the third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk block divides the physical according to the preset granularity.
  • the storage unit group got.
  • the processor 91 executes the instruction to: generate a second parity code for the first parity code and the at least one other parity code and store the second parity code.
  • the at least one other parity code is a parity code of at least two metadata belonging to different user data stored in the second type of storage unit group except the third storage unit group.
  • the first RAID storage mode may be RAID1
  • the second RAID storage mode may be RAID5.
  • the embodiment of the present invention provides a metadata protection device, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit group uses a first RAID storage method. And then selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the selected at least two storage unit groups, the third storage unit group having at least two elements belonging to different user data.
  • the third storage unit group belongs to the second type of storage unit group, the second The class storage unit group uses the second RAID storage mode, and then generates and stores the first parity code for at least two metadata belonging to different user data stored in the third storage unit group. This adds a layer of protection to the metadata and improves security.
  • the character "/" in this article generally indicates that the contextual object is an "or" relationship.
  • each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may be physically included separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.
  • the above-described integrated modules implemented in the form of software functional units can be stored in a computer readable storage medium.
  • the above software function modules are stored in a storage medium and include a number of instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform part of the steps of the method of the various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and the like can store program codes. Medium.

Abstract

The present invention relates to the field of computers. Provided are a metadata protection method and device, providing metadata with an additional protection mechanism and improving security. The specific solution is: firstly, respectively storing the metadata belonging to data of different users into a corresponding first-class storage unit group, the first-class storage unit group being in a first redundant array of independent disks (RAID) storage mode; then selecting at least two storage unit groups from the first-class storage unit group, and forming a third storage unit group according to the at least two selected storage unit groups, the third storage unit group storing at least two metadata belonging to data of different users, the third storage unit group belonging to a second-class storage unit group, and the second-class storage unit group being in a second RAID storage mode; and generating and storing a first parity check code for the at least two metadata belonging to data of different users stored in the third storage unit group so as to protect the metadata.

Description

一种元数据的保护方法和装置  Method and device for protecting metadata
本申请要求于 2013年 10月 17日提交中国专利局、申请号 201310487474.9、 发明名称为 "一种元数据的保护方法和装置" 的中国专利申请的优先权, 其全 部内容通过引用结合在本申请中。  The present application claims priority to Chinese Patent Application No. 201310487474.9, entitled "A Method and Apparatus for Protecting Metadata", filed on October 17, 2013, the entire contents of which is incorporated herein by reference. in.
技术领域 Technical field
本发明涉及计算机领域, 尤其涉及一种元数据的保护方法和装置。  The present invention relates to the field of computers, and in particular, to a method and an apparatus for protecting metadata.
背景技术 Background technique
在存储领域中,用户的数据分散存储在逻辑硬盘上,逻辑硬盘是由多个独 立的物理硬盘或硬盘块组合而成的,硬盘块是指按照一定粒度划分物理硬盘组 (若干个物理硬盘组合在一起)的硬盘空间实现块虚拟化, 虚拟化的硬盘块内 物理地址连续。 逻辑硬盘中存储的元数据是在用户业务配置以及运行过程中产生的, 是用 来表述用户存储数据的空间信息、 映射关系以及配置信息等关键信息。 元数据 一旦遭到破坏逻辑硬盘将无法正常运行, 所以元数据的保护显的至关重要。 独立冗余磁盘阵列( Redundant Array of Independent Disks, RAID )数据存 储方式是把数据存储在由多个独立的物理硬盘或硬盘块组合而成的存储单元 组上, 通过把相同或不同的数据存储在多个物理硬盘或硬盘块上, 实现了数据 的备份或冗余保护。  In the storage domain, the data of the user is distributed on the logical hard disk. The logical hard disk is composed of multiple independent physical hard disks or hard disk blocks. The hard disk block refers to the physical hard disk group according to a certain granularity (a number of physical hard disk combinations). Together, the hard disk space implements block virtualization, and the physical addresses of the virtualized hard disk blocks are continuous. The metadata stored in the logical hard disk is generated during the user service configuration and running process, and is used to express key information such as spatial information, mapping relationship, and configuration information of the user stored data. Metadata Once the compromised logical hard drive is not working properly, metadata protection is critical. Redundant Array of Independent Disks (RAID) data storage method is to store data on a storage unit group composed of a plurality of independent physical hard disks or hard disk blocks, by storing the same or different data in Data backup or redundancy protection is implemented on multiple physical hard disks or hard disk blocks.
RAID1是把一个硬盘块的数据镜像到另一个硬盘块上,也就是说数据在写 入一个硬盘块的同时, 会在另一个闲置的硬盘块上生成镜像文件, 在不影响性 能情况下最大限度的保证系统的可靠性和可修复性, 只要系统中任何一对镜像 硬盘块中至少有一个硬盘块可以使用,甚至可以在一半数量的硬盘块出现问题 时系统都可以正常运行,当一个硬盘块失效时, 系统会忽略该硬盘块,转而使用 剩余的镜像硬盘块读写数据, 具备很好的磁盘冗余能力。 现有技术中元数据是以既定的 RAID1 的数据保护方法进行数据备份与保 护的, 保护方式比较单一, 当其中的一个或多个硬盘块发生故障时可能无法区 分正确的数据或者存在数据恢复的存在风险, 即使能够恢复数据也需要较长的 时间去读取正确的元数据信息。 RAID1 mirrors the data of one hard disk block to another hard disk block. That is to say, when data is written to one hard disk block, an image file is generated on another idle hard disk block, which maximizes the performance without affecting performance. Assuring the reliability and repairability of the system, as long as at least one of the hard disk blocks in any pair of mirrored hard disk blocks in the system can be used, even when half of the number of hard disk blocks have problems, the system can operate normally, when a hard disk block When it fails, the system ignores the hard disk block and uses the remaining mirrored hard disk block to read and write data, which has good disk redundancy. In the prior art, the metadata is backed up and protected by the data protection method of the established RAID1, and the protection mode is relatively simple. When one or more hard disk blocks fail, the correct data may be indistinguishable or the data recovery may exist. There is a risk that it takes a long time to read the correct metadata information even if the data can be recovered.
发明内容 Summary of the invention
本发明的实施例提供一种元数据的保护方法及装置, 解决了保护方式单一 导致的发生故障时可能无法区分正确的数据或者存在数据恢复风险的问题。  Embodiments of the present invention provide a method and an apparatus for protecting metadata, which solves the problem that a single protection mode may cause a failure to distinguish between correct data or a risk of data recovery.
为达到上述目的, 本发明的实施例釆用如下技术方案: 第一方面, 提供一种元数据的保护方法, 所述方法包括:  To achieve the above objective, the embodiment of the present invention uses the following technical solution: In a first aspect, a method for protecting metadata is provided, where the method includes:
将属于不同用户数据的元数据分别存储在对应的第一类存储单元组中, 所 述第一类存储单元组釆用第一种 RAID存储方式;  The metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first RAID storage mode;
在所述第一类存储单元组中选取至少两个存储单元组, 并根据所述至少两 个存储单元组形成第三存储单元组, 所述第三存储单元组存储有至少两个属于 不同用户数据的元数据, 所述第三存储单元组属于第二类存储单元组, 所述第 二类存储单元组釆用第二种 RAID存储方式;  Selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the at least two storage unit groups, wherein the third storage unit group stores at least two belonging to different users. The metadata of the data, the third storage unit group belongs to the second type of storage unit group, and the second type of storage unit group uses the second RAID storage mode;
为所述第三存储单元组存储的所述至少两个属于不同用户数据的元数据 生成第一奇偶校验码并储存。 结合第一方面, 在第一种可能的实现方式中, 将所述元数据中的属于不同 用户数据的元数据分别存储在对应的第一类存储单元组中, 所述第一类存储单 元组釆用第一种 RAID存储方式包括: 将所述元数据中的属于不同用户数据的元数据分别存储在对应的第一类 存储单元组中的每个物理存储单元或硬盘块上; 所述第一类存储单元组包括至少两个物理存储单元或硬盘块, 所述硬盘块 是根据预设粒度划分物理存储单元组得到的。 结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式中, 在 所述第一类存储单元组中选取至少两个存储单元组, 并根据所述至少两个存储 单元组形成第三存储单元组包括: 在所述第一类- 选出一个物理存储单元或硬盘块; Generating a first parity code for the at least two metadata belonging to different user data stored by the third storage unit group and storing. With reference to the first aspect, in a first possible implementation manner, metadata belonging to different user data in the metadata is separately stored in a corresponding first type of storage unit group, where the first type of storage unit group The first type of RAID storage method includes: storing metadata belonging to different user data in the metadata in each physical storage unit or hard disk block in the corresponding first type of storage unit group; A type of storage unit group includes at least two physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity. With reference to the first possible implementation of the first aspect, in a second possible implementation, at least two storage unit groups are selected in the first type of storage unit group, and according to the at least two storage units Forming the third storage unit group includes: selecting one physical storage unit or hard disk block in the first category;
L盘块组成所述第三 存储单元组; L disk blocks constitute the third storage unit group;
所述第三存储单元组包括至少三个物理存储单元或硬盘块, 所述硬盘块是 根据预设粒度划分物理存储单元组得到的。 结合第一方面, 在第三种可能的实现方式中, 为所述第三存储单元组存储 的所述至少两个属于不同用户数据的元数据生成第一奇偶校验码并储存还包 括:  The third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity. With reference to the first aspect, in a third possible implementation, generating, by the third storage unit group, the at least two metadata belonging to different user data, the first parity code and storing further includes:
为所述第一奇偶校验码和至少一个其他的奇偶校验码生成第二奇偶校验 码并储存;  Generating a second parity code for the first parity code and at least one other parity code and storing the second parity code;
所述至少一个其他的奇偶校验码为除所述第二类存储单元组中除第三存 于不同用户数据的元数据的奇偶校验码。  The at least one other parity code is a parity code other than the third metadata of the second type of memory cell group stored in the different user data.
结合第一方面, 在第四种可能的实现方式中, 所述第一种 RAID存储方式 为 RAID1, 所述第二种 RAID存储方式为 RAID5。 第二方面, 提供一种元数据的保护装置, 所述装置包括: 存储模块, 用于获取元数据, 并将所述元数据中的属于不同用户数据的元 数据分别存储在对应的第一类存储单元组中, 所述第一类存储单元组釆用第一 种 RAID存储方式; 保护模块, 用于在所述第一类存储单元组中选取至少两个存储单元组, 并 根据所述至少两个存储单元组形成第三存储单元组, 所述第三存储单元组存储 有至少两个属于不同用户数据的元数据, 所述第三存储单元组属于第二类存储 单元组, 所述第二类存储单元组釆用第二种 RAID存储方式; 奇偶校验码模块, 用于为所述第三存储单元组存储的所述至少两个属于不 同用户数据的元数据生成第一奇偶校验码并储存。 With reference to the first aspect, in a fourth possible implementation manner, the first RAID storage mode is RAID1, and the second RAID storage mode is RAID5. A second aspect provides a protection device for metadata, where the device includes: a storage module, configured to acquire metadata, and store metadata belonging to different user data in the metadata in a corresponding first class In the storage unit group, the first type of storage unit group uses a first type of storage mode, and the protection module is configured to select at least two storage unit groups in the first type of storage unit group, and Forming, according to the at least two storage unit groups, a third storage unit group, wherein the third storage unit group stores at least two metadata belonging to different user data, and the third storage unit group belongs to the second type storage unit group The second type of storage unit group uses the second RAID storage mode; the parity code module is configured to generate, for the third storage unit group, the at least two metadata belonging to different user data. A parity code is stored and stored.
结合第二方面, 在第一种可能的实现方式中, 所述存储模块具体用于: 将所述元数据中的属于不同用户数据的元数据分别存储在对应的第一类 存储单元组中的每个物理存储单元或硬盘块上; 所述第一类存储单元组包括至少两个物理存储单元或硬盘块, 所述硬盘块 是根据预设粒度划分物理存储单元组得到的。  With reference to the second aspect, in a first possible implementation manner, the storage module is specifically configured to: store metadata belonging to different user data in the metadata in a corresponding first type of storage unit group Each of the physical storage units or the hard disk block; the first type of storage unit group includes at least two physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity.
结合第二方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所 述保护模块具体用于:  In conjunction with the first possible implementation of the second aspect, in a second possible implementation, the protection module is specifically configured to:
在所述第一类- 选出一个物理存储单元或硬盘块;  In the first category - selecting a physical storage unit or a hard disk block;
L盘块组成所述第三 存储单元组; L disk blocks constitute the third storage unit group;
所述第二类存储单元组包括至少三个物理存储单元或硬盘块, 所述硬盘块 是根据预设粒度划分物理存储单元组得到的。  The second type of storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity.
结合第二方面,在第三种可能的实现方式中,所述奇偶校验码模块还用于: 为所述第一奇偶校验码和至少一个其他的奇偶校验码生成第二奇偶校验 码并储存;  With reference to the second aspect, in a third possible implementation, the parity code module is further configured to: generate a second parity for the first parity code and the at least one other parity code Code and store;
所述至少一个其他的奇偶校验码为除所述第二类存储单元组中除第三存 储单元组外其他的釆用第二  The at least one other parity code is other than the third storage unit group except the third storage unit group.
于不同用户数据的元数据的奇偶校验码 < 结合第二方面, 在第四种可能的实现方式中, 所述第一种 RAID存储方式 为 RAID1, 所述第二种 RAID存储方式为 RAID5。 本发明的实施例提供一种元数据的保护方法和装置, 首先获取元数据, 并 将所述元数据中的属于不同用户数据的元数据分别存储在对应的第一类存储 单元组中, 所述第一类存储单元组釆用第一种 RAID存储方式, 然后在所述第 一类存储单元组中选取至少两个存储单元组, 并根据所述至少两个存储单元组 形成第三存储单元组, 所述第三存储单元组存储有至少两个属于不同用户数据 的元数据, 所述第三存储单元组属于第二类存储单元组, 所述第二类存储单元 组釆用第二种 RAID存储方式, 而后为所述第三存储单元组存储的所述至少两 个属于不同用户数据的元数据生成第一奇偶校验码并储存。 这样为元数据多增 加了一层保护机制, 降低了数据恢复的风险, 提高了安全性。 Parity code of metadata for different user data < With reference to the second aspect, in a fourth possible implementation manner, the first RAID storage mode is RAID1, and the second RAID storage mode is RAID5. An embodiment of the present invention provides a method and an apparatus for protecting metadata, first acquiring metadata, and storing metadata belonging to different user data in the metadata in a corresponding first type of storage unit group. The first type of storage unit group uses the first RAID storage mode, and then selects at least two storage unit groups in the first type of storage unit group, and forms a third storage unit according to the at least two storage unit groups. The third storage unit group stores at least two metadata belonging to different user data, the third storage unit group belongs to the second type storage unit group, and the second type storage unit group uses the second type. And storing, by the RAID storage mode, the first parity code for the at least two metadata belonging to different user data stored by the third storage unit group and storing the first parity code. This adds a layer of protection to the metadata, which reduces the risk of data recovery and improves security.
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付 出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。 图 1为本发明实施例提供的一种元数据的保护方法的流程示意图一; 图 2为本发明实施例提供的一种元数据的保护方法的流程示意图二; 图 3为本发明实施例提供的一种元数据的保护方法的效果示意图一; 图 4为本发明实施例提供的一种元数据的保护方法的效果示意图二; 图 5为本发明的实施例提供的一种元数据的保护装置的结构示意图一; 图 6为本发明的实施例提供的一种元数据的保护装置的结构示意图二。 具体实施方式 下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。 本发明的实施例提供一种元数据的保护方法, 如图 1所示, 该方法包括: BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings to be used in the embodiments or the description of the prior art will be briefly described below, and obviously, in the following description The drawings are only some of the embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative work. 1 is a schematic flowchart 1 of a method for protecting metadata according to an embodiment of the present invention; FIG. 2 is a schematic flowchart 2 of a method for protecting metadata according to an embodiment of the present invention; FIG. 4 is a schematic diagram 2 of a method for protecting a metadata according to an embodiment of the present invention; FIG. 5 is a diagram of protection of metadata according to an embodiment of the present invention; FIG. 6 is a schematic structural diagram 2 of a metadata protection device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The technical solutions in the embodiments of the present invention will be clarified in the following with reference to the accompanying drawings in the embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS It is apparent that the described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without departing from the inventive scope are the scope of the present invention. An embodiment of the present invention provides a method for protecting metadata. As shown in FIG. 1, the method includes:
101、 将元数据中的属于不同用户数据的元数据分别存储在对应的第一类 存储单元组中, 第一类存储单元组釆用第一种 RAID存储方式。 101. The metadata belonging to different user data in the metadata is respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first type of RAID storage manner.
102、 在第一类存储单元组中选取至少两个存储单元组, 并根据至少两个 存储单元组形成第三存储单元组, 第三存储单元组存储有至少两个属于不同用 户数据的元数据, 第三存储单元组属于第二类存储单元组, 第二类存储单元组 釆用第二种 RAID存储方式。 102. Select at least two storage unit groups in the first type of storage unit group, and form a third storage unit group according to the at least two storage unit groups, where the third storage unit group stores at least two metadata belonging to different user data. The third storage unit group belongs to the second type storage unit group, and the second type storage unit group uses the second RAID storage method.
103、 为第三存储单元组存储的至少两个属于不同用户数据的元数据生成 第一奇偶校验码并储存。 本发明的实施例提供一种元数据的保护方法, 首先将属于不同用户数据的 元数据分别存储在对应的第一类存储单元组中, 第一类存储单元组釆用第一种 RAID存储方式, 然后在第一类存储单元组中选取至少两个存储单元组, 并根 据选取的至少两个存储单元组形成第三存储单元组, 第三存储单元组存储有至 少两个属于不同用户数据的元数据, 第三存储单元组属于第二类存储单元组, 第二类存储单元组釆用第二种 RAID存储方式, 而后为第三存储单元组存储的 至少两个属于不同用户数据的元数据生成第一奇偶校验码并储存。 这样为元数 据多增加了一层保护机制, 提高了安全性。 本发明的实施例还提供一种元数据的保护方法,如图 2所示,该方法包括: 103. Generate a first parity code for at least two metadata belonging to different user data stored in the third storage unit group and store the first parity code. The embodiment of the present invention provides a method for protecting metadata, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit uses the first RAID storage method. And then selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the selected at least two storage unit groups, the third storage unit group storing at least two belonging to different user data. Metadata, the third storage unit group belongs to the second type of storage unit group, the second type of storage unit group uses the second RAID storage mode, and then the third storage unit group stores at least two metadata belonging to different user data. A first parity code is generated and stored. This adds a layer of protection to the metadata and improves security. An embodiment of the present invention further provides a method for protecting metadata, as shown in FIG. 2, the method includes:
201、 将属于不同用户数据的元数据分别存储在对应的第一类存储单元组 中, 第一类存储单元组釆用第一种 RAID存储方式。 由硬盘块组成的, 其中, 硬盘块(Chunk )是将硬盘空间按照一定的切分粒度 划分得到的硬盘空间,硬盘块内硬盘物理地址连续。以第一类存储单元组为例, 若第一类存储单元组是由物理存储单元组成的, 则第一类存储单元组至少包括 两个物理存储单元, 若第一类存储单元组是由硬盘块组成的, 则第一类存储单 元组至少包括两个硬盘块, 另外, 由多个硬盘块按照指定的 RAID类型组成的 逻辑空间称为硬盘块组(Chunk Group ) , 因此, 也可以将第一类存储单元组 称为第一类 Chunk Group, 下文的第二类存储单元组也同样适用。 其中, 物理 存储单元可以为物理硬盘, 比如磁盘或者 SSD ( Solid State Disk, 固态硬盘), 或者可以为闪存, 还可以为光盘或者其他物理存储器。 故将属于不同用户数据的元数据分别存储在对应的第一类存储单元组中, 具体可以通过: 将属于不同用户数据的元数据分别存储在对应的第一类存储单元组中的 每个物理存储单元或硬盘块上; 第一类存储单元组包括至少两个物理存储单元或硬盘块。该硬盘块是根据 预设粒度划分物理存储单元组得到的。 其中, 本发明实施例中提及的第一种 RAID存储方式可以是 RAID1, 以物 理硬盘为例, 上述的物理存储单元组可以由多个大容量的物理硬盘组成, 例如 用 4个 500G的物理硬盘组成一个物理存储单元组。 其中, RAID1是把一个物理存储单元或硬盘块的数据镜像到另一个物理存 储单元或硬盘块上的技术,也就是说数据在写入一个物理存储单元或硬盘块的 同时, 会在另一个闲置的物理存储单元或硬盘块上生成镜像文件, 在不影响性 能情况下最大限度的保证系统的可靠性和可修复性, 只要系统中任何一对镜像 物理存储单元或硬盘块中至少有一个物理存储单元或硬盘块可以使用,甚至可 以在一半数量的物理存储单元或硬盘块出现问题时系统都可以正常运行,当一 个物理存储单元或硬盘块失效时, 系统会忽略该物理存储单元或硬盘块, 转而 使用剩余的镜像物理存储单元或硬盘块读写数据, 具备很好的磁盘冗余能力。 201. The metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first type of RAID storage manner. The hard disk block (Chunk) is a hard disk space obtained by dividing the hard disk space according to a certain granularity, and the physical address of the hard disk in the hard disk block is continuous. Taking the first type of storage unit group as an example, if the first type of storage unit group is composed of physical storage units, the first type of storage unit group includes at least two physical storage units, and if the first type of storage unit group is composed of a hard disk The first type of storage unit group includes at least two hard disk blocks. In addition, a logical space composed of a plurality of hard disk blocks according to a specified RAID type is called a hard disk block group (Chunk Group), and therefore, One type of storage unit group is called the first type of Chunk Group, and the second type of storage unit group is also applicable. The physical storage unit may be a physical hard disk, such as a disk or an SSD (Solid State Disk), or may be a flash memory, or may be a compact disk or other physical storage. Therefore, the metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the specific metadata may be: storing each metadata belonging to different user data in each physical medium of the corresponding first type storage unit group. The storage unit or the hard disk block; the first type of storage unit group includes at least two physical storage units or hard disk blocks. The hard disk block is obtained by dividing a physical storage unit group according to a preset granularity. The first RAID storage mode mentioned in the embodiment of the present invention may be RAID1. Taking a physical hard disk as an example, the physical storage unit group may be composed of multiple large-capacity physical hard disks, for example, four 500G physical technologies. The hard disks form a physical storage unit group. Among them, RAID1 is a technology for mirroring data of one physical storage unit or hard disk block to another physical storage unit or hard disk block, that is, data is idle while being written to one physical storage unit or hard disk block. An image file is generated on a physical storage unit or a hard disk block to ensure the reliability and repairability of the system to the utmost extent without affecting performance. As long as there is at least one physical storage in any pair of mirrored physical storage units or hard disk blocks in the system. The unit or hard disk block can be used, and the system can operate normally even when there are problems in half of the physical storage unit or the hard disk block. When a physical storage unit or hard disk block fails, the system ignores the physical storage unit or the hard disk block. Turn instead Use the remaining mirrored physical storage unit or hard disk block to read and write data, with good disk redundancy.
202、 在第一类存储单元组中选取至少两个存储单元组, 并根据至少两个 存储单元组形成第三存储单元组。 示例' )·生的, 可以通过: 202. Select at least two storage unit groups in the first type of storage unit group, and form a third storage unit group according to the at least two storage unit groups. Example ')· born, can pass:
一个物理存储单元或硬盘块, 优选的, 可以从上述至少两个存储单元组中的每 个存储单元组中各自选出一个健康状态最好的物理存储单元或硬盘块; Preferably, a physical storage unit or a hard disk block is selected from each of the at least two storage unit groups;
根据每个存储单元组中选出的物理存储单元或硬盘块组成第三存储单元 组; 第三存储单元组属于第二类存储单元组, 第三存储单元组存储有至少两个 属于不同用户数据的元数据, 第二类存储单元组釆用第二种 RAID存储方式。 其中, 上述第二类存储单元组包括至少三个物理存储单元或硬盘块, 该硬 盘块是根据预设粒度划分物理存储单元组得到的, 所以第三存储单元组也包括 至少三个物理存储单元或硬盘块。 示例性的,在本发明实施例中提及的第二种 RAID存储方式可以是 RAID5。 其中, RAID5是一种为数据生成奇偶校验码后,将数据所在的物理存储单 元(或硬盘块)和相对应的奇偶校验码所在的物理存储单元(或硬盘块)组成 存储单元组的技术。 当 RAID5 的一个物理存储单元(或硬盘块)数据发生损 坏后, 可以利用剩下的数据和相应的奇偶校验码去恢复被损坏的数据。  Forming a third storage unit group according to the selected physical storage unit or hard disk block in each storage unit group; the third storage unit group belongs to the second type storage unit group, and the third storage unit group stores at least two belonging to different user data. Metadata, the second type of storage unit group uses the second RAID storage method. The second type of storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk block is obtained by dividing a physical storage unit group according to a preset granularity, so the third storage unit group also includes at least three physical storage units. Or hard disk block. Illustratively, the second RAID storage method mentioned in the embodiment of the present invention may be RAID 5. The RAID 5 is a physical storage unit (or a hard disk block) in which the data is stored, and a physical storage unit (or a hard disk block) in which the corresponding parity code is located is formed into a storage unit group. technology. When the data of one physical storage unit (or hard disk block) of RAID5 is damaged, the remaining data and the corresponding parity code can be used to recover the damaged data.
RAID5数据存储方式至少需要三个物理存储单元或硬盘块,把数据和相对 应的奇偶校验码存储到组成 RAID5 的各个物理存储单元或硬盘块上, 并且奇 意 n-1 ( n为组成 RAID5的物理存储单元或硬盘块的个数 )个物理存储单元或 硬盘块上都存储完整的数据,也就是说有相当于一个物理存储单元或硬盘块容 量的空间用于存储奇偶校验码。 因此当 RAID5 的一个物理存储单元或硬盘块 发生损坏后, 不会影响数据的完整性, 从而保证了数据安全。 当损坏的物理存 储单元或硬盘块被替换后, RAID还会自动利用剩下奇偶校验码去重建此物理 存储单元或硬盘块上的数据, 保持了数据存储的高可靠性。 The RAID5 data storage method requires at least three physical storage units or hard disk blocks, and stores the data and the corresponding parity code on each physical storage unit or hard disk block that constitutes RAID5, and the odd-numbered n-1 (n is composed of RAID5). The physical storage unit or the number of hard disk blocks) the physical storage unit or the hard disk block stores complete data, that is, equivalent to one physical storage unit or hard disk block capacity The amount of space is used to store the parity code. Therefore, when a physical storage unit or hard disk block of RAID5 is damaged, the integrity of the data is not affected, thereby ensuring data security. When a damaged physical storage unit or hard disk block is replaced, RAID automatically uses the remaining parity code to reconstruct the data on the physical storage unit or hard disk block, maintaining high reliability of data storage.
203、 为第三存储单元组存储的至少两个属于不同用户数据的元数据生成 第一奇偶校验码并储存。 示例性的, 奇偶校验码可以是垂直奇偶校验码、 水平奇偶校验码或水平垂 直奇偶校验码。 203. Generate a first parity code for at least two metadata belonging to different user data stored in the third storage unit group and store the first parity code. Illustratively, the parity code may be a vertical parity code, a horizontal parity code, or a horizontal vertical parity code.
204、 为第一奇偶校验码和至少一个其他的奇偶校验码生成第二奇偶校验 码并储存。 具体的, 上述至少一个其他的奇偶校验码为除第二类存储单元组中除第三 属于不同用户数据的元数据的奇偶校验码。 为了使本领域技术人员能够更清楚地理解本发明实施例提供的技术方案, 下面通过具体的例子, 对本发明的实施例提供的另一种元数据的保护方法进行 详细说明: 例 1, 如图 3 所示, 4叚设图中黑色和白色部分是釆用了第一类存储方式 RAID1的第一存储单元组和第二存储单元组, 其中, 第一存储单元组由硬盘块 A、 B、 C组成, 硬盘块 A、 B、 C上存储有相同的元数据 1, 第二存储单元组 由硬盘块0、 E、 Z组成, 硬盘块 D、 E、 Z上存储有相同的元数据 2, 然后在 第一存储单元组和第二存储单元组中选择硬盘块 A和 D, 对硬盘块 A和 D上 存储的元数据 1和元数据 2进行异或运算得到元数据 1和元数据 2的奇偶校验 码 1, 将得到的奇偶校验码 1存储在硬盘块 Z上, 奇偶校验码 1属于第一奇偶 校验码,硬盘块 A、 D、 Z以 RAID5的存储方式组成第三存储单元组,第三存储 单元组属于第二类存储单元组。 从而为元数据增加了一层保护机制, 能够更好 的保护元数据。 204. Generate a second parity code for the first parity code and the at least one other parity code and store the second parity code. Specifically, the at least one other parity code is a parity code other than the third metadata belonging to different user data in the second type of storage unit group. In order to enable a person skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present invention, another method for protecting metadata provided by the embodiments of the present invention is described in detail by using specific examples: 3, the black and white part of the figure is the first memory cell group and the second memory cell group using the first type of storage mode RAID1, wherein the first memory cell group is composed of hard disk blocks A, B, C composition, the same metadata 1 is stored on the hard disk blocks A, B, and C, and the second storage unit group is composed of hard disk blocks 0, E, and Z, and the same metadata 2 is stored on the hard disk blocks D, E, and Z. Then, the hard disk blocks A and D are selected in the first storage unit group and the second storage unit group, and the metadata 1 and the metadata 2 stored on the hard disk blocks A and D are XORed to obtain the metadata 1 and the metadata 2 Parity code 1, the obtained parity code 1 is stored on the hard disk block Z, the parity code 1 belongs to the first parity code, and the hard disk blocks A, D, Z are stored in the storage mode of the RAID 5 to form the third storage. Unit group, the third storage unit group belongs to the Type memory cell groups. Thereby adding a layer of protection to the metadata, which is better Protection metadata.
例 2, 如图 4所示, 硬盘块 G、 H、 I组成第四存储单元组, 硬盘块 J、 K、 L组成第五存储单元组, 硬盘块 0、 P、 Q组成第六存储单元组, 硬盘块 R、 S、 T组成第七存储单元组, 第四、五、 六、 七存储单元组分别存储有元数据 3、 4、 5、 6, 第四、 五、 六、 七存储单元组均釆用 RAID1 的存储方式且都属于第一 类存储单元组,按照例 1中的方法得到元数据 3和元数据 4的奇偶校验码 2以 及元数据 5和元数据 6的奇偶校验码 4, 然后对奇偶校验码 2和奇偶校验码 3 异或运算得到奇偶校验码 2和奇偶校验码 3的奇偶校验码 4, 奇偶校验码 2和 奇偶校验码 3属于第一奇偶校验码, 奇偶校验码 4属于第二奇偶校验码, 硬盘 块0、 M、 J组成第八存储单元组, 硬盘块 0、 R、 N组成第九存储单元组, 硬 盘块 M、 N、 U组成第十存储单元组, 第八、 九、 十存储单元组均以 RAID5 存储方式组成, 第八、 九、 十存储单元组属于第二类存储单元组。 这样对奇偶 校验码也进行了保护, 进一步增强了对元数据的保护。 这里还要指出的是, 本 例中存储元数据 3和元数据 4的奇偶校验码 的硬盘块 M并非是专门用来存 储奇偶校验码的, 可以用存储其他元数据的硬盘块来存储奇偶校验码, 比如说 可以是存储元数据 5的硬盘块 P。 这是因为, 对于 RAID5存储方式, 是将元数 据和元数据的奇偶校验码分开存储在不同的硬盘块上, 不同元数据和对应的不 同的奇偶校验码分开交叉存储在不同的硬盘块上, 只要保证元数据和该元数据 对应的奇偶校验码没有存储在同一个硬盘块上, 这样存储的效果就相当于用一 个硬盘块单独存储奇偶校验码。  Example 2, as shown in FIG. 4, the hard disk blocks G, H, and I form a fourth storage unit group, the hard disk blocks J, K, and L form a fifth storage unit group, and the hard disk blocks 0, P, and Q form a sixth storage unit group. The hard disk blocks R, S, and T constitute a seventh storage unit group, and the fourth, fifth, sixth, and seventh storage unit groups respectively store metadata 3, 4, 5, 6, fourth, fifth, sixth, and seventh storage unit groups. The RAID 1 storage mode is used and both belong to the first type of storage unit group, and the parity code 2 of the metadata 3 and the metadata 4 and the parity code of the metadata 5 and the metadata 6 are obtained according to the method in the first example. 4. Then, the parity code 2 and the parity code 3 are XORed to obtain the parity code 2 of the parity code 2 and the parity code 3, and the parity code 2 and the parity code 3 belong to the a parity check code, the parity check code 4 belongs to the second parity check code, the hard disk blocks 0, M, and J constitute the eighth storage unit group, and the hard disk blocks 0, R, and N constitute the ninth storage unit group, and the hard disk block M , N, U form the tenth storage unit group, the eighth, ninth, tenth storage unit group In RAID5 storage composition, eighth, ninth, tenth memory cell group belong to the second memory cell group. This also protects the parity code, further enhancing the protection of the metadata. It should also be noted here that the hard disk block M storing the parity code of the metadata 3 and the metadata 4 in this example is not specifically used for storing the parity code, and may be stored by a hard disk block storing other metadata. The parity code, for example, may be the hard disk block P storing the metadata 5. This is because, for the RAID5 storage mode, the parity code of the metadata and the metadata are separately stored on different hard disk blocks, and different metadata and corresponding different parity codes are separately stored and stored in different hard disk blocks. In the above, as long as the metadata and the parity code corresponding to the metadata are not stored on the same hard disk block, the effect of the storage is equivalent to storing the parity code separately by using one hard disk block.
另外值得一提的是, 上述例 1和例 2中的奇偶校验码可以用来校验存储在 硬盘块上的元数据是否正确。例如在例 1中假设通过校验计算得知硬盘块 A上 存储的元数据 1错误, 那么向硬盘块 A上重新存储正确的元数据 1, 如果硬盘 块 A损坏则用新的健康状态良好的硬盘块替换硬盘块 A并将正确的元数据 1 存储在新的硬盘块上。 上述例 1和例 2中的奇偶校验码还可以用来恢复损坏的 元数据。 例如在例 2中假设存储在硬盘块 G、 H、 I上的元数据 3全部错误且存 储在硬盘块 M上的奇偶校验码 2也错误, 则可以根据硬盘块 N上存储的奇偶 校验码 3和硬盘块 U上存储的奇偶校验码 4通过冗余恢复计算得到奇偶校验码 2并存储在硬盘块 M上, 如果硬盘块 M损坏则用新的健康状态良好的硬盘块 替换硬盘块 M并将正确的奇偶校验码 2存储在新的硬盘块上, 再根据奇偶校 验码 2和硬盘块 K、 J、 L上存储的元数据 4通过冗余恢复计算得到正确的元数 据 3并对应存储在硬盘块 G、 H、 I上, 如果硬盘块 G、 H、 I中有损坏的则用 新的健康状态良好的硬盘块替换损坏掉的并将正确的元数据 3存储在新的硬盘 块上。通过这样的方法, 为元数据增加了一层保护机制, 更好的保护了元数据, 在发生意外时也能够比较容易恢复丟失的数据。 It is also worth mentioning that the parity codes in the above examples 1 and 2 can be used to verify whether the metadata stored on the hard disk block is correct. For example, in the example 1, it is assumed that the metadata 1 stored on the hard disk block A is incorrectly verified by the check calculation, then the correct metadata 1 is re-stored on the hard disk block A, and if the hard disk block A is damaged, the new healthy state is good. The hard disk block replaces hard disk block A and stores the correct metadata 1 on the new hard disk block. The parity codes in the above examples 1 and 2 can also be used to recover corrupted metadata. For example, in Example 2, it is assumed that the metadata 3 stored on the hard disk blocks G, H, and I is all wrong and stored. If the parity code 2 stored on the hard disk block M is also incorrect, the parity can be calculated by redundancy recovery according to the parity code 3 stored on the hard disk block N and the parity code 4 stored on the hard disk block U. The code 2 is stored on the hard disk block M. If the hard disk block M is damaged, the hard disk block M is replaced with a new healthy hard disk block and the correct parity code 2 is stored on the new hard disk block, and then according to the parity table. The verification code 2 and the metadata 4 stored on the hard disk blocks K, J, and L are calculated by redundancy recovery to obtain the correct metadata 3 and correspondingly stored on the hard disk blocks G, H, and I, if the hard disk blocks G, H, I If there is damage, replace the damaged one with a new healthy hard disk block and store the correct metadata 3 on the new hard disk block. In this way, a layer of protection is added to the metadata to better protect the metadata, and it is easier to recover lost data in the event of an accident.
最后, 还要指出的是, 在现有技术中, 一般是以 4个存储单元以 RAID1 的形式存储元数据, 如果有 N个不同的元数据就需要 4N个存储单元, 然而根 储单元, 这样就能够节省存储空间也即减少了冗余空间。 比如在例 1中, N=2, 每个元数据需要 4个存储单元来保护数据,釆用例 1提供的方法只需要 3N+1=7 个存储单元, 若釆用现有技术的方法则需要 4N=8个存储单元, 因此, 相比现 有技术, 减少了 N-l=l个存储单元, 由此可以看出冗余度相同的情况下减少了 冗余空间。  Finally, it should be pointed out that in the prior art, metadata is generally stored in the form of RAID1 in four storage units, and if there are N different metadata, 4N storage units are needed, but the root storage unit is This saves storage space and reduces redundant space. For example, in Example 1, N=2, each metadata requires 4 storage units to protect data, and the method provided by use case 1 only needs 3N+1=7 storage units, if using the prior art method, 4N = 8 memory cells, therefore, Nl = 1 memory cells are reduced compared to the prior art, and it can be seen that the redundancy space is reduced with the same redundancy.
本发明的实施例提供一种元数据的保护方法, 首先将属于不同用户数据的 元数据分别存储在对应的第一类存储单元组中, 第一类存储单元组釆用第一种 RAID存储方式, 然后在第一类存储单元组中选取至少两个存储单元组, 并根 据选取的至少两个存储单元组形成第三存储单元组, 第三存储单元组有至少两 个属于不同用户数据的元数据, 第三存储单元组属于第二类存储单元组, 第二 类存储单元组釆用第二种 RAID存储方式, 而后为第三存储单元组存储的至少 两个属于不同用户数据的元数据生成第一奇偶校验码并储存。这样为元数据多 增加了一层保护机制, 提高了安全性, 并且在冗余度相同的情况下减少了冗余 本发明的实施例还提供一种元数据的保护装置 00,如图 5所示,该保护装 置包括: The embodiment of the present invention provides a method for protecting metadata, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit uses the first RAID storage method. And then selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the selected at least two storage unit groups, the third storage unit group having at least two elements belonging to different user data. Data, the third storage unit group belongs to the second type of storage unit group, and the second type of storage unit group uses the second RAID storage mode, and then generates at least two metadata belonging to different user data stored in the third storage unit group. The first parity code is stored. This adds a layer of protection to the metadata, improves security, and reduces redundancy with the same redundancy. The embodiment of the present invention further provides a metadata protection device 00. As shown in FIG. 5, the protection device includes:
存储模块 10,用于将属于不同用户数据的元数据分别存储在对应的第一类 存储单元组中, 第一类存储单元组釆用第一种 RAID存储方式。 可选的, 存储模块 10可以具体用于: 将属于不同用户数据的元数据分别存储在对应的第一类存储单元组中的 每个物理存储单元或硬盘块上; 第一类存储单元组包括至少两个物理存储单元或硬盘块, 该硬盘块是根据 预设粒度划分物理存储单元组得到的。  The storage module 10 is configured to store metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit group uses a first type of RAID storage manner. Optionally, the storage module 10 is specifically configured to: store metadata belonging to different user data on each physical storage unit or hard disk block in the corresponding first type of storage unit group; the first type of storage unit group includes At least two physical storage units or hard disk blocks obtained by dividing physical storage unit groups according to a preset granularity.
保护模块 20,用于在第一类存储单元组中选取至少两个存储单元组, 并根 据至少两个存储单元组形成第三存储单元组, 第三存储单元组存储有至少两个 属于不同用户数据的元数据, 第三存储单元组属于第二类存储单元组, 第二类 存储单元组釆用第二种 RAID存储方式。 可选的, 保护模块 20可以具体用于: 一个物理存储单元或硬盘块;  The protection module 20 is configured to select at least two storage unit groups in the first type of storage unit group, and form a third storage unit group according to the at least two storage unit groups, where the third storage unit group stores at least two belonging to different users. The metadata of the data, the third storage unit group belongs to the second type storage unit group, and the second type storage unit group uses the second RAID storage method. Optionally, the protection module 20 can be specifically configured to: a physical storage unit or a hard disk block;
根据每个存储单元组中选出的物理存储单元或硬盘块组成第三存储单元 组;  Forming a third storage unit group according to a physical storage unit or a hard disk block selected in each storage unit group;
第三存储单元组包括至少三个物理存储单元或硬盘块,硬盘块是根据预设 粒度划分物理存储单元组得到的。  The third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing physical storage unit groups according to a preset granularity.
奇偶校验码模块 30,用于为第三存储单元组存储的至少两个属于不同用户 数据的元数据生成第一奇偶校验码并储存。 具体的, 该模块还可以用于为第一奇偶校验码和至少一个其他的奇偶校验 码生成第二奇偶校验码并储存。 其中, 上述至少一个其他的奇偶校验码为除第二类存储单元组中除第三存 于不同用户数据的元数据的奇偶校验码。 The parity code module 30 is configured to generate and store a first parity code for at least two metadata belonging to different user data stored by the third storage unit group. Specifically, the module is further configured to generate and store a second parity code for the first parity code and the at least one other parity code. The at least one other parity code is a parity code other than the third metadata stored in different user data in the second type of memory cell group.
示例性的, 上述的奇偶校验码可以是垂直奇偶校验码, 水平奇偶校验码或 者水平垂直奇偶校验码。 本发明的实施例提供一种元数据的保护装置, 首先将属于不同用户数据的 元数据分别存储在对应的第一类存储单元组中, 第一类存储单元组釆用第一种 Exemplarily, the above parity code may be a vertical parity code, a horizontal parity code or a horizontal vertical parity code. Embodiments of the present invention provide a metadata protection apparatus, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit group uses the first type.
RAID存储方式, 然后在第一类存储单元组中选取至少两个存储单元组, 并根 据选取的至少两个存储单元组形成第三存储单元组, 第三存储单元组有至少两 个属于不同用户数据的元数据, 第三存储单元组属于第二类存储单元组, 第二 类存储单元组釆用第二种 RAID存储方式, 而后为第三存储单元组存储的至少 两个属于不同用户数据的元数据生成第一奇偶校验码并储存。这样为元数据多 增加了一层保护机制, 提高了安全性。 本发明的实施例还提供一种元数据的保护装置 90, 如图 6所示, 该装置 90包括: 总线 94; 以及连接到总线 94的处理器 91、 存储器 92和接口 93, 其 中该接口 93用于通信; 该存储器 92用于存储指令, 处理器 91用于执行该指 令用于: RAID storage mode, then selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the selected at least two storage unit groups, the third storage unit group having at least two belonging to different users Metadata of the data, the third storage unit group belongs to the second type of storage unit group, the second type of storage unit group uses the second RAID storage mode, and then the third storage unit group stores at least two belonging to different user data. The metadata generates a first parity code and stores it. This adds a layer of protection to the metadata and improves security. Embodiments of the present invention also provide a metadata protection device 90. As shown in FIG. 6, the device 90 includes: a bus 94; and a processor 91, a memory 92, and an interface 93 connected to the bus 94, wherein the interface 93 For communication; the memory 92 is for storing instructions, and the processor 91 is configured to execute the instructions for:
将属于不同用户数据的元数据分别存储在对应的第一类存储单元组中, 第 一类存储单元组釆用第一种独立冗余磁盘阵列 RAID存储方式; 在第一类存储单元组中选取至少两个存储单元组, 并根据至少两个存储单 元组形成第三存储单元组, 第三存储单元组存储有至少两个属于不同用户数据 的元数据, 第三存储单元组属于第二类存储单元组, 第二类存储单元组釆用第 二种 RAID存储方式; 为第三存储单元组存储的至少两个属于不同用户数据的元数据生成第一 奇偶校验码并储存。 可选的, 处理器 91执行该指令可以具体用于: The metadata belonging to different user data are respectively stored in the corresponding first type of storage unit group, and the first type of storage unit group uses the first independent redundant disk array RAID storage mode; At least two storage unit groups, and forming a third storage unit group according to at least two storage unit groups, the third storage unit group storing at least two metadata belonging to different user data, and the third storage unit group belongs to the second type storage The second group of storage unit groups uses the second RAID storage mode; the first parity code is generated and stored for at least two metadata belonging to different user data stored in the third storage unit group. Optionally, the executing the instruction by the processor 91 may be specifically used to:
将所述元数据中的属于不同用户数据的元数据分别存储在对应的第一类 存储单元组中的每个硬盘或硬盘块上; 所述第一类存储单元组包括至少两个物理存储单元或硬盘块, 所述硬盘块 是根据预设粒度划分物理存储单元组得到的。  Storing metadata belonging to different user data in the metadata on each hard disk or hard disk block in the corresponding first type of storage unit group; the first type of storage unit group includes at least two physical storage units Or a hard disk block, where the hard disk block is obtained by dividing a physical storage unit group according to a preset granularity.
可选的, 处理器 91执行该指令还可以具体用于:  Optionally, the executing the instruction by the processor 91 may also be specifically used to:
一个物理存储单元或硬盘块; a physical storage unit or hard disk block;
根据每个存储单元组中选出的物理存储单元或硬盘块组成第三存储单元 组; 第三存储单元组包括至少三个物理存储单元或硬盘块, 所述硬盘块是根据 预设粒度划分物理存储单元组得到的。  The third storage unit group is formed according to the physical storage unit or the hard disk block selected in each storage unit group; the third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk block divides the physical according to the preset granularity. The storage unit group got.
可选的, 处理器 91执行该指令用于: 为第一奇偶校验码和至少一个其他 的奇偶校验码生成第二奇偶校验码并储存。  Optionally, the processor 91 executes the instruction to: generate a second parity code for the first parity code and the at least one other parity code and store the second parity code.
其中, 至少一个其他的奇偶校验码为第二类存储单元组中除第三存储单元 组外其他的釆用存储单元组存储的至少两个属于不同用户数据的元数据的奇 偶校验码。 可选的, 第一种 RAID存储方式可以为 RAID1 , 第二种 RAID存储方式可 以为 RAID5。 本发明的实施例提供一种元数据的保护装置, 首先将属于不同用户数据的 元数据分别存储在对应的第一类存储单元组中, 第一类存储单元组釆用第一种 RAID存储方式, 然后在第一类存储单元组中选取至少两个存储单元组, 并根 据选取的至少两个存储单元组形成第三存储单元组, 第三存储单元组有至少两 个属于不同用户数据的元数据, 第三存储单元组属于第二类存储单元组, 第二 类存储单元组釆用第二种 RAID存储方式, 而后为第三存储单元组存储的至少 两个属于不同用户数据的元数据生成第一奇偶校验码并储存。这样为元数据多 增加了一层保护机制, 提高了安全性。 本文中字符 "/" , 一般表示前后关联对象是一种 "或" 的关系。 The at least one other parity code is a parity code of at least two metadata belonging to different user data stored in the second type of storage unit group except the third storage unit group. Optionally, the first RAID storage mode may be RAID1, and the second RAID storage mode may be RAID5. The embodiment of the present invention provides a metadata protection device, which first stores metadata belonging to different user data in a corresponding first type of storage unit group, and the first type of storage unit group uses a first RAID storage method. And then selecting at least two storage unit groups in the first type of storage unit group, and forming a third storage unit group according to the selected at least two storage unit groups, the third storage unit group having at least two elements belonging to different user data. Data, the third storage unit group belongs to the second type of storage unit group, the second The class storage unit group uses the second RAID storage mode, and then generates and stores the first parity code for at least two metadata belonging to different user data stored in the third storage unit group. This adds a layer of protection to the metadata and improves security. The character "/" in this article generally indicates that the contextual object is an "or" relationship.
以上所描述的装置实施例仅仅是示意性的, 例如, 模块的划分, 仅仅为一 种逻辑功能划分, 实际实现时可以有另外的划分方式。 另一点, 所显示或讨论 的模块相互之间的连接可以是通过一些接口,可以是电性,机械或其它的形式。 所述各个模块可以是或者也可以不是物理上分开的, 可以是或者也可以不是物 理单元。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方 案的目的。 另外, 在本发明各个实施例中的各功能模块可以集成在一个处理模块中, 也可以是各个模块单独物理包括,也可以两个或两个以上模块集成在一个模块 中。 上述集成的模块既可以釆用硬件的形式实现, 也可以釆用硬件加软件功能 模块的形式实现。 上述以软件功能单元的形式实现的集成的模块, 可以存储在一个计算机可 读取存储介质中。 上述软件功能模块存储在一个存储介质中, 包括若干指令用 以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行 本发明各个实施例所述方法的部分步骤。 而前述的存储介质包括: U盘、 移动 硬盘、只读存储器( Read-Only Memory,简称 ROM )、随机存取存储器( Random Access Memory, 简称 RAM )、磁碟或者光盘等各种可以存储程序代码的介质。 以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于 此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应 以所述权利要求的保护范围为准。  The device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division, and the actual implementation may have another division manner. Alternatively, the modules shown or discussed may be connected to each other through some interface, and may be in electrical, mechanical or other form. The individual modules may or may not be physically separate and may or may not be physical units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment scheme. In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may be physically included separately, or two or more modules may be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules. The above-described integrated modules implemented in the form of software functional units can be stored in a computer readable storage medium. The above software function modules are stored in a storage medium and include a number of instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform part of the steps of the method of the various embodiments of the present invention. The foregoing storage medium includes: a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and the like can store program codes. Medium. The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims

权利要求 Rights request
1、 一种元数据的保护方法, 其特征在于, 包括: 1. A metadata protection method, characterized by including:
中, 所述第一类存储单元组釆用第一种独立冗余磁盘阵列 RAID存储方式; 在所述第一类存储单元组中选取至少两个存储单元组, 并根据所述至 少两个存储单元组形成第三存储单元组, 所述第三存储单元组存储有至少 两个属于不同用户数据的元数据, 所述第三存储单元组属于第二类存储单 元组, 所述第二类存储单元组釆用第二种 RAID存储方式; 为所述第三存储单元组存储的所述至少两个属于不同用户数据的元数 据生成第一奇偶校验码并储存。 Among them, the first type of storage unit group adopts the first independent redundant disk array RAID storage method; at least two storage unit groups are selected from the first type of storage unit group, and according to the at least two storage units The unit group forms a third storage unit group, the third storage unit group stores at least two metadata belonging to different user data, the third storage unit group belongs to a second type of storage unit group, and the second type of storage The unit group adopts the second RAID storage method; generating and storing a first parity check code for the at least two metadata belonging to different user data stored in the third storage unit group.
2、 根据权利要求 1所述的方法, 其特征在于, 将所述元数据中的属于 不同用户数据的元数据分别存储在对应的第一类存储单元组中, 所述第一 类存储单元组釆用第一种 RAID存储方式包括: 将所述元数据中的属于不同用户数据的元数据分别存储在对应的第一 类存储单元组中的每个硬盘或硬盘块上; 2. The method according to claim 1, characterized in that: metadata belonging to different user data in the metadata are stored in corresponding first-type storage unit groups, and the first-type storage unit group Using the first RAID storage method includes: storing the metadata belonging to different user data in the metadata on each hard disk or hard disk block in the corresponding first-type storage unit group;
所述第一类存储单元组包括至少两个物理存储单元或硬盘块, 所述硬 盘块是根据预设粒度划分物理存储单元组得到的。 The first type of storage unit group includes at least two physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing the physical storage unit group according to a preset granularity.
3、 根据权利要求 2所述的方法, 其特征在于, 在所述第一类存储单元 组中选取至少两个存储单元组, 并根据所述至少两个存储单元组形成第三 存储单元组包括: 3. The method according to claim 2, characterized in that, selecting at least two memory unit groups from the first type of memory unit group, and forming a third memory unit group based on the at least two memory unit groups includes: :
中选出一个物理存储单元或硬盘块; Select a physical storage unit or hard disk block;
三存储单元组; 所述第三存储单元组包括至少三个物理存储单元或硬盘块, 所述硬盘 块是根据预设粒度划分物理存储单元组得到的。 Three storage unit groups; The third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing the physical storage unit group according to a preset granularity.
4、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 为所述第一奇偶校验码和至少一个其他的奇偶校验码生成第二奇偶校 验码并储存; 所述至少一个其他的奇偶校验码为所述第二类存储单元组中除第三存 数据的奇偶校验码。 4. The method according to claim 1, wherein the method further comprises: generating and storing a second parity check code for the first parity check code and at least one other parity check code; The at least one other parity check code is a parity check code of the third type of stored data in the second type of storage unit group.
5、 根据权利要求 1所述的方法, 其特征在于, 所述第一种 RAID存储 方式为 RAID1 , 所述第二种 RAID存储方式为 RAID5。 5. The method according to claim 1, characterized in that the first RAID storage method is RAID1, and the second RAID storage method is RAID5.
6、 一种元数据的保护装置, 其特征在于, 包括: 存储模块, 用于将属于不同用户数据的元数据分别存储在对应的第一 类存储单元组中, 所述第一类存储单元组釆用第一种独立冗余磁盘阵列 RAID存储方式; 保护模块, 用于在所述第一类存储单元组中选取至少两个存储单元组, 并根据所述至少两个存储单元组形成第三存储单元组, 所述第三存储单元 组存储有至少两个属于不同用户数据的元数据, 所述第三存储单元组属于 第二类存储单元组, 所述第二类存储单元组釆用第二种 RAID存储方式; 奇偶校验码模块, 用于为所述第三存储单元组存储的所述至少两个属 于不同用户数据的元数据生成第一奇偶校验码并储存。 6. A metadata protection device, characterized in that it includes: a storage module, configured to store metadata belonging to different user data in corresponding first-type storage unit groups, said first-type storage unit group Adopt the first independent redundant disk array RAID storage method; a protection module, used to select at least two storage unit groups from the first type of storage unit group, and form a third storage unit group based on the at least two storage unit groups Storage unit group, the third storage unit group stores at least two metadata belonging to different user data, the third storage unit group belongs to the second type of storage unit group, the second type of storage unit group adopts the third Two RAID storage methods; A parity check code module, configured to generate and store a first parity check code for the at least two metadata belonging to different user data stored in the third storage unit group.
7、根据权利要求 6所述的装置, 其特征在于, 所述存储模块具体用于: 将所述元数据中的属于不同用户数据的元数据分别存储在对应的第一 类存储单元组中的每个物理存储单元或硬盘块上; 7. The device according to claim 6, wherein the storage module is specifically configured to: store metadata belonging to different user data in the metadata in corresponding first-type storage unit groups. On each physical storage unit or hard drive block;
所述第一类存储单元组包括至少两个物理存储单元或硬盘块, 所述硬 盘块是根据预设粒度划分物理存储单元组得到的。 The first type of storage unit group includes at least two physical storage units or hard disk blocks, and the hard disk Disk blocks are obtained by dividing physical storage unit groups according to preset granularity.
8、根据权利要求 7所述的装置, 其特征在于, 所述保护模块具体用于: 8. The device according to claim 7, characterized in that the protection module is specifically used for:
中选出一个物理存储单元或硬盘块; Select a physical storage unit or hard disk block;
三存储单元组; Three storage unit groups;
所述第三存储单元组包括至少三个物理存储单元或硬盘块, 所述硬盘 块是根据预设粒度划分物理存储单元组得到的。 The third storage unit group includes at least three physical storage units or hard disk blocks, and the hard disk blocks are obtained by dividing the physical storage unit group according to a preset granularity.
9、根据权利要求 6所述的装置, 其特征在于, 奇偶校验码模块还用于: 为所述第一奇偶校验码和至少一个其他的奇偶校验码生成第二奇偶校 验码并储存; 9. The device according to claim 6, wherein the parity check code module is further configured to: generate a second parity check code for the first parity check code and at least one other parity check code and storage;
所述至少一个其他的奇偶校验码为除所述第二类存储单元组中除第三 存储单元组外其他的釆用第二种 RAID存储方式的存储单元组存储的至少 两个属于不同用户数据的元数据的奇偶校验码。 The at least one other parity check code is at least two stored by other storage unit groups using the second RAID storage method except the third storage unit group in the second type of storage unit group and belonging to different users. The parity code of the data's metadata.
10、 根据权利要求 6所述的装置, 其特征在于, 所述第一种 RAID存 储方式为 RAID1 , 所述第二种 RAID存储方式为 RAID5。 10. The device according to claim 6, wherein the first RAID storage method is RAID1, and the second RAID storage method is RAID5.
PCT/CN2014/083034 2013-10-17 2014-07-25 Metadata protection method and device WO2015055033A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310487474.9A CN103593260B (en) 2013-10-17 2013-10-17 The guard method of a kind of metadata and device
CN201310487474.9 2013-10-17

Publications (1)

Publication Number Publication Date
WO2015055033A1 true WO2015055033A1 (en) 2015-04-23

Family

ID=50083415

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/083034 WO2015055033A1 (en) 2013-10-17 2014-07-25 Metadata protection method and device

Country Status (2)

Country Link
CN (1) CN103593260B (en)
WO (1) WO2015055033A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593260B (en) * 2013-10-17 2016-10-05 华为技术有限公司 The guard method of a kind of metadata and device
CN106339179B (en) * 2015-07-06 2020-11-17 上海宝存信息科技有限公司 Host device, access system, and access method
US10191841B2 (en) 2015-07-06 2019-01-29 Shannon Systems Ltd. Host device, access system, and access method
CN107315659B (en) * 2017-06-27 2020-09-18 苏州浪潮智能科技有限公司 Metadata redundancy backup method and device
CN109032513B (en) * 2018-07-16 2020-08-25 山东大学 RAID (redundant array of independent disks) architecture based on SSD (solid State disk) and HDD (hard disk drive) and backup and reconstruction methods thereof
CN109101437A (en) * 2018-07-20 2018-12-28 浪潮电子信息产业股份有限公司 A kind of date storage method and terminal
CN112988081B (en) * 2021-05-17 2021-08-17 浙江正泰仪器仪表有限责任公司 Electric quantity data storage and reading method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1821948A (en) * 2006-03-28 2006-08-23 威盛电子股份有限公司 Independent magnetic disc poly array system and its set-up method
US7512736B1 (en) * 2005-05-02 2009-03-31 Nvidia Corporation System and method for adaptive raid configuration
US8171379B2 (en) * 2008-02-18 2012-05-01 Dell Products L.P. Methods, systems and media for data recovery using global parity for multiple independent RAID levels
CN103176858A (en) * 2013-03-11 2013-06-26 北京忆恒创源科技有限公司 Storage device with multiple solid-state discs
CN103593260A (en) * 2013-10-17 2014-02-19 华为技术有限公司 Protecting method and protecting device for metadata

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037091A1 (en) * 2008-08-06 2010-02-11 Anant Baderdinni Logical drive bad block management of redundant array of independent disks
CN101510145B (en) * 2009-03-27 2010-08-25 杭州华三通信技术有限公司 Storage system management method and apparatus
CN102117297A (en) * 2009-12-31 2011-07-06 华为技术有限公司 Streaming media file processing method, device and system
CN103067461B (en) * 2012-12-18 2016-03-30 曙光信息产业(北京)有限公司 A kind of metadata management system of file and metadata management method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7512736B1 (en) * 2005-05-02 2009-03-31 Nvidia Corporation System and method for adaptive raid configuration
CN1821948A (en) * 2006-03-28 2006-08-23 威盛电子股份有限公司 Independent magnetic disc poly array system and its set-up method
US8171379B2 (en) * 2008-02-18 2012-05-01 Dell Products L.P. Methods, systems and media for data recovery using global parity for multiple independent RAID levels
CN103176858A (en) * 2013-03-11 2013-06-26 北京忆恒创源科技有限公司 Storage device with multiple solid-state discs
CN103593260A (en) * 2013-10-17 2014-02-19 华为技术有限公司 Protecting method and protecting device for metadata

Also Published As

Publication number Publication date
CN103593260B (en) 2016-10-05
CN103593260A (en) 2014-02-19

Similar Documents

Publication Publication Date Title
WO2015055033A1 (en) Metadata protection method and device
US10795590B2 (en) Method and apparatus for flexible RAID in SSD
CN103793182B (en) System and method for expansible storage protection
US10459814B2 (en) Drive extent based end of life detection and proactive copying in a mapped RAID (redundant array of independent disks) data storage system
US8171379B2 (en) Methods, systems and media for data recovery using global parity for multiple independent RAID levels
US10210045B1 (en) Reducing concurrency bottlenecks while rebuilding a failed drive in a data storage system
US8484506B2 (en) Redundant array of independent disks level 5 (RAID 5) with a mirroring functionality
US7093069B2 (en) Integration of a RAID controller with a disk drive module
WO2012051931A1 (en) Method, device and system for reconstructing redundant array of inexpensive disks
US20150347232A1 (en) Raid surveyor
WO2011015134A1 (en) Multi-disks fault-tolerant system and method for generating check blocks and recovering data blocks
TW200817992A (en) Amorphous raid
US11314594B2 (en) Method, device and computer program product for recovering data
CN115562594B (en) Method, system and related device for constructing RAID card
US20110202721A1 (en) Redundant array of independent storage
Feng et al. An extension of RDP code with parallel decoding procedure
WO2015085802A1 (en) Data storage method and storage apparatus
CN111506259A (en) Data storage method, data reading method, data storage device, data reading equipment and readable storage medium
CN111897676A (en) File backup method and device based on database index
CN101122882A (en) Method for removing synchronous process of cheap magnetic disc redundant array apparatus
US10372556B1 (en) Recovery of nodes
Pâris et al. Three-dimensional RAID Arrays with Fast Repairs
CN111752748B (en) VRAID-based data reconstruction method and device and electronic equipment
US11150988B1 (en) Metadata pattern to detect write loss/inconsistencies of optimized-write-once operations
Joshi et al. Raid 5 for Secured Storage Virtualisation

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

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

Country of ref document: EP

Kind code of ref document: A1