Data fragmentation balancing method and device based on distributed storage and electronic equipment

By collecting and evaluating the data distribution of logical volumes in a distributed storage system and performing migration and loop operations, the problem of low data sharding balance in the existing technology is solved, and the performance and stability of the system are improved.

CN120469813AActive Publication Date: 2025-08-12BEIJING XSKY TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510940454.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-08-12
Estimated Expiration
2045-07-08

AI Technical Summary

Technical Problem

The existing distributed storage systems are less effective in data sharding balance, resulting in excessive loading of some nodes and low resource utilization, and lack of careful consideration of volume level balance. Migration decisions may be poor, resulting in unnecessary or omission of necessary migrations.

Method used

By collecting the data distribution and number of shards of each logical volume in the distributed storage system on each storage node, performing initial equalization checks, in-depth evaluation of the balanced status of the logical volume, identifying unbalanced logical volumes, and performing migration cycle operations until the system is balanced or reaches the preset number of migrations.

Benefits of technology

It realizes more accurate data imbalance state evaluation, optimizes migration priorities, reduces unnecessary migration, improves system performance and stability, and ensures a more uniform and dispersed data distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120469813A_ABST
    Figure CN120469813A_ABST
Patent Text Reader

Abstract

The invention discloses a data fragment balancing method and device based on distributed storage and electronic equipment, and relates to the technical field of distribution.The method comprises the steps that data distribution of each logical volume on each storage node in a distributed storage system at the current moment and the number of data fragments of each storage node are collected, based on the number of the data fragments of each storage node, carrying out initial equilibrium check on the distributed storage system to obtain a check result, and under the condition that the check result indicates that the distributed storage system is unbalanced, judging the equilibrium state of each logical volume based on the data distribution of each logical volume on each storage node, and under the condition that the logical volume in the unbalanced state exists, carrying out migration cycle operation on the logical volume in the unbalanced state until the distributed storage system is balanced or the migration frequency reaches the preset frequency, and solving the technical problem that the effectiveness of balancing the distributed storage system is relatively low in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a data sharding balancing method based on distributed storage, a device thereof, and an electronic device. Background Art

[0002] Distributed storage systems are widely used to provide scalable and highly available storage services. Data is typically organized into volumes and further divided into multiple shards. These shards are distributed across multiple physical or virtual storage nodes (Infinity Block Server Daemons, XBSDs) in a cluster. As cluster size changes (node additions and deletions, fault replacements), data is written and deleted, or node load fluctuates naturally, the distribution of shards across XBSDs can become uneven. This imbalance can lead to excessive load on some nodes, impacting overall system performance and stability, while other nodes experience low resource utilization. Therefore, data rebalancing mechanisms are essential components of distributed storage systems, dynamically adjusting shard distribution to achieve load balancing.

[0003] In related technologies, distributed storage systems generally adopt a rebalancing strategy based on the maximum-minimum difference (Max-MinDifference). Specifically, (1) Count the total number of shards currently carried on each XBSD. (2) Find the XBSD with the largest (Max) and smallest (Min) number of shards in the cluster. (3) If the difference between Max and Min exceeds a preset threshold (for example, Max-Min>1), the system is considered to be in an unbalanced state. (4) Select one or more shards from the XBSD with a larger number of shards (usually higher than the average or the largest number) and migrate them to the XBSD with a smaller number of shards (usually lower than the average or the smallest number). (5) Repeat this process until the difference in the number of shards on all XBSDs meets the balance condition.

[0004] However, the aforementioned maximum-minimum difference-based rebalancing strategy focuses primarily on the difference in the total number of shards at the global XBSD level and performs migration using a series of heuristic rules (such as randomly selecting source XBSDs and volumes and selecting the target XBSD with the least number of shards). This can easily lead to the following problems:

[0005] (1) Inaccurate assessment of imbalance: Simply comparing the maximum and minimum shard numbers on the global XBSD may not fully reflect the true discreteness of data distribution. For example, even if the difference between the maximum and minimum values is not large, there may be a situation where some XBSDs have concentrated loads while others have extremely low loads. This subtle overall uneven distribution is difficult to capture with a simple difference.

[0006] (2) Lack of detailed consideration of volume-level balancing: This approach usually first considers the total number of shards in the XBSD, but pays insufficient attention to whether the shards within a volume are evenly distributed across different XBSDs. Even if the shards of a volume are very unevenly distributed within its allowed XBSD range, they may be ignored because the total number of shards in the XBSD is within an acceptable range.

[0007] (3) Migration decisions may not be optimal: When choosing which volume and shard to migrate, there may be a lack of clear priorities, resulting in the selection of volumes with reasonable balance while skipping volumes that need more balance. Furthermore, the target XBSD may be selected based solely on its current minimum number of shards, without fully considering the contribution of the migration to the distribution of a specific volume.

[0008] (4) It may lead to unnecessary migration or omission of necessary migration: Since the evaluation criteria are relatively rough, unnecessary migration may be performed when the overall distribution is acceptable but the local difference triggers the threshold; or when the local difference is not large but the overall variance is large, necessary migration may not be triggered.

[0009] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0010] The embodiments of the present invention provide a data shard balancing method based on distributed storage, an apparatus thereof, and an electronic device thereof, so as to at least solve the technical problem of low effectiveness in balancing distributed storage systems in related technologies.

[0011] According to one aspect of an embodiment of the present invention, a data shard balancing method based on distributed storage is provided, comprising: collecting the data distribution of each logical volume on each storage node in the distributed storage system at the current moment and the number of data shards on each storage node, wherein the logical volume is a logical storage unit divided in the distributed storage system, and the data in the logical volume is divided into multiple data shards, and each data shard is stored on a storage node; based on the number of data shards on each storage node, an initial balancing check is performed on the distributed storage system to obtain a check result; if the check result indicates that the distributed storage system is unbalanced, the balance state of each logical volume is judged based on the data distribution of each logical volume on each storage node; if there are logical volumes in an unbalanced state, a migration cycle operation is performed on the logical volumes in the unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number.

[0012] Furthermore, the step of performing an initial balance check on the distributed storage system based on the number of data shards of each storage node includes: determining the maximum number of data shards and the minimum number of data shards based on the number of data shards of each storage node; determining that the distributed storage system is in balance when the difference between the maximum number of data shards and the minimum number of data shards is less than or equal to a preset number threshold; and determining that the distributed storage system is unbalanced when the difference between the maximum number of data shards and the minimum number of data shards is greater than a preset number threshold.

[0013] Further, the data distribution includes: the distribution number of data shards of the logical volume on each storage node, and the step of judging the balance state of each logical volume based on the data distribution of each logical volume on each storage node, including: for each logical volume, determining the maximum distribution number and the minimum distribution number based on the distribution number of data shards of the logical volume on each storage node; determining that the logical volume is in a balanced state when the difference between the maximum distribution number and the minimum distribution number is less than or equal to a preset distribution threshold; or determining the standard deviation and coefficient of variation of the logical volume based on the data distribution of the logical volume on each storage node when the difference between the maximum distribution number and the minimum distribution number is greater than the preset distribution threshold; determining that the logical volume is in an unbalanced state when the standard deviation of the logical volume is greater than the preset standard deviation threshold, and / or the coefficient of variation is greater than the preset variation threshold; determining that the logical volume is in a balanced state when the standard deviation of the logical volume is less than or equal to the preset standard deviation threshold and the coefficient of variation is less than or equal to the preset variation threshold.

[0014] Furthermore, the step of determining the standard deviation and coefficient of variation of the logical volume based on the data distribution of the logical volume on each storage node includes: determining the distribution average based on the distribution number of data shards of the logical volume on each storage node; determining the standard deviation based on the distribution number and distribution average of data shards of the logical volume on each storage node; and determining the coefficient of variation based on the standard deviation and the distribution average.

[0015] Furthermore, in the case where there are logical volumes in an unbalanced state, a migration cycle operation is performed on the logical volumes in the unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number, including: in the case where there are multiple logical volumes in an unbalanced state, determining the migration score of each logical volume; determining the logical volume indicated by the maximum migration score as the target logical volume, and selecting the data slices to be migrated from the target logical volume; determining the target storage center from the distributed storage system; migrating the data slices to be migrated from the source storage center to the target storage center to obtain a migration result, wherein the source storage center is the storage center where the data slices to be migrated were stored before the migration; when the migration result indicates that the migration is successful, updating the data distribution of the target logical volume on each storage node and the number of data slices on each storage node, and accumulating the number of migrations; based on the updated data distribution of the target logical volume on each storage node and the number of data slices on each storage node, re-judging the balance state of the distributed storage system until the distributed storage system is balanced or the number of migrations reaches a preset number.

[0016] Furthermore, the step of determining the migration score of each logical volume includes: for each logical volume, when the total number of data slices into which the logical volume is divided is less than or equal to the number of storage nodes, determining the maximum storage quantity of the data slices of the logical volume stored on a storage node; based on the maximum storage quantity, determining the error value of the logical volume; based on the error value and the total number of data slices, determining the migration score of the logical volume; when the total number of data slices into which the logical volume is divided is greater than the number of storage nodes, determining the maximum storage quantity and the minimum storage quantity of the data slices of the logical volume stored on a storage node; determining the actual storage difference based on the maximum storage quantity and the minimum storage quantity; determining the average storage quantity based on the total number of data slices and the number of nodes; and determining the migration score of the logical volume based on the actual storage difference, the ideal storage difference and the average storage quantity, wherein the ideal storage difference is determined based on the average storage quantity.

[0017] Furthermore, the step of determining the target storage center from the distributed storage system includes: selecting a storage center in the distributed storage system where the data shards of the target logical volume are not stored as a candidate storage center; selecting a candidate storage center with the smallest number of data shards from all candidate storage centers as the target storage center; when there are multiple candidate storage centers with the smallest number of data shards among all candidate storage centers, selecting any one candidate storage center from the multiple candidate storage centers with the smallest number of data shards as the target storage center; or, when there is no storage center in the distributed storage system where the data shards of the target logical volume are not stored, selecting the storage center with the smallest number of data shards from all storage centers as the target storage center; when there are multiple storage centers with the smallest number of data shards among all storage centers, selecting any one storage center from the multiple storage centers with the smallest number of data shards as the target storage center.

[0018] According to another aspect of an embodiment of the present invention, a data shard balancing device based on distributed storage is also provided, including: a collection unit, used to collect the data distribution of each logical volume on each storage node in the distributed storage system at the current moment and the number of data shards on each storage node, wherein the logical volume is a logical storage unit divided in the distributed storage system, and the data in the logical volume is divided into multiple data shards, and each data shard is stored in the storage node; an inspection unit, used to perform an initial balancing check on the distributed storage system based on the number of data shards on each storage node to obtain an inspection result; a judgment unit, used to judge the balance state of each logical volume based on the data distribution of each logical volume on each storage node when the inspection result indicates that the distributed storage system is unbalanced; a migration unit, used to perform a migration cycle operation on the logical volumes in an unbalanced state when there are logical volumes in an unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number of times.

[0019] Furthermore, the inspection unit includes: a first determination module, used to determine the maximum number of data shards and the minimum number of data shards based on the number of data shards of each storage node; a second determination module, used to determine that the distributed storage system is in balance when the difference between the maximum number of data shards and the minimum number of data shards is less than or equal to a preset number threshold; a third determination module, used to determine that the distributed storage system is in imbalance when the difference between the maximum number of data shards and the minimum number of data shards is greater than a preset number threshold.

[0020] Furthermore, the data distribution includes: the distribution number of data shards of the logical volume on each storage node, and the judgment unit includes: a fourth determination module, which is used to determine the maximum distribution number and the minimum distribution number for each logical volume based on the distribution number of data shards of the logical volume on each storage node; a fifth determination module, which is used to determine that the logical volume is in a balanced state when the difference between the maximum distribution number and the minimum distribution number is less than or equal to a preset distribution threshold; a sixth determination module, which is used to determine the standard deviation and the coefficient of variation of the logical volume based on the data distribution of the logical volume on each storage node when the difference between the maximum distribution number and the minimum distribution number is greater than the preset distribution threshold; a seventh determination module, which is used to determine that the logical volume is in an unbalanced state when the standard deviation of the logical volume is greater than a preset standard deviation threshold, and / or the coefficient of variation is greater than a preset variation threshold; an eighth determination module, which is used to determine that the logical volume is in a balanced state when the standard deviation of the logical volume is less than or equal to the preset standard deviation threshold and the coefficient of variation is less than or equal to the preset variation threshold.

[0021] Furthermore, the sixth determination module includes: a first determination submodule, used to determine the distribution average based on the distribution number of data shards of the logical volume on each storage node; a second determination submodule, used to determine the standard deviation based on the distribution number of data shards of the logical volume on each storage node and the distribution average; a third determination submodule, used to determine the coefficient of variation based on the standard deviation and the distribution average.

[0022] Furthermore, the migration unit includes: a ninth determination module, for determining the migration score of each logical volume when there are multiple logical volumes in an unbalanced state; a tenth determination module, for determining the logical volume indicated by the maximum migration score as the target logical volume, and selecting the data slices to be migrated from the target logical volume; an eleventh determination module, for determining the target storage center from the distributed storage system; a first migration module, for migrating the data slices to be migrated from the source storage center to the target storage center to obtain a migration result, wherein the source storage center is the storage center where the data slices to be migrated were stored before the migration; a first update module, for updating the data distribution of the target logical volume on each storage node and the number of data slices on each storage node and accumulating the number of migrations when the migration result indicates that the migration is successful; a first judgment module, for re-judging the balance state of the distributed storage system based on the updated data distribution of the target logical volume on each storage node and the number of data slices on each storage node, until the distributed storage system is in balance or the number of migrations reaches a preset number.

[0023] Furthermore, the ninth determination module includes: a fourth determination submodule for determining, for each logical volume, the maximum storage quantity of the data slices of the logical volume stored on a storage node when the total number of data slices into which the logical volume is divided is less than or equal to the number of nodes of the storage node; a fifth determination submodule for determining the error value of the logical volume based on the maximum storage quantity; a sixth determination submodule for determining the migration score of the logical volume based on the error value and the total number of data slices; a seventh determination submodule for determining the maximum storage quantity and the minimum storage quantity of the data slices of the logical volume stored on a storage node when the total number of data slices into which the logical volume is divided is greater than the number of nodes of the storage node; an eighth determination submodule for determining the actual storage difference based on the maximum storage quantity and the minimum storage quantity; a ninth determination submodule for determining the average storage quantity based on the total number of data slices and the number of nodes; a tenth determination submodule for determining the migration score of the logical volume based on the actual storage difference, the ideal storage difference and the average storage quantity, wherein the ideal storage difference is determined based on the average storage quantity.

[0024] Furthermore, the eleventh determination module includes: a first selection submodule, used to select a storage center where the data shards of the target logical volume are not stored as a candidate storage center from the distributed storage system; a second selection submodule, used to select a candidate storage center with the smallest number of data shards from all candidate storage centers as the target storage center; the first submodule, used to, when there are multiple candidate storage centers with the smallest number of data shards among all candidate storage centers, select one candidate storage center from the multiple candidate storage centers with the smallest number of data shards as the target storage center; the second submodule, used to, when there is no storage center where the data shards of the target logical volume are not stored in the distributed storage system, select the storage center with the smallest number of data shards from all storage centers as the target storage center; the third submodule, used to, when there are multiple storage centers with the smallest number of data shards among all storage centers, select one storage center from the multiple storage centers with the smallest number of data shards as the target storage center.

[0025] According to another aspect of an embodiment of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the above-mentioned data sharding balancing methods based on distributed storage.

[0026] According to another aspect of an embodiment of the present invention, an electronic device is also provided, including one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned data sharding balancing methods based on distributed storage.

[0027] In the present invention, the data distribution of each logical volume on each storage node and the number of data shards on each storage node in the distributed storage system at the current moment are collected, and based on the number of data shards on each storage node, an initial balancing check is performed on the distributed storage system to obtain a check result. When the check result indicates that the distributed storage system is unbalanced, the balance state of each logical volume is judged based on the data distribution of each logical volume on each storage node. When there are logical volumes in an unbalanced state, a migration cycle operation is performed on the logical volumes in the unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number, thereby solving the technical problem of low effectiveness of balancing the distributed storage system in the related art.

[0028] In the present invention, the data distribution of each logical volume on each storage node and the number of data shards on each storage node in the distributed storage system can be collected first, and then a quick initial balance check can be performed. If the system is found to be unbalanced, the balance status of each logical volume is deeply evaluated, the logical volume that really needs to be rebalanced is identified, and an iterative Shard migration operation is performed on it until the system is balanced or the preset migration limit is reached, thereby achieving the purpose of accurately identifying the data imbalance status, thereby realizing the technical effect of optimizing the dynamic balance of data shards, avoiding unnecessary data movement, and improving the overall performance and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0030] Figure 1 This is a flowchart of an optional data sharding balancing method based on distributed storage according to an embodiment of the present invention;

[0031] Figure 2 is a schematic diagram of an optional Shard rebalancing process according to an embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of an optional volume imbalance assessment process according to an embodiment of the present invention;

[0033] Figure 4is a schematic diagram of an optional Shard migration execution iterative process according to an embodiment of the present invention;

[0034] Figure 5 is a schematic diagram of an optional data sharding balancing device based on distributed storage according to an embodiment of the present invention;

[0035] Figure 6 This is a hardware structure block diagram of an electronic device (or mobile device) for a data sharding balancing method based on distributed storage according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0037] It should be noted that the terms "first," "second," and the like in the present invention are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.

[0038] To facilitate those skilled in the art to understand the present invention, some of the terms or nouns involved in the embodiments of the present invention are explained below:

[0039] Distributed storage system: refers to a system in which data is stored in a dispersed manner on multiple independent storage node devices.

[0040] XBSD (Infinity Block Server Daemon): A storage node or service instance in a distributed storage system.

[0041] Volume: A logical storage unit divided in a storage system, the basic unit of user data storage.

[0042] Shard: A further division of data within a volume, and the smallest unit of data migration and distribution.

[0043] Data balancing / rebalancing: In a distributed storage system, the process of adjusting the distribution of shards across different XBSDs to achieve a relatively even distribution of XBSD loads (such as storage capacity and I / O (input / output) pressure).

[0044] Standard Deviation (StdDev): A statistical concept used to measure the dispersion of a set of values relative to its mean. In this document, it refers to the standard deviation of the number of shards in a volume across all XBSDs.

[0045] Coefficient of Variation (CV): The ratio of the standard deviation to the mean, a relative measure of data dispersion. In this document, it refers to the ratio of the standard deviation of a volume's shard distribution to the average number of shards on each XBSD.

[0046] It should be noted that the relevant 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.) collected and involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse. For example, an interface is set up between this system and the relevant users or institutions. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or institution through the interface, and obtain the relevant information after receiving the consent information fed back by the aforementioned user or institution.

[0047] This paper proposes a statistically-based method for optimizing the distribution balance of data shards in distributed storage systems. This method accurately assesses the degree of dispersion of shards across storage nodes (XBSD) within each data unit (volume) and, combined with a priority strategy, iteratively migrates them to achieve optimal load balancing.

[0048] The present invention solves the following problems or achieves the following objectives by optimizing the distribution balance of data shards in a distributed storage system based on statistical indicators:

[0049] (1) More accurate assessment of data imbalance: Provides a method based on statistical indicators (standard deviation and coefficient of variation) to more accurately quantify the degree of imbalance in the distribution of shards within a single volume across its available XBSD nodes.

[0050] (2) Improve the accuracy of rebalancing decisions: Based on more accurate imbalance assessment, more effectively identify volumes and related XBSD nodes that do need to be rebalanced.

[0051] (3) Optimize migration priority: Introduce a priority scoring mechanism to prioritize volumes with the most unbalanced shard distribution, thereby improving the efficiency and effectiveness of rebalancing.

[0052] (4) Reduce unnecessary Shard migration: Through more detailed balance judgment conditions, avoid unnecessary Shard migration within an acceptable statistical fluctuation range and save system resources.

[0053] (5) Enhance the adaptability of the balancing strategy: Make the rebalancing strategy more adaptable to complex scenarios where different volumes have different total shard amounts and different XBSD constraints (preset lists, including: the first type of list (i.e. prohibiting the storage of shards of a certain volume on certain storage nodes listed in the list), the second type of list (i.e. (if it exists and is not empty) only allowing the storage of shards of a certain volume on specific storage nodes listed in the list).

[0054] (6) Improve the overall uniformity and dispersion of data distribution: By comprehensively considering the statistical characteristics of shard distribution within the volume and the target node selection strategy, promote more uniform and dispersed distribution of data.

[0055] The present invention will be described in detail below with reference to various embodiments.

[0056] Example 1

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

[0058] Figure 1 FIG. 1 is a flow chart of an optional data sharding balancing method based on distributed storage according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0059] Step S101, collect the data distribution of each logical volume on each storage node in the distributed storage system at the current moment and the number of data shards on each storage node, where a logical volume is a logical storage unit divided in the distributed storage system, and the data in the logical volume is divided into multiple data shards, each data shard is stored in a storage node.

[0060] In an embodiment of the present invention, before initiating a balancing check, a comprehensive understanding of the current data status of the distributed storage system is required. This can be done by first checking the current status and configuration of each storage node in the distributed storage system (cluster), i.e., the current operating status of all storage nodes (XBSD) in the cluster (e.g., whether they are online, undergoing maintenance or upgrades, etc.). Then, statistics are collected on the data distribution of each logical volume on each storage node in the distributed storage system. This means, from the perspective of each logical volume, the specific storage nodes on which all shards (i.e., the multiple data shards into which the data in the logical volume is divided) are currently distributed, as well as the number of shards on each storage node. Statistics are also collected on the specific logical volumes carried by each storage node, as well as detailed information on the individual data shards after these logical volumes are divided, to obtain a load profile for each storage node (i.e., the number of data shards currently carried by each storage node).

[0061] Here, "current moment" refers to the real-time point at which data is collected, ensuring that information is up-to-date and facilitating timely and accurate decision-making. A "distributed storage system" refers to a storage architecture in which data is partitioned and stored across multiple independent storage nodes within a cluster to improve data reliability and system scalability. A "logical volume" is the basic organization of user data within the system (i.e., the logical storage unit divided within a distributed storage system). Similar to volumes in a file system, but existing in a distributed environment, data is further divided into "data shards." These shards are distributed across different "storage nodes," each of which can be a physical server or a virtual storage entity. "Data distribution" refers to the layout of data shards for each logical volume across various storage nodes, including the number of shards and their location. "Data shard count" counts the total number of data shards across all logical volumes on a storage node. Collecting this data facilitates subsequent balancing checks.

[0062] In some optional embodiments, data placement constraints of a distributed storage system can be determined, that is, shard placement rules for a specific logical volume, for example: a first type of list is set, which prohibits shards of a certain volume from being stored on certain storage nodes listed in the list; a second type of list is set, and if the list exists and is not empty, shards of a certain volume are only allowed to be stored on specific storage nodes listed in the list.

[0063] Step S102: Based on the number of data shards of each storage node, an initial balance check is performed on the distributed storage system to obtain a check result.

[0064] In an embodiment of the present invention, after the number of data shards of each storage node is collected, an initial balance check can be performed on the distributed storage system to quickly assess whether the system is in an obvious imbalance state.

[0065] Here, the "check results" provide intuitive feedback on the system's balance status, which is used to determine whether a more detailed evaluation and data migration process is necessary. This preliminary check helps filter out simple cases that do not require rebalancing, saving computing resources.

[0066] Step S103: When the check result indicates that the distributed storage system is unbalanced, the balance state of each logical volume is determined based on the data distribution of each logical volume on each storage node.

[0067] In this embodiment of the present invention, when the "check results" indicate an overall system imbalance, further analysis is required to diagnose the imbalance at the level of each "logical volume." The balance status of each logical volume can be determined based on the collected data distribution information on the storage node, including the number and location of shards.

[0068] Specifically, a statistical analysis of the data distribution of each logical volume is performed, calculating the standard deviation and coefficient of variation of the data shard distribution on each storage node. This serves as a measure of the uniformity of the volume's data distribution. If the standard deviation or coefficient of variation of the data distribution for any volume exceeds the preset "balanced state" threshold, the volume is deemed unbalanced. By considering the overall dispersion of the data distribution, it can more accurately identify issues where localized unevenness exists despite minimal overall variation.

[0069] Step S104: If there are logical volumes in an unbalanced state, a migration cycle operation is performed on the logical volumes in the unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number.

[0070] In an embodiment of the present invention, if "logical volumes" in an unbalanced state are found, a "migration cycle operation" can be initiated for these volumes to improve data distribution by migrating data shards until the "balance" condition is met or the pre-set "migration times" limit is reached.

[0071] Here, the "balance" condition can be that the difference between the maximum and minimum number of data shards on a storage node is less than or equal to 1, or that the data distribution of all volumes falls within acceptable standard deviation and coefficient of variation thresholds (indicating that the distributed storage system is balanced). Furthermore, you can prevent infinite loops and excessive migrations by setting a "preset number" such as a maximum number of migrations or a maximum number of volumes to be processed.

[0072] In this embodiment of the present invention, during a loop, priority is given to logical volumes with the highest degree of imbalance. The node with the largest number of shards is selected as the source node, and data shards are migrated based on a series of optimization strategies (such as prioritizing nodes that do not contain the volume and have low load as target nodes). This process is iterative, with data distribution information updated and the balance status reassessed after each migration until equilibrium is achieved or the number limit is reached. This not only effectively reduces unnecessary data movement but also ensures a more even distribution of logical volume shards, improving system performance and stability.

[0073] Figure 2 is a schematic diagram of an optional Shard rebalancing process according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following:

[0074] (1) Start: Rebalance request.

[0075] (2) Initialization and data collection: Collect the number of shards of all XBSDs, the distribution of each volume on each XBSD, and the list restrictions.

[0076] (3) Fast balance check: Check based on the global Max-Min difference. For example, if there is no list restriction and the maximum and minimum difference in the number of Shards between the global XBSDs is less than or equal to 1, it is considered balanced and can be terminated directly: no rebalancing is required; if it is unbalanced, further inspection is required.

[0077] (4) Volume-by-Volume Imbalance Assessment: StdDev / CV. For each volume, the standard deviation (StdDev) and coefficient of variation (CV) are calculated based on its shard distribution on the available XBSDs.

[0078] (5) Is there any volume imbalance? Check whether the StdDev or CV of any volume exceeds the preset threshold. If so, perform Shard migration iterations. If not, terminate the process directly without rebalancing.

[0079] (6) Perform Shard migration iterations: If there is an unbalanced volume, enter a migration loop and try to move the Shard from the XBSD with high load to the XBSD with low load.

[0080] (7) Post-migration processing and result output: After the migration is completed, update the status and output the results.

[0081] In summary, we can first collect the data distribution of each logical volume on each storage node in the distributed storage system and the number of data shards on each storage node, and then perform a quick initial balance check. If the system is found to be unbalanced, we can deeply evaluate the balance status of each logical volume, identify the logical volumes that really need to be rebalanced, and perform iterative Shard migration operations on them until the system is balanced or reaches the preset migration limit, thereby achieving the purpose of accurately identifying the data imbalance state, thereby realizing the technical effect of optimizing the dynamic balance of data shards, avoiding unnecessary data movement, and improving the overall performance and stability of the system, thereby solving the technical problem of low effectiveness of balancing distributed storage systems in related technologies.

[0082] In order to achieve a fast balance check of a distributed storage system, in the data shard balancing method based on distributed storage provided in Example 1 of the present application, the maximum number of data shards and the minimum number of data shards are determined based on the number of data shards of each storage node; when the difference between the maximum number of data shards and the minimum number of data shards is less than or equal to a preset number threshold, it is determined that the distributed storage system is in balance; when the difference between the maximum number of data shards and the minimum number of data shards is greater than the preset number threshold, it is determined that the distributed storage system is in imbalance.

[0083] In an embodiment of the present invention, the "maximum number of data shards" and the "minimum number of data shards" can be determined based on the number of data shards of each storage node. The "maximum number of data shards" refers to the maximum number of Shards carried by the node, and the "minimum number of data shards" refers to the minimum number of Shards carried by the node. Then, a quick and intuitive method can be used to determine whether the entire distributed storage system is in a balanced state, that is, to compare whether the difference between the "maximum number of data shards" and the "minimum number of data shards" is "less than or equal to the preset number threshold." The threshold can be set according to the system design goals and actual operating experience, and is generally a small positive integer, such as 1. If the difference between the two meets this condition, it can be preliminarily concluded that the system has achieved balance, and no further data rebalancing operations are required. On the contrary, if the "difference is greater than the preset number threshold," it indicates that the system has an uneven load problem, and more in-depth analysis and adjustment are required.

[0084] In this embodiment, the "difference" between the "maximum number of data shards" and the "minimum number of data shards" is used to quickly screen out situations of obvious imbalance. Combined with the subsequent more in-depth logical volume imbalance assessment, it not only reduces the computational complexity of the system evaluation, but also ensures an accurate grasp of the imbalance state. In this way, while avoiding unnecessary data migration, it is possible to efficiently identify and solve the problem of uneven load within the storage system, thereby improving the uniformity of data distribution throughout the system, reducing I / O pressure, and ultimately achieving the goal of improving the performance and stability of the distributed storage system. In addition, by flexibly using the "preset quantity threshold", the system can adjust the sensitivity of rebalancing according to real-time load changes and business needs, thereby enhancing the adaptability and controllability of the strategy.

[0085] Optionally, the data distribution includes: the number of data shards of the logical volume distributed on each storage node. In order to improve the accuracy of judging the balanced state of each logical volume, in the data shard balancing method based on distributed storage provided in the first embodiment of the present application, for each logical volume, based on the number of data shards of the logical volume distributed on each storage node, the maximum distribution number and the minimum distribution number are determined; when the difference between the maximum distribution number and the minimum distribution number is less than or equal to a preset distribution threshold, the logical volume is determined to be in a balanced state; or, when the difference between the maximum distribution number and the minimum distribution number is greater than a preset distribution threshold, the standard deviation and coefficient of variation of the logical volume are determined based on the data distribution of the logical volume on each storage node; when the standard deviation of the logical volume is greater than the preset standard deviation threshold, and / or the coefficient of variation is greater than the preset variation threshold, the logical volume is determined to be in an unbalanced state; when the standard deviation of the logical volume is less than or equal to the preset standard deviation threshold and the coefficient of variation is less than or equal to the preset variation threshold, the logical volume is determined to be in a balanced state.

[0086] In an embodiment of the present invention, for each logical volume in the system, the distribution number of its data shards on each storage node (XBSD) can be analyzed first to obtain the specific distribution of the Shards of the logical volume on different nodes, providing basic data for subsequent balance judgment. By analyzing the distribution number of the data shards of the logical volume on each storage node, the maximum distribution number and the minimum distribution number can be determined. Among them, the "maximum distribution number" and the "minimum distribution number" refer to the distribution number carried by the node with the largest number of Shards of the logical volume and the distribution number carried by the node with the least number of Shards of the logical volume among all relevant storage nodes, respectively.

[0087] After obtaining the number of shards distributed for each logical volume, a quick balance check can be performed. This check is based on whether the difference between the "maximum distribution number" and the "minimum distribution number" is less than or equal to the preset "distribution threshold." If the difference meets the condition (i.e., the difference is less than or equal to the "distribution threshold"), the logical volume's shard distribution is preliminarily determined to be balanced. This allows logical volumes with minimal shard distribution differences that don't require a large-scale rebalancing operation to be quickly eliminated, saving computing resources.

[0088] If the difference between the "Maximum Distribution Number" and the "Minimum Distribution Number" exceeds the "Distribution Threshold," the volume's shard distribution cannot be simply assumed to be balanced. A more refined assessment is required, based on the "Standard Deviation" and "Coefficient of Variation" to further determine whether the logical volume is truly unbalanced. The standard deviation indicates the degree of dispersion of the number of shards relative to the average, while the "Coefficient of Variation" is the ratio of the standard deviation to the average, measuring the relative degree of dispersion. Only when the logical volume's "Standard Deviation" is greater than the "Preset Standard Deviation Threshold" and / or the "Coefficient of Variation" is greater than the "Preset Coefficient of Variation Threshold" can the logical volume's shard distribution be confirmed to be unbalanced. This dual standard allows for more precise judgments and can identify logical volumes that appear balanced but actually have excessively dispersed shard distributions.

[0089] If the "Standard Deviation" of the logical volume's data shard distribution is less than or equal to the "Preset Standard Deviation Threshold" and the "Coefficient of Variation" is less than or equal to the "Preset Coefficient of Variation Threshold," the logical volume is considered balanced. This ensures that even if there are minor differences, data migration won't be triggered as long as the overall distribution is relatively even, thus avoiding unnecessary system burden and resource waste.

[0090] In this embodiment, by introducing a multi-level balancing evaluation mechanism, the intelligence and efficiency of the distributed storage system rebalancing strategy are improved. Compared with the evaluation method that relies only on the maximum and minimum differences, this method can not only more accurately diagnose the logical volumes that actually need to be rebalanced, but also effectively avoid excessive processing of volumes that are already balanced or nearly balanced, thereby reducing the number of unnecessary data migrations, reducing network traffic and I / O pressure, and ultimately improving the overall performance and resource utilization of the storage system. At the same time, because the standard deviation and coefficient of variation are used as evaluation criteria, this method is more adaptable to different business needs and constraints (such as preset lists), and can achieve accurate data shard distribution adjustments in various complex scenarios.

[0091] In order to improve the accuracy of determining the standard deviation and coefficient of variation of a logical volume, in the data shard balancing method based on distributed storage provided in Example 1 of the present application, the distribution average is determined based on the number of data shards of the logical volume distributed on each storage node; the standard deviation is determined based on the number of data shards of the logical volume distributed on each storage node and the distribution average; and the coefficient of variation is determined based on the standard deviation and the distribution average.

[0092] In an embodiment of the present invention, the distribution average can be calculated based on the number of logical volume data shards distributed on each storage node and the number of distributed storage nodes. The distribution average refers to the average number of logical volume Shards distributed on all relevant storage nodes. By summing up the number of Shards distributed on all nodes of the logical volume and then dividing it by the total number of nodes, a value reflecting the central trend of the Shard distribution (i.e., the distribution average) can be obtained. Distribution average The calculation formula is as follows:

[0093] ;

[0094] in, Indicates the number of logical volume data slices distributed on the i-th storage node, and n indicates the number of storage nodes where the logical volume data slices are distributed.

[0095] After determining the distribution mean, the "standard deviation" can be calculated based on the number of logical volume data shards distributed on each storage node and the distribution mean. The standard deviation is a statistical indicator used to measure the degree of dispersion of a set of values relative to its mean. In this embodiment, the standard deviation can indicate the fluctuation of the number of logical volume Shards distributed on each storage node relative to the distribution mean. It can be calculated by summing the squares of the deviations between the number of Shards on each node and the distribution mean, then taking the average and taking the square root. The larger the standard deviation, the more uneven the Shard distribution, and vice versa. This indicator can be used to identify logical volumes that appear to be balanced but have large fluctuations in actual Shard distribution. Standard deviation The calculation formula is as follows:

[0096] ;

[0097] Then, the "coefficient of variation" can be calculated using the "standard deviation" and "distribution mean". The coefficient of variation is the ratio of the standard deviation to the mean, providing a relative indicator for measuring the degree of dispersion of the shard distribution. In some cases, the absolute standard deviation value may appear larger or smaller due to the size of the cardinality (mean value). The coefficient of variation eliminates the impact of the cardinality, thus enabling a more fair comparison of the uniformity of shard distribution across different logical volumes. A high coefficient of variation implies greater relative fluctuations, meaning that the imbalance in shard distribution is more severe and data rebalancing operations require a higher priority. The formula for calculating the coefficient of variation CV is as follows:

[0098] ;

[0099] In this embodiment, logical volumes that actually need to be rebalanced can be quickly identified. Furthermore, by using the coefficient of variation as a relative indicator, the degree of shard distribution imbalance can be more accurately assessed. This is especially true for volumes with a large total number of shards, where the absolute standard deviation may not be sufficient to reflect the distribution imbalance. Therefore, when dealing with complex storage environments, this embodiment can make more intelligent data migration decisions, avoid unnecessary shard movement, improve the efficiency of rebalancing operations, and reduce system overhead during data migration, thus playing a positive role in improving the overall performance and stability of the distributed storage system.

[0100] Figure 3 is a schematic diagram of an optional volume imbalance assessment process according to an embodiment of the present invention, such as Figure 3 As shown, the process includes the following:

[0101] (1) Start: Start imbalance assessment for a specific volume, that is, for a single logical volume.

[0102] (2) Obtain the shard number distribution of the volume on all available XBSDs, that is, count the number of data shards of this volume on each valid storage node.

[0103] (3) Max-Min difference ≤ 1, that is, determine whether the difference between the maximum number of shards (Max) and the minimum number of shards (Min) on each node of this volume is less than or equal to 1.

[0104] (4) If the difference is less than or equal to 1, the volume is considered to be locally balanced and the volume evaluation is completed directly.

[0105] (5) If the difference is greater than 1, calculate the StdDev and CV of the Shard distribution, that is, calculate the standard deviation (StdDev) and coefficient of variation (CV) of the Shard distribution of this volume.

[0106] (6) Determine whether StdDev or CV exceeds the preset threshold.

[0107] (7) If both StdDev and CV do not exceed the preset threshold, the volume is considered balanced and the volume evaluation is completed directly.

[0108] (8) If either StdDev or CV exceeds the preset threshold, the volume is marked as unbalanced, and the migration priority score of the volume is calculated to complete the volume evaluation.

[0109] In this embodiment, after all logical volumes have completed the imbalance assessment, all volumes marked as "unbalanced" and their corresponding priority scores can be summarized, and the unbalanced volumes can be sorted from high to low according to their priority scores. The volume with the highest score is selected from the sorting results as the preferred target for the migration operation.

[0110] In order to achieve accurate migration of unbalanced logical volumes, in the data shard balancing method based on distributed storage provided in Example 1 of the present application, when there are multiple logical volumes in an unbalanced state, the migration score of each logical volume is determined; the logical volume indicated by the maximum migration score is determined as the target logical volume, and the data shards to be migrated are selected from the target logical volume; the target storage center is determined from the distributed storage system; the data shards to be migrated are migrated from the source storage center to the target storage center to obtain a migration result, wherein the source storage center is the storage center where the data shards to be migrated were stored before migration; when the migration result indicates that the migration is successful, the data distribution of the target logical volume on each storage node and the number of data shards on each storage node are updated, and the number of migrations is accumulated; based on the updated data distribution of the target logical volume on each storage node and the number of data shards on each storage node, the balanced state of the distributed storage system is re-judged until the distributed storage system is balanced or the number of migrations reaches a preset number.

[0111] In an embodiment of the present invention, when multiple logical volumes are detected to be in an unbalanced state, a "migration score" can be calculated for each volume. This score is a comprehensive metric determined based on the characteristics of each volume (such as the total number of shards, the number of available storage nodes, the maximum and minimum differences in the current shard distribution, and the degree of deviation from the ideal average distribution). It is used to quantify the urgency of shard migration for each volume. By comprehensively considering the current state of each logical volume and the system environment, this score can guide the system to prioritize those volumes most in need of rebalancing, thereby improving the relevance and efficiency of rebalancing operations.

[0112] In this embodiment of the present invention, after calculating the migration scores for all unbalanced logical volumes, the logical volume indicated by the "maximum migration score" can be selected as the "target logical volume." Shard migration is prioritized for the volume with the highest migration score, aiming to achieve the greatest improvement in balancing. A "data shard to be migrated" (or "shard") is then selected from the target logical volume. The current distribution of the shards and the load of the storage nodes can be considered to ensure that migrating the selected shard substantially optimizes the distribution of the target logical volume. For example, the shard of the storage node with the highest load can be selected as the data shard to be migrated.

[0113] In this embodiment of the present invention, a "target storage center" refers to the storage node in the distributed storage system that receives the shard to be migrated. The target storage center can be automatically selected and determined based on factors such as the node's current load and whether it belongs to a preset list. If the target storage center is determined, a "data migration" operation is performed to move the shard to be migrated from the source storage center to the target storage center. The source storage center is the storage node where the shard to be migrated resided before the migration.

[0114] If the "Migration Result" indicates a successful migration, the "Data Distribution" of the target logical volume on each storage node and the "Number of Data Shards" for each storage node are updated to ensure the real-time and accuracy of system information and provide the latest data for subsequent balance status assessments. Furthermore, the "Number of Migrations" is accumulated to track the number of completed migration operations since the rebalancing process began, to avoid over-migration. Based on the updated data distribution and number of shards, the distributed storage system's balance status is reassessed to check whether all volumes are balanced or whether the "Preset Number of Migrations" limit has been reached.

[0115] This embodiment improves the intelligence and efficiency of shard rebalancing operations by introducing a migration score mechanism and a target logical volume selection strategy. This ensures that rebalancing decisions not only consider the global imbalance but also carefully analyze the shard distribution characteristics within each logical volume. This prioritizes volumes that have the greatest impact on overall system balance, reducing unnecessary data movement while maintaining good adaptability even in complex environments with pre-defined list constraints. This effectively reduces system overhead and improves the performance and reliability of distributed storage systems while ensuring uniform data distribution.

[0116] In order to improve the accuracy of determining the migration score of a logical volume, in the data shard balancing method based on distributed storage provided in Example 1 of the present application, for each logical volume, when the total number of data shards into which the logical volume is divided is less than or equal to the number of storage nodes, the maximum storage number of the data shards of the logical volume stored on one storage node is determined; based on the maximum storage number, the error value of the logical volume is determined; based on the error value and the total number of data shards, the migration score of the logical volume is determined; when the total number of data shards into which the logical volume is divided is greater than the number of storage nodes, the maximum storage number and the minimum storage number of the data shards of the logical volume stored on one storage node are determined; based on the maximum storage number and the minimum storage number, the actual storage difference is determined; based on the total number of data shards and the number of nodes, the average storage number is determined; based on the actual storage difference, the ideal storage difference and the average storage number, the migration score of the logical volume is determined, wherein the ideal storage difference is determined based on the average storage number.

[0117] In an embodiment of the present invention, when the total number of data shards (total_shards) that a logical volume is divided into is less than or equal to the number of storage nodes (available_count), ideally, each shard occupies a dedicated XBSD, or each XBSD has at most one shard for that volume. The number of shards for that volume on all XBSDs is either 0 or 1. If the number of shards for that volume on a particular XBSD is greater than 1, this means that shards that could be more dispersed are instead clumped together. Therefore, the maximum number of data shards for a logical volume that can be stored on a single storage node can be determined (i.e., which node stores the most data shards for that volume and the number of data shards for that volume on that node). Then, the ideal value (i.e., 1) can be subtracted from the maximum number to obtain the error value for that volume. This error value directly measures the "excess" accumulation and reflects the absolute degree of imbalance (how many shards are in the "wrong" locations). For example, if there are three shards for that volume on an XBSD, which should be dispersed, two are now redundant. The ratio of the error value to the total number of data shards is then calculated to determine the migration score for the logical volume. For example, if there are two shards on one XBSD, the imbalance is significantly greater than if there are only two shards on one XBSD.

[0118] In an embodiment of the present invention, if the total number of Shards of a logical volume is greater than the number of storage nodes, ideally, the Shards are distributed as evenly as possible across all available XBSDs. Ideally, the number of Shards for the volume on all XBSDs is either exactly the same or differs by at most 1. Therefore, ideal_max_min_gap (the ideal maximum-minimum gap, i.e., the ideal storage gap) is either 0 (i.e., the total number of data shards and the number of nodes are evenly divisible) or 1 (i.e., the total number of data shards and the number of nodes are not evenly divisible). If the actual max_min_gap (the difference between the actual maximum number of Shards (i.e., the maximum number of storage nodes) and the minimum number of Shards (i.e., the minimum number of storage nodes)) is much larger than ideal_max_min_gap, it indicates uneven distribution. Therefore, the maximum and minimum storage quantities of the data shards of the logical volume stored on a storage node can be determined first (i.e., determining which node stores the least number of data shards for the volume, and determining the number of data shards for the volume on the node). Next, based on the difference between the maximum and minimum storage amounts, the actual storage gap (max_min_gap) is determined. The difference between the actual storage gap (max_min_gap) and the ideal storage gap (ideal_max_min_gap) is also determined. This value represents the "gap" by which the actual distribution exceeds the ideal uniform distribution. A larger value indicates that the gap between the most crowded XBSD and the least crowded XBSD exceeds the ideal state. The average storage amount is then calculated by dividing the ratio of the total number of data shards to the number of nodes. The difference between the actual storage gap and the ideal storage gap is then divided by the average storage amount to determine the migration score for the logical volume. For example, if the ideal gap exceeds the ideal gap by two shards, the impact is relatively small if each XBSD should host an average of 10 shards. However, if each XBSD should host an average of only three shards, the gap becomes significantly larger. Therefore, the migration score measures the ratio of this "gap" to the average load.

[0119] This embodiment introduces the concepts of error values and storage differences, and uses these values to calculate migration scores, providing a more accurate and efficient data rebalancing strategy for distributed storage systems. This strategy not only distinguishes between the actual storage requirements and current distribution of different logical volumes, but also considers the number of storage nodes and the principle of average distribution. This allows rebalancing operations to avoid unnecessary data movement while effectively addressing uneven data distribution.

[0120] In order to improve the accuracy of determining the target storage center, in the data shard balancing method based on distributed storage provided in Example 1 of the present application, a storage center where the data shards of the target logical volume are not stored is selected from the distributed storage system as a candidate storage center; a candidate storage center with the smallest number of data shards is selected from all candidate storage centers as the target storage center; when there are multiple candidate storage centers with the smallest number of data shards among all candidate storage centers, one candidate storage center is selected from the multiple candidate storage centers with the smallest number of data shards as the target storage center; or, when there is no storage center where the data shards of the target logical volume are not stored in the distributed storage system, a storage center with the smallest number of data shards is selected from all storage centers as the target storage center; when there are multiple storage centers with the smallest number of data shards among all storage centers, one storage center is selected from the multiple storage centers with the smallest number of data shards as the target storage center.

[0121] In this embodiment of the present invention, when selecting a logical volume for shard migration, you can first select a "candidate storage center." A "candidate storage center" here refers to a storage node (XBSD) that currently does not store any shards for the logical volume. This allows shards to be distributed across different nodes, preventing excessive data concentration. This improves data distribution and system redundancy, enhancing overall system robustness and reliability.

[0122] After obtaining all candidate storage centers, you can determine which candidate storage center is most suitable as the target storage center based on the number of data shards. Specifically, you can select the candidate storage center with the smallest number of data shards, that is, the node currently hosting the fewest shards, as the target storage center. This way, shards are migrated to the node with the lowest load, balancing the storage pressure on each node and optimizing storage resource utilization.

[0123] Among the candidate storage centers, if there are multiple nodes with the smallest number of data shards, that is, there are multiple "candidate storage centers with the smallest number of data shards", then a node will be randomly selected as the "target storage center".

[0124] In this embodiment of the present invention, if there are no "storage centers with no data shards" in the distributed storage system, that is, all nodes have already stored the shards of the target logical volume, the "storage center with the smallest number of data shards" can be selected from "all storage centers" as the target. If there are multiple "storage centers with the smallest number of data shards", one of them will be randomly selected as the target storage center.

[0125] In some optional embodiments, when the number of Shards of storage nodes is the same, the node with the smallest node ID (ie, the number pre-configured for the node) may be selected as the target storage center.

[0126] This embodiment prioritizes nodes that don't store the target logical volume's shards and considers node load during selection, aiming to achieve widespread data distribution and load balancing across storage nodes. This optimizes shard distribution, reduces hotspots, and improves overall system performance and stability while avoiding data redundancy.

[0127] Figure 4 FIG. 1 is a schematic diagram of an optional iterative process of Shard migration execution according to an embodiment of the present invention. Figure 4 As shown, the process includes the following:

[0128] (1) Start iteration: Attempt to migrate a shard, that is, start an iterative process of attempting to migrate data shards.

[0129] (2) Determine whether there are still attempts or migration quotas, that is, check whether the preset total number of iterations, the total number of Shards or Volumes allowed to be migrated in this round, and other limits have been reached.

[0130] (3) If no, then end the iteration: the limit is reached (i.e., if any limit has been reached, then end this round of migration iteration); if yes, then select the source XBSD with the most shards from the current highest priority volume (i.e., if the limit has not been reached, then select the storage node (XBSD) that carries the largest number of shards of the current pending, highest priority volume as the migration source).

[0131] (4) Select a specific Shard from the source XBSD to be migrated, that is, on the selected source XBSD, select a specific data shard for the target volume to be migrated.

[0132] (5) Determine whether a shard that can be migrated is successfully found.

[0133] (6) If not, try the next volume or end. That is, if no shard is selected (for example, there is no shard to migrate for the volume on the source XBSD, or all other shards have been tried), try to process the volume with the next priority, or end the entire migration if there are no other volumes.

[0134] (7) If yes, select the target XBSD for the Shard. That is, if the source Shard is successfully selected, find a suitable target XBSD for migration. The dispersion strategy will be applied during the selection (such as giving priority to XBSDs that do not have such a volume and have a low total load).

[0135] (8) Determine whether a valid target XBSD that meets the policy is found for the Shard to be migrated.

[0136] (9) If not, mark this Shard as failed in this round of migration and re-determine whether there are more attempts or migration quotas; if yes, perform the migration: the Shard is moved from the source to the target, that is, if no suitable target is found, mark this Shard migration attempt as failed and prepare for the next iteration. If the target is found, perform the actual Shard migration operation and move it from the source XBSD to the target XBSD.

[0137] (10) Update the global Shard count and distribution map, that is, after the migration is successful, update the statistics and location mapping information of all relevant Shards in the system.

[0138] (11) Record the details of this migration and accumulate the relevant migration counters.

[0139] (12) Determine whether the Max-Min difference is ≤1, that is, check whether the maximum and minimum difference between the total number of Shards on all XBSDs in the entire cluster has reached the ideal balance state (the difference is less than or equal to 1).

[0140] (13) If yes, then end the iteration: reach the ideal equilibrium, that is, if the ideal equilibrium has been reached, end this round of migration iteration in advance.

[0141] (14) If not, re-judge whether there are still attempts or migration quotas. That is, if the ideal balance is not reached, return to the beginning of the loop and continue with the next iterative attempt.

[0142] In this embodiment of the present invention, imbalance diagnosis can be performed more accurately. By introducing two statistical indicators, standard deviation and coefficient of variation, to measure the shard distribution of each volume, the system can more comprehensively and accurately reflect the degree of dispersion and imbalance in data distribution, rather than relying solely on a simple comparison of extreme values (maximum / minimum). Furthermore, a more intelligent migration decision is provided. By prioritizing unbalanced volumes, the "most unbalanced" volumes can be identified, allowing the system to prioritize those volumes most in need of adjustment, thereby improving the overall efficiency and effectiveness of rebalancing. When selecting target XBSDs, nodes that do not yet host the volume are prioritized, promoting wider dispersion of data within the volume and avoiding concentrating shard migrations on a few nodes that already host the volume. Furthermore, unnecessary migrations are reduced. Statistical threshold-based judgments can avoid unnecessary migrations triggered by temporary, local maximum and minimum differences that do not affect the overall distribution. For example, even if a volume has one more shard than another on a particular XBSD, if its overall standard deviation and coefficient of variation are small, indicating that the distribution is still fairly even, migration may not be necessary. Volumes with a maximum and minimum number of shards distributed across nodes less than or equal to 1 are considered balanced. This also avoids unnecessary calculations and migration attempts for already balanced volumes.

[0143] Furthermore, independent statistical analysis of each volume can better handle situations where the total number of shards, importance, and access patterns across the system may vary significantly. Even with complex constraints such as pre-set lists, effective statistical evaluation and decision-making based on the permitted node range can be performed. Furthermore, more accurate and less unnecessary migrations can reduce network bandwidth consumption, I / O load, and computing overhead associated with data migration, thereby improving overall system performance and resource utilization.

[0144] In an embodiment of the present invention, compared with the current algorithm based on maximum-minimum difference, this embodiment can identify potential and subtle data distribution imbalance problems earlier in some scenarios. In the process of simulating the recovery of XBSD node downtime or the rebalancing process triggered by the addition of a new node, this embodiment tends to give priority to those volumes that are more statistically discrete, which helps the system recover from a serious imbalance faster. In addition, by adjusting the thresholds of the standard deviation and coefficient of variation, the sensitivity and migration amount of the rebalancing can be effectively controlled. In some cases, this embodiment can achieve better global balancing effects with fewer Shard migrations (for example, the total number of Shards on all XBSDs is less different, or the Shard distribution of critical business volumes is more even).

[0145] The following describes it in detail with reference to another embodiment.

[0146] Example 2

[0147] A data sharding balancing device based on distributed storage provided in this embodiment includes multiple implementation units, each implementation unit corresponding to each implementation step in the above-mentioned embodiment 1.

[0148] Figure 5 FIG. 1 is a schematic diagram of an optional data sharding balancing device based on distributed storage according to an embodiment of the present invention. Figure 5 As shown, the data shard balancing device may include: a collection unit 50, a checking unit 51, a judgment unit 52, and a migration unit 53.

[0149] The collection unit 50 is configured to collect the data distribution of each logical volume on each storage node and the number of data shards on each storage node in the distributed storage system at the current moment. A logical volume is a logical storage unit divided in the distributed storage system. The data in the logical volume is divided into multiple data shards, and each data shard is stored in a storage node.

[0150] A checking unit 51 is configured to perform an initial balance check on the distributed storage system based on the number of data shards on each storage node, and obtain a check result;

[0151] The judging unit 52 is configured to judge the balance state of each logical volume based on the data distribution of each logical volume on each storage node when the checking result indicates that the distributed storage system is unbalanced;

[0152] The migration unit 53 is configured to, if there are logical volumes in an unbalanced state, perform a migration cycle operation on the logical volumes in the unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number.

[0153] The above-mentioned data shard balancing device can collect the data distribution of each logical volume on each storage node in the distributed storage system and the number of data shards on each storage node, and then perform a quick initial balancing check. If the system is found to be unbalanced, it will deeply evaluate the balance status of each logical volume, identify the logical volumes that really need to be rebalanced, and perform iterative Shard migration operations on them until the system is balanced or reaches the preset migration limit, thereby achieving the purpose of accurately identifying the data imbalance status, thereby achieving the technical effect of optimizing the dynamic balance of data shards, avoiding unnecessary data movement, and improving the overall performance and stability of the system, thereby solving the technical problem of low effectiveness of balancing distributed storage systems in related technologies.

[0154] Optionally, the inspection unit includes: a first determination module, used to determine the maximum number of data shards and the minimum number of data shards based on the number of data shards of each storage node; a second determination module, used to determine that the distributed storage system is in balance when the difference between the maximum number of data shards and the minimum number of data shards is less than or equal to a preset number threshold; a third determination module, used to determine that the distributed storage system is unbalanced when the difference between the maximum number of data shards and the minimum number of data shards is greater than a preset number threshold.

[0155] Optionally, the data distribution includes: the distribution number of data shards of the logical volume on each storage node, and the judgment unit includes: a fourth determination module, which is used to determine the maximum distribution number and the minimum distribution number for each logical volume based on the distribution number of data shards of the logical volume on each storage node; a fifth determination module, which is used to determine that the logical volume is in a balanced state when the difference between the maximum distribution number and the minimum distribution number is less than or equal to a preset distribution threshold; a sixth determination module, which is used to determine the standard deviation and the coefficient of variation of the logical volume based on the data distribution of the logical volume on each storage node when the difference between the maximum distribution number and the minimum distribution number is greater than the preset distribution threshold; a seventh determination module, which is used to determine that the logical volume is in an unbalanced state when the standard deviation of the logical volume is greater than a preset standard deviation threshold, and / or the coefficient of variation is greater than a preset variation threshold; an eighth determination module, which is used to determine that the logical volume is in a balanced state when the standard deviation of the logical volume is less than or equal to the preset standard deviation threshold and the coefficient of variation is less than or equal to the preset variation threshold.

[0156] Optionally, the sixth determination module includes: a first determination submodule, used to determine the distribution average based on the distribution number of data shards of the logical volume on each storage node; a second determination submodule, used to determine the standard deviation based on the distribution number of data shards of the logical volume on each storage node and the distribution average; and a third determination submodule, used to determine the coefficient of variation based on the standard deviation and the distribution average.

[0157] Optionally, the migration unit includes: a ninth determination module for determining the migration score of each logical volume when there are multiple logical volumes in an unbalanced state; a tenth determination module for determining the logical volume indicated by the maximum migration score as the target logical volume, and selecting the data slices to be migrated from the target logical volume; an eleventh determination module for determining the target storage center from the distributed storage system; a first migration module for migrating the data slices to be migrated from the source storage center to the target storage center to obtain a migration result, wherein the source storage center is the storage center where the data slices to be migrated were stored before migration; a first update module for updating the data distribution of the target logical volume on each storage node and the number of data slices on each storage node and accumulating the number of migrations when the migration result indicates that the migration is successful; a first judgment module for re-judging the balance state of the distributed storage system based on the updated data distribution of the target logical volume on each storage node and the number of data slices on each storage node until the distributed storage system is in balance or the number of migrations reaches a preset number.

[0158] Optionally, the ninth determination module includes: a fourth determination submodule for determining, for each logical volume, the maximum storage quantity of the data slices of the logical volume stored on a storage node when the total number of data slices into which the logical volume is divided is less than or equal to the number of storage nodes; a fifth determination submodule for determining the error value of the logical volume based on the maximum storage quantity; a sixth determination submodule for determining the migration score of the logical volume based on the error value and the total number of data slices; a seventh determination submodule for determining the maximum storage quantity and the minimum storage quantity of the data slices of the logical volume stored on a storage node when the total number of data slices into which the logical volume is divided is greater than the number of storage nodes; an eighth determination submodule for determining the actual storage difference based on the maximum storage quantity and the minimum storage quantity; a ninth determination submodule for determining the average storage quantity based on the total number of data slices and the number of nodes; and a tenth determination submodule for determining the migration score of the logical volume based on the actual storage difference, the ideal storage difference and the average storage quantity, wherein the ideal storage difference is determined based on the average storage quantity.

[0159] Optionally, the eleventh determination module includes: a first selection submodule, used to select a storage center where the data shards of the target logical volume are not stored as a candidate storage center from the distributed storage system; a second selection submodule, used to select a candidate storage center with the smallest number of data shards from all candidate storage centers as the target storage center; the first submodule, used to, when there are multiple candidate storage centers with the smallest number of data shards among all candidate storage centers, select one candidate storage center from the multiple candidate storage centers with the smallest number of data shards as the target storage center; the second submodule, used to, when there is no storage center in the distributed storage system where the data shards of the target logical volume are not stored, select the storage center with the smallest number of data shards from all storage centers as the target storage center; the third submodule, used to, when there are multiple storage centers with the smallest number of data shards among all storage centers, select one storage center from the multiple storage centers with the smallest number of data shards as the target storage center.

[0160] The above-mentioned data sharding balancing device can also include a processor and a memory. The above-mentioned collection unit 50, inspection unit 51, judgment unit 52, migration unit 53, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.

[0161] The processor includes a kernel that retrieves corresponding program units from memory. One or more kernels can be configured to adjust kernel parameters to cyclically migrate unbalanced logical volumes until the distributed storage system is balanced or a preset number of migrations is reached.

[0162] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0163] The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: collecting the data distribution of each logical volume on each storage node in the distributed storage system at the current moment and the number of data shards on each storage node, performing an initial balance check on the distributed storage system based on the number of data shards on each storage node, and obtaining a check result; if the check result indicates that the distributed storage system is unbalanced, judging the balance state of each logical volume based on the data distribution of each logical volume on each storage node; if there are logical volumes in an unbalanced state, performing a migration cycle operation on the logical volumes in the unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number.

[0164] According to another aspect of an embodiment of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the above-mentioned data sharding balancing methods based on distributed storage.

[0165] According to another aspect of an embodiment of the present invention, an electronic device is also provided, including one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the above-mentioned data sharding balancing method based on distributed storage.

[0166] Figure 6 This is a hardware structure block diagram of an electronic device (or mobile device) for a data sharding balancing method based on distributed storage according to an embodiment of the present invention. Figure 6 As shown, the electronic device may include one or more processors (e.g., Figure 6 The processors 602a, 602b, ..., 602n, etc., which may include but are not limited to processing devices such as microprocessors (MCUs) or programmable logic devices (FPGAs), and a memory 604 for storing data. In addition, the processors 602a, 602b, ..., 602n, etc., may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. It will be understood by those skilled in the art that Figure 6 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 6 More or fewer components than shown, or with Figure 6 Different configurations shown.

[0167] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0168] The embodiments or examples of the present disclosure are not exhaustive, but are merely illustrations of some embodiments or examples, and are not intended to be specific limitations on the scope of protection of the present disclosure. In the absence of contradiction, each step in a certain embodiment or example can be implemented as an independent example, and the steps can be arbitrarily combined. For example, a solution after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be arbitrarily combined; in addition, the various embodiments or examples can be arbitrarily combined. For example, some or all steps of different embodiments or examples can be arbitrarily combined, and a certain embodiment or example can be arbitrarily combined with the optional methods or optional examples of other embodiments or examples.

[0169] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0170] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, and can be electrical or other forms.

[0171] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0172] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0173] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), a mobile hard drive, a magnetic disk, or an optical disk.

[0174] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A data sharding balancing method based on distributed storage, characterized in that: include: Collecting the data distribution of each logical volume on each storage node in the distributed storage system at the current moment and the number of data shards on each storage node, wherein the logical volume is a logical storage unit divided in the distributed storage system, the data in the logical volume is divided into multiple data shards, and each data shard is stored on the storage node; Performing an initial balance check on the distributed storage system based on the number of data shards of each storage node to obtain a check result; If the checking result indicates that the distributed storage system is unbalanced, determining a balance state of each logical volume based on the data distribution of each logical volume on each storage node; In the case that the logical volume in the unbalanced state exists, a migration cycle operation is performed on the logical volume in the unbalanced state until the distributed storage system is balanced or the number of migrations reaches a preset number.

2. The data sharding balancing method according to claim 1, characterized in that: The step of performing an initial balance check on the distributed storage system based on the number of data shards of each storage node includes: Determine a maximum number of data shards and a minimum number of data shards based on the number of data shards of each storage node; When the difference between the maximum number of data shards and the minimum number of data shards is less than or equal to a preset number threshold, determining that the distributed storage system is in balance; When the difference between the maximum number of data shards and the minimum number of data shards is greater than the preset number threshold, it is determined that the distributed storage system is unbalanced.

3. The data sharding balancing method according to claim 1, characterized in that: The data distribution includes: the number of data shards of the logical volume distributed on each storage node. Based on the data distribution of each logical volume on each storage node, the step of determining the balance state of each logical volume includes: For each of the logical volumes, determining a maximum distribution quantity and a minimum distribution quantity based on the distribution quantity of the data slices of the logical volume on each of the storage nodes; In a case where the difference between the maximum distribution quantity and the minimum distribution quantity is less than or equal to a preset distribution threshold, determining that the logical volume is in a balanced state; or When the difference between the maximum distribution quantity and the minimum distribution quantity is greater than the preset distribution threshold, determining a standard deviation and a coefficient of variation of the logical volume based on the data distribution of the logical volume on each of the storage nodes; When the standard deviation of the logical volume is greater than a preset standard deviation threshold, and / or the coefficient of variation is greater than a preset variation threshold, determining that the logical volume is in an unbalanced state; When the standard deviation of the logical volume is less than or equal to the preset standard deviation threshold and the coefficient of variation is less than or equal to the preset variation threshold, it is determined that the logical volume is in a balanced state.

4. The data sharding balancing method according to claim 3, characterized in that: The step of determining the standard deviation and the coefficient of variation of the logical volume based on the data distribution of the logical volume on each storage node includes: Determine a distribution average based on the distribution quantity of the data shards of the logical volume on each of the storage nodes; Determining the standard deviation based on the distribution number of the data slices of the logical volume on each storage node and the distribution average; The coefficient of variation is determined based on the standard deviation and the distribution mean.

5. The data sharding balancing method according to claim 1, characterized in that: In the case where the logical volume is in an unbalanced state, the step of performing a migration cycle operation on the logical volume in the unbalanced state until the distributed storage system is in a balanced state or the number of migrations reaches a preset number includes: In a case where there are multiple logical volumes in an unbalanced state, determining a migration score for each of the logical volumes; Determine the logical volume indicated by the maximum migration score as the target logical volume, and select data slices to be migrated from the target logical volume; Determining a target storage center from the distributed storage system; Migrating the data shards to be migrated from the source storage center to the target storage center to obtain a migration result, wherein the source storage center is the storage center where the data shards to be migrated are stored before the migration; If the migration result indicates that the migration is successful, updating the data distribution of the target logical volume on each storage node and the number of data shards on each storage node, and accumulating the number of migrations; Based on the updated data distribution of the target logical volume on each storage node and the number of data shards on each storage node, the equilibrium state of the distributed storage system is re-determined until the distributed storage system is in equilibrium or the number of migrations reaches the preset number.

6. The data sharding balancing method according to claim 5, characterized in that: The step of determining the migration score of each logical volume comprises: For each of the logical volumes, when the total number of data slices into which the logical volume is divided is less than or equal to the number of the storage nodes, determining a maximum number of data slices of the logical volume that can be stored on one of the storage nodes; determining an error value of the logical volume based on the maximum storage quantity; determining the migration score of the logical volume based on the error value and the total number of data slices; In a case where the total number of the data slices into which the logical volume is divided is greater than the number of the storage nodes, determining a maximum storage quantity and a minimum storage quantity of the data slices of the logical volume stored on one storage node; determining an actual storage difference based on the maximum storage quantity and the minimum storage quantity; Determine an average storage quantity based on the total number of data shards and the number of nodes; The migration score of the logical volume is determined based on the actual storage difference, the ideal storage difference, and the average storage quantity, wherein the ideal storage difference is determined based on the average storage quantity.

7. The data sharding balancing method according to claim 5, characterized in that: The step of determining a target storage center from the distributed storage system includes: Selecting the storage center where the data slice of the target logical volume is not stored as a candidate storage center from the distributed storage system; Selecting the candidate storage center with the smallest number of data shards from all the candidate storage centers as the target storage center; In the case that there are multiple candidate storage centers with the minimum number of data shards among all the candidate storage centers, any one of the candidate storage centers with the minimum number of data shards is selected as the target storage center; or In the case that there is no storage center in the distributed storage system that does not store the data slices of the target logical volume, selecting the storage center with the smallest number of data slices from all the storage centers as the target storage center; In the case that there are multiple storage centers with the minimum number of data shards among all the storage centers, one storage center is selected from the multiple storage centers with the minimum number of data shards as the target storage center.

8. A data sharding balancing device based on distributed storage, characterized in that: include: a collection unit, configured to collect data distribution of each logical volume on each storage node in the distributed storage system at a current moment, and the number of data shards on each storage node, wherein the logical volume is a logical storage unit divided in the distributed storage system, the data in the logical volume is divided into multiple data shards, and each data shard is stored on the storage node; A checking unit, configured to perform an initial balance check on the distributed storage system based on the number of data shards of each storage node, and obtain a check result; a judging unit, configured to, if the checking result indicates that the distributed storage system is unbalanced, judge a balance state of each logical volume based on the data distribution of each logical volume on each storage node; The migration unit is configured to, when there is an unbalanced logical volume, perform a migration cycle operation on the unbalanced logical volume until the distributed storage system is balanced or the number of migrations reaches a preset number.

9. A computer program product, characterized in that It includes a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the data sharding balancing method based on distributed storage as described in any one of claims 1 to 7.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data sharding balancing method based on distributed storage as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for migrating files

    CN105930545A

  • Method of analyzing performance in a storage system

    US20080216086A1

  • System and method for optimizing data migration in a partitioned database

    US20120254175A1

  • Rebalancing of the first extents of logical volumes among a plurality of ranks

    US20190065068A1

  • Distributed storage system and volume management method

    US20230021806A1