Disk parameter management method, device, electronic device and storage medium
By managing disk parameters according to the categories of RAID groups in RAID technology, the problem of excessive memory space occupancy in RAID technology is solved, and more efficient storage space utilization is achieved.
Patent Information
- Application Number
- CN202411306622.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-19
AI Technical Summary
The management of disk parameters in existing RAID technology leads to excessive memory space consumption.
By obtaining disk management information and target disk level and quantity when a new RAID group is detected, unstored disk parameters are determined based on the category of the RAID group (divided by disk level and quantity), and store and update them to disk management, and information.
It effectively reduces the storage space usage of disk parameters, improves the utilization rate of storage space, and avoids repeated storage of disk parameters of the same type of RAID group.
Smart Images

Figure CN118819428B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a disk parameter management method, device, electronic device and storage medium. Background Art
[0002] A Redundant Array of Independent Disks (RAID) group is a redundant disk array composed of independent disks, which has the characteristics of large storage capacity, high storage performance and strong fault tolerance. Among them, a RAID group has three important parameters, including: parity disk generation parameters, stripe consistency check parameters and bad disk recovery parameters. The parity disk generation parameters are used to generate specific data of the parity disk in the RAID group. The stripe consistency check parameters are used to use the data in the parity disk to verify whether the data of each stripe in the RAID group is consistent, so as to determine whether the data of the stripe in the RAID group is incorrect. The bad disk recovery parameters are used to recover the data of a failed disk in the RAID group.
[0003] The current RAID technology usually manages these three parameters by associating the group number of the RAID group with the three parameters of the RAID group and storing them in a fixed storage location in the memory. However, this method of associating the storage parameters with the group number of the RAID group requires allocating a storage space in the memory for each RAID group, resulting in the problem of excessive memory space occupation. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a disk parameter management method, device, electronic device and storage medium, which can solve the problem of excessive memory space occupation in the current RAID group parameter management method.
[0005] In order to solve the above technical problems, this application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for managing disk parameters, the method comprising:
[0007] In the case of detecting a new first independent redundant array of disks RAID group, obtaining disk management information, a target disk level and a target disk quantity of the first RAID group, the disk management information including: a first storage address of a disk parameter of the RAID group and a category of the RAID group, the category of the RAID group being divided according to the disk level and the disk quantity, and the disk parameters of RAID groups of the same category being the same, and the disk parameters including a check disk generation parameter and / or a stripe consistency check parameter;
[0008] When it is determined that the disk parameters of a RAID group of the same category are not stored according to the target disk level, the target disk quantity, and the disk management information, obtaining the target disk parameters of the first RAID group;
[0009] storing the target disk parameter and determining a first storage address of the target disk parameter;
[0010] The first storage address of the target disk parameter and the type of the first RAID group are updated to the disk management information.
[0011] In a second aspect, an embodiment of the present application provides a disk parameter management device, the device comprising:
[0012] an acquisition module, configured to acquire disk management information, a target disk level and a target disk quantity of the first RAID group when a new first independent redundant array of disks RAID group is detected, wherein the disk management information includes: a first storage address of a disk parameter of the RAID group and a category of the RAID group, wherein the category of the RAID group is divided according to the disk level and the number of disks, and the disk parameters of RAID groups of the same category are the same, and the disk parameters include a check disk generation parameter and / or a stripe consistency check parameter;
[0013] The acquisition module is further configured to acquire the target disk parameters of the first RAID group when it is determined that the disk parameters of the RAID group of the same category are not stored according to the target disk level, the target disk quantity and the disk management information;
[0014] A storage module, used for storing the target disk parameter and determining a first storage address of the target disk parameter;
[0015] An updating module is used to update the first storage address of the target disk parameter and the category of the first RAID group into the disk management information.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the disk parameter management method as described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the disk parameter management method described in the first aspect is implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the disk parameter management method as described in the first aspect.
[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the disk parameter management method as described in the first aspect.
[0020] In an embodiment of the present application, when a new first RAID group is detected, disk management information, a target disk level and a target disk number of the first RAID group are obtained. The disk management information records the first storage address of the disk parameters of the stored RAID group and the category of the RAID group. Since the category of the RAID group is divided according to the disk level and the number of disks, and the disk parameters of the RAID groups of the same category are the same, when it is determined that the disk parameters of the RAID group of the same category are not stored according to the target disk level, the target disk number and the disk management information, the target disk parameters of the first RAID group can be stored, and then the first storage address of the target disk parameters and the category of the first RAID group can be updated to the disk management information. In this technical solution, by dividing the RAID group category according to the disk level and the number of disks, when the disk parameters of the RAID groups of the same category are the same, only one disk parameter is stored for the RAID groups of the same category, thereby avoiding repeated storage of the disk parameters of the RAID groups of the same category, effectively reducing the amount of storage space occupied by the disk parameters, and improving the utilization of the storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a schematic diagram of disk parameters provided by an embodiment of the present application;
[0022] Figure 2 It is a schematic diagram of generating disk parameters provided by an embodiment of the present application;
[0023] Figure 3 is a flow chart of a disk parameter management method provided in an embodiment of the present application;
[0024] Figure 4 It is a storage schematic diagram of a disk parameter provided in an embodiment of the present application;
[0025] Figure 5 is a flow chart of a parameter storage space configuration method provided in an embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of a definition of disk management information provided by an embodiment of the present application;
[0027] Figure 7 is a flow chart of another disk parameter management method provided in an embodiment of the present application;
[0028] Figure 8 This is a schematic diagram of address calculation of disk parameters provided in an embodiment of the present application;
[0029] Fig. 9 This is another schematic diagram of address calculation of disk parameters provided in an embodiment of the present application;
[0030] Fig.10 is a flow chart of another disk parameter management method provided in an embodiment of the present application;
[0031] Fig.11 It is another storage schematic diagram of disk parameters provided in an embodiment of the present application;
[0032] Fig.12 is a flow chart of another disk parameter management method provided in an embodiment of the present application;
[0033] Fig.13 This is another schematic diagram of address calculation of disk parameters provided in an embodiment of the present application;
[0034] Fig.14 is a schematic diagram of another disk parameter management method provided in an embodiment of the present application;
[0035] Fig.15 It is a block diagram of a disk parameter management device provided in an embodiment of the present application;
[0036] Fig.16 It is a block diagram of an electronic device provided by the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] A RAID group is a redundant disk array composed of independent disks, which has the characteristics of large storage capacity, high storage performance and strong fault tolerance. Among them, the disk levels of the RAID group include RAID0, RAID1, RAID10, RAID5, RAID6, and RAID TP. In addition to the data disk, the RAID5 disk array has a new P check disk (also known as a check block), which can be used to recover the data of a failed disk. A failed disk refers to a failed data disk. In the disk array, RAID6 adds a Q check disk on the basis of RAID5, and the data of two failed disks can be recovered through the P check disk and Q check disk. In the disk array, RAID TP adds an R check disk on the basis of RAID6, and the data of three failed disks can be recovered through the P check disk, Q check disk, and R check disk.
[0039] Among them, the RAID group has three important parameters, including: check disk generation parameters, stripe consistency check parameters and bad disk recovery parameters. Check disk generation parameters are used to generate specific data of the check disk in the RAID group. Stripe consistency check parameters are used to use the data in the check disk to verify whether the data of each stripe in the RAID group is consistent, so as to determine whether the data of the stripe in the RAID group is incorrect. Bad disk recovery parameters are used to recover the data of a failed disk in the RAID group.
[0040] In RAID related technologies, the management method for these three parameters is usually to associate the group number of the RAID group with the three parameters of the RAID group and store them in a fixed storage location in the memory. However, this method of associating the storage parameters with the group number of the RAID group requires allocating a storage space in the memory for each RAID group, resulting in the problem of excessive memory space occupation.
[0041] For ease of understanding, the following gives priority to introducing some concepts involved in this application.
[0042] Strip / chunk: Divide a disk partition into multiple blocks of equal size and adjacent addresses. These blocks are called stripes. Stripes are usually considered to be elements of stripes.
[0043] Stripe: A collection of blocks with related locations on different disks in a RAID group's disk array. It is a unit for organizing blocks on different disk partitions. That is, a stripe includes some data blocks on each disk in the RAID group. In RAID5 and RAID6, the parity block is obtained from the data block through the parity generation algorithm using the stripe as a unit.
[0044] Stripe group: A stripe group is a collection of stripes. A RAID group includes at least one stripe group. Each stripe group includes at least one stripe, and each stripe group includes at most m stripes. m is the number of disks included in the RAID group.
[0045] Parity disk generation parameters, stripe consistency check parameters, and bad disk recovery parameters: In a RAID group containing a parity disk, the data disk and the parity disk need to satisfy the condition that the data in each disk is multiplied by a set of proportional coefficients, and then XORed, and the result is 0. Therefore, when the data in the data disk is known, the data on the parity disk can be obtained to satisfy: P = k0×d0+k1×d1+…+kn×dn. Among them, × represents multiplication operation. + represents XOR operation. P represents the data on the parity disk. k0…kn represents the parity disk generation parameters. d0…dn represents the data on the data disk. In addition, the RAID group also has bad disk recovery parameters. When a data disk in the RAID group fails, the RAID group can recover the data of the failed data disk based on the bad disk recovery parameters, the data of other data disks except the failed one, and the data of the parity disk.
[0046] Taking RAID TP as an example, the RAID group includes P check disk, Q check disk, and R check disk. Figure 1 As shown, in the RAID group, the D0 data disk, the D1 data disk, the D2 data disk, the D3 data disk, and the D4 data disk generate parameters through the check disk to generate data of the P check disk, data of the Q check disk, and data of the R check disk. The D0 data disk, the D1 data disk, the D2 data disk, the D3 data disk, the D4 data disk, and the P check disk, the Q check disk, and the R check disk verify that the data of each stripe in the RAID group is correct through the stripe consistency check parameter. Among them, for any stripe in the RAID group, if the data of each disk in the data disk and the check disk of the stripe is multiplied by the stripe consistency check parameter and then XORed to 0, it indicates that the data of the stripe is correct. On the contrary, if it is not 0, it indicates that the data of the stripe is incorrect. In the case of a failure of the D3 data disk, the data of the D3 data disk can be restored according to the data of the D0 data disk, the D1 data disk, the D2 data disk, the D4 data disk, the P check disk, the Q check disk, the R check disk and the bad disk recovery parameter.
[0047] Taking the RAID TP with four data disks (d0-d3) and three parity disks (d4-d6) as an example, according to the RAID group principle "the data disk and the parity disk need to satisfy the requirement that the data in each disk is multiplied by a set of proportional coefficients, and then XORed, and the result is 0", there is such a situation Figure 2 The Vandermonde matrix shown is the strip consistency test parameter. Among them, a0 a1 a2a3 a4 a5 a6 values are 0 1 2 3 4 5 6 respectively.
[0048] according to Figure 2 After derivation and calculation, we can get the calculation formula of the check disk (d4 d5 d6), and further extend it to n data disks to get: Formula 1:
[0049] ;
[0050] Formula 2:
[0051] ;
[0052] Formula 3:
[0053] ;
[0054] Among them, each operation in formula 1 to formula 3 is performed in the Galois field GF (28). In addition, in formula 1, P represents the data of the P check disk. The check disk generation parameters of the P check disk are kp0, kp1, ..., kpn. The check disk generation parameter kp0 is ; The check disk generation parameter kp1 is ; The check disk generation parameter kpn is In formula 2, Q represents the data of the Q check disk. The check disk generation parameters of the Q check disk are kq0, kq1, ..., kqn. The check disk generation parameter kq0 is ; The check disk generation parameter kq1 is ; The check disk generation parameter kqn is In formula 3, R represents the data of the R check disk. The check disk generation parameters of the R check disk are kr0, kr1, ..., krn. The check disk generation parameter kr0 is ; The check disk generation parameter kr1 is ; The check disk generation parameter krn is . ap, aq, ar, and ak are all constants.
[0055] Please refer to Figure 3 , which shows a flow chart of the disk parameter management method provided in the embodiment of the present application. Optionally, the disk parameter management method can be applied to a RAID device. The RAID device may include at least one RAID group and a memory. The memory is used to store parameters of the RAID group, which include check disk generation parameters, stripe consistency check parameters, and bad disk recovery parameters. By way of example, the RAID device may also include a processor for executing the disk parameter management method provided in the embodiment of the present application. The following embodiment takes the disk parameter management method as an example that can be applied to a RAID device and executed by a processor. Figure 3 As shown, the disk parameter management method includes:
[0056] Step 301: When a new first RAID group is detected, disk management information, a target disk level and a target disk quantity of the first RAID group are obtained.
[0057] Among them, the disk parameters include check disk generation parameters and / or stripe consistency check parameters. The disk management information is used to store relevant information of the RAID group that has stored the disk parameters. The relevant information includes the first storage address and category of the disk parameters of the RAID group. The first storage address may be the storage address of the disk parameters. For example, the first storage address may be the storage address of the disk parameters in the memory. Specifically, the disk management information includes: the first storage address of the disk parameters of the RAID group and the category of the RAID group. The categories of RAID groups are divided according to the disk level and the number of disks, and the disk parameters of RAID groups of the same category are the same. By way of example, the disk management information includes: the first storage address of the disk parameters of the RAID group, the disk level of the RAID group, and the number of disks of the RAID group.
[0058] Optionally, in a RAID group with the same disk level and disk quantity, the check disk generation parameters of each stripe are the same. Furthermore, in a RAID group with the same disk level and disk quantity, the stripe consistency check parameters of each stripe are the same. However, in a RAID group with a disk level of RAID 5, the check disk generation parameters of the RAID group are all 1. Therefore, in a RAID group with a disk level of RAID 5, the check disk generation parameters and stripe consistency check parameters of each stripe are the same.
[0059] Based on this, RAID groups with a disk level of RAID 5 can be of the same category. And for RAID groups with a disk level other than RAID 5, RAID groups with the same disk level and disk quantity are of the same category. For example, for RAID groups with a disk level of RAID 5, no matter how many disks the RAID group consists of, it is classified into the same category. For RAID groups with a disk level of RAID 6 or RAID TP, RAID groups of the same category have the same disk level and disk quantity.
[0060] Optionally, the process of detecting a new first RAID group may include at least one of the following situations: establishing a new first RAID group, or a first RAID group with a changed category. For example, when a new first RAID group is established, or the category of the first RAID group is changed, disk management information, a target disk level, and a target disk quantity of the first RAID group may be obtained. The change in the category of the first RAID group may refer to a change in the disk level and / or the number of disks included.
[0061] Step 302: When it is determined that no disk parameters of a RAID group of the same category are stored according to the target disk level, the target disk quantity, and the disk management information, the target disk parameters of the first RAID group are obtained.
[0062] In some embodiments of the present application, after obtaining the disk management information, the target disk level and the target disk number of the first RAID group, the processor can determine whether the category of the first RAID group is recorded in the disk management information based on the target disk level and the target disk number of the first RAID group to determine whether disk parameters of a RAID group of the same category as the first RAID group are stored.
[0063] If it is determined that the disk parameters of the RAID group of the same category are stored, it is not necessary to repeatedly store the disk parameters of the first RAID group. If it is determined that the disk parameters of the RAID group of the same category are not stored, it is necessary to obtain and store the disk parameters of the first RAID group.
[0064] In an optional implementation, the disk management information includes a first storage address, a disk level, and a number of disks corresponding to the RAID group. When the target disk level of the first RAID group is RAID5, the processor searches the disk management information for a RAID group with a disk level of RAID5. If so, the processor determines that the RAID device stores disk parameters of a RAID group of the same category as the first RAID group. If not, the processor determines that the RAID device does not store disk parameters of a RAID group of the same category as the first RAID group.
[0065] When the target disk level of the first RAID group is not RAID5, the processor searches the disk management information for a RAID group whose disk level is the target disk level and whose disk quantity is the target disk quantity. If so, the processor determines that the RAID device stores disk parameters of a RAID group of the same category as the first RAID group. If not, the processor determines that the RAID device does not store disk parameters of a RAID group of the same category as the first RAID group.
[0066] In another optional implementation, the disk management information includes a first storage address and a disk category corresponding to the RAID group. The processor determines the target category of the first RAID group according to the target disk level and the target disk quantity. It is searched whether there is a RAID group with a disk category of the target category in the disk management information. If so, the processor determines that the RAID device stores disk parameters of a RAID group of the same category as the first RAID group. If not, the processor determines that the RAID device does not store disk parameters of a RAID group of the same category as the first RAID group.
[0067] For example, assuming that the target disk level of the first RAID group is RAID5 and the target disk quantity is 5. The processor determines that the category of the first RAID group is RAID5. The processor determines that the RAID device stores disk parameters of a RAID group of the same category as the first RAID group based on the result of determining whether there is a RAID group of the RAID5 category in the disk management information.
[0068] Assume that the target disk level of the first RAID group is RAID6, and the target disk quantity is 7. The processor determines that the category of the first RAID group is RAID6-7. According to the judgment result of whether there is a RAID group with a disk category of RAID6-7 in the disk management information, it is determined that the RAID device stores disk parameters of a RAID group of the same category as the first RAID group.
[0069] Optionally, the processor may obtain the target disk parameters of the first RAID group by calculating the target disk parameters of the first RAID group. The implementation method of the processor calculating the check disk generation parameters may refer to the calculation method of the check disk generation parameters in the prior art. Similarly, the implementation method of the processor calculating the stripe consistency check parameters may refer to the calculation method of the stripe consistency check parameters in the prior art, which is not limited in the embodiments of the present application.
[0070] Step 303: Store the target disk parameters and determine a first storage address of the target disk parameters.
[0071] Optionally, the processor may store the target disk parameters of the first RAID group in the memory and determine a first storage address of the target disk parameters when determining that no disk parameters of a RAID group of the same category are stored based on the target disk level, the target disk quantity and the disk management information.
[0072] Step 304: Update the first storage address of the target disk parameter and the type of the first RAID group into the disk management information.
[0073] Optionally, in the case where the disk level and the number of disks of the RAID group are recorded in the disk management information to record the category, the first storage address of the target disk parameter of the first RAID group, and the target disk level and the target disk number of the first RAID group can be added to the disk management information. Alternatively, in the case where the category of the RAID group is directly recorded in the disk management information, the processor can determine the category of the first RAID group based on the target disk level and the target disk number of the first RAID group. Furthermore, the first storage address of the target disk parameter of the first RAID group and the category of the first RAID group are added to the disk management information.
[0074] In an embodiment of the present application, when a new first RAID group is detected, disk management information, a target disk level and a target disk number of the first RAID group are obtained. The disk management information records the first storage address of the disk parameters of the stored RAID group and the category of the RAID group. Since the category of the RAID group is divided according to the disk level and the number of disks, and the disk parameters of the RAID groups of the same category are the same, when it is determined that the disk parameters of the RAID group of the same category are not stored according to the target disk level, the target disk number and the disk management information, the target disk parameters of the first RAID group can be stored, and then the first storage address of the target disk parameters and the category of the first RAID group can be updated to the disk management information. In this technical solution, by dividing the RAID group category according to the disk level and the number of disks, when the disk parameters of the RAID groups of the same category are the same, only one disk parameter is stored for the RAID groups of the same category, thereby avoiding repeated storage of the disk parameters of the RAID groups of the same category, effectively reducing the amount of storage space occupied by the disk parameters, and improving the utilization of the storage space.
[0075] Optionally, the parameter storage space is used for the disk parameters of the RAID group. For example, the parameter storage space may refer to the storage space in the memory of the RAID device. The parameter storage space includes s memory blocks, where s is a positive integer. Each memory block is used to store the disk parameters of different categories of RAID groups. Accordingly, the first storage address in the disk management information is: the offset of the memory block where the disk parameters are located in the parameter storage space. Based on this, step 303 stores the target disk parameters, and the process of determining the first storage address of the target disk parameters may include: storing the target disk parameters in the free memory blocks in the parameter storage space, determining the offset of the free memory blocks in the parameter storage space, and obtaining the first storage address of the target disk parameters.
[0076] The number s of memory blocks in the parameter storage space is at least equal to the total number of categories of RAID groups that can be configured by the RAID device. For example, assume that the disk levels of the configurable RAID groups include RAID5, RAID6, and RAID TP. If the category of the RAID group with a disk level of RAID6 is x1, and the category of the RAID group with a disk level of RAID TP is x2, then because the RAID group with a disk level of RAID5 is one category, the total number of categories of RAID groups that can be configured by the RAID device is x1+x2+1. Accordingly, the number s of memory blocks in the parameter storage space is at least equal to x1+x2+1.
[0077] In the embodiment of the present application, the free memory block is a memory block that does not store disk parameters. Optionally, the processor can sequentially access the memory blocks in the parameter storage space to determine the free memory blocks that do not store disk parameters. The processor stores the target disk parameters of the first RAID group in the free memory block and determines the offset of the free memory block in the parameter storage space.
[0078] In an optional implementation, the size of each memory block in the parameter storage space is equal. The processor may store the base address of the parameter storage space (i.e., the starting address of the parameter storage space), the memory address of each memory block, and the size of the memory block. According to the memory address of each memory block, the memory blocks in the parameter storage space are accessed in sequence to determine that the memory block is not a free memory block when the disk parameters are read from the memory address; and to determine that the memory block is a free memory block when the disk parameters are not read from the memory address. The processor may store the target disk parameters of the first RAID group in a free memory block, calculate the address difference between the memory address of the free memory block and the base address, and determine the quotient of the address difference and the size of the memory block as the offset of the free memory block.
[0079] In another optional implementation, the size of each memory block in the parameter storage space is equal. The processor may store the base address of the parameter storage space, the offset of each memory block in the parameter storage space, and the size of the memory block. The processor may read the offset of the memory block in the parameter storage space in sequence, and then calculate the memory address of the memory block according to the base address, offset and size of the memory block of the parameter storage space. The memory address of the memory block is accessed to determine that the memory block is not a free memory block when the disk parameters are read from the memory address; and determine that the memory block is a free memory block when the disk parameters are not read from the memory address. The processor may store the target disk parameters of the first RAID group in any free memory block and obtain the offset of the free memory block in the parameter storage space.
[0080] Further optionally, each memory block includes a parameter block and a flag. The parameter block is used to store the disk parameters of the RAID group. The flag indicates whether data is stored in the parameter block. Based on this, the process of storing the target disk parameters in the free memory blocks in the parameter storage space, determining the offset of the free memory blocks in the parameter storage space, and obtaining the first storage address of the target disk parameters can further include the following steps 3031A to 3033A.
[0081] In step 3031A, a free memory block in the parameter storage space is determined according to the flag bit of each memory block in the parameter storage space.
[0082] Optionally, the value of the flag bit can indicate whether the corresponding parameter block stores data. The processor can access the flag bits of the memory blocks in the parameter storage space in sequence to determine that the memory block is a free memory block when the value of the read flag bit indicates that the parameter block of the corresponding memory block does not store data. For example, the value of the flag bit can be 0 or 1. 0 indicates that the corresponding parameter block does not store data; 1 indicates that the corresponding parameter block stores data. The processor can determine the memory block with a flag bit value of 1 as a free memory block.
[0083] In step 3032A, the target disk parameters are stored in the parameter block in the free memory block, and the flag bit of the free memory block is updated.
[0084] In the embodiment of the present application, after storing the target disk parameters in the parameter block in the free memory block, the flag bit of the free memory block can be updated, and the updated flag bit indicates that the corresponding parameter block stores data. Optionally, in the parameter storage space, when there are multiple free memory blocks, the processor can store the target disk parameters in any free memory block. Alternatively, the processor can store the target disk parameters in the first determined free memory block.
[0085] In step 3033A, the offset of the free memory block in the parameter storage space is determined to obtain the first storage address of the target disk parameter.
[0086] The implementation method of determining the offset of the free memory block in the parameter storage space in step 3033A can refer to the implementation method of determining the offset of the free memory block in the parameter storage space by the aforementioned processor, which is not elaborated in the embodiment of the present application.
[0087] In an optional implementation, the first memory block in the reference storage space may be used to store disk parameters of a RAID group with a disk level of RAID 5. Based on this, the processor stores the target disk parameters in a free memory block in the parameter storage space, determines the offset of the free memory block in the parameter storage space, and obtains the first storage address of the target disk parameters. The process may also include step 3031B and step 3032B.
[0088] In step 3031B, when the disk level of the first RAID group is RAID 5, the target disk parameters are written to the first memory block in the parameter storage space, and the first storage address of the target disk parameters is determined to be 0.
[0089] When the disk level of the first RAID group is RAID 5, the target disk parameter is written to the first memory block in the parameter storage space, an offset of 0 of the first memory is obtained, and the first storage address of the target disk parameter is determined to be 0.
[0090] In step 3032B, when the disk level of the first RAID group is not RAID 5, the target disk parameters are stored in the free memory blocks except the first memory block in the parameter storage space, and the offset of the free memory blocks in the parameter storage space is determined.
[0091] In this step, the target disk parameters are stored in the free memory blocks other than the first memory block in the parameter storage space, and the offset of the free memory blocks in the parameter storage space is determined. The implementation method of storing the target disk parameters in the free memory blocks in the parameter storage space and determining the offset of the free memory blocks in the parameter storage space by the aforementioned processor can be referred to, and this embodiment of the present application will not be elaborated on this.
[0092] In an optional case, the disk parameters include check disk generation parameters and stripe consistency check parameters. Each memory block in the parameter storage space includes a parameter block and a flag bit, and each parameter block includes a calculation parameter (calc param) area and a recovery parameter (check param) area. The calculation parameter area is used to store the check disk generation parameters. The recovery parameter area is used to store the stripe consistency check parameters.
[0093] For example, a RAID device is configured with at most m disks, and a RAID group includes at most m disks. For each type of RAID group, the size of its disk parameter is m×z×(m+1)+y bytes, where z represents the maximum number of parity disks for each stripe in the RAID group.
[0094] Since a RAID group includes at most m disks, a stripe group includes at most m stripes. Each stripe includes partial data blocks of m disks. Therefore, for each stripe having m×z bytes of check disk generation parameters, a RAID group has m×z×m bytes of check disk generation parameters. The m×z bytes of check disk generation parameters of each stripe include: z groups of m check disk generation parameters, and each group of m check disk generation parameters is used to generate data of a check disk of the stripe.
[0095] Furthermore, since the stripe consistency check parameters of different stripes of the same type of RAID group are the same, one RAID group has a stripe consistency check parameter of m×z bytes.
[0096] Furthermore, a RAID group has a y-byte flag bit, which indicates whether a memory block corresponding to the RAID group stores disk parameters.
[0097] Therefore, the size of the memory block used to store disk parameters is at least m×z×(m+1)+y bytes. Accordingly, the size of the parameter block is at least m×z×(m+1) bytes, and the size of the flag bit is at least y bytes. Furthermore, the size of the calculation parameter area is at least m×z×m bytes, and the size of the recovery parameter area is at least m×z bytes.
[0098] For example, the maximum number of check disks included in a RAID group is 3 (z=3), namely, P check disk, Q check disk, and R check disk. And assume that the number of bytes of the flag bit is 4. Thus, for each type of RAID group, the size of its disk parameter is m×3×(m+1)+4 bytes. Thus, Figure 4 As shown, the processor can apply for a continuous memory space according to the maximum number of RAID categories (RAID group categories, types, types) that can exist at the same time. The memory space can be arranged as: s continuous memory blocks, s is the number of RAID categories that can exist. The size of each memory block is m×3×(m+1)+4 bytes. Among them, the first m×3×m bytes are the calculation parameter area, which is used to store the check disk generation parameters, and the subsequent m×3 bytes are the recovery parameter area, which is used to store the stripe consistency check parameters. The last 4 bytes are flag bits, which are used to indicate whether the memory block is occupied, so as to indicate whether the calculation parameter area / recovery parameter area writes the disk parameters. In addition, the calculation parameter area can store the check disk generation parameters of each stripe of the m stripes of the RAID group. The check disk generation parameters of each stripe include 3 groups of m check disk generation parameters. The 3 groups of m check disk generation parameters include m P check disk generation parameters kp0, kp1, ..., kpm, m Q check disk generation parameters kq0, kq1, ..., kqm, and m R check disk generation parameters kr0, kr1, ..., krm.
[0099] In some embodiments of the present application, the processor may also perform a process of acquiring the parameter storage space to apply for a parameter storage space having s memory blocks in the memory. Figure 5 As shown, before step 301, the disk parameter management method further includes:
[0100] Step 501: Obtain the total number of configured disks and a set of disk levels of configurable RAID groups.
[0101] The processor may obtain the total number of disks configured by the RAID device and a set of disk levels of configurable RAID groups. The set of disk levels includes all disk levels of RAID groups configurable by the RAID device. Optionally, the set of disk levels includes: RAID5, RAID6, and RAID TP.
[0102] Step 502: For each disk level in the disk level set, determine the maximum number of categories of the RAID group of the disk level according to the total number of disks, and obtain the total number of categories of the configurable RAID group.
[0103] For disk level RAID 5, the processor may determine that the maximum number of categories of the RAID group of disk level RAID 5 is 1. That is, for disk level RAID 5, no matter how many disks are included, they are all considered to be of the same category.
[0104] For disk level RAID6, since the RAID group of disk level RAID6 includes at least 4 disks. Therefore, the maximum number of categories a of the RAID group of disk level RAID6 satisfies Inequality 1 and Inequality 2. Inequality 1 and Inequality 2 are 4+5+6+7+…+a≤w, 4+5+6+7+…+a+(a+1)>w respectively. Among them, w is the total number of disks configured in the RAID device. Based on this, the processor can determine the maximum number of categories a of the RAID group of disk level RAID6 based on the total number of disks w according to Inequality 1 and Inequality 2.
[0105] For disk-level RAID TP, since the RAID group of disk-level RAID TP includes at least 5 disks. Therefore, the maximum number of categories b of the RAID group of disk-level RAID TP satisfies Inequality 3 and Inequality 4. Inequality 3 and Inequality 4 are 5+6+7+…+b≤w, 5+6+7+…+b+(b+1)>w respectively. Among them, w is the total number of disks configured in the RAID device. Based on this, the processor can determine the maximum number of categories b of the RAID group of disk-level RAID TP based on the total number of disks w according to Inequality 3 and Inequality 4. Based on this, the processor can determine that the total number of categories s of the configurable RAID group is a+b+1.
[0106] Step 503: Determine a parameter storage space including s memory blocks, where s is the total number of categories.
[0107] Optionally, the processor may apply for a continuous parameter storage space in the memory to determine the parameter storage space including s memory blocks and obtain the base address of the parameter storage space. Based on this, the offsets of the s memory blocks in the parameter storage space are 0, 1, 2, ..., s-1 in sequence.
[0108] Correspondingly, optionally, when the first storage address of the disk management information is: the offset of the memory block where the disk parameters are located in the parameter storage space, the disk management information may include the category of the RAID group and the offset of the memory block. The category of the RAID group includes the RAID level and the number of disks.
[0109] like Figure 6As shown, it shows the mapping relationship between disk management information and memory blocks in parameter storage space. The parameter storage space includes memory blocks of s categories of RAID groups. Each memory block includes a calculation parameter area and a recovery parameter area. The disk management information records the offset of each memory block in the parameter storage space. It should be noted that Figure 6 In the example, the disk management information is recorded in a table form, and the disk management information also includes the number of RAID groups of the same category. In an optional implementation, the processor can create a management information table (table) to record the disk management information when the RAID device is initialized. The management information table includes s memory blocks in the memory corresponding to s elements. Each element is a structure containing three fields, namely the disk level, the number of disks, and the number of RAID groups of the same category.
[0110] Optionally, the disk management information further includes the number of RAID groups of the same category. The number of RAID groups of the same category indicates the number of RAID groups of the same category in the RAID groups that have stored the disk parameters. The method for managing disk parameters further includes: when determining the disk parameters of the RAID groups of the same category stored according to the target disk level and the disk management information, adding 1 to the number of RAID groups of the first category in the disk management information, where the first category is the category of the first RAID group.
[0111] Accordingly, the process of updating the first storage address of the target disk parameter and the category of the first RAID group to the disk management information in step 304 may include: updating the first storage address of the target disk parameter, the category of the first RAID group, and the number 1 of the RAID groups of the first category to the disk management information.
[0112] Wherein, in the case where a new first RAID group is detected, when the processor determines that the disk parameters of the RAID group of the same category are stored according to the target disk level, the target number of disks, and the disk management information, it is not necessary to repeatedly store the disk parameters of the first RAID group, and the number of RAID groups of the first category in the disk management information is increased by 1. When determining that the disk parameters of the RAID group of the same category are stored according to the target disk level, the target number of disks, and the disk management information, the target disk parameters are stored, a first storage address of the target disk parameters is determined, and the first storage address of the target disk parameters, the category of the first RAID group, and the number of RAID groups of the first category, 1, are updated to the disk management information.
[0113] For example, Figure 6 Take the management information table shown in FIG. 1 as an example. Assume that the management information table records the parameter management information including: RAID 5, the number of disks is 32, and the number of RAID groups of the same type is 1.
[0114] When the target disk type of the first RAID group is RAID5, the processor updates the number of RAID groups of the same type corresponding to RAID5 in the management information table to 2. When the target disk type of the first RAID group is RAID6 and the number of disks is 6, the processor adds information to the management information table: RAID6, the number of disks is 6, and the number of RAID groups of the same type is 1.
[0115] In order to facilitate understanding of the storage method of disk parameters in the disk parameter management method, the following is further explained with an example. Take the management information table recording disk management information as an example. Figure 7 As shown, when the processor detects a new first RAID group, it obtains the management information table, the target disk level and the target disk quantity of the first RAID group. It determines whether the target disk level of the first RAID group is RAID 5, RAID 8 or RAID TP. If not, it exits; if so, it determines whether the category of the first RAID group is recorded in the disk management information according to the target disk level and the target disk quantity of the first RAID group, so as to determine whether the disk parameters of the RAID group of the same category as the first RAID group are stored.
[0116] When the category of the first RAID group is recorded in the disk management information, there is no need to repeatedly store the disk parameters. The number of RAID groups of the same category corresponding to the category of the first RAID group is updated in the management information table, and the updated value is increased by 1 compared to the value before the update.
[0117] If the category of the first RAID group is not recorded in the disk management information, the check disk generation parameter of each stripe of the first RAID group and the stripe consistency check parameter of the RAID group are calculated. It is determined whether the target disk level of the first RAID group is RAID 5.
[0118] If the target disk level of the first RAID group is RAID 5, search for a free memory block in the parameter storage space in the memory. Store the check disk generation parameters and stripe consistency check parameters of the first RAID group in the free memory block, record the offset of the free memory block, and update the flag of the free memory block. Update the data corresponding to the offset in the management information table. The updated management information table is added with: the disk level of the first RAID group, the number of disks, the offset of the memory block storing the disk parameters, and the number of RAID groups of the same category 1.
[0119] If the target disk level of the first RAID group is not RAID 5, store the check disk generation parameters and stripe consistency check parameters of the first RAID group in the memory block with offset 0 (i.e., the first memory block) in the parameter storage space of the memory, record the offset of the free memory block, and update the flag of the free memory block. Update the data corresponding to the offset 0 in the management information table, and the updated management information table is added with: the disk level of the first RAID group, the number of disks, the offset 0 of the memory block storing the disk parameters, and the number of RAID groups of the same category 1.
[0120] In some embodiments of the present application, when it is necessary to read the disk parameters of a RAID group, the parameter address of the disk parameters of the category to which the RAID group belongs can be determined based on the disk management information, and then the disk parameters can be read based on the parameter address to obtain the disk parameters of the RAID group.
[0121] In an optional implementation, the first storage address of the disk management information is: a direct storage address of the disk parameters. The disk parameter management method further includes: in response to a read operation of the disk parameters of the first RAID group, obtaining the disk management information. In a case where the disk management information includes relevant information of the category to which the first RAID group belongs, the first storage address of the first RAID group is read from the disk management information. According to the first storage address, the disk parameters of the first RAID group are read.
[0122] In another optional implementation, the first storage address of the disk management information is: the offset of the memory block in the parameter storage space. The disk parameter management method also includes: in response to the read operation of the disk parameter of the first RAID group, obtaining the disk management information and the base address of the parameter storage space. In the case where the disk management information includes relevant information about the category to which the first RAID group belongs, the offset of the memory block corresponding to the first RAID group is read from the disk management information. The product of the offset and the size of the memory block is calculated to obtain the offset address. The sum of the base address and the offset address of the parameter storage space is determined as the storage address of the disk parameter of the first RAID group. The disk parameters are read according to the storage address.
[0123] It should be noted that, in the case where the disk parameters include the check disk generation parameters and the stripe consistency check parameters, a single memory block (or parameter block) in the parameter storage space may store the check disk generation parameters and the stripe consistency check parameters, a total of two types of parameters. The processor may also read the two types of parameters separately according to the size of the memory occupied by the check disk generation parameters (for example, the calculation parameter area) and the size of the memory occupied by the stripe consistency check parameters (for example, the recovery parameter area).
[0124] Further optionally, the calculation parameter area in the memory block is used to store the check disk generation parameters of each stripe in the RAID group. Accordingly, the generation parameters of a stripe in a RAID group can also be read separately from the memory. The first RAID group includes multiple stripes. The check disk generation parameters of the first RAID include the generation parameters of each stripe in the first RAID group. Based on this, the disk parameter management method includes:
[0125] In response to a read operation of the generation parameters of the first stripe in the first RAID group, an offset of the first stripe in the first RAID group and disk management information are obtained. A first storage address of the first RAID group is read from the disk management information. A first parameter address corresponding to the first stripe is determined based on a base address of the parameter storage space, a first storage address, a memory size of the parameter block, an offset corresponding to the first stripe, and a memory size of the generation parameters in the calculation parameter area. Based on the first parameter address, the generation parameters of the first stripe are read.
[0126] The address of a single memory block in the memory (address 1) can be calculated based on the base address of the parameter storage space, the offset of the memory block, and the size of the memory block. The address of a single stripe in the memory block can be calculated based on the address of the memory block, the offset of the stripe, and the size of the stripe. Specifically, Figure 8 As shown, when the memory block is composed of the calculation parameter area, the recovery parameter area and the flag bit from front to back according to the address, address 1 satisfies: address 1 = base address of parameter storage space + offset × size of memory block. The address of a single stripe in the memory block satisfies: the address = address 1 + offset of the stripe × size of the stripe. For example, if the flag bit is 4 bytes, then address 1 = base address of parameter storage space + offset × (m × 3 × (m + 1) + 4). The address = address 1 + offset of the stripe × m × 3.
[0127] In this way, after obtaining the offset of the first stripe in the first RAID group and the offset of the memory block corresponding to the first RAID group in the parameter storage space (i.e., the first storage address), the processor can use Formula 4, the base address of the parameter storage space, the first storage address, the memory size of the parameter block, the offset corresponding to the first stripe, and the memory size of the generation parameter in the calculation parameter area to determine the first parameter address corresponding to the first stripe, and the storage space where the first parameter address is located stores the check disk generation parameter of the first stripe. Wherein, Formula 4 satisfies: addr2 = addr_base + offset ×(m×z×(m+1)+y) + stripe_offset×(m×z). In Formula 4, addr2 represents the first parameter address corresponding to the first stripe. addr_base represents the base address of the parameter storage space. offset represents the offset of the memory block corresponding to the first RAID group in the parameter storage space (i.e., the first storage address). (m×z×(m+1)+y) represents the size of the memory block. stripe_offset represents the offset of the first stripe in the first RAID group. (m×z) represents the memory size occupied by the parity disk generation parameters of a single stripe.
[0128] Optionally, the read operation of the generation parameters of the first stripe can be directly used to trigger the generation of the offset corresponding to the first stripe. Accordingly, in response to the read operation, the offset corresponding to the generated first stripe is obtained. Alternatively, the read operation of the generation parameters of the first stripe can be directly used to trigger the generation of the starting address of the data block corresponding to the input and output (I0) interface of the RAID group. The starting address refers to the starting address of the first data block in the data blocks of each disk included in the stripe.
[0129] In this way, the process of the processor obtaining the offset of the first stripe in the first RAID group may include: using Formula 5, according to the starting address, the number of data blocks in a single stripe in the first RAID group, and the number of disks included in the first RAID group. Wherein, Formula 5 satisfies: stripe_offset = slab / stripe_size % disk_num. In Formula 5, stripe_offset represents the offset of the first stripe in the first RAID group. slab represents the starting address of the data block corresponding to the input and output (I0) interface of the first RAID group. stripe_size represents the number of data blocks in a single stripe in the first RAID group. disk_num represents the number of disks included in the first RAID group.
[0130] Further optionally, as shown above, the consistency check parameters of each stripe in the RAID group are consistent. The recovery parameter area in the memory block is used to store the stripe consistency check parameters of a single stripe in the RAID group. The processor can read the stripe consistency check parameters of a single RAID group from the memory. Based on this, the disk parameter management method also includes:
[0131] In response to a read operation of a stripe consistency check parameter of the first RAID group, disk management information is obtained; a first storage address of the first RAID group is read from the disk management information; a second parameter address corresponding to the stripe consistency check parameter of the first RAID group is determined based on a base address of the parameter storage space, the first storage address, a memory size of the parameter block, and a size of the calculation parameter area; and based on the second parameter address, the stripe consistency check parameter of the first RAID group is read.
[0132] The address of a single memory block in the memory (address 1) can be calculated based on the base address of the parameter storage space, the offset of the memory block, and the size of the memory block. The address of the recovery parameter area in the memory block can be calculated based on the address of the memory block and the size of the calculation parameter area. Specifically, Fig. 9 As shown, when the memory block is composed of the calculation parameter area, the recovery parameter area and the flag bit from front to back according to the address, address 1 satisfies: address 1 = base address of parameter storage space + offset × size of memory block. The address of the recovery parameter area satisfies: the address = address 1 + size of calculation parameter area. For example, if the flag bit is 4 bytes, then address 1 = base address of parameter storage space + offset × (m × 3 × (m + 1) + 4). The address = address 1 + m × m × 3.
[0133] In this way, after the processor obtains the offset (i.e., the first storage address) of the memory block corresponding to the first RAID group in the parameter storage space, the processor can use Formula 6 to determine the second parameter address corresponding to the stripe consistency check parameter of the first RAID group according to the base address of the parameter storage space, the first storage address, the memory size of the parameter block, and the size of the calculation parameter area. The storage space indicated by the second parameter address stores the stripe consistency check parameter of the first RAID group. Wherein, Formula 6 satisfies: addr2 = addr_base + offset × (m×z×(m+1)+y) + m×z×m. In Formula 6, addr2 represents the second parameter address. addr_base represents the base address of the parameter storage space. offset represents the offset (i.e., the first storage address) of the memory block corresponding to the first RAID group in the parameter storage space. (m×z×(m+1)+y) represents the size of the memory block. stripe_offset represents the offset of the first stripe in the first RAID group. (m×z) represents the memory occupied size of the check disk generation parameter of a single stripe.
[0134] In some embodiments of the present application, when it is necessary to delete the disk parameters of the RAID group, the parameter address of the disk parameters of the category to which the RAID group belongs can be determined based on the disk management information, and then the disk parameters can be read based on the parameter address to obtain the disk parameters of the RAID group. Among them, the process of deleting the disk parameters can refer to the process of reading the disk parameters. The main difference between the two is that in the process of reading the disk parameters, after the processor obtains the parameter address (such as the first parameter address and the second parameter address), it reads the disk parameters according to the parameter address. In the process of deleting the disk parameters, after the processor obtains the parameter address (such as the first parameter address and the second parameter address), it deletes the disk parameters in the storage space indicated by the parameter address.
[0135] It should be noted that, in some embodiments, the disk management information includes: the number of RAID groups of the same category. In this way, in the process of deleting the disk parameters, it is necessary to synchronously update the flag bit of the memory block and the number of RAID groups of the same category recorded in the disk management information. Optionally, the disk parameter management method also includes:
[0136] In response to a delete operation on the second RAID group, the disk management information and the disk level and the number of disks of the second RAID group are obtained; based on the disk level and the number of disks of the second RAID group, the number of RAID groups of the second category in the disk management information is reduced by 1 to obtain an updated number of RAID groups of the second category, where the second category is the category of the second RAID group; when the updated number is 0, the first storage address corresponding to the second category is obtained from the disk management information, the disk parameters in the first storage address are deleted, and all information corresponding to the second category in the disk management information is deleted.
[0137] Wherein, in the case of deleting the second RAID group, the disk parameters of the second RAID group need to be deleted synchronously. In response to the deletion operation on the second RAID group, the processor obtains the disk level and the number of disks of the second RAID group. According to the disk level and the number of disks of the second RAID group, the number of RAID groups of the same category corresponding to the second category in the disk management information is obtained. The number of RAID groups of the same category records the number of RAID groups of the second category in the RAID group in which the disk parameters have been stored. The processor updates the number of RAID groups of the same category corresponding to the second category in the disk management information to obtain the updated number of RAID groups of the second category, and the updated number is reduced by one compared to the number before the update. When the updated number is 0, the first storage address corresponding to the second category is obtained from the disk management information, the disk parameters in the first storage address are deleted, and all information corresponding to the second category in the disk management information is deleted. All the information includes the second category, the first storage address corresponding to the second category, and the number of RAID groups of the same category corresponding to the second category.
[0138] Optionally, the first storage address is a storage address or an offset of a memory block in the parameter storage space. In the case where the memory block in the parameter storage space includes a flag bit, when deleting the disk parameters in the first storage address corresponding to the second category, it is also necessary to update the flag bit of the memory block indicated by the first storage address, and the updated flag bit indicates that the memory block does not store the disk parameters.
[0139] For example, Fig.10 As shown, in the case where the deletion operation on the second RAID group is triggered, the processor obtains the management information table, the disk level and the number of disks of the second RAID group in response to the deletion operation on the second RAID group.
[0140] Determine whether the target disk level of the second RAID group is RAID 5, RAID 8, or RAID TP. If not, exit; if so, find the category of the second RAID group in the management information table according to the disk level and number of disks of the second RAID group, and reduce the number of RAID groups of the same category corresponding to the category of the second RAID group in the management information table by 1.
[0141] Determine whether the number of RAID groups of the same category corresponding to the category to which the second RAID group belongs in the management information table is 0. If not, exit; if so, delete the disk parameters corresponding to the category to which the second RAID group belongs in the memory, update the flag bit of the corresponding memory block to invalid, and delete all information corresponding to the category to which the second RAID group belongs in the management information table.
[0142] In some embodiments of the present application, the RAID group also has bad disk recovery parameters. The bad disk recovery parameters are used to recover data on damaged disks. In the case that some disks in the RAID group fail or become damaged, all undamaged disks are used as data disks and damaged disks are used as check disks. Corresponding check disk generation parameters can be generated, and the check disk generation parameters are bad disk recovery parameters. Among them, RAID 5 allows at most one disk to fail, RAID 6 allows at most two disks to fail, and RAID TP allows at most three disks to fail.
[0143] Since any disk of a RAID group may fail, and the reasons for failure may be as many as hundreds. Different failed disks have different bad disk recovery parameters. Therefore, each failed RAID group can store its own bad disk recovery parameters. Among them, according to the group sequence number of the RAID group, a memory block can be allocated to the RAID group to store the bad disk recovery parameters of the RAID group. When a failed RAID group appears, the bad disk recovery parameters can be calculated, and the calculated bad disk recovery parameters can be stored in the memory block corresponding to the group sequence number of the RAID group.
[0144] It should be noted that a single RAID group can have m×z bytes of bad disk recovery parameters. Accordingly, a memory block of m×z bytes can be allocated to each RAID group. For example, the maximum number of check disks included in the RAID group is 3 (z=3). A single RAID group can have m×3 bytes of bad disk recovery parameters. Fig.11 As shown in the figure, when the RAID device is configured with w disks, since w disks can form at most w RAID groups. Therefore, the processor can divide w continuous memory blocks in the memory. The memory block is also called the decoding parameter area. The size of each memory block is m×3 bytes, and each memory block is used to store the bad disk recovery parameters of different RAID groups. Among them, the processor can divide a continuous storage space in the memory. The front part of the storage space is the parameter storage space, and the latter part is the w decoding parameter areas.
[0145] Correspondingly, optionally, the disk parameter management method further includes: in the case where a damaged disk appears in the RAID group, obtaining the bad disk recovery parameter. According to the correspondence between the group sequence number of the RAID group and the second storage address, determining the third parameter address corresponding to the group sequence number of the RAID group where the damaged disk appears. According to the third parameter address, storing the bad disk recovery parameter. In an optional implementation, the processor may store the correspondence between the group sequence number of the RAID group and the second storage address. In the correspondence, the second storage address indicates the storage space in the memory for storing the bad disk recovery parameter of the corresponding RAID group. In the case where a damaged disk appears in the RAID group, the processor may calculate the bad disk recovery parameter. Then, in the correspondence between the group sequence number and the second storage address, the second storage address corresponding to the group sequence number of the RAID group where the damaged disk appears is determined as the third parameter address. Writing the bad disk recovery parameter to the storage space indicated by the third parameter address.
[0146] For example, Fig.12 As shown, in the case of a RAID group with a damaged disk, the processor can use the good disk as a data disk and the bad disk as a check disk, calculate the check disk generation parameter, and the check disk generation parameter is the bad disk recovery parameter. The processor stores the bad disk recovery parameter in the memory designated space corresponding to the group number of the RAID group according to the group number (raid_id) of the RAID group. Among them, the good disk refers to the undamaged disk in the RAID group. The bad disk refers to the damaged disk in the RAID group.
[0147] In some embodiments of the present application, when it is necessary to read the bad disk recovery parameters of the RAID group, the second storage address corresponding to the group number of the RAID group whose bad disk recovery parameters are to be read can be determined according to the correspondence between the group number of the RAID group and the second storage address. The bad disk recovery parameters are read according to the second storage address.
[0148] In an optional implementation, the second storage address is a direct storage address of the bad disk recovery parameter. The processor can directly determine the second storage address corresponding to the RAID group whose bad disk recovery parameter is to be read according to the correspondence between the group number of the RAID group and the second storage address, and read the bad disk recovery parameter from the storage space corresponding to the second storage address.
[0149] In another optional implementation, there is a bad disk storage space. The bad disk storage space includes w memory blocks. The second storage address is the offset of the memory block in the bad disk storage space. The processor determines the second storage address of the RAID group whose bad disk recovery parameters are to be read based on the correspondence between the group number of the RAID group and the second storage address. Afterwards, the base address of the bad disk storage space and the size of a single memory block in the bad disk storage space are obtained. The product of the second storage address and the size of the memory block is calculated to obtain the offset address. The sum of the base address of the bad disk storage space and the offset address is determined as the storage address of the bad disk recovery parameters of the RAID group. The bad disk recovery parameters are read from the storage space corresponding to the storage address.
[0150] For example, Fig.13 As shown, a single RAID group has a bad disk recovery parameter of m×3 bytes. The size of a single memory block in the bad disk storage space is m×3 bytes. In addition, the processor can allocate the memory blocks of the bad disk storage space according to the group order of the RAID group. In this way, the offset of the memory block in the bad disk storage space is the group sequence number of the RAID group.
[0151] Assume that the group number of the third RAID group is 3 and the offset is 3. If the bad disk recovery parameter of the third RAID group is read, the processor can use Formula 7 to calculate the storage address of the bad disk recovery parameter of the third RAID group according to the base address of the bad disk storage space, the size of a single memory block, and the offset of the third RAID group. Wherein, Formula 7 satisfies: addr4=addr_base_3+raid_id×(m×3). In Formula 7, addr4 represents the storage address of the bad disk recovery parameter of the third RAID group. addr_base_3 represents the base address of the bad disk storage space. raid_id represents the offset of the third RAID group (i.e., the group number of the third RAID group). (m×3) is the size of a single memory block in the bad disk storage space.
[0152] Further exemplified, the bad disk storage space and the parameter storage space are continuous storage spaces in the memory. And the offset of the bad disk storage space compared to the base address of the parameter storage space is types_1. Based on this, the processor can also use Formula 8 to calculate the storage address of the bad disk recovery parameter of the third RAID group according to the base address of the parameter storage space, the offset of the bad disk storage space compared to the parameter storage space, the size of a single memory block in the bad disk storage space, and the offset of the third RAID group. Wherein, Formula 8 satisfies: addr4=addr_base×(m×3×(m+1)×4)×types_1+raid_id×(m×3). In Formula 8, addr4 represents the storage address of the bad disk recovery parameter of the third RAID group. addr_base represents the base address of the parameter storage space. types_1 represents that the offset of the bad disk storage space compared to the base address of the parameter storage space is types_1. raid_id represents the offset of the third RAID group (i.e., the group number of the third RAID group). (m×3) is the size of a single memory block in the bad disk storage space.
[0153] In an embodiment of the present application, when a new first RAID group is detected, disk management information, a target disk level and a target disk number of the first RAID group are obtained. The disk management information records the first storage address of the disk parameters of the stored RAID group and the category of the RAID group. Since the category of the RAID group is divided according to the disk level and the number of disks, and the disk parameters of the RAID groups of the same category are the same, when it is determined that the disk parameters of the RAID group of the same category are not stored according to the target disk level, the target disk number and the disk management information, the target disk parameters of the first RAID group can be stored, and then the first storage address of the target disk parameters and the category of the first RAID group can be updated to the disk management information. In this technical solution, by dividing the RAID group category according to the disk level and the number of disks, when the disk parameters of the RAID groups of the same category are the same, only one disk parameter is stored for the RAID groups of the same category, thereby avoiding repeated storage of the disk parameters of the RAID groups of the same category, effectively reducing the amount of storage space occupied by the disk parameters, and improving the utilization of the storage space.
[0154] For ease of understanding, the technical solution of the present application is further introduced with the following example. For example, it is assumed that the RAID device is configured with 64 disks, and a single RAID group includes a maximum of 32 disks, that is, w = 64, m = 32. In this way, according to the aforementioned inequality 1 and inequality 2, 4+5+6+7+…+a≤64, 4+5+6+7+…+a+(a+1)>64. And according to the aforementioned inequality 3 and inequality 4, 5+6+7+…+b≤64, 5+6+7+…+b+(b+1)>64. Based on this, a = 7, b = 8. The processor can determine that the total number of categories s of the configurable RAID group is a + b + 1 = 16.
[0155] Take the following scenario as an example. The RAID device creates 5-disk RAID 5, creates 6-disk RAID 5, creates 6-disk RAID 6, creates 7-disk RAID 6, creates 5-disk RAID TP, deletes 6-disk RAID 6, creates 8-disk RAID TP, deletes 5-disk RAID5, and deletes 6-disk RAID 5. The changes in the parameter storage space and management information table in the memory during this process are as follows: Fig.14 It should be noted that Fig.14 The dark-filled memory block indicates that the memory block is occupied. In addition, since the RAID groups with disk level RAID5 are all of the same category. Therefore, the number of disks in the RAID group of this category can be recorded as any value in the management information table. This example takes 32 as an example. In addition, p1 disk RAID 5 indicates a RAID group with disk level RAID5 and p1 disks. p2 disk RAID 6 indicates a RAID group with disk level RAID6 and p2 disks. p3 disk RAID TP indicates a RAID group with disk level RAID TP and p3 disks. In this example, p1 is 5 and 6; p2 is 6 and 7; and p3 is 5 and 8.
[0156] After the RAID device is initialized, the parameter storage space and management information table are as follows: Fig.14 As shown in the figure, all memory blocks in the parameter storage space are not occupied, and the management information table is empty.
[0157] When creating a 5-disk RAID 5, Fig.14 As shown, the memory block with offset 0 in the parameter storage space is occupied, and the management information table is written with: disk level (raid_level) RAID 5, number of disks (disk_num) 32, and number of RAID groups of the same category (raid_num) 1.
[0158] When creating a 6-disk RAID 5, Fig.14As shown, the memory block with offset 0 in the parameter storage space is occupied, and the management information table is updated as follows: disk level RAID 5, number of disks 32, and number of RAID groups of the same category 2.
[0159] When creating a 6-disk RAID 6, Fig.14 As shown, two memory blocks with offsets 0 and 1 in the parameter storage space are occupied, and the management information table is updated as follows: disk level RAID 5, number of disks 32, number of RAID groups of the same category 2; disk level RAID 6, number of disks 6, number of RAID groups of the same category 1.
[0160] When creating a 7-disk RAID 6, Fig.14 As shown, three memory blocks with offsets 0, 1 and 2 in the parameter storage space are occupied, and the management information table is updated as follows: disk level RAID 5, number of disks 32, number of RAID groups of the same category 2; disk level RAID 6, number of disks 6, number of RAID groups of the same category 1; disk level RAID 6, number of disks 7, number of RAID groups of the same category 1.
[0161] When creating a 5-disk RAID TP, Fig.14 As shown, four memory blocks with offsets 0, 1, 2 and 3 in the parameter storage space are occupied, and the management information table is updated as follows: disk level RAID 5, number of disks 32, number of RAID groups of the same category 2; disk level RAID 6, number of disks 6, number of RAID groups of the same category 1; disk level RAID 6, number of disks 7, number of RAID groups of the same category 1; disk level RAID TP, number of disks 5, number of RAID groups of the same category 1.
[0162] When deleting a 6-disk RAID 6, Fig.14 As shown, three memory blocks with offsets 0, 2 and 3 in the parameter storage space are occupied, and the management information table is updated as follows: disk level RAID 5, number of disks 32, number of RAID groups of the same category 2; disk level RAID 6, number of disks 7, number of RAID groups of the same category 1; disk level RAID TP, number of disks 5, number of RAID groups of the same category 1.
[0163] When creating an 8-disk RAID TP, Fig.14As shown, four memory blocks with offsets of 0, 1, 2, and 3 in the parameter storage space are occupied, and the management information table is updated as follows: disk level RAID 5, number of disks 32, number of RAID groups of the same category 2; disk level RAID TP, number of disks 8, number of RAID groups of the same category 1; disk level RAID 6, number of disks 7, number of RAID groups of the same category 1; disk level RAID TP, number of disks 5, number of RAID groups of the same category 1.
[0164] In the case of deleting 5-disk RAID 5, Fig.14 As shown, four memory blocks with offsets 0, 1, 2 and 3 in the parameter storage space are occupied, and the management information table is updated as follows: disk level RAID 5, number of disks 32, number of RAID groups of the same category 1; disk level RAID TP, number of disks 8, number of RAID groups of the same category 1; disk level RAID 6, number of disks 7, number of RAID groups of the same category 1; disk level RAID TP, number of disks 5, number of RAID groups of the same category 1.
[0165] When deleting a 6-disk RAID 5, Fig.14 As shown, three memory blocks with offsets of 1, 2 and 3 in the parameter storage space are occupied, and the management information table is updated as follows: disk level RAID TP, number of disks 8, number of RAID groups of the same category 1; disk level RAID 6, number of disks 7, number of RAID groups of the same category 1; disk level RAID TP, number of disks 5, number of RAID groups of the same category 1.
[0166] In summary, the disk parameter management method provided in the embodiment of the present application obtains disk management information, the target disk level and the target disk number of the first RAID group when a new first RAID group is detected. Among them, the disk management information records the first storage address of the disk parameters of the stored RAID group and the category of the RAID group. Since the category of the RAID group is divided according to the disk level and the number of disks, and the disk parameters of the RAID groups of the same category are the same, the target disk parameters of the first RAID group can be stored when it is determined that the disk parameters of the RAID group of the same category are not stored according to the target disk level, the target disk number and the disk management information, and then the first storage address of the target disk parameters and the category of the first RAID group are updated to the disk management information. In this technical solution, by dividing the RAID group category according to the disk level and the number of disks, so that the disk parameters of the RAID groups of the same category are the same, only one disk parameter is stored for the RAID groups of the same category, thereby avoiding repeated storage of the disk parameters of the RAID groups of the same category, effectively reducing the amount of storage space occupied by the disk parameters, and improving the utilization of the storage space.
[0167] Please refer to Fig.15 , which shows a block diagram of a disk parameter management device provided by an embodiment of the present application. Fig.15 As shown, the disk parameter management device 1500 includes: an acquisition module 1501, a storage module 1502 and an update module 1503.
[0168] The acquisition module 1501 is used to acquire disk management information, a target disk level and a target disk quantity of the first RAID group when a new first independent redundant array of disks RAID group is detected, wherein the disk management information includes: a first storage address of a disk parameter of the RAID group and a category of the RAID group, wherein the category of the RAID group is divided according to the disk level and the number of disks, and the disk parameters of RAID groups of the same category are the same, and the disk parameters include a check disk generation parameter and / or a stripe consistency check parameter;
[0169] The acquisition module 1501 is further used to acquire the target disk parameters of the first RAID group when it is determined that no disk parameters of the RAID group of the same category are stored according to the target disk level, the target disk quantity and the disk management information;
[0170] The storage module 1502 is used to store the target disk parameters and determine the first storage address of the target disk parameters;
[0171] The updating module 1503 is used to update the first storage address of the target disk parameter and the type of the first RAID group into the disk management information.
[0172] Optionally, the parameter storage space includes s memory blocks, where s is a positive integer; each memory block is used to store disk parameters of different categories of RAID groups, and the first storage address in the disk management information is: the offset of the memory block where the disk parameters are located in the parameter storage space; the storage module 1502 is also used to store the target disk parameters in the free memory blocks in the parameter storage space, determine the offset of the free memory blocks in the parameter storage space, and obtain the first storage address of the target disk parameters, and the free memory blocks are memory blocks that do not store disk parameters.
[0173] Optionally, the memory block includes a parameter block and a flag bit, and the flag bit indicates whether data is stored in the parameter block; the storage module 1502 is further used for:
[0174] Determine a free memory block in the parameter storage space according to a flag bit of each memory block in the parameter storage space;
[0175] Store the target disk parameters in the parameter block in the free memory block and update the flag bit of the free memory block;
[0176] The offset of the free memory block in the parameter storage space is determined to obtain the first storage address of the target disk parameter.
[0177] Optionally, the acquisition module 1501 is further used to acquire the total number of configured disks and a set of disk levels of a configurable RAID group;
[0178] The disk parameter management device 11500 also includes: a determination module, which is used to determine the maximum number of categories of the RAID group of the disk level according to the total number of disks for each disk level in the disk level set, and obtain the total number of categories of the configurable RAID group; and is also used to determine a parameter storage space including s memory blocks, where s is the total number of categories.
[0179] Optionally, the storage module 1502 is further used to: when the disk level of the first RAID group is RAID 5, write the target disk parameters to the first memory block in the parameter storage space, and determine that the first storage address of the target disk parameters is 0; when the disk level of the first RAID group is not RAID 5, store the target disk parameters in the free memory blocks other than the first memory block in the parameter storage space, and determine the offset of the free memory blocks in the parameter storage space.
[0180] Optionally, the disk management information further includes: the number of RAID groups of the same category; the updating module 1503 is further configured to, when determining the disk parameters storing the RAID groups of the same category according to the target disk level and the disk management information, increase the number of RAID groups of the first category in the disk management information by 1, where the first category is the category of the first RAID group;
[0181] The updating module 1503 is further configured to update the first storage address of the target disk parameter, the category of the first RAID group, and the number 1 of the RAID groups of the first category to the disk management information.
[0182] Optionally, the acquisition module 1501 is further configured to acquire disk management information and a disk level and a number of disks of the second RAID group in response to a deletion operation on the second RAID group;
[0183] The updating module 1503 is further configured to reduce the number of RAID groups of the second category in the disk management information by 1 according to the disk level and the number of disks of the second RAID group, so as to obtain an updated number of RAID groups of the second category, where the second category is the category of the second RAID group;
[0184] The disk parameter management device 11500 also includes: a deletion module, which is used to obtain the first storage address corresponding to the second category from the disk management information when the update quantity is 0, delete the disk parameters in the first storage address, and delete all information corresponding to the second category in the disk management information.
[0185] Optionally, the parameter block is divided into a calculation parameter area and a recovery parameter area, the calculation parameter area is used to store the check disk generation parameter, and the recovery parameter area is used to store the stripe consistency check parameter; the first RAID group includes multiple stripes, and the check disk generation parameter of the first RAID includes the generation parameter of each stripe in the first RAID group; the device also includes:
[0186] The acquisition module 1501 is further configured to acquire the offset of the first stripe in the first RAID group and the disk management information in response to the read operation of the generation parameters of the first stripe in the first RAID group;
[0187] The disk parameter management device 11500 further includes: a reading module, configured to read a first storage address of a first RAID group from the disk management information;
[0188] The determination module is further used to determine a first parameter address corresponding to the first stripe according to a base address of the parameter storage space, a first storage address, a size of the memory block, an offset corresponding to the first stripe, and a memory occupation size of generation parameters of a single stripe;
[0189] The reading module is further used to read the generation parameters of the first stripe according to the first parameter address.
[0190] Optionally, the acquisition module 1501 is further configured to acquire disk management information in response to a read operation of a stripe consistency check parameter of the first RAID group;
[0191] The disk parameter management device 11500 further includes: reading a first storage address of a first RAID group from the disk management information;
[0192] The determination module is further used to determine a second parameter address corresponding to the stripe consistency check parameter of the first RAID group according to the base address of the parameter storage space, the first storage address, the size of the memory block, and the size of the calculation parameter area;
[0193] The disk parameter management device 11500 further includes: reading a stripe consistency check parameter of the first RAID group according to the second parameter address.
[0194] Optionally, the acquisition module 1501 is further used to acquire bad disk recovery parameters when a bad disk exists in the RAID group;
[0195] The determination module is further used to determine the third parameter address corresponding to the group serial number of the RAID group where the damaged disk appears according to the corresponding relationship between the group serial number of the RAID group and the second storage address;
[0196] The storage module 1502 is further configured to store bad disk recovery parameters according to the third parameter address.
[0197] Optionally, detecting a new first redundant array of independent disks RAID group includes at least one of the following situations: establishing a new first RAID group, or there is a first RAID group with a changed category.
[0198] Optionally, RAID groups whose disk level is RAID 5 are of the same category; and for RAID groups whose disk level is not RAID 5, RAID groups whose disk level and disk quantity are the same are of the same category.
[0199] In summary, the disk parameter management device provided in the embodiment of the present application obtains disk management information, the target disk level and the target disk number of the first RAID group when a new first RAID group is detected. The disk management information records the first storage address of the disk parameters of the stored RAID group and the category of the RAID group. Since the category of the RAID group is divided according to the disk level and the number of disks, and the disk parameters of the RAID groups of the same category are the same, the target disk parameters of the first RAID group can be stored when it is determined that the disk parameters of the RAID group of the same category are not stored according to the target disk level, the target disk number and the disk management information, and then the first storage address of the target disk parameters and the category of the first RAID group are updated to the disk management information. In this technical solution, by dividing the RAID group category according to the disk level and the number of disks, when the disk parameters of the RAID groups of the same category are the same, only one disk parameter is stored for the RAID groups of the same category, thereby avoiding repeated storage of the disk parameters of the RAID groups of the same category, effectively reducing the amount of storage space occupied by the disk parameters, and improving the utilization of the storage space.
[0200] Optional, such as Fig.16 As shown, an embodiment of the present application also provides an electronic device, which includes: a processor 1601, a memory 1602, and a program or instruction stored in the memory 1602 and executable on the processor 1601. When the program or instruction is executed by the processor 1601, each process of the above-mentioned disk parameter management method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0201] It should be noted that the functions of the various components within the electronic device 1600 in the embodiment of the present application can refer to the functions of the corresponding parts within the electronic device 1600 provided in the previous embodiment, and will not be repeated here.
[0202] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned disk parameter management method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0203] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0204] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned disk parameter management method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0205] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0206] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0207] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0208] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for managing disk parameters, characterized in that: The method comprises: In the case of detecting a new first independent redundant array of disks group, obtaining disk management information, a target disk level and a target disk quantity of the first independent redundant array of disks group, the disk management information including: a first storage address of a disk parameter of the independent redundant array of disks group and a category of the independent redundant array of disks group, the category of the independent redundant array of disks group being divided according to the disk level and the disk quantity, and the disk parameters of independent redundant array of disks groups of the same category being the same, and the disk parameters including a check disk generation parameter and / or a stripe consistency check parameter; When it is determined that the disk parameters of an independent redundant array of disks group of the same category are not stored according to the target disk level, the target disk quantity and the disk management information, acquiring the target disk parameters of the first independent redundant array of disks group; storing the target disk parameter and determining a first storage address of the target disk parameter; updating the first storage address of the target disk parameter and the category of the first independent redundant array of disks group into the disk management information; The parameter storage space includes s memory blocks, s is a positive integer, the memory block includes a parameter block and a flag bit, the flag bit indicates whether data is stored in the parameter block; each of the memory blocks is used to store the disk parameters of different types of independent redundant disk array groups, the first storage address in the disk management information is: the offset of the memory block where the disk parameter is located in the parameter storage space; the storing of the target disk parameter and determining the first storage address of the target disk parameter include: storing the target disk parameter in a free memory block in the parameter storage space, determining an offset of the free memory block in the parameter storage space, and obtaining a first storage address of the target disk parameter, wherein the free memory block is a memory block in which the disk parameter is not stored; The step of storing the target disk parameter in a free memory block in the parameter storage space, determining an offset of the free memory block in the parameter storage space, and obtaining a first storage address of the target disk parameter includes: Determining a free memory block in the parameter storage space according to the flag bit of each memory block in the parameter storage space; Storing the target disk parameter in the parameter block in the free memory block, and updating the flag bit of the free memory block; The offset of the free memory block in the parameter storage space is determined to obtain a first storage address of the target disk parameter.
2. The method according to claim 1, characterized in that The method further comprises: Get the total number of configured disks and the set of disk levels for configurable independent redundant array of disks groups; For each disk level in the disk level set, determine the maximum number of categories of independent redundant array of disks groups of the disk level according to the total number of disks, and obtain the total number of categories of the configurable independent redundant array of disks groups; Determine the parameter storage space including s memory blocks, where s is the total number of categories.
3. The method according to claim 1, characterized in that The step of storing the target disk parameter in a free memory block in the parameter storage space, determining an offset of the free memory block in the parameter storage space, and obtaining a first storage address of the target disk parameter includes: When the disk level of the first independent redundant array of disks group is independent redundant array of disks RAID5, writing the target disk parameter into the first memory block in the parameter storage space, and determining that the first storage address of the target disk parameter is 0; When the disk level of the first independent redundant array of disks group is not independent redundant array of disks RAID5, the target disk parameters are stored in the free memory blocks except the first memory block in the parameter storage space, and the offset of the free memory blocks in the parameter storage space is determined.
4. The method according to claim 1, characterized in that The disk management information also includes: the number of independent redundant disk array groups of the same category; the method also includes: When determining the disk parameters of the independent redundant array of disks group having the same category according to the target disk level and the disk management information, adding 1 to the number of independent redundant array of disks groups of the first category in the disk management information, the first category being the category of the first independent redundant array of disks group; The step of updating the first storage address of the target disk parameter and the category of the first independent redundant disk array group to the disk management information includes: The first storage address of the target disk parameter, the category of the first independent redundant array of disks group, and the number 1 of the first category of independent redundant array of disks groups are updated to the disk management information.
5. The method according to claim 4, characterized in that The method comprises: In response to a delete operation on a second independent redundant array of disks group, acquiring the disk management information and a disk level and a number of disks of the second independent redundant array of disks group; According to the disk level and the number of disks of the second independent redundant array of disks group, the number of independent redundant array of disks groups of the second category in the disk management information is reduced by 1 to obtain an updated number of independent redundant array of disks groups of the second category, where the second category is the category of the second independent redundant array of disks group; When the update quantity is 0, a first storage address corresponding to the second category is obtained from the disk management information, the disk parameters in the first storage address are deleted, and all information corresponding to the second category in the disk management information is deleted.
6. The method according to claim 1, characterized in that The parameter block is divided into a calculation parameter area and a recovery parameter area, the calculation parameter area is used to store the check disk generation parameters, and the recovery parameter area is used to store the stripe consistency check parameters; The first independent redundant array of disks group includes a plurality of stripes, and the check disk generation parameters of the first independent redundant array of disks include generation parameters of each stripe in the first independent redundant array of disks group; the method further includes: In response to a read operation of generation parameters of a first stripe in the first independent redundant array of disks group, acquiring an offset of the first stripe in the first independent redundant array of disks group and the disk management information; Reading a first storage address of the first independent redundant array of disks group from the disk management information; Determine a first parameter address corresponding to the first stripe according to a base address of the parameter storage space, the first storage address, a size of the memory block, an offset corresponding to the first stripe, and a memory occupation size of the generation parameter of a single stripe; According to the first parameter address, generation parameters of the first stripe are read.
7. The method according to claim 6, characterized in that The method further comprises: In response to a read operation of the stripe consistency check parameter of the first independent redundant array of disks group, acquiring the disk management information; Reading a first storage address of the first independent redundant array of disks group from the disk management information; Determine a second parameter address corresponding to the stripe consistency check parameter of the first independent redundant array of disks group according to a base address of the parameter storage space, the first storage address, the size of the memory block, and the size of the calculation parameter area; The stripe consistency check parameter of the first independent redundant array of disks group is read according to the second parameter address.
8. The method according to claim 1, characterized in that The method further comprises: When a damaged disk appears in an independent redundant disk array group, obtain the damaged disk recovery parameters; Determine, according to the correspondence between the group serial number of the independent redundant array of disks group and the second storage address, a third parameter address corresponding to the group serial number of the independent redundant array of disks group where the damaged disk occurs; The bad disk recovery parameter is stored according to the third parameter address.
9. The method according to claim 8, characterized in that The detecting of a new first independent redundant array of disks group includes at least one of the following situations: establishing a new first independent redundant array of disks group, and a first independent redundant array of disks group with a changed category.
10. The method according to claim 1, characterized in that Independent redundant disk array groups whose disk level is independent redundant disk array RAID5 are of the same category; and for independent redundant disk array groups whose disk level is not independent redundant disk array RAID5, independent redundant disk array groups with the same disk level and disk quantity are of the same category.
11. A disk parameter management device, characterized in that: The device comprises: an acquisition module, configured to acquire disk management information, a target disk level and a target disk quantity of the first independent redundant disk array group when a new first independent redundant disk array group is detected, wherein the disk management information includes: a first storage address of a disk parameter of the independent redundant disk array group and a category of the independent redundant disk array group, wherein the category of the independent redundant disk array group is divided according to the disk level and the disk quantity, and the disk parameters of independent redundant disk array groups of the same category are the same, and the disk parameters include a check disk generation parameter and / or a stripe consistency check parameter; The acquisition module is further configured to acquire the target disk parameters of the first independent redundant disk array group when it is determined that the disk parameters of the independent redundant disk array group of the same category are not stored according to the target disk level, the target disk quantity and the disk management information; A storage module, used for storing the target disk parameter and determining a first storage address of the target disk parameter; an updating module, configured to update the first storage address of the target disk parameter and the category of the first independent redundant disk array group to the disk management information, The parameter storage space includes s memory blocks, s is a positive integer, the memory block includes a parameter block and a flag bit, the flag bit indicates whether data is stored in the parameter block; each of the memory blocks is used to store the disk parameters of independent redundant disk array groups of different categories, and the storage module is further used to: store the target disk parameters in the free memory blocks in the parameter storage space, determine the offset of the free memory blocks in the parameter storage space, and obtain the first storage address of the target disk parameters, and the free memory blocks are the memory blocks that do not store the disk parameters; Among them, the storage module is also used to: determine the free memory blocks in the parameter storage space according to the flag bit of each memory block in the parameter storage space; store the target disk parameters in the parameter blocks in the free memory blocks and update the flag bits of the free memory blocks; determine the offset of the free memory blocks in the parameter storage space to obtain the first storage address of the target disk parameters.
12. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores instructions, and the processor implements the method according to any one of claims 1 to 10 when executing the instructions.
13. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Redundancy protected method, device and system
CN101571820A
RAID array adaptive configuration method and RAID server
CN115145495A