A resource allocation method and a resource secondment method
The consistent hash algorithm is used to generate a hash ring, determine the target cluster and establish an association relationship, which solves the problem of resource secondment conflicts between busy clusters and improves resource utilization and response performance.
Patent Information
- Application Number
- CN201910704756.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-31
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-07-31
AI Technical Summary
In the existing technology, secondment conflicts are prone to occur when multiple busy clusters concurrently borrow resources from the same idle cluster, resulting in low resource utilization efficiency and increased response delays.
A consistent hash algorithm is used to generate a hash ring, and the target cluster is determined by calculating the hash value of the node, establishing a fixed association, avoiding random queries and repeated confirmations, directly seconding resources, and reducing information round-trip delay.
Secondment conflicts are effectively avoided, resource utilization and response performance are improved, and information round-trip delays are reduced.
Smart Images

Figure CN112306651B
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed systems, and in particular to a resource allocation method and a resource borrowing method. Background Art
[0002] With the development of artificial intelligence (AI) and the Internet of Things (IoT), many emerging computing-intensive and delay-sensitive terminal applications, such as virtual reality (VR), augmented reality (AR), and high-definition video and image processing, are rapidly emerging, and the demand for applications such as low latency, high bandwidth, and strong computing is growing. Cloud computing technology is affected by factors such as network link capacity limitations, which can easily lead to problems such as slow data transmission rate and high response delay, making it difficult to meet application service requirements. It has gradually become a trend to use edge devices close to data sources to perform calculations to improve service response performance. However, the computing power of a single edge device is small, and it is difficult to meet large-scale task requirements using only a single edge device to perform tasks. Therefore, the computing power of multiple edge devices is combined and used, and the data processing of complex tasks is collaboratively completed through resource sharing and mutual assistance of multiple edge devices, so as to effectively ensure service quality.
[0003] The resource cooperation scenarios between devices are mainly divided into two categories. One is the resource cooperation of hierarchical heterogeneous devices, such as the collaboration of devices with different computing capabilities between edge devices and edge servers, and central cloud processors; the other is the resource collaboration between devices at the same level, that is, when the resources of edge devices are insufficient, resources can be borrowed from other edge devices.
[0004] In the prior art, when a busy cluster with insufficient resources needs to borrow resources from other idle clusters, the master node in the busy cluster needs to send a resource query request to a randomly selected idle cluster, and then borrow resources after receiving a response. When multiple busy clusters concurrently borrow resources from the same idle cluster, a borrowing conflict will occur. Summary of the invention
[0005] The embodiments of the present application provide a resource allocation method and a resource secondment method, which avoid secondment conflicts caused by multiple busy clusters concurrently seconding resources from the same idle cluster.
[0006] In a first aspect, the present application provides a resource allocation method, comprising:
[0007] The first node determines the hash value corresponding to the first cluster; the first node obtains a hash ring, the hash ring includes at least one hash value interval, each hash value interval corresponds to a second cluster; the first node determines the corresponding target second cluster according to the hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to the target hash interval, the target hash interval is a hash value interval in the at least one hash value interval, and the target hash interval corresponds to the target second cluster; the first node establishes an association relationship between the first cluster and the target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster. Moreover, since the corresponding relationship of resource borrowing is determined based on the corresponding relationship of the hash value of the first cluster on the hash ring generated based on the busy cluster, the corresponding relationship is unique, so the idle cluster can only borrow resources from the corresponding busy cluster on the hash ring, and therefore, there will be no borrowing conflict caused by multiple busy clusters borrowing resources from the same idle cluster concurrently.
[0008] In this way, the first node can determine the target second cluster corresponding to the first cluster through the distribution of the hash value corresponding to the first cluster on the hash ring (generated according to the hash value corresponding to the second cluster), and establish an association relationship between the target second cluster and the first cluster. Since the distribution of the hash value corresponding to the first cluster and the hash node corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined, each idle cluster is only allowed to be borrowed from a fixed empty cluster. Therefore, when the target second cluster needs to borrow the idle resources of the first cluster, it is not necessary to randomly send a resource query request to the selected idle cluster and borrow resources after receiving the return. It can directly borrow resources from the first cluster, reducing the delay overhead of one round trip of information.
[0009] In an optional design of the first aspect, the hash ring includes a first hash node and a second hash node, the first hash node corresponds to the target second cluster, the first hash node is an adjacent successor node of the second hash node on the hash ring, and the target hash interval is a hash interval between the hash value of the first hash node and the hash value of the second hash node.
[0010] In an optional design of the first aspect, the method further includes: the first node divides an idle cluster including multiple computing nodes to obtain multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
[0011] In an optional design of the first aspect, the multiple subclusters include a third subcluster and a fourth subcluster, the third subcluster is the subcluster with the largest amount of idle resources among the multiple subclusters, the fourth subcluster is the cluster with the smallest amount of idle resources among the multiple subclusters, and the absolute value of the difference between the idle amount of resources of the third subcluster and the idle amount of resources of the fourth subcluster is less than a first threshold. In this way, the first node can divide the multiple computing nodes of the idle cluster so that the difference in the idle amount of resources between the first clusters in the multiple subclusters obtained after the division is not too large.
[0012] In an optional design of the first aspect, the absolute value of the difference between the idle amount of resources of each of the multiple subclusters and a preset idle amount of resources is less than or equal to a second threshold, and the preset idle amount of resources is related to the historical resource request amount. In this way, the first node divides the multiple computing nodes of the idle cluster based on the historical resource request, so that the idle resource amount of each subcluster after the division is close to the historical resource request amount.
[0013] In an optional design of the first aspect, the number of the multiple sub-clusters and the number of the second clusters are less than a third threshold.
[0014] In an optional design of the first aspect, the method also includes: the first node receives a first resource borrowing request sent by the target second cluster, the first resource borrowing request includes task data and an identifier of the first cluster; the first node sends the task data to the first cluster according to the identifier of the first cluster.
[0015] In an optional design of the first aspect, the method further includes: the first node receives a first resource borrowing request sent by the target second cluster, the first resource borrowing request includes task data; and the first node sends the task data to the first cluster.
[0016] In an optional design of the first aspect, the first node sends the task data to the first cluster, including: the first node sends the task data to the first cluster based on an association relationship between the first cluster and a target second cluster.
[0017] In an optional design of the first aspect, the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, and the corresponding hash values of the Y hash nodes and the hash value corresponding to the first cluster are generated according to the same hash algorithm, and Y is a positive integer. In this way, the corresponding hash values of the hash nodes on the hash ring and the hash values corresponding to the first cluster are generated based on the same hash algorithm, so that the hash value corresponding to the first cluster does not overlap with the hash node on the hash ring.
[0018] In an optional design of the first aspect, the method further includes: the first node determines Y hash values corresponding to X second clusters, wherein each second cluster corresponds to at least one hash value, X is a positive integer, and Y is a positive integer greater than or equal to X; the first node generates the hash ring according to the Y hash values, wherein the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, and the Y hash nodes divide the hash ring into Y hash value intervals, and each hash node corresponds to a hash value interval. In this way, the first node can generate the hash ring by itself.
[0019] In an optional design of the first aspect, the method further includes: the first node receiving the hash ring sent by the second cluster.
[0020] In an optional design of the first aspect, the method further includes: the first node sending the idle amount of resources of the first cluster to the target second cluster.
[0021] In a second aspect, the present application provides a resource borrowing method, the method comprising: a second node determines a first cluster having an association relationship with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and the hash value corresponding to the first cluster belongs to the target hash value interval; the second node receives task data; the second node sends a first resource borrowing request to the first node, the first borrowing request being used to instruct the first node to assign the task data to the first cluster for processing.
[0022] In this way, since the distribution of hash values corresponding to the first cluster and hash nodes corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined, each idle cluster is only allowed to be borrowed by a fixed empty cluster. Therefore, when the target second cluster needs to borrow idle resources from the first cluster, there is no need to randomly send a resource query request to the selected idle cluster and then borrow resources after receiving the return. Resources can be directly borrowed from the first cluster, reducing the delay overhead of a round trip of information.
[0023] In an optional design of the second aspect, the method further includes: the second node determines that the first cluster is in a resource non-borrowable state based on sending the first resource borrowing request to the first node. In this way, after the second node sends the first resource borrowing request to the first node, it is equivalent to occupying the idle resources of the first cluster, and then it can be determined that the first cluster is in a resource non-borrowable state. Optionally, the second node can mark the resource borrowing state of the first cluster as a resource non-borrowable state in the mapping table. Correspondingly, the first node can also determine that the first cluster is in a resource non-borrowable state, that is, it determines that the first cluster cannot provide available resources for other busy clusters, thereby ensuring resource locking and achieving conflict-free scheduling of cross-cluster resources.
[0024] In an optional design of the second aspect, there are multiple clusters that have an association relationship with the target second cluster, and the second node determines a first cluster that has an association relationship with the target second cluster, including: the second node determines that one of the multiple clusters that have an association relationship with the target second cluster is the first cluster.
[0025] In an optional design of the second aspect, the second node determines that one of the multiple clusters associated with the target second cluster is the first cluster, including: the second node determines that among the idle resources of the multiple clusters associated with the target second cluster, the cluster corresponding to the idle resources with the smallest difference from the resource demand of the task data is the first cluster. In this way, the second node determines that among the idle resources of the multiple clusters associated with the target second cluster, the cluster corresponding to the idle resources with the smallest difference from the resource demand of the task data is the first cluster, thereby improving resource utilization during resource loan.
[0026] In an optional design of the second aspect, it is characterized in that the method also includes: the second node receives the resource requirement of the task data sent by the third node; based on the resource idle amount of the first cluster being greater than or equal to the resource requirement, the second node sends the identifier of the first cluster and the resource idle amount of the first cluster to the third node.
[0027] In an optional design of the second aspect, the second node receives the task data, including: the second node receives a second resource secondment request sent by the third node, the second resource secondment request includes the task data, and the second secondment request is used to instruct the second node to allocate the task data to the first cluster for processing.
[0028] In a third aspect, the present application provides a resource borrowing method, including: a second node receives a resource demand of task data sent by a third node; the second node determines a first cluster having an association relationship with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and the hash value corresponding to the first cluster belongs to the target hash value interval; based on the resource idle amount of the first cluster being greater than or equal to the resource demand, the second node sends a third resource borrowing request to the third node, and the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster.
[0029] In this way, the first node can determine the target second cluster corresponding to the first cluster through the distribution of the hash value corresponding to the first cluster on the hash ring (generated according to the hash value corresponding to the second cluster), and establish the association relationship between the target second cluster and the first cluster. Since the distribution of the hash value corresponding to the first cluster and the hash node corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined, each idle cluster is only allowed to be borrowed from a fixed empty cluster. Therefore, when the third node needs to borrow resources from the second node, the second node does not need to randomly send a resource query request to the selected idle cluster and then borrow resources after receiving the return. Instead, it can directly determine the first cluster from which resources can be borrowed, reducing the delay overhead of one round trip of information.
[0030] In an optional design of the third aspect, there are multiple clusters that have an association relationship with the target second cluster, and the second node determines a first cluster that has an association relationship with the target second cluster, including: the second node determines that one of the multiple clusters that have an association relationship with the target second cluster is the first cluster.
[0031] In a fourth aspect, the present application provides a resource borrowing method, comprising: a third node receives task data; the third node sends the resource demand of the task data to the second node; the third node receives a third resource borrowing request sent by the second node, the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from a first cluster, wherein the second node belongs to a target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, the hash value corresponding to the first cluster belongs to the target hash value interval, and the resource idle amount of the first cluster is greater than or equal to the resource demand; the third node sends a first resource borrowing request to the first node, the first borrowing request is used to indicate that the first node allocates the task data to the first cluster for processing.
[0032] In this way, since the distribution of hash values corresponding to the first cluster and hash nodes corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined and relatively balanced, when the third node needs to borrow resources from the second node, the second node does not need to randomly send a resource query request to the selected idle cluster and then borrow resources after receiving the return. Instead, it can directly determine the first cluster from which resources can be borrowed, reducing the delay overhead of one round trip of information.
[0033] In an optional design of the fourth aspect, the third node sends the resource requirement of the task data to the second node, including: the third node sends the resource requirement of the task data to multiple nodes, and the second node is one of the multiple nodes; the third node receives a third resource borrowing request sent by the second node, including: the third node receives the third resource borrowing request sent by the multiple nodes, and the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
[0034] In an optional design of the fourth aspect, the method further includes: the third node determines that the subcluster corresponding to the resource idle amount having the smallest difference with the resource demand amount of the task data among the resource idle amounts of the multiple subclusters is the first cluster.
[0035] In a fifth aspect, the present application provides a first management node, the first management node comprising:
[0036] A processing module, configured to determine a hash value corresponding to a first cluster; obtain a hash ring, the hash ring comprising at least one hash value interval, each hash value interval corresponding to a second cluster; determine a corresponding target second cluster according to the hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to a target hash interval, the target hash interval is a hash value interval in the at least one hash value interval, and the target hash interval corresponds to the target second cluster;
[0037] The transceiver module is used to establish an association relationship between a first cluster and a target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster.
[0038] In an optional design of the fifth aspect, the hash ring includes a first hash node and a second hash node, the first hash node corresponds to the target second cluster, the first hash node is an adjacent successor node of the second hash node on the hash ring, and the target hash interval is a hash interval between the hash value of the first hash node and the hash value of the second hash node.
[0039] In an optional design of the fifth aspect, the processing module is further used to divide an idle cluster including multiple computing nodes to obtain multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
[0040] In an optional design of the fifth aspect, the multiple subclusters include a third subcluster and a fourth subcluster, the third subcluster is a subcluster with the largest amount of idle resources among the multiple subclusters, the fourth subcluster is a cluster with the smallest amount of idle resources among the multiple subclusters, and the absolute value of the difference between the idle amount of resources of the third subcluster and the idle amount of resources of the fourth subcluster is less than a first threshold.
[0041] In an optional design of the fifth aspect, an absolute value of a difference between an idle resource amount of each of the multiple subclusters and a preset idle resource amount is less than or equal to a second threshold, and the preset idle resource amount is related to a historical resource request amount.
[0042] In an optional design of the fifth aspect, the number of the multiple sub-clusters and the number of the second clusters are less than a third threshold.
[0043] In an optional design of the fifth aspect, the transceiver module is further used for:
[0044] receiving a first resource secondment request sent by the target second cluster, wherein the first resource secondment request includes task data and an identifier of the first cluster;
[0045] The task data is sent to the first cluster according to the identifier of the first cluster.
[0046] In an optional design of the fifth aspect, the transceiver module is further used for:
[0047] A first resource borrowing request sent by the target second cluster is received, where the first resource borrowing request includes task data, and the task data is sent to the first cluster.
[0048] In an optional design of the fifth aspect, the transceiver module is specifically used to: send the task data to the first cluster based on an association relationship between the first cluster and the target second cluster.
[0049] In an optional design of the fifth aspect, the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, and the corresponding hash values of the Y hash nodes and the hash value corresponding to the first cluster are generated according to the same hash algorithm, and Y is a positive integer.
[0050] In an optional design of the fifth aspect, the processing module is further used to determine Y hash values corresponding to X second clusters, wherein each second cluster corresponds to at least one hash value, X is a positive integer, and Y is a positive integer greater than or equal to X; generate the hash ring according to the Y hash values, wherein the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, the Y hash nodes divide the hash ring into Y hash value intervals, and each hash node corresponds to a hash value interval.
[0051] In an optional design of the fifth aspect, the transceiver module is also used to receive the hash ring sent by the second cluster.
[0052] In an optional design of the fifth aspect, the transceiver module is further used to send the resource idle amount of the first cluster to the target second cluster.
[0053] In a sixth aspect, the present application provides a second management node, characterized in that the second management node includes:
[0054] A processing module, configured to determine a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and a hash value corresponding to the first cluster belongs to the target hash value interval;
[0055] The transceiver module is used to receive task data; and send a first resource secondment request to the first node, wherein the first resource secondment request is used to instruct the first node to allocate the task data to the first cluster for processing.
[0056] In an optional design of the sixth aspect, the processing module is further used to send a resource borrowing request to the first node based on the transceiver module, and determine that the first cluster is in a state where resources cannot be borrowed.
[0057] In an optional design of the sixth aspect, there are multiple clusters associated with the target second cluster, and the processing module is specifically used to determine that one of the multiple clusters associated with the target second cluster is the first cluster.
[0058] In an optional design of the sixth aspect, the processing module is specifically used to determine the resource idleness of multiple clusters associated with the target second cluster, and the cluster corresponding to the resource idleness with the smallest difference with the resource demand of the task data is the first cluster.
[0059] In an optional design of the sixth aspect, the transceiver module is also used to receive the resource requirement of the task data sent by the third node, and based on the resource free amount of the first cluster being greater than or equal to the resource requirement, send the identifier of the first cluster and the resource free amount of the first cluster to the third node.
[0060] In an optional design of the sixth aspect, the transceiver module is specifically used to receive a second resource borrowing request sent by the third node, the second resource borrowing request includes the task data, and the second borrowing request is used to instruct the second node to allocate the task data to the first cluster for processing.
[0061] In a seventh aspect, the present application provides a second management node, characterized in that the second management node includes:
[0062] A transceiver module, used for receiving the resource demand of the task data sent by the third node;
[0063] A processing module, configured to determine a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and a hash value corresponding to the first cluster belongs to the target hash value interval;
[0064] The transceiver module is further used to send a third resource borrowing request to the third node based on the idle amount of resources of the first cluster being greater than or equal to the required amount of resources, wherein the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster.
[0065] In an optional design of the seventh aspect, there are multiple clusters associated with the target second cluster, and the processing module is specifically used to determine that one of the multiple clusters associated with the target second cluster is the first cluster.
[0066] In an eighth aspect, the present application provides a third management node, characterized in that the third management node includes:
[0067] A transceiver module is used to receive task data, send the resource demand of the task data to a second node, receive a third resource borrowing request sent by the second node, and the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from a first cluster, wherein the second node belongs to a target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, the hash value corresponding to the first cluster belongs to the target hash value interval, and the resource idle amount of the first cluster is greater than or equal to the resource demand, and send a first resource borrowing request to the first node, and the first resource borrowing request is used to indicate that the first node allocates the task data to the first cluster for processing.
[0068] In an optional design of the eighth aspect, the transceiver module is specifically used to send the resource demand of the task data to multiple nodes, the second node is one of the multiple nodes, and receives a third resource borrowing request sent by the multiple nodes, the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
[0069] In an optional design of the eighth aspect, the third management node further includes:
[0070] The processing module is configured to determine that the subcluster corresponding to the idle resource amount having the smallest difference with the resource demand amount of the task data among the idle resource amounts of the multiple subclusters is the first cluster.
[0071] In a ninth aspect, the present application provides a cluster, comprising a plurality of computing nodes, wherein the computing nodes provide the required resources for task data to execute the task data, and the cluster further comprises: the first management node described in any of the above aspects.
[0072] In a tenth aspect, the present application provides a cluster, comprising a plurality of computing nodes, wherein the computing nodes provide the required resources for task data to execute the task data, and the cluster further comprises: the second management node described in any of the above aspects.
[0073] In an eleventh aspect, the present application provides a cluster, comprising a plurality of computing nodes, wherein the computing nodes provide the required resources for task data to execute the task data, and the cluster further comprises: the third management node described in any of the above aspects.
[0074] In a twelfth aspect, the present application provides a distributed system, characterized in that the distributed system includes the cluster described in the ninth aspect and the cluster described in the tenth aspect.
[0075] In a thirteenth aspect, the present application provides a distributed system, characterized in that the distributed system includes the cluster described in the ninth aspect, the cluster described in the tenth aspect, and the cluster described in the eleventh aspect.
[0076] In a fourteenth aspect, the present application provides a computer storage medium for storing computer software instructions used for the above-mentioned first management node, which includes a program designed for executing the above-mentioned aspects.
[0077] In a fifteenth aspect, the present application provides a computer storage medium for storing computer software instructions used for the above-mentioned second management node, which includes a program designed for executing the above-mentioned aspects.
[0078] In a sixteenth aspect, the present application provides a computer storage medium for storing computer software instructions used for the above-mentioned third management node, which includes a program designed for executing the above-mentioned aspects.
[0079] In an embodiment of the present application, the first node determines a hash value corresponding to the first cluster; the first node obtains a hash ring, the hash ring includes at least one hash value interval, and each hash value interval corresponds to a second cluster; the first node determines the corresponding target second cluster according to the hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to the target hash interval, the target hash interval is a hash value interval in at least one hash value interval, and the target hash interval corresponds to the target second cluster; the first node establishes an association relationship between the first cluster and the target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster. Through the above method, the first node can determine the target second cluster corresponding to the first cluster through the distribution of the hash value corresponding to the first cluster on the hash ring (generated according to the hash value corresponding to the second cluster), and establish the association relationship between the target second cluster and the first cluster. Since the distribution of the hash value corresponding to the first cluster and the hash node corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined, each idle cluster is only allowed to be borrowed from a fixed empty cluster. Therefore, when the target second cluster needs to borrow the idle resources of the first cluster, it is not necessary to randomly send a resource query request to the selected idle cluster and borrow resources after receiving the return. It can directly borrow resources from the first cluster, reducing the delay overhead of one round trip of information. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 This is a schematic diagram of a centralized distributed system architecture with a one-layer architecture;
[0081] Figure 2 The following is a schematic diagram of the architecture of a resource loan scenario;
[0082] Figure 3a A schematic diagram of an embodiment of a resource allocation method provided in an embodiment of the present application;
[0083] Figure 3b This is a schematic diagram of the idle and busy status distribution of a cluster;
[0084] Figure 3c This is a schematic diagram of the idle and busy status distribution of a cluster;
[0085] Figure 3d This is a schematic diagram of a packing result in an embodiment of the present application;
[0086] Figure 4a A schematic diagram of the structure of a hash ring provided in an embodiment of the present application;
[0087] Figure 4b A schematic diagram of the structure of a hash ring provided in an embodiment of the present application;
[0088] Figure 4c A schematic diagram of the structure of a hash ring provided in an embodiment of the present application;
[0089] Figure 4d A schematic diagram of the structure of a hash ring provided in an embodiment of the present application;
[0090] Figure 5 A schematic diagram of an embodiment of a resource borrowing method provided in an embodiment of the present application;
[0091] Figure 6 A schematic diagram of an embodiment of a resource borrowing method provided in an embodiment of the present application;
[0092] Figure 7 A schematic diagram of the structure of a first management node provided in an embodiment of the present application;
[0093] Figure 8 A schematic diagram of the structure of a second management node provided in an embodiment of the present application;
[0094] Fig. 9 A schematic diagram of the structure of a third management node provided in an embodiment of the present application;
[0095] Fig.10 A system example of a management node applicable to an embodiment of the present invention;
[0096] Fig.11 A schematic diagram of the structure of a cluster provided in an embodiment of the present application;
[0097] Fig.12 A schematic diagram of the structure of a cluster provided in an embodiment of the present application;
[0098] Fig.13A schematic diagram of the structure of a cluster provided in an embodiment of the present application;
[0099] Fig.14 A schematic diagram of the structure of a distributed system provided in an embodiment of the present application;
[0100] Fig.15 A schematic diagram of the structure of a distributed system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0101] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0102] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0103] Below through Figure 1 The system architecture of the distributed system applied in the embodiment of the present invention is exemplarily described.
[0104] like Figure 1 The figure shows a schematic diagram of a centralized distributed system architecture with a one-layer architecture. In this architecture, users (user1, user2, ...) can submit task data to the master node (master) of the node cluster. The master node schedules and allocates the task data through the scheduler, allocates the required resources for the task data, and then allocates the task to the slave nodes (slave1, slave2, ... slaveN) that meet the resources required by the task.
[0105] It should be noted that the master node (master) in this application can also be understood as a management node, and the slave node (slave) can be understood as a computing node.
[0106] In the aforementioned various architectures, the scheduler can be a hardware device integrated on the relevant node, or can be implemented by software through the general hardware of the node. In the embodiment of the present invention, the specific manner in which the management node implements the scheduler function is not limited.
[0107] The resource scheduling described in the embodiments of the present invention refers to allocating the resources of the computing nodes in the distribution to the task data. It should be noted that in various embodiments of the present invention, the computing node refers to a resource set as a resource scheduling unit in the distributed system. Generally speaking, the computing node is a server or a physical computer. However, in some scenarios, the computing nodes can be divided according to different division units for different resource types. For example, when the CPU is used as the monitored resource, the processor or processing core can be used as the division unit. Each processor or processing core in the distributed system is used as a computing node, and a server may contain multiple computing nodes. For another example, when only storage resources are used as monitored resources, data shards can be used as the division unit of computing nodes. Then a data shard in the distributed database is used as a computing node, and a server may contain multiple data shards, that is, multiple computing nodes.
[0108] With the development of artificial intelligence (AI) and the Internet of Things (IoT), many emerging computing-intensive and delay-sensitive terminal applications, such as virtual reality (VR), augmented reality (AR), and high-definition video and image processing, are rapidly emerging, and the demand for applications such as low latency, high bandwidth, and strong computing is growing. Cloud computing technology is affected by factors such as network link capacity limitations, which can easily lead to problems such as slow data transmission rate and high response delay, making it difficult to meet application service requirements. It has gradually become a trend to use edge devices close to data sources to perform calculations to improve service response performance. However, the computing power of a single edge device is small, and it is difficult to meet large-scale task requirements using only a single edge device to perform tasks. Therefore, the computing power of multiple edge devices is combined and used, and the data processing of complex tasks is collaboratively completed through resource sharing and mutual assistance of multiple edge devices, so as to effectively ensure service quality.
[0109] The resource cooperation scenarios between devices are mainly divided into two categories. One is the resource cooperation of hierarchical heterogeneous devices, such as the collaboration of devices with different computing capabilities between edge devices and edge servers, and central cloud processors; the other is the resource collaboration between devices at the same level, that is, when the resources of edge devices are insufficient, resources can be borrowed from other edge devices.
[0110] Reference Figure 2 , Figure 2 This is a schematic diagram of the architecture of a resource loan scenario, such as Figure 2 As shown in the figure, it includes cluster 201, cluster 202, cluster 203 and cluster 204, wherein cluster 201, cluster 202 and cluster 203 are idle clusters with more idle resources, cluster 204 is a busy cluster with less idle resources, cluster 201 includes a management node 2011 and multiple computing nodes 2012, cluster 202 includes a management node 2021 and multiple computing nodes 2022, cluster 203 includes a management node 2031 and multiple computing nodes 2032, and cluster 204 includes a management node 2041 and multiple computing nodes 2042.
[0111] In one embodiment, taking the case where the idle resources of cluster 204 are insufficient as an example, resources can be transferred across clusters according to the following strategy:
[0112] The management node 2041 sorts the clusters 201 , 202 , and 203 from large to small according to the amount of free resources, and obtains a first cluster list.
[0113] For example, the first cluster list is {cluster 201, cluster 203, cluster 202}.
[0114] The management node 2041 receives the task data, and determines that the available idle resources of the plurality of computing nodes 2042 are less than the resource requirements of the task data.
[0115] The management node 2041 selects a cluster whose idle resources meet the resource requirements of the task data from the first cluster list, and obtains a second cluster list.
[0116] For example, if the idle amounts of resources of cluster 201 , cluster 202 , and cluster 203 all meet the resource requirements of the task data, the second cluster list is {cluster 201 , cluster 203 , cluster 202}.
[0117] The management node 2041 randomly selects two clusters from the second cluster list, and sends a resource query request to the two selected clusters.
[0118] For example, the management node 2041 selects the cluster 201 and the cluster 203 . At this time, the management node 2041 may send a resource query request to the management node 2011 and the management node 2021 .
[0119] The management node 2041 selects the first cluster that returns a secondment result and meets the resource requirements of the task data, and performs cross-cluster resource secondment.
[0120] For example, cluster 201 is the first cluster to return the secondment result and meet the resource requirements of the task data, then the management node can send the task data to management node 2011, so that management node 2011 schedules multiple computing nodes to process the task data.
[0121] However, in the above design, since the management node 2041 needs to send resource query requests to k randomly selected clusters when performing cross-level resource borrowing, and then conduct resource borrowing after receiving the returned borrowing results, a round-trip information delay overhead is required before resource borrowing, which increases the delay.
[0122] At the same time, resource secondment is performed at the cluster granularity. For a scenario where the number of clusters is small but there are many nodes in the clusters, the probability of secondment conflict is relatively high during concurrent secondment, that is, for the same idle cluster, there may be multiple busy clusters for resource secondment. For example, taking the above embodiment as an example, if cluster 201 and cluster 203 are both being seconded by other busy clusters, a resource secondment conflict will occur on cluster 201 and cluster 203, resulting in no cluster returning a secondment result.
[0123] In order to solve the above technical problems, the present application provides a resource allocation method, referring to Figure 3a , Figure 3a A schematic diagram of an embodiment of a resource allocation method provided in an embodiment of the present application is shown in FIG. Figure 3a As shown in the figure, the resource allocation method provided by the present application includes:
[0124] 301. A first node determines a hash value corresponding to a first cluster.
[0125] In an embodiment of the present application, the first node may be a management node of an idle cluster, wherein the idle cluster includes a first node and multiple computing nodes, the first cluster may be a node cluster composed of all or part of the multiple computing nodes, and the first cluster may also include the first node, which is not limited here.
[0126] In the embodiment of the present application, before determining the hash value corresponding to the first cluster, the first node may first determine the busy or idle state of the cluster in which it is located.
[0127] Optionally, in one embodiment, the first node may evaluate the busy / idle status of the node according to the occupancy rate of the dominant resource of the computing node in the cluster, and evaluate the busy / idle status of the cluster according to the number of busy nodes and the number of idle nodes in the cluster.
[0128] Exemplarily, the first node may define the busy / idle status of the computing node according to the following formula:
[0129]
[0130] Where i represents the i-th resource, Use(i) represents the resource usage of the i-th resource in use, and Total(i) represents the total resource usage of the i-th resource;
[0131]
[0132] Among them, a is the preset threshold, max{P i} indicates the largest resource occupancy rate among i resources.
[0133] In an embodiment of the present application, when the maximum resource occupancy rate in the computing node is greater than or equal to threshold a, the first node can determine that the computing node is a busy node; when the maximum resource occupancy rate in the computing node is less than threshold a, the first node can determine that the computing node is an idle node.
[0134] It should be noted that the above threshold a can be adjusted in real time according to demand and can be configured according to different scenarios, and this application is not limited.
[0135] Exemplarily, the first node may define the busy / idle status of the cluster in which it is located in the following manner:
[0136] In the cluster where the first node is located, the number of busy nodes is n and the number of idle nodes is m;
[0137] When m=1: that is, when there is only one idle node in the cluster where the first node is located, the first node can determine that the cluster where it is located is a busy cluster;
[0138] When m≠1: Calculate
[0139] Wherein, b is the preset threshold.
[0140] It should be noted that the above threshold b can be adjusted in real time according to demand and can be configured according to different scenarios, and this application is not limited.
[0141] Reference Figure 3b and Figure 3c , Figure 3b and Figure 3c It is a schematic diagram of cluster idle and busy status distribution, such as Figure 3b and Figure 3c As shown, in Figure 3b In the cluster, there are 4 busy nodes and 5 idle nodes, that is, n = 4, m = 5;
[0142] Then p = 1.25. If the threshold b is determined to be 0.3, due to but Figure 3b The cluster shown is an idle cluster and can provide idle resources.
[0143] Similarly, Figure 3c The cluster shown has 7 busy nodes and 2 idle nodes, i.e., n=7, m=2;
[0144] Then p = 0.286. Since 0.286 < 0.3, then Figure 3c The cluster shown is a busy cluster.
[0145] In the embodiment of the present application, when the first node determines that the idle-busy state of the cluster in which it is located is idle, the first node may determine the hash value corresponding to the first cluster.
[0146] Optionally, the idle cluster where the first node is located includes multiple computing nodes, and the first node may divide the multiple computing nodes of the idle cluster into multiple sub-clusters.
[0147] Furthermore, the idle cluster where the first node is located includes multiple idle nodes, and the first node may divide the multiple idle nodes of the idle cluster into multiple sub-clusters.
[0148] In one embodiment, the multiple subclusters include a third cluster and a fourth cluster, the third cluster is a cluster with the largest amount of idle resources among the multiple subclusters, the fourth cluster is a cluster with the smallest amount of idle resources among the multiple subclusters, and the absolute value of the difference between the idle amount of resources of the third cluster and the idle amount of resources of the fourth cluster is less than a first threshold.
[0149] That is, in an embodiment of the present application, the first node can divide multiple computing nodes of the idle cluster so that the difference in resource idle amount between each first cluster in the multiple sub-clusters obtained after the division will not be too large (the absolute value of the difference between the maximum resource idle amount and the minimum resource idle amount is less than the first threshold).
[0150] Exemplarily, the first node may randomly select a part of the idle nodes or all the idle nodes from the plurality of idle nodes in the idle cluster as reserved resources, and provide resources for the local busy nodes of the idle cluster;
[0151] In the embodiment of the present application, the first node may determine the remaining idle nodes among the idle nodes except the reserved resources as borrowable resources, and group them.
[0152] Specifically, the first node may first calculate the resource idle rate r of each idle node in the borrowable resources. i =α×c i +β×m i , and sort the nodes in descending order according to the resource idle rate, where c i Indicates the CPU resource idle rate, m i represents the idle rate of memory resources, α and β represent the weight parameters of the idle rate of CPU resources and the idle rate of memory resources.
[0153] The first node divides the borrowable resources into j groups and performs an "s"-type boxing operation on all borrowable nodes, while calculating the total idle rate R of each idle resource group. j =∑r i and σ j =max{R j}-min{R j}, iterate to σ j Greater than σ j-1 When , the algorithm terminates and takes the j-1 group as the grouping result, where n represents the number of borrowable nodes. It should be noted that j is a configurable parameter and can be selected according to requirements in actual applications. It is not limited here.
[0154] For example, the first node may determine that the remaining idle nodes in the idle nodes except for the reserved resources include: {node 1, node 2, node 3, node 4, node 5, node 6, node 7, node 8, node 9, node 10, node 11, node 12}, where each node has been sorted in descending order of idle rate (i.e., node 1 has the highest idle rate and node 12 has the lowest idle rate), refer to Figure 3d , Figure 3d : is a schematic diagram of a packing result in an embodiment of the present application, wherein, when the number of groups j is determined to be 5, the schematic diagram of the “S” type packing result is as follows Figure 3d As shown, in Figure 3d In the figure, five subclusters are obtained after division.
[0155] In another embodiment, an absolute value of a difference between an idle resource amount of each of the multiple subclusters and a preset idle resource amount is less than or equal to a second threshold, and the preset idle resource amount is related to a historical resource request amount.
[0156] Specifically, the resource idle amount may include the CPU resource idle amount and the memory resource idle amount, and the preset resource idle amount may include the preset CPU resource idle amount and the preset memory resource idle amount, wherein the preset resource idle amount is related to the historical resource request amount, and accordingly, the preset CPU resource idle amount is related to the historical CPU resource request amount, and the preset memory resource idle amount is related to the historical memory resource request amount.
[0157] In an embodiment of the present application, the absolute value of the difference between the CPU resource idle amount of each sub-cluster in the multiple sub-clusters and the preset CPU resource idle amount is less than or equal to the third threshold, and the absolute value of the difference between the memory resource idle amount of each sub-cluster in the multiple sub-clusters and the preset memory resource idle amount is less than or equal to the fourth threshold.
[0158] In the embodiment of the present application, the preset idle amount of CPU resources and the preset idle amount of memory resources can be determined according to the resource request amount in the historical loan request. For example, the first node can record the resource information requested in the idle cluster in the last k cycles, where k is an adjustable parameter.
[0159] Optionally, the first node may first perform statistical averages on the CPU resource request amounts and memory resource request amounts in k cycles according to the historical resource request table, and obtain the historical average CPU request amount of each idle resource group in a single cycle. and the historical average memory requests
[0160]
[0161]
[0162] Among them, CPU i Indicates the total amount of CPU resource requests in the ith cycle, s i Indicates the number of idle resource groups in the i-th cycle, MEM i Represents the total amount of memory resource requests in the i-th cycle.
[0163] The first node can determine the historical average CPU request volume The preset CPU resource idle amount and the historical average memory request amount The preset memory resource amount.
[0164] The first node can and As an indicator, the borrowable resources are grouped so that the idle CPU resources and memory resources in each sub-cluster after grouping are close to and
[0165] The first node can calculate the contribution rate of each idle node And sort the idle nodes in descending order according to the contribution rate, and divide the borrowable resources into N groups.
[0166] All borrowable nodes are packed into “S” shape to obtain multiple subclusters.
[0167] Among them, idle_c i Indicates CPU idle amount and idle_m i Indicates the amount of free memory, α and β indicate the weight parameters of CPU and memory, sum_cpu indicates the total amount of free CPU available in the idle cluster, and sum_mem indicates the total amount of free memory available in the idle cluster.
[0168] Regarding how the first node packs all idle nodes into "S"-shaped boxes to obtain multiple sub-clusters, reference may be made to the description in the above embodiment, which will not be repeated here.
[0169] In the embodiment of the present application, at a preset time interval, the management nodes in the cluster can determine the idle and busy status of the respective clusters. When the management node determines that the set it is in is an idle cluster, all or part of the idle nodes in the idle cluster can be divided in the above manner to obtain multiple subclusters. When the management node determines that the set it is in is a busy cluster, it can broadcast its own busy and idle status (busy status) to other management nodes.
[0170] In an embodiment of the present application, the first node may determine a hash value corresponding to the first cluster. Specifically, the first node may determine a hash value corresponding to each of the multiple subclusters. It should be understood that one of the multiple subclusters in the first cluster.
[0171] Specifically, the first cluster can uniquely correspond to an identifier, for example, the first cluster can be uniquely identified by IP and ID, wherein IP is the identifier of the idle cluster where the first node is located, and ID is the identifier of the group. In the embodiment of the present application, IP can be the IP address of the server where the idle cluster is located, and the IP address can include two pieces of information, the IP address and the port number of the server. For example, the hash value corresponding to the first cluster can be calculated based on the IP address and port number information of the server where it is located and the ID used to identify the group, and the hash value corresponding to the first cluster is calculated based on a preset hash algorithm.
[0172] The first node may calculate the hash value corresponding to each subcluster based on a preset hash algorithm. Specifically, the first node may calculate the hash value of the identifier of each subcluster based on the preset hash algorithm. Since the identifiers of multiple subcluster are not repeated, the corresponding hash values are also different.
[0173] 302. The first node obtains a hash ring, where the hash ring includes at least one hash value interval, and each hash value interval corresponds to a second cluster.
[0174] In the embodiment of the present application, the hash ring can be understood as a data structure including the hash values of multiple hash nodes and the hash value interval between two adjacent hash nodes, and the data structure can be in the form of a list or an array. The present application does not limit the specific form of the hash value, and any data structure that can reflect the distribution characteristics of at least one second cluster should fall within the protection scope of the present application.
[0175] In one embodiment, the first node may construct a hash ring based on a preset hash algorithm.
[0176] In a distributed system based on a consistent hashing algorithm, clusters can be distributed on a logical ring of numerical space according to their corresponding hash values, called a hash ring. The hash ring is generally generated and saved by a management node. A data range on the hash ring (such as a hash value range of 1000 to 20000 on the hash ring) is called a hash value interval.
[0177] Specifically, when the management node determines that the set it is in is a busy cluster, it can broadcast its busy / idle state (busy state) to other management nodes. Accordingly, the first node can determine the busy cluster (at least one second cluster) included in the distributed system.
[0178] The first node can calculate the hash values corresponding to each second cluster based on a preset hash algorithm. It should be noted that the preset hash algorithm can be a jhash hash algorithm or other types of hash algorithms, which are not specifically limited in the present embodiment of the application. The first node can select a suitable hash algorithm according to system requirements, as long as the hash value of the first cluster and the hash value of the second cluster are calculated using the same hash algorithm.
[0179] The first node can generate a hash ring based on the hash values corresponding to each second cluster. Figure 4a , Figure 4a A schematic diagram of a hash ring structure provided in an embodiment of the present application, wherein the data range of the hash ring is from 0 to 2 32 , each large circle in the hash ring is a hash value calculated based on the identifier of the second cluster, representing a second cluster. The second clusters are distributed at different positions on the hash ring according to their corresponding hash values. Figure 4a As shown, the hash values corresponding to the second cluster divide the entire hash ring into the same number of hash value intervals as the second cluster, and a hash value interval is a data range of a hash value on the hash ring.
[0180] Optionally, in one embodiment, the hash ring includes a first hash node and a second hash node, the first hash node corresponds to a target second cluster, the first hash node is an adjacent successor node of the second hash node on the hash ring, and the target hash interval is a hash interval between the first hash node and the second hash node.
[0181] In an embodiment of the present application, each hash value interval on the hash ring corresponds to a second cluster. In one possible implementation, for any hash value interval constituting the hash ring, the search is started from the hash value interval along the first direction, and the first second cluster found is determined as the second cluster corresponding to the hash value interval. In other words, if the hash value of the second cluster is the boundary hash value of the hash value interval in the first direction, then the second cluster can be considered to correspond to the hash value interval. Among them, the first direction is the positive direction of the hash ring, which can be clockwise or counterclockwise, and the embodiment of the present application does not specifically limit it. Exemplarily, Figure 4a The clockwise direction is selected as the first direction.
[0182] In the embodiment of the present application, the first node may determine Y hash values corresponding to X second clusters, where each second cluster corresponds to at least one hash value, X is a positive integer, and Y is a positive integer greater than or equal to X.
[0183] In one embodiment, Y is greater than X, that is, there is a second cluster, and the second cluster corresponds to multiple hash values.
[0184] In the embodiment of the present application, when the number of the second clusters is too small, the distribution of the second clusters on the hash ring will be too sparse. Figure 4b , Figure 4b A schematic diagram of a hash ring structure provided in an embodiment of the present application. When the number of second clusters is too small, the distribution of the second clusters on the hash ring will be too sparse. Therefore, the second clusters can correspond to multiple nodes on the hash ring, that is, virtual nodes are introduced. Figure 4c , Figure 4c A schematic diagram of a hash ring structure provided in an embodiment of the present application is shown in FIG. Figure 4c As shown in , the target second cluster can correspond to two hash nodes on the hash ring. By introducing virtual nodes, the second cluster can correspond to multiple nodes on the hash ring, and the distribution of the second cluster on the hash ring will not be too sparse. How to achieve the correspondence of the second cluster to multiple nodes on the hash ring by introducing virtual nodes can refer to the implementation in the existing solution, which will not be repeated here.
[0185] In an embodiment of the present application, the first node generates a hash ring based on Y hash values, wherein the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, the Y hash nodes divide the hash ring into Y hash value intervals, each hash node corresponds to a hash value interval, that is, each hash node corresponds to a second cluster, and a second cluster can correspond to multiple hash nodes on the hash ring.
[0186] In the embodiment of the present application, the first node may periodically receive the idle and busy status broadcast by other clusters, and periodically update the hash ring according to the idle and busy status broadcast by other clusters.
[0187] Optionally, in another embodiment, the first node may receive a hash table sent by the second cluster.
[0188] In an embodiment of the present application, the management node (e.g., the second node) in the second cluster can receive the idle and busy status broadcast by other clusters, and build a hash ring based on the idle and busy status broadcast by other clusters. For how the second cluster builds a hash ring based on the idle and busy status broadcast by other clusters, please refer to the description in the above embodiment, which will not be repeated here.
[0189] 303. The first node determines a corresponding target second cluster according to a hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to a target hash interval, the target hash interval is a hash value interval in at least one hash value interval, and the target hash interval corresponds to the target second cluster.
[0190] In an embodiment of the present application, after determining the hash value corresponding to the first cluster and obtaining the hash ring generated based on the hash value of the second cluster, the first node can determine the corresponding target second cluster from the hash ring according to the hash value corresponding to the first cluster.
[0191] In an embodiment of the present application, since each hash value interval on the hash ring corresponds to a second cluster, the first node can determine that the hash value interval to which the hash value corresponding to the first cluster belongs on the hash ring is the target hash interval, and determine that the second cluster corresponding to the target hash interval is the target second cluster.
[0192] Reference Figure 4d , Figure 4d A schematic diagram of a hash ring structure provided in an embodiment of the present application is shown in FIG. Figure 4d As shown in the figure, the hash ring includes: six hash nodes {hash node 1, hash node 3, hash node 4, hash node 6, hash node 8, hash node 10}, wherein hash node 3 and hash node 8 correspond to the second cluster 1, hash node 1 and hash node 4 correspond to the second cluster 2, and hash node 6 and hash node 10 correspond to the second cluster 3.
[0193] The hash value interval between hash node 1 and hash node 3 corresponds to the second cluster 1, the hash value interval between hash node 3 and hash node 4 corresponds to the second cluster 2, the hash value interval between hash node 4 and hash node 6 corresponds to the second cluster 3, the hash value interval between hash node 6 and hash node 8 corresponds to the second cluster 1, the hash value interval between hash node 8 and hash node 10 corresponds to the second cluster 3, and the hash value interval between hash node 10 and hash node 1 corresponds to the second cluster 2.
[0194] The idle cluster a includes two subclusters {first cluster a1, first cluster a2}, and the idle cluster b includes two subclusters {first cluster b1, first cluster b2}.
[0195] The distribution of each first cluster {first cluster a1, first cluster a2, first cluster b1, first cluster b2} on the hash ring is as shown in Figure 4, wherein the hash value corresponding to the first cluster a1 belongs to the hash value interval between hash node 8 and hash node 6, the hash value corresponding to the first cluster a2 belongs to the hash value interval between hash node 4 and hash node 10, the hash value corresponding to the first cluster b1 belongs to the hash value interval between hash node 1 and hash node 3, and the hash value corresponding to the first cluster b2 belongs to the hash value interval between hash node 4 and hash node 10.
[0196] Combined with the distribution of the above-mentioned first clusters in the hash ring, the first node in the idle cluster a can determine that the first cluster a1 corresponds to the second cluster 6, the first node in the idle cluster a can determine that the first cluster a2 corresponds to the second cluster 4, the first node in the idle cluster b can determine that the first cluster b1 corresponds to the second cluster 3, and the first node in the idle cluster b can determine that the first cluster b2 corresponds to the second cluster 4.
[0197] 304. The first node establishes an association relationship between a first cluster and a target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster.
[0198] In an embodiment of the present application, after the first node determines the corresponding target second cluster according to the hash value corresponding to the first cluster, the first node can send the identifier of the first cluster to the target second cluster. Specifically, after the first node determines the corresponding target second cluster according to the hash value corresponding to the first cluster, the first node can send a resource allocation indication to the management node (second node) in the target second cluster, and the resource allocation indication includes the identifier of the first cluster. The resource allocation indication can indicate that the target second node is allowed to apply for resources from the first cluster.
[0199] Optionally, in an embodiment, the first node may also send the idle amount of resources of the first cluster to the target second cluster.
[0200] Specifically, the first node may also send the idle amount of CPU resources and the idle amount of memory resources of the first cluster to the target second cluster.
[0201] On the one hand, the first node can determine the target second cluster corresponding to the first cluster through the distribution of the hash value corresponding to the first cluster on the hash ring (generated according to the hash value corresponding to the second cluster), and establish an association relationship between the target second cluster and the first cluster. Since the distribution of the hash value corresponding to the first cluster and the hash nodes corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined, each idle cluster is only allowed to be borrowed from a fixed empty cluster. Therefore, when the target second cluster needs to borrow the idle resources of the first cluster, it is not necessary to randomly send a resource query request to the selected idle cluster and borrow resources after receiving the return. It can directly borrow resources from the first cluster, reducing the delay overhead of one round trip of information.
[0202] On the other hand, since the corresponding relationship of resource secondment is determined based on the corresponding relationship of the hash value of the first cluster on the hash ring generated based on the busy cluster, the corresponding relationship is unique. Therefore, the idle cluster can only borrow resources from the corresponding busy cluster on the hash ring. Therefore, there will be no secondment conflict caused by multiple busy clusters concurrently borrowing resources from the same idle cluster.
[0203] On the other hand, the first node divides the multiple computing nodes of the idle cluster into multiple sub-clusters, and then can borrow resources from other busy clusters in units of sub-clusters, so that the idle resources in the idle cluster can be borrowed relatively evenly.
[0204] On the other hand, when the number of second clusters is too small, the distribution of the second clusters on the hash ring will be too sparse. Therefore, the second cluster (for example, the target second cluster) can correspond to multiple nodes on the hash ring, that is, virtual nodes are introduced, so that the situation where one second cluster corresponds to multiple first clusters will not occur due to the overly sparse distribution of the second clusters on the hash ring, thereby increasing the balance of resource allocation.
[0205] In an embodiment of the present application, the first node determines a hash value corresponding to the first cluster; the first node obtains a hash ring, the hash ring includes at least one hash value interval, and each hash value interval corresponds to a second cluster; the first node determines the corresponding target second cluster according to the hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to the target hash interval, the target hash interval is a hash value interval in at least one hash value interval, and the target hash interval corresponds to the target second cluster; the first node establishes an association relationship between the first cluster and the target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster. Through the above method, on the one hand, the first node can determine the target second cluster corresponding to the first cluster through the distribution of the hash value corresponding to the first cluster on the hash ring (generated according to the hash value corresponding to the second cluster), and establish the association relationship between the target second cluster and the first cluster. Since the distribution of the hash value corresponding to the first cluster and the hash node corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined, each idle cluster is only allowed to be borrowed by a fixed empty cluster. Therefore, when the target second cluster needs to borrow the idle resources of the first cluster, it is not necessary to randomly send a resource query request to the selected idle cluster, and then borrow resources after receiving the return. Resources can be directly borrowed from the first cluster, reducing the time delay overhead of one information round trip. Moreover, since the corresponding relationship of resource borrowing is determined based on the corresponding relationship of the hash value of the first cluster on the hash ring generated based on the busy cluster, the corresponding relationship is unique, so the idle cluster can only be borrowed by the corresponding busy cluster on the hash ring. Therefore, there will be no borrowing conflict caused by multiple busy clusters borrowing resources from the same idle cluster concurrently.
[0206] It should be noted that, in another embodiment, the first node may determine the corresponding target second cluster not based on the distribution of the hash value corresponding to the first cluster on the hash ring, but by random allocation or sequential allocation.
[0207] Specifically, the first node may randomly select a second cluster from multiple second clusters in the distributed system as the target second cluster.
[0208] Specifically, at least one second cluster may be sorted, and multiple subclusters (including the first cluster) may be sequentially mounted to the corresponding second cluster in a preset order (i.e., an association relationship between each subcluster and the second cluster is established). Then, the first node may also determine the corresponding target second cluster in the above manner.
[0209] It should be understood that the actual application may not be limited to the above implementation method. As long as the distributed system determines a fixed resource allocation relationship (the first node establishes an association relationship with a certain target second cluster) when allocating resource borrowing relationships, it can be realized. When the busy cluster conducts resource borrowing, it does not need to randomly send a resource query request to the selected idle cluster, and after receiving the return, it conducts resource borrowing. It can directly borrow resources from the first cluster, reducing the time delay overhead of one information round trip. Moreover, since the corresponding relationship of resource borrowing is determined based on the corresponding relationship of the hash value of the first cluster on the hash ring generated based on the busy cluster, the corresponding relationship is unique, so the idle cluster can only borrow resources from the corresponding busy cluster on the hash ring. Therefore, there will be no borrowing conflicts caused by multiple busy clusters borrowing resources from the same idle cluster concurrently.
[0210] Reference Figure 5 , Figure 5 A schematic diagram of an embodiment of a resource secondment method provided in an embodiment of the present application, such as Figure 5 As shown in the figure, the resource borrowing method provided by the present application includes:
[0211] 501. A second node determines a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and a hash value corresponding to the first cluster belongs to the target hash value interval.
[0212] In the embodiment of the present application, the second node belongs to the target second cluster, wherein the target second cluster is a busy cluster. Specifically, the second node may receive a resource allocation indication sent by the first node, the resource allocation indication including an identifier of the first cluster, and the resource allocation indication may indicate that the second node may borrow idle resources of the first cluster. For how the first node sends the identifier of the first cluster to the target second cluster, reference may be made to the above embodiment, which will not be repeated here.
[0213] In the embodiment of the present application, the second node may receive identifiers of multiple sub-clusters, that is, there are multiple clusters associated with the target second cluster.
[0214] In this embodiment, the second node may determine that one of a plurality of clusters having an association relationship with the target second cluster is the first cluster.
[0215] Optionally, in an embodiment, the second node may also receive the idle amount of resources of each sub-cluster in the multiple sub-clusters.
[0216] 502. The second node receives task data.
[0217] In this embodiment of the present application, the second node can receive the task data.
[0218] Optionally, in one embodiment, after receiving the task data, the second node can determine the resource demand of the received task data, and judge the resource idleness of the idle nodes in the busy cluster (target second cluster) to which it belongs. If the resource idleness of the idle nodes in the busy cluster to which it belongs is greater than or equal to the resource demand of the task data, it is equivalent to that the second node can determine that the local cluster has sufficient resource idleness to process the task data. If the resource idleness of the idle nodes in the busy cluster to which it belongs is less than the resource demand of the task data, it is equivalent to that the second node can determine that the local cluster does not have sufficient resource idleness to process the task data.
[0219] Specifically, if the idle CPU resource amount of the idle nodes in the busy cluster to which it belongs is greater than or equal to the CPU resource requirement of the task data, and the idle memory resource amount of the idle nodes in the busy cluster to which it belongs is greater than or equal to the memory resource requirement of the task data, it is equivalent to that the second node can determine that the local cluster has sufficient idle resources to process the task data. If the idle CPU resource amount of the idle nodes in the busy cluster to which it belongs is less than the CPU resource requirement of the task data, and the idle memory resource amount of the idle nodes in the busy cluster to which it belongs is less than the memory resource requirement of the task data, it is equivalent to that the second node can determine that the local cluster does not have sufficient idle resources to process the task data.
[0220] 503. The second node sends a first resource secondment request to the first node, where the first resource secondment request is used to instruct the first node to allocate the task data to the first cluster for processing.
[0221] If the second node determines that the local cluster does not have sufficient free resources to process the task data, it needs to borrow resources from other clusters to execute the task data.
[0222] In an embodiment of the present application, the second node may send a first resource secondment request to the first node, and the first secondment request may include task data and an identifier of the first cluster. Accordingly, after receiving the first resource secondment request, the first node may assign the task data included therein to the first cluster for processing.
[0223] In one embodiment, the second node may receive identifiers of multiple subclusters and the idle amounts of resources of the multiple subclusters. At this time, the second node needs to determine a cluster as a resource loan object. Next, it is discussed how the second node determines the first cluster as a resource loan object from the multiple subclusters.
[0224] In an embodiment of the present application, the second node can maintain a mapping table, which stores the identifiers of multiple subclusters and the corresponding resource idle amounts. The second node can search the mapping table for a cluster set whose resource idle amounts in the multiple subclusters are greater than or equal to the resource demand amount of the task data, and obtain a subcluster set {slices 1, slices 2, ..., slices n} that meets the resource demand amount, where slices n represents the identifier of the nth subcluster.
[0225] After obtaining the subcluster set {slices 1, slices 2, ..., slices n}, the second node can prioritize the multiple subclusters in the subcluster set, where the priority ranking indicator is the degree of proximity between the resource idle amount of the subcluster and the resource demand amount of the task data. The closer the proximity, the higher the priority of the corresponding subcluster. The second node can select the subcluster with the highest priority to initiate the first secondment request.
[0226] Exemplarily, the second node may maintain the following mapping table:
[0227]
[0228] The second node receives the task data, and determines that the CPU resource requirement corresponding to the task data is 0.6, and the memory resource requirement is 0.65.
[0229] The second node may search in the mapping table for a cluster set whose resource idleness in the plurality of first clusters is greater than or equal to the resource requirement of the task data, and obtain a first cluster set {slices6, slices7} that meets the resource requirement.
[0230] The second node can determine the first cluster that is closest to the resource requirement of the task data according to the following formula:
[0231]
[0232] Among them, α represents the weight parameter of CPU, β represents the weight parameter of memory, Indicates the idle amount of CPU resources of the first cluster i registered on the second cluster j, represents the idle amount of CPU resources required by the task data determined in the second cluster j, represents the amount of free memory resources of the first cluster i registered on the second cluster j, represents the amount of free memory resources required by the task data determined in the second cluster j. For example, α is 0.6 and β is 0.4.
[0233] The closeness of slices 6 to the task data resource request is:
[0234] (0.65-0.6)*0.6+(0.75-0.65)*0.4=0.07
[0235] The closeness of slices 7 to the task data resource request is:
[0236] (0.74-0.6)*0.6+(0.7-0.65)*0.4=0.104
[0237] The second node may determine that the idle amount of resources of the first cluster corresponding to slices 6 is closest to the resource demand of the task data, and initiate a first secondment request to the first cluster corresponding to slices 6 .
[0238] It should be noted that the above description is only an illustration, and the specific parameter selection is only an illustration, and this application does not limit it.
[0239] Through the above method, the second node determines that among the resource idleness of multiple clusters associated with the target second cluster, the cluster corresponding to the resource idleness with the smallest difference with the resource demand of the task data is the first cluster, thereby improving resource utilization during resource borrowing.
[0240] Optionally, in an embodiment, the second node may determine that the first cluster is in a resource-borrowable state based on receiving an identifier of the first cluster sent by the first node.
[0241] The second node may determine that resources of the first cluster are not available for borrowing based on sending a resource borrowing request to the first node.
[0242] In an embodiment of the present application, after the second node sends a resource loan request to the first node, it is equivalent to occupying the idle resources of the first cluster, and it can be determined that the first cluster is in a state where resources cannot be loaned. Optionally, the second node can mark the resource loan state of the first cluster as a resource cannot be loaned in the mapping table. Correspondingly, the first node can also determine that the first cluster is in a state where resources cannot be loaned, that is, it is determined that the first cluster cannot provide available resources for other busy clusters, thereby ensuring resource locking and achieving conflict-free scheduling of cross-cluster resources.
[0243] In the embodiment of the present application, after processing the task data, the first cluster may return the processing result to the first node, and the first node sends the processing result to the second node.
[0244] In an embodiment of the present application, the second node determines a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and the hash value corresponding to the first cluster belongs to the target hash value interval; the second node receives task data; the second node sends a first resource loan request to the first node, and the first loan request is used to instruct the first node to assign the task data to the first cluster for processing. Through the above method, on the one hand, when there are multiple first clusters in a distributed system, each first node determines the target second cluster corresponding to the first cluster by the distribution of the hash value corresponding to the first cluster on the hash ring generated according to the hash value corresponding to the second cluster, and indicates that the target second cluster can borrow the idle resources of the first cluster. Since the distribution of the hash value corresponding to the first cluster and the hash node corresponding to the second cluster on the hash ring based on the consistent hashing algorithm is determined and relatively balanced, when the target second cluster needs to borrow the idle resources of the first cluster, it is not necessary to randomly send a resource query request to the selected idle cluster, and then borrow resources after receiving the return, but directly determine the first cluster that needs to borrow resources, and send the first resource loan request to the first node, reducing the delay overhead of one round trip of information. Moreover, since the corresponding relationship of resource secondment is determined based on the corresponding relationship of the hash value of the first cluster on the hash ring generated based on the busy cluster, the corresponding relationship is unique. Therefore, the idle cluster can only borrow resources from the corresponding busy cluster on the hash ring. Therefore, there will be no secondment conflict caused by multiple busy clusters concurrently borrowing resources from the same idle cluster.
[0245] Reference Figure 6 , Figure 6 A schematic diagram of an embodiment of a resource secondment method provided in an embodiment of the present application, such as Figure 5 As shown in the figure, the resource borrowing method provided by the present application includes:
[0246] 601. A second node determines a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and a hash value corresponding to the first cluster belongs to the target hash value interval.
[0247] The detailed description of step 601 can be found in Figure 5 The specific description of step 501 in the corresponding embodiment will not be repeated here.
[0248] 602. The second node receives the resource demand of the task data sent by the third node.
[0249] In an embodiment of the present application, after receiving the task data, the third node can determine the resource requirement of the received task data and judge the resource free amount of the idle nodes in the busy cluster to which it belongs. If the resource free amount of the idle nodes in the busy cluster to which it belongs is less than the resource requirement of the task data, the third node determines that the local cluster does not have sufficient resource free amount to process the task data.
[0250] The third node can traverse the mapping table that stores the identifiers of multiple subclusters and the corresponding resource idle amounts, and search the mapping table for a cluster set whose resource idle amounts in the multiple subclusters are greater than or equal to the resource demand amounts of the task data. If the third node determines that the resource idle amounts of each subcluster in the multiple subclusters are less than the resource demand amounts of the task data, or determines that the multiple subclusters are in a state where resources cannot be borrowed, the third node needs to borrow resources from other busy clusters.
[0251] Specifically, the third node can determine the adjacent subsequent node of the hash node corresponding to the third node along the first direction from the maintained hash ring, and the adjacent subsequent node corresponds to the second cluster. The third node can send the resource demand of the task data to the management node (second node) of the second cluster. Specifically, the third node can send the resource demand of the task data to the second node.
[0252] Optionally, in one embodiment, the third node can determine multiple subsequent nodes of the hash node corresponding to the third node from the maintained hash ring along the first direction, and the multiple subsequent nodes correspond to multiple second clusters. The third node can send the resource demand of the task data to the management nodes (second nodes) of the multiple second clusters.
[0253] Correspondingly, the second node can receive the resource demand of the task data sent by the third node.
[0254] 603. Based on the idle amount of resources of the first cluster being greater than or equal to the required amount of resources, the second node sends a third resource borrowing request to the third node, where the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster.
[0255] In an embodiment of the present application, after receiving the resource demand, the second node can search the mapping table maintained by itself, and determine the first cluster whose resource idle amount is greater than or equal to the resource demand, and send a third resource borrowing request to the third node, the third resource borrowing request including the identifier of the first cluster, and the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster.
[0256] Optionally, in an embodiment, the second node may determine that the idle amount of resources of the multiple subclusters is greater than or equal to the required amount of resources, and the second node may send the identifiers of the determined multiple subclusters to the third node, wherein the first cluster is one of the multiple subclusters.
[0257] Optionally, in an embodiment, the second node may determine that the idle amount of resources of the multiple subclusters is greater than or equal to the required amount of resources, randomly select a portion of subclusters from the determined multiple subclusters, and send identifiers of the portion of subclusters to the third node.
[0258] Optionally, in an embodiment, the second node may receive a second resource secondment request sent by a third node, where the second resource secondment request includes the task data, and the second secondment request is used to instruct the second node to allocate the task data to the first cluster for processing.
[0259] In the embodiment of the present application, after the third node receives the identifier of the first cluster sent by the second node, it is equivalent to obtaining the identifier of the first cluster that can perform resource secondment from the second node.
[0260] Optionally, in one embodiment, the third node may receive identifiers of multiple subclusters sent by multiple second nodes, or the third node may receive identifiers of multiple subclusters sent by a second node and then need to determine one cluster among the multiple subclusters as a resource secondment object. As to how the third node determines a first cluster among multiple first clusters as a resource secondment object, reference may be made to the description of how the second node determines a first cluster among multiple subclusters as a resource secondment object in the above embodiment, and no further details will be given here.
[0261] If the third node determines that the first cluster among multiple subclusters is the resource secondment object, accordingly, the second node can receive a second resource secondment request sent by the third node, the second resource secondment request includes the task data and the identifier of the first cluster, and the second secondment request is used to instruct the second node to allocate the task data to the first cluster for processing.
[0262] In the embodiment of the present application, the second node may send the task data and the identifier of the first cluster to the first node.
[0263] The first node may distribute the task data to the first cluster for processing.
[0264] Optionally, in another embodiment, after receiving the third resource secondment request sent by the second node, the third node may not send a second resource secondment request to the second node to instruct the second node to allocate the task data to the first cluster processing, but may directly send a first resource secondment request to the first node, and the first secondment request is used to instruct the first node to allocate the task data to the first cluster processing, thereby reducing the forwarding overhead of one step of information.
[0265] Reference Figure 7 , Figure 7 A schematic diagram of the structure of a first management node 700 provided in an embodiment of the present application is shown in FIG. Figure 7 As shown in FIG. 7 , the first management node 700 includes:
[0266] Processing module 701 is used to determine a hash value corresponding to a first cluster; obtain a hash ring, the hash ring includes at least one hash value interval, each hash value interval corresponds to a second cluster; determine a corresponding target second cluster according to the hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to a target hash interval, the target hash interval is a hash value interval in the at least one hash value interval, and the target hash interval corresponds to the target second cluster;
[0267] The transceiver module 702 is configured to establish an association relationship between a first cluster and a target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster.
[0268] Optionally, in one embodiment, the hash ring includes a first hash node and a second hash node, the first hash node corresponds to the target second cluster, the first hash node is an adjacent successor node of the second hash node on the hash ring, and the target hash interval is a hash interval between the hash value of the first hash node and the hash value of the second hash node.
[0269] Optionally, in an embodiment, the processing module 701 is further configured to divide an idle cluster including multiple computing nodes into multiple subclusters, and the first cluster is one of the multiple subclusters.
[0270] Optionally, in one embodiment, the multiple subclusters include a third subcluster and a fourth subcluster, the third subcluster is a subcluster with the largest amount of idle resources among the multiple subclusters, the fourth subcluster is a cluster with the smallest amount of idle resources among the multiple subclusters, and the absolute value of the difference between the idle amount of resources of the third subcluster and the idle amount of resources of the fourth subcluster is less than a first threshold.
[0271] Optionally, in an embodiment, an absolute value of a difference between an idle resource amount of each sub-cluster in the multiple sub-clusters and a preset idle resource amount is less than or equal to a second threshold, and the preset idle resource amount is related to a historical resource request amount.
[0272] Optionally, in one embodiment, the transceiver module 702 is further used for:
[0273] receiving a resource secondment request sent by the target second cluster, wherein the resource secondment request includes task data and an identifier of the first cluster;
[0274] The task data is sent to the first cluster according to the identifier of the first cluster.
[0275] Optionally, in one embodiment, the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, and the corresponding hash values of the Y hash nodes and the hash value corresponding to the first cluster are generated according to the same hash algorithm, and Y is a positive integer.
[0276] Optionally, in one embodiment, the processing module 701 is further used to determine Y hash values corresponding to X second clusters, wherein each second cluster corresponds to at least one hash value, X is a positive integer, and Y is a positive integer greater than or equal to X; generate the hash ring according to the Y hash values, wherein the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, the Y hash nodes divide the hash ring into Y hash value intervals, and each hash node corresponds to a hash value interval.
[0277] Optionally, in an embodiment, the transceiver module 702 is further configured to receive the hash ring sent by the second cluster.
[0278] Optionally, in an embodiment, the transceiver module 702 is further configured to send the idle amount of resources of the first cluster to the target second cluster.
[0279] Reference Figure 8 , Figure 8 A schematic diagram of the structure of a second management node 800 provided in an embodiment of the present application is shown in FIG. Figure 8 As shown in FIG. 8 , the second management node 800 includes:
[0280] Processing module 801 is used to determine a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and the hash value corresponding to the first cluster belongs to the target hash value interval;
[0281] The transceiver module 802 is used to receive task data; and send a first resource secondment request to the first node, where the first resource secondment request is used to instruct the first node to allocate the task data to the first cluster for processing.
[0282] Optionally, in an embodiment, the processing module 801 is further configured to send a resource borrowing request to the first node based on the transceiver module, and determine that the first cluster is in a resource non-borrowing state.
[0283] Optionally, in an embodiment, there are multiple clusters associated with the target second cluster, and the processing module 801 is specifically configured to determine that one of the multiple clusters associated with the target second cluster is the first cluster.
[0284] Optionally, in an embodiment, the processing module 801 is specifically configured to determine that among the idle resources of multiple clusters associated with the target second cluster, the cluster corresponding to the idle resource amount having the smallest difference with the resource demand amount of the task data is the first cluster.
[0285] Optionally, in one embodiment, the transceiver module 802 is also used to receive the resource requirement of the task data sent by the third node, and based on the resource free amount of the first cluster being greater than or equal to the resource requirement, send the identifier of the first cluster and the resource free amount of the first cluster to the third node.
[0286] Optionally, in one embodiment, the transceiver module 802 is specifically used to receive a second resource secondment request sent by the third node, the second resource secondment request includes the task data, and the second secondment request is used to instruct the second node to allocate the task data to the first cluster for processing.
[0287] Reference Figure 8 , Figure 8 A schematic diagram of the structure of a second management node 800 provided in an embodiment of the present application is shown in FIG. Figure 8 As shown in FIG. 8 , the second management node 800 includes:
[0288] The transceiver module 802 is used to receive the resource demand of the task data sent by the third node;
[0289] Processing module 801 is used to determine a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and the hash value corresponding to the first cluster belongs to the target hash value interval;
[0290] The transceiver module 802 is further used to send a third resource borrowing request to the third node based on the idle amount of resources of the first cluster being greater than or equal to the required amount of resources, wherein the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster.
[0291] Optionally, in an embodiment, there are multiple clusters associated with the target second cluster, and the processing module is specifically configured to determine that one of the multiple clusters associated with the target second cluster is the first cluster.
[0292] Reference Fig. 9 , Fig. 9 A schematic diagram of the structure of a third management node 900 provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown in FIG. 1 , the third management node 900 includes:
[0293] The transceiver module 901 is used to receive task data, send the resource demand of the task data to the second node, receive a third resource borrowing request sent by the second node, and the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to the target hash value interval in the hash ring, the hash value corresponding to the first cluster belongs to the target hash value interval, and the resource idle amount of the first cluster is greater than or equal to the resource demand, and send a first resource borrowing request to the first node, and the first borrowing request is used to indicate the first node to allocate the task data to the first cluster for processing.
[0294] Optionally, in one embodiment, the transceiver module 901 is specifically used to send the resource demand of the task data to multiple nodes, the second node is one of the multiple nodes, and receives a third resource borrowing request sent by the multiple nodes, the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
[0295] Optionally, in an embodiment, the third management node 900 further includes:
[0296] The processing module 902 is configured to determine that the subcluster corresponding to the idle resource amount having the smallest difference with the resource demand amount of the task data among the idle resource amounts of the multiple subclusters is the first cluster.
[0297] Fig.10A system example of a management node applicable to an embodiment of the present invention is described, wherein the management node can be any one of the first management node, the second management node and the third management node described in the above embodiment. Based on the system environment in this embodiment, the functions of each logic module of the management node in the previous embodiment can be implemented. This embodiment is only an example applicable to the present invention, and does not attempt to suggest any limitation on the function and structure of the management node provided by the present invention.
[0298] The embodiment of the present invention uses a general computer system environment as an example to illustrate the management node. As is well known, other hardware architectures applicable to the management node can also be used to implement similar functions. Including but not limited to, personal computers, service computers, multi-processor systems, microprocessor-based systems, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0299] Reference Fig.10 , the system implementing the present invention includes a general computing device in the form of a management node 1000. In combination with the aforementioned system scenario and architecture, the management node described in this embodiment can be the execution subject of the embodiment of the present invention described in the aforementioned scenario and architecture. For example, it can be a master node, a management node, or any node in a decentralized architecture.
[0300] Elements of the management node 1000 may include, but are not limited to, a processing unit 1020, a system memory 1030, and a system bus 1010. The system bus couples various system elements including the system memory to the processing unit 1020. The system bus 1010 may be any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, and a local bus using a bus structure. The bus structure may include an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Extended ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0301] The management node 1000 generally includes a variety of management node readable media. The management node readable media can be any media that the management node 1000 can effectively access, and includes volatile or non-volatile media, and removable or non-removable media. For example, but not limited to, the management node readable media can include management node storage media and communication media. Any method or technology for managing management node readable instructions, data structures, program modules or other data information is implemented. The management node storage medium includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, or hard disk storage, solid state drive storage, optical disk storage, disk box, disk storage or other storage device, or any other medium that can store the required information and can be accessed by the management node 1000. The communication medium generally includes embedded computer readable instructions, data structures, program modules or other data in a modular data signal (for example, a carrier or other transmission mechanism), and also includes any information transmission medium. The term "modular data signal" refers to a signal that has one or more signal feature groups or is changed by encoding the information in the signal. For example, but not limitation, communication media include wired media such as a wired network or direct wired connection, and wireless media such as acoustic, RF infrared and other wireless media. Any combination of the above should also be included within the scope of management node readable media.
[0302] System memory 1030 includes management node storage media, which may be volatile and non-volatile memory, such as read-only memory (ROM) 1031 and random access memory (RAM) 1032. Basic input / output system 1033 (BIOS) is typically stored in ROM 1031 and contains basic routines that facilitate the transfer of information between components in management node 1010. RAM 1032 typically contains data and / or program modules that can be immediately accessed and / or acted upon by processing unit 1020. For example, but not limited to, Fig.10 Operating system 1034 , application programs 1035 , other program modules 1036 , and program data 1037 are illustrated.
[0303] The management node 1000 may also include other removable / non-removable, volatile / non-volatile management node storage media. This is just an example. Fig.10The hard disk storage 1041 is described, which can be a non-detachable and non-volatile readable and writable magnetic medium; the external storage 1051 can be various types of detachable and non-volatile external storage, such as an optical disk, a magnetic disk, a flash memory or a mobile hard disk, etc. The hard disk storage 1041 is generally connected to the system bus 1010 through a non-detachable storage interface (for example, interface 1040), and the external storage is generally connected to the system bus 1010 through a detachable storage interface (for example, interface 1060). The above-mentioned and Fig.10 The illustrated drives and their associated management node storage media provide storage for management node readable instructions, data structures, program modules, and other data for the management node 1000. For example, hard disk drive 1041 is illustrated for storing an operating system 1042, application programs 1043, other application programs 1044, and program data 1045. It should be noted that these elements may be the same as or different from operating system 1034, application programs 1035, other program modules 1036, and program data 1037.
[0304] In this embodiment, the method in the aforementioned embodiment or the function of the logic module in the previous embodiment can be performed by codes or readable instructions stored in the storage medium of the management node, and the processing unit 1020 reads the codes or readable instructions to execute the method.
[0305] The user can input commands and information to the management node 1000 through various input devices 1061. Various input devices are often connected to the processing unit 1020 through the user input interface 1060, which is coupled to the system bus, but can also be connected through other interfaces and bus structures, such as a parallel interface, or a universal serial port (USB). The display device 1091 can also be connected to the system bus 1010 through an interface (for example, a video interface 1090). In addition, the computing device 1000 may also include various peripheral output devices 1020, and the output devices can be connected through the output interface 10100, etc. The management node 1000 can be logically connected to one or more computing devices, such as a remote computer 1071. Remote computing nodes include management nodes, computing nodes, servers, routers, network PCs, equivalent devices or other general network nodes, and generally include many or all of the above-mentioned elements discussed in connection with the management node 1000. In combination with the aforementioned Figure 1 In the described architecture, the remote computing node can be a slave node, a computing node, or other management node. Fig.10The logical connection described in the description includes a local area network (LAN) and a wide area network (WAN), and may also include other networks. Through the logical connection, the management node can realize the interaction between the present invention and other subjects with other nodes. For example, task information and data can be transmitted through the logical link with the user, thereby obtaining the user's task data; resource data can be transmitted and task allocation commands can be transmitted through the logical link with the computing node, thereby realizing the acquisition of resource information of each node and the allocation of task data.
[0306] Reference Fig.11 , Fig.11 A schematic diagram of a cluster 1100 provided in an embodiment of the present application is shown in FIG. Fig.11 As shown in FIG. 1 , the cluster 1100 includes a plurality of computing nodes 1101, wherein the computing nodes 1101 provide the required resources for the task data to execute the task data, and the cluster 1100 further includes: Figure 7 The first management node 700 described in the corresponding embodiment.
[0307] Reference Fig.12 , Fig.12 A schematic diagram of a cluster structure provided in an embodiment of the present application is shown in FIG. Fig.12 As shown in FIG. 1 , the cluster 1200 includes a plurality of computing nodes 1201, wherein the computing nodes 1201 provide the required resources for the task data to execute the task data, and the cluster 1200 further includes: Figure 8 The second management node 800 described in the corresponding embodiment.
[0308] Reference Fig.13 , Fig.13 A schematic diagram of a cluster structure provided in an embodiment of the present application is shown in FIG. Fig.13 As shown in FIG. 1 , the cluster 1300 includes a plurality of computing nodes 1301, wherein the computing nodes 1301 provide the required resources for the task data to execute the task data, and the cluster 1300 further includes: Fig. 9 The third management node 900 described in the corresponding embodiment.
[0309] Reference Fig.14 , Fig.14 A structural diagram of a distributed system 1400 provided in an embodiment of the present application is shown in FIG. Fig.14 As shown in FIG. 1 , the distributed system 1400 includes Fig.11 The cluster 1100 and Fig.12 The cluster 1200 described in the corresponding embodiment.
[0310] Reference Fig.15 , Fig.15 A schematic diagram of a distributed system structure provided in an embodiment of the present application is shown in FIG. Fig.12 As shown in FIG. 1 , the distributed system 1500 includes Fig.11 The cluster 1100 described in the corresponding embodiment, Fig.12 The cluster 1200 and Fig.13 The cluster 1300 described in the corresponding embodiment.
[0311] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0312] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0313] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0314] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0315] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0316] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0317] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0318] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource allocation method, It is characterized in that The method comprises: The first node determines a hash value corresponding to the first cluster; the idle / busy state of the first cluster is idle; The first node obtains a hash ring, the hash ring includes at least one hash value interval, each hash value interval corresponds to a second cluster; the idle state of the second cluster is busy; The first node determines a corresponding target second cluster according to a hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to a target hash interval, the target hash interval is a hash value interval in the at least one hash value interval, and the target hash interval corresponds to the target second cluster; The first node establishes an association relationship between a first cluster and a target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster.
2. The method according to claim 1, It is characterized in that The hash ring includes a first hash node and a second hash node, the first hash node corresponds to the target second cluster, the first hash node is an adjacent successor node of the second hash node on the hash ring, and the target hash interval is a hash interval between a hash value of the first hash node and a hash value of the second hash node.
3. The method according to claim 1, It is characterized in that The method further comprises: The first node divides an idle cluster including a plurality of computing nodes into a plurality of subclusters, and the first cluster is one of the plurality of subclusters.
4. The method according to claim 3, It is characterized in that The multiple subclusters include a third subcluster and a fourth subcluster, the third subcluster is a subcluster with the largest amount of idle resources among the multiple subclusters, the fourth subcluster is a cluster with the smallest amount of idle resources among the multiple subclusters, and an absolute value of a difference between an amount of idle resources of the third subcluster and an amount of idle resources of the fourth subcluster is less than a first threshold.
5. The method according to claim 3, It is characterized in that An absolute value of a difference between an idle resource amount of each of the multiple subclusters and a preset idle resource amount is less than or equal to a second threshold, and the preset idle resource amount is related to a historical resource request amount.
6. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: The first node receives a first resource borrowing request sent by the target second cluster, where the first resource borrowing request includes task data and an identifier of the first cluster; The first node sends the task data to the first cluster according to the identifier of the first cluster.
7. The method according to any one of claims 1 to 5, It is characterized in that The hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, and the hash values corresponding to the Y hash nodes and the hash value corresponding to the first cluster are generated according to the same hash algorithm, and Y is a positive integer.
8. The method according to any one of claims 1 to 5, It is characterized in that The first node obtains the hash ring, including: The first node determines Y hash values corresponding to X second clusters, wherein each second cluster corresponds to at least one hash value, X is a positive integer, and Y is a positive integer greater than or equal to X; The first node generates the hash ring according to the Y hash values, wherein the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, the Y hash nodes divide the hash ring into Y hash value intervals, and each hash node corresponds to a hash value interval.
9. The method according to any one of claims 1 to 5, It is characterized in that The first node obtains the hash ring, including: The first node receives the hash ring sent by the second cluster.
10. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: The first node sends the idle amount of resources of the first cluster to the target second cluster.
11. A resource loan method, It is characterized in that The method comprises: The second node determines a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in the hash ring, and the hash value corresponding to the first cluster belongs to the target hash value interval; the idle and busy status of the first cluster is idle; and the idle and busy status of the target second cluster is busy; The second node receives task data; The second node sends a first resource borrowing request to the first node, where the first resource borrowing request is used to instruct the first node to allocate the task data to the first cluster for processing.
12. The method according to claim 11, It is characterized in that The method further comprises: The second node determines that resources of the first cluster are not available for borrowing based on sending a first resource borrowing request to the first node.
13. The method according to claim 12, It is characterized in that The method further comprises: The second node receives the idle amount of resources of the first cluster sent by the first node.
14. The method according to any one of claims 11 to 13, It is characterized in that There are multiple clusters associated with the target second cluster, and the second node determines the first cluster associated with the target second cluster, including: The second node determines, as the first cluster, one of a plurality of clusters associated with the target second cluster.
15. The method according to claim 14, It is characterized in that The second node determines that one of the plurality of clusters having an association relationship with the target second cluster is the first cluster, including: The second node determines that, among the idle resources of a plurality of clusters associated with the target second cluster, the cluster corresponding to the idle resource amount having the smallest difference with the resource demand amount of the task data is the first cluster.
16. The method according to any one of claims 11 to 13, It is characterized in that The method further comprises: The second node receives the resource demand of the task data sent by the third node; Based on the fact that the idle amount of resources of the first cluster is greater than or equal to the required amount of resources, the second node sends the identifier of the first cluster and the idle amount of resources of the first cluster to the third node.
17. The method according to claim 16, It is characterized in that The second node receiving the task data includes: The second node receives a second resource borrowing request sent by the third node, where the second resource borrowing request includes the task data, and the second resource borrowing request is used to instruct the second node to allocate the task data to the first cluster for processing.
18. A resource loan method, It is characterized in that include: The second node receives the resource demand of the task data sent by the third node; The second node determines a first cluster associated with a target second cluster, wherein the second node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in the hash ring, and the hash value corresponding to the first cluster belongs to the target hash value interval; the idle and busy status of the first cluster is idle; and the idle and busy status of the target second cluster is busy; Based on the fact that the idle amount of resources of the first cluster is greater than or equal to the required amount of resources, the second node sends a third resource borrowing request to the third node, where the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster.
19. The method according to claim 18, It is characterized in that There are multiple clusters associated with the target second cluster, and the second node determines the first cluster associated with the target second cluster, including: The second node determines, as the first cluster, one of a plurality of clusters associated with the target second cluster.
20. A resource loan method, It is characterized in that include: The third node receives the task data; The third node sends the resource demand of the task data to the second node; The third node receives a third resource borrowing request sent by the second node, where the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster, wherein the second node belongs to a target second cluster, the target second cluster corresponds to a target hash value interval in the hash ring, the hash value corresponding to the first cluster belongs to the target hash value interval, and the idle amount of resources of the first cluster is greater than or equal to the resource demand; the idle-busy state of the first cluster is idle; and the idle-busy state of the target second cluster is busy; The third node sends a first resource borrowing request to the first node, where the first resource borrowing request is used to instruct the first node to allocate the task data to the first cluster for processing.
21. The method according to claim 20, It is characterized in that The third node sends the resource demand of the task data to the second node, including: The third node sends the resource demand of the task data to a plurality of nodes, and the second node is one of the plurality of nodes; The third node receiving the third resource borrowing request sent by the second node includes: The third node receives a third resource borrowing request sent by the multiple nodes, where the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
22. The method according to claim 21, It is characterized in that The method further comprises: The third node determines that the sub-cluster corresponding to the idle resource amount having the smallest difference with the resource demand amount of the task data among the idle resource amounts of the multiple sub-clusters is the first cluster.
23. A first management node, It is characterized in that The first management node includes: A processing module, configured to determine a hash value corresponding to a first cluster; obtain a hash ring, the hash ring comprising at least one hash value interval, each hash value interval corresponding to a second cluster; determine a corresponding target second cluster according to the hash value corresponding to the first cluster, wherein the hash value corresponding to the first cluster belongs to a target hash interval, the target hash interval is a hash value interval in the at least one hash value interval, and the target hash interval corresponds to the target second cluster; the idle and busy status of the first cluster is idle; the idle and busy status of the second cluster is busy; The transceiver module is used to establish an association relationship between a first cluster and a target second cluster, wherein the target second cluster that has established an association relationship with the first cluster is allowed to apply for resources from the first cluster.
24. The first management node according to claim 23, It is characterized in that The hash ring includes a first hash node and a second hash node, the first hash node corresponds to the target second cluster, the first hash node is an adjacent successor node of the second hash node on the hash ring, and the target hash interval is a hash interval between a hash value of the first hash node and a hash value of the second hash node.
25. The first management node according to claim 23, It is characterized in that The processing module is further used to divide the idle cluster including multiple computing nodes into multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
26. The first management node according to claim 25, It is characterized in that The multiple subclusters include a third subcluster and a fourth subcluster, the third subcluster is a subcluster with the largest amount of idle resources among the multiple subclusters, the fourth subcluster is a cluster with the smallest amount of idle resources among the multiple subclusters, and an absolute value of a difference between an amount of idle resources of the third subcluster and an amount of idle resources of the fourth subcluster is less than a first threshold.
27. The first management node according to claim 25, It is characterized in that An absolute value of a difference between an idle resource amount of each of the multiple subclusters and a preset idle resource amount is less than or equal to a second threshold, and the preset idle resource amount is related to a historical resource request amount.
28. The first management node according to any one of claims 23 to 27, It is characterized in that The transceiver module is also used for: receiving a first resource secondment request sent by the target second cluster, wherein the first resource secondment request includes task data and an identifier of the first cluster; The task data is sent to the first cluster according to the identifier of the first cluster.
29. The first management node according to any one of claims 23 to 27, It is characterized in that The hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, and the hash values corresponding to the Y hash nodes and the hash value corresponding to the first cluster are generated according to the same hash algorithm, and Y is a positive integer.
30. The first management node according to any one of claims 23 to 27, It is characterized in that The processing module is further used to determine Y hash values corresponding to X second clusters, wherein each second cluster corresponds to at least one hash value, X is a positive integer, and Y is a positive integer greater than or equal to X; generate the hash ring according to the Y hash values, wherein the hash ring includes Y hash nodes, each second cluster corresponds to at least one hash node, the Y hash nodes divide the hash ring into Y hash value intervals, and each hash node corresponds to a hash value interval.
31. The first management node according to any one of claims 23 to 27, It is characterized in that The transceiver module is further used to receive the hash ring sent by the second cluster.
32. The first management node according to any one of claims 23 to 27, It is characterized in that The transceiver module is further configured to send the idle amount of resources of the first cluster to the target second cluster.
33. A second management node, It is characterized in that The second management node includes: A processing module, configured to determine a first cluster associated with a target second cluster, wherein the second management node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and a hash value corresponding to the first cluster belongs to the target hash value interval; the idle and busy status of the first cluster is idle; and the idle and busy status of the target second cluster is busy; The transceiver module is used to receive task data and send a first resource borrowing request to the first node, where the first resource borrowing request is used to instruct the first node to allocate the task data to the first cluster for processing.
34. The second management node according to claim 33, It is characterized in that The processing module is further configured to send a first resource borrowing request to the first node based on the transceiver module, and determine that the first cluster is in a resource non-borrowing state.
35. The second management node according to claim 33, It is characterized in that There are multiple clusters associated with the target second cluster, and the processing module is specifically configured to determine one of the multiple clusters associated with the target second cluster as the first cluster.
36. The second management node according to claim 35, It is characterized in that The processing module is specifically configured to determine that, among the idle resources of a plurality of clusters associated with the target second cluster, the cluster corresponding to the idle resource amount having the smallest difference with the resource demand amount of the task data is the first cluster.
37. The second management node according to any one of claims 33 to 36, It is characterized in that The transceiver module is further configured to receive the resource requirement of the task data sent by the third node, and based on the idle resource amount of the first cluster being greater than or equal to the resource requirement, send the identifier of the first cluster and the idle resource amount of the first cluster to the third node.
38. The second management node according to claim 37, It is characterized in that The transceiver module is specifically used to receive a second resource borrowing request sent by the third node, the second resource borrowing request includes the task data, and the second resource borrowing request is used to instruct the second management node to allocate the task data to the first cluster for processing.
39. A second management node, It is characterized in that The second management node includes: A transceiver module, used for receiving the resource demand of the task data sent by the third node; A processing module, configured to determine a first cluster associated with a target second cluster, wherein the second management node belongs to the target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, and a hash value corresponding to the first cluster belongs to the target hash value interval; the idle and busy status of the first cluster is idle; and the idle and busy status of the target second cluster is busy; The transceiver module is further used to send a third resource borrowing request to the third node based on the idle amount of resources of the first cluster being greater than or equal to the required amount of resources, wherein the third resource borrowing request is used to indicate that the third node is allowed to apply for resources from the first cluster.
40. The second management node according to claim 39, It is characterized in that There are multiple clusters associated with the target second cluster, and the processing module is specifically configured to determine one of the multiple clusters associated with the target second cluster as the first cluster.
41. A third management node, It is characterized in that The third management node includes: A transceiver module is used to receive task data, send the resource demand of the task data to a second node, receive a third resource borrowing request sent by the second node, and the third resource borrowing request is used to indicate that the third management node is allowed to apply for resources from a first cluster, wherein the second node belongs to a target second cluster, the target second cluster corresponds to a target hash value interval in a hash ring, the hash value corresponding to the first cluster belongs to the target hash value interval, and the resource idle amount of the first cluster is greater than or equal to the resource demand, and send a first resource borrowing request to the first node, and the first resource borrowing request is used to indicate that the first node allocates the task data to the first cluster for processing; the idle and busy status of the first cluster is idle; and the idle and busy status of the target second cluster is busy.
42. The third management node according to claim 41, It is characterized in that The transceiver module is specifically used to send the resource demand of the task data to multiple nodes, the second node is one of the multiple nodes, and receives a third resource borrowing request sent by the multiple nodes, the third resource borrowing request is used to indicate that the third management node is allowed to apply for resources from multiple sub-clusters, and the first cluster is one of the multiple sub-clusters.
43. The third management node according to claim 42, It is characterized in that The third management node also includes: The processing module is configured to determine that the subcluster corresponding to the idle resource amount having the smallest difference with the resource demand amount of the task data among the idle resource amounts of the multiple subclusters is the first cluster.
44. A cluster, It is characterized in that The cluster includes a plurality of computing nodes, which provide required resources for task data to execute the task data, and the cluster further includes: a first management node as described in any one of claims 23-32.
45. A cluster, It is characterized in that The cluster includes a plurality of computing nodes, which provide the required resources for the task data to execute the task data, and the cluster further includes: a second management node as described in any one of claims 33-40.
46. A cluster, It is characterized in that The cluster includes a plurality of computing nodes, which provide the required resources for the task data to execute the task data, and the cluster also includes: a third management node as described in any one of claims 41 to 43.
47. A distributed system, It is characterized in that The distributed system includes the cluster as claimed in claim 44 and the cluster as claimed in claim 45. 48.A distributed system, It is characterized in that The distributed system includes the cluster of claim 44, the cluster of claim 45, and the cluster of claim 46.
