Method, electronic device, program product for disk mapping
By dividing and mapping hard disk groups in RAID technology, the problem of unconsumed capacity and space waste under various hard disk sizes and types is solved, and more efficient hard disk resource utilization is achieved.
Patent Information
- Application Number
- CN202311008010.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2025-02-18
AI Technical Summary
Existing RAID technology has problems of unconsumed capacity and space when utilizing multiple hard drives of different sizes and types, especially when there are significant size differences between larger and smaller disks.
By dividing multiple disks into multiple groups, dividing these groups into available groups and unavailable groups based on the target RAID type, and then mapping the disk units of the available groups to the unavailable groups, so that the unavailable groups can form the target RAID, thereby Reassemble the disk section to improve resource utilization.
It realizes more efficient use of hard disk resources, reduces unconsumed capacity and space waste, and provides users with more available storage space.
Smart Images

Figure CN119473120A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computers, and more particularly, to a method, an electronic device, and a computer program product for disk mapping. Background Art
[0002] Redundant Array of Independent Disks (RAID) is a technology for data storage that combines multiple independent hard disk drives to provide data redundancy, fault tolerance, and performance optimization. RAID technology is designed to solve the failure and performance bottleneck problems that a single hard disk drive may face. RAID technology is widely used in data centers and enterprise-level storage systems to ensure data reliability and efficiency.
[0003] The storage resources used by the volume or file system can be allocated by the underlying mapping RAID technology called Dynamic Resilience Engine (DRE). When calculating the available space, DRE considers the size of the disk and the RAID type to determine the maximum available space for the user. Summary of the invention
[0004] Embodiments of the present disclosure relate to methods, electronic devices, and computer program products for disk mapping.
[0005] According to a first aspect of the present disclosure, a method for disk mapping is provided. The method includes dividing a plurality of disks into a plurality of groups based on the number and type of the plurality of disks, and dividing the plurality of groups into a set of available groups and a set of unavailable groups based on the type of a target redundant array of independent disks (RAID), wherein the available group indicates that the disk units in the available group can constitute the target RAID, and the unavailable group indicates that the disk units in the unavailable group cannot constitute the target RAID. The method also includes mapping one or more disk units of one or more available groups in the set of available groups to the set of unavailable groups, so that one or more unavailable groups in the set of unavailable groups can constitute the target RAID.
[0006] According to a second aspect of the present disclosure, an electronic device for disk mapping is provided. The electronic device includes at least one processor, and a memory, coupled to the at least one processor and having instructions stored thereon, the instructions causing the electronic device to perform actions when executed by the at least one processor, the actions including dividing the multiple disks into multiple groups based on the number and type of the multiple disks, and dividing the multiple groups into a set of available groups and a set of unavailable groups based on the type of the target redundant array of independent disks RAID, wherein the available group indicates that the disk units in the available group can constitute the target RAID, and the unavailable group indicates that the disk units in the unavailable group cannot constitute the target RAID. The action also includes mapping one or more disk units of one or more available groups in the set of available groups to the set of unavailable groups, so that one or more unavailable groups in the set of unavailable groups can constitute the target RAID.
[0007] According to a third aspect of the present disclosure, there is provided a computer program product, which is tangibly stored on a non-volatile computer-readable medium and includes machine-executable instructions, which when executed cause a machine to perform the steps of the method implemented in the first aspect of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like elements throughout the exemplary embodiments of the present disclosure.
[0009] Figure 1 Schematic diagrams showing examples in which the devices and / or methods of embodiments of the present disclosure may be implemented;
[0010] Figure 2 A flowchart of a method for disk mapping of a storage system according to an embodiment of the present disclosure is shown;
[0011] Figure 3 A schematic diagram of a storage system for grouping disks of different types of capacities according to some embodiments of the present disclosure is shown;
[0012] Figure 4a A schematic diagram for splitting some of the multiple groups associated with some embodiments of the present disclosure is shown;
[0013] Figure 4b A schematic diagram for splitting some groups among a plurality of groups according to some embodiments of the present disclosure is shown;
[0014] Figure 5 A schematic diagram for mapping some groups of a plurality of groups according to some embodiments of the present disclosure is shown;
[0015] Figure 6 A schematic diagram for mapping some groups of a plurality of groups according to some embodiments of the present disclosure is shown;
[0016] Figure 7 A schematic block diagram of an example device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0018] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0019] In technical solutions for data storage such as RAID, there is usually unconsumed capacity, which is caused by the presence of fewer larger drives than the minimum width requirement. Therefore, such a calculation method has some disadvantages, such as when a user selects a RAID configuration that requires a larger width, but the number of larger disks is less than the minimum width requirement, more capacity will be unconsumed. In addition, when there is a significant size difference between the larger and smaller disks, a lot of space will be wasted. This unused space cannot be utilized by the user, resulting in unnecessary expenses.
[0020] At least to solve the above and other potential problems, an embodiment of the present disclosure provides a method for disk mapping. The method includes dividing the multiple disks into multiple groups based on the number and type of the multiple disks, and dividing the multiple groups into a set of available groups and a set of unavailable groups based on the type of the target redundant array of independent disks (RAID), wherein the available group indicates that the disk units in the available group can constitute the target RAID, and the unavailable group indicates that the disk units in the unavailable group cannot constitute the target RAID. The method also includes mapping one or more disk units of one or more available groups in the set of available groups to the set of unavailable groups, so that one or more unavailable groups in the set of unavailable groups can constitute the target RAID. By using the method implemented by the present disclosure, the disk portion can be reassembled based on the current physical disk layout, providing users with more opportunities to utilize the non-effective capacity portion of the disk, and improving the utilization rate of disk resources.
[0021] The basic principles and several exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Figure 1 FIG. 1 is a schematic diagram of a disk-based storage system 100 according to an embodiment of the present disclosure. It should be understood that Figure 1 The number and arrangement of components, elements, and disks shown are only examples, and the schematic diagram may include components, elements, and disks of different numbers and arrangements, as well as various additional elements. It should be understood that the above examples are only used to illustrate the disk-based storage system 100. With the development of technology, the disk-based storage system 100 may include various known or unknown magnetic disks, mechanical hard disks, solid-state hard disks, hybrid hard disks, external hard disks, SAS hard disks, RAID storage arrays, optical disks, floppy disks, etc., which are used in various fields and aspects, and the present disclosure does not impose any limitation on this.
[0022] like Figure 1 As shown, a storage system 100 such as RAID is composed of multiple disks 101-1 to 101-n of different types and capacities. The disks 101-1 to 101-n can be logically divided into multiple disk spaces, such as disk spaces 102 to 110, etc. In order to form a RAID, the effective available capacity of the disk space that a user can use depends on the capacity that each drive / disk can consume and the minimum width / number of disks required for the RAID configuration.
[0023] If the user uses disks of different sizes / capacities to create a pool, some unused disk space may be generated, such as disk space 110 in the context of RAID 5 (4+1) as an example. In contrast, disk spaces 102, 104, 106 are effective capacity (ecap) that can be used to form RAID 5. If the effective capacity portion 102 to 106 contains enough disks, even if some disks are deleted, as long as the number of remaining disks always exceeds the minimum number required to build a RAID, they will remain classified as such. If the removed disks are added / mapped to the non-effective capacity (non-ecap) portion 110 and the requirements for forming a RAID are met, the non-effective capacity portion 110 will become an ecap portion and can be used by the user, thereby increasing the available capacity.
[0024] As an example, a storage system 100 such as a RAID can be installed in any computing device that has processing computing resources or storage resources. For example, a computing device can have common capabilities such as receiving and sending data requests, real-time data analysis, local data storage, and real-time network connection. Computing devices can generally include various types of devices. Examples of computing devices may include, but are not limited to: database servers, rack servers, server clusters, blade servers, enterprise-level servers, application servers, desktop computers, notebook computers, smart phones, wearable devices, security equipment, smart manufacturing equipment, smart home equipment, Internet of Things equipment, smart cars, drones, etc., and the present disclosure does not impose any restrictions on this.
[0025] Combined with the above Figure 1 A schematic diagram of the architecture of a storage system in which the method and / or process according to an embodiment of the present disclosure can be implemented is described below. Figure 2 The flowchart of the method 200 for disk mapping of the storage system according to the embodiment of the present disclosure is described. As described above for the storage system, the method 200 for disk mapping according to the embodiment of the present disclosure can be executed at an edge device with computing capabilities, or at a cloud server, and the present disclosure does not limit this. In order to more effectively realize the utilization of non-effective capacity disk space, the method 200 for disk mapping according to the embodiment of the present disclosure is proposed.
[0026] At block 201, the plurality of disks are divided into a plurality of groups based on the number and type of the plurality of disks. According to an embodiment of the present disclosure, in order to obtain the corresponding plurality of groups, the storage system may first divide the plurality of disks into a first number of first type disks having a first capacity, a second number of second type disks having a second capacity, and a third number of third type disks having a third capacity, etc., based on the capacities of the plurality of disks in the storage system.
[0027] For example, in a storage system, there may be n types of disks, and the size / capacity of each type of disk in these disks may be S1, S2, S3...Sn (S1>S2>S3...>Sn). In some embodiments, the number of each type of disk in these disks may be N1, N2, N3...Nn. As an example, a storage system may have a first type of disk with a capacity of S1 and a number of N1, a second type of disk with a capacity of S2 and a number of N2, a third type of disk with a capacity of S3 and a number of N3, and an nth type of disk with a capacity of Sn and a number of Nn, where S i Indicates the capacity / size of a disk, and N i Indicates the number of disks of one type.
[0028] The storage system can then set up groups based on these n types of disks. For example, the first group can be set up to consist of disk unit DUs with a capacity of S1-S2 and a number of N1. In an embodiment of the present disclosure, the disk unit DU is a data structure representing a portion of a physical disk. Similarly, the second group can be set up to consist of disk unit DUs with a capacity of S2-S3 and a number of N1+N2. By analogy, the nth group can be set up to consist of disk unit DUs with a capacity of Sn and a number of N1+N2+…+Nn. In other words, a group can be a collection of disk unit DUs.
[0029] In this way, disk units of different levels can be located through different groups. In the above manner, n groups Group1, Group2, Group3, ... Groupn can be obtained in n different types of disks. Additionally or alternatively, in some embodiments, each group may also have the attributes or data structure shown in Table 1 below.
[0030]
[0031] Table 1 Group attributes
[0032] Wherein, ID represents the identifier or identification number of the group, DU represents the disk unit object, length represents the number of disk units included in the group, and capacity represents the logical disk capacity of the disk unit.
[0033] Additionally or alternatively, in some embodiments, the disk unit DU of the disk representing the partition may also have the attributes or data structure shown in Table 2 below.
[0034]
[0035] Table 2 Properties of disk unit
[0036] Wherein ID represents the identifier or identification number of the disk unit object, Physical_disk represents the disk identifier of the physical disk where the disk unit object is located, and Group_ID represents the group identifier of the group where the disk unit object is located. According to some embodiments of the present disclosure, the capacity of (multiple) DUs in a group is always the same and comes from different physical disks.
[0037] It should be understood that when a storage system has only one type of disk to create a pool, there may be no non-consumable capacity. In the context of the present disclosure, a system with different types of disks is considered. It should also be understood that in a storage system composed of different types of disks, the non-consumable portion is always located in the larger disk, because the excess portion is not enough to create a small RAID and cannot provide protection for user data.
[0038] At box 204, based on the type of the target redundant array of independent disks (RAID), the multiple groups are divided into a set of available groups and a set of unavailable groups, where the available groups indicate that the disk units in the available groups can form the target RAID, and the unavailable groups indicate that the disk units in the unavailable groups cannot form the target RAID. According to an embodiment of the present disclosure, the storage system may first determine the type of the target RAID to be formed, and the minimum number of disks required to form different types of target RAIDs is different. If a user creates a pool / storage system of a specified RAID type, and its RAID width (for example, the number of disks that can be read or written concurrently at the same time) is X, then the minimum predetermined number of disks R can be obtained. min , the process can be expressed by the following formula:
[0039] R min =X+a(a is number of spare disks) (1)
[0040] Where R min is the minimum number of disks required to compose / build the target RAID when the target RAID type is specified, and a is the number of spare disks.
[0041] According to an embodiment of the present disclosure, as an example, the storage system may then compare the length of each group in the previous plurality of groups (the number of disk units included in each group) with the minimum predetermined number of disks R. min Compare and judge respectively, the process can be expressed by the following formula:
[0042] Group.length <R min (2)
[0043] Group.length represents the length of one of the multiple groups, that is, the number of disk units included in the group.
[0044] According to an embodiment of the present disclosure, as an example, if the number of disk units of a group is greater than or equal to the minimum predetermined number of disks R min , it means that the disk units in the group can form a target RAID independently, and the group can be further identified as an available group. In some embodiments, multiple available groups can form a set of available groups, and the set of available groups can also be represented as an effective capacity list ecap_list=[G 1′ , G 2′ , G 3′ ....] where G 1′ , G 2′ , G 3′ ....can represent the first available group, the second available group, the third available group, etc. respectively.
[0045] According to an embodiment of the present disclosure, as an example, if the number of disk units of a group is less than the minimum predetermined number of disks R min , it means that the disk units in the group cannot form a target RAID alone, and the group can be further identified as an unavailable group. In some embodiments, multiple unavailable groups can form a set of unavailable groups, and the set of unavailable groups can also be represented as a non-effective capacity list non_ecap-list = [G1, G2, G3....], where G1, G2, G3.... can represent the first unavailable group, the second unavailable group, the third unavailable group, etc. respectively.
[0046] At block 208, one or more unavailable groups in the set of unavailable groups are enabled to form a target RAID by mapping one or more disk units of one or more available groups in the set of available groups to the set of unavailable groups. According to an embodiment of the present disclosure, as an example, an unavailable group from the set of unavailable groups can be represented as "Gi".
[0047] According to an embodiment of the present disclosure, as an example, in order to map an available group "Ga" from a set of available groups to an unavailable group "Gi" so that the capacity of the unavailable group "Gi" can be used to form a target RAID, the storage system needs to meet the following conditions during the mapping process: 1. The DU capacity of the available group Ga needs to be greater than or equal to the capacity of the DU in the unavailable group Gi; 2. The physical disks of the moved DUs cannot be the same, because the disks of the RAID should come from different physical disks; 3. The length of the available group Ga after the move should be greater than or equal to R min .
[0048] According to some embodiments of the present disclosure, for condition 1, if the DU capacity G of the available group Ga is a .capacity is equal to the capacity G of the DU in the unavailable group Gi a .capacity (i.e., Ga capacity = G i .capacity), the storage system may check whether other conditions (e.g., condition 2 and condition 3) are satisfied. According to some embodiments of the present disclosure, for condition 1, if the DU capacity G of the available group Ga is a capacity is greater than the capacity G of the DU in the unavailable group Gi a .capacity (i.e., G a .capacity>G i .capacity), the available group Ga can be further split so that the DU capacity of the split available group G is the same as the capacity of the DU in the unavailable group Gi.
[0049] According to some embodiments of the present disclosure, for condition 2, when choosing to map (multiple) DUs from the available group Ga to the unavailable group Gi, it is necessary to ensure that the physical disks of the DUs to be mapped are different from the physical disks of the unavailable group Gi, so that the DUs constituting the RAID come from different physical disks, thereby achieving redundant backup.
[0050] According to some embodiments of the present disclosure, for condition 3, if G a .length-R min ≥R min -G i .length, then the selected (R min -G i ·length) DUs are moved to the unavailable group Gi. On the contrary, if G a .length-R min ≥R min -G i If .length is not true, it means that no group has enough DUs available. After mapping, there are still unconsumable DUs, so DU mapping will not occur.
[0051] Additionally or alternatively, in some embodiments, before mapping the disk unit (s) DU in the available group Ga to the unavailable group Gi, the total available capacity C of the multiple groups currently including the available group Ga and the unavailable group Gi is calculated. This process can be represented by the following formula:
[0052]
[0053] Among them G k Indicates that the length of the group is greater than R min a is the number of spare disks, D_D is the number of data drives in the RAID, and X is the RAID width.
[0054] In some embodiments, the total available capacity C of the new plurality of groups after the mapping is completed may also be calculated. new , the process can be expressed by the following formula:
[0055]
[0056] Where G' k Represents a group among all new multiple groups.
[0057] If C new If it is greater than C, it means that there is more capacity available in the current storage system. Therefore, the disks can be mapped / reorganized into new groups to obtain more available space. Additionally or alternatively, in some embodiments of the present disclosure, the mapping of disk unit DU can be achieved by changing the group identifier in (multiple) disk unit DUs.
[0058] Figure 3 FIG. 3 is a schematic diagram of a storage system 300 for grouping disks of different types of capacities according to some embodiments of the present disclosure. Figure 3 As shown, there may be n disks of different capacities in the storage system 300. As an example, in the storage system 300 there are N1 disks of capacity S1, N2 disks of capacity S2, N3 disks of capacity S3, ... and Nn disks of capacity Sn.
[0059] Accordingly, these disks can be divided into multiple parts. Based on n types of disks, it can be divided into n hierarchical parts, such as the first layer 302, the second layer 304, ... and the nth layer 306, etc. These hierarchical parts can be called "groups" and have disk units of different numbers and capacities. As an example, the first layer / first group 302 can be composed of disk units with a number of N1 and a capacity of S1-S2, the second layer / second group 304 can be composed of disk units with a number of N1+N2 and a capacity of S2-S3, ..., the nth layer / nth group 306 can be composed of disk units with a number of N1+N2+...+Nn and a capacity of Sn. Therefore, disks of multiple different types of capacities can be divided into different groups by the method disclosed in the present invention.
[0060] Figure 4a 4 shows a schematic diagram for splitting some of the multiple groups 400a associated with some embodiments of the present disclosure. Figure 4aAs shown, in some embodiments, the disk units of one or more available groups in the set of available groups can be split so that the capacity of the split disk units is the same as that of the disk units in the unavailable group, thereby realizing the mapping of the disk units. As an example, there can be a group 401a and some disk unit DUs, such as 403a. The disk unit DU can reduce some of its capacity so that the reduced part can be used by the destination group (unavailable group). The reduced value is equal to the capacity of the disk unit DU in the destination group, so that the capacity of the DU in the destination group can be kept the same. If only the capacity of the disk unit DU 403a in the group 401a is reduced, it may cause the source group (available group) to have disk unit DUs of different capacities, such as 405a.
[0061] In order to keep the disk unit capacities in a group the same, a method for splitting some groups according to some embodiments of the present disclosure is proposed. Figure 4b A schematic diagram 400b for splitting some groups among a plurality of groups according to some embodiments of the present disclosure is shown.
[0062] like Figure 4b As shown, the source group (available group) 401b can be split into groups G with the same disk unit capacity as the destination group (unavailable group). a 405b and another group G' a 407b. Group G a Disk units in 405b, such as disk unit 403b, can then be moved / mapped to a destination group. Another group G' a The capacity of the disk unit in 407b is equal to the difference between the capacity of the disk unit of the source group and the capacity of the disk unit of the destination group, and the other group G' a 407b can continue to be used to form the target RAID because the number of disk units therein is greater than or equal to R min In this way, more efficient utilization of the entire disk space can be achieved.
[0063] Figure 5 A schematic diagram for mapping some of the multiple groups according to some embodiments of the present disclosure is shown. As an example, one or more disk units in the available groups from different physical disks can be mapped to one or more unavailable groups, so that the one or more unavailable groups can have the disk units required to form a RAID, and finally achieve efficient use of disk space. Figure 5As shown, as an example, a storage system 500 may include multiple physical disks 501, 502, 503, 504, 505, 506, 507, and these physical disks may be further divided into two groups 510 and 512. Group 510 may include disk units 501a, 502a, 503a, 504a, 505a, 506a, 507a, and group 512 may include disk units 501b, 502b, 503b, 504b, 505b, 506b, 507b.
[0064] Disk units 501a, 502a, 503a, 504a, 505a correspond to 501b, 502b, 503b, 504b, 505b, respectively, and are from the same physical disk. If a RAID of RAID type 5 (4+1) is to be formed, disk units 506a and 507a in group 510 can be mapped to group 512, but disk units 501a, 502a, 503a, 504a, 505a cannot be mapped to group 512, because according to the embodiments of the present disclosure, it must be ensured that each disk unit in the RAID group comes from a different physical disk.
[0065] Figure 6 FIG. 2 shows a schematic diagram for mapping some groups in a plurality of groups according to some embodiments of the present disclosure. Figure 6 As shown, as an example, a storage system 600 may include a plurality of physical disks 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, with a total of 10 disks. The capacity of the physical disks 601, 602, 603, 604 may be 700 GB, and the capacity of the physical disks 605, 606, 607, 608, 609, 610 may be 350 GB. These plurality of physical disks 601 to 610 may be further initialized into two groups G1 615 and G2 620.
[0066] In group G1 615, the ID may be G1, and may include group units 601a, 602a, 603a, 604a, 605a, 606a, 607a, 608a, 609a, 610a. The length of group G1 615 is 10 and the capacity is 350GB. As an example, the ID of group unit 601a may be DU 1, the physical disk is D1, and the Group_ID is G1, the ID of group unit 602a may be DU 2, the physical disk is D2, and the Group_ID is G1... The ID of group unit 610a may be DU 10, the physical disk is D10, and the Group_ID is G1. Similarly, in group G2 620, the ID may be G2, and may include group units 601b, 602b, 603b, 604b. The length of group G2 620 is 4 and the capacity is 350GB. As an example, the ID of the group unit 601b may be DU 11, the physical disk may be D1, and the Group_ID may be G2, ... the ID of the group unit 604b may be DU 14, the physical disk may be D4, and the Group_ID may be G2.
[0067] To create a RAID 5(4+1) pool, you can perform the corresponding mapping operation. The total consumable space before mapping is And R min =4+1+1=6. Since the length of group G1615 is 10 and greater than R min , so group G1 615 can be classified into the set of available groups, ie, ecap_list = [G1]. Since the length of group G2 620 is 4 and smaller than R min Therefore, group G2620 can be classified into the set of unavailable groups, that is, non_ecap_list = [G2].
[0068] Through detection, the following conditions for group G1 615 and group G2 620 can be found: first, according to an embodiment of the present disclosure, the capacity of the disk units in the one or more available groups to be mapped needs to be greater than or equal to the capacity of the disk units in the unavailable group. In this example, the capacity of the available group is the same as the capacity of the two unavailable groups, that is, G1.capacity=G2.capacity; second, the physical disks where the disk units in the one or more available groups to be mapped are located are different from the physical disks where the disk units in the available groups are located. All disk units selected to be mapped can be disk units 605a, 606a, 607a, 608a, 609a, 610a from physical disks 605 to 610, which are different from the physical disks 601 to 605 where the unavailable group is located; and, the number of disks in the one or more available groups to be mapped is greater than or equal to the minimum predetermined number of disks after mapping. As an example, in the present disclosure, the capacity of the two groups satisfies G1.length-R min =4, Rmin -G2.length=2G1.length-R min >R min - G2.length, so two disk units can be randomly selected from disk units 605a to 610a to be mapped from group G1 to group G2. As an example, in an embodiment of the present disclosure, the two disk units to be mapped may be disk units 609a and 610a.
[0069] Additionally or alternatively, one or more available groups in the set of available groups may be mapped to the set of unavailable groups based on determining that the sum of the capacities of the mapped multiple groups is greater than the capacities of the multiple groups before mapping. The attributes of the mapped groups may also be changed accordingly. For example, the attributes of the mapped group G1 615 may be ID: G1, the group units include 601a, 602a, 603a, 604a, 605a, 606a, 607a, 608a, the length of group G1 is 8, and the capacity is 350GB. The attributes of the mapped group G2 615 may be ID: G2, and may include group units 609a, 610a, 601b, 602b, 603b, 604b, the length of group G2 620 is 6 and the capacity is 350GB. The total consumable capacity after mapping may be recalculated by the following formula:
[0070]
[0071] The above formula shows that compared with the available capacity before mapping, more available capacity can be obtained after mapping, such as 840 (3360-2520) GB. In this way, the above mapping method can realize the reassembly and more efficient use of the physical disk, thereby improving the utilization rate of the disk resources, and finally reducing the unavailable space in the physical disk as much as possible or eliminating it.
[0072] Figure 7 A schematic block diagram of an example device 700 that may be used to implement embodiments of the present disclosure is shown. Figure 1 The computing device in the device 700 can be implemented by using the device 700. As shown in the figure, the device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 702 or computer program instructions loaded from a storage unit 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the storage device 700 can also be included. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 404. An input / output (I / O) interface 705 is also connected to the bus 704.
[0073] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage page 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0074] The various processes and processing described above, such as method 200, may be performed by processing unit 701. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by CPU 701, one or more actions of method 200 described above may be performed.
[0075] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0076] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0077] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0078] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0079] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0080] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0081] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0082] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0083] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for disk mapping, the method comprising: dividing the plurality of disks into a plurality of groups based on the number and type of the plurality of disks; Based on the type of target Redundant Array of Independent Disks (RAID), the multiple groups are divided into a set of available groups and a set of unavailable groups, wherein the available group indicates that the disk units in the available group can constitute the target RAID, and the unavailable group indicates that the disk units in the unavailable group cannot constitute the target RAID; as well as By mapping one or more disk units of one or more available groups in the set of available groups to the set of unavailable groups, one or more unavailable groups in the set of unavailable groups are enabled to form the target RAID.
2. The method according to claim 1, wherein mapping the one or more disk units of the one or more available groups in the set of available groups to the set of unavailable groups satisfies the following conditions: The capacity of the disk units in the one or more available groups to be mapped is greater than or equal to the capacity of the disk units in the unavailable group; The physical disk where the disk units in the one or more available groups to be mapped are located is different from the physical disk where the disk units in the available groups are located; or The number of disks of the one or more available groups to be mapped is greater than or equal to a minimum predetermined number of disks after mapping, wherein the minimum predetermined number of disks is a number required to form the target RAID.
3. The method according to claim 1, dividing the plurality of disks into the plurality of groups based on the number and type of the plurality of disks comprises: dividing the plurality of disks into a first number of first-type disks having a first capacity, a second number of second-type disks having a second capacity, and a third number of third-type disks having a third capacity based on capacities of the plurality of disks; setting the number of disk units in the first group to the first number, and setting the capacity of each disk unit in the first group to the first capacity minus the second capacity; as well as The number of disk units in the second group is set to the first number plus the second number, and the capacity of each disk unit in the second group is set to the second capacity minus the third capacity.
4. The method according to claim 2, wherein dividing the plurality of groups into a set of available groups and a set of unavailable groups based on the type of the target RAID further comprises: identifying one of the plurality of groups as an available group based on the number of disk units of the one of the plurality of groups being greater than or equal to the minimum predetermined number of disks; as well as Based on the number of disk units of one of the plurality of groups being less than the minimum predetermined number of disks, the one of the plurality of groups is identified as an unavailable group.
5. The method according to claim 2, further comprising: Based on the fact that the capacity of the disk unit in the available group to be mapped is greater than the capacity of the disk unit in the unavailable group, the capacity of the disk unit in the available group to be mapped is split to be the same as the capacity of the disk unit in the unavailable group.
6. The method according to claim 2, further comprising: Based on the fact that the capacity of the disk unit in the available group to be mapped is equal to the capacity of the disk unit in the unavailable group, other conditions among the conditions continue to be detected.
7. The method according to claim 1, wherein mapping the one or more available groups in the set of available groups to the set of unavailable groups further comprises: comparing a sum of the capacities of the plurality of groups after mapping with a sum of the capacities of the plurality of groups before mapping; as well as According to determining that the sum of the capacities of the plurality of groups after mapping is greater than the capacities of the plurality of groups before mapping, the one or more available groups in the set of available groups are mapped to the set of unavailable groups. 8 . The method according to claim 1 , wherein the disk units of each of the plurality of groups have the same capacity and are from different physical disks.
9. The method of claim 1, wherein the disk unit has a physical disk identifier and a group identifier, and The disk unit is mapped based on the physical disk identifier and the group identifier.
10. An electronic device, comprising: processor; as well as A memory is coupled to the processor and stores instructions that, when executed by the processor, cause the device to perform the following actions: dividing the plurality of disks into a plurality of groups based on the number and type of the plurality of disks; Based on the type of target Redundant Array of Independent Disks (RAID), the multiple groups are divided into a set of available groups and a set of unavailable groups, wherein the available group indicates that the disk units in the available group can constitute the target RAID, and the unavailable group indicates that the disk units in the unavailable group cannot constitute the target RAID; as well as By mapping one or more disk units of one or more available groups in the set of available groups to the set of unavailable groups, one or more unavailable groups in the set of unavailable groups are enabled to form the target RAID.
11. The electronic device according to claim 10, wherein mapping the one or more disk units of the one or more available groups in the set of available groups to the set of unavailable groups satisfies the following conditions: The capacity of the disk units in the one or more available groups to be mapped is greater than or equal to the capacity of the disk units in the unavailable group; The physical disk where the disk units in the one or more available groups to be mapped are located is different from the physical disk where the disk units in the available groups are located; and The number of disks of the one or more available groups to be mapped is greater than or equal to a minimum predetermined number of disks after mapping, wherein the minimum predetermined number of disks is a number required to form the target RAID.
12. The electronic device according to claim 10, wherein dividing the plurality of disks into the plurality of groups based on the number and type of the plurality of disks comprises: dividing the plurality of disks into a first number of first-type disks having a first capacity, a second number of second-type disks having a second capacity, and a third number of third-type disks having a third capacity based on capacities of the plurality of disks; setting the number of disk units in the first group to the first number, and setting the capacity of each disk unit in the first group to the first capacity minus the second capacity; as well as The number of disk units in the second group is set to the first number plus the second number, and the capacity of each disk unit in the second group is set to the second capacity minus the third capacity.
13. The electronic device according to claim 11, wherein dividing the plurality of groups into a set of available groups and a set of unavailable groups based on the type of the target RAID further comprises: identifying one of the plurality of groups as an available group based on the number of disk units of the one of the plurality of groups being greater than or equal to the minimum predetermined number of disks; as well as Based on the number of disk units of one of the plurality of groups being less than the minimum predetermined number of disks, the one of the plurality of groups is identified as an unavailable group.
14. The electronic device according to claim 11, further comprising: Based on the fact that the capacity of the disk unit in the available group to be mapped is greater than the capacity of the disk unit in the unavailable group, the capacity of the disk unit in the available group to be mapped is split to be the same as the capacity of the disk unit in the unavailable group.
15. The electronic device according to claim 11, further comprising: Based on the fact that the capacity of the disk unit in the available group to be mapped is equal to the capacity of the disk unit in the unavailable group, other conditions among the conditions continue to be detected.
16. The electronic device according to claim 10, wherein mapping the one or more available groups in the set of available groups to the set of unavailable groups further comprises: comparing a sum of the capacities of the plurality of groups after mapping with a sum of the capacities of the plurality of groups before mapping; as well as Based on the sum of the capacities of the mapped groups being greater than the capacities of the groups before mapping, the one or more available groups in the set of available groups are mapped to the set of unavailable groups. 17 . The electronic device according to claim 10 , wherein the disk units of each of the plurality of groups have the same capacity and are from different physical disks.
18. The electronic device according to claim 10, wherein the disk unit has a physical disk identifier and a group identifier, and The disk unit is mapped based on the physical disk identifier and the group identifier.
19. A computer program product tangibly stored on a non-transitory computer readable storage medium and comprising computer executable instructions that, when executed, cause a computer to: dividing the plurality of disks into a plurality of groups based on the number and type of the plurality of disks; Based on the type of target Redundant Array of Independent Disks (RAID), the multiple groups are divided into a set of available groups and a set of unavailable groups, wherein the available groups indicate that the disk units in the available groups can constitute the target RAID, and the unavailable groups indicate that the disk units in the unavailable groups cannot constitute the target RAID; and By mapping one or more disk units of one or more available groups in the set of available groups to the set of unavailable groups, one or more unavailable groups in the set of unavailable groups are enabled to form the target RAID.
20. The computer program product according to claim 19, wherein mapping the one or more disk units of the one or more available groups in the set of available groups to the set of unavailable groups satisfies the following condition: The capacity of the disk units in the one or more available groups to be mapped is greater than or equal to the capacity of the disk units in the unavailable group; The physical disk where the disk units in the one or more available groups to be mapped are located is different from the physical disk where the disk units in the available groups are located; and The number of disks of the one or more available groups to be mapped is greater than or equal to a minimum predetermined number of disks after mapping, wherein the minimum predetermined number of disks is a number required to form the target RAID.