Disk capacity balancing method and device and computer equipment

By obtaining the usage capacity of disks and partition copies in the Kafka cluster, calculating the balanced capacity range, and automatically adjusting the location of the partition copies, it solves the problem of uneven disk usage in the Kafka cluster, achieves capacity balancing in a multi-disk environment, and improves Improve system performance and management efficiency.

CN118860293APending Publication Date: 2024-10-29SUZHOU LANGDONG NET TEC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411198933.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

The imbalance of partition traffic in the Kafka cluster leads to uneven disk usage. Existing technology cannot effectively balance disk capacity in a multi-disk environment, which increases maintenance complexity.

Method used

Determine the initial balancing capacity by obtaining the usage capacity of the target agent node disk and partition copy, and use the preset balancing range coefficient to calculate the target balancing capacity range, select the partition copy from the disk with high usage capacity, and add it to the disk with low usage capacity. In the disk, the disk capacity is automatically balanced.

Benefits of technology

Effectively utilize storage resources to avoid disk overload and idleness, improve storage system efficiency and reliability, reduce administrator workload, and improve data management accuracy and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860293A_ABST
    Figure CN118860293A_ABST
Patent Text Reader

Abstract

The invention relates to a disk capacity balancing method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring the use capacity of a target agent node disk and the use capacity of a partition copy corresponding to the disk; determining the initial equilibrium capacity of the disk according to the use capacity of the disk; according to the initial balance capacity, obtaining a target balance capacity range of the disk by using a preset balance range coefficient; under the condition that the use capacity of the disk is larger than the target balance capacity range, partition copies are selected from the disk, and the partition copies are added into the disk with the use capacity smaller than the target balance capacity. By adopting the method, the use capacity balance among multiple disks can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a disk capacity balancing method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of distributed computing, distributed stream processing platforms such as Kafka have emerged. Kafka has been widely used in various scenarios, for example, using its high throughput to collect different types of data, and distributing messages to multiple brokers (agent nodes) to ensure that the system remains available when brokers fail. However, during the operation of the Kafka cluster, the imbalance of partition traffic often leads to uneven disk usage of each node. Since Kafka itself does not provide a mechanism for migrating partition replicas based on disk usage, it faces great complexity in maintaining the Kafka cluster.

[0003] To address this problem, there are some balancing methods for single nodes and single disks in the prior art, which can effectively adjust the usage capacity of a single disk. However, these methods cannot meet the balancing requirements in a multi-disk environment and are difficult to adapt to the ever-changing multi-disk environment. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product that can balance disk capacity in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for balancing disk capacity. The method comprises:

[0006] Obtain the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk;

[0007] Determining the initial balanced capacity of the disk according to the used capacity of the disk;

[0008] According to the initial balanced capacity, using a preset balanced range coefficient, obtaining a target balanced capacity range of the disk;

[0009] In the case that the used capacity of the disk is greater than the target balanced capacity range, a partition copy is selected from the disk, and the partition copy is added to a disk whose used capacity is less than the target balanced capacity.

[0010] In one embodiment, selecting a partition copy from the disk includes:

[0011] sorting the partition copies according to the usage capacity of the partition copies corresponding to the disk;

[0012] Selecting the partition replica with the smallest used capacity from the partition replicas in sequence;

[0013] When the used capacity of the disk meets the target balanced capacity range, the selection is stopped.

[0014] In one embodiment, obtaining the target balanced capacity range of the disk using a preset balanced range coefficient according to the initial balanced capacity includes:

[0015] Performing product processing on the balancing range coefficient and the initial balancing capacity to obtain an error range;

[0016] The error range and the initial balancing capacity are summed to obtain an upper limit of a target balancing capacity range;

[0017] The initial balancing capacity and the error range are subjected to difference processing to obtain a lower limit of a target balancing capacity range.

[0018] In one embodiment, obtaining the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk includes:

[0019] Use the node monitor to obtain the disk usage capacity;

[0020] The distributed stream processing platform monitor is used to obtain the usage capacity of the partition replica corresponding to the disk.

[0021] In one of the embodiments, adding the partition replica to a disk whose used capacity is smaller than the target balanced capacity includes:

[0022] The used capacity of the partition replica and the used capacity of the disk whose used capacity is smaller than the target balanced capacity range are summed to obtain the used capacity of the disk after adding;

[0023] When the used capacity of the added disk is less than or meets the target balanced capacity range, the partition copy is added to the disk.

[0024] In one embodiment, determining the initial balanced capacity of the disk according to the used capacity of the disk includes:

[0025] The used capacity of the target proxy node disk is averaged to obtain the initial balanced capacity of the disk.

[0026] In a second aspect, the present application also provides a disk capacity balancing device. The device comprises:

[0027] A capacity acquisition module, used to acquire the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk;

[0028] An initial balancing module, used to determine the initial balancing capacity of the disk according to the used capacity of the disk;

[0029] A target balancing module, configured to obtain a target balancing capacity range of the disk according to the initial balancing capacity and using a preset balancing range coefficient;

[0030] The disk balancing module is used to select a partition copy from the disk when the used capacity of the disk is greater than the target balancing capacity range, and add the partition copy to a disk whose used capacity is less than the target balancing capacity.

[0031] In one embodiment, the disk balancing module includes:

[0032] A partition sorting submodule, used to sort the partition copies according to the usage capacity of the partition copies corresponding to the disk;

[0033] A partition selection submodule, used to select a partition replica with the smallest usage capacity from the partition replicas in sequence;

[0034] The partition selection submodule is further configured to stop the selection when the used capacity of the disk meets the target balanced capacity range.

[0035] In one embodiment, the target balancing module includes:

[0036] An error determination submodule, used for performing a product processing on the balancing range coefficient and the initial balancing capacity to obtain an error range;

[0037] A target balancing submodule, configured to sum the error range and the initial balancing capacity to obtain an upper limit of a target balancing capacity range;

[0038] The target balancing submodule is further used to perform a difference processing on the initial balancing capacity and the error range to obtain a lower limit of the target balancing capacity range.

[0039] In one embodiment, the capacity acquisition module includes:

[0040] The capacity acquisition submodule is used to obtain the used capacity of the disk using the node monitor;

[0041] The capacity acquisition submodule is further used to acquire the usage capacity of the partition replica corresponding to the disk by using the distributed stream processing platform monitor.

[0042] In one embodiment, the disk balancing submodule includes:

[0043] A capacity acquisition submodule, configured to sum the used capacity of the partition replica and the used capacity of the disk whose used capacity is smaller than the target balanced capacity range, to obtain the used capacity of the disk after adding;

[0044] The partition adding submodule is used to add the partition replica to the disk when the used capacity of the disk after the addition is less than or meets the target balanced capacity range.

[0045] In one embodiment, the initial equalization module includes:

[0046] The initial balancing submodule is used to perform mean processing on the used capacity of the target proxy node disk to obtain the initial balanced capacity of the disk.

[0047] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the disk capacity balancing method as described in any one of the embodiments of the present disclosure is implemented.

[0048] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the disk capacity balancing method as described in any one of the embodiments of the present disclosure is implemented.

[0049] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for balancing the disk capacity as described in any one of the embodiments of the present disclosure is implemented.

[0050] The above-mentioned disk capacity balancing method, device, computer equipment, storage medium and computer program product determine the initial balanced capacity of the disk through the usage capacity of the target proxy node and the usage capacity of the partition copy corresponding to the disk, and obtain the target balanced capacity range according to the preset balance range threshold and the initial balanced capacity, further screen out the disks with usage capacity greater than the target balanced capacity range, and add the partition copy in the disk to the disk with usage capacity less than the target balanced capacity range. Through the above-mentioned method, storage resources can be effectively utilized to avoid the situation where some disks are overloaded while other disks are idle, thereby improving the efficiency and reliability of the storage system; timely adjust the position of the partition copy, reduce the load of the disk, improve the data reading and writing efficiency, and thus improve the overall system performance; manage the capacity in an automated manner, reduce the workload of the administrator, and improve the efficiency and accuracy of data management. By balancing the usage capacity of multiple disks automatically, the usage capacity of multiple disks can be balanced quickly and accurately, and it can also be flexibly adjusted according to actual use to adapt to different load requirements, thereby improving the flexibility and applicability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] FIG1 is a schematic diagram of a flow chart of a disk capacity balancing method in one embodiment;

[0052] FIG2 is a schematic diagram of a process of selecting a partition replica in one embodiment;

[0053] FIG3 is a schematic diagram of a process for determining a target balancing capacity range in one embodiment;

[0054] FIG4 is a schematic diagram of a process of using capacity acquisition in one embodiment;

[0055] FIG5 is a schematic diagram of a process of adding a partition copy to a disk in one embodiment;

[0056] FIG6 is a structural block diagram of a disk capacity balancing device in one embodiment;

[0057] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] In one embodiment, as shown in FIG1 , a disk capacity balancing method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0060] Step S100, obtaining the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk.

[0061] In an exemplary embodiment, the disk capacity balancing method can be applied to Kafka (distributed stream processing platform), etc.; the target proxy node may include a broker node under Kafka, etc.; the used capacity of the disk and the used capacity of the partition replica can be collected through node_exporter, Kafka exporter, etc.

[0062] In an exemplary embodiment, the target proxy node may include multiple broker nodes, that is, obtaining the usage capacity of disks of multiple nodes to achieve balanced usage capacity of multiple nodes and multiple disks.

[0063] Step S200: determining the initial balanced capacity of the disk according to the used capacity of the disk.

[0064] In an exemplary embodiment, the initial balancing capacity may include obtaining the usage size of the entire target proxy node and the number of disks, and obtaining the average usage size of each disk, which is the initial balancing capacity; therefore, here, based on the usage capacity of the disk, determining the initial balancing capacity of the disk may include summing the usage capacity of all disks of the target proxy node to obtain the usage capacity of the target proxy node, taking the quotient of the usage capacity of the target proxy node and the number of disks to obtain the initial balancing capacity of the disk, etc.

[0065] Step S300: According to the initial balanced capacity, a target balanced capacity range of the disk is obtained using a preset balanced range coefficient.

[0066] In an exemplary embodiment, the balancing range coefficient may include a preset error range allowed by a balancing task, etc. It is understandable that after obtaining the initial balancing capacity, it is difficult or even impossible to control each disk to the initial balancing capacity, so adjusting the initial balancing capacity through the balancing range coefficient and further obtaining the target balancing capacity range can not only balance the disk usage capacity, but also quickly meet the balancing effect. Among them, the balancing range coefficient can be preset according to different scenarios, and the error value is obtained through the balancing range coefficient. The initial balancing capacity is summed and subtracted according to the error value to obtain the upper limit and lower limit of the target balancing capacity range, etc.; for example, the initial balancing capacity is 1000GB; the balancing range coefficient is 5%; the error value obtained is 1000GB×5%=50GB; the upper limit of the target balancing capacity range is 1000GB+50GB=1050GB; the lower limit of the target balancing capacity range is 1000GB-50GB=9950GB; so the target balancing capacity range is 9950GB~1050GB, etc.

[0067] Step S400, when the used capacity of the disk is greater than the target balanced capacity range, select a partition copy from the disk, and add the partition copy to a disk whose used capacity is less than the target balanced capacity.

[0068] In an exemplary embodiment, selecting a partition replica from the disk may include selecting a partition replica from a disk whose used capacity is greater than a target balanced capacity range, and adding the partition replica to a disk whose used capacity is less than the target balanced capacity, etc. It is understandable that after taking a partition replica from a disk whose used capacity is greater than the target balanced capacity range, if the disk used capacity is still greater than the target balanced capacity range, then continue to select a partition replica from the disk until the used capacity of the disk is no greater than the target balanced capacity, etc.

[0069] In an exemplary embodiment, selecting a partition copy from the disk and adding the partition copy to the disk whose used capacity is less than the target balancing capacity may include selecting from the disks whose used capacity is greater than the target balancing capacity range, in order from small to large according to the used capacity of the partition copy, until the used capacity of the disk is no greater than the target balancing capacity range; and adding the selected partition copy to the disk whose used capacity is less than the target balancing capacity. It can be understood that after selecting multiple partition copies, the partition copies can be added in sequence to the disks whose used capacity is less than the target balancing capacity, so as to avoid adding all of them at once and causing the used capacity of the disk to be greater than the target balancing capacity after adding.

[0070] In an exemplary embodiment, the used capacity of all disks of the proxy node can be judged to determine whether the used capacity of all disks of the proxy node is greater than the target balanced capacity range. If the used capacity is greater than the target balanced capacity threshold, partition replicas are selected in order from small to large according to their used capacity until the used capacity of all disks is no greater than the target balanced capacity range; and the selected partition replicas are added to the disks whose used capacity is less than the target balanced capacity range.

[0071] In the above disk capacity balancing method, the initial balanced capacity of the disk is determined by the used capacity of the target proxy node and the used capacity of the partition replica corresponding to the disk, and the target balanced capacity range is obtained according to the preset balance range threshold and the initial balanced capacity, and the disk with a used capacity greater than the target balanced capacity range is further screened out, and the partition replica in the disk is added to the disk with a used capacity less than the target balanced capacity range. The above method can effectively utilize storage resources, avoid the situation where some disks are overloaded while other disks are idle, and improve the efficiency and reliability of the storage system; timely adjust the position of the partition replica, reduce the load of the disk, improve the data reading and writing efficiency, and thus improve the overall system performance; manage the capacity in an automated manner, reduce the workload of the administrator, and improve the efficiency and accuracy of data management. By balancing the used capacity of multiple disks automatically, the used capacity of multiple disks can be balanced quickly and accurately, and it can also be flexibly adjusted according to actual use to adapt to different load requirements, thereby improving the flexibility and applicability of the system.

[0072] In one embodiment, as shown in FIG2 , selecting a partition copy from the disk includes:

[0073] Step S401, sorting the partition copies according to the usage capacity of the partition copies corresponding to the disk.

[0074] Step S402: Select the partition replica with the smallest usage capacity from the partition replicas in sequence.

[0075] Step S403, when the used capacity of the disk meets the target balanced capacity range, stop selecting.

[0076] In an exemplary embodiment, the partition copies can be sorted from small to large according to the usage size of the partition copies; it can be understood that filtering out the partition copy with the smallest usage capacity from the disk can avoid multiple movements of the partition copy caused by the partition copy with larger usage capacity; for example, the following situation may occur, causing the disk with a usage capacity greater than the target balanced capacity range to have a usage capacity less than the target balanced capacity range after the partition copy is taken out; or, the usage capacity of the partition copy taken out is too large, causing other disks with a usage capacity less than the target balanced capacity range to be larger than the target balanced capacity range after being added, etc., thereby causing more partition copy movements, etc.

[0077] In an exemplary embodiment, after the partition replicas are sorted, the partition replicas with the smallest used capacity are selected in sequence from the partition replicas until the used capacity of the disk is no greater than the target balanced capacity range.

[0078] In this embodiment, the partition replicas are sorted by using the used capacity of the partition replicas, and the partition replicas with the smallest used capacity are selected in turn. By selecting from the smallest to the largest used capacity, the movement of the partition replicas during the disk balancing process is reduced, and the efficiency and stability of the disk capacity balancing are improved.

[0079] In one embodiment, as shown in FIG. 3 , obtaining the target balanced capacity range of the disk using a preset balanced range coefficient according to the initial balanced capacity includes:

[0080] Step S301, performing product processing on the balancing range coefficient and the initial balancing capacity to obtain an error range.

[0081] Step S302: summing the error range and the initial balancing capacity to obtain an upper limit of a target balancing capacity range.

[0082] Step S303: performing a difference process on the initial balancing capacity and the error range to obtain a lower limit of a target balancing capacity range.

[0083] In an exemplary embodiment, the error range may include a specific error value, etc.; the error = balancing range coefficient × initial balancing capacity; the upper limit of the target balancing capacity = initial balancing capacity + error value; the lower limit of the target balancing capacity = initial balancing capacity - error value; it can be understood that the upper and lower limits of the target balancing capacity constitute the target balancing capacity range, that is, the lower limit of the target balancing capacity ~ the upper limit of the target balancing capacity is the target balancing capacity, etc.

[0084] In this embodiment, the error range is obtained by using the balancing range coefficient and the initial balancing capacity, and further the target balancing capacity range is obtained. The balancing range coefficient can provide a data basis for the target balancing capacity range, thereby improving the accuracy of the target balancing capacity; at the same time, the calculation of the error range also allows the system to adapt to more scenarios, thereby improving the flexibility and applicability of disk balancing.

[0085] In one embodiment, as shown in FIG. 4 , obtaining the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk includes:

[0086] Step S101, using a node monitor to obtain the used capacity of a disk.

[0087] Step S102: using the distributed stream processing platform monitor, obtaining the usage capacity of the partition replica corresponding to the disk.

[0088] In an exemplary embodiment, node_exporter monitoring can be used to obtain the used capacity of the disk. It can be understood that node_exporter can monitor specific disk usage, etc.; Kafka_exporter can be used to obtain the used capacity of the partition copy corresponding to the disk, etc.

[0089] In this embodiment, the node monitor and the distributed stream processing platform monitor are used to obtain the used capacity of the disk and the used capacity of the partition replica corresponding to the disk. The node monitor and the distributed stream processing platform monitor can be used to obtain the use of the disk and partition in real time, and the use of the disk and partition can be accurately obtained, providing an accurate data basis for the subsequent balance of the used capacity of the disk.

[0090] In one embodiment, as shown in FIG. 5 , adding the partition replica to a disk whose used capacity is smaller than the target balanced capacity includes:

[0091] Step S411, summing up the used capacity of the partition replica and the used capacity of the disk whose used capacity is smaller than the target balanced capacity range, to obtain the used capacity of the disk after adding.

[0092] Step S412: When the used capacity of the added disk is less than or meets the target balanced capacity range, add the partition copy to the disk.

[0093] In an exemplary embodiment, before adding a partition copy to a disk whose used capacity is less than the target balancing capacity, the used capacity of the partition copy is summed with the used capacity of the added disk to determine that after the addition, the used capacity of the disk will not be greater than the target balancing capacity range. If it is not greater than the target balancing capacity range, the partition disk is added to the corresponding disk; if it is greater than the target balancing capacity range, the partition copy is not added to the corresponding disk, and the next disk whose used capacity is less than the target balancing capacity is sought, etc.

[0094] In this embodiment, the used capacity of the partition replica is summed with the used capacity of the added disk to obtain the capacity of the disk after the addition, and further determine whether it will be larger than the target balanced capacity range after the addition. This avoids the excessive number of partition replica moves caused by the disk used capacity exceeding the target balanced range after the partition replica is added, effectively reducing the number of partition replica moves and improving the efficiency of disk capacity balancing.

[0095] In one embodiment, determining the initial balanced capacity of the disk according to the used capacity of the disk includes:

[0096] The used capacity of the target proxy node disk is averaged to obtain the initial balanced capacity of the disk.

[0097] In an exemplary embodiment, the initial balanced capacity may include an average value of disk usage capacity, etc.; it is understandable that disk balancing may include disk usage capacity balancing, so the balanced capacity is the average value of disk usage capacity, etc.

[0098] In this embodiment, the initial balanced capacity of the disk is obtained by averaging the used capacity of the target proxy node disk, which provides a benchmark for the target balanced capacity range and a data basis for determining the target balanced capacity range.

[0099] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0100] Based on the same inventive concept, the embodiment of the present application also provides a disk capacity balancing device for implementing the disk capacity balancing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more disk capacity balancing devices provided below can refer to the limitations of the disk capacity balancing method above, and will not be repeated here.

[0101] In one embodiment, as shown in FIG6 , a disk capacity balancing device 100 is provided, comprising: a capacity acquisition module 101, an initial balancing module 102, a target balancing module 103 and a disk balancing module 104, wherein:

[0102] A capacity acquisition module, used to acquire the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk;

[0103] An initial balancing module, used to determine the initial balancing capacity of the disk according to the used capacity of the disk;

[0104] A target balancing module, configured to obtain a target balancing capacity range of the disk according to the initial balancing capacity and using a preset balancing range coefficient;

[0105] The disk balancing module is used to select a partition copy from the disk when the used capacity of the disk is greater than the target balancing capacity range, and add the partition copy to a disk whose used capacity is less than the target balancing capacity.

[0106] In one embodiment, the disk balancing module includes:

[0107] A partition sorting submodule, used to sort the partition copies according to the usage capacity of the partition copies corresponding to the disk;

[0108] A partition selection submodule, used to select a partition replica with the smallest usage capacity from the partition replicas in sequence;

[0109] The partition selection submodule is further configured to stop the selection when the used capacity of the disk meets the target balanced capacity range.

[0110] In one embodiment, the target balancing module includes:

[0111] An error determination submodule, used for performing a product processing on the balancing range coefficient and the initial balancing capacity to obtain an error range;

[0112] A target balancing submodule, configured to sum the error range and the initial balancing capacity to obtain an upper limit of a target balancing capacity range;

[0113] The target balancing submodule is further used to perform a difference processing on the initial balancing capacity and the error range to obtain a lower limit of the target balancing capacity range.

[0114] In one embodiment, the capacity acquisition module includes:

[0115] The capacity acquisition submodule is used to obtain the used capacity of the disk using the node monitor;

[0116] The capacity acquisition submodule is further used to acquire the usage capacity of the partition replica corresponding to the disk by using the distributed stream processing platform monitor.

[0117] In one embodiment, the disk balancing submodule includes:

[0118] A capacity acquisition submodule, configured to sum the used capacity of the partition replica and the used capacity of the disk whose used capacity is smaller than the target balanced capacity range, to obtain the used capacity of the disk after adding;

[0119] The partition adding submodule is used to add the partition replica to the disk when the used capacity of the disk after the addition is less than or meets the target balanced capacity range.

[0120] In one embodiment, the initial equalization module includes:

[0121] The initial balancing submodule is used to perform mean processing on the used capacity of the target proxy node disk to obtain the initial balanced capacity of the disk.

[0122] Each module in the above-mentioned disk capacity balancing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0123] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store disk balancing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a disk capacity balancing method is implemented.

[0124] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0125] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0128] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A disk capacity balancing method, characterized in that: The method comprises: Obtain the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk; Determining the initial balanced capacity of the disk according to the used capacity of the disk; According to the initial balanced capacity, using a preset balanced range coefficient, obtaining a target balanced capacity range of the disk; In the case that the used capacity of the disk is greater than the target balanced capacity range, a partition copy is selected from the disk, and the partition copy is added to a disk whose used capacity is less than the target balanced capacity.

2. The method according to claim 1, characterized in that The selecting a partition copy from the disk comprises: sorting the partition copies according to the usage capacity of the partition copies corresponding to the disk; Selecting the partition replica with the smallest used capacity from the partition replicas in sequence; When the used capacity of the disk meets the target balanced capacity range, the selection is stopped.

3. The method according to claim 1, characterized in that The step of obtaining a target balanced capacity range of the disk based on the initial balanced capacity and using a preset balanced range coefficient includes: Performing product processing on the balancing range coefficient and the initial balancing capacity to obtain an error range; The error range and the initial balancing capacity are summed to obtain an upper limit of a target balancing capacity range; The initial balancing capacity and the error range are subjected to difference processing to obtain a lower limit of a target balancing capacity range.

4. The method according to claim 1, characterized in that: The obtaining of the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk includes: Use the node monitor to obtain the disk usage capacity; The distributed stream processing platform monitor is used to obtain the usage capacity of the partition replica corresponding to the disk.

5. The method according to claim 1, characterized in that The adding the partition replica to a disk whose used capacity is smaller than the target balanced capacity comprises: The used capacity of the partition replica and the used capacity of the disk whose used capacity is smaller than the target balanced capacity range are summed to obtain the used capacity of the disk after adding; When the used capacity of the added disk is less than or meets the target balanced capacity range, the partition copy is added to the disk.

6. The method according to claim 1, characterized in that The step of determining the initial balanced capacity of the disk according to the used capacity of the disk includes: The used capacity of the target proxy node disk is averaged to obtain the initial balanced capacity of the disk.

7. A disk capacity balancing device, characterized in that: The device comprises: A capacity acquisition module, used to acquire the used capacity of the target proxy node disk and the used capacity of the partition replica corresponding to the disk; An initial balancing module, used to determine the initial balancing capacity of the disk according to the used capacity of the disk; A target balancing module, configured to obtain a target balancing capacity range of the disk according to the initial balancing capacity and using a preset balancing range coefficient; The disk balancing module is used to select a partition copy from the disk when the used capacity of the disk is greater than the target balancing capacity range, and add the partition copy to a disk whose used capacity is less than the target balancing capacity.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.