Resource allocation method and device, computer equipment and storage medium

Through the automated storage resource allocation method, storage resources are allocated to each volume according to the storage resource information and policies of the volume group, which solves the problem of tedious manual settings, improves the allocation efficiency and utilization of storage resources, and ensures the real-time performance of the system. performance and responsiveness.

CN118860643APending Publication Date: 2024-10-29ZHENGZHOU INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410883969.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

In the prior art, manually setting the IOPS and bandwidth values ​​of a volume to allocate storage resources is cumbersome and inefficient.

Method used

By obtaining the storage resource information and resource allocation strategy of the volume group, it automatically allocates storage resources to each volume, adopts average allocation and dynamic allocation strategies, and dynamically adjusts storage resource allocation based on the usage status and historical data of the volume.

Benefits of technology

It improves the allocation efficiency and utilization of storage resources, ensuring that high-priority volumes obtain more resources and low-priority volumes obtain fewer resources, improving the real-time and responsiveness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860643A_ABST
    Figure CN118860643A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of distributed storage, and discloses a resource allocation method and device, computer equipment and a storage medium, and the method comprises the steps: for any volume group, obtaining storage resource information and a resource allocation strategy of the volume group; under the condition that the resource allocation strategy is average allocation, determining the number of volumes in the volume group based on volume list information of the volume group; based on the number of volumes in the volume group and the storage resource information, determining a to-be-allocated storage resource value of each volume in the volume group; and based on the to-be-allocated storage resource value, allocating a corresponding storage resource to each volume. According to the resource allocation strategy, the storage resources are automatically allocated to each volume, and the allocation efficiency of the storage resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed storage technology, and in particular to a resource allocation method, device, computer equipment and storage medium. Background Art

[0002] As digital transformation continues to deepen, the amount of data is increasing, and the requirements for data storage are getting higher and higher. Distributed block storage has the advantages of scalability, low cost, and high performance, so it is widely used in data storage.

[0003] In related technologies, a volume is the basic container unit of distributed block storage. Related data is stored in different volumes, and these volumes with data association constitute a volume group. By manually setting the number of read and write operations per second (IOPS), bandwidth value, and other information for the volume group and each volume in the volume group, storage resource allocation for each volume is achieved.

[0004] However, this method of manually setting information such as IOPS and bandwidth value for each volume to achieve storage resource allocation is cumbersome and inefficient. Summary of the invention

[0005] In view of this, the present invention provides a resource allocation method, apparatus, computer device and storage medium to solve the problem in the related art that manually setting IOPS, bandwidth value and other information for each volume to achieve storage resource allocation is cumbersome and inefficient.

[0006] In a first aspect, the present invention provides a resource allocation method, the method comprising:

[0007] For any volume group, obtaining storage resource information and resource allocation strategy of the volume group;

[0008] In the case where the resource allocation strategy is average allocation, determining the number of volumes in the volume group based on the volume list information of the volume group;

[0009] Determining a storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information;

[0010] Based on the value of the storage resource to be allocated, corresponding storage resources are allocated to each of the volumes.

[0011] The resource allocation method provided in this embodiment obtains the storage resource information and resource allocation strategy of the volume group, and when the resource allocation strategy is equal allocation, determines the number of volumes in the volume group based on the volume list information of the volume group, and determines the storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information. By automatically allocating storage resources to each volume in the volume group according to the resource allocation strategy and the storage resource information, the allocation efficiency of storage resources is improved.

[0012] In an optional embodiment, the method further includes:

[0013] In the case where the resource allocation strategy is dynamic allocation, determining whether a dynamic adjustment period has been reached;

[0014] When a dynamic adjustment period is reached, obtaining a usage status of each volume in the volume group based on the volume list information of the volume group;

[0015] For any volume in the volume group, when the usage status of the volume is not used by the client, determining the storage resource usage of the volume in the last dynamic adjustment cycle as a preset storage resource value;

[0016] When the usage status of the volume is that the volume is being used by the client, obtaining the storage resource usage of the volume in a previous dynamic adjustment cycle;

[0017] Determining whether the storage resource usage of the volume in the last dynamic adjustment cycle is a preset storage resource value;

[0018] In a case where the storage resource usage of the volume in the last dynamic adjustment cycle is a preset storage resource value, determining the storage resource value to be allocated for the volume to be a minimum storage resource value;

[0019] In the case where the storage resource usage of the volume in the last dynamic adjustment cycle is not a preset storage resource value, obtaining the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and determining the ratio of the storage resource usage of the volume in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle;

[0020] Determining a storage resource value to be allocated for the volume based on the ratio and the storage resource information;

[0021] Based on the value of the storage resource to be allocated of the volume, storage resources are allocated to the volume.

[0022] The resource allocation method provided in this embodiment determines the value of storage resources to be allocated for the volume according to the storage resource usage in the previous dynamic adjustment cycle when the resource allocation policy is dynamic allocation, and allocates storage resources to the volume based on the value of storage resources to be allocated. This achieves the allocation of more storage resources to high-priority volumes and fewer storage resources to low-priority volumes during the use of the volume group, thereby achieving effective use of storage resources and improving storage resource utilization efficiency.

[0023] In an optional embodiment, the method further includes:

[0024] When the dynamic adjustment period has not been reached and a mount operation is performed on any volume in the volume group, obtaining the storage resource usage of the volume on which the mount operation is performed in the previous dynamic adjustment period and the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment period;

[0025] In a case where the storage resource usage of the volume on which the mount operation is performed in the last dynamic adjustment cycle is a preset storage resource value, determining the storage resource value to be allocated of the volume on which the mount operation is performed as a minimum storage resource value;

[0026] Obtaining the total amount of storage resource usage of all volumes in the volume group in a previous dynamic adjustment cycle, and determining the proportion of the storage resource usage of the other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment cycle to the total amount of storage resource usage of all volumes in the volume group in a previous dynamic adjustment cycle based on the storage resource usage of the other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment cycle and the total amount of storage resource usage of all volumes in the volume group in a previous dynamic adjustment cycle;

[0027] Based on the ratio and the storage resource information, the storage resource values ​​to be allocated of the volumes other than the volume on which the mount operation is performed in the volume group are determined.

[0028] The resource allocation method provided in this embodiment can timely obtain the storage resource usage of the last dynamic adjustment cycle and the storage resource usage of other volumes in the last dynamic adjustment cycle when a mount operation is performed on any volume, and perform corresponding processing according to the situation. This ensures that when a mount operation occurs, the system can respond quickly and allocate appropriate storage resources to the volume, thereby improving the real-time performance and responsiveness of the system.

[0029] In an optional embodiment, the method further includes:

[0030] When the dynamic adjustment cycle has not been reached and any volume in the volume group is subjected to an unloading operation, determining that the storage resource usage of the volume subjected to the unloading operation in the previous dynamic adjustment cycle is a preset storage resource usage value, and determining that the storage resource value to be allocated of the volume subjected to the unloading operation is a preset storage resource value;

[0031] Obtaining the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and determining the proportion of the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle based on the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle;

[0032] Based on the ratio and the storage resource information, the storage resource values ​​to be allocated of the volumes other than the volume on which the unmount operation is performed in the volume group are determined.

[0033] The resource allocation method provided in this embodiment can timely obtain the storage resource usage of the previous dynamic adjustment cycle and the storage resource usage of other volumes in the previous dynamic adjustment cycle when any volume is unloaded, and perform corresponding processing according to the situation. This ensures that when the unloading operation occurs, the system can respond quickly and allocate appropriate storage resources to the volume, thereby improving the real-time performance and responsiveness of the system.

[0034] In an optional embodiment, the method further includes:

[0035] In a case where the resource allocation strategy is dynamic allocation and the current dynamic adjustment period is an initial dynamic adjustment period, determining the number of volumes in the volume group based on the volume list information of the volume group;

[0036] Based on the number of volumes in the volume group and the storage resource information, a storage resource value to be allocated for each volume in the volume group is determined.

[0037] The resource allocation method provided in this embodiment, when the resource allocation strategy is dynamic allocation and the current dynamic adjustment cycle is the initial dynamic adjustment cycle, implements storage resource allocation for each volume in the volume group by evenly allocating storage resources. Each subsequent dynamic adjustment cycle dynamically allocates storage resources according to the actual storage resource usage of the previous dynamic adjustment cycle, thereby achieving the effect of reasonable allocation of storage resources and avoiding waste of storage resources.

[0038] In an optional implementation manner, the obtaining storage resource information and resource allocation strategy of the volume group includes:

[0039] In response to the status opening operation, obtaining volume list information of the volume group;

[0040] Based on the volume list information of the volume group, modifying the switch state of the metadata information of each volume in the volume group to an on state;

[0041] When the switch state of the metadata information of each volume in the volume group is modified to the on state, determining that the switch state of the metadata information of the volume group is the on state;

[0042] When the switch state of the metadata information of the volume group is on, storage resource information and resource allocation strategy of the volume group are acquired, wherein the metadata information includes storage resource information and resource allocation strategy.

[0043] The resource allocation method provided in this embodiment can ensure that all relevant data is ready before obtaining storage resource information and resource allocation strategies by opening the metadata information of each volume in turn. This helps to ensure the integrity and accuracy of the data and avoid errors or anomalies caused by the unavailability or inconsistency of some data.

[0044] In an optional implementation, the storage resource information is the number of read and write operations per second and a bandwidth value.

[0045] The resource allocation method provided in this embodiment automatically allocates storage resources to each volume in the volume group according to the resource allocation policy, thereby improving the allocation efficiency of storage resources.

[0046] In a second aspect, the present invention provides a resource allocation device, the device comprising:

[0047] A first acquisition module, used for acquiring storage resource information and resource allocation strategy of any volume group;

[0048] A first determination module, configured to determine the number of volumes in the volume group based on the volume list information of the volume group when the resource allocation strategy is average allocation;

[0049] A second determining module, configured to determine a storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information;

[0050] The first allocation module is used to allocate corresponding storage resources to each volume based on the value of the storage resource to be allocated.

[0051] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the resource allocation method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0052] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the resource allocation method of the first aspect or any corresponding embodiment thereof.

[0053] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the resource allocation method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 is a schematic diagram of a flow chart of a resource allocation method according to an embodiment of the present invention;

[0056] Figure 2 is a flow chart of another resource allocation method according to an embodiment of the present invention;

[0057] Figure 3 is a flow chart of another resource allocation method according to an embodiment of the present invention;

[0058] Figure 4 is a schematic diagram of a flow chart of volume group switch state control according to an embodiment of the present invention;

[0059] Figure 5 is a schematic diagram of a process of dynamic resource allocation according to an embodiment of the present invention;

[0060] Figure 6 is a structural block diagram of a resource allocation device according to an embodiment of the present invention;

[0061] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0063] As digital transformation continues to deepen, the amount of data is increasing massively. In order to better preserve this data, it has gradually evolved from centralized storage to distributed storage. Distributed storage is to store data in multiple servers in a decentralized manner and form these decentralized storage resources into a virtual storage device.

[0064] Distributed block storage is a widely used storage technology in distributed storage. It stores data in groups in a certain way and has the advantages of scalability, low cost, and high performance. In distributed block storage, volumes are the most commonly used basic container units for managing files. Usually, data stored in different volumes have a certain correlation. When performing corresponding operations on volumes, in order to ensure the correlation of data or restore multiple volumes with correlation to the same time point in disaster recovery backup scenarios, the volumes with correlation can be added to the same group to form a volume group, and then the corresponding operations on the volumes in the group can be realized through the volume group.

[0065] In the related art, storage resource allocation for each volume is achieved by manually setting information such as IOPS value and bandwidth value for the volume group and each volume in the volume group.

[0066] However, this method of manually setting information such as IOPS and bandwidth value for each volume to achieve storage resource allocation is cumbersome and inefficient.

[0067] The embodiment of the present invention provides a resource allocation method, which automatically allocates storage resources to each volume in a volume group according to the storage resource information and resource allocation strategy of the volume group, so as to achieve the effect of improving the allocation efficiency of storage resources.

[0068] According to an embodiment of the present invention, a resource allocation method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0069] In this embodiment, a resource allocation method is provided, which can be used in a mobile terminal, such as a server, a central processing unit, etc. Figure 1 is a flow chart of a resource allocation method according to an embodiment of the present invention. Figure 1As shown, the process includes the following steps:

[0070] Step S101: for any volume group, obtain storage resource information and resource allocation strategy of the volume group.

[0071] The volume group is a storage quality of service (QOS) group. QOS is used to allocate resources in a multi-user and multi-service system to ensure a certain storage quality, including IOPS and bandwidth data access services.

[0072] Storage resource information includes IOPS and bandwidth values. The resource allocation strategy can be average allocation or dynamic allocation.

[0073] In the field of distributed block storage, for any volume group, when a user opens the volume group, he or she sets storage resource information and resource allocation policy for the volume group.

[0074] The relevant structures involved in this embodiment are as follows:

[0075] struct group{

[0076] string group_name; / / volume group name

[0077] string create_time; / / Volume group creation time

[0078] uint64_t image_number; / / Volume data in volume group

[0079] bool iops_switch; / / iops switch

[0080] bool bandwidth_switch; / / Bandwidth switch

[0081] uint64_t iops_limit; / / iops limit

[0082] uint64_t bandWidth_limit; / / Bandwidth limit

[0083] uint64_t qosAdjust_cycle; / / Identifies the dynamic adjustment cycle of the QOS group, the default is 0: average distribution

[0084] string adj_Storage; / / Dynamic adjustment strategy: volume size

[0085] string last_adj_time; / / Record the last dynamically adjusted time point

[0086] }

[0087] Among them, group type is used to store the metadata information of the volume group. Among them, group_name is used to store the name of the volume group. create_time is used to store the creation time of the volume group. image_number is used to store the number of volumes in the volume group. iops_switch indicates the IOPS switch status of the volume group, where 1 indicates on and 0 indicates off. bandwidth_switch indicates the bandwidth switch status of the volume group, where 1 indicates on and 0 indicates off. iops_limit indicates the IOPS limit of the volume group, which defaults to the maximum value after the volume group is created. bandWidth_limit indicates the bandwidth limit of the volume group, which defaults to the maximum value after the volume group is created. qosAdjust_cycle is used to record the dynamic adjustment cycle of the QOS group, in minutes. The default value is 0, which means that the IOPS / bandwidth value of the volume group is evenly divided among the volumes in the group. Otherwise, the IOPS / bandwidth value of each volume is dynamically adjusted regularly based on the value of qosAdjust_cycle and the data volume of each volume in the group. last_adj_time is used to record the time point of the last dynamic adjustment. After the volume group is created, this value defaults to the creation time of the volume group.

[0088] The relevant structures involved in this embodiment also include:

[0089] struct volume{

[0090] string volume_name; / / volume name

[0091]

[0092] The type volume is used to store metadata information of the logical volume. Data_size is added based on the original attributes. Data_size is used to record the average data volume of the volume over the past period of time when the resource allocation strategy of the volume group is dynamic allocation. It can be understood that the data volume is represented by the average IOPS value and bandwidth value over the past period of time.

[0093] The server automatically obtains storage resource information and resource allocation policies based on the volume group set by the user. The IOPS and bandwidth values ​​of the volume group are the IOPS limit and bandwidth limit of the volume group set by the user.

[0094] Step S102: when the resource allocation strategy is average allocation, the number of volumes in the volume group is determined based on the volume list information of the volume group.

[0095] Users can use the command line to set IOPS / bandwidth limits for existing volume groups and simultaneously set IOPS / bandwidth limits for volumes in the volume group. The resource allocation policy for volume groups supports average allocation.

[0096] Figure 2 FIG. 1 is a flow chart of a resource allocation method according to an embodiment of the present invention. Figure 2 As shown in the figure, the user creates a volume group through the management software and adds volumes to the volume group. Initially, all metadata of the volume group are default values, the IOPS and bandwidth switches of the volume group are turned off, and the IOPS and bandwidth switches of each volume in the group are turned off synchronously. The dynamic adjustment period is 0, that is, each volume in the group evenly shares the IOPS value and bandwidth value of the volume group, and no dynamic allocation is performed. The user performs volume group IOPS / bandwidth and cycle policy operations in the management software (management software) interface, that is, the user selects the IOPS and bandwidth switch status in the volume group and sets the resource allocation policy in the management software interface.

[0097] The command line writes the management software parameters into the volume group metadata information. That is, the volume group metadata information is obtained. The volume group and volume list information are obtained, where the volume list information includes the volumes contained in the volume group and the metadata information of each volume.

[0098] Determine whether qosAdjust_cycle is equal to 0. If qosAdjust_cycle is equal to 0, the dynamic adjustment cycle is 0, and the resource allocation strategy is determined to be average allocation.

[0099] When the resource allocation policy is average allocation, the number of volumes in the volume group is determined based on the volume list information of the volume group.

[0100] It can be understood that if qosAdjust_cycle is not 0, the dynamic adjustment cycle is not 0, and the resource allocation strategy is determined to be dynamic allocation.

[0101] Step S103: determining the storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information.

[0102] When the number of volumes in the volume group is determined, the storage resource value to be allocated for each volume in the volume group is determined according to the number of volumes in the volume group and the storage resource information by dividing the storage resource information by the number of volumes.

[0103] It can be understood that the IOPS value of each volume in the volume group is determined according to the number of volumes in the volume group and the IOPS of the volume group; the bandwidth value of each volume in the volume group is determined according to the number of volumes in the volume group and the bandwidth value of the volume group.

[0104] like Figure 2 As shown, the IOPS / bandwidth value of each volume in the group is calculated, that is, based on the number of volumes in the volume group and the storage resource information, the storage resource value to be allocated for each volume in the volume group is determined.

[0105] It should be noted that after the storage resource value to be allocated of each volume in the volume group is determined, the storage resource value to be allocated of each volume needs to be updated into the metadata information of each volume to complete the metadata information setting of each volume.

[0106] like Figure 2 As shown, the volume list of the volume group is looped, and for any volume in the volume list, it is determined whether the volume exists. If the volume exists, the volume IOPS / bandwidth value is modified, that is, the IOPS of the volume is modified to the IOPS value corresponding to the volume that is evenly distributed, and the bandwidth value of the volume is modified to the bandwidth value corresponding to the volume that is evenly distributed. If the volume does not exist, it is determined whether the volume list is looped. If the volume list is not looped, the volume list is continued to be looped to update the metadata information of each volume. If the volume list loop is completed, the loop ends.

[0107] After the modification of the volume IOPS / bandwidth value is completed, it is determined whether the volume information is modified successfully, that is, whether the IOPS / bandwidth value of the volume is modified successfully. If the volume information is modified successfully, it is determined whether the volume list is cycled. If the volume list is not cycled, the volume list is continued to cycle to update the metadata information of each volume.

[0108] If the volume information is not modified successfully, it is determined that the volume group QOS setting fails, that is, the IOPS / bandwidth value of the volume in the volume group fails to be modified.

[0109] It should be noted that after the IOPS and bandwidth values ​​of all volumes in the volume group are modified, the IOPS and bandwidth values ​​of the volume group are modified to the IOPS and bandwidth values ​​set by the user. Among them, the volume group IOPS limit is changed from the default 1000000 to the IOPS limit set by the user, and the bandwidth limit is changed from the default 10G to the bandwidth limit set by the user.

[0110] It should be further explained that modifying the IOPS and bandwidth values ​​is actually modifying the IOPS limit and bandwidth limit.

[0111] Step S104: Allocate corresponding storage resources to each volume based on the value of the storage resources to be allocated.

[0112] After determining the storage resource value to be allocated for each volume in the volume group, that is, modifying the IOPS and bandwidth value of each volume to the evenly distributed IOPS and bandwidth value, corresponding storage resources are allocated to each volume according to the modified IOPS and bandwidth values.

[0113] It can be understood that this embodiment is an even distribution, and the storage resources allocated to each volume are the same.

[0114] The resource allocation method provided in this embodiment obtains the storage resource information and resource allocation strategy of the volume group, and when the resource allocation strategy is equal allocation, determines the number of volumes in the volume group based on the volume list information of the volume group, and determines the storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information. By automatically allocating storage resources to each volume in the volume group according to the resource allocation strategy and the storage resource information, the allocation efficiency of storage resources is improved.

[0115] By adding volume group metadata information, that is, adding volume group IOPS switch status and volume group bandwidth switch status, the IOPS switch status and bandwidth switch status of the volume group can be controlled, and the IOPS switch status and bandwidth switch status of the volumes in the volume group can be controlled synchronously.

[0116] By adding volume group IOPS limit and volume group bandwidth limit, the IOPS limit and bandwidth limit of the volume group can be set. By adding dynamic adjustment cycle and the time point of the last dynamic adjustment, the resource allocation strategy and dynamic adjustment of the volume group and the volumes in the volume group can be implemented.

[0117] By adding attributes for statistical data volume, it is possible to allocate a QOS value of appropriate proportion to each volume when dynamically adjusting the QOS value of volumes in the volume group.

[0118] In this embodiment, a resource allocation method is provided, which can be used in a mobile terminal, such as a server, a central processing unit, etc. Figure 3 is a flow chart of a resource allocation method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0119] Step S301: for any volume group, obtain storage resource information and resource allocation strategy of the volume group.

[0120] Specifically, the above step S301 includes:

[0121] Step S3011, in response to the status opening operation, obtaining volume list information of the volume group.

[0122] Users can control the IOPS / bandwidth switch status of the volume group through the management software, control the IOPS / bandwidth switch status of the existing volume group through the command line, and simultaneously set the IOPS / bandwidth switch status of the volumes in the volume group.

[0123] The user selects the corresponding volume group through the management software to perform the operation of turning on the IOPS and bandwidth switch or turning off the IOPS and bandwidth switch. In response to the user's state turning on operation, the management software issues a command, and the bottom layer calls the command line to issue an instruction to change the IOPS / bandwidth switch state of the volume group.

[0124] Figure 4FIG. 1 is a flow chart of volume group switch state control according to an embodiment of the present invention. Figure 4 As shown, the user creates a volume group and adds volumes to the volume group through the management software, and the management software performs the QOS on / off operation, that is, the management software performs the volume group IOPS / bandwidth on or off operation. This embodiment takes the execution of the volume group IOPS / bandwidth on operation as an example.

[0125] In response to the status open operation, volume list information of the volume group is obtained.

[0126] Step S3012: based on the volume list information of the volume group, modify the switch state of the metadata information of each volume in the volume group to an on state.

[0127] like Figure 4 As shown, after obtaining the volume list information of the volume group, the volume list is looped, and for any volume in the volume list, it is determined whether the volume exists. If the volume exists, the IOPS / bandwidth switch state of the volume is modified, that is, the switch state of the metadata information of each volume in the volume group is changed to the on state.

[0128] It should be noted that the metadata information includes the IOPS and bandwidth switch status of the volume. Change the IOPS switch status and bandwidth switch status of the volume to the on state.

[0129] After the modification of the volume IOPS / bandwidth switch status is completed, it is determined whether the volume information is modified successfully, that is, whether the volume IOPS / bandwidth switch status is modified successfully. If the volume information is modified successfully, it is determined whether the volume list cycle is completed. If the volume information modification is unsuccessful, it is determined that the volume group QOS setting fails, that is, the volume IOPS / bandwidth switch status modification fails.

[0130] If the volume list is not completely circulated, the volume list continues to be circulated until the volume list is completely circulated, that is, the IOPS / bandwidth switch status of each volume in the volume group is modified.

[0131] Step S3013: when the switch state of the metadata information of each volume in the volume group is modified to the on state, determine that the switch state of the metadata information of the volume group is the on state.

[0132] like Figure 4 As shown, the IOPS / bandwidth switch status of each volume in the volume group is modified, that is, the switch status of the metadata information of each volume in the volume group is modified to the on state.

[0133] It should be noted that, when the switch state of the metadata information of each volume in the volume group is modified to the on state, the switch state of the metadata information of the volume group is modified to the on state.

[0134] Determine whether the modification of the volume group QOS status is successful, that is, whether the switch status of the volume group metadata information is changed to the on state.

[0135] When the modification of the volume group QOS state is successful, it is determined that the volume group QOS is set successfully, that is, the switch state of the metadata information of the volume group is modified to the on state.

[0136] When the modification of the volume group QOS state fails, it is determined that the volume group QOS setting fails, that is, the switch state of the metadata information of the volume group is not modified to the on state.

[0137] Step S3014: when the switch state of the metadata information of the volume group is on, obtain the storage resource information and resource allocation strategy of the volume group, wherein the metadata information includes the storage resource information and the resource allocation strategy.

[0138] Among them, the switch status of the metadata information of the volume group is on, that is, the switch status of the IOPS and bandwidth of the volume group and each volume in the volume group is on. When the switch status of the metadata information of the volume group is on, the user sets the corresponding storage resource information for each volume group, that is, sets the corresponding IOPS limit and bandwidth limit, and of course sets the corresponding resource allocation strategy for each volume group.

[0139] That is to say, when the switch state of the metadata information of the volume group is on, the storage resource information and resource allocation strategy of the volume group can be obtained. When the switch state of the metadata information of the volume group is off, the storage resource information and resource allocation strategy of the volume group cannot be obtained, that is, the resource allocation of the volume group cannot be performed.

[0140] Step S302: When the resource allocation strategy is equal allocation, the number of volumes in the volume group is determined based on the volume list information of the volume group. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0141] Step S303: Based on the number of volumes in the volume group and the storage resource information, determine the storage resource value to be allocated for each volume in the volume group. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0142] Step S304: Allocate corresponding storage resources to each volume based on the storage resource value to be allocated. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0143] The resource allocation method provided in this embodiment can ensure that all relevant data is ready before obtaining storage resource information and resource allocation strategies by opening the metadata information of each volume in turn. This helps to ensure the integrity and accuracy of the data and avoid errors or anomalies caused by the unavailability or inconsistency of some data.

[0144] By controlling the volume group QOS switch and setting the volume group QOS value, the volume QOS and bandwidth values ​​in the volume group are evenly distributed or dynamically allocated, thus achieving reasonable resource allocation for the volume group.

[0145] The resource allocation method provided in this embodiment supports setting QOS values ​​for volumes in a volume group in an average allocation manner, that is, setting IOPS and bandwidth values. The average allocation manner is that all volumes in a volume group divide the volume group IOPS and bandwidth values ​​equally. The dynamic allocation manner is supported to set QOS values ​​for volumes in a volume group. The dynamic allocation manner is to set a dynamic allocation strategy, and regularly dynamically adjust the IOPS and bandwidth values ​​of each volume according to the dynamic allocation strategy, the usage status of the volumes in the volume group, and the storage resource usage in the previous dynamic adjustment cycle.

[0146] In some optional implementations, the resource allocation method further includes:

[0147] Step a1: when the resource allocation strategy is dynamic allocation, determine whether the dynamic adjustment period has been reached.

[0148] Figure 5 FIG. 1 is a schematic diagram of a process of dynamic resource allocation according to an embodiment of the present invention. Figure 5 As shown, the periodic function periodically reads the volume group metadata information to determine whether the qosAdjust_cycle in the volume group metadata information is 0. When qosAdjust_cycle is not 0, the dynamic adjustment cycle is not 0, and the resource allocation strategy is determined to be dynamic allocation, that is, the IOPS and bandwidth values ​​of each volume in the volume group are dynamically adjusted according to the storage resource usage and usage status of the volumes in the previous dynamic adjustment cycle in the set dynamic adjustment cycle. It should be noted that the dynamic adjustment cycle is set by the user.

[0149] Determine whether the volume group IOPS&bandwidth switch is equal to false, that is, determine whether the volume group IOPS switch status and bandwidth switch status are closed.

[0150] When the volume group IOPS switch state and bandwidth switch state are on, determine whether the difference between the current time and the last dynamic adjustment time point last_adj_time is greater than or equal to the qosAdjust_cycle dynamic adjustment cycle, that is, determine whether the dynamic adjustment cycle has been reached.

[0151] It should be noted that the dynamic adjustment function is called to adjust the IOPS and bandwidth values ​​of each volume in the volume group only when the IOPS and bandwidth switch status of the volume group is turned on, the resource allocation policy is dynamic allocation, and the dynamic adjustment period is reached.

[0152] Step a2: when the dynamic adjustment period is reached, the usage status of each volume in the volume group is obtained based on the volume list information of the volume group.

[0153] like Figure 5 As shown, the difference between the current time and the last dynamically adjusted time point last_adj_time is greater than or equal to qosAdjust_cycle, and it is determined that the dynamic adjustment cycle has been reached. The dynamic adjustment function is called to set the IOPS and bandwidth values ​​for each volume in the volume group.

[0154] Specifically, the volume list information of the volume group is obtained. Based on the volume list information of the volume group, the volume list is circulated, and for any volume in the volume list, it is determined whether the volume exists. If the volume exists, it is determined whether the volume status is login (mounted status), that is, whether the usage status of the volume is being used by the client.

[0155] Step a3: for any volume in the volume group, when the usage status of the volume is not used by the client, determine the storage resource usage of the volume in the last dynamic adjustment cycle as the preset storage resource value.

[0156] Among them, for any volume in the volume group, if the usage status of the volume is not used by the client, that is, the volume status is not mounted, then the data volume data_size of the volume is determined to be 0, that is, the storage resource usage of the volume in the previous dynamic adjustment cycle is the preset storage resource value, wherein the preset storage resource value is 0.

[0157] The storage resource usage in the previous dynamic adjustment period includes the average IOPS and average bandwidth values ​​in the previous dynamic adjustment period.

[0158] Step a4: when the usage status of the volume is that it is being used by the client, obtain the storage resource usage of the volume in a previous dynamic adjustment cycle.

[0159] Among them, the usage status of the volume is being used by the client, that is, the volume status is mounted, then the data volume from last_adj_time to the current time is counted and the sum is calculated, that is, the storage resource usage of the volume in the previous dynamic adjustment cycle and the total storage resource usage of all volumes in the volume group in the previous dynamic adjustment cycle are obtained.

[0160] The total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle includes the total IOPS and the total bandwidth of all volumes in the volume group in the last dynamic adjustment cycle.

[0161] Step a5: determine whether the storage resource usage of the volume in the previous dynamic adjustment cycle is a preset storage resource value.

[0162] like Figure 5 As shown, it is determined whether the volume data volume in the previous statistical period is 0, that is, it is determined whether the storage resource usage of the volume in the previous dynamic adjustment period is a preset storage resource value, wherein the preset storage resource value is 0.

[0163] Step a6: when the storage resource usage of the volume in the last dynamic adjustment cycle is the preset storage resource value, determine the storage resource value to be allocated of the volume as the minimum storage resource value.

[0164] like Figure 5 As shown, the volume data volume in the last statistical cycle is 0, that is, the storage resource usage of the volume in the last dynamic adjustment cycle is the preset storage resource value, and the minimum QOS value is set for the volume. That is, the storage resource value to be allocated for the volume is determined to be the minimum storage resource value, that is, the IOPS value of the volume is set to the minimum IOPS value, and the bandwidth value of the volume is set to the minimum bandwidth value.

[0165] It should be noted that the minimum storage resource value is set by the technicians and is not specifically limited here. It is generally very small and can be ignored. In other words, the minimum IOPS value and the minimum bandwidth value are set by the technicians and are generally very small and can be ignored.

[0166] Step a7, when the storage resource usage of the volume in the last dynamic adjustment cycle is not the preset storage resource value, obtain the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and determine the proportion of the storage resource usage of the volume in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle.

[0167] like Figure 5 As shown, the volume data volume in the previous statistical period is not 0, that is, the storage resource usage of the volume in the previous dynamic adjustment period is not the preset storage resource value, so the volume data volume ratio is calculated and the volume QOS value is set accordingly.

[0168] Calculating the volume data volume ratio is to determine the ratio of the volume's storage resource usage in the previous dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the previous dynamic adjustment cycle.

[0169] Step a8: determining the storage resource value to be allocated for the volume based on the ratio and the storage resource information.

[0170] Among them, the QOS value of the volume is set proportionally, that is, based on the ratio of the storage resource usage of the volume in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle and the storage resource information of the volume group, the storage resource value to be allocated for the volume is determined.

[0171] The storage resource value to be allocated for the volume is determined by multiplying the ratio of the storage resource usage of the volume in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle by the storage resource information of the volume group, so as to allocate more resources to the volumes in use in the volume group.

[0172] It can be understood that the IOPS value of the volume is modified by multiplying the ratio of the average IOPS value of the volume in the last dynamic adjustment cycle to the total average IOPS value of all volumes in the volume group in the last dynamic adjustment cycle by the IOPS value of the volume group.

[0173] The bandwidth value of the volume is modified by multiplying the ratio of the average bandwidth value of the volume in the last dynamic adjustment cycle to the total average bandwidth value of all volumes in the volume group in the last dynamic adjustment cycle by the bandwidth value of the volume group.

[0174] Step a9: Allocate storage resources to the volume based on the value of the storage resources to be allocated of the volume.

[0175] After the value of the storage resources to be allocated of the volume is obtained, storage resources are allocated to the volume according to the value of the storage resources to be allocated of the volume.

[0176] It is understandable that storage resources are allocated to the volume according to the IOPS value and bandwidth value of the volume, thereby allocating storage resources to each volume in the volume group.

[0177] The resource allocation method provided in this embodiment determines the value of storage resources to be allocated for the volume according to the storage resource usage in the previous dynamic adjustment cycle when the resource allocation policy is dynamic allocation, and allocates storage resources to the volume based on the value of storage resources to be allocated. This achieves the allocation of more storage resources to high-priority volumes and fewer storage resources to low-priority volumes during the use of the volume group, thereby achieving effective use of storage resources and improving storage resource utilization efficiency.

[0178] Generally, different volume groups and volumes within a volume group undertake different services, and their service priorities are different. To ensure the stable execution of services of high-priority volume groups and prevent low-priority volume groups from occupying more resources, different data access capabilities such as IOPS and bandwidth can be set for groups and volumes within groups. This embodiment dynamically allocates storage resources to dynamically adjust the storage resources allocated to the volume according to the storage resource usage of the volume in the previous dynamic adjustment cycle, thereby achieving effective utilization of storage resources.

[0179] In some optional implementations, the resource allocation method further includes:

[0180] Step b1, when the dynamic adjustment cycle has not been reached and any volume in the volume group is mounted, obtain the storage resource usage of the volume on which the mount operation is performed in the previous dynamic adjustment cycle and the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment cycle.

[0181] In addition to setting the volume group resource allocation policy in the management software to dynamically adjust the IOPS and bandwidth values ​​of the volumes in the volume group, dynamic adjustment of the IOPS and bandwidth values ​​of the volume group volumes will also be triggered when the volumes in the volume group are mounted and unmounted before the dynamic adjustment cycle is reached.

[0182] When the dynamic adjustment period has not been reached and any volume is mounted, it is determined whether the volume is in the volume group, and whether the IOPS and bandwidth switch status of the volume group are turned on.

[0183] When the volume is in a volume group and the IOPS and bandwidth switch status of the volume group is on, the IOPS value and bandwidth value of the volume in the volume group need to be dynamically adjusted. Specifically, the dynamic adjustment process in the volume group setting dynamic adjustment process can be executed by calling a dynamic adjustment function.

[0184] When a mount operation is performed on any volume in the volume group before the dynamic adjustment cycle is reached, the storage resource usage of the volume on which the mount operation is performed in the previous dynamic adjustment cycle and the storage resource usage of each volume in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment cycle are first obtained.

[0185] Step b2: when the storage resource usage of the volume on which the mount operation is executed in the last dynamic adjustment cycle is the preset storage resource value, determining that the storage resource value to be allocated of the volume on which the mount operation is executed is the minimum storage resource value.

[0186] Wherein, when the storage resource usage of the volume on which the mount operation is performed in the last dynamic adjustment cycle is 0, the storage resource value to be allocated of the volume on which the mount operation is performed is determined to be the minimum storage resource value.

[0187] Step b3, obtaining the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and based on the storage resource usage of other volumes in the volume group except the volume on which the mount operation was performed in the last dynamic adjustment cycle and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, determining the proportion of the storage resource usage of other volumes in the volume group except the volume on which the mount operation was performed in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle.

[0188] It should be noted that, when the storage resource usage of the volume on which the mount operation is performed in the last dynamic adjustment cycle is 0, a step is performed to obtain the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and based on the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the last dynamic adjustment cycle and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, a step is performed to determine the proportion of the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle.

[0189] Step b4: Based on the ratio and the storage resource information, determine the storage resource values ​​to be allocated for the volumes other than the volume on which the mount operation is performed in the volume group.

[0190] Among them, when the storage resource usage of the volume on which the mount operation is performed in the last dynamic adjustment cycle is 0, and when the ratio of the storage resource usage of each volume in the volume group except the volume on which the mount operation is performed in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle is obtained, the storage resource value to be allocated for each volume in the volume group except the volume on which the mount operation is performed is determined based on the product of the ratio and the storage resource information.

[0191] Storage resources are allocated to each of the other volumes in the volume group except the volume on which the mount operation is performed according to the to-be-allocated storage resource value of each of the other volumes.

[0192] It should be further explained that, when the storage resource usage of the volume on which the mount operation is performed in the last dynamic adjustment cycle is not 0, the ratio of the storage resource usage of each volume in the volume group in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle is determined. Based on the ratio and the storage resource information, the storage resource value to be allocated for each volume in the volume group is determined.

[0193] The resource allocation method provided in this embodiment can timely obtain the storage resource usage of the last dynamic adjustment cycle and the storage resource usage of other volumes in the last dynamic adjustment cycle when any volume is mounted, and perform corresponding processing according to the situation. That is, when a volume is mounted and used by a client, the operation of dynamically adjusting the QOS value of each volume in the volume group is triggered. This ensures that when the mounting operation occurs, the system can respond quickly and allocate appropriate storage resources to the volume, thereby improving the real-time performance and responsiveness of the system.

[0194] In some optional implementations, the resource allocation method further includes:

[0195] Step c1, when the dynamic adjustment cycle has not been reached and any volume in the volume group has been unloaded, determines that the storage resource usage of the volume on which the unloading operation was performed in the previous dynamic adjustment cycle is a preset storage resource usage value, and determines that the storage resource value to be allocated of the volume on which the unloading operation was performed is the preset storage resource value.

[0196] When the dynamic adjustment period has not been reached and any volume is unmounted, it is determined whether the volume is in the volume group, and whether the IOPS and bandwidth switch status of the volume group are in the on state.

[0197] When the volume is in a volume group and the IOPS and bandwidth switch status of the volume group is on, the IOPS value and bandwidth value of the volume in the volume group need to be dynamically adjusted. Specifically, the dynamic adjustment process in the volume group setting dynamic adjustment process can be executed by calling a dynamic adjustment function.

[0198] When any volume in the volume group is unloaded before the dynamic adjustment period is reached, it is determined that the storage resource usage of the volume being unloaded in the previous dynamic adjustment period is 0, that is, the data_size of the volume being unloaded is set to 0. And it is determined that the storage resource value to be allocated of the volume being unloaded is 0.

[0199] Step c2, obtaining the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed during the last dynamic adjustment cycle and the total storage resource usage of all the volumes in the volume group during the last dynamic adjustment cycle, and based on the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed during the last dynamic adjustment cycle and the total storage resource usage of all the volumes in the volume group during the last dynamic adjustment cycle, determining the proportion of the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed during the last dynamic adjustment cycle to the total storage resource usage of all the volumes in the volume group during the last dynamic adjustment cycle.

[0200] After determining that the value of storage resources to be allocated of the volume on which the unloading operation is performed is 0, it is also necessary to determine the value of storage resources to be allocated of each volume other than the volume on which the unloading operation is performed in the volume group. First, it is necessary to determine the ratio of the storage resource usage of each volume other than the volume on which the unloading operation is performed in the volume group in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle.

[0201] Step c3: Based on the ratio and the storage resource information, determine the storage resource values ​​to be allocated for the volumes other than the volume on which the unmounting operation is performed in the volume group.

[0202] After determining the proportion of the storage resource usage of each volume in the volume group other than the volume on which the unloading operation is performed to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, the storage resource values ​​to be allocated of the volumes in the volume group other than the volume on which the unloading operation is performed are determined based on the proportion of the storage resource usage of each volume in the volume group other than the volume on which the unloading operation is performed to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle and the storage resource information, and the corresponding volume's meta information is modified based on the storage resource values ​​to be allocated. Specifically, the volume's IOPS and bandwidth values ​​are modified.

[0203] The resource allocation method provided in this embodiment can timely obtain the storage resource usage of the last dynamic adjustment cycle and the storage resource usage of other volumes in the last dynamic adjustment cycle when any volume is unloaded, and perform corresponding processing according to the situation. That is, when a volume in a volume group is unloaded by a client, the QOS value of the volume is adjusted to 0, and the QOS values ​​of other volumes in the group are dynamically adjusted according to the business status. This ensures that when an unloading operation occurs, the system can respond quickly and allocate appropriate storage resources to the volume, thereby improving the real-time performance and responsiveness of the system.

[0204] In some optional implementations, the resource allocation method further includes:

[0205] Step d1, when the resource allocation strategy is dynamic allocation and the current dynamic adjustment period is the initial dynamic adjustment period, the number of volumes in the volume group is determined based on the volume list information of the volume group.

[0206] It is understandable that when the resource allocation strategy is dynamic allocation, in the first dynamic adjustment cycle, that is, the initial dynamic adjustment cycle, the volumes in the volume group do not have the storage resource usage information of the previous dynamic adjustment cycle. In this case, in the initial dynamic adjustment cycle, resources are allocated by average allocation.

[0207] First, obtain the volume list information of the volume group, and determine the number of volumes in the volume group based on the volume list information.

[0208] Step d2: determining the storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information.

[0209] The storage resource value to be allocated for each volume is determined by dividing the storage resource information of the volume group by the number of volumes in the volume group.

[0210] It should be noted that, when the resource allocation policy is dynamic allocation and the current dynamic adjustment period is not the initial dynamic adjustment period, storage resources are allocated to the volumes in the volume group in the manner of steps a2 to a9.

[0211] The resource allocation method provided in this embodiment, when the resource allocation strategy is dynamic allocation and the current dynamic adjustment cycle is the initial dynamic adjustment cycle, implements storage resource allocation for each volume in the volume group by evenly allocating storage resources. Each subsequent dynamic adjustment cycle dynamically allocates storage resources according to the actual storage resource usage of the previous dynamic adjustment cycle, thereby achieving the effect of reasonable allocation of storage resources and avoiding waste of storage resources.

[0212] The resource allocation method provided in this embodiment is applicable to the distributed block storage system in the related technology and has compatibility. Moreover, the resource allocation method does not consume additional resources, further improves the use of volume functions, and has the advantage of low cost. Moreover, the resource allocation method can perform batch operations on volumes with data correlation through the newly added volume group metadata information, providing a friendly operation experience. Moreover, the resource allocation method performs QOS operations on volumes within the volume group through the newly added volume group metadata information, controls and reasonably divides resources, ensures the service quality of key businesses and can meet the basic needs of ordinary businesses, thereby ensuring the storage service quality. Moreover, the resource allocation method makes full and effective use of various resources of the storage cluster such as CPU, memory, etc. through reasonable allocation of resources, thereby improving resource utilization.

[0213] In some optional implementations, the resource allocation method further includes:

[0214] Step e1, when the resource allocation strategy is dynamic allocation, determine whether the dynamic adjustment period has arrived. For details, refer to the above step a1, which will not be described here.

[0215] Step e2: when the dynamic adjustment period is reached, based on the volume list information of the volume group, the usage status of each volume in the volume group is obtained. For details, please refer to the above step a2, which will not be repeated here.

[0216] Step e3, for any volume in the volume group, when the usage status of the volume is not used by the client, determine the average storage resource usage of the volume in the historical dynamic adjustment period as the preset storage resource value. The historical dynamic adjustment period is the dynamic adjustment period before the current dynamic adjustment period. The average storage resource usage of the volume in the historical dynamic adjustment period is the average IOPS and average bandwidth value of the volume in the historical dynamic adjustment period, which can be obtained by dividing the sum of the storage resource usage of the historical dynamic adjustment period by the number of historical dynamic adjustment periods.

[0217] Step e4, when the usage status of the volume is being used by the client, obtain the average storage resource usage of the volume in the historical dynamic adjustment period.

[0218] Step e5, determining whether the average storage resource usage of the volume in the historical dynamic adjustment period is a preset storage resource value.

[0219] Step e6: when the average storage resource usage of the volume in the historical dynamic adjustment period is the preset storage resource value, determine the storage resource value to be allocated for the volume as the minimum storage resource value.

[0220] Step e7, when the average storage resource usage of the volume's historical dynamic adjustment period is not a preset storage resource value, obtain the total average storage resource usage of all volumes in the volume group during the historical dynamic adjustment period, and determine the proportion of the average storage resource usage of the volume's historical dynamic adjustment period to the total average storage resource usage of all volumes in the volume group during the historical dynamic adjustment period.

[0221] Step e8: Determine the storage resource value to be allocated for the volume based on the ratio and the storage resource information.

[0222] Step e9: Allocate storage resources to the volume based on the value of the storage resources to be allocated of the volume.

[0223] The resource allocation method provided in this embodiment can more accurately predict the resource requirements of a volume by considering the average storage resource usage in the historical dynamic adjustment cycle of the volume, achieve more refined resource allocation, improve resource utilization efficiency, and better meet the usage requirements of different volumes.

[0224] In this embodiment, a resource allocation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0225] This embodiment provides a resource allocation device, such as Figure 6 As shown, including:

[0226] The first acquisition module 601 is used to acquire storage resource information and resource allocation strategy of any volume group.

[0227] The first determination module 602 is used to determine the number of volumes in the volume group based on the volume list information of the volume group when the resource allocation strategy is average allocation.

[0228] The second determining module 603 is used to determine the storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information.

[0229] The first allocation module 604 is configured to allocate corresponding storage resources to each volume based on the value of the storage resources to be allocated.

[0230] In some optional implementations, the resource allocation device further includes:

[0231] The first judgment module is used to judge whether a dynamic adjustment period has been reached when the resource allocation strategy is dynamic allocation.

[0232] The second acquisition module is used to acquire the use status of each volume in the volume group based on the volume list information of the volume group when the dynamic adjustment period is reached.

[0233] The third determination module is used to determine, for any volume in the volume group, if the usage status of the volume is not used by the client, that the storage resource usage of the volume in the last dynamic adjustment cycle is a preset storage resource value.

[0234] The third acquisition module is used to acquire the storage resource usage of the volume in a previous dynamic adjustment period when the usage status of the volume is being used by the client.

[0235] The second judgment module is used to judge whether the storage resource usage of the volume in the previous dynamic adjustment cycle is a preset storage resource value.

[0236] The fourth determination module is used to determine that the storage resource value to be allocated of the volume is the minimum storage resource value when the storage resource usage of the volume in the previous dynamic adjustment cycle is the preset storage resource value.

[0237] The fourth acquisition module is used to obtain the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle when the storage resource usage of the volume in the last dynamic adjustment cycle is not a preset storage resource value, and determine the proportion of the storage resource usage of the volume in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle.

[0238] The fifth determining module is used to determine the storage resource value to be allocated of the volume based on the ratio and the storage resource information.

[0239] The second allocation module is used to allocate storage resources to the volume based on the value of the storage resources to be allocated of the volume.

[0240] In some optional implementations, the resource allocation device further includes:

[0241] The fifth acquisition module is used to obtain the storage resource usage of the volume on which the mount operation is performed in the previous dynamic adjustment cycle and the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment cycle when the dynamic adjustment cycle has not been reached and any volume in the volume group has been mounted.

[0242] The sixth determination module is used to determine that the storage resource value to be allocated of the volume on which the mount operation is performed is the minimum storage resource value when the storage resource usage of the volume on which the mount operation is performed in the last dynamic adjustment cycle is the preset storage resource value.

[0243] The sixth acquisition module is used to obtain the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and based on the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the last dynamic adjustment cycle and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, determine the proportion of the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle.

[0244] The seventh determining unit is used to determine the storage resource values ​​to be allocated of other volumes in the volume group except the volume on which the mount operation is performed based on the ratio and the storage resource information.

[0245] In some optional implementations, the resource allocation device further includes:

[0246] The eighth determination module is used to determine that the storage resource usage of the volume that has been unloaded in the previous dynamic adjustment cycle is a preset storage resource usage value, and to determine that the storage resource value to be allocated of the volume that has been unloaded is a preset storage resource value, when the dynamic adjustment cycle has not been reached and any volume in the volume group has been unloaded.

[0247] The seventh acquisition module is used to obtain the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed in the last dynamic adjustment cycle and the total storage resource usage of all the volumes in the volume group in the last dynamic adjustment cycle, and based on the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed in the last dynamic adjustment cycle and the total storage resource usage of all the volumes in the volume group in the last dynamic adjustment cycle, determine the proportion of the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed in the last dynamic adjustment cycle to the total storage resource usage of all the volumes in the volume group in the last dynamic adjustment cycle.

[0248] The ninth determining module is used to determine the storage resource values ​​to be allocated of other volumes in the volume group except the volume on which the unmounting operation is performed based on the ratio and the storage resource information.

[0249] In some optional implementations, the resource allocation device further includes:

[0250] The tenth determination module is used to determine the number of volumes in the volume group based on the volume list information of the volume group when the resource allocation strategy is dynamic allocation and the current dynamic adjustment period is the initial dynamic adjustment period.

[0251] The eleventh determining module is used to determine the storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information.

[0252] In some optional implementations, the first acquisition module 601 includes:

[0253] The first acquisition subunit is used to acquire volume list information of the volume group in response to the status opening operation.

[0254] The modification unit is used to modify the switch state of the metadata information of each volume in the volume group to an on state based on the volume list information of the volume group.

[0255] The determining unit is used to determine that the switch state of the metadata information of the volume group is the on state when the switch state of the metadata information of each volume in the volume group is modified to the on state.

[0256] The second acquisition subunit is used to acquire storage resource information and resource allocation strategy of the volume group when the switch state of the metadata information of the volume group is on, wherein the metadata information includes storage resource information and resource allocation strategy.

[0257] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0258] The resource allocation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0259] The embodiment of the present invention also provides a computer device having the above Figure 6 The resource allocation device shown.

[0260] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 701, memory 702, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component utilizes different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 701 is taken as an example.

[0261] The processor 701 may be a central processing unit, a network processor or a combination thereof. The processor 701 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0262] The memory 702 stores instructions executable by at least one processor 701, so that the at least one processor 701 executes the method shown in the above embodiment.

[0263] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 702 may optionally include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0264] The memory 702 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 702 may also include a combination of the above types of memory.

[0265] The computer device also includes a communication interface 703, which is used for the computer device to communicate with other devices or a communication network.

[0266] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0267] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0268] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A resource allocation method, characterized in that: The method comprises: For any volume group, obtaining storage resource information and resource allocation strategy of the volume group; In the case where the resource allocation strategy is average allocation, determining the number of volumes in the volume group based on the volume list information of the volume group; Determining a storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information; Based on the value of the storage resource to be allocated, corresponding storage resources are allocated to each of the volumes.

2. The method according to claim 1, characterized in that The method further comprises: In the case where the resource allocation strategy is dynamic allocation, determining whether a dynamic adjustment period has been reached; When a dynamic adjustment period is reached, obtaining a usage status of each volume in the volume group based on the volume list information of the volume group; For any volume in the volume group, when the usage status of the volume is not used by the client, determining the storage resource usage of the volume in the last dynamic adjustment cycle as a preset storage resource value; When the usage status of the volume is that the volume is being used by the client, obtaining the storage resource usage of the volume in a previous dynamic adjustment cycle; Determining whether the storage resource usage of the volume in the last dynamic adjustment cycle is a preset storage resource value; In a case where the storage resource usage of the volume in the last dynamic adjustment cycle is a preset storage resource value, determining the storage resource value to be allocated for the volume to be a minimum storage resource value; In the case where the storage resource usage of the volume in the last dynamic adjustment cycle is not a preset storage resource value, obtaining the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and determining the ratio of the storage resource usage of the volume in the last dynamic adjustment cycle to the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle; Determining a storage resource value to be allocated for the volume based on the ratio and the storage resource information; Based on the value of the storage resource to be allocated of the volume, storage resources are allocated to the volume.

3. The method according to claim 2, characterized in that The method further comprises: When the dynamic adjustment period has not been reached and a mount operation is performed on any volume in the volume group, obtaining the storage resource usage of the volume on which the mount operation is performed in the previous dynamic adjustment period and the storage resource usage of other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment period; In a case where the storage resource usage of the volume on which the mount operation is performed in the last dynamic adjustment cycle is a preset storage resource value, determining the storage resource value to be allocated of the volume on which the mount operation is performed as a minimum storage resource value; Obtaining the total amount of storage resource usage of all volumes in the volume group in a previous dynamic adjustment cycle, and determining the proportion of the storage resource usage of the other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment cycle to the total amount of storage resource usage of all volumes in the volume group in a previous dynamic adjustment cycle based on the storage resource usage of the other volumes in the volume group except the volume on which the mount operation is performed in the previous dynamic adjustment cycle and the total amount of storage resource usage of all volumes in the volume group in a previous dynamic adjustment cycle; Based on the ratio and the storage resource information, the storage resource values ​​to be allocated of the volumes other than the volume on which the mount operation is performed in the volume group are determined.

4. The method according to claim 2, characterized in that: The method further comprises: When the dynamic adjustment cycle has not been reached and any volume in the volume group is subjected to an unloading operation, determining that the storage resource usage of the volume subjected to the unloading operation in the previous dynamic adjustment cycle is a preset storage resource usage value, and determining that the storage resource value to be allocated of the volume subjected to the unloading operation is a preset storage resource value; Obtaining the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, and based on the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle, determining the proportion of the storage resource usage of the other volumes in the volume group except the volume on which the unloading operation is performed and the total storage resource usage of all volumes in the volume group in the last dynamic adjustment cycle; Based on the ratio and the storage resource information, the storage resource values ​​to be allocated of the volumes other than the volume on which the unmount operation is performed in the volume group are determined.

5. The method according to claim 2, characterized in that: The method further comprises: In a case where the resource allocation strategy is dynamic allocation and the current dynamic adjustment period is an initial dynamic adjustment period, determining the number of volumes in the volume group based on the volume list information of the volume group; Based on the number of volumes in the volume group and the storage resource information, a storage resource value to be allocated for each volume in the volume group is determined.

6. The method according to claim 1, characterized in that The obtaining of the storage resource information and resource allocation strategy of the volume group includes: In response to the status opening operation, obtaining volume list information of the volume group; Based on the volume list information of the volume group, modifying the switch state of the metadata information of each volume in the volume group to an on state; When the switch state of the metadata information of each volume in the volume group is modified to the on state, determining that the switch state of the metadata information of the volume group is the on state; When the switch state of the metadata information of the volume group is on, storage resource information and resource allocation strategy of the volume group are acquired, wherein the metadata information includes storage resource information and resource allocation strategy.

7. The method according to claim 1, characterized in that The storage resource information is the number of read and write operations per second and the bandwidth value.

8. A resource allocation device, characterized in that: The device comprises: A first acquisition module, used for acquiring storage resource information and resource allocation strategy of any volume group; A first determination module, configured to determine the number of volumes in the volume group based on the volume list information of the volume group when the resource allocation strategy is average allocation; a second determining module, configured to determine a storage resource value to be allocated for each volume in the volume group based on the number of volumes in the volume group and the storage resource information; The first allocation module is used to allocate corresponding storage resources to each volume based on the value of the storage resource to be allocated.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the resource allocation method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the resource allocation method according to any one of claims 1 to 7.