Data processing method and device based on distributed storage and electronic equipment
By enabling each node in the distributed storage system to autonomously receive and process load information, the problems of long processing times and high resource consumption caused by reliance on the scheduling center are solved, thus achieving efficient load balancing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2026-03-10
AI Technical Summary
In existing distributed systems, resource scheduling relies on a scheduling center, which results in long processing times and high computational resource consumption in generating scheduling decisions.
Each data processing node receives load-related information from other nodes, autonomously determines its load status, and migrates data to the target node when overloaded, thereby achieving load balancing.
This reduces the time spent generating scheduling decisions and the consumption of computing resources, thereby improving the efficiency of load balancing.
Smart Images

Figure CN121636066A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed storage technology, and more specifically, to a data storage method, apparatus, electronic device, and computer-readable storage medium based on distributed storage. Background Technology
[0002] A distributed system is a system composed of a group of independent computers that are interconnected through a network and collaborate to complete tasks. These independent computers are usually called nodes, and to the user, they appear as a unified system. The design and implementation of distributed systems aim to address a variety of challenges, including but not limited to performance, scalability, reliability, and availability.
[0003] In existing distributed systems, node resource scheduling and load balancing are handled by a centralized service. Examples include Kubernetes' container scheduling within a hardware cluster and TiKV's Placement Driver (PD) service's scheduling of storage units. In these solutions, each node periodically reports its load data to a scheduling center. The scheduling center then integrates and analyzes all node load data, makes scheduling decisions, generates corresponding scheduling tasks, and sends these tasks to the respective nodes for execution. Therefore, in existing technologies, resource scheduling and load balancing rely on information from the scheduling center, resulting in time-consuming scheduling decision generation and high computational resource consumption. Summary of the Invention
[0004] This application provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product for distributed storage. This application aims to solve the problem that existing technologies in distributed systems rely on a scheduling center, resulting in long time consumption for generating scheduling decisions and high computational resource consumption during resource scheduling.
[0005] According to a first aspect of the embodiments of this application, a data processing method for distributed storage is provided. The method is applied to a distributed system comprising multiple data processing nodes. The method is executed by a first data node, which is any data processing node in the distributed system. The method includes: The system receives load-related information broadcast by each of the second data nodes, wherein each of the second data nodes is a data processing node other than the first data node among the plurality of data processing nodes, and the load-related information includes the index value of at least one load evaluation index, wherein the at least one load evaluation index includes a storage index, and the index value of the storage index is the amount of data stored. The load status of the first data node is determined based on the load-related information of each third data node; each third data node includes the first data node and each second data node. When the load state is overloaded, a data migration operation is performed; the data migration operation includes: Based on the load-related information of the first data node, determine the data to be migrated from the first data node; Based on the amount of data to be migrated and the load-related information of each of the second data nodes, a target node is determined from each of the second data nodes, and the data to be migrated is migrated to the target node.
[0006] According to a second aspect of the embodiments of this application, a data processing apparatus based on distributed storage is provided, applied to a first data node of a distributed system, the distributed system including multiple data processing nodes, wherein the first data node is any data processing node in the distributed system, the apparatus comprising: A receiving module is used to receive load-related information broadcast by each of the second data nodes, wherein each of the second data nodes is a data processing node other than the first data node among the plurality of data processing nodes, and the load-related information includes the index value of at least one load evaluation index, wherein the at least one load evaluation index includes a storage index, and the index value of the storage index is the amount of data stored. The determination module is used to determine the load status of the first data node based on the load-related information of each third data node; the third data node includes the first data node and the second data node. The migration module is used to perform a data migration operation when the load state is overloaded; the data migration operation includes: Based on the load-related information of the first data node, determine the data to be migrated from the first data node; Based on the amount of data to be migrated and the load information of each of the second data nodes, a target node is determined from each of the second data nodes, and the data to be migrated is migrated to the target node.
[0007] According to a third aspect of the embodiments of this application, an electronic device is provided, the electronic device including a memory, a processor and a computer program stored in the memory, wherein the processor executes the program to implement the steps of the method provided in the first aspect.
[0008] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps of the method provided in the first aspect.
[0009] According to a fifth aspect of the present application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, causing the computer device to perform steps implementing the method provided in the first aspect.
[0010] The beneficial effects of the technical solution provided in this application embodiment are as follows: The distributed storage data processing in this application embodiment is executed by any data processing node. Each data processing node can receive load-related information broadcast by other data processing nodes and can determine its own load status based on the load-related information of all data processing nodes. When its own load status is overloaded, it determines its own data to be migrated based on its own load-related information. Based on the amount of data to be migrated and the load information of other data nodes, it determines the target node from other data nodes and migrates the data to be migrated to the target node. Therefore, in this application embodiment, by distributing the scheduling tasks of the scheduling center in the prior art to each data processing node, each data processing node determines whether its own load status is overloaded and determines the target node when overloaded, and migrates its own data to be migrated to the target node. Therefore, in this application embodiment, each data processing node only needs to focus on whether its own load status is overloaded to achieve load balancing. Therefore, the distributed storage data processing method provided in this application embodiment has the advantages of short time consumption and low computational resource consumption in generating scheduling decisions and load balancing compared with the prior art. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0012] Figure 1 This is a schematic diagram of a system architecture for data processing that implements distributed storage, provided in an embodiment of this application. Figure 2 A flowchart illustrating a data processing method for distributed storage provided in an embodiment of this application; Figure 3 A schematic diagram of a tree structure provided in an embodiment of this application; Figure 4 This is another tree structure diagram provided in an embodiment of this application; Figure 5 A schematic diagram illustrating the determination of a target node provided in an embodiment of this application; Figure 6 This is a schematic diagram illustrating another method for determining a target node, as provided in an embodiment of this application. Figure 7 A schematic diagram of a tree structure provided in an embodiment of this application; Figure 8 This is a schematic diagram illustrating another method for determining a target node, as provided in an embodiment of this application. Figure 9 This is a schematic diagram illustrating another method for determining a target node, as provided in an embodiment of this application. Figure 10 A flowchart illustrating another data processing method based on distributed storage provided in an embodiment of this application; Figure 11 This application provides a schematic diagram of the structure of a data processing device based on distributed storage, as shown in the embodiments of this application. Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0013] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0014] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.”
[0015] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0017] First, let's introduce and explain several terms used in this application: A distributed system is a system composed of a group of independent computers that are interconnected through a network and collaborate to complete tasks. To the end user, these independent computers (usually called nodes) appear as a single, consistent system. Distributed systems are designed and implemented to address a variety of challenges, including but not limited to performance, scalability, reliability, and availability.
[0018] Consensus algorithms are a class of algorithms in the fields of distributed computing and distributed systems. Their goal is to enable multiple nodes in a system to reach a consensus on a value (or a set of values) even in the presence of failures. Consensus algorithms are crucial in distributed systems because they ensure the reliability and consistency of the system, even in the event of network latency, partitions, or node failures.
[0019] Data sharding is a database architecture technique designed to improve the management efficiency and performance of large-scale datasets by distributing data across multiple databases or database nodes. This approach is commonly used in distributed database systems and can significantly improve query response time, increase system scalability, and availability.
[0020] The Gossip protocol, also known as the gossip protocol or propagation protocol, is an algorithm used for inter-node communication and data synchronization in distributed systems.
[0021] A moving average (MA) is a statistical tool used to analyze series of data points. It displays trends in data by creating a series of averages. Moving averages can smooth out short-term fluctuations and highlight long-term trends or cycles.
[0022] The data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in this application aim to solve the problems of long scheduling time and high computational resource consumption in the prior art when generating scheduling decisions and realizing load balancing of distributed systems.
[0023] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0024] Figure 1 This is a schematic diagram of a system architecture for implementing data processing based on distributed storage, provided in an embodiment of this application. The system includes multiple data processing nodes, each of which is a computer. The first data node is any data processing node; taking data processing node A as an example, the other data processing nodes are second data nodes. Data processing node A receives load-related information broadcast by the other data processing nodes. Each data processing node includes a data collection module, which comprises a broadcast submodule and a receiving and organizing submodule. The broadcast submodule sends its own load-related information, such as CPU utilization, memory usage, storage capacity, and request frequency, to other data nodes. The receiving and organizing submodule continuously receives load-related information broadcast by other nodes. Each data processing node also includes a node self-checking module and a scheduling module. The node self-checking module determines its own load status based on the load-related parameters of each data node in the system, and when its own load status is overloaded, determines the data to be migrated and the target node. The scheduling module migrates the data to be migrated to the target node.
[0025] All data processing nodes are connected via a network, which can include, but is not limited to, wired and wireless networks. Wired networks can include local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs), while wireless networks can include Bluetooth, Wi-Fi, and other networks that enable wireless communication. The specific network can be determined based on the actual application scenario and is not limited here.
[0026] This application provides a distributed storage data processing method. The method is applied to a distributed system comprising multiple data processing nodes. The method is executed by a first data node, which can be any data processing node in the distributed system. Figure 2 As shown, the method includes: S201, Receive the respective load-related information broadcast by each of the second data nodes.
[0027] Each second data node is a data processing node other than the first data node among multiple data processing nodes. The load-related information includes the value of at least one load evaluation indicator, and the at least one load evaluation indicator includes a storage indicator, the value of which is the amount of data stored.
[0028] In this embodiment, the distributed system can be a distributed cluster composed of multiple computers. Data processing nodes in the distributed system can be computers, and any data processing node in the distributed system can execute the distributed storage-based data processing method of this embodiment. Taking the execution entity as a first data node as an example, the first data node can be any data processing node in the distributed system, and data processing nodes other than the first data node serve as second data nodes. This embodiment will be described below.
[0029] The first data node can receive load-related information broadcast by each of the second data nodes. This load-related information consists of the values of at least one load evaluation metric, including a storage metric. The value of this storage metric is the amount of data stored, which can be the total amount of data stored in the data processing node or the individual data amount of each data node. As an optional embodiment, the load evaluation metric in this application embodiment further includes at least one of CPU utilization, memory availability, storage availability, and request frequency.
[0030] Among them, CPU utilization is used to measure the busyness of CPU processing tasks; memory usage refers to the amount of memory currently used by the data processing node, including memory used for caching, processing requests, etc.; storage space represents the amount of storage space available to the data processing node; and request frequency is the number of requests received by the data processing node per unit time. Each load evaluation metric in this application embodiment can be used to represent the load status of the data processing node.
[0031] In this embodiment of the application, each data processing node can collect its own load-related information and broadcast its own load-related information to other data processing nodes in the distributed system via the Gossip protocol every first time interval.
[0032] As an optional embodiment, the values of each load assessment metric can be the moving average or sampled values of the load assessment metrics collected within the first time interval as load-related information. An appropriate method for determining the metric values can be selected based on the characteristics of the load assessment metrics, so that the obtained load-related information can more accurately reflect the load situation within the first time interval. For example, the values of load assessment metrics such as CPU utilization and memory usage can be the moving averages of CPU utilization and memory usage within the first time interval, while the values of load assessment metrics such as storage capacity can be instantaneous values sampled within the first time interval.
[0033] As another optional embodiment, considering that the load assessment index of the data processing node may be unstable within a certain event interval, the load-related information broadcast by the data processing node can be the weighted value of the load assessment index of the previous first time interval and the load assessment index of the current first time interval. That is, the load-related information broadcast in the current first time interval refers to the load assessment index of the previous time interval, so as to more accurately reflect the load status of the current data processing node.
[0034] S202. Determine the load status of the first data node based on the load-related information of each third data node; each third data node includes the first data node and each second data node.
[0035] In this embodiment of the application, the first data node obtains the load-related information of each of the second data nodes based on the load-related information received from each of the second data nodes and the load-related information it has collected. For ease of description, the first data node and each of the second data nodes are referred to as third data nodes. Thus, the first data node obtains the load-related information of each of the third data nodes.
[0036] Data analysis is performed on the load-related information of each third data node to determine the load status of the first data node. The load status can be divided into overload and underload. When the load status is overloaded, it means that the current data processing node has a high load intensity and a weak ability to process tasks or requests. When the load status is underloaded, it means that the current data processing node has a low load intensity and a strong ability to process tasks or requests.
[0037] As an optional embodiment, a numerical range can be set for each load assessment metric. When the value of the load assessment metric is outside the numerical range, the load status of the data processing node is overloaded. For example, the numerical range of CPU utilization can be set to [0, 90]. If the CPU utilization of the first data node exceeds the numerical range, the load status of the first data node is overloaded.
[0038] S203. When the load condition is overloaded, perform a data migration operation; the data migration operation includes: Based on the load-related information of the first data node, determine the data to be migrated from the first data node; Based on the amount of data to be migrated and the load information of each of the second data nodes, a target node is determined from each of the second data nodes, and the data to be migrated is migrated to the target node.
[0039] In this embodiment of the application, when the first data node determines that its own load status is overloaded, it indicates that the distributed system is in a state of unbalanced load. Therefore, it is necessary to perform a data migration operation on the first data node. The data migration operation is used to migrate the data stored by itself to other data processing nodes, thereby reducing its own load and improving its ability to process tasks or requests.
[0040] In this embodiment of the application, the data migration operation includes performing data analysis on its own load-related information, determining the data that needs to be migrated, and taking the data that needs to be migrated as the data to be migrated. As an optional embodiment, the data to be migrated can be determined according to the size of each data. For example, the data with the largest data volume can be taken as the data to be migrated, thereby increasing the storage capacity index value and reducing the load.
[0041] In this embodiment of the application, the data processing node to which the data to be migrated is to be migrated is taken as the target node. In order to determine the target node, data analysis is performed on the amount of data to be migrated and the load-related information of each second data node. The target node is determined from each second data node, and the data to be migrated is migrated to the target node.
[0042] In this embodiment, by setting up a logically identical load balancing mechanism for each data processing node in the distributed system, a relatively balanced load can be maintained among the data processing nodes without the need for a scheduling center. Therefore, the distributed system scheduling service in this embodiment is decentralized. Each node in the system is responsible for monitoring its own load. When its load is too high, it can autonomously initiate a request to migrate some data to other nodes, and each node can initiate resource scheduling without worrying about single points of failure. Even if a few nodes lose contact with other nodes due to network latency or hardware failure, the remaining nodes in the system can still continue to provide services and autonomously balance the load.
[0043] In this embodiment, distributed storage data processing is performed by any data processing node. Each data processing node can receive load-related information broadcast by other data nodes and determine its own load status based on the load-related information of all data processing nodes. When its own load status is overloaded, it determines its own data to be migrated based on its own load-related information. Based on the amount of data to be migrated and the load information of other data nodes, it determines the target node from other data nodes and migrates the data to be migrated to the target node. Therefore, in this embodiment, by distributing the scheduling tasks of the scheduling center in the prior art to each data processing node, and each data processing node determines whether its own load status is overloaded and determines the target node when overloaded, it migrates its own data to be migrated to the target node. Therefore, in this embodiment, each data processing node only needs to focus on whether its own load status is overloaded to achieve load balancing. Therefore, the distributed storage data processing method provided in this embodiment has the advantages of shorter time consumption for generating scheduling strategies and less consumption of computing resources compared with the prior art in realizing the generation of scheduling decisions and load balancing.
[0044] As an optional embodiment of this application, the method further includes: Construct a tree structure corresponding to the first data node. This tree structure is based on the location where each third data node is deployed. The tree structure includes a root node and multiple leaf nodes, where each leaf node represents a third data node. Based on the load information of each third data node, determine the load status of the first data node, including: Based on the load-related information of each third node, determine the first load value of each third data node; The first load value of each third data node is used as the first load value of the corresponding leaf node. The first load values of each leaf node in the tree structure are combined to obtain the baseline load value of each leaf node in the tree structure. The baseline load value is used as the load value of the root node. The load status of the first data node is determined based on the first load value of the first data node and the load value of the root node. If the first load value of the first data node is greater than the load value of the root node, then the load state of the first data node is overloaded.
[0045] In this embodiment, each data processing node constructs a tree structure to store load-related information for each data processing node. For the first data node, the tree structure includes at least a root node and multiple leaf nodes, with each leaf node representing a third data node; that is, each leaf node corresponds to one data processing node. The tree structure is constructed by each data processing node based on the locations of the deployed third data nodes. Figure 3 As shown, Figure 3 A tree structure diagram provided for an embodiment of this application includes a root node and multiple leaf nodes.
[0046] It should be noted that the tree structure is used to store data. Each leaf node can store load-related information about its corresponding third data node, and the root node can store statistical information about the load-related information of each leaf node. For example, the root node can store the maximum, minimum, average, and standard deviation of CPU utilization for each leaf node. For ease of explanation, the load-related information of the third data node corresponding to a leaf node will be used as the load-related information of that leaf node. Figure 3 As shown, Figure 3 The tree structure diagram provided in this application embodiment includes a root node and multiple leaf nodes. The leaf nodes are nodes 1 to 4. Each leaf node can be used to record load-related information of the corresponding third data node. The root node can be used to record statistical information of nodes 1 to 4 regarding a certain load evaluation index. For example, if the CPU utilization of node 1 is 40%, the CPU utilization of node 2 is 50%, the CPU utilization of node 3 is 30%, and the CPU utilization of node 4 is 60%, then the root node can record that the maximum CPU utilization of each node is 60%, the minimum CPU utilization is 30%, and the average CPU utilization is 45%.
[0047] In this embodiment, the load-related information of each third data node can be extracted to determine the first load value of each third data node. As an optional embodiment, the first load value of each third data node can be the sum of its load-related information. The leaf nodes of the tree structure can store the load-related information of the corresponding third data node. The first data node can read the load-related information of each third data node according to the constructed tree structure, thereby quickly determining the first load value of each third data node.
[0048] For ease of description, the first load value of each third data node is taken as the first load value of the corresponding leaf node, and the baseline load value of each leaf node is taken as the load value of the root node. The baseline load value of each leaf node can be the average of the first load values of each leaf node, or the sum of the average and standard deviation of the first load values of each leaf node. For example, the average of the first load values of each leaf node is... The standard deviation is Then the baseline load value can be or Furthermore, it can also provide or By using statistical values such as the average and standard deviation of the baseline load values of each leaf node, a baseline load value is set, which makes the baseline load value more reflective of the numerical range of the first load value of most leaf nodes.
[0049] In this embodiment, the load state of the first data node can be determined based on the first load value of the first data node and the load value of the root node. When the first load value of the first data node is greater than the load value of the root node, the load state of the first data node is determined to be overloaded. It can be understood that when the first load value of the first data node is greater than the baseline load value of each leaf node, the load intensity of the first data node is greater than the load intensity of most leaf nodes, and at this time, the first data node is in an overloaded state.
[0050] It should be noted that in this embodiment, each data processing node constructs a tree structure, which can be a data structure for recording information. Each data processing node can store load-related information of the corresponding third data node in the leaf nodes of the tree structure. After receiving load-related information broadcast by other data processing nodes, the node updates the tree structure. Furthermore, the tree structures of different data processing nodes may differ at the same time due to the different times they receive information broadcast by other data processing nodes. In addition, each data processing node can receive heartbeat messages from other data processing nodes. It should be understood that a data processing node can periodically send heartbeat messages to other data processing nodes to indicate that it is operating normally. When a data processing node does not receive a heartbeat message from a certain data processing node, it will delete the leaf node corresponding to that data processing node in the tree structure and update the tree structure.
[0051] In this embodiment, a tree structure is constructed including leaf nodes and root nodes corresponding to each third data processing node. Based on the load-related information of each third data node, the first load value of each leaf node and the load value of the root node are determined. Based on the first load value of the first data node and the load value of the root node, a scheme for determining the load status of the first data node is proposed. This allows for timely execution of load migration operations when the first data node is overloaded, thereby achieving load balancing in the distributed system.
[0052] As an optional embodiment of this application, the tree structure further includes at least one layer of intermediate nodes, the parent node of the topmost intermediate node in the at least one layer of intermediate nodes is the root node, the child node of the bottommost intermediate node includes at least one leaf node, and when the at least one layer of intermediate nodes is at least two layers of intermediate nodes, the child node of the uppermost intermediate node in the at least two layers of intermediate nodes includes at least one intermediate node of the lower layer. The method also includes: For each intermediate node, the load value of the intermediate node is determined by combining the target load values of each target leaf node; where each target leaf node includes all leaf nodes under the intermediate node. Wherein, for each of the intermediate nodes, the target load value of each target leaf node is either the first load value of the target leaf node or the second load value of the target leaf node relative to the intermediate node, wherein the second load value of each target leaf node corresponding to the intermediate node is determined based on the load-related information of each target leaf node; If the first load value of the first data node is less than or equal to the load value of the root node, the load status of the first data node is determined based on the load-related information of each third data node, including: For each level of first intermediate node, in descending order of level, if the load value of any level of first intermediate node is less than the target load value of the first data node corresponding to the first intermediate node of any level, then the load state of the first data node is determined to be overloaded; wherein, the first intermediate node of each level refers to the intermediate node of each level to which the first data node belongs.
[0053] In this embodiment, the tree structure constructed by the first data node may further include at least one level of intermediate nodes. The parent node of the uppermost intermediate node in each level is the root node, and the child nodes of the lowermost intermediate node include at least one leaf node. When there are at least two levels of intermediate nodes, the child nodes of the upper-level intermediate node include at least one intermediate node of the lower-level intermediate node. Each data processing node can set up multiple levels of intermediate nodes according to the geographical location where each third data node is deployed. These multiple levels may include regional levels, data center levels, and rack levels. Similar to the root node, the intermediate nodes in the tree structure can be used to store statistical values of load-related information of each leaf node corresponding to that intermediate node.
[0054] like Figure 4 As shown, Figure 4 This is a schematic diagram of another tree structure provided in an embodiment of this application. It includes three levels of intermediate nodes: region level, data center level, and rack level. Other intermediate nodes and leaf nodes are also included in this tree structure, but are omitted for ease of illustration. The intermediate nodes are virtual nodes used to represent the geographical location of each leaf node. For example, node 1 is a data processing node located in rack 1 of data center 1 in region 1. Each intermediate node can record statistical information on various load assessment metrics of its corresponding leaf nodes. Rack nodes can record statistical information on various load assessment metrics of nodes 1 to 4. Data center node 1 can record statistical information on various load assessment metrics of its corresponding leaf nodes. Each leaf node corresponding to data center node 1 includes the leaf nodes corresponding to each child node of data center node 1.
[0055] In this embodiment, for each intermediate node, the load value of the intermediate node can be determined based on the target load value corresponding to each leaf node under that intermediate node. For ease of description, each leaf node under that intermediate node is referred to as the target leaf node. For example, Figure 4 The target leaf nodes of the rack node 1 are nodes 1 to 4, and the target leaf nodes of the data center node 1 are the target leaf nodes of each child node of the data center node 1. Similarly, the target leaf nodes of the region node 1 are obtained.
[0056] In this embodiment, the first load value of the target leaf node can be used as the target load value of the target leaf node, or the second load value of the target leaf node corresponding to the intermediate node can be used as the target load value of the target leaf node corresponding to the intermediate node. The second load value of the target leaf node corresponding to the intermediate node is determined based on the load-related information of each target leaf node of the intermediate node. As an optional embodiment, the second load value of the target leaf node with respect to the intermediate node can be the sum of the load-related information of the target leaf node.
[0057] Similar to the method for determining the load value of the root node, the load value of the intermediate node can be determined based on the baseline target load value of the leaf node corresponding to the intermediate node. This baseline target load value can be the average value of the target load values of the target leaf node corresponding to the intermediate node, or the sum of the average value and the standard deviation.
[0058] In this embodiment of the application, when the first load value of the first data node is less than or equal to the load value of the root node, the load status of the first data node can be further determined according to the relationship between the first data node and its intermediate nodes.
[0059] In this embodiment, the intermediate nodes of each level to which the first data node belongs are designated as first intermediate nodes. Following a descending order of level, the load value of each first intermediate node is sequentially compared to the target load value of the first data node corresponding to that first intermediate node. If the load value of any first intermediate node is less than the target load value of that first data node corresponding to that first intermediate node, then the first data node is also considered overloaded. For ease of description, a first data node being overloaded at the root node is defined as having a first load value greater than the load value of the root node; and a first data node being overloaded at the first intermediate node is defined as having a load value less than the target load value of that first intermediate node corresponding to that first intermediate node.
[0060] It is important to understand that if the load status of the first data node is not overloaded after comparing it with the root node, it indicates that the load intensity of the first data node is balanced relative to the entire distributed system. To further determine whether the load intensity of the first data node is balanced relative to each level, this embodiment uses the intermediate node to which the first data node belongs as the first intermediate node, determines the load value of the first intermediate node in the tree structure, compares the target load value of the first data node corresponding to each first intermediate node with the load value of each first intermediate node, further determines the load status of the first data node in each level, and determines the load status of the first data node as overloaded when the target load of the first data node corresponding to the first intermediate node is greater than the load value of the first intermediate node. This allows for timely data migration operations. Therefore, this embodiment can not only achieve load balancing of the entire distributed system, but also achieve load balancing within the distributed system at each level.
[0061] For example, in Figure 4In this scenario, if node 1 is overloaded at the root node, it indicates that the load intensity of node 1 does not exceed the average load intensity of the entire distributed system. However, the load intensity of node 1 may exceed the average load intensity of region 1, the average load intensity of node 1 in the data center, or the average load intensity of the rack nodes. In this embodiment, if the load intensity of node 1 exceeds the load intensity of any of its constituent nodes, node 1 is considered overloaded, and a data migration operation is performed. Therefore, this embodiment can achieve load balancing for the system, regions, data centers, and racks. This embodiment adopts a hierarchical regional management structure, transforming geographical location information into a tree-like data structure, thus supporting hierarchical load balancing from large to small areas.
[0062] As an optional embodiment of this application, when the load state of the first data node is determined to be overloaded based on the first load value of the first data node and the load value of the root node, the target node is determined from each of the second data nodes, including: The intermediate node with the smallest load value among all intermediate nodes at the highest level is determined and designated as the second intermediate node at the highest level. For each level other than the highest level, determine the intermediate node with the smallest load value from the child nodes of the second intermediate node of the level above that level, and use it as the second intermediate node of that level. The lowest-level second intermediate node is used as the third intermediate node. Based on the target load value of each leaf node under the third intermediate node corresponding to the third intermediate node and the amount of data to be migrated, the target node is determined from each leaf node under the third intermediate node.
[0063] In this embodiment of the application, if the load state of the first data node is overloaded, it is determined by comparing the first load value of the first data node with the load value of the root node. That is, if the first data node is overloaded at the root node, the method for determining the target node is as follows: For each intermediate node in the tree structure, the second intermediate node in each level can be determined sequentially from high to low level. The second intermediate node of the highest level is the intermediate node with the smallest load value among all intermediate nodes in that highest level, and the second intermediate node of non-highest level is the intermediate node with the smallest load value among the child nodes of the second intermediate node of the level above the highest level.
[0064] In this embodiment, the second intermediate node in the lowest level is designated as the third intermediate node, and the child nodes of the third intermediate node are designated as leaf nodes. The target node is determined from the child nodes of the third intermediate node. Specifically, the target node can be determined from the leaf nodes under the third intermediate node based on the target load value of the third intermediate node and the amount of data to be migrated.
[0065] like Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the determination of a target node according to an embodiment of this application. Node 1 is a first data node. If the first load value of node 1 exceeds the load value of the root node, then node 1 is overloaded, specifically at the root node. The intermediate node with the smallest load value among the root node's child nodes is then determined; let's assume it's region node 1. Region node 1 is then the second intermediate node at the highest level. Next, the second intermediate node at the data center level is determined from the child nodes of region node 1. The intermediate node with the smallest load value among the child nodes of region node 1 is then taken as the second intermediate node at the data center level; let's assume it's data center node 1. Similarly, the second intermediate node at the rack level is determined; let's assume it's rack node 1. Rack node 1 is then the third intermediate node. The target node is determined from the leaf nodes of the third intermediate node; let's assume it's node 4 in the diagram.
[0066] In this embodiment, the load value of the intermediate node is used to measure the load of each leaf node under the intermediate node. Therefore, by searching the intermediate node with the smallest load value in each level, the leaf node with low load intensity can be found, and the data to be migrated can be migrated to the leaf node to achieve load balancing.
[0067] As an optional embodiment of this application, when the first load value of the first data node is less than or equal to the load value of the root node, and the state of the first data node is overloaded, the target node is determined from each of the second data nodes, including: The intermediate node with the smallest load value is determined from the child nodes of the first intermediate node of any level in the target level, and is used as the fourth intermediate node of the target level. The target level is the next level after the arbitrary level. For each level under the target level, determine the intermediate node with the smallest load value from the child nodes of the fourth intermediate node of the level above that level, and use it as the fourth intermediate node of that level. The lowest-level fourth intermediate node is taken as the fifth intermediate node. Based on the target load value of each leaf node under the fifth intermediate node corresponding to the fifth intermediate node, and the amount of data to be migrated, the target node is determined from each leaf node under the fifth intermediate node.
[0068] In this embodiment, when the load state of the first data node is overloaded, and the load state of the first data node is not determined to be overloaded at the root node, it indicates that the first data node is overloaded at the first intermediate node. It should be noted that since the load value of the first intermediate node is determined to be greater than the target load value corresponding to that first intermediate node in descending order, any level where the first intermediate node is located is the highest level among all levels where the load value of the first intermediate node is greater than the target load value corresponding to that first intermediate node.
[0069] In this embodiment of the application, the next level of the arbitrary level is taken as the target level, and the fourth intermediate node of the target level is the intermediate node with the smallest load value among the child nodes of the first intermediate node of the arbitrary level. That is, in order from high to low, the intermediate node with the smallest load value among the child nodes of the first intermediate node whose load value is greater than the target load value of the first node corresponding to the first intermediate node is determined.
[0070] For each level under the target level, the fourth intermediate node of that level is the intermediate node with the smallest load value among the respective nodes of the fourth intermediate node of the previous level.
[0071] The lowest-level fourth intermediate node is designated as the fifth intermediate node, and the child nodes of the fifth intermediate node are the leaf nodes. Based on the target load value of the fifth intermediate node and the amount of data to be migrated corresponding to each leaf node under the fifth intermediate node, the target node is determined from each leaf node under the fifth intermediate node.
[0072] like Figure 6 As shown, Figure 6 This is a schematic diagram illustrating another method for determining a target node according to an embodiment of this application. Node 1 is a first data node. The first load value of node 1 is less than or equal to the load value of the root node, meaning node 1 is not overloaded at the root node. However, the target load value of node 1 corresponding to region node 1 is greater than the load value of region node 1, so node 1 is overloaded. In this case, when determining the target node, the search is only performed on the leaf nodes corresponding to region node 1, not on the leaf nodes corresponding to region node 2. The target level is the data center level. A fourth intermediate node is determined from the data center nodes under the region node, assumed to be data center node 1. Then, a fourth intermediate node at the rack level is determined from the rack nodes of data center node 1, assumed to be rack node 1. Rack node 1 is also the fifth intermediate node. The target node is determined from the leaf nodes of rack node 1, assumed to be node 4.
[0073] As can be seen from the above steps, when the first data node is overloaded at the first intermediate node, the target node is selected from the leaf nodes under that first intermediate node. In other words, in this embodiment, when the first data node is overloaded at a certain level of the first intermediate node, a target node is selected from under that first intermediate node according to the search rules, serving as the node for the data to be migrated, instead of selecting a target node from the leaf nodes that do not correspond to the first intermediate node. This is used to achieve load balancing within the level represented by the first intermediate node. Furthermore, when determining the target node, the second intermediate node with the smallest load value in each level is determined sequentially, and finally, the target node is determined from the second intermediate node with the smallest load value in the lowest level. Searching for leaf nodes with low load intensity is highly efficient.
[0074] As an optional embodiment of this application, at least one load assessment metric includes at least two load assessment metric values; Based on the load information of each third node, determine the first load value of each third data node, including: Obtain the weights corresponding to each load assessment metric from at least two load assessment metrics; For each third data node, the weights corresponding to each load assessment index are used to perform a weighted summation of the index values of each load assessment index of the third data node to obtain the comprehensive index value of the third data node. This comprehensive index value is used as the first load value of the third data node.
[0075] In this embodiment, the load assessment metric can be at least two of CPU utilization, memory availability, storage availability, request frequency, and the amount of stored data. Each load assessment metric can be weighted according to its impact on the load of the data processing node. When determining the first load value of each third data node, the weights corresponding to the load assessment metrics are obtained, and the metric values of the load assessment metrics of the third data node are weighted and summed using these weights. This summation is then used as the comprehensive metric value of the third data node, which is the first load value of the third data node.
[0076] The first load value of the third data node is also the first load value of the corresponding leaf node in the tree structure, and the baseline load value of the leaf node is used as the load value of the root node. As an optional embodiment, the comprehensive index value of the third data node can be processed to obtain the average and standard deviation of the comprehensive index values of each third data node, and the average and standard deviation of the comprehensive index values can be used as the load value of the root node.
[0077] In this embodiment of the application, based on the influence of load assessment indicators on the load of data processing nodes, different weights are assigned to each load assessment indicator, and the load assessment indicators are weighted and summed, so that the first load value determined in this embodiment of the application can more accurately measure the load of a data processing node in this system.
[0078] As an optional embodiment of this application, the data processing method based on distributed storage in this application embodiment further includes: For each load assessment metric, the maximum and minimum values of the load assessment metric are determined based on the metric values of each third data node. For each load assessment metric, the metric values of the load assessment metric for each third data node are normalized according to the maximum and minimum values of the load assessment metric to obtain the normalized metric values. For each third data node, the weights corresponding to each load assessment metric are used to perform a weighted summation of the metric values of the third data node, resulting in a comprehensive metric value for the third data node, including: By using the weights corresponding to each load assessment index, the normalized index values of each load assessment index of the third data node are weighted and summed to obtain the comprehensive index value of the third data node.
[0079] In this embodiment of the application, in the tree structure constructed by the first data node, the root node can be used to record the statistical information of each leaf node regarding the index value of each load evaluation index, including statistical information such as maximum value, minimum value, average value and standard deviation.
[0080] For each load assessment metric, the maximum and minimum values of the metric can be obtained directly from each leaf node, or the maximum and minimum values of the metric can be obtained from each third data node in the root node of the tree structure.
[0081] For each load assessment metric, based on its maximum and minimum values across all third data nodes, the metric value for each third data node can be normalized to obtain a normalized metric value. The normalization method can be expressed as follows:
[0082] in, For any load assessment metric, This represents the minimum value of the load assessment metric across all third-party data nodes. This represents the maximum value of the load assessment metric across all third data nodes.
[0083] For each third data node, when determining the comprehensive index value of the third data node, the weights corresponding to each load assessment index can be used to perform a weighted sum of the normalized index values of each load assessment index of the third data node to obtain the comprehensive index value of the third data node.
[0084] In this embodiment, when determining the comprehensive index value of the third data node, the index values of each load assessment index are first normalized. This normalization scales the value range of each load assessment index to the same interval, which helps to eliminate the influence of different dimensions of the load assessment indexes. Simultaneously, by combining the weights of each load assessment index, the comprehensive index value of the third data node is determined, enabling a more accurate measurement of the load status of the data processing node in the distributed system.
[0085] As an optional embodiment of this application, for each intermediate node, the second load value of each target leaf node corresponding to the intermediate node is determined in the following way: For each load assessment metric, the maximum and minimum values of the load assessment metric for each target leaf node are determined based on the metric values of the load assessment metric for each target leaf node. For each load assessment index, the index value of the load assessment index of each target leaf node is normalized according to the maximum and minimum values of the load assessment index of each target leaf node, so as to obtain the normalized index value of each target leaf node with respect to the intermediate node. Using the weights corresponding to each load assessment index, the normalized index values of each load assessment index corresponding to each target leaf node and the intermediate node are weighted and summed to obtain the comprehensive index value of each target leaf node corresponding to the intermediate node. The comprehensive index value of each target leaf node corresponding to the intermediate node is used as the second load value of each target leaf node corresponding to the intermediate node.
[0086] In this embodiment, for ease of description, each leaf node under an intermediate node is referred to as a target leaf node. In the tree structure constructed by the first data node, the intermediate node can record statistical information of each target leaf node regarding various load evaluation indicators, including minimum value, maximum value, average value, and standard deviation.
[0087] For each target leaf node, the weighted sum of the values of each evaluation index of the target leaf node can be obtained to obtain the comprehensive index value of the target leaf node corresponding to the intermediate node, and the comprehensive index value of the target leaf node corresponding to the intermediate node can be used as the second load value of the target leaf node corresponding to the intermediate node.
[0088] Furthermore, based on the maximum and minimum values of the load assessment metrics for each target leaf node, the load assessment metric values for each target leaf node with respect to each intermediate node can be normalized to obtain the normalized load assessment metric values for each target leaf node with respect to that intermediate node. Then, according to the weights of each load assessment metric, the normalized load assessment metric values for each target leaf node corresponding to the intermediate node are weighted and summed to obtain the comprehensive metric value for each target leaf node corresponding to the intermediate node.
[0089] It is important to understand that for the same leaf node, when the corresponding intermediate nodes are different, the maximum and minimum values of each load assessment metric for the leaf nodes corresponding to different intermediate nodes may be different. Therefore, the comprehensive metric value of the leaf node corresponding to each intermediate node will also be different. The comprehensive metric value of the leaf node corresponding to the intermediate node obtained in the embodiments of this application can measure the load of the leaf node among the leaf nodes corresponding to the intermediate nodes, thereby reflecting the load of the leaf node in the geographical hierarchy represented by the intermediate node.
[0090] Finally, the comprehensive index value of each target leaf node corresponding to the intermediate node is used as the second load value of each target leaf node corresponding to the intermediate node.
[0091] In this embodiment, when determining the comprehensive index value of a leaf node corresponding to a certain intermediate node to which the leaf node belongs, the index values of each load assessment index of the leaf node are first normalized based on the maximum and minimum values of the index values of each target leaf node of the intermediate node with respect to the load assessment index. This normalizes the value range of each load assessment index to the same interval, which helps to eliminate the influence of different dimensions of load assessment indices. At the same time, by combining the weights of each load assessment index, the comprehensive index value of the leaf node with respect to the intermediate node is determined, which can more accurately measure the load of the data processing node in the geographical hierarchy represented by the third node.
[0092] As an optional embodiment of this application, the data stored in each data processing node includes a copy of at least one data shard among a plurality of data shards, wherein the copy of at least one data shard among the plurality of data shards is stored in at least two data processing nodes, wherein the data to be migrated includes at least one copy to be migrated; The second intermediate node at the highest level is the intermediate node with the smallest load value among all intermediate nodes in the highest level and the number of replicas to be migrated stored is less than the first threshold. For each level other than the highest level, the second intermediate node of that level is the intermediate node with the smallest load value among the child nodes of the second intermediate node of the level above that level, and the number of replicas stored is less than the first threshold. The fourth intermediate node of the target level is the intermediate node with the smallest load value among the child nodes of the first intermediate node of any level, and the number of replicas to be migrated stored is less than the first threshold. For each level under the target level, the fourth intermediate node of that level is the intermediate node with the smallest load value among the child nodes of the fourth intermediate node of the level above that level, and the number of replicas stored is less than the first threshold. The first threshold of the highest-level intermediate node is determined based on the total number of replicas to be migrated in the system and the number of intermediate nodes in the highest level; the first threshold of the intermediate node in each level below the highest level is determined based on the first threshold of the parent node of the intermediate node in the previous level and the number of child nodes of the parent node.
[0093] In this embodiment, each data processing node is used to store a copy of the data shard. It should be understood that in a distributed system, large amounts of data can be divided into multiple data shards. Data storage sharding technology can be used to split the data that the service needs to store into shards of appropriate size. The data size of a shard can be 250MB, and a corresponding copy is generated for each data shard. The copy is stored in the data node, and all copies of the same shard maintain data consistency through a consensus algorithm.
[0094] As an optional implementation, multiple backups of the same data shards and related services are created to avoid service interruptions due to regional failures. A replica of a data shard may have the following characteristics: A single data shard has at most one replica on a data processing node. If the data processing nodes are distributed across different geographical locations (countries, regions, provinces, cities, server deployment zones, etc.), the replicas of the same shard should be distributed as evenly as possible across these locations. For example, if the data processing nodes are deployed in three different zones and the data shard has six replicas, then the same shard will have at most two replicas in one zone, which will be scheduled to two different data processing nodes within that zone.
[0095] It is important to understand that as the distributed system continues to operate and provide services to users, the amount of data on each data processing node regarding the replicas of each data shard changes, leading to uneven load distribution on the data nodes. Therefore, it is necessary to adjust the number of replicas on each data processing node to balance the load across them. This application embodiment can ensure that even when hardware resources are not evenly distributed across different regions, the resource utilization ratio between regions is comparable, and the resource load is balanced within each region. Therefore, even if the distribution of replicas of data shards is uneven, the method provided in this application embodiment can ensure that the replicas of data shards are evenly distributed across the data processing nodes.
[0096] In this embodiment of the application, the total number of copies stored in each leaf node under the intermediate node is taken as the number of copies stored in the intermediate node.
[0097] Therefore, in this embodiment, for each replica, each intermediate node has a first threshold for the number of replicas it stores. For each intermediate node in the highest level, the first threshold is determined based on the total number of replicas in the distributed system and the number of intermediate nodes in the highest level. As an optional embodiment, the first threshold for the intermediate node can be the result of dividing the total number of replicas in the distributed system by the number of intermediate nodes in the highest level and rounding up.
[0098] For intermediate nodes that are not at the highest level, the first threshold for that intermediate node with respect to the replica is determined based on the first threshold of its parent node and the number of its child nodes, i.e., based on the first threshold of its parent node and the number of its sibling nodes. As an optional embodiment, the first threshold of the intermediate node can be obtained by dividing the first threshold of its parent node with respect to the replica by the number of its child nodes and then rounding up.
[0099] like Figure 7 As shown, Figure 7This is a tree structure diagram provided in an embodiment of this application. The value in parentheses after each node represents the first threshold corresponding to that node. For replica A, the distributed system stores 6 copies of replica A. Therefore, the number of replicas A stored by the root node is 6. Since there are two regional nodes, the maximum number of replicas A that each regional node can store is set to 3. Since the maximum number of replicas A that regional node 1 can store is 3, and regional node 1 has 3 data center nodes, the maximum number of replicas A that data center nodes 1, 2, and 3 can store is set to 1. Since the maximum number of replicas A that regional node 2 can store is 3, and it has two data center nodes, the maximum number of replicas A that data center nodes 4 and 5 can store is 2, which is 3 divided by 2 and then rounded up.
[0100] In this embodiment, when the first data node is overloaded at the root node, it is necessary to determine the second intermediate nodes at each level. When determining the second intermediate node at the highest level, it is required that the second intermediate node has the lowest load value among all intermediate nodes at the highest level, and that the number of replicas to be migrated stored in the second intermediate node is less than a first threshold. It should be understood that determining the second intermediate node at the highest level is used to identify the target node among the leaf nodes under the second intermediate node at the highest level. Considering load balancing and disaster recovery for the number of replicas at different geographical levels, when determining the second intermediate node at the highest level, an intermediate node whose number of replicas to be migrated does not reach the first threshold is selected.
[0101] In this embodiment, after determining the second intermediate node at the highest level, the second intermediate node in the next level below the highest level is determined from among the child nodes of the second intermediate node at the highest level. The intermediate node with the smallest load value among the child nodes of the second intermediate node at the highest level and the number of copies to be migrated stored is less than a first threshold is taken as the second intermediate node of the next level below the highest level. This process is repeated to obtain the second intermediate nodes of each level. That is, for each level other than the highest level, the second intermediate node of that level is the intermediate node with the smallest load value among the child nodes of the second intermediate node of the level above that level and the number of copies to be migrated stored is less than a first threshold.
[0102] In this embodiment, if the first data node is overloaded at a certain first intermediate node, it is necessary to determine the target level and the fourth intermediate nodes of each level under the target level. First, the fourth intermediate node of the target level is selected only from the child nodes under the first intermediate node. When selecting, it is required that the fourth intermediate node is not only the child node with the smallest load value of the first intermediate node, but also that the fourth intermediate node is an intermediate node whose number of copies to be migrated is less than a first threshold among the child nodes of the first intermediate node.
[0103] After determining the fourth intermediate node of the target level, the fourth intermediate nodes of each level under the target level are determined in descending order of level. The fourth intermediate node of each level under the target level is the intermediate node with the smallest load value among the child nodes of the fourth intermediate node of the previous level and the number of copies of the target node stored is less than the first threshold.
[0104] In this embodiment, when determining the second intermediate node at the highest level and the second intermediate nodes at each level below the highest level, as well as the fourth intermediate node at the target level and the fourth intermediate nodes at each level below the target level, not only the load value of each intermediate node is considered, but also the number of replicas to be migrated stored in each intermediate node. Therefore, not only is load balancing achieved across all data processing nodes, but also, when a data processing node fails, replicas can be obtained from other data processing nodes, thus achieving disaster recovery. Therefore, this embodiment supports multi-site disaster recovery backup for services and storage. When less than half of the nodes fail, the service will not be significantly affected, and load balancing scheduling will not break the rules of multi-site backup. By backing up the same data and related services in multiple locations, service interruptions caused by regional failures can be avoided.
[0105] As an optional embodiment of this application, the target node is determined from each of the second data nodes based on the data volume of the replica to be migrated and the load-related information of each second data node, including: Based on the load values from smallest to largest, the first second data node that does not store the replica to be migrated and whose estimated load state is not overloaded is determined as the target node. The estimated load state of any second data node is the load state of the second data node when the replica to be migrated is migrated to the second data node.
[0106] In this embodiment of the application, when the load state of the first data node is overloaded, the first second data node that does not store the copy to be migrated and whose estimated load state is not overloaded can be selected from the second data nodes in ascending order of the first load value as the target node.
[0107] The estimated load status of the second data node refers to its load status if the replica to be migrated is moved to this data node. The estimated load status of the second data node can be determined based on the estimated load information of each third data node and the data volume of the replica to be migrated. The estimated load information of each third data node can be the load information of each third data node if the first data node migrates the replica to be migrated to this second data node.
[0108] As an optional embodiment, when the first data node is overloaded at the root node, the target node is determined from the target leaf nodes of the third intermediate node. The first target leaf node that does not store any replicas to be migrated and whose estimated load state is not overloaded can be determined as the target node, in ascending order of the target load value corresponding to the third intermediate node.
[0109] As an optional embodiment, when the first data node is overloaded at a certain first intermediate node, the target node is determined from the target leaf nodes of the fifth intermediate node. The first target leaf node that does not store any replicas to be migrated and whose estimated load state is overloaded can be determined as the target node, in ascending order of the target load value corresponding to the fifth intermediate node.
[0110] like Figure 8 As shown, Figure 8 This is a schematic diagram illustrating another method for determining a target node according to an embodiment of this application. The value in parentheses after each node indicates the number of replicas to be migrated stored in that node. Node 1 is the first data node, and rack node 1 is either the third or fifth intermediate node. If there are no intermediate nodes in the tree structure, rack node 1 can also represent the root node. For each of the second data nodes 2 to 4, node 2 stores one replica to be migrated, while nodes 3 and 4 do not store any replicas to be migrated. Furthermore, the target load value of node 4 corresponding to rack node 1 is less than the target load value of node 3 corresponding to rack node 1; therefore, node 4 is designated as the target node.
[0111] If no target node meets the conditions among the leaf nodes under the third or fifth intermediate node, the lowest-level third or fifth intermediate node is re-determined. This re-determination is achieved by selecting the intermediate node with the smallest load value and a number of stored replicas to be migrated that is less than a first threshold from the child nodes of the second intermediate node at the next higher level. It can be seen that the process of determining the target node in this embodiment follows the principle of depth-first search. If no target node exists, the data migration operation ends. Depth-First Search (DFS) is an algorithm used to traverse or search a tree or graph. In DFS, starting from the root node, nodes are traversed along the depth of the tree, searching the branches as deeply as possible. When a leaf node is reached, the algorithm backtracks and explores other branches. In this embodiment, the target node is determined from the leaf nodes under other intermediate nodes based on the load value of the intermediate node and the number of stored replicas to be migrated.
[0112] Specifically, such as Figure 9 As shown, Figure 9This is a schematic diagram illustrating another method for determining a target node according to an embodiment of this application. Node 1 is the first data node. Node 1 is overloaded at region node 1. Rack node 1 is the determined fifth intermediate node. However, no target node meeting the conditions is found among nodes 2 to 4. Therefore, from the other child nodes of data center node 1, the rack node with the lowest load and storing fewer than a first threshold number of replicas to be migrated is determined as the new fifth intermediate node, assuming it is rack node 2. The target node is then determined from the leaf nodes of rack node 2. If none of the leaf nodes of any child node of data center node 1 meet the conditions, a new second intermediate node is determined from the other data center nodes of region node 1, assuming it is data center node 2. A new fifth intermediate node is determined from the child nodes of data center node 2, and the target node is determined from the new fifth intermediate node. If none of the leaf nodes of any data center node under region node 1 contain a target node, the current data migration ends, and the replicas to be migrated are not migrated.
[0113] In this embodiment, when determining the target node, the target node with the lowest load value, no stored replicas to be migrated, and an estimated load state that is not overloaded is selected from the various second data nodes. This reduces the load on the first data node while ensuring load balance across the entire system. Furthermore, the fact that the target node does not store replicas to be migrated makes the storage of these replicas more balanced, thus achieving disaster recovery and backup of data in the distributed system.
[0114] As an optional embodiment of this application, determining the data to be migrated from the first data node based on the load-related information of the first data node includes: The replicas of the first data node that meet the first condition are designated as replicas to be migrated. The first condition includes at least one of the following: The replica with the fewest accesses among all replicas of the first data node; The replica of the first data node that minimizes the difference between the estimated load value of the first data node and the estimated load value of the target node; wherein, the estimated load value of any data processing node is the first load value of the data processing node when assuming that the replica to be migrated is migrated to the data processing node. A replica in the first data node that is different from the replica in the target node.
[0115] In this embodiment, the replica to be migrated can be determined according to actual needs. The replica with the fewest accesses among all replicas in the first data node can be selected as the replica to be migrated, thus reducing the load on the first data node without affecting its ability to execute received data processing requests. Furthermore, load assessment metrics related to load information can include the access volume of each replica.
[0116] The replica of the first data node whose estimated load value is minimized compared to the estimated load value of the target node can be selected as the replica to be migrated. This is used to achieve load balancing between the first data node and the target node.
[0117] A replica in a first data node that is different from the target node can be used as a replica to be migrated to achieve disaster recovery backup of the system. This prevents the problem of not being able to access the replica when all replicas are stored on the same data processing node and the data processing node fails.
[0118] As an optional embodiment of this application, migrating the data to be migrated to the target node includes: Send a migration request to the target node, which includes the amount of data to be migrated; Upon receiving the first information from the target node, the data to be migrated will be migrated to the target node; The first information is used to indicate that the target node agrees to receive the data to be migrated. The first information is sent by the target node when it determines that the estimated load state is not overloaded based on the amount of data to be migrated.
[0119] In this embodiment, after the first data node determines the target node, it can send a migration request to the target node. Upon receiving the migration request, the target node determines whether its own load status is overloaded if it receives the data to be migrated, based on the amount of data to be migrated carried in the migration request. As an optional embodiment, the target node can determine whether its estimated load status is overloaded based on the load-related information of each third data node it has obtained.
[0120] When the target node determines that its estimated load status is not overloaded, it sends the first information to the first data node. After receiving the first information, the first data node migrates the data to be migrated to the target node.
[0121] It is important to understand that different data processing nodes may receive load-related information from other data processing nodes at different times, and the order in which they process the data may also differ. Therefore, after the first data node determines that the target node's estimated load status is not overloaded, the target node needs to combine its own information to reconfirm that its own estimated load status is not overloaded before it can receive the data to be migrated from the first data node. This effectively ensures the load balancing of the distributed system.
[0122] When the target node determines that its estimated load is overloaded, it sends a second message to the first data node, indicating that the target node refuses to receive the data to be migrated. Upon receiving the second message, the first data node needs to re-determine the target node. This can be done using a depth-first search, selecting the target node from the corresponding leaf nodes of other untraversed intermediate nodes.
[0123] like Figure 10 As shown, Figure 10 The flowchart of another data processing method based on distributed storage provided in this application embodiment is executed by the first data node and includes the following steps: S1001, Receive the respective load-related information broadcast by each second data node; S1002. Update the pre-built tree structure according to the load-related information of each third data node; S1003. Based on the load-related information of each third data node, determine the first load value of each third data node and the load value of the root node. S1004. For each intermediate node, the load value of the intermediate node is determined by combining the target load values of each target leaf node. S1005. Determine the load status of the first data node based on the first load value of the first data node and the load value of the root node. S1006. If the first load value of the first data node is greater than the load value of the root node, then the load state of the first data node is overloaded, and steps S1007-S1008 are executed; if the first load value of the first data node is less than or equal to the load value of the root node, step S1009 is executed. S1007. Determine the second intermediate node of the highest level and each level under the highest level, and take the second intermediate node of the lowest level as the third intermediate node; S1008. Determine the target node from each leaf node of the third intermediate node and execute S1013. S1009. In descending order of hierarchy, determine whether there is a first intermediate node whose load value is greater than the target load value of the first data node corresponding to the intermediate node; if there is a first intermediate node whose load value is greater than the target load value of the first data node corresponding to the intermediate node, then execute S1010-S1013. S1010. Determine the first intermediate node whose load value is greater than the target load value of the first data node, and take the next level of the first intermediate node as the target level. S1011. Determine the target level and the fourth intermediate node of each level under the target level, and take the fourth intermediate node of the lowest level as the fifth intermediate node. S1012. Determine the target node from each leaf node of the fifth intermediate node; S1013. Migrate the copy to be migrated to the target node.
[0124] Any data processing node in the embodiments of this application may include a data collection module, a node self-test module, and a scheduling module.
[0125] The data collection module includes a broadcast submodule and a receiving and processing submodule.
[0126] The broadcast submodule collects its own load assessment metrics, such as CPU utilization, memory usage, storage capacity, request frequency, and number of replicas. Metrics like CPU utilization, memory usage, and request frequency use moving averages. At fixed intervals, the broadcast submodule uses the Gossip protocol to broadcast its own load metrics and its geographical location to other nodes in the system.
[0127] The receiving and organizing submodule continuously receives information broadcast by other nodes and organizes it into a tree structure according to the geographical location information of each node. When a newly received node information is inserted into this tree structure, the statistical information of each intermediate node on its storage path is updated synchronously.
[0128] When a node detects that other nodes are not alive through the node heartbeat in the Gossip protocol, that is, when the node encounters problems such as network unreachability, abnormal status, or crash, it will remove these nodes from the tree structure and update the statistics of all intermediate nodes on the leaf node path from the root node to the node.
[0129] The node self-checking module uses information from the tree structure built by the data collection module to determine whether some data needs to be migrated from itself to other nodes. If migration is required, a suitable target node is selected for each copy to be migrated.
[0130] The scheduling module is responsible for actually executing the migration of replicas. During the migration process, it uses a consensus algorithm to ensure that all replicas in the same shard have consistent data, and at the same time, it does not block any CRUD requests on the shard to which the migrated replica belongs.
[0131] In the distributed system described in this application, each node has a logically identical load balancing mechanism. Each node only needs to ensure that its load does not exceed a threshold by migrating out replicas, and before accepting replicas migrated in from other nodes, it determines whether to accept the migration request by estimating the impact of this operation on its own load. The entire scheduling system does not require a scheduling center, while still maintaining a relatively balanced load among the nodes in the system.
[0132] This application provides a data processing device based on distributed storage, applied to a first data node in a distributed system. The distributed system includes multiple data processing nodes, and the first data node can be any data processing node in the distributed system, such as... Figure 11 As shown, the device may include: a receiving module 1101, a determining module 1102, and a migrating module 1103, wherein, The receiving module 1101 is used to receive the respective load-related information broadcast by each second data node, wherein each second data node is a data processing node other than the first data node among multiple data processing nodes, and the load-related information includes the index value of at least one load evaluation index, the at least one load evaluation index includes a storage index, and the index value of the storage index is the amount of data stored. The determination module 1102 is used to determine the load status of the first data node based on the load-related information of each third data node; each third data node includes the first data node and each second data node. Migration module 1103 is used to perform data migration operations when the load state is overloaded; the data migration operations include: Based on the load-related information of the first data node, determine the data to be migrated from the first data node; Based on the amount of data to be migrated and the load information of each second data node, the target node is determined from each second data node, and the data to be migrated is migrated to the target node.
[0133] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0134] This application provides an electronic device including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of a data processing method based on distributed storage. Compared with related technologies, this method achieves the following: the distributed storage data processing in this application is performed by any data processing node. Each data processing node can receive load-related information broadcast by other data nodes and determine its own load status based on the load-related information of all data processing nodes. When its own load status is overloaded, it determines its own data to be migrated based on its own load-related information and the amount of data to be migrated and the load information of other data nodes. The data processing method of distributed storage in this application determines the target node from other data nodes and then migrates the data to be migrated to the target node. Therefore, in this embodiment, by distributing the scheduling tasks of the scheduling center in the prior art to each data processing node, each data processing node determines whether its own load status is overloaded, and determines the target node when overloaded, and migrates its own data to be migrated to the target node. Therefore, each data processing node in this embodiment only needs to focus on whether its own load status is overloaded to achieve load balancing. Therefore, the distributed storage data processing method provided in this embodiment has the advantages of short time consumption and low computational resource consumption in generating scheduling decisions and load balancing compared with the prior art.
[0135] In one alternative embodiment, an electronic device is provided, such as Figure 12 As shown, Figure 12 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.
[0136] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0137] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0138] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0139] The memory 4003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 4001. The processor 4001 executes the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0140] The electronic device package may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0141] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments. Compared with existing technologies, the following can be achieved: In the distributed storage data processing of this application embodiment, the data processing is executed by any data processing node. Each data processing node can receive load-related information broadcast by other data nodes and determine its own load status based on the load-related information of all data processing nodes. When its own load status is overloaded, it determines its own data to be migrated based on its own load-related information. Based on the amount of data to be migrated and the load information of other data nodes, it determines the target node from other data nodes and migrates the data to be migrated to the target node. Therefore, in this application embodiment, by distributing the scheduling tasks of the scheduling center in the prior art to each data processing node, each data processing node determines whether its own load status is overloaded and determines the target node when overloaded, and migrates its own data to be migrated to the target node. Therefore, in this application embodiment, each data processing node only needs to focus on whether its own load status is overloaded to achieve load balancing. Therefore, the distributed storage data processing method provided in this application embodiment has the advantages of shorter time consumption for generating scheduling strategies and less consumption of computing resources compared with the prior art in realizing the generation of scheduling decisions and load balancing.
[0142] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium, a computer-readable medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0143] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments. Compared with existing technologies, the following can be achieved: In the distributed storage data processing of this application embodiment, the data processing is executed by any data processing node. Each data processing node can receive load-related information broadcast by other data nodes and determine its own load status based on the load-related information of all data processing nodes. When its own load status is overloaded, it determines its own data to be migrated based on its own load-related information. Based on the amount of data to be migrated and the load information of other data nodes, it determines the target node from other data nodes and migrates the data to be migrated to the target node. Therefore, in this application embodiment, by distributing the scheduling tasks of the scheduling center in the prior art to each data processing node, each data processing node determines whether its own load status is overloaded and determines the target node when overloaded, and migrates its own data to be migrated to the target node. Therefore, in this application embodiment, each data processing node only needs to focus on whether its own load status is overloaded to achieve load balancing. Therefore, the distributed storage data processing method provided in this application embodiment has the advantages of shorter time consumption for generating scheduling strategies and less consumption of computing resources compared with the prior art in realizing the generation of scheduling decisions and load balancing.
[0144] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the illustrations or text descriptions.
[0145] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0146] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A data processing method based on distributed storage, characterized by, The method is applied to a distributed system comprising a plurality of data processing nodes, and is executed by a first data node which is any data processing node in the distributed system, and comprises: receiving respective load-related information broadcast by respective second data nodes, wherein the respective second data nodes are data processing nodes other than the first data node in the plurality of data processing nodes, and the load-related information comprises an index value of at least one load evaluation index, and the at least one load evaluation index comprises a storage index, and the index value of the storage index is an amount of stored data; determining a load state of the first data node according to load-related information of respective third data nodes, wherein the respective third data nodes comprise the first data node and the respective second data nodes; when the load state is overload, performing a data migration operation, wherein the data migration operation comprises: determining to-be-migrated data of the first data node according to the load-related information of the first data node; determining a target node from the respective second data nodes according to an amount of the to-be-migrated data and the load-related information of the respective second data nodes, and migrating the to-be-migrated data to the target node.
2. The method of claim 1, wherein, The method further comprises: constructing a tree structure corresponding to the first data node, wherein the tree structure is constructed based on positions at which the respective third data nodes are deployed, and the tree structure comprises a root node and a plurality of leaf nodes, and each leaf node represents a third data node; the determining of the load state of the first data node according to the load-related information of the respective third data nodes comprises: determining first load values of the respective third data nodes according to the load-related information of the respective third data nodes; comprehending the first load values of the respective leaf nodes to obtain reference load values of the respective leaf nodes in the tree structure, and taking the reference load values as a load value of the root node; determining the load state of the first data node according to a first load value of the first data node and the load value of the root node; and wherein if the first load value of the first data node is greater than the load value of the root node, the load state of the first data node is overload.
3. The method of claim 2, wherein, The tree structure further comprises at least one layer of intermediate nodes, a parent node of an uppermost intermediate node in the at least one layer of intermediate nodes is the root node, child nodes of a lowermost intermediate node comprise at least one leaf node, and in a case where the at least one layer of intermediate nodes is at least two layers of intermediate nodes, child nodes of an upper intermediate node in the at least two layers of intermediate nodes comprise at least one intermediate node in a lower layer; the method further comprises: for each intermediate node, comprehending target load values of respective target leaf nodes to determine a load value of the intermediate node, wherein the respective target leaf nodes comprise respective leaf nodes under the intermediate node. The target load value of each target leaf node corresponding to the intermediate node is a first load value of the target leaf node, or a second load value of the target leaf node corresponding to the intermediate node, wherein the second load value of each target leaf node corresponding to the intermediate node is determined according to load-related information of each target leaf node. If the first load value of the first data node is less than or equal to the load value of the root node, the determining of the load state of the first data node according to the load-related information of each third data node further comprises: For each first intermediate node of each level, in a descending order of the levels, if the load value of any first intermediate node of a level is less than a target load value of the first data node corresponding to the first intermediate node of the first data node corresponding to the any first intermediate node of the level, it is determined that the load state of the first data node is overloaded, wherein the first intermediate nodes of each level are the intermediate nodes of each level to which the first data node belongs.
4. The method of claim 3, wherein, In a case where the load state of the first data node is determined to be overloaded according to the first load value of the first data node and the load value of the root node, the determining of the target node from each second data node comprises: determining a first intermediate node with the minimum load value among the intermediate nodes of the highest level as a second intermediate node of the highest level; for each level in the non-highest level, determining a first intermediate node with the minimum load value from the child nodes of the second intermediate node of the previous level of the level as a second intermediate node of the level; determining a target node from each leaf node under the third intermediate node according to the target load value of each leaf node corresponding to the third intermediate node and the data volume of the data to be migrated, with the second intermediate node of the lowest level as the third intermediate node.
5. The method of claim 3, wherein, In a case where the first load value of the first data node is less than or equal to the load value of the root node and the state of the first data node is overloaded, the determining of the target node from each second data node comprises: determining a fourth intermediate node with the minimum load value from the child nodes of the first intermediate node of the target level as a fourth intermediate node of the target level, the target level being the next level of the any level; for each level under the target level, determining a fourth intermediate node with the minimum load value from the child nodes of the fourth intermediate node of the previous level of the level as a fourth intermediate node of the level; determining a target node from each leaf node under the fifth intermediate node according to the target load value of each leaf node corresponding to the fifth intermediate node and the data volume of the data to be migrated, with the fourth intermediate node of the lowest level as the fifth intermediate node.
6. The method according to claim 2 or 3, characterized in that, The at least one load evaluation index comprises at least two load evaluation index values. The determining the first load value of each third data node according to the load-related information of each third node comprises: obtaining a weight corresponding to each load evaluation index in the at least two load evaluation indexes; for each third data node, performing weighted summation on the index values of each load evaluation index of the third data node by using the weight corresponding to each load evaluation index, to obtain a comprehensive index value of the third data node, and taking the comprehensive index value as the first load value of the third data node.
7. The method of claim 6, wherein, The method further comprises: for each load evaluation index, determining the maximum value and the minimum value of the load evaluation index according to the index values of the load evaluation index of each third data node; for each load evaluation index, performing normalization processing on the index values of the load evaluation index of each third data node respectively according to the maximum value and the minimum value of the load evaluation index, to obtain normalized index values; for each third data node, the performing weighted summation on the index values of each load evaluation index of the third data node by using the weight corresponding to each load evaluation index comprises: performing weighted summation on the normalized index values of each load evaluation index of the third data node by using the weight corresponding to each load evaluation index, to obtain the comprehensive index value of the third data node.
8. The method of claim 5, wherein, for each intermediate node, the second load value of each target leaf node corresponding to the intermediate node is determined in the following manner: for each load evaluation index, determining the maximum value and the minimum value of the load evaluation index of each target leaf node according to the index values of the load evaluation index of each target leaf node; for each load evaluation index, performing normalization processing on the index values of the load evaluation index of each target leaf node respectively according to the maximum value and the minimum value of the load evaluation index of each target leaf node, to obtain the normalized index values of each target leaf node with respect to each load evaluation index of the intermediate node; performing weighted summation on the normalized index values of each load evaluation index of each target leaf node corresponding to the intermediate node by using the weight corresponding to each load evaluation index, to obtain the comprehensive index value of each target leaf node corresponding to the intermediate node, and taking the comprehensive index value of each target leaf node corresponding to the intermediate node as the second load value of each target leaf node corresponding to the intermediate node.
9. The method of claim 5, wherein, The data stored by each data processing node comprises a copy of at least one data shard in a plurality of data shards, wherein the copy of at least one data shard in the plurality of data shards is stored in at least two data processing nodes, wherein the data to be migrated comprises at least one copy to be migrated; the second intermediate node at the highest level is an intermediate node in the highest level, which has the smallest load value and the number of copies to be migrated stored by the intermediate node is less than a first threshold value; the second intermediate node at the highest level is an intermediate node in the highest level, which has the smallest load value and the number of copies to be migrated stored by the intermediate node is less than a first threshold value; For each level in the non-highest level, the second intermediate node of the level is the intermediate node with the smallest load value and storing less than the first threshold number of the to-be-migrated copies among the child nodes of the second intermediate node of the upper level of the level; The fourth intermediate node of the target level is the intermediate node with the smallest load value and storing less than the first threshold number of the to-be-migrated copies among the child nodes of the first intermediate node of the arbitrary level; For each level under the target level, the fourth intermediate node of the level is the intermediate node with the smallest load value and storing less than the first threshold number of the to-be-migrated copies among the child nodes of the fourth intermediate node of the upper level of the level; The first threshold of the intermediate node in the highest level is determined according to the total number of the to-be-migrated copies in the distributed system and the number of the intermediate nodes in the highest level; and the first threshold of the intermediate node in each level under the highest level is determined according to the first threshold of the parent node of the intermediate node in the upper level and the number of the child nodes of the parent node.
10. The method of any one of claims 1, 4, 5, or 9, wherein, The data stored by each data processing node includes a copy of at least one data shard in a plurality of data shards, wherein the copy of at least one data shard in the plurality of data shards is stored in at least two data processing nodes, and wherein the to-be-migrated data includes at least one to-be-migrated copy. The target node is determined from each second data node according to the data amount of the to-be-migrated copy and the load-related information of each second data node, including: In order of load value from small to large, the first second data node without storing the to-be-migrated copy and with an estimated load state of not overloaded is determined as the target node, and the estimated load state of any second data node is the load state of the second data node when the to-be-migrated copy is migrated to the second data node.
11. The method of claim 1, wherein, The migration of the to-be-migrated data to the target node includes: sending a migration request to the target node, the migration request including the data amount of the to-be-migrated data; in the case of receiving first information returned by the target node, migrating the to-be-migrated data to the target node; The first information is used to indicate that the target node agrees to receive the to-be-migrated data, and the first information is sent by the target node when the estimated load state is not overloaded according to the data amount of the to-be-migrated data.
12. A data processing apparatus based on distributed storage, characterized by, The first data node applied to a distributed system, the distributed system including a plurality of data processing nodes, the first data node being any data processing node in the distributed system, the apparatus comprising: a receiving module configured to receive respective load-related information broadcast by each second data node, wherein the second data nodes are data processing nodes in the plurality of data processing nodes except the first data node, and the load-related information includes an index value of at least one load evaluation index, and the at least one load evaluation index includes a storage index, and the index value of the storage index is a stored data amount; determining module, configured to determine a load state of the first data node according to load-related information of each third data node; the each third data node comprises the first data node and the each second data node; migrating module, configured to perform a data migration operation when the load state is overload; the data migration operation comprises: determining to-be-migrated data of the first data node according to load-related information of the first data node; determining a target node from each second data node according to a data amount of the to-be-migrated data and load-related information of each second data node, and migrating the to-be-migrated data to the target node.
13. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, is arranged to perform the method of any one of claims 1 to 12. The processor executes the computer program to implement the steps of the method in any one of claims 1-11.
14. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1-11.
15. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1-11.