Load capacity balancing method, device, equipment and storage medium based on layout
By calculating the average residual capacity and equalization rate of each target during the storage period, determining the target storage object and writing IO, the problem of uneven capacity proportion caused by the limitations of layout algorithms and uneven IO size in the prior art is solved, and the balance of target capacity in the cluster is achieved.
Patent Information
- Application Number
- CN202311659839.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2025-05-20
- Estimated Expiration
- 2043-12-04
AI Technical Summary
The limitations of layout algorithms and uneven IO size in the prior art lead to uneven share of target capacity.
By calculating the average remaining capacity and the first remaining capacity equalization rate of the global target during the storage period, as well as the average remaining capacity and the second remaining capacity equalization rate of the target on each storage object, the target is determined and its IO is written to the corresponding target to achieve equalization of the global target capacity.
The target capacity balance is achieved in the entire cluster, and the uneven capacity proportion caused by the limitations of layout algorithms and the uneven IO size.
Smart Images

Figure CN117806817B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage, and particularly to a layout-based load capacity balancing method, device, equipment, and computer-readable storage medium. Background Art
[0002] During the application of hard disks, in order to better utilize the write performance of hard disks, the common practice in the industry is to redirect (ROW) the data written to the hard disk pool objects together and aggregate them into large IOs, and then write them sequentially to the objects allocated by the hard disk pool. When writing to different storages of the hard disk pool, it will be hashed to different storage disks (targets) based on the data layout algorithm. However, due to the limitations of the layout algorithm or the imbalance of the IO sizes, the capacity ratios of each target are unbalanced. Summary of the Invention
[0003] The present application provides a layout-based load capacity balancing method, device, equipment, and computer-readable storage medium, which can solve the technical problem in the prior art that due to the limitations of the layout algorithm or the imbalance of the IO sizes, the capacity ratios of each target are unbalanced.
[0004] In a first aspect, an embodiment of the present application provides a layout-based load capacity balancing method, and the layout-based load capacity balancing method includes:
[0005] Calculating the average remaining capacity of the global target and the first remaining capacity balance rate during the storage period, as well as the average remaining capacity of the target on each storage object and the second remaining capacity balance rate;
[0006] Determining a target storage object according to the average remaining capacity of the global target and the first remaining capacity balance rate, and the average remaining capacity of the target on each storage object and the second remaining capacity balance rate;
[0007] Writing the IO of the target storage object to the corresponding target to balance the capacity on the global target during the storage period.
[0008] In combination with the first aspect, in an implementation manner, the determining a target storage object according to the average remaining capacity of the global target and the first remaining capacity balance rate, and the average remaining capacity of the target on each storage object and the second remaining capacity balance rate includes:
[0009] Determining whether the first remaining capacity balance rate of the global target meets a first preset condition according to the average remaining capacity of the global target and a preset adjustment table;
[0010] If the first remaining capacity balance rate of the global target satisfies the first preset condition, determine a target storage object according to the average remaining capacity of the global target and the average remaining capacity of the targets on each of the storage objects, and / or according to the first remaining capacity balance rate of the global target and the second remaining capacity balance rate of the targets on each of the storage objects.
[0011] Combined with the first aspect, in an implementation, after determining whether the first remaining capacity balance rate of the global target satisfies the condition, it further includes:
[0012] If the first remaining capacity balance rate of the global target does not satisfy the first preset condition, determine the third remaining capacity balance rate of the global target based on the preset adjustment table;
[0013] Determine a target storage object according to the average remaining capacity of the global target and the average remaining capacity of the targets on each of the storage objects, and / or according to the third remaining capacity balance rate of the global target and the second remaining capacity balance rate of the targets on each of the storage objects.
[0014] Combined with the first aspect, in an implementation, determining whether the first remaining capacity balance rate of the global target satisfies the first preset condition according to the average remaining capacity of the global target and the preset adjustment table includes:
[0015] Determine the third remaining capacity balance rate corresponding to the average remaining capacity of the global target in the preset adjustment table;
[0016] If the third remaining capacity balance rate is greater than or equal to the first remaining capacity balance rate, determine that the first remaining capacity balance rate of the global target satisfies the first preset condition;
[0017] If the third remaining capacity balance rate is less than the first remaining capacity balance rate, determine that the first remaining capacity balance rate of the global target does not satisfy the first preset condition.
[0018] Combined with the first aspect, in an implementation, calculating the average remaining capacity and the first remaining capacity balance rate of the global target during the storage period, and the average remaining capacity and the second remaining capacity balance rate of the targets on each storage object includes:
[0019] Obtain the number of global targets and the capacity information of the global targets during the storage period, and obtain the number of targets on each storage object and the capacity information of the targets on each storage object;
[0020] Calculate the average remaining capacity and the first remaining capacity balance rate of the global targets during the storage period according to the number of global targets and the capacity information of the global targets during the storage period, where the capacity information of the global targets includes the total capacity information and the used capacity information of each target in the global;
[0021] Calculate the average remaining capacity and the second remaining capacity balance rate of the targets on each storage object according to the number of targets on each storage object and the capacity information of the targets on each storage object, where the capacity information of the targets on the storage object includes the total capacity information and the used capacity information of the targets on the storage object.
[0022] Combined with the first aspect, in one implementation, the number of target storage objects is at least 1.
[0023] Combined with the first aspect, in one implementation, when the number of target storage objects is multiple, sort according to the average remaining capacity of the targets on each target storage object, and perform IO writes in descending order of the average remaining capacity in sequence.
[0024] In a second aspect, an embodiment of the present application provides a layout-based load capacity balancing device, and the layout-based load capacity balancing device includes:
[0025] A calculation module, configured to calculate the average remaining capacity and the first remaining capacity balance rate of the global targets during the storage period, and the average remaining capacity and the remaining capacity balance rate of the targets on each storage object;
[0026] A determination module, configured to determine a target storage object according to the average remaining capacity and the first remaining capacity balance rate of the global targets, and the average remaining capacity and the remaining capacity balance rate of the targets on each storage object;
[0027] A capacity balancing module, configured to write the IO of the target storage object to the corresponding target to balance the capacity on the global targets during the storage period.
[0028] In a third aspect, an embodiment of the present application provides a layout-based load capacity balancing device, and the layout-based load capacity balancing device includes a processor, a memory, and a layout-based load capacity balancing program stored on the memory and executable by the processor. When the layout-based load capacity balancing program is executed by the processor, the steps of the layout-based load capacity balancing method as described above are implemented.
[0029] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a layout-based load capacity balancing program is stored. When the layout-based load capacity balancing program is executed by a processor, the steps of the above-mentioned layout-based load capacity balancing method are implemented.
[0030] The beneficial effects brought by the technical solutions provided by the embodiments of the present application include:
[0031] By calculating the average remaining capacity of the global target and the first remaining capacity balance rate within the storage cycle, as well as the average remaining capacity of the target on each storage object and the second remaining capacity balance rate; determining the target storage object according to the average remaining capacity of the global target and the first remaining capacity balance rate, and the average remaining capacity of the target on each storage object and the second remaining capacity balance rate; writing the IO of the target storage object to the corresponding target, so as to balance the capacity on the global target within the storage cycle, the technical problem of unbalanced capacity ratios of each target caused by the limitations of the layout algorithm or the uneven size of IO in the related art is solved, and the balance of the target capacity under the entire cluster is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic flowchart of an embodiment of the layout-based load capacity balancing method of the present application;
[0033] Figure 2 It is a schematic diagram of the functional modules of an embodiment of the layout-based load capacity balancing device of the present application;
[0034] Figure 3 It is a schematic diagram of the hardware structure of the layout-based load capacity balancing device involved in the solution of the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0036] First, some technical terms in the present application are explained to facilitate the understanding of the present application by those skilled in the art.
[0037] To make the objectives, technical solutions, and advantages of this application more clear, the following will further describe the embodiments of this application in detail with reference to the accompanying drawings.
[0038] In a first aspect, an embodiment of this application provides a layout-based load capacity balancing method.
[0039] In one embodiment, referring to Figure 1 , Figure 1 is a schematic flowchart of an embodiment of the layout-based load capacity balancing method of this application. As Figure 1 shown, the layout-based load capacity balancing method includes:
[0040] S10: Calculate the average remaining capacity and the first remaining capacity balance rate of the global target during the storage period, and the average remaining capacity and the second remaining capacity balance rate of the target on each storage object;
[0041] Exemplarily, obtain the number and capacity information of the global target during the storage period, and obtain the number and capacity information of the target on each storage object. According to the number and capacity information of the global target during the storage period, calculate the average remaining capacity and the first remaining capacity balance rate of the global target during the storage period, where the capacity information of the global target includes the total capacity information and the used capacity information of each target in the global. For example, obtain the total capacity information and the used capacity information of each target in the global, and calculate the remaining capacity ratio of each target in the global. Invoke the first preset formula E n1 =(T n1 -U n1 )÷T n1 , where E n1 is the remaining capacity ratio of the first target in the global, T n1 is the total capacity of the first target in the global, and U n1 is the used capacity of the first target in the global. After obtaining the remaining capacity ratio of each target in the global, obtain the average remaining capacity of the global target according to the number of targets in the global. For example, invoke the second preset formula where G 1 is the average remaining capacity of the global target, E n is the remaining capacity ratio of each target in the global, and N 1is the number of targets in the global scope. After obtaining the average remaining capacity of the global targets, based on the average remaining capacity of the global targets, the remaining capacity ratios of each target in the global scope, and the number of targets in the global scope, the first remaining capacity balance rate is obtained. For example, obtain the third preset formula where G 1 is the average remaining capacity of the global targets, E n is the remaining capacity ratio of each target in the global scope, N 1 is the number of targets in the global scope, M 1 is the first remaining capacity balance rate.
[0042] According to the number of targets on each storage object and the capacity information of the targets on each storage object, calculate the average remaining capacity of the targets on each storage object and the second remaining capacity balance rate, where the capacity information of the targets on the storage object includes the total capacity information and the used capacity information of the targets on the storage object. For example, obtain the total capacity information and the used capacity information of each target on the storage object, and calculate the remaining capacity ratio of each target on the storage object. Invoke the fourth preset formula E n2 =(T n2 -U n2 )÷T n2 where E n2 is the remaining capacity ratio of the first target on any storage object, T n2 is the total capacity of the first target on any storage object, U n2 is the used capacity of the first target on any storage object. After obtaining the remaining capacity ratios of each target on any storage object, based on the number of targets on any storage object, obtain the average remaining capacity of the targets on any storage object. For example, invoke the fifth preset formula where G 2 is the average remaining capacity of the targets on any storage object, E m is the remaining capacity ratio of the targets on any storage object, N 2 is the number of targets in the global scope. After obtaining the average remaining capacity of the targets on any storage object, based on the average remaining capacity of the targets on any storage object, the sum of the remaining capacity ratios of each target on any storage object, and the number of targets on any storage object, obtain the second remaining capacity balance rate. For example, obtain the sixth preset formula where G 2is the average remaining capacity of the target on any storage object, E m is the remaining capacity ratio of each target on any storage object, N 2 is the number of targets on any storage object, M 2 is the second remaining capacity balance rate of the target on any storage object.
[0043] S20: Determine the target storage object according to the average remaining capacity and the first remaining capacity balance rate of the global target, and the average remaining capacity and the second remaining capacity balance rate of the targets on each storage object;
[0044] Exemplarily, compare the average remaining capacity of the targets on each storage object with the average remaining capacity of the global target, and determine that the storage object with an average remaining capacity greater than that of the global target is the target storage object; and / or, compare the second remaining capacity balance rate of the targets on each storage object with the first remaining capacity balance rate of the global target, and determine that the storage object with a second remaining capacity balance rate less than the first remaining capacity balance rate of the global target is the target storage object, and discard the storage objects determined not to be the target storage objects.
[0045] Specifically, the step of determining the target storage object according to the average remaining capacity and the first remaining capacity balance rate of the global target, and the average remaining capacity and the second remaining capacity balance rate of the targets on each storage object includes: determining whether the first remaining capacity balance rate of the global target meets the first preset condition according to the average remaining capacity of the global target and the preset adjustment table; if the first remaining capacity balance rate of the global target meets the first preset condition, then determine the target storage object according to the average remaining capacity of the global target and the average remaining capacity of the targets on each storage object, and / or according to the first remaining capacity balance rate of the global target and the second remaining capacity balance rate of the targets on each storage object, and discard the storage objects determined not to be the target storage objects.
[0046] Exemplarily, obtain the preset adjustment table, query the remaining capacity balance rate corresponding to the average remaining capacity of the global target in the preset adjustment table, compare the remaining capacity balance rate queried in the preset adjustment table with the first remaining capacity balance rate of the global target, and determine whether it meets the first preset condition. For example, obtain the adjustment table shown as follows:
[0047] Average remaining capacity 0≤G<50% 50%≤G<70% 70%≤G<80% 80%≤G<100% Remaining capacity balance rate 10% 8% 5% 3%
[0048] If the average remaining capacity of the global target is 55%, query the remaining capacity balance rate corresponding to 55% of the average remaining capacity of the global target in the preset adjustment table. If the first remaining capacity balance rate of the global target is less than 8%, it is determined that the first remaining capacity balance rate of the global target meets the first preset condition; if the first remaining capacity balance rate of the global target is greater than or equal to 8%, it is determined that the first remaining capacity balance rate of the global target does not meet the first preset condition, and 8% is taken as the third remaining capacity balance rate of the global target. Compare the average remaining capacity of the target on each storage object with the average remaining capacity of the global target, and determine the storage object with an average remaining capacity greater than that of the global target as the target storage object; and / or, compare the second remaining capacity balance rate of the target on each storage object with the first remaining capacity balance rate of the global target, and determine the storage object with a second remaining capacity balance rate less than the first remaining capacity balance rate of the global target as the target storage object, and discard the storage object determined not to be the target storage object.
[0049] Specifically, after determining whether the first remaining capacity balance rate of the global target meets the first preset condition, it further includes: if the first remaining capacity balance rate of the global target does not meet the first preset condition, determine the third remaining capacity balance rate of the global target based on the preset adjustment table; determine the target storage object according to the average remaining capacity of the global target and the average remaining capacity of the target on each storage object, and / or, according to the third remaining capacity balance rate of the global target and the second remaining capacity balance rate of the target on each storage object.
[0050] Exemplarily, if the first remaining capacity balance rate of the global target is greater than or equal to 8%, it is determined that the first remaining capacity balance rate of the global target does not meet the first preset condition, and 8% is taken as the third remaining capacity balance rate of the global target. Compare the average remaining capacity of the target on each storage object with the average remaining capacity of the global target, and determine the storage object with an average remaining capacity greater than that of the global target as the target storage object; and / or, compare the second remaining capacity balance rate of the target on each storage object with the third remaining capacity balance rate of the global target, and determine the storage object with a second remaining capacity balance rate less than the third remaining capacity balance rate of the global target as the target storage object, and discard the storage object determined not to be the target storage object.
[0051] S30: Write the I / O of the target storage object to the corresponding target to balance the capacity on the global target during the storage cycle.
[0052] Exemplarily, the number of target storage objects is at least 1. When the number of target storage objects is multiple, they are sorted according to the average remaining capacity of the target on each target storage object, and the IO is written to the corresponding target in descending order of the average remaining capacity until all the multiple target storage objects are exhausted, so as to balance the capacity on the global target during the storage period.
[0053] In this embodiment, by calculating the average remaining capacity ratio and balance rate of the storage objects, and dynamically adjusting the written storage objects in combination with the sorting algorithm, the capacity balance on the local target is ensured, and finally the capacity balance of the target under the entire cluster is achieved, solving the technical problem that the limitations of the layout algorithm or the imbalance of the IO size in the related art lead to the imbalance of the capacity ratio of each target.
[0054] In a second aspect, the embodiments of the present application further provide a load capacity balancing device based on layout.
[0055] In one embodiment, referring to Figure 2 , Figure 2 is a schematic diagram of the functional modules of an embodiment of the load capacity balancing device based on layout of the present application. As Figure 2 shown, the load capacity balancing device based on layout includes:
[0056] A calculation module 10, configured to calculate the average remaining capacity and the first remaining capacity balance rate of the global target during the storage period, as well as the average remaining capacity and the remaining capacity balance rate of the target on each storage object;
[0057] A determination module 20, configured to determine target storage objects according to the average remaining capacity and the first remaining capacity balance rate of the global target, and the average remaining capacity and the remaining capacity balance rate of the target on each storage object;
[0058] A capacity balancing module 30, configured to write the IO of the target storage object to the corresponding target, so as to balance the capacity on the global target during the storage period.
[0059] Further, in one embodiment, the determination module 20 is configured to:
[0060] Determine whether the first remaining capacity balance rate of the global target meets a first preset condition according to the average remaining capacity of the global target and a preset adjustment table;
[0061] If the first remaining capacity balance rate of the global target satisfies the first preset condition, determine the target storage object according to the average remaining capacity of the global target and the average remaining capacity of the targets on each of the storage objects, and / or according to the first remaining capacity balance rate of the global target and the second remaining capacity balance rate of the targets on each of the storage objects.
[0062] Further, in an embodiment, the determining module 20 is configured to:
[0063] If the first remaining capacity balance rate of the global target does not satisfy the first preset condition, determine the third remaining capacity balance rate of the global target based on the preset adjustment table;
[0064] Determine the target storage object according to the average remaining capacity of the global target and the average remaining capacity of the targets on each of the storage objects, and / or according to the third remaining capacity balance rate of the global target and the second remaining capacity balance rate of the targets on each of the storage objects.
[0065] Further, in an embodiment, the determining module 20 is configured to:
[0066] Determine the third remaining capacity balance rate corresponding to the average remaining capacity of the global target in the preset adjustment table;
[0067] If the third remaining capacity balance rate is greater than or equal to the first remaining capacity balance rate, determine that the first remaining capacity balance rate of the global target satisfies the first preset condition;
[0068] If the third remaining capacity balance rate is less than the first remaining capacity balance rate, determine that the first remaining capacity balance rate of the global target does not satisfy the first preset condition.
[0069] Further, in an embodiment, the calculating module 10 is configured to:
[0070] Obtain the number of global targets and the capacity information of the global targets during the storage period, and obtain the number of targets on each of the second storage objects and the capacity information of the targets on each of the storage objects;
[0071] According to the number of global targets and the capacity information of the global targets during the storage period, calculate the average remaining capacity and the first remaining capacity balance rate of the global targets during the storage period, where the capacity information of the global targets includes the total capacity information and the used capacity information of each target in the global.
[0072] According to the number of targets on each of the storage objects and the capacity information of the targets on each of the storage objects, calculate the average remaining capacity of the targets on each of the storage objects and the second remaining capacity balance rate, where the capacity information of the targets on the storage object includes the total capacity information and the used capacity information of the targets on the storage object.
[0073] Further, in one embodiment, the load capacity balancing device based on layout further includes: the number of the target storage objects is at least 1.
[0074] Further, in one embodiment, the load capacity balancing device based on layout further includes: when the number of the target storage objects is multiple, sort according to the average remaining capacity of the targets on each of the target storage objects, and perform IO writes in order from the largest to the smallest average remaining capacity.
[0075] Wherein, the function implementation of each module in the above load capacity balancing device based on layout corresponds to each step in the above embodiment of the load capacity balancing method based on layout, and its function and implementation process will not be elaborated here one by one.
[0076] In a third aspect, an embodiment of the present application provides a load capacity balancing device based on layout. The load capacity balancing device based on layout may be a device with data processing functions such as a personal computer (PC), a laptop computer, a server, etc.
[0077] Refer to Figure 3 , Figure 3 This is a schematic diagram of the hardware structure of the load capacity balancing device based on layout involved in the solution of the embodiment of the present application. In the embodiment of the present application, the load capacity balancing device based on layout may include a processor, a memory, a communication interface, and a communication bus.
[0078] Wherein, the communication bus can be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0079] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, etc., which are used to implement the interconnection of components inside the load capacity balancing device, and interfaces used to implement the interconnection of the load capacity balancing device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0080] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical memory, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0081] The processor can be a general-purpose processor, which can call the layout-based load capacity balancing program stored in the memory and execute the layout-based load capacity balancing method provided by the embodiments of the present application. For example, the general-purpose processor can be a central processing unit (CPU). Among them, the method executed when the layout-based load capacity balancing program is called can refer to the various embodiments of the layout-based load capacity balancing method of the present application, which will not be elaborated here.
[0082] Those skilled in the art can understand that Figure 3 the hardware structure shown in does not constitute a limitation to the present application, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0083] In a fourth aspect, the embodiments of the present application further provide a computer-readable storage medium.
[0084] The layout-based load capacity balancing program is stored on the computer-readable storage medium of the present application. When the layout-based load capacity balancing program is executed by a processor, the steps of the layout-based load capacity balancing method as described above are implemented.
[0085] Among them, the method implemented when the layout-based load capacity balancing program is executed can refer to the various embodiments of the layout-based load capacity balancing method of the present application, which will not be elaborated here.
[0086] It should be noted that the serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0087] In the description of the specification, claims and the above-mentioned drawings of this application, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally further include steps or units not listed, or may optionally further include other steps or units inherent to these processes, methods, products or devices. Descriptions such as "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit that "first", "second" and "third" are different types.
[0088] In the description of the embodiments of this application, "exemplary", "for example" or "for instance" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary", "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary", "for example" or "for instance" is intended to present relevant concepts in a specific manner.
[0089] In the description of the embodiments of this application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; "and / or" in the text is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "a plurality of" means two or more than two.
[0090] In some processes described in the embodiments of this application, there are a plurality of operations or steps that appear in a specific order. However, it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of this application or may be executed in parallel. The serial numbers of the operations are only used to distinguish different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0091] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to enable a terminal device to execute the methods described in the various embodiments of this application.
[0092] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.
Claims
1. A load capacity balancing method based on layout, characterized in that: The layout-based load capacity balancing method includes: Calculate the average remaining capacity and the first remaining capacity balancing ratio of the global target during the storage cycle, as well as the average remaining capacity and the second remaining capacity balancing ratio of the target on each storage object; The calculation of the average remaining capacity and the first remaining capacity balancing ratio of the global target in the storage cycle, and the average remaining capacity and the second remaining capacity balancing ratio of the target on each storage object, includes: Obtaining the number of global targets and capacity information of the global targets within a storage cycle, and obtaining the number of targets on each storage object and capacity information of the targets on each storage object; According to the number of global targets in the storage period and the capacity information of the global targets, the average remaining capacity of the global targets in the storage period and the first remaining capacity balancing rate are calculated, wherein the capacity information of the global targets includes the total capacity information and the used capacity information of each target in the global, and the first remaining capacity balancing rate includes obtaining the third preset formula Where G1 is the average remaining capacity of the global target, where the average remaining capacity of the global target is calculated based on the remaining capacity ratio of each target in the global and the number of targets in the global. n is the remaining capacity ratio of each target in the global system, which is calculated based on the total capacity information and used capacity information of each target in the global system, N1 is the number of targets in the global system, and M1 is the first remaining capacity balancing rate; According to the number of targets on each of the storage objects and the capacity information of the targets on each of the storage objects, the average remaining capacity of the targets on each of the storage objects and the second remaining capacity balancing ratio are calculated, wherein the capacity information of the targets on the storage objects includes the total capacity information and the used capacity information of the targets on the storage objects, wherein the calculation of the second remaining capacity balancing ratio includes obtaining a sixth preset formula Wherein, G2 is the average remaining capacity of the target on any storage object, and the average remaining capacity of the target on any storage object is calculated based on the remaining capacity ratio of each target on any storage object and the number of targets on any storage object, E m is the remaining capacity ratio of each target on any storage object, the remaining capacity ratio of each target on any storage object is calculated according to the total capacity information and used capacity information of each target in the global, N2 is the number of targets on any storage object, and M2 is the second remaining capacity balancing ratio of the target on any storage object; Determine the target storage object according to the average remaining capacity and the first remaining capacity balancing rate of the global target, the average remaining capacity and the second remaining capacity balancing rate of the targets on each of the storage objects, wherein determining the target storage object comprises comparing the average remaining capacity of the targets on each of the storage objects with the average remaining capacity of the global target, and determining that the storage object having an average remaining capacity greater than the global target is the target storage object; and / or comparing the second remaining capacity balancing rate of the targets on each of the storage objects with the first remaining capacity balancing rate of the global target, and determining that the storage object having a first remaining capacity balancing rate less than the global target is the target storage object; The IO of the target storage object is written to the corresponding target, so that the capacity on the global target is balanced during the storage cycle.
2. The layout-based load capacity balancing method according to claim 1, characterized in that: The determining the target storage object according to the average remaining capacity and the first remaining capacity balancing ratio of the global target, the average remaining capacity and the second remaining capacity balancing ratio of the targets on each of the storage objects comprises: Determining whether a first remaining capacity balancing rate of the global target satisfies a first preset condition according to an average remaining capacity of the global target and a preset adjustment table; If the first remaining capacity balancing ratio of the global target satisfies the first preset condition, the target storage object is determined according to the average remaining capacity of the global target and the average remaining capacity of the targets on each of the storage objects, and / or according to the first remaining capacity balancing ratio of the global target and the second remaining capacity balancing ratio of the targets on each of the storage objects.
3. The layout-based load capacity balancing method according to claim 2, characterized in that: After determining whether the first remaining capacity balancing ratio of the global target satisfies the first preset condition, the method further includes: If the first remaining capacity balancing ratio of the global target does not meet the first preset condition, determining a third remaining capacity balancing ratio of the global target based on the preset adjustment table; The target storage object is determined according to the average remaining capacity of the global target and the average remaining capacity of the targets on each of the storage objects, and / or according to the third remaining capacity balancing ratio of the global target and the second remaining capacity balancing ratio of the targets on each of the storage objects.
4. The layout-based load capacity balancing method according to claim 2, characterized in that: The determining, according to the average remaining capacity of the global target and the preset adjustment table, whether the first remaining capacity balancing rate of the global target satisfies a first preset condition includes: Determine a third remaining capacity balancing rate corresponding to the average remaining capacity of the global target in the preset adjustment table; If the third remaining capacity balancing ratio is greater than or equal to the first remaining capacity balancing ratio, determining that the first remaining capacity balancing ratio of the global target satisfies a first preset condition; If the third remaining capacity balancing ratio is less than the first remaining capacity balancing ratio, it is determined that the first remaining capacity balancing ratio of the global target does not satisfy the first preset condition.
5. The layout-based load capacity balancing method according to claim 1, characterized in that: The number of the target storage objects is at least 1.
6. The layout-based load capacity balancing method according to claim 1, characterized in that: When there are multiple target storage objects, the target storage objects are sorted according to their average remaining capacities, and IO writing is performed in descending order of the average remaining capacities.
7. A load capacity balancing device based on layout, characterized in that: The layout-based load capacity balancing device includes: A calculation module, used to calculate the average remaining capacity and the first remaining capacity balance rate of the global target in the storage cycle, as well as the average remaining capacity and the remaining capacity balance rate of the target on each storage object; The calculation of the average remaining capacity and the first remaining capacity balancing ratio of the global target in the storage cycle, and the average remaining capacity and the second remaining capacity balancing ratio of the target on each storage object, includes: Obtaining the number of global targets and capacity information of the global targets within a storage cycle, and obtaining the number of targets on each storage object and capacity information of the targets on each storage object; According to the number of global targets in the storage period and the capacity information of the global targets, the average remaining capacity of the global targets in the storage period and the first remaining capacity balancing rate are calculated, wherein the capacity information of the global targets includes the total capacity information and the used capacity information of each target in the global, and the first remaining capacity balancing rate includes obtaining the third preset formula Where G1 is the average remaining capacity of the global target, where the average remaining capacity of the global target is calculated based on the remaining capacity ratio of each target in the global and the number of targets in the global. n is the remaining capacity ratio of each target in the global system, which is calculated based on the total capacity information and used capacity information of each target in the global system, N1 is the number of targets in the global system, and M1 is the first remaining capacity balancing rate; According to the number of targets on each of the storage objects and the capacity information of the targets on each of the storage objects, the average remaining capacity of the targets on each of the storage objects and the second remaining capacity balancing ratio are calculated, wherein the capacity information of the targets on the storage objects includes the total capacity information and the used capacity information of the targets on the storage objects, wherein the calculation of the second remaining capacity balancing ratio includes obtaining a sixth preset formula Wherein, G2 is the average remaining capacity of the target on any storage object, and the average remaining capacity of the target on any storage object is calculated based on the remaining capacity ratio of each target on any storage object and the number of targets on any storage object, E m is the remaining capacity ratio of each target on any storage object, the remaining capacity ratio of each target on any storage object is calculated according to the total capacity information and used capacity information of each target in the global, N2 is the number of targets on any storage object, and M2 is the second remaining capacity balancing ratio of the target on any storage object; A determination module, configured to determine a target storage object according to an average remaining capacity and a first remaining capacity balancing rate of the global target, an average remaining capacity and a remaining capacity balancing rate of targets on each of the storage objects, wherein determining the target storage object comprises comparing the average remaining capacity of targets on each of the storage objects with the average remaining capacity of the global target, and determining that a storage object having an average remaining capacity greater than that of the global target is the target storage object; and / or comparing the second remaining capacity balancing rate of targets on each of the storage objects with the first remaining capacity balancing rate of the global target, and determining that a storage object having a first remaining capacity balancing rate less than that of the global target is the target storage object; The capacity balancing module is used to write the IO of the target storage object to the corresponding target, so as to balance the capacity on the global target within the storage cycle.
8. A layout-based load capacity balancing device, characterized in that: The layout-based load capacity balancing device includes a processor, a memory, and a layout-based load capacity balancing program stored in the memory and executable by the processor, wherein when the layout-based load capacity balancing program is executed by the processor, the steps of the layout-based load capacity balancing method as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a layout-based load capacity balancing program, wherein when the layout-based load capacity balancing program is executed by a processor, the steps of the layout-based load capacity balancing method as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
File storage method and device, storage management equipment and storage medium
CN110275873A
Storage capacity balancing method and device and object storage method and device
CN110633053A