A method, device, equipment and medium for expanding a redundant array of independent disks

By dividing the redundant array of independent disks into blocks and stripes, determining the type of new disks and performing redirection address mapping and data migration, the problems of large data migration volume and long time in RAID expansion are solved, and efficient expansion is achieved.

CN119690354BActive Publication Date: 2025-10-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411983172.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-29
Publication Date
2025-10-17
Estimated Expiration
2044-12-29

AI Technical Summary

Technical Problem

In the existing technology, when expanding a redundant array of independent disks (RAID), the amount of data migration is large and the expansion time is long, resulting in low efficiency.

Method used

By pre-dividing the independent disk redundant array into blocks and stripes, it is determined whether the new disk type is the same as the target array. If they are the same, a combined virtual array is created after expansion, and address mapping and data migration are performed using redirection to ensure that the number of data blocks and check blocks remains unchanged.

Benefits of technology

The amount of data migration during the expansion process is reduced, the normal performance of the array is maintained, and the expansion efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690354B_ABST
    Figure CN119690354B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and equipment for expanding a redundant array of independent disks and a medium, and relates to the technical field of computers.The method comprises the following steps: when an instruction for adding a new disk to a target array is received, it is determined whether the disk type of the new disk is the same as the disk type of the disks in the target array; the target array is a disk array obtained by performing disk blocking and strip division on a plurality of disks in a redundant array of independent disks in advance; if the disk types are the same, the new disk is combined with the disks in the target array to create a virtual array after expansion; and address mapping and data migration are performed on the strips in the target array and the virtual array after expansion by using a redirection mode, so that the expansion of the redundant array of independent disks is completed.The application can reduce the amount of data migration during the expansion process, ensure that the redundant array of independent disks can still be normally used during the expansion, and improve the expansion efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, in particular to an independent disk redundant array expansion method, device, equipment and medium. BACKGROUND

[0002] Currently, when expanding the standard space-distributed independent disk redundant array (RAID), it is usually achieved through simple mathematical transformation, and the data needs to be copied from the array space G(n) before expansion to the array space G(n+x) after expansion.

[0003] However, the expansion relationship obtained based on mathematical transformation is unchangeable, and with the continuous development of disk technology, the capacity of single disk is increasing, which makes the data volume migrated during the expansion of the standard space-distributed independent disk redundant array increase, thereby causing the time required for expansion to increase. SUMMARY

[0004] Therefore, the purpose of the present application is to provide an independent disk redundant array expansion method, device, equipment and medium, which can reduce the migration amount of data during expansion, ensure that the independent disk redundant array can still be used normally during expansion, and improve the efficiency of expansion. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses an independent disk redundant array expansion method, comprising:

[0006] When receiving an instruction to add a new disk to a target array, it is determined whether the disk type of the new disk is the same as the type of the disk in the target array; the target array is a disk array obtained by performing disk blocking and strip division on a plurality of disks in the independent disk redundant array in advance;

[0007] If the disk type of the new disk is the same as the type of the disk in the target array, the new disk is combined with the disk in the target array to create a virtual array after expansion; the virtual array after expansion has the same number of data blocks and check blocks as the target array;

[0008] The address mapping and data migration of the strips in the target array and the virtual array after expansion are performed by redirection to complete the expansion of the independent disk redundant array.

[0009] Optionally, the independent disk redundant array expansion method of the present application further comprises:

[0010] When it is monitored that a new disk is inserted into the independent disk redundant array, the new disk is added to a preset disk list, and the preset disk list is displayed on the front-end interface;

[0011] When receiving the state ready instruction for the preset disk list sent by the front-end interface, the disk type of the new disk is acquired;

[0012] It is judged whether there is a disk with the same disk type as the new disk in the preset disk list;

[0013] If there is a disk with the same disk type as the new disk in the preset disk list, the new disk is added to the sub-list of the preset disk list with the same disk type;

[0014] Correspondingly, when receiving the instruction of adding the new disk to the target array, it is judged whether the disk type of the new disk is the same as the type of the disk in the target array, comprising:

[0015] When receiving the instruction of adding the new disk in the sub-list of the preset disk list to the target array sent by the front-end interface, it is judged whether the disk type of the new disk is the same as the type of the disk in the target array.

[0016] Optionally, the addresses of the target array and the virtual array after expansion are respectively mapped and the data is migrated by using the redirection mode, comprising:

[0017] The target stripe in the volume partition with different disk addresses in the target array and the virtual array after expansion is determined, and the addresses of each disk partition in the target stripe are mapped with the addresses of the disk partitions in the corresponding stripe in the virtual array after expansion by using the address redirection mode;

[0018] The data in the target stripe in the target array is migrated to the corresponding stripe in the virtual array after expansion by using the data redirection mode.

[0019] Optionally, the data in the target stripe in the target array is migrated to the corresponding stripe in the virtual array after expansion by using the data redirection mode, comprising:

[0020] The numbers of each stripe in the target array are acquired to obtain the stripe numbers;

[0021] The data in each disk partition in the target stripe in the target array is migrated to the disk partition in the corresponding stripe in the virtual array after expansion by using the data redirection mode and based on the size of the stripe numbers.

[0022] Optionally, the method for expanding the Redundant Array of Independent Disks further comprises:

[0023] When receiving the data reading request sent by the user end, the target disk partition to be read is determined;

[0024] According to the address mapping relationship of the disk blocks in the target array and the virtual array after expansion, data in the disk block corresponding to the target disk block is obtained from the target array or the virtual array after expansion to obtain target data, and the target data is returned to the user end.

[0025] Optionally, after the address mapping and data migration of the stripes in the target array and the virtual array after expansion are performed by using the redirection mode, the method further comprises:

[0026] When the data write request sent by the user end is received, the overlapping disk blocks in the target array and the virtual array after expansion which are in an idle state are obtained, and the data to be written is written into the overlapping disk blocks.

[0027] Optionally, the method for expanding the redundant array of independent disks further comprises:

[0028] If the disk type of the new disk is different from the disk type of the disks in the target array, prompt information indicating that the disk types are different is generated, and the prompt information is displayed on the front-end interface.

[0029] When the instruction of adding the new disk to the new array sent by the front-end interface is received, the new array is taken as the target array, and the step of judging whether the disk type of the new disk is the same as the disk type of the disks in the target array is jumped to.

[0030] In a second aspect, the application discloses a device for expanding the redundant array of independent disks, which comprises:

[0031] A judging module is configured to, when an instruction of adding a new disk to a target array is received, judge whether the disk type of the new disk is the same as the disk type of the disks in the target array, wherein the target array is a disk array obtained by performing disk block and stripe division on a plurality of disks in the redundant array of independent disks.

[0032] A combining module is configured to, if the disk type of the new disk is the same as the disk type of the disks in the target array, combine the new disk with the disks in the target array to create a virtual array after expansion, wherein the virtual array after expansion has the same number of data blocks and check blocks as the target array.

[0033] An expanding module is configured to perform address mapping and data migration on the stripes in the target array and the virtual array after expansion by using a redirection mode to complete the expansion of the redundant array of independent disks.

[0034] In a third aspect, the application discloses an electronic device, which comprises a processor and a memory; wherein the processor implements the method for expanding the redundant array of independent disks when executing the computer program saved in the memory.

[0035] In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the foregoing independent disk redundant array expansion method.

[0036] It can be seen that when the present application receives an instruction of adding a new disk to the target array, it is determined whether the disk type of the new disk is the same as the disk type in the target array; the target array is a disk array obtained after disk partitioning and striping of a plurality of disks in the independent disk redundant array; if the disk type of the new disk is the same as the disk type in the target array, the new disk is combined with the disks in the target array to create a virtual array after expansion; the virtual array after expansion has the same number of data blocks and check blocks as the target array; and the address mapping and data migration of the strips in the target array and the virtual array after expansion are performed by using the redirection mode to complete the expansion of the independent disk redundant array. The present application performs disk partitioning and striping on a plurality of virtual disks in the independent disk redundant array in advance, when an instruction of adding a new disk to the target array created in advance is received, it is first determined whether the disk type of the new disk is the same as the disk type in the target array, if they are the same, the new disk is combined with the disks in the target array to create a virtual array after expansion on the basis of the target array, and then the address mapping and data migration of the strips in the target array and the virtual array after expansion are performed by using the redirection mode, the expansion of the independent disk redundant array is performed by the above-mentioned mode, the array space and the volume space can be combined, because the number of data blocks and check blocks before and after expansion is the same, the strip width before and after expansion does not change, so that the standard space distribution after expansion is still met, the volume partitioning of the array and the disk partitioning of the disk can still use a simple linear mapping relationship, no additional metadata space is occupied, in addition, the address mapping and data migration of the strips are performed by using the redirection mode, the amount of data migration during the expansion process is reduced, and the independent disk redundant array can still be normally used during the expansion, so that the influence of the expansion process on the performance of the independent disk redundant array is small, and the efficiency of the expansion is improved. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.

[0038] Figure 1 A flow chart of an independent disk redundant array expansion method disclosed by the present application is provided.

[0039] Figure 2A specific logical volume creation diagram disclosed by the present application;

[0040] Figure 3 A specific virtual array volume partitioning diagram before expansion disclosed by the present application;

[0041] Figure 4 A specific virtual array volume partitioning diagram after expansion disclosed by the present application;

[0042] Figure 5 A specific virtual array volume partitioning diagram before expansion disclosed by the present application;

[0043] Figure 6 A specific virtual array stripe diagram before expansion disclosed by the present application;

[0044] Figure 7 A specific virtual array volume partitioning diagram after expansion disclosed by the present application;

[0045] Figure 8 A specific virtual array stripe diagram after expansion disclosed by the present application;

[0046] Figure 9 A specific virtual array volume partitioning diagram before and after expansion disclosed by the present application;

[0047] Figure 10 A specific Redundant Array of Independent Disks expansion method flow chart disclosed by the present application;

[0048] Figure 11 A specific Redundant Array of Independent Disks expansion device structure diagram disclosed by the present application;

[0049] Figure 12 A specific electronic device structure diagram disclosed by the present application. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0051] The embodiments of the present application disclose a Redundant Array of Independent Disks expansion method, referring to Figure 1 The method comprises the following steps.

[0052] Step S11: When receiving an instruction to add a new disk to a target array, determine whether the disk type of the new disk is the same as the type of the disks in the target array; the target array is a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes.

[0053] It should be noted that before expanding the capacity of the independent disk redundant array, this application pre-creates two components, namely the volume space management component and the array space management component. The volume space management component is used to manage the space of the volume, and the array space management component is used to manage the space of the array.

[0054] Specifically, the volume space management component can divide the array address space into volume blocks (extents) and allocate volume blocks (extents) to volumes when users create volumes. For example, when a user creates a 10GB volume with an extent size of 1GB, the continuous array space address will be split into 1GB blocks. At this time, the volume will contain 10 extents, where the 10 extents contained in the volume can be continuous or discontinuous. See Figure 2 As shown in the figure, when the user creates a volume, discontinuous volume extents are allocated to volume0 and volume1.

[0055] Specifically, the array space management component can combine the disk space into an array space. Specifically, the disk can be divided into blocks to obtain disk blocks (strides), and then the disk blocks (strides) can be combined to divide the disk into n data blocks (such as Figure 3 D in) and m check blocks (such as Figure 3 P) into redundant strips. For details, see Figure 3 As shown, Figure 3 The figure shows the distribution of an array space consisting of 3 data blocks (i.e., n=3), 1 check block (i.e., m=1), and 5 disks (i.e., s=5). The array space contains 5 stripes, and 2 strips correspond to 1 volume extent. In addition, the array space management component can also manage virtual arrays. When the user specifies n, m, and s to create an array, the array space management component will create a corresponding virtual array structure array0, and array0 will be visible to the user to facilitate user operations. In addition, when a new disk is added, the array space management component will expand the array. The array space distribution after expansion is as follows: Figure 4As shown in array1 in the array space, the positions of the data blocks and the check blocks in the array space change, but the length of the extent in array1 is the same as the length of the extent in array0. It can be understood that, because the space structure changes, the disk addresses of the same extent in array1 and array0 are different. Specifically, refer to Figure 5 、 Figure 6 、 Figure 7 and Figure 8 , which respectively show the numbering corresponding to the extent and the strip before and after the expansion of the same RAID, wherein, Figure 5 0, 1, and 2 in array0 before expansion represent the extent numbering corresponding to the array, Figure 6 0, 1, 2, 3, and 4 in array0 before expansion represent the strip numbering corresponding to the array, Figure 7 0, 1, and 2 in array1 after expansion represent the extent numbering corresponding to the array, Figure 8 0, 1, 2, 3, 4, and 5 in array1 after expansion represent the strip numbering corresponding to the array. Through the comparison of the numbering before and after the expansion, it can be known that the extent numbering and the strip numbering corresponding to the same disk block change.

[0056] It should be noted that when the user inserts a new disk into the physical interface of the independent redundant array, the computer automatically scans the interface, thereby identifying the new disk, and when the user needs to expand the independent redundant array, the computer or the like can be instructed to add the new disk to the target array. When the computer or the like receives the expansion instruction for the new disk, the expansion operation is triggered. Specifically, the disk type of the new disk can be obtained by the array space management component, and then the disk type of the new disk is compared with the type of the disk in the target array, and it is determined whether the disk types are the same. The target array is a disk array obtained by performing disk block (stride) and strip (strip) division on a plurality of disks in the independent disk redundant array (i.e., RAID), such as array0 in Figure 3 .

[0057] In the embodiment, before expanding the redundant array of independent disks, the method further includes: when it is monitored that a new disk is inserted into the redundant array of independent disks, adding the new disk into a preset disk list, and displaying the preset disk list on a front-end interface; when a state ready instruction for the preset disk list is received from the front-end interface, obtaining a disk type of the new disk; determining whether there is a disk with the same disk type as the new disk in the preset disk list; and if there is a disk with the same disk type as the new disk in the preset disk list, adding the new disk into a sub-list with the same disk type in the preset disk list. In the embodiment, the computer can automatically scan a physical interface of the redundant array to identify a newly inserted disk of a user, and add the newly inserted disk into a visible disk list of an array space management component, and then display the visible disk list on the front-end interface. Then, when a state ready instruction for the visible disk list is received from the front-end interface, it indicates that all the disks in the visible disk list are in a ready state. At this time, the disks in the ready state in the list can be classified and managed by the array space management component. Specifically, disk information of the newly inserted disk can be obtained first, and then it is determined whether there is a disk with the same type in the visible disk list based on the information. If there is, the newly inserted disk is added into a sub-list of the same disk type. By identifying the disk type and classifying based on the disk type, the disks of the same type can be classified and managed, and the speed of subsequent expansion of the redundant array of independent disks is facilitated.

[0058] Correspondingly, when the instruction of adding the new disk into the target array is received, it is determined whether the disk type of the new disk is the same as the type of the disk in the target array. Specifically, when the instruction of adding the new disk in the sub-list of the preset disk list into the target array is received from the front-end interface, it is determined whether the disk type of the new disk is the same as the type of the disk in the target array. That is, when the instruction of adding the new disk in a certain sub-list of the preset disk list into the specified target array array0 is received from the front-end interface, the expansion operation is triggered, that is, the operation of determining whether the disk type of the new disk is the same as the type of the disk in the target array array0 is triggered.

[0059] Step S12: If the disk type of the new disk is the same as the type of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array. The expanded virtual array has the same number of data blocks and check blocks as the target array.

[0060] In this embodiment, if the disk type of the new disk is the same as the disk type in the target array array0 specified by the user, the new disk is combined with the disks in the target array array0 by the array space management component, thereby creating a virtual array array0 after expansion; the virtual array array1 after expansion has the same number of data blocks (D) and check blocks (P) as the target array array0. By comparing the disk types and combining the disks when the disk types are the same, and by keeping the number of data blocks and check blocks unchanged before and after expansion, i.e., the virtual array array1 uses the same n, m space structure as array0, it can be ensured that the strip width does not change before and after expansion, and only the array width (i.e., s) is increased.

[0061] Step S13: performing address mapping and data migration on the strips in the target array and the virtual array after expansion respectively by using the redirection method, so as to complete the expansion of the redundant array of independent disks.

[0062] In this embodiment, after creating the virtual array array1 after expansion, further, the address mapping is performed on the strips (strip) in the target array array0 and the virtual array array1 after expansion by using the volume space management component and by using the address redirection method, and then the data in the mapped strips (strip) in the target array array0 and the virtual array array1 after expansion is migrated by using the data redirection method, thereby completing the expansion of the redundant array of independent disks (RAID).

[0063] Specifically, performing address mapping and data migration on the strips in the target array and the virtual array after expansion respectively by using the redirection method can include: determining the target strips in the volume blocks with different disk addresses in the target array and the virtual array after expansion from the target array, and mapping the addresses of the disk blocks in the target strips with the addresses of the disk blocks in the corresponding strips in the virtual array after expansion by using the address redirection method; migrating the data in the target strips in the target array to the corresponding strips in the virtual array after expansion by using the data redirection method. In this embodiment, the corresponding extents in the virtual arrays array0 and array1 can be scanned by the volume space management component, and the disk blocks (Stride) with different disk addresses can be determined based on the space distribution of array0 and array1, and the disk blocks (Stride) in the corresponding extents in the two spaces are mapped, i.e., the disk blocks (Stride) in the extents in array0 are mapped to the disk blocks (Stride) in the extents in array1, for example, see Figure 9As shown, the disk blocks in the gray 1 area corresponding bands in the two arrays are mapped by performing address redirection, such as mapping stride 0 in array 0 corresponding to extent 0 to stride 0 in array 1, and mapping stride 5 in array 0 corresponding to extent 0 to stride 6 in array 1; then, the data in the target bands of the target array array 0 is migrated to the corresponding bands in the virtual array array 1 after expansion by using data redirection. By using address redirection and data redirection to map the addresses of the bands in the two virtual arrays (i.e., array 0 and array 1) and migrate the data, and by keeping the band width unchanged, the expansion can be completed to still conform to the standard space distribution, and the array blocks (i.e., volume blocks) and the disk blocks can still use a simple linear mapping relationship without occupying additional metadata space. In addition, the array address space after expansion is still linearly mapped, so that by distinguishing whether the extent is from array 0 or array 1, the old data is mapped by the space distribution of array 0, and the new data is mapped by the space distribution of array 1.

[0064] Specifically, the data in the target bands of the target array is migrated to the corresponding bands in the virtual array after expansion by using data redirection, which can include: obtaining the numbers of the bands in the target array to obtain the band numbers; and migrating the data in the disk blocks in the target bands of the target array to the disk blocks in the corresponding bands in the virtual array after expansion by using data redirection and based on the size of the band numbers. In this embodiment, for extents other than extent 0, such as extent 1, extent 2, etc., the volume space management component can determine whether the extent is preferentially migrated or reallocated according to the distance from the first aligned extent, for example, when the user specifies n, m, s to create an array, s→s+1, and the length of the extent is x (indicating the number of bands in 1 extent) (n+m), for the bands of the extent with mod (s+1) == 0, fewer bands can be migrated, and these bands are preferentially migrated, for example, the bands with mod (s+1) == 0 are preferentially migrated, and the bands with mod (s+1) == 1 are preferentially reallocated. Figure 9 The disk blocks in the gray 2 area corresponding bands are migrated by data redirection. By using data redirection and based on the size of the band numbers to migrate the data, the migration efficiency can be improved, and the amount of data migrated during expansion is reduced, while ensuring that the redundant array of disks can be normally used during expansion, and the performance of the redundant array of disks is less affected, and the expansion speed is much higher than the traditional data copying method.

[0065] It should be noted that in the process of expansion, user access operations such as user data write operation and user data read operation are also involved.

[0066] Specifically, for the user data read operation, the method can include: when receiving the data read request sent by the user end, determining the target disk block to be read; according to the address mapping relationship of each disk block in the target array and the virtual array after expansion, obtaining the data in the disk block corresponding to the target disk block from the target array or the virtual array after expansion to obtain the target data, and returning the target data to the user end. In this embodiment, the volume space management component can determine the address of the extent of the data to be read by the user according to the mapping relationship between the volume and the extent. Since the extent records the array number and the stripe number allocated to its space, the data in the disk block of the corresponding array can be found based on the array number and the stripe number. Specifically, when reading data, the array space management component can send a data read request to the corresponding array based on the array number and the stripe number, so that the array calculates the disk address according to its own space distribution, and reads data based on the calculated disk address. It should be noted that the data read operation can occur before or after expansion.

[0067] When reading the data written before expansion, the data can be read from array0, for example, when the user reads the data extent7 written before expansion, the volume space management component can be used to find the disk block corresponding to extent7 stored in the extent, which is Stride5, and then array0 and Stride5 are sent to the array space management component, so that the array space management component reads the data in Stride5 according to the space distribution of array0, and returns the read data to the user end.

[0068] When reading the data written after expansion, the data can be read from array1, for example, when the user reads the data extent7 written before expansion, the volume space management component can be used to find the disk block corresponding to extent7 stored in the extent, which is Stride6, and then array1 and Stride6 are sent to the array space management component, so that the array space management component reads the data in Stride6 according to the space distribution of array1, and returns the read data to the user end.

[0069] By distinguishing whether the user read data operation occurs before or after the expansion, and reading data from the corresponding virtual array array, the user read data operation can be executed at the same time as the expansion operation. It can be seen that the present scheme has little effect on the performance of the disk redundant array.

[0070] Specifically, for the user write data operation, after address mapping and data migration are performed on the target array and the stripe in the virtual array after expansion by using the redirection method, the method can further include: when receiving the data write request sent by the user end, obtaining the overlapping disk blocks in the target array and the virtual array after expansion which are in an idle state, and writing the data to be written into the overlapping disk blocks. It should be noted that when the user writes data, the extent corresponding to the new data written by the user will only be allocated to the extent in array1. In this embodiment, after address mapping and data migration are performed, when receiving the data write request sent by the user end, the overlapping disk blocks (Stride) in the target array array0 and the virtual array array1 after expansion which are in an idle state are first obtained from the virtual array array1 after expansion, and the data to be written is written into the overlapping disk blocks (Stride). For example, when the data written before expansion corresponds to extent7, and extent7 corresponds to Stride5, extent7 after expansion will be redirected to Stride6 in array1. At this time, when the user writes data to extent7, the array space management component can be used to find the idle StrideX in array1, and StrideX is submitted to the volume space management component; after the volume space management component receives StrideX, it is specified to write data to StrideX in array1. At this time, extent7 can be redirected to StrideX in array1, and Stride6 is marked as an idle state. Then, the array space management component is used to find whether the corresponding StrideX in array1 is in an idle state, and if so, the data to be written is written into StrideX in array1.

[0071] It can be understood that there is an overlap between array1 and the extent in array0, and therefore when allocating the extent in an idle state, not only the address range of the extent in array1 is idle, but also the extent in array0 is in an idle state. However, in actual application, there can be no extent in an idle state in array1, and for this scenario, it can be checked first whether there is an extent in use in array0, if there is an extent in use in array0, the extent in use in array0 is migrated to the extent in array1, at this time, there is an extent in array1 that is idle, then the data to be written is written into the extent in array1 that is idle, in this way, when there is no extent in an idle state in array0, the operation of reading data by the user can be realized. For example, when the array space management component does not find a free StrideX in array1, information of StrideX without an idle state is generated to the volume space management component; then, the volume space management component is used to find an extent containing StrideX in array0, and then a group of aligned StrideX (for example, the 4x6 square in the upper right corner of the figure) is specified to perform data migration, the old data in the group of StrideX is read by the array space management component, and the old data and the new data to be written are combined together according to the space distribution of array1 and written into the group of StrideX, and finally the volume space management component is notified to redirect all the extents corresponding to the group of StrideX to the Stride in array1. Figure 9

[0072] It can be understood that for the write of the user address space, when the new data is written into the extent in array1, the old extent in array1 or array0 is released, and since the extent in array0 is no longer allocated subsequently, the extent in array0 will be finally released completely, at this time, array0 is deleted.

[0073] ​It can be seen that when the instruction of adding the new disk to the target array is received, the embodiment of the application judges whether the disk type of the new disk is same as the disk type of the disks in the target array; the target array is a disk array obtained after disk partitioning and striping of a plurality of disks in the redundant array of independent disks are performed in advance; if the disk type of the new disk is same as the disk type of the disks in the target array, the new disk is combined with the disks in the target array to create a virtual array after expansion; the virtual array after expansion has the same number of data blocks and check blocks as the target array; the address mapping and data migration of the strips in the target array and the virtual array after expansion are performed by using the redirection mode, so as to complete the expansion of the redundant array of independent disks. In the embodiment of the application, the disk partitioning and striping of a plurality of virtual disks in the redundant array of independent disks are performed in advance; when the instruction of adding the new disk to the target array created in advance is received, it is first judged whether the disk type of the new disk is same as the disk type of the disks in the target array; if yes, the new disk is combined with the disks in the target array to create a virtual array after expansion on the basis of the target array; then the address mapping and data migration of the strips in the target array and the virtual array after expansion are performed by using the redirection mode; through the above method, the expansion of the redundant array of independent disks is performed; the array space can be combined with the volume space; because the number of data blocks and check blocks before and after expansion is same, the strip width before and after expansion is not changed, so that the standard space distribution after expansion is still met; the volume partitioning of the array and the disk partitioning of the disk can still use the simple linear mapping relationship, and the metadata space is not additionally occupied; in addition, the address mapping and data migration of the strips are performed by using the redirection mode, so that the data migration amount in the expansion process is reduced, and the redundant array of independent disks can still be normally used during the expansion, the influence of the expansion process on the performance of the redundant array of independent disks is small, and the efficiency of the expansion is improved.

[0074] The embodiment of the application discloses a specific expansion method of a redundant array of independent disks, as shown in Figure 10 The method comprises the following steps.

[0075] In step S21, when the instruction of adding the new disk to the target array is received, it is judged whether the disk type of the new disk is same as the disk type of the disks in the target array; the target array is a disk array obtained after disk partitioning and striping of a plurality of disks in the redundant array of independent disks are performed in advance.

[0076] In step S22, if the disk type of the new disk is same as the disk type of the disks in the target array, the new disk is combined with the disks in the target array to create a virtual array after expansion; the virtual array after expansion has the same number of data blocks and check blocks as the target array.

[0077] Step S23: Address mapping and data migration are performed on the strips in the target array and the expanded virtual array respectively by means of redirection, so as to complete the expansion of the Redundant Array of Independent Disks.

[0078] Step S24: If the disk type of the new disk is different from the disk type in the target array, prompt information of different disk types is generated, and the prompt information is displayed on the front-end interface.

[0079] In this embodiment, if the disk type of the new disk is different from the disk type in the target array array0, prompt information of different disk types is generated, and the prompt information is displayed on the front-end interface.

[0080] Step S25: When receiving the instruction of adding the new disk to the new array sent by the front-end interface, the new array is taken as the target array, and the step of judging whether the disk type of the new disk is the same as the disk type in the target array is performed.

[0081] In this embodiment, when receiving the instruction of adding the new disk to the new array sent by the front-end interface, the new array can be taken as the target array, and the step of judging whether the disk type of the new disk is the same as the disk type in the target array is performed.

[0082] In the above steps S21 to S23, the more specific processing process can refer to the corresponding content disclosed in the foregoing embodiments, and will not be described here.

[0083] It can be seen that, in the embodiment of the application, when the instruction of adding the new disk to the target array is received, it is judged whether the disk type of the new disk is same as the disk type of the disks in the target array, if the disk type of the new disk is same as the disk type of the disks in the target array, the new disk is combined with the disks in the target array to create a virtual array after expansion, and the address mapping and data migration of the stripes in the target array and the virtual array after expansion are performed by using the redirection mode to complete the expansion of the redundant array of independent disks; if the disk type of the new disk is not same as the disk type of the disks in the target array, the prompt information of different disk types is generated, and the prompt information is displayed on the front-end interface, when the instruction of adding the new disk to the new array sent by the front-end interface is received, the new array is taken as the target array, and the step of judging whether the disk type of the new disk is same as the disk type of the disks in the target array is jumped to. In the embodiment of the application, when the disk type of the new disk is not same as the disk type of the disks in the target array specified by the user, the prompt information of different disk types is generated, and when the instruction of adding the new disk to the new array is received, the expansion operation is performed again. It can be seen that, when the expansion is performed, it is detected whether the specified disk and the disk in the array 0 are the same type of disk, and the expansion process is triggered only when the disk types are same. Since the same type of disk has the same characteristics, such as the same data block and the same verification block, it can be ensured that the stripe width is not changed before and after the expansion, the array after the expansion still meets the standard space distribution, and the array block and the disk block can still use the simple linear mapping relationship, without occupying additional metadata space.

[0084] Correspondingly, the embodiment of the application further discloses an expansion device of a redundant array of independent disks, which refers to Figure 11 The device comprises:

[0085] A judging module 11 is configured to judge whether the disk type of the new disk is same as the disk type of the disks in the target array when the instruction of adding the new disk to the target array is received; the target array is a disk array obtained after the disk block and the stripe division of the plurality of disks in the redundant array of independent disks are performed.

[0086] A combining module 12 is configured to combine the new disk with the disks in the target array to create a virtual array after expansion if the disk type of the new disk is same as the disk type of the disks in the target array; the virtual array after expansion has the same number of data blocks and verification blocks as the target array.

[0087] An expansion module 13 is configured to perform the address mapping and data migration of the stripes in the target array and the virtual array after expansion by using the redirection mode to complete the expansion of the redundant array of independent disks.

[0088] The specific workflow of each module can refer to the corresponding content disclosed in the foregoing embodiments, and will not be described here again.

[0089] It can be seen that, in the embodiment of the application, when the instruction of adding a new disk to the target array is received, it is determined whether the disk type of the new disk is the same as the disk type of the disks in the target array; the target array is a disk array obtained after disk partitioning and striping of the plurality of disks in the redundant array of independent disks are performed in advance; if the disk type of the new disk is the same as the disk type of the disks in the target array, the new disk is combined with the disks in the target array to create a virtual array after expansion; the virtual array after expansion has the same number of data blocks and check blocks as the target array; the address mapping and data migration of the strips in the target array and the virtual array after expansion are performed by using the redirection mode, so as to complete the expansion of the redundant array of independent disks. In the embodiment of the application, the disk partitioning and striping of the plurality of virtual disks in the redundant array of independent disks are performed in advance, when the instruction of adding a new disk to the target array created in advance is received, it is first determined whether the disk type of the new disk is the same as the disk type of the disks in the target array, if the same, the new disk is combined with the disks in the target array to create a virtual array after expansion on the basis of the target array, and then the address mapping and data migration of the strips in the target array and the virtual array after expansion are performed by using the redirection mode, so as to complete the expansion of the redundant array of independent disks. By the above method, the array space and the volume space can be combined, because the number of data blocks and check blocks before and after expansion is the same, the strip width before and after expansion is unchanged, so that the standard space distribution after expansion is still met, the volume partitioning of the array and the disk partitioning of the disk can still use the simple linear mapping relationship, and the metadata space is not additionally occupied. In addition, by the redirection mode, the address mapping and data migration of the strips are performed, which can reduce the migration amount of data in the expansion process, and ensure that the redundant array of independent disks can still be normally used during the expansion, so that the influence of the expansion process on the performance of the redundant array of independent disks is small, and the efficiency of the expansion is improved.

[0090] In some specific embodiments, the redundant array of independent disks expansion device can further include:

[0091] The first adding unit is configured to add the new disk to the preset disk list when it is monitored that the new disk is inserted into the redundant array of independent disks;

[0092] The display unit is configured to display the preset disk list on the front-end interface;

[0093] The type obtaining unit is configured to obtain the disk type of the new disk when the state ready instruction for the preset disk list sent by the front-end interface is received;

[0094] The first judging unit is configured to judge whether there is a disk with the same disk type as the new disk in the preset disk list.

[0095] The second adding unit is configured to add the new disk to the sub-list of the preset disk list with the same disk type if there is a disk with the same disk type as the new disk in the preset disk list.

[0096] Correspondingly, the judging module 11 can specifically include:

[0097] The second judging unit is configured to judge whether the disk type of the new disk is the same as the type of the disk in the target array when receiving the instruction of adding the new disk in the sub-list of the preset disk list to the target array sent by the front-end interface.

[0098] In some specific embodiments, the capacity expansion module 13 can specifically include:

[0099] The determining unit is configured to determine the target stripe in the volume partition with different disk addresses in the target array and the virtual array after capacity expansion from the target array.

[0100] The address mapping unit is configured to map the addresses of the disk partitions in the target stripe by using the address redirection manner to the addresses of the disk partitions in the corresponding stripe in the virtual array after capacity expansion.

[0101] The first data migration unit is configured to migrate the data in the target stripe in the target array to the corresponding stripe in the virtual array after capacity expansion by using the data redirection manner.

[0102] In some specific embodiments, the first data migration unit can specifically include:

[0103] The number obtaining unit is configured to obtain the numbers of the stripes in the target array to obtain the stripe numbers.

[0104] The second data migration unit is configured to migrate the data in each disk partition in the target stripe in the target array to the disk partition in the corresponding stripe in the virtual array after capacity expansion by using the data redirection manner and based on the size of the stripe numbers.

[0105] In some specific embodiments, the Redundant Array of Independent Disks capacity expansion device can further include:

[0106] The first partition determining unit is configured to determine the target disk partition to be read when receiving the data reading request sent by the user end.

[0107] The data acquisition unit is configured to acquire data in the target disk block corresponding to the target disk block from the target array or the virtual array after expansion according to an address mapping relationship of each disk block in the target array and the virtual array after expansion, to obtain target data.

[0108] The data return unit is configured to return the target data to the user terminal.

[0109] In some embodiments, the expansion module 13 can further include:

[0110] The second block acquisition unit is configured to acquire, when receiving a data write request sent by the user terminal, overlapping disk blocks in the target array and the virtual array after expansion that are both in an idle state, and write the data to be written into the overlapping disk blocks.

[0111] In some embodiments, the RAID expansion device can further include:

[0112] The prompt information generation unit is configured to generate prompt information of different disk types if the disk type of the new disk is different from the disk type in the target array.

[0113] The information display unit is configured to display the prompt information on the front-end interface.

[0114] The jump unit is configured to, when receiving an instruction of adding the new disk to the new array sent by the front-end interface, take the new array as the target array, and jump to the step of judging whether the disk type of the new disk is the same as the disk type in the target array.

[0115] Further, the embodiments of the present application also disclose an electronic device, Figure 12 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the use range of the present application.

[0116] Figure 12 A structural diagram of an electronic device 20 provided by the embodiments of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the related steps in the RAID expansion method disclosed in any of the preceding embodiments. In addition, the electronic device 20 in the embodiments can be an electronic computer.

[0117] In this embodiment, the power supply 23 is configured to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 is configured to create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which will not be specifically limited herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which will not be specifically limited herein.

[0118] In addition, the memory 22 as a carrier of resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.

[0119] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the independent disk redundant array expansion method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work.

[0120] Further, the present application also discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the foregoing disclosed independent disk redundant array expansion method. For the specific steps of the method, reference can be made to the corresponding content disclosed in the foregoing embodiments, which will not be described here again.

[0121] Further, the present application embodiment also discloses a computer program product comprising computer programs / instructions, which are executed by a processor to implement the steps of the foregoing disclosed independent disk redundant array expansion method.

[0122] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between each embodiment can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the related parts can be referred to the method part.

[0123] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality, without referring to a specific sequence of operations for implementing the functions. The order of various illustrative blocks, modules, circuits, and steps may be re-arranged or otherwise implemented without departing from the spirit of the application, which is defined by the appended claims.

[0124] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0125] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are more especially used for the purpose of distinction from other elements in the specification. Also, the terms "comprise", "include" or "contain" or any other variant thereof are intended to encompass a non-exclusive inclusion, such that processes, methods, articles, or apparatuses that comprise, include, or contain a list of elements are not limited to those elements, but can include other elements not expressly listed or inherent to such processes, methods, articles, or apparatuses. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises, includes, or contains the identified element.

[0126] The above provides a detailed introduction to the independent disk redundancy array expansion method, device, equipment and medium provided by the present application. The principles and implementation modes of the present application are described by specific examples in this paper. The above example is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in view of the above, the content of the specification should not be understood as the limitation of the present application.

Claims

1. A method for expanding a redundant array of independent disks, characterized in that: include: When receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of disks in the target array; the target array is a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes; If the disk type of the new disk is the same as the type of the disk in the target array, combining the new disk with the disk in the target array to create an expanded virtual array; The number of data blocks and check blocks in the expanded virtual array is the same as that in the target array; Address mapping and data migration are performed on the stripes in the target array and the expanded virtual array respectively by means of redirection, so as to complete the expansion of the redundant array of independent disks.

2. The method for expanding redundant array of independent disks according to claim 1, wherein: Also includes: When a new disk is detected to be inserted into the redundant array of independent disks, the new disk is added to a preset disk list, and the preset disk list is displayed on the front-end interface; When receiving a status ready instruction for the preset disk list sent by the front-end interface, obtaining the disk type of the new disk; Determine whether there is a disk of the same type as the new disk in the preset disk list; If there is a disk of the same disk type as the new disk in the preset disk list, adding the new disk to a sublist of the same disk type as the new disk in the preset disk list; Accordingly, when receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of the disks in the target array includes: When receiving an instruction from the front-end interface to add a new disk in a sublist of a preset disk list to a target array, it is determined whether a disk type of the new disk is the same as a type of a disk in the target array.

3. The method for expanding redundant array of independent disks according to claim 1, wherein: The method of performing address mapping and data migration on the stripes in the target array and the expanded virtual array respectively by redirection includes: Determining, from the target array, a target stripe in a volume block having different disk addresses between the target array and the expanded virtual array, and mapping, by means of address redirection, an address of each disk block in the target stripe to an address of a disk block in a corresponding stripe in the expanded virtual array; The data in the target stripe of the target array is migrated to the corresponding stripe in the expanded virtual array by using data redirection.

4. The method for expanding redundant array of independent disks according to claim 3, wherein: The step of migrating the data in the target stripe of the target array to the corresponding stripe in the expanded virtual array by means of data redirection includes: Acquire the number of each stripe located in the target array to obtain a stripe number; By means of data redirection and based on the size of the stripe number, data in each disk block in the target stripe of the target array is migrated to the disk block of the corresponding stripe in the expanded virtual array.

5. The method for expanding redundant array of independent disks according to claim 1, wherein: Also includes: When receiving a data read request from a user, determining a target disk block to be read; According to the address mapping relationship between the target array and the disk blocks in the expanded virtual array, data in the disk blocks corresponding to the target disk blocks are obtained from the target array or the expanded virtual array to obtain target data, and the target data is returned to the user end.

6. The method for expanding redundant array of independent disks according to claim 1, wherein: After performing address mapping and data migration on the target array and the stripes in the expanded virtual array respectively by redirection, the method further includes: When a data write request is received from a user terminal, the redundant disk blocks in both the target array and the redundant disk blocks are obtained from the expanded virtual array, and the data to be written is written into the redundant disk blocks.

7. The method for expanding a redundant array of independent disks according to any one of claims 1 to 6, wherein: Also includes: If the disk type of the new disk is different from the type of the disk in the target array, a prompt message indicating that the disk types are different is generated and the prompt message is displayed on the front-end interface; When receiving the instruction sent by the front-end interface to add the new disk to the new array, the new array is used as the target array, and the process jumps to the step of determining whether the disk type of the new disk is the same as the type of the disk in the target array.

8. A device for expanding redundant array of independent disks, characterized in that: include: a determination module configured to, upon receiving an instruction to add a new disk to a target array, determine whether the disk type of the new disk is the same as the type of disks in the target array; the target array being a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes; a combining module, configured to combine the new disk with the disks in the target array to create an expanded virtual array if the disk type of the new disk is the same as the type of the disks in the target array; The number of data blocks and check blocks in the expanded virtual array is the same as that in the target array; The expansion module is used to perform address mapping and data migration on the stripes in the target array and the expanded virtual array respectively by redirection, so as to complete the expansion of the redundant array of independent disks.

9. An electronic device, characterized in that: The method comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the method for expanding a redundant array of independent disks as claimed in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that Used to store computer programs; wherein, when the computer program is executed by a processor, the method for expanding a redundant array of independent disks according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and device for increasing magnetic disc redundant array redundancy

    CN101587425A

  • Method and device for expanding capacity of independent redundant disk array and medium

    CN112114758A