Method, system and related device for determining block number in RAID6 array

文档序号:7127 发布日期:2021-09-17 浏览:38次 中文

1. A method for determining a block number in a RAID6 array, comprising:

receiving a number acquisition request of a target block; the acquisition request comprises a disk number and a strip number;

judging whether a target block number of the target block exists in a hash table corresponding to the RAID6 array according to the disk number and the stripe number;

if yes, reading the target block number from the hash table and responding to the number acquisition request;

if not, judging whether the number of the disks of the RAID6 array is an even number;

if the number of the disks in the RAID6 array is even, determining the number of the target blocks according to the symmetric blocks corresponding to the target blocks; if the number of the disks is N, the target block and the symmetric block belong to the same disk, and the absolute value of the difference between the stripe numbers of the target block and the symmetric block is N/2.

2. The method of claim 1, wherein determining the target partition number according to the symmetric partition corresponding to the target partition comprises:

if the symmetric block number of the symmetric block is a check disc, the target block number of the target block is a check disc with the number opposite to that of the symmetric block;

and if the symmetric block number of the symmetric block is not the check disk, taking the symmetric block number as the target block number.

3. The method according to claim 1, wherein if the storage array corresponds to a hash table without a target block number of the target block, further comprising:

and converting the disk number and the strip number into a logical address from a physical address, and calculating a target block number of the target block based on the logical address.

4. The determination method according to claim 3, wherein calculating a target block number of the target block based on the logical address comprises:

under the logical address, calculating the number of intervals between a check disk on a disk corresponding to the disk number and a disk number 0 in the array according to the strip number;

and calculating the target block number of the target block according to the interval number and the disk number.

5. The determination method according to claim 3 or 4, further comprising, after calculating a target block number of the target block based on the logical address:

and adding the target block number of the target block to a hash table corresponding to the RAID6 array.

6. A system for determining a block number in a RAID6 array, comprising:

the request receiving module is used for receiving a number acquisition request of a target block; the acquisition request comprises a disk number and a strip number;

a hash table detection module, configured to determine whether a target block number of the target block exists in a hash table corresponding to the RAID6 array according to the disk number and the stripe number;

a hash table reading module, configured to, when the determination result of the hash table detecting module is yes, read the target block number from the hash table and respond to the number obtaining request;

the judging module is used for judging whether the number of the disks of the RAID6 array is an even number or not when the judgment result of the hash table detecting module is negative;

the number confirmation module is used for determining the number of the target block according to the symmetrical block corresponding to the target block when the judgment result of the judgment module is yes; if the number of the disks is N, the target block and the symmetric block belong to the same disk, and the absolute value of the difference between the stripe numbers of the target block and the symmetric block is N/2.

7. The determination system of claim 6, wherein the numbering validation module comprises:

a first confirming unit, configured to confirm that the target block number is a parity check disc with a number opposite to that of the symmetric block number if the symmetric block number of the symmetric block is the parity check disc;

and the second confirming unit is used for taking the symmetrical block number as the target block number if the symmetrical block number of the symmetrical block is not the check disc.

8. The determination system according to claim 6, further comprising:

and the block number calculation module is used for converting the disk number and the stripe number into a logical address from a physical address if the storage array corresponding to the hash table does not have the target block number of the target block, and calculating the target block number of the target block based on the logical address.

9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for determining a block number in a RAID6 array according to any one of claims 1 to 5.

10. A storage device comprising a memory having a computer program stored therein and a processor that when invoked by the computer program in the memory performs the steps of the method of determining a block number in a RAID6 array of any one of claims 1 to 5.

Background

RAID (Redundant Array of Independent Disks) is typically represented by RAID6, RAID6, and is an Array of 4-16 Disks with two hot spare Disks in the Array. Data integrity is maintained when two disks are unplugged simultaneously in the array. However, when the partition in the array needs to be determined, the disk number and the stripe number need to be given each time, and the partition number needs to be calculated once, which results in a complex and time-consuming process for determining the partition number.

Disclosure of Invention

The application aims to provide a method for determining a block number in a RAID6 array, a system for determining a block number in a RAID6 array, a computer-readable storage medium and a storage device, which can improve the confirmation efficiency of each block number in a RAID6 array.

In order to solve the above technical problem, the present application provides a method for determining a block number in a RAID6 array, and the specific technical solution is as follows:

receiving a number acquisition request of a target block; the acquisition request comprises a disk number and a strip number;

judging whether a target block number of the target block exists in a hash table corresponding to the RAID6 array according to the disk number and the stripe number;

if yes, reading the target block number from the hash table and responding to the number acquisition request;

if not, judging whether the number of the disks of the RAID6 array is an even number;

if the number of the disks in the RAID6 array is even, determining the number of the target blocks according to the symmetric blocks corresponding to the target blocks; if the number of the disks is N, the target block and the symmetric block belong to the same disk, and the absolute value of the difference between the stripe numbers of the target block and the symmetric block is N/2.

Optionally, determining the number of the target block according to the symmetric block corresponding to the target block includes:

if the symmetric block number of the symmetric block is a check disc, the target block number of the target block is a check disc with the number opposite to that of the symmetric block;

and if the symmetric block number of the symmetric block is not the check disk, taking the symmetric block number as the target block number.

Optionally, if the hash table corresponding to the storage array does not have the target block number of the target block, the method further includes:

and converting the disk number and the strip number into a logical address from a physical address, and calculating a target block number of the target block based on the logical address.

Optionally, calculating a target block number of the target block based on the logical address includes:

under the logical address, calculating the number of intervals between a check disk on a disk corresponding to the disk number and a disk number 0 in the array according to the strip number;

and calculating the target block number of the target block according to the interval number and the disk number.

Optionally, after calculating the target block number of the target block based on the logical address, the method further includes:

and adding the target block number of the target block to a hash table corresponding to the RAID6 array.

The application also provides a system for determining the block number in the RAID6 array, which comprises:

the request receiving module is used for receiving a number acquisition request of a target block; the acquisition request comprises a disk number and a strip number;

a hash table detection module, configured to determine whether a target block number of the target block exists in a hash table corresponding to the RAID6 array according to the disk number and the stripe number;

a hash table reading module, configured to, when the determination result of the hash table detecting module is yes, read the target block number from the hash table and respond to the number obtaining request;

the judging module is used for judging whether the number of the disks of the RAID6 array is an even number or not when the judgment result of the hash table detecting module is negative;

the number confirmation module is used for determining the number of the target block according to the symmetrical block corresponding to the target block when the judgment result of the judgment module is yes; if the number of the disks is N, the target block and the symmetric block belong to the same disk, and the absolute value of the difference between the stripe numbers of the target block and the symmetric block is N/2.

Optionally, the number confirmation module includes:

a first confirming unit, configured to confirm that the target block number is a parity check disc with a number opposite to that of the symmetric block number if the symmetric block number of the symmetric block is the parity check disc;

and the second confirming unit is used for taking the symmetrical block number as the target block number if the symmetrical block number of the symmetrical block is not the check disc.

Optionally, the method further includes:

and the block number calculation module is used for converting the disk number and the stripe number into a logical address from a physical address if the storage array corresponding to the hash table does not have the target block number of the target block, and calculating the target block number of the target block based on the logical address.

The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method as set forth above.

The present application also provides a storage device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described above when calling the computer program in the memory.

The application provides a method for determining a block number in a RAID6 array, which comprises the following steps: receiving a number acquisition request of a target block; the acquisition request comprises a disk number and a strip number; judging whether a target block number of the target block exists in a hash table corresponding to the RAID6 array according to the disk number and the stripe number; if yes, reading the target block number from the hash table and responding to the number acquisition request; if not, judging whether the number of the disks of the RAID6 array is an even number; if the number of the disks in the RAID6 array is even, determining the number of the target blocks according to the symmetric blocks corresponding to the target blocks; if the number of the disks is N, the target block and the symmetric block belong to the same disk, and the absolute value of the difference between the stripe numbers of the target block and the symmetric block is N/2.

When a number acquisition request of a target block is received, whether the number of the target block exists in the hash table is searched first, and if the number of the target block exists, the number is directly returned from the hash table. Otherwise, when the number of the disks is even, the target block number can be quickly acquired by using the symmetry between the block numbers, so that the block numbers do not need to be calculated one by one, and the confirming efficiency of the block numbers is effectively improved.

The application also provides a system for determining the block number in the RAID6 array, a computer-readable storage medium, and a storage device, which have the above beneficial effects and are not described herein again.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

Fig. 1 is a flowchart of a method for determining a block number in a RAID6 array according to an embodiment of the present disclosure;

FIG. 2 is a spatial distribution diagram of a RAID6 array according to an embodiment of the present application;

fig. 3 is a schematic structural diagram of a system for determining a block number in a RAID6 array according to an embodiment of the present disclosure.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

Referring to fig. 1, fig. 1 is a flowchart of a method for determining a block number in a RAID6 array according to an embodiment of the present application, where the present application provides a method for determining a block number in a RAID6 array, and a specific technical solution is as follows:

s101: receiving a number acquisition request of a target block;

s102: judging whether a target block number of the target block exists in a hash table corresponding to the RAID6 array according to the disk number and the stripe number; if yes, entering S103; if not, entering S104;

s103: reading the target block number from the hash table and responding to the number acquisition request;

s104: judging whether the number of the disks of the RAID6 array is even or not; if yes, entering S105;

s105: determining the number of the target block according to the symmetrical block corresponding to the target block;

the number acquisition request is received first, and how to receive the number acquisition request is not limited herein. The acquisition request comprises a disk number and a strip number, and the disk number and the strip number can be directly calculated to obtain the block number of the target block, but the process is complicated.

In this embodiment, the disk number and the stripe number are used to determine corresponding block location information. Referring to fig. 2, fig. 2 is a spatial distribution diagram of a RAID6 array according to an embodiment of the present application, in fig. 2, six disks from disk 0 to disk 5 are illustrated, the right side of fig. 2 is labeled with stripes formed by the array, and each stripe is formed by a block. Each disk has a fixed rotation, and the value is the number of intervals between the check disk P on the disk and the disk No. 0 in the array. Wherein, the block numbers Q and P are check disks.

After receiving the number acquisition request, reading the corresponding target block number from the hash table, if the target block number exists, directly reading the hash table and returning, and calculating without using the disk number and the strip number.

If the hash table does not have the target block number of the target block, it is determined whether the number of the disks of the RAID6 array is an even number. As can be seen from FIG. 2, the RAID6 array of FIG. 2 has six, i.e., an even number of disks, with stripes 0 through stripe 2, and with stripes 3 through stripe 5 having the same block number, except for the opposite parity disk. In fact, as long as the number of disks in the RAID6 array is even, the rule is that the numbers of the blocks in the first half of the stripes are the same as the numbers of the blocks in the second half of the stripes except for the parity disks, and the parity disks are opposite. For example, the disk 0 and the slice number 2 have a block number P, and the corresponding disk 0 and the corresponding slice number 5 have a block number Q. The block number of the disk 1 and the stripe number 2 is Q, and the corresponding block number of the disk 1 and the stripe number 5 is P. The number of the target block can be determined using the number of the symmetric block of the target block. Of course, both are symmetric partitions.

The judgment method for whether the two blocks are symmetrical blocks is as follows: if the number of the disks is N, N is an even number, the target block and the symmetric block belong to the same disk, and the difference between the stripe numbers of the target block and the symmetric block is N/2.

It can be seen from this that: if the symmetric block number of the symmetric block is a check disc, the target block number is the check disc with the number opposite to that of the symmetric block; and if the symmetric block numbers of the symmetric blocks are not the check disks, taking the symmetric block numbers as the target block numbers.

If the hash table has the number of the symmetric block of the target block, the number of the target block can be directly determined according to the number of the symmetric block, and the number of the target block is obtained without a complex calculation process.

Of course, if the hash table corresponding to the storage array does not have the target block number of the target block, the target block number can only be obtained through normal calculation, that is, the disk number and the stripe number are converted into the logical address from the physical address, and the target block number of the target block is calculated based on the logical address.

Specifically, under the logical address, the number of intervals between the check disk on the disk corresponding to the disk number and the disk number 0 in the array is calculated according to the tape number, and then the target block number of the target block is calculated according to the number of intervals and the number of disks.

If the block number of the target block is obtained through calculation, the target block number of the target block can be added to the hash table corresponding to the RAID6 array in order to facilitate subsequent query of the block number or the number of the symmetric block of the block, so that rapid query is facilitated.

When a number acquisition request of a target block is received, whether the number of the target block exists in a hash table is searched first, and if the number of the target block exists, the number is directly returned from the hash table. Otherwise, when the number of the disks is an even number, the target block numbers can be quickly acquired by utilizing the symmetry among the block numbers, so that the block numbers do not need to be calculated one by one, the solving speed of the block logical addresses is well accelerated based on a cache mechanism and a related algorithm, the performance of equipment is improved, and the solving efficiency of the redundant array block codes is effectively improved.

In the following, a system for determining a block number in a RAID6 array according to an embodiment of the present application is described, and the following determination system and the above-described method for determining a block number in a RAID6 array may be referred to correspondingly.

Referring to fig. 3, fig. 3 is a schematic structural diagram of a system for determining a block number in a RAID6 array according to an embodiment of the present application, and the present application further provides a system for determining a block number in a RAID6 array, including:

the request receiving module is used for receiving a number acquisition request of a target block; the acquisition request comprises a disk number and a strip number;

a hash table detection module, configured to determine whether a target block number of the target block exists in a hash table corresponding to the RAID6 array according to the disk number and the stripe number;

a hash table reading module, configured to, when the determination result of the hash table detecting module is yes, read the target block number from the hash table and respond to the number obtaining request;

the judging module is used for judging whether the number of the disks of the RAID6 array is an even number or not when the judgment result of the hash table detecting module is negative;

the number confirmation module is used for determining the number of the target block according to the symmetrical block corresponding to the target block when the judgment result of the judgment module is yes; if the number of the disks is N, the target block and the symmetric block belong to the same disk, and the absolute value of the difference between the stripe numbers of the target block and the symmetric block is N/2.

Based on the above embodiment, as a preferred embodiment, the number confirmation module includes:

a first confirming unit, configured to confirm that the target block number is a parity check disc with a number opposite to that of the symmetric block number if the symmetric block number of the symmetric block is the parity check disc;

and the second confirming unit is used for taking the symmetrical block number as the target block number if the symmetrical block number of the symmetrical block is not the check disc.

Based on the above embodiment, as a preferred embodiment, the method may further include:

and the block number calculation module is used for converting the disk number and the stripe number into a logical address from a physical address if the storage array corresponding to the hash table does not have the target block number of the target block, and calculating the target block number of the target block based on the logical address.

Based on the above embodiment, as a preferred embodiment, the method may further include:

and the hash table updating module is used for adding the target block number of the target block to the hash table corresponding to the RAID6 array.

The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

The present application further provides a storage device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided in the foregoing embodiments when calling the computer program in the memory. Of course, the storage device may also include various network interfaces, power supplies, and the like.

The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.

The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种磨损均衡方法、装置、设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类