Load balancing methods and electronic devices for storage systems
By constructing multiple candidate migration paths in a distributed storage system and evaluating migration efficiency parameters, the optimal migration path is selected for data sharding migration, thus solving the problem of low migration efficiency and achieving efficient load balancing scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-07-03
Smart Images

Figure CN122331827A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a load balancing method and electronic device for a storage system. Background Technology
[0002] In a typical distributed storage system, the storage cluster divides all data into several data shards (Regions). Each Region is independently stored on a specific storage node and can be migrated or replicated as needed. Some Regions may become significantly hot due to frequent access, causing their respective storage nodes to be under high load for extended periods, while other storage nodes may be under low load, resulting in a situation where some storage nodes are overloaded and others are idle. To address this issue, many related technologies employ the approach of finding the hottest node and migrating a Region to the coldest node. However, these technologies suffer from inefficient migration due to high migration costs and low effectiveness, meaning they exhibit low migration efficiency. Summary of the Invention
[0003] This application provides a load balancing method and electronic device for a storage system, to at least solve the problem of low migration efficiency in related technologies.
[0004] This application provides a load balancing method for a storage system, the storage system including multiple storage nodes, wherein data shards are stored on the storage nodes among the multiple storage nodes; the method includes: when there are data shards to be migrated in the storage system, constructing multiple candidate migration paths, wherein one of the multiple candidate migration paths is a path for migrating the data shard to be migrated from its source storage node to a storage node other than the source storage node in the storage system; determining the parameter value of a migration benefit parameter corresponding to the candidate migration path among the multiple candidate migration paths, wherein the migration benefit parameter is used to represent the relationship between the degree of adjustment of the data shard migration operation on the load balancing of the storage system and the migration cost of the data shard; determining the candidate migration path with the largest parameter value of the migration benefit parameter among the multiple candidate migration paths as the target migration path, and performing a migration operation on the data shard to be migrated according to the target migration path.
[0005] This application also provides a load balancing device for a storage system, the storage system including multiple storage nodes, wherein data shards are stored on the storage nodes among the multiple storage nodes, the device comprising: a first construction unit, configured to construct multiple candidate migration paths when data shards to be migrated exist in the storage system, wherein one of the multiple candidate migration paths is a path for migrating the data shards to be migrated from the source storage node to a storage node other than the source storage node in the storage system; a first determination unit, configured to determine the parameter value of a migration benefit parameter corresponding to the candidate migration path among the multiple candidate migration paths, wherein the migration benefit parameter is used to represent the relationship between the degree of adjustment of the data shard migration operation on the load balancing of the storage system and the migration cost of the data shards; and a first execution unit, configured to determine the candidate migration path with the largest parameter value of the migration benefit parameter among the multiple candidate migration paths as the target migration path, and perform a migration operation on the data shards to be migrated according to the target migration path.
[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above methods.
[0007] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above methods.
[0008] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above methods.
[0009] This application addresses the issue of low migration efficiency in storage systems with data shards to be migrated. By constructing multiple candidate migration paths—paths for migrating data shards from their source storage node to another storage node in the system—multiple reasonable migration schemes are considered. The migration benefit parameter for each candidate path is determined, identifying a path that balances load balancing with migration cost control. Based on the migration benefit parameter, the target migration path with the highest benefit is selected from the candidate paths. The migration operation for the data shards is then executed according to this target path, ensuring optimal resource scheduling, avoiding resource waste and performance degradation caused by blind migration, and improving migration efficiency. Therefore, this application solves the technical problem of low migration efficiency in related technologies. Attached Figure Description
[0010] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram illustrating an application scenario of a load balancing method for a storage system according to an embodiment of this application.
[0012] Figure 2 This is a flowchart illustrating a load balancing method for a storage system according to an embodiment of this application.
[0013] Figure 3 This is a timing diagram of a load balancing method for a storage system according to an embodiment of this application.
[0014] Figure 4 This is a structural block diagram of a load balancing device for a storage system provided in an embodiment of this application.
[0015] Figure 5 This is a computer system architecture block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0017] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0018] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0019] According to one aspect of the embodiments of this application, a load balancing method for a storage system is provided. Optionally, in this embodiment, the above-described load balancing method for a storage system may be applied, but is not limited to, to applications such as... Figure 1The diagram shows a hardware environment including storage system 102 and storage nodes 1022. Storage system 102 includes multiple storage nodes 1022, and each storage node 1022 includes multiple data shards. Data sharding is the process of dividing a data set into multiple smaller parts (shards or partitions). In distributed storage systems, data sharding is a common strategy for data management and is distributed across storage nodes 1022. Optionally, storage nodes 1022 may include multiple servers.
[0020] The load balancing method of the storage system in this embodiment can be executed by the storage system 102. Taking the execution of the load balancing method of the storage system in this embodiment by the storage system as an example... Figure 2 This is a flowchart illustrating an optional load balancing method for a storage system according to an embodiment of this application, as shown below. Figure 2 As shown, the process of this method may include the following steps S202 to S206.
[0021] Step S202: If there are data shards to be migrated in the storage system, construct multiple candidate migration paths. Among these multiple candidate migration paths, one of the candidate migration paths is the path for migrating the data shards to be migrated from the source storage node where they are stored to a storage node in the storage system other than the source storage node.
[0022] Step S204: Determine the parameter value of the migration benefit parameter corresponding to the candidate migration path among multiple candidate migration paths. The migration benefit parameter is used to represent the relationship between the degree of adjustment of the load balancing of the storage system by the data shard migration operation and the migration cost of the data shard.
[0023] Step S206: Among multiple candidate migration paths, the candidate migration path with the largest corresponding migration benefit parameter value is determined as the target migration path, and the migration operation is performed on the data to be migrated according to the target migration path.
[0024] The load balancing method for the storage system in this embodiment can be applied to the field of distributed storage system technology, and to scenarios involving the migration of data shards.
[0025] Typical distributed storage systems (such as Hadoop Database (HBase), Titanium Database (TiDB), Cockroach Database (CockroachDB), and Ceph distributed file system) generally adopt an architecture of data sharding (Region / Shard) and multi-node deployment to achieve horizontal scaling and high availability. In this distributed architecture, the storage cluster divides all data into several Regions, each Region is independently stored on a specific storage node, and can be migrated or replicated as needed.
[0026] Because business access patterns are often uneven, the following problems can easily occur: some regions become significantly hot due to frequent access, causing the input / output operations per second (IOPS), central processing unit (CPU), and network resources of the storage node to be under high load for a long time, while other storage nodes may be under low load, resulting in a situation where "some nodes are overloaded and some nodes are idle". Mainstream solutions often adopt the approach of "finding the hottest node and migrating a region to the coldest node". Sometimes migrating a large region is very costly, but the balancing effect is limited. Sometimes migrating a small region can quickly improve the balance, but this is overlooked. Therefore, related technologies may result in inefficient migrations that are "costly and ineffective", that is, there is a problem of low migration efficiency in related technologies.
[0027] To at least partially address the aforementioned technical issues, this embodiment, after optimization, more accurately reflects recent load conditions, quantifies benefits and costs before migration, and ensures efficient scheduling. Therefore, in this embodiment, when data shards to be migrated exist in the storage system, multiple candidate migration paths are constructed. A candidate migration path is a path for migrating the data shards from their source storage node to a storage node other than the source storage node in the storage system. This ensures that all reasonable migration schemes are considered. The parameter value of the migration benefit parameter corresponding to each candidate migration path is determined, allowing for the identification of migration paths that balance improving load balancing performance with controlling migration costs. Based on the parameter value of the migration benefit parameter, the target migration path with the highest migration benefit is selected from the multiple candidate migration paths. Based on the target migration path, the migration operation of the data shards to be migrated is executed. This more accurately reflects recent load conditions, quantifies benefits and costs before migration to ensure efficient scheduling, avoids resource waste and performance degradation caused by blind migration, and improves migration efficiency.
[0028] In this embodiment, the data shard to be migrated refers to a data shard that needs to be migrated from its current storage location (source storage node) to another storage location (target storage node). For example, the data shard to be migrated is a data shard with access popularity exceeding a preset popularity, or a data shard to be migrated is a data shard that requires maintenance or fault recovery. The data shards are stored on storage nodes, and multiple data shards are stored on a storage node. A candidate migration path refers to the path taken by the data shard to be migrated from its source storage node to a storage node in the storage system other than the source storage node; the source storage node refers to the node where the data shard to be migrated is initially or currently stored, and the source storage node includes multiple data shards to be migrated.
[0029] Migration benefit parameters quantify the relationship between the degree of load balancing adjustment and migration cost of data sharding migration operations on the storage system. Essentially, migration benefit parameters can be derived from the degree of load balancing adjustment and migration cost. For example, the ratio of the degree of load balancing adjustment to the migration cost can be used as the migration benefit parameter; conversely, the difference between the degree of load balancing adjustment and the migration cost can also be used. Migration benefit parameters characterize the benefits generated by performing migration operations on the data shards to be migrated in the storage system. Optionally, a larger migration benefit parameter indicates a better improvement in load balancing after the migration operation and a lower migration cost. The degree of load balancing adjustment in the storage system refers to the change in workload differences between storage nodes after data sharding migration; therefore, the degree of load balancing adjustment can be represented by a single parameter value.
[0030] Optionally, the degree of load balancing adjustment can be evaluated in several ways. For example, the average difference in workload (such as IOPS, CPU utilization, network traffic, or storage usage) of each storage node before and after the migration can be calculated. If the difference decreases, it indicates that the load balancing has been improved. Alternatively, the system's balance can be evaluated by comparing the changes in the load ratio between storage nodes before and after the migration. The load ratio between the busiest and the least busy storage nodes can be calculated. The closer the ratio is to 1, the more uniform the load distribution. Or, the overall service quality of the system can be evaluated after the migration operation, such as read / write latency, throughput, and error rate, to assess the effectiveness of load balancing.
[0031] The migration cost of data shards refers to the cost or expense of resources consumed or potential negative effects when migrating data shards between different storage nodes. Optionally, the migration cost of data shards can be represented by a parameter value.
[0032] Optionally, the migration cost of data shards can be obtained in various ways. For example, the total data volume of the data shards to be migrated can be measured, and the network bandwidth occupied by the migration operation between the source storage node and the candidate storage node can be determined. The time required for the data migration operation can be evaluated, and the cost of performing the migration operation can be evaluated based on the total data volume and time to obtain the migration cost. Alternatively, the impact of the data migration operation on the CPU utilization of the storage nodes can be evaluated, including the increase in CPU load during the migration process and the consumption of CPU resources by possible additional computing tasks (such as compression and decompression). The impact on disk read and write operations during data migration can be analyzed, and the network bandwidth consumption and data transmission time can be evaluated. The impact of data migration on CPU, disk read and write, network bandwidth consumption and data transmission, as well as the potential impact on the overall system performance (including increased latency, decreased throughput and system stability risks), can be comprehensively considered. Based on the evaluation of CPU, disk read and write and network bandwidth consumption, combined with the potential impact, the total cost of the migration operation can be estimated to obtain the migration cost.
[0033] The target migration path refers to the candidate migration path with the highest migration benefit parameter value. The target migration path includes a source storage node and a target storage node, and is used to migrate the data shards to be migrated from the current storage node (i.e., the source storage node) to another storage node (i.e., the target storage node). The target migration path represents the path selected to perform the data shard migration operation based on the current load conditions, resource distribution, and migration benefit parameters. The target migration path is the optimal migration path determined from multiple candidate migration paths, based on the principle of maximizing load balancing adjustment and minimizing migration cost.
[0034] Optionally, the migration operation for the data shards to be migrated can be performed according to the target migration path in the following ways: Method 1: Monitor the resource status of storage nodes through the scheduler, calculate the migration benefit parameters corresponding to multiple candidate migration paths, and determine the target migration path. For example, monitor the resource status of each storage node in real time (including CPU, memory, network bandwidth, and disk space usage) through the scheduler, and collect information such as the access popularity and size of each data shard to be migrated to build multiple candidate migration paths; predict the load status of the data shards to be migrated after migrating to the candidate migration paths, and obtain the load balancing adjustment of the storage system. The migration efficiency and migration cost are considered. By adjusting the load balancing level and migration cost, the migration efficiency parameter of each candidate migration path is calculated. The migration path with the highest migration efficiency parameter value is selected as the target path. That is, the source storage node and target storage node of the data shard to be migrated are determined. The scheduler sends a migration instruction (including the identifier of the data shard to be migrated, the address of the target node, etc.) to the source storage node. After receiving the migration instruction, the source storage node begins to migrate the specified data shard to be migrated to the target storage node. During the migration process, the scheduler continuously monitors the system status to ensure that the migration operation does not have a negative impact on system stability. Method 2: Each storage node assesses its local resource usage and access frequency of the data shard to be migrated based on real-time monitoring data. Simultaneously, it exchanges resource status information with neighboring storage nodes. Based on resource usage and the resource status of neighboring storage nodes, the storage node calculates the load balancing adjustment level and migration cost of the storage system after the data shard migration. It then calculates migration benefit parameters based on these parameters and selects the migration path with the highest benefit parameter as the target migration path. After migration, the target storage node confirms data consistency. Once confirmed, the source storage node can delete its local copy of the data shard to be migrated. After the migration is complete, both the source and target storage nodes update their respective data shard statuses and re-monitor resource status through the scheduler to verify whether the migration path has achieved the expected load balancing effect. If necessary, subsequent migration strategies are adjusted.
[0035] In an optional embodiment, the monitor (mon) is a component used to monitor and collect load information. The monitor obtains the load information of each storage node through a heartbeat reporting mechanism. The fairness policy layer (fpl) is a component used to query load information and participate in load balancing. Storage nodes (such as kvdbtarget1, kvdb target2, etc.) are used to store regions, and regions include various load information. Figure 3This is a timing diagram illustrating a load balancing method for a storage system according to an embodiment of this application, as shown below. Figure 3 As shown, the FPL queries the load information in the storage nodes (e.g., kvdb target1, kvdb target2, etc.), the storage nodes return the load information to the FPL, the FPL aggregation process (i.e., aggregating the target data shard target-region information), the FPL reports the load information via heartbeat, the monitor saves the load information (Region map), updates the routing table information, performs load balancing calculations, and generates scheduling commands.
[0036] For example, the following functions can be used to store load information about heartbeat reporting and the status of the target storage node: uint32_t node_id; uint64_t heartbeat_seq; uint32_t target_count; TargetInfotargets[]; uint64_t timesharp. The following data structures can also be used to store and manage metadata information (i.e., Target information) related to storage nodes: The TargetInfo data structure describes the Region management status of a specific storage node. For example, the TargetInfo data structure includes StoreInfo store_info (containing a StoreInfo type variable that stores information about the storage node), uint32_t region_count (an unsigned 32-bit integer variable that stores the number of Regions managed by the storage node), and RegionInfo regions[] (an array of RegionInfo type that stores detailed information about all Regions associated with the storage node); The StoreInfo data structure records the identity information of the storage node. For example, the StoreInfo data structure includes uint32_t target_id (an unsigned 32-bit integer variable that stores the ID of the target storage node) and uint32_t node_id (an unsigned 32-bit integer variable that is the ID of the node where the storage node is located); The RegionInfo data structure describes the attributes of each Region. For example, the attributes of each Region include the storage node it belongs to, basic attributes, load information, and operation status. The RegionInfo data structure includes uint64_t `region_id` (an unsigned 64-bit integer variable that stores the unique identifier of the Region), `StoreInfo` `store_info` (containing a member variable of type `StoreInfo` that stores information about the storage nodes associated with the Region), `RegionBaseInfo` `base_info` (containing a member variable of type `RegionBaseInfo` that stores basic information about the Region, such as size and creation time), `PayloadInfo` `pyload_info` (containing a member variable of type `PayloadInfo` that stores the load information of the Region, such as the number of key-value pairs stored and IOPS), and `opInfo` `info` (containing a member variable of type `opInfo` that stores the operation information of the Region, such as the recent operation status or historical operation records).
[0037] Optionally, migration operations are performed on the data shards to be migrated according to the target migration path. The migration operations may include generating a migration schedule, updating the region status, and monitoring the migration effect.
[0038] In this embodiment, when data shards to be migrated exist in the storage system, multiple candidate migration paths are constructed. Each candidate migration path is a path for migrating a data shard from its source storage node to a storage node other than the source storage node in the storage system, ensuring that all reasonable migration schemes are considered. The migration benefit parameter value corresponding to each candidate migration path is determined. This migration benefit parameter characterizes the benefit generated by performing the migration operation on the data shards in the storage system. By calculating the migration benefit parameter corresponding to each candidate migration path, the balance between improving load balancing and controlling migration costs can be identified. This application achieves a balanced migration path by selecting the target migration path with the highest migration benefit from multiple candidate migration paths based on the parameter values of migration benefit parameters. The target migration path represents the optimal migration path selected to perform the data shard migration operation based on the current load, resource distribution, and migration benefit parameters. Compared to the scheduling strategy in related technologies that finds the hottest node and migrates a Region to the coldest node, this embodiment performs the data shard migration operation according to the target migration path, ensuring optimal resource scheduling, avoiding resource waste and performance degradation caused by blind migration, and improving migration efficiency. Therefore, it can solve the technical problem of low migration efficiency in related technologies.
[0039] In an exemplary embodiment, determining the parameter value of the migration benefit parameter corresponding to a candidate migration path among multiple candidate migration paths includes: taking each candidate migration path among the multiple candidate migration paths as a candidate migration path in the current candidate migration path and performing the following determination operations: determining a first parameter value of the load balancing parameter before the migration of the data shard to be migrated, wherein the load balancing parameter is used to represent the load difference between storage nodes in the storage system; predicting the parameter value of the load balancing parameter after migrating the data shard to be migrated according to the current candidate migration path to obtain a second parameter value; determining the parameter value of the migration benefit parameter corresponding to the current candidate migration path based on the difference between the first parameter value and the second parameter value, and the current migration cost of the data shard to be migrated, wherein the current migration cost is the migration cost of migrating the data shard to be migrated according to the current candidate migration path, and the parameter value of the migration benefit parameter is positively correlated with the difference between the first parameter value and the second parameter value, and negatively correlated with the current migration cost.
[0040] In this embodiment, load balancing parameters refer to quantitative indicators that reflect the load differences between storage nodes in the storage system. For example, load balancing parameters include the processing capacity of storage nodes (such as CPU utilization), read and write operation rates (such as IOPS), network traffic, and storage capacity usage.
[0041] The first parameter value refers to a quantified value of the load balancing status before the data shard migration operation is executed. For example, the first parameter value includes the standard deviation of CPU utilization among storage nodes, the maximum to minimum ratio of IOPS, and the uniformity of the data shard distribution to be migrated. The first parameter value reflects the degree of load distribution imbalance before the migration operation.
[0042] Optionally, the storage system continuously records resource usage data (including but not limited to CPU, memory, disk I / O, and network bandwidth utilization) of all storage nodes; extracts features from historical data to identify key features related to the load of storage nodes (such as time period, data shard size, access request type, etc.), constructs a supervised learning model (such as a regression model or neural network), trains the model using historical data to predict the load of storage nodes, and adjusts model parameters through techniques such as cross-validation to improve prediction accuracy; uses the trained model to predict the load of each storage node based on the current system state (including node resource usage and access patterns of data shards to be migrated); and calculates a parameter value representing the system load balance status (such as the standard deviation or mean difference of the node load prediction value) based on the predicted load of storage nodes to quantitatively evaluate the current load balance status. The obtained parameter value is the first parameter value.
[0043] The second parameter value refers to the quantified value of the expected load balancing parameter after the data to be migrated is moved from the source storage node to the target storage node according to the current candidate migration path. Optionally, the second parameter value can be obtained by prediction model or analysis based on historical data. The second parameter value reflects the expected load distribution state of the system after the migration operation is performed, that is, the state after the load balancing is improved.
[0044] Optionally, the storage system continuously collects migration data from historical migration operations (including load changes of storage nodes before and after migration, size of data shards to be migrated, migration time, network resource consumption, etc.); analyzes historical migration data to identify the impact of different sizes and types of data shards to be migrated and network conditions between storage nodes on the load balancing parameters after migration; when determining the current candidate migration path, it uses migration effect data of similar historical scenarios to predict the specific impact of this migration on the load balancing parameters and calculates the second parameter value. For example, based on the size and type of data shards to be migrated and the network conditions between candidate source storage nodes and target storage nodes, it searches for the most similar migration cases in the historical database; based on the migration effects of historical cases, it applies similarity adjustments to predict the impact of the migration action on the load balancing status of storage nodes in the candidate path; and combines the prediction results to calculate the second parameter value of the expected load balancing parameters of the storage system after migration.
[0045] Alternatively, the storage system collects various features of the data shards to be migrated before and after migration (such as the size of the data shards to be migrated, access frequency, resource status of storage nodes, network bandwidth, etc.); using the collected feature data and the actual changes in load balancing parameters after migration, a prediction model, such as a random forest, support vector machine, or deep neural network, is trained; when a migration path for a data shard to be migrated is selected, the trained model is used, the features of the current candidate migration path are input, and the changes in load balancing parameters after migration are predicted to obtain the second parameter value.
[0046] The difference between the first and second parameter values refers to the difference in load balancing status among storage nodes in the storage system before and after the migration of the data shards to be migrated. The first parameter value is the load balancing parameter before migration, while the second parameter value is the predicted load balancing parameter after migration. The larger the difference between the two, the more significant the improvement in load balancing that can be achieved through the migration operation. Therefore, the value of the migration benefit parameter is positively correlated with the difference between the first and second parameter values. In other words, the larger the difference between the first and second parameter values, the larger the value of the migration benefit parameter, meaning a greater degree of load balancing improvement and higher migration benefits.
[0047] The current migration cost refers to the migration cost of migrating the data shards to be migrated according to the current candidate migration path. For example, the migration cost includes network bandwidth, disk I / O operations, CPU computing time, etc.; the higher the migration cost, the higher the difficulty and cost of performing the migration, and the smaller the parameter value of the migration benefit parameter.
[0048] For example, the parameter value of the migration benefit parameter (i.e., the benefit calculation function Gain) can be obtained by the following formula (1):
[0049] Gain=ΔLoadImbalance / Cost (1)
[0050] Here, ΔLoadImbalance refers to the difference between the first parameter value and the second parameter value (that is, the amount of decrease in load difference before and after migration), and Cost refers to the current migration cost (representing the migration cost).
[0051] Thus, unlike related technologies that only consider hotspot size, this embodiment establishes a mathematical trade-off between load balancing benefits and migration costs, which can significantly improve scheduling effectiveness. By considering load balancing (such as load improvement rate) and migration costs in a unified manner, the parameter value of the migration benefit parameter is calculated using formula (1). The scheduler can then select the migration scheme with the highest score, rather than simply migrating the hottest Region. At the same time, based on migration benefits, scheduling becomes more efficient, enabling priority migration of Regions with the highest benefit / cost ratio, achieving low-cost, high-benefit balance.
[0052] This embodiment determines the first parameter value of the load balancing parameters before the migration of the data shards and predicts the second parameter value of the load balancing parameters after the migration of the data shards. Then, based on the difference between the first and second parameter values and the current migration cost of the data shards to be migrated, the parameter value of the migration benefit parameter corresponding to the current candidate migration path is determined. This allows for the rapid determination of the most suitable migration scheme among multiple candidate migration paths, avoiding resource waste and improving the dynamic balancing capability of storage resources and system operating efficiency.
[0053] In an exemplary embodiment, determining a first parameter value for the load balancing parameters before the migration of the data shards to be migrated includes at least one of the following: determining the maximum load node and the minimum load node before the migration of the data shards to be migrated, and determining the difference between the load of the maximum load node and the load of the minimum load node as the first parameter value, wherein the maximum load node is the storage node with the highest load in the storage system, and the minimum load node is the storage node with the lowest load in the storage system; determining the maximum load node and the minimum load node before the migration of the data shards to be migrated, and determining the ratio between the load of the maximum load node and the load of the minimum load node as the first parameter value, wherein the maximum load node is the storage node with the highest load in the storage system, and the minimum load node is the storage node with the lowest load in the storage system; and determining the variance of the load of the storage nodes in the storage system before the migration of the data shards to be migrated as the first parameter value.
[0054] In this embodiment, the maximum load node refers to the storage node with the highest load in the storage system, and the minimum load node refers to the storage node with the lowest load in the storage system.
[0055] Optionally, the maximum and minimum load nodes before the data shard migration can be determined as follows: By deploying real-time monitoring tools on each storage node to continuously track load conditions (such as CPU utilization, disk I / O rate, network throughput, and other key load performance indicators); collecting performance data from all storage nodes within the same time period, ranking and comparing the various load performance indicators to identify the storage nodes with the highest and lowest resource consumption; based on the comparison results, determining the storage node with the highest resource consumption (e.g., highest CPU utilization, highest I / O rate, or most frequent network activity) as the maximum load node, and the storage node with the lowest resource consumption as the minimum load node. Alternatively, collect historical load data and historical operation logs (including data access patterns, read / write operation frequency, and peak resource consumption) for each storage node over a period of time. Based on the collected historical load data and historical operation logs, use machine learning techniques (such as time series analysis, regression models, or neural networks) to train a prediction model to predict the load of the nodes at the current point in time. Use the trained model to predict the current load level of each storage node, and then sort the prediction results to find the storage nodes with the highest and lowest predicted loads, which will be designated as the maximum and minimum load nodes, respectively.
[0056] For example, in this embodiment, the first parameter value can be calculated based on the ratio of the maximum load node to the minimum load node, the difference between the maximum load node and the minimum load node, or the variance of the overall load of the storage nodes.
[0057] Optionally, load data (including but not limited to CPU utilization, IOPS, network traffic, etc.) of all storage nodes are collected in real time or periodically. Based on the collected load data, the average load value of all storage nodes within a specified time window is calculated. For each storage node, the square of the difference between its load and the average load is calculated, and then the average of the squares of the differences of all storage nodes is calculated to obtain the variance. The calculated variance value is used as the first parameter value. The larger the variance, the higher the degree of system load imbalance, and vice versa.
[0058] This embodiment uses at least the difference between the highest and lowest load nodes, the ratio of the highest to lowest load nodes, and the variance of the storage node load as the first parameter value. This allows for the intelligent identification and evaluation of which data shards to be migrated can most effectively alleviate load imbalance. Simultaneously, considering the costs and benefits of migration, it maximizes resource utilization and system performance while minimizing resource waste. Furthermore, since the calculation of the first parameter value can be dynamic, the system can continuously adjust its load balancing strategy based on real-time or predicted load conditions to adapt to constantly changing workload demands and business scenarios.
[0059] In some optional embodiments, predicting the load balancing parameters after migrating the data shards according to the current candidate migration path to obtain a second parameter value may include at least one of the following: predicting the maximum load node and the minimum load node before the data shard migration, and determining the difference between the load of the maximum load node and the load of the minimum load node as the second parameter value, wherein the maximum load node is the storage node with the highest load in the storage system, and the minimum load node is the storage node with the lowest load in the storage system; predicting the maximum load node and the minimum load node before the data shard migration, and determining the ratio between the load of the maximum load node and the load of the minimum load node as the second parameter value, wherein the maximum load node is the storage node with the highest load in the storage system, and the minimum load node is the storage node with the lowest load in the storage system; determining the variance of the load of the storage nodes in the storage system before the data shard migration as the second parameter value. It is understood that the calculation method of the second parameter value is similar to the calculation method of the first parameter value, and will not be repeated here.
[0060] In an exemplary embodiment, the method further includes: taking each candidate migration path from the multiple candidate migration paths as a candidate migration path in the current candidate migration path and performing the following prediction operation: predicting the resource consumption of migrating the data shard to be migrated according to the current candidate migration path to obtain the current resource consumption; and determining the current resource consumption as the migration cost of migrating the data shard to be migrated according to the current candidate migration path.
[0061] In this embodiment, resource consumption refers to the total amount of resources required during the migration of the data shard to be migrated, and current resource consumption refers to the total amount of resources required to migrate the data shard to be migrated according to the current candidate migration path.
[0062] Optionally, resource consumption data (including but not limited to migration time, network traffic, CPU and memory usage) of past data shards to be migrated during the migration process can be collected. Using the collected historical resource consumption data, a prediction model can be trained through statistical methods or machine learning techniques (such as linear regression, time series analysis, etc.). The prediction model aims to understand the relationship between data migration operations and resource consumption (including the impact of variables such as the size of the data shard to be migrated, the distance between the source storage node and the target storage node, and the current system load status on resource consumption). After determining the candidate migration path, parameters such as the size of the data shard to be migrated, the current load status of the source storage node and the target storage node, and the network conditions between the source storage node and the target storage node are input into the prediction model. The prediction model will output the estimated resource consumption, i.e., the current resource consumption.
[0063] This embodiment, by predicting the resource consumption of migration operations, avoids selecting candidate migration paths that, while improving load balancing, consume excessive resources, thereby effectively controlling resource consumption and achieving the goal of optimized resource utilization. Furthermore, using the current resource consumption as the migration cost helps to minimize migration costs while meeting business needs, thus improving the migration efficiency of the distributed storage system.
[0064] In an exemplary embodiment, before constructing multiple candidate migration paths, the method further includes: collecting load information of data shards on storage nodes in the storage system; determining the access popularity of data shards on storage nodes in the storage system based on the load information of data shards on storage nodes in the storage system; determining the access popularity of storage nodes in the storage system based on the access popularity of data shards on storage nodes in the storage system; identifying storage nodes in the storage system with access popularity greater than or equal to a first popularity threshold as source storage nodes, and identifying data shards in the source storage nodes with access popularity greater than or equal to a second popularity threshold as data shards to be migrated.
[0065] In this embodiment, load information refers to the load information of data shards in the storage system, used to evaluate the access frequency of data shards and the load status of storage nodes. For example, load information may include IOPS, CPU utilization, network traffic, etc. Data shard access popularity refers to the activity level of data shard access.
[0066] For example, collecting load information (such as load data) involves periodically collecting IOPS, the number of key-value pairs (Key-Value Count), region size, and other load metrics.
[0067] Optionally, access patterns and load data of data shards over a past period, as well as the access popularity of these data shards, are collected. Based on the collected historical data, features that help predict access popularity (such as daily access frequency, average access time interval, data shard size, storage location, etc.) are extracted. A prediction model is trained using machine learning algorithms (such as random forest, support vector machine, or deep learning model). This prediction model predicts the access popularity of data shards based on current load information and features extracted from historical data. After the prediction model is trained, the load information of the data shards on the storage nodes at the current moment is input into the prediction model, and the predicted access popularity of the data shards is output.
[0068] After determining the access popularity of data shards on storage nodes in a storage system, the access popularity of the corresponding storage nodes can be determined. For example, the access popularity value of all data shards on each storage node can be obtained; a weighted average can be used to synthesize the access popularity values of all data shards on a storage node, where the weights can be the size of the data shards, storage time, or other importance indicators. Alternatively, clustering algorithms (such as K-means or hierarchical clustering) can be used to divide all data shards in the storage system into several popularity levels based on their access popularity, with each level representing a certain range of access popularity; the distribution of popularity levels of data shards on each storage node can be analyzed, and the access popularity of the storage node can be determined based on the proportion of high-popularity-level data shards or the total popularity value.
[0069] Optionally, after obtaining the access popularity of the corresponding storage nodes, source storage nodes and target storage nodes are selected based on the access popularity of the storage nodes, and the data shards to be migrated in the source storage nodes are selected.
[0070] In this embodiment, the first heat threshold is used to determine whether the access heat of the storage node has reached the level for load balancing, and the second heat threshold is used to filter the data shards to be migrated in the storage node.
[0071] Optionally, storage nodes with access popularity greater than or equal to a first popularity threshold are selected and identified as source storage nodes; data shards with access popularity greater than or equal to a second popularity threshold are selected and identified as data shards to be migrated.
[0072] This embodiment effectively identifies hot data shards and high-load storage nodes by collecting load information and determining the access frequency of data shards and storage nodes. The threshold-based filtering mechanism not only avoids unnecessary migration of low-load data shards, reducing waste of system resources, but also ensures that load balancing can be performed on demand, thereby improving the overall system responsiveness and data processing efficiency.
[0073] In an exemplary embodiment, constructing multiple candidate migration paths includes: filtering out storage nodes in the storage system whose access popularity is less than a third popularity threshold, and determining the path from the source storage node to a storage node whose access popularity is less than the third popularity threshold as a candidate migration path, thereby obtaining multiple candidate migration paths.
[0074] In this embodiment, the third heat threshold is used to identify storage nodes in the storage system that can receive data shards to be migrated. It should be noted that the third heat threshold is less than or equal to the first heat threshold.
[0075] Storage nodes in the storage system whose access popularity is less than the third popularity threshold are selected and identified as candidate storage nodes. Multiple candidate storage nodes are obtained, and the path from the source storage node to the candidate storage node is identified as a candidate migration path, thus obtaining multiple candidate migration paths.
[0076] In another optional embodiment, the paths from the source storage node to the N storage nodes with the lowest access frequency are determined as multiple candidate migration paths, where N is an integer greater than or equal to 2.
[0077] This embodiment filters out storage nodes with access popularity below a third access popularity threshold and constructs candidate migration paths from the source storage node to these nodes. This avoids blind migration or resource mismatch, migrating data shards from high-access-population storage nodes to low-access-population storage nodes. This helps to distribute hotspots, improve the overall resource utilization of the system, and reduce service latency or performance bottlenecks caused by local overload. Furthermore, by setting a third access popularity threshold, the load status of storage nodes can be determined, preventing data shards from being migrated to another set of high-load storage nodes, thereby reducing invalid or inefficient migration operations.
[0078] In one exemplary embodiment, in related technologies, the access popularity of data shards is often evaluated based on static or moving average metrics. This method struggles to capture rapid changes in recent access patterns, especially hotspots that emerge within a short period. To address this issue, this embodiment introduces a time decay factor, making recent load parameters have a greater impact on access popularity.
[0079] The load information includes the parameter values of multiple load parameters, and one load parameter corresponds to a parameter weight.
[0080] For example, load parameters can include IOPS, key-value pairs, and region size. Load parameters reflect the load on data shards across different dimensions. Each load parameter is assigned a weight, which indicates the importance the system or business scenario places on a particular load parameter. Optionally, the parameter weights can be dynamically adjusted based on usage scenarios, access frequency, and time.
[0081] In some embodiments, determining the access heat of data shards on storage nodes in a storage system based on the load information of data shards on storage nodes in a storage system includes: taking each data shard on a storage node in a storage system as the current data shard and performing the following determination operation: summing the product of the parameter values of the load parameters among multiple load parameters of the current data shard, the parameter weights corresponding to the load parameters among multiple load parameters, and the time decay factors corresponding to the load parameters among multiple load parameters, and determining the summation result as the access heat of the current data shard; wherein, the time decay factor is the value of an exponential function with a specified base, exponentially multiplied by the product of the time difference between the current time and the time of collection of the parameter values of the load parameters and a specified decay coefficient, and the specified decay coefficient is negative.
[0082] In this embodiment, the parameter weights reflect the priority and importance of different load parameters when calculating access popularity. The time decay factor is a value that gradually decreases over time and is used to evaluate the influence of the load parameters of data shards. It reflects the access level of the corresponding load parameters over a period of time. The specified number of the time decay factor can be Euler's number (i.e., e) or other numbers.
[0083] In an optional embodiment, an exponential time decay function is introduced to make recent indicators have a greater impact on popularity. The access popularity of data shards on storage nodes can be calculated using the following formula (2):
[0084] (2)
[0085] in, The parameter weights are the load parameters; The parameter value is the load parameter. The time decay factor, This is the interval between the current time and the sampling time of the load parameter (i.e., the time difference between the acquisition time of the load parameter value). The attenuation coefficient, which decreases over time. The decreasing rate is used to control the decay rate, and finally, all load parameters are summed to obtain the access popularity score.
[0086] In this way, the access popularity of the current data shard can be calculated based on the exponential time decay function, making the popularity perception more accurate. Through the time decay function, the system can quickly identify sudden hot spots and adapt to business load cycles.
[0087] In this embodiment, by introducing a time decay factor, the access popularity of data shards is obtained, making the recent load parameters have a greater impact on the popularity, avoiding the occurrence of hot spot identification lag, and improving the efficiency and accuracy of data utilization.
[0088] In an exemplary embodiment, in related technologies, load is generally determined using fixed metrics (such as storage capacity, number of regions, or IOPS). However, fixed metrics (i.e., parameters of load information) are often statically weighted or moving averages, which cannot highlight recent sudden load changes or dynamically adjust weights according to business cycles. This leads to delayed hotspot identification, untimely scheduling, and even meaningless migrations during off-peak periods. To address these issues, unlike the fixed weighting or moving average methods used in related technologies, this embodiment further proposes a dynamic weight switching mechanism. This mechanism dynamically adjusts the parameter weights corresponding to the access frequency parameters, highlighting recent changes and adapting to business cycles.
[0089] In this embodiment, the multiple load parameters include the access frequency parameter; the method further includes: determining a first time interval within the specified time period based on the recorded load changes of storage nodes in the storage system over a specified time period; increasing the parameter weight corresponding to the access frequency parameter within the first time interval; wherein, the first time interval is the time interval during which the load of the storage nodes in the storage system is greater than or equal to a first load threshold.
[0090] In this embodiment, the access frequency parameter refers to the number of times a data fragment is accessed per unit time. For example, the access frequency parameter can be IOPS. The first time interval refers to the time interval during which the load of the storage nodes in the storage system is greater than or equal to a first load threshold, where the first load threshold is a preset value used to determine normal load status and high load status.
[0091] Optionally, a first preset weight value is set, and within a first time interval, the parameter weight corresponding to the access frequency parameter is increased according to a fixed step size or a preset linear relationship. In time intervals other than the first time interval, the parameter weight corresponding to the access frequency parameter is decreased according to a fixed step size or a preset linear relationship.
[0092] By defining a first time interval and increasing the parameter weight corresponding to the access frequency parameter within that time interval, this embodiment can respond more sensitively to changes in access frequency, ensuring a more reasonable allocation of system resources and load, and effectively addressing hotspot issues.
[0093] In an exemplary embodiment, in related technologies, load is generally determined using fixed metrics (such as storage capacity, number of regions, or IOPS). However, fixed metrics (i.e., parameters of load information) are often statically weighted or moving averages, which cannot highlight recent sudden load changes or dynamically adjust weights according to business cycles. This leads to delayed hotspot identification, untimely scheduling, and even meaningless migrations during off-peak periods. To address these issues, unlike the fixed weighting or moving average methods used in related technologies, this embodiment further proposes a dynamic weight switching mechanism. This mechanism dynamically adjusts the parameter weights corresponding to the shard capacity parameters, highlighting recent changes and adapting to business cycles.
[0094] In some of the above, multiple load parameters include shard capacity parameters; the above method further includes: determining a second time interval within a specified time period based on the load changes of storage nodes in the storage system over a specified time period; increasing the parameter weight corresponding to the shard capacity parameter within the second time interval; wherein the second time interval is the time interval during which the load of storage nodes in the storage system is less than a second load threshold.
[0095] In this embodiment, the shard capacity parameter refers to the storage space occupied by data shards in the distributed storage system. The second time interval refers to the time interval during which the load on the storage nodes in the storage system is less than a second load threshold, where the second load threshold is a preset value used to distinguish whether the storage nodes are in a low-load state.
[0096] It should be noted that the second load threshold can be the same as or different from the first load threshold; the second time interval can be the same as or different from the first time interval.
[0097] Optionally, a second preset weight value is set. Within the second time interval, the parameter weight corresponding to the fragment capacity parameter is adjusted to be greater than or equal to the second preset weight value. In time intervals other than the first time interval, the parameter weight corresponding to the fragment capacity parameter is adjusted to be less than the second preset weight value.
[0098] For example, increase the weight of IOPS during peak periods and increase the weight of shard capacity parameters during off-peak periods to match different business scenarios.
[0099] In this embodiment, by determining a second time interval and increasing the parameter weight corresponding to the shard capacity parameter within the second time interval, the resource allocation strategy is ensured to match the actual system state. This not only helps to improve the overall performance of the storage system but also reduces unnecessary migration operations.
[0100] In large-scale storage clusters, existing load balancing mechanisms often fail to accurately detect load, intelligently select migration schemes, and promptly exit scheduling, leading to low resource utilization and degraded service performance. This paper proposes a load balancing method for distributed storage systems based on dynamic heat perception and benefit-driven approaches. This embodiment achieves more intelligent and stable resource balancing through a dynamic heat calculation model and benefit-driven migration decisions.
[0101] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this 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 read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0103] According to another aspect of the embodiments of this application, a load balancing device for a storage system is also provided. This load balancing device can be used to implement the load balancing method for the storage system provided in the above embodiments, and details already described will not be repeated. As used below, the term "unit" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0104] Figure 4This is a structural block diagram of an optional load balancing device for a storage system according to an embodiment of this application, such as... Figure 4 As shown, the load balancing device of the storage system includes:
[0105] The first construction unit 402 is used to construct multiple candidate migration paths when there are data shards to be migrated in the storage system. Among the multiple candidate migration paths, one of the candidate migration paths is the path for migrating the data shards to be migrated from the source storage node where they are stored to a storage node in the storage system other than the source storage node.
[0106] The first determining unit 404 is used to determine the parameter value of the migration benefit parameter corresponding to the candidate migration path among multiple candidate migration paths. The migration benefit parameter is used to represent the relationship between the degree of adjustment of the load balancing of the storage system by the data shard migration operation and the migration cost of the data shard.
[0107] The first execution unit 406 is used to determine the candidate migration path with the largest value of the corresponding migration benefit parameter among multiple candidate migration paths as the target migration path, and to perform migration operations on the data to be migrated in segments according to the target migration path.
[0108] It should be noted that the first execution unit 402 in this embodiment can be used to execute the above step S202, the second execution unit 404 in this embodiment can be used to execute the above step S204, and the third execution unit 406 in this embodiment can be used to execute the above step S206.
[0109] Through the embodiments provided in this application, when there are data shards to be migrated in the storage system, multiple candidate migration paths are constructed. Each candidate migration path is a path for migrating the data shards to be migrated from the source storage node to a storage node other than the source storage node in the storage system. This ensures that all reasonable migration schemes are considered. The parameter value of the migration benefit parameter corresponding to each candidate migration path is determined, which can identify a migration path that achieves a balance between improving load balancing and controlling migration costs. Based on the parameter value of the migration benefit parameter, the target migration path with the greatest migration benefit is selected from multiple candidate migration paths. According to the target migration path, the migration operation of the data shards to be migrated is executed, ensuring optimal allocation of resources, avoiding resource waste and performance degradation caused by blind migration, and improving load balancing and migration efficiency.
[0110] In an exemplary embodiment, the first determining unit 404 is further configured to perform the following determining operations on each of the candidate migration paths among the multiple candidate migration paths as candidate migration paths in the current candidate migration path: determining a first parameter value of the load balancing parameter before the migration of the data shard to be migrated, wherein the load balancing parameter is used to represent the load difference between storage nodes in the storage system; predicting the parameter value of the load balancing parameter after the data shard to be migrated is migrated according to the current candidate migration path, and obtaining a second parameter value; determining the parameter value of the migration benefit parameter corresponding to the current candidate migration path based on the difference between the first parameter value and the second parameter value, and the current migration cost of the data shard to be migrated, wherein the current migration cost is the migration cost of migrating the data shard to be migrated according to the current candidate migration path, and the parameter value of the migration benefit parameter is positively correlated with the difference between the first parameter value and the second parameter value, and negatively correlated with the current migration cost.
[0111] In an exemplary embodiment, the first determining unit 404 is further configured to: determine the maximum load node and the minimum load node before the migration of the data shards to be migrated, and determine the difference between the load of the maximum load node and the load of the minimum load node as a first parameter value, wherein the maximum load node is the storage node with the highest load in the storage system, and the minimum load node is the storage node with the lowest load in the storage system; determine the maximum load node and the minimum load node before the migration of the data shards to be migrated, and determine the ratio between the load of the maximum load node and the load of the minimum load node as a first parameter value, wherein the maximum load node is the storage node with the highest load in the storage system, and the minimum load node is the storage node with the lowest load in the storage system; and determine the variance of the load of the storage nodes in the storage system before the migration of the data shards to be migrated as a first parameter value.
[0112] In an exemplary embodiment, the apparatus further includes a second execution unit, which is further configured to perform the following prediction operation on each of the candidate migration paths among the multiple candidate migration paths as the current candidate migration path: predict the resource consumption of migrating the data fragment to be migrated according to the current candidate migration path, and obtain the current resource consumption; and determine the current resource consumption as the migration cost of migrating the data fragment to be migrated according to the current candidate migration path.
[0113] In an exemplary embodiment, the first construction unit is further configured to: collect load information of data shards on storage nodes in the storage system before constructing multiple candidate migration paths; determine the access popularity of data shards on storage nodes in the storage system based on the load information of data shards on storage nodes in the storage system; determine the access popularity of storage nodes in the storage system based on the access popularity of data shards on storage nodes in the storage system; determine the storage nodes in the storage system whose access popularity is greater than or equal to a first popularity threshold as source storage nodes; and determine the data shards in the source storage nodes whose access popularity is greater than or equal to a second popularity threshold as data shards to be migrated.
[0114] In an exemplary embodiment, the first construction unit is further configured to filter out storage nodes in the storage system whose access popularity is less than a third popularity threshold, and determine the path from the source storage node to a storage node whose access popularity is less than the third popularity threshold as a candidate migration path, thereby obtaining multiple candidate migration paths.
[0115] In an exemplary embodiment, the load information includes parameter values of multiple load parameters, and one load parameter corresponds to a parameter weight. The first construction unit is further configured to perform the following determination operation on the data shards on the storage nodes in the storage system as the current data shards: summing the product of the parameter values of the load parameters among the multiple load parameters of the current data shard, the parameter weights corresponding to the load parameters among the multiple load parameters, and the time decay factors corresponding to the load parameters among the multiple load parameters, and determining the summation result as the access heat of the current data shard; wherein, the time decay factor is the function value of an exponential function with a specified base and the exponent of the product of the time difference between the current time and the collection time of the parameter values of the load parameters and a specified decay coefficient, and the specified decay coefficient is negative.
[0116] In one exemplary embodiment, the multiple load parameters include an access frequency parameter; the apparatus further includes a third execution unit, which is configured to determine a first time interval within a specified time period based on the load changes of storage nodes in the recorded storage system over a specified time period; and within the first time interval, increase the parameter weight corresponding to the access frequency parameter; wherein the first time interval is the time interval during which the load of the storage nodes in the storage system is greater than or equal to a first load threshold.
[0117] In one exemplary embodiment, the multiple load parameters include shard capacity parameters; the apparatus further includes a fourth execution unit, which is configured to determine a second time interval within a specified time period based on the recorded load changes of storage nodes in the storage system over a specified time period; and within the second time interval, increase the parameter weight corresponding to the shard capacity parameters; wherein the second time interval is the time interval during which the load of the storage nodes in the storage system is less than a second load threshold.
[0118] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0119] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.
[0120] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.
[0121] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0122] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0123] According to another aspect of the embodiments of this application, a computer program product is also provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit 501, it performs various functions provided in the embodiments of this application. The sequence numbers of the embodiments of this application above are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0124] Figure 5A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 5 As shown, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in ROM 502 or programs loaded into RAM 503 from storage section 508. Random access memory 503 also stores various programs and data required for system operation. The CPU 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.
[0125] The following components are connected to I / O interface 505: input section 506 including keyboard, mouse, etc.; output section 507 including cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; storage section 508 including hard disk, etc.; and communication section 509 including network interface card, modem, etc. Communication section 509 performs communication processing via a network such as the Internet. Drive 510 is also connected to I / O interface 505 as needed. Removable media 511, such as disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 510 as needed so that computer programs read from them can be installed into storage section 508 as needed.
[0126] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit 501, it performs various functions defined in the system of this application.
[0127] It should be noted that, Figure 5 The computer system 500 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0128] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0129] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A load balancing method for a storage system, characterized in that, The storage system includes multiple storage nodes, wherein data shards are stored on the storage nodes among the multiple storage nodes; the method includes: In the case of data shards to be migrated in the storage system, multiple candidate migration paths are constructed. Among these multiple candidate migration paths, one of the candidate migration paths is the path for migrating the data shard to be migrated from the source storage node where it is stored to a storage node in the storage system other than the source storage node. Determine the parameter value of the migration benefit parameter corresponding to the candidate migration path among the multiple candidate migration paths, wherein the migration benefit parameter is used to represent the relationship between the degree of adjustment of the load balance of the storage system by the data shard migration operation and the migration cost of the data shard; Among the multiple candidate migration paths, the candidate migration path with the largest corresponding migration benefit parameter value is determined as the target migration path, and the migration operation is performed on the data to be migrated in segments according to the target migration path.
2. The method according to claim 1, characterized in that, The parameter values for determining the migration benefit parameters corresponding to the candidate migration paths among the multiple candidate migration paths include: The candidate migration paths from the multiple candidate migration paths are used as candidate migration paths in the current candidate migration path, and the following determination operation is performed: Determine a first parameter value for the load balancing parameters before migrating the data shards to be migrated, wherein the load balancing parameters are used to represent the load differences between storage nodes in the storage system; The second parameter value is obtained by predicting the parameter values of the load balancing parameters after the data to be migrated is sharded and migrated according to the current candidate migration path; Based on the difference between the first parameter value and the second parameter value, and the current migration cost of the data shard to be migrated, the parameter value of the migration benefit parameter corresponding to the current candidate migration path is determined, wherein the current migration cost is the migration cost of migrating the data shard to be migrated according to the current candidate migration path, and the parameter value of the migration benefit parameter is positively correlated with the difference between the first parameter value and the second parameter value, and negatively correlated with the current migration cost.
3. The method according to claim 2, characterized in that, The first parameter value for determining the load balancing parameters before migrating the data shards includes at least one of the following: The maximum load node and the minimum load node of the data shards to be migrated before migration are determined, and the difference between the load of the maximum load node and the load of the minimum load node is determined as the first parameter value, wherein the maximum load node is the storage node with the largest load in the storage system, and the minimum load node is the storage node with the smallest load in the storage system. The maximum load node and the minimum load node of the data shards to be migrated before migration are determined, and the ratio between the load of the maximum load node and the load of the minimum load node is determined as the first parameter value, wherein the maximum load node is the storage node with the largest load in the storage system, and the minimum load node is the storage node with the smallest load in the storage system. The variance of the load of the storage nodes in the storage system before the data to be migrated is determined as the first parameter value.
4. The method according to claim 1, characterized in that, The method further includes: The candidate migration paths from the multiple candidate migration paths are used as candidate migration paths in the current candidate migration path, and the following prediction operation is performed: Predict the resource consumption of migrating the data shard to be migrated according to the current candidate migration path, and obtain the current resource consumption; The current resource consumption is determined as the migration cost of migrating the data shard to be migrated according to the current candidate migration path.
5. The method according to any one of claims 1 to 4, characterized in that, Before constructing multiple candidate migration paths, the method further includes: Collect load information of data shards on storage nodes in the storage system; Based on the load information of the data shards on the storage nodes in the storage system, the access frequency of the data shards on the storage nodes in the storage system is determined. The access frequency of the storage nodes in the storage system is determined based on the access frequency of the data shards on the storage nodes in the storage system. In the storage system, the storage nodes whose access popularity is greater than or equal to a first popularity threshold are identified as the source storage nodes, and the data fragments in the source storage nodes whose access popularity is greater than or equal to a second popularity threshold are identified as the data fragments to be migrated.
6. The method according to claim 5, characterized in that, The construction of multiple candidate migration paths includes: The storage nodes in the storage system with access popularity less than a third popularity threshold are selected, and the path from the source storage node to a storage node with access popularity less than the third popularity threshold is determined as a candidate migration path, thus obtaining the multiple candidate migration paths.
7. The method according to claim 5, characterized in that, The load information includes the parameter values of multiple load parameters, and one of the multiple load parameters corresponds to a parameter weight; Determining the access frequency of data shards on storage nodes in the storage system based on the load information of the data shards on the storage nodes in the storage system includes: The following determination operations are performed on the data fragments on the storage nodes in the storage system as the current data fragments: The product of the load parameter values, the corresponding parameter weights, and the time decay factors of the load parameters in the current data shard is summed, and the summation result is determined as the access popularity of the current data shard. The time decay factor is a function of an exponential function, which is a specified number as the base and the product of the time difference between the current time and the acquisition time of the load parameter value and the specified decay coefficient, and the specified decay coefficient is negative.
8. The method according to claim 7, characterized in that, The plurality of load parameters includes access frequency parameters; the method further includes: Based on the recorded load changes of storage nodes in the storage system during a specified time period, a first time interval within the specified time period is determined. Within the first time interval, the parameter weight corresponding to the access frequency parameter is increased; The first time interval is the time interval during which the load of the storage nodes in the storage system is greater than or equal to the first load threshold.
9. The method according to claim 7, characterized in that, The plurality of load parameters includes fragmentation capacity parameters; the method further includes: Based on the recorded load changes of storage nodes in the storage system during a specified time period, a second time interval within the specified time period is determined. During the second time interval, the parameter weight corresponding to the fragmentation capacity parameter is increased; The second time interval is the time interval during which the load of the storage nodes in the storage system is less than the second load threshold.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method as claimed in any one of claims 1 to 9.