A resource scheduling method and device, a storage medium and an electronic device
By dividing resource intervals and determining migration costs and priority coefficients, the problem of difficulty in balancing balance, utilization rate and fulfillment rate in existing resource scheduling methods is solved, and the balance and efficient utilization of resource scheduling are achieved.
Patent Information
- Application Number
- CN202210693042.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-06-17
AI Technical Summary
Existing resource scheduling methods struggle to simultaneously guarantee balanced resource allocation, utilization, and fulfillment rates. Kubernetes prioritizes nodes with higher remaining resource levels, resulting in low utilization and fulfillment rates, while the Binpack algorithm leads to uneven resource allocation and low utilization.
By pre-dividing resource intervals, determining migration costs and node priority coefficients, and comprehensively considering the remaining resources of nodes and the impact of migration, target nodes are selected for resource scheduling to ensure the balance and utilization of resource allocation.
It achieves the simultaneous guarantee of resource allocation balance, utilization rate and fulfillment rate in resource scheduling, avoids node resource idleness, and can handle requests with large resource demand.
Smart Images

Figure CN115048219B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of computer technology, and particularly relates to a resource scheduling method and device, a storage medium and an electronic device. BACKGROUND
[0002] Resource scheduling is one of the most widely used technologies at present. The available resources are concentrated in a distributed system, and when a user's resource request is received, the corresponding resources are provided to the user for use. In actual application, the balance degree of resource allocation, utilization rate and fulfillment rate are usually used to measure the current resource scheduling method. Among them, the balance degree is used to represent the balance degree of scheduling of each node in the distributed system, the utilization rate is used to represent whether the resources in each node are effectively utilized, and the fulfillment rate is used to represent the probability that the distributed system can process the user request after receiving the user request. The higher the balance degree, utilization rate and fulfillment rate of resource allocation, the better the current resource scheduling method.
[0003] Because different users have different resource needs, the total amount of resources is fixed, but the consumption of resources is uncertain, so in the actual process of resource scheduling, only one or two of the above three indicators can be ensured, and it is difficult to ensure high balance degree, utilization rate and fulfillment rate at the same time.
[0004] In the prior art, there are two commonly used resource scheduling methods, one is the Kubernetes resource orchestration scheduling system, and the other is the Binpack algorithm. Among them, Kubernetes can only ensure high balance degree when scheduling resources, and cannot ensure utilization rate and fulfillment rate; Binpack has high fulfillment rate, but the resource allocation is seriously unbalanced, and the utilization rate is also low. It can be seen that the existing resource scheduling method cannot simultaneously satisfy high balance degree, utilization rate and fulfillment rate. SUMMARY
[0005] The present specification provides a resource scheduling method, device, storage medium and electronic device to at least partially solve the above problems existing in the prior art.
[0006] The present specification adopts the following technical solutions:
[0007] The present specification provides a resource scheduling method, which is applied to a distributed system, and includes:
[0008] obtaining a pre-divided resource interval, wherein the resource at least includes computing resource and / or storage resource;
[0009] For each resource interval, according to the historical resource request in which the resource demand quantity falls into the resource interval, determining the migration cost corresponding to the resource interval.
[0010] When receiving the current resource request, a first priority coefficient of each node in the distributed system is determined according to a current residual resource amount of the node, and a resource interval in which the node currently locates;
[0011] For each node, a migration influence degree of the node is determined according to the resource interval in which the node currently locates and a migration cost of each resource interval; the migration influence degree is used to represent an influence of a change of the resource interval in which the node locates on the distributed system after a resource of the node is scheduled to process the current resource request;
[0012] A second priority coefficient of the node is determined according to the first priority coefficient and the migration influence degree of the node;
[0013] A target node is selected from the nodes according to the second priority coefficients of the nodes, and a resource of the target node is scheduled to process the current resource request.
[0014] Optionally, the resource intervals are divided in advance, and the division specifically includes:
[0015] A resource demand amount of each historical resource request is obtained;
[0016] The resource intervals are divided according to a difference between a number of historical resource requests with resource demand amounts falling into different resource intervals being within a preset range, as a constraint.
[0017] Optionally, the migration cost corresponding to the resource interval is determined according to the historical resource requests with resource demand amounts falling into the resource interval, and the determination specifically includes:
[0018] The migration cost of the resource interval is determined according to a proportion of a number of the historical resource requests with resource demand amounts falling into the resource interval in a total number of the historical resource requests, wherein the proportion is positively correlated with the migration cost of the resource interval.
[0019] Optionally, the first priority coefficient of each node is determined according to a current residual resource amount of the node, and the determination specifically includes:
[0020] For each node, the first priority coefficient of the node is determined in a manner that the current residual resource amount of the node is positively correlated with the first priority coefficient of the node.
[0021] Optionally, the migration influence degree of the node is determined according to the resource interval in which the node currently locates and the migration cost of each resource interval, and the determination specifically includes:
[0022] According to the current residual resource amount of the node and a resource demand amount of the current resource request, an estimated residual resource amount of the node is determined when the node processes the current resource request.
[0023] determining a target resource interval to which the node migrates when processing the current resource request according to the estimated remaining resource amount of the node;
[0024] determining a total migration cost of the node according to the resource interval in which the node currently locates and the target resource interval, and the migration cost of each resource interval;
[0025] determining a migration influence degree of the node according to the total migration cost of the node and a proportion of the number of nodes in the resource interval in which the node currently locates in the total number of nodes.
[0026] Optionally, the total migration cost of the node is determined according to the resource interval in which the node locates and the resource interval to which the node should migrate, and the migration cost of each resource interval, and specifically includes:
[0027] the migration cost of each resource interval between the resource interval in which the node locates and the resource interval to which the node should migrate, and the sum of the migration costs of the resource intervals in which the node locates, are taken as the total migration cost of the node.
[0028] Optionally, the migration influence degree of the node is determined according to the total migration cost of the node and the proportion of the number of nodes in the resource interval in which the node currently locates in the total number of nodes, and specifically includes:
[0029] the total migration cost of the node is negatively related to the migration influence degree of the node, and the proportion of the number of nodes in the resource interval in which the node locates in the total number of nodes is positively related to the migration influence degree of the node.
[0030] Optionally, the second priority coefficient of the node is determined according to the first priority coefficient and the migration influence degree of the node, and specifically includes:
[0031] the first priority coefficient and the migration influence degree of the node are weighted by using a first weight corresponding to the first priority coefficient of the node and a second weight corresponding to the migration influence degree of the node to obtain the second priority coefficient of the node.
[0032] The resource scheduling device provided in the specification includes:
[0033] an acquisition module configured to acquire a pre-divided resource interval, wherein the resource includes at least computing resource and / or storage resource;
[0034] a migration cost determination module configured to determine, for each resource interval, a migration cost corresponding to the resource interval according to historical resource requests in which resource demand amounts fall into the resource interval;
[0035] The first priority coefficient determination module determines a first priority coefficient of each node and a resource interval currently occupied by each node according to a current remaining resource amount of each node in the distributed system when receiving a current resource request.
[0036] The migration influence degree determination module determines a migration influence degree of each node according to the resource interval currently occupied by the node and a migration cost of each resource interval.
[0037] The second priority coefficient determination module determines a second priority coefficient of each node according to the first priority coefficient and the migration influence degree of the node.
[0038] The scheduling module selects a target node from the nodes according to the second priority coefficient of each node and schedules a resource of the target node to process the current resource request.
[0039] The present specification provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the resource scheduling method.
[0040] The present specification provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the resource scheduling method when executing the program.
[0041] The above at least one technical solution adopted by the present specification can achieve the following beneficial effects:
[0042] The present specification provides a resource scheduling method, device, storage medium, and electronic device. In the resource scheduling method provided by the present specification, a resource interval is obtained, and a migration cost of each resource interval is determined. A first priority coefficient of each node is determined according to a remaining resource amount of each node, and a resource interval occupied by each node is determined, and a migration influence degree of each node is determined according to the resource interval. A second priority coefficient of each node is determined according to the first priority coefficient and the migration influence degree of each node, and a node to be scheduled is selected according to the second priority coefficient. In the method, the second priority coefficient of each node is determined by dividing the resource interval, considering the remaining resource amount of each node and the distribution of each node in each resource interval, and the node to be scheduled is selected according to the second priority coefficient. On the basis of reasonable resource allocation, the balance of resource scheduling is ensured, and the utilization rate of allocated resources is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:
[0044] Figure 1 This is a flowchart illustrating one resource scheduling method described in this specification.
[0045] Figure 2 This is a schematic diagram of a distributed system described in this specification;
[0046] Figure 3 This is a schematic diagram illustrating one method of dividing resource areas in this specification;
[0047] Figure 4 This is a schematic diagram of a resource scheduling device provided in this specification;
[0048] Figure 5 The corresponding information provided in this specification Figure 1 A schematic diagram of an electronic device. Detailed Implementation
[0049] Currently, the most widely used resource scheduling methods are the scheduling methods based on the Kubernetes resource orchestration and scheduling system and the Binpcak algorithm. However, neither of these methods can simultaneously achieve high balance, utilization, and fulfillment rate in resource allocation.
[0050] In Kubernetes systems, resource scheduling prioritizes nodes with higher remaining resource levels. This leads to a near-equal distribution of resources across nodes. In other words, similar resource consumption across nodes indicates similar load conditions and a high degree of resource balance. However, this approach can result in lower overall utilization and fulfillment rates. While the total remaining resources may be substantial, each node might lack sufficient resources to handle a large resource request.
[0051] When Binpack is used for resource scheduling, the scheduling manner is just the opposite of Kubernetes, and the node with lower remaining resource amount is selected for scheduling. Whenever a new resource request is generated, the node with the lowest remaining resource amount is selected from the nodes whose remaining resource amount can meet the resource demand of the resource request. Since this method retains many nodes with full resource amount, it can usually meet any resource request and has a high fulfillment rate. However, because of this, there are often some nodes with full load and some nodes completely idle in Binpack, and the balance and utilization of resource allocation are low.
[0052] To solve the problem that the existing method cannot guarantee the balance, utilization and fulfillment rate of resource scheduling at the same time, the present specification provides a resource scheduling method.
[0053] To make the purpose, technical solutions and advantages of the present specification clearer, the technical solutions of the present specification will be described clearly and completely in the following with reference to the specific embodiments of the present specification and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present specification, not all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.
[0054] The technical solutions provided by the embodiments of the present specification will be described in detail below with reference to the drawings.
[0055] Figure 1 The flowchart of the resource scheduling method in the present specification specifically includes the following steps:
[0056] S100: obtaining a pre-divided resource interval, wherein the resource at least includes computing resource and / or storage resource.
[0057] All steps in the resource scheduling method provided by the present specification can be completed by any distributed system.
[0058] The distributed system to which the present method is applied can be specifically as shown in the figure. Figure 2 The distributed system contains a plurality of nodes for storing and providing resources. When a resource request sent by a user is received, the distributed system can schedule a suitable node among the nodes to process the resource request.
[0059] Dividing resources into intervals specifically refers to dividing different resource intervals based on resource quantity. The resources mentioned in this specification can be any computing and / or storage resources that can be used in electronic devices, including but not limited to central processing units (CPUs), memory, disks, and bandwidth. When dividing resource intervals, different resources can be divided separately or multiple resources can be divided simultaneously, depending on the resources to be scheduled and specific requirements.
[0060] Taking CPU and memory as the resources to be allocated as an example, the unit for CPU is a core, and the unit for memory is a gigabyte (GB). For ease of explanation, cores will be abbreviated as C and gigabytes as G. (The following is a simplified explanation of the concept.) Figure 3 The method shown divides the CPU and memory, defining the interval between two adjacent boundaries as a resource interval, such as 0C0G~4C8G, 8C16G~16C32G, etc. It's worth noting that the specific division method for resource intervals can also be set according to requirements, for example... Figure 3 The method shown is that in adjacent intervals, the difference between the upper and lower boundaries of the next interval is twice the difference between the upper and lower boundaries of the previous interval; in addition, the resource intervals can also be divided in a way that the difference between the upper and lower boundaries of each interval is the same, or other division methods, which are not limited in this specification.
[0061] S102: For each resource interval, determine the migration cost corresponding to that resource interval based on the historical resource requests that fall within that resource interval in terms of resource demand.
[0062] After dividing the resource intervals, the migration cost of each interval can be determined. The migration cost of a resource interval represents the amount of resource request processing capacity lost by nodes within that interval after migrating to the previous resource interval. The higher the migration cost of a resource interval, the greater the loss of resource request processing capacity due to migration. When a node is scheduled to process a resource request, its remaining resources decrease. When the change in the node's remaining resources crosses the boundary of a resource interval, the node's resource interval changes, meaning the node migrates from a larger resource interval to a smaller one. Correspondingly, the number of resource requests the node can process decreases, i.e., its resource request processing capacity decreases. The loss of resource request processing capacity during the migration process is the migration cost.
[0063] S104: When a current resource request is received, the first priority coefficient of each node and the resource range in which each node is currently located are determined based on the current remaining resources of each node in the distributed system.
[0064] According to the current residual resource amount of each node, the resource interval in which each node currently locates can be determined. In fact, the interval in which a node locates can specifically refer to the resource interval in which the current residual resource amount of the node falls. For example, still taking the manner of allocating resource intervals as shown in the table, when the current residual resource amount of a node is 7C10G, the current residual resource amount of the node falls in the interval 4C8G-8C16G, and then the resource interval in which the node currently locates is 4C8G-8C16G. Figure 3
[0065] Meanwhile, according to the residual resource amount of each node, the first priority coefficient of each node can also be determined. The first priority coefficient is used to represent the probability of the node being preferentially scheduled, and the greater the first priority coefficient of a node, the greater the probability of the node being preferentially scheduled. There can be multiple methods for determining the first priority coefficient of a node according to the residual resource amount of the node. Specifically, for each node, the first priority coefficient of the node can be determined in a manner that the current residual resource amount of the node is positively correlated with the first priority coefficient of the node. In other words, the greater the residual resource amount of a node, the greater the probability of the node being preferentially scheduled,
[0066] S106: For each node, the migration influence degree of the node is determined according to the resource interval in which the node currently locates and the migration cost of each resource interval. The migration influence degree is used to represent the influence of the change of the resource interval in which the node locates on the distributed system after the resource processing of the node is scheduled to process the current resource request.
[0067] According to the migration cost of each resource interval determined in step S102 and the resource interval in which each node locates determined in step S104, the migration influence degree of each node can be determined. The migration influence degree of a node is used to represent the influence of the ability of the distributed system as a whole to process resource requests after the node migrates, and the greater the migration influence degree of a node, the smaller the influence of the ability of the distributed system as a whole to process resource requests after the node migrates.
[0068] S108: The second priority coefficient of the node is determined according to the first priority coefficient and the migration influence degree of the node.
[0069] According to the first priority coefficient of the node determined in step S104 and the migration influence degree of the node determined in step S106, the second priority coefficient of the node can be determined. The second priority coefficient of the node is used to represent the priority of the node being scheduled, and the higher the second priority coefficient of a node, the more preferentially the node is scheduled.
[0070] According to the first priority coefficient of a node and the migration influence degree of the node, there are many methods to determine the second priority coefficient of the node, for example, a first weight corresponding to the first priority coefficient of the node and a second weight corresponding to the migration influence degree of the node can be preset, and the first priority coefficient of the node and the migration influence degree of the node are weighted to obtain the second priority coefficient of the node; for another example, the first priority coefficient and the migration influence degree are directly added or multiplied to obtain the second priority coefficient, and the present specification does not limit this.
[0071] S110: According to the second priority coefficient of each node, a target node is selected from each node, and the resource of the target node is scheduled to process the current resource request.
[0072] According to the second priority coefficient of each node obtained in step S108, the target node to be scheduled can be selected. Since the second priority coefficient of a node represents the priority of the node to be scheduled, the node with the highest second priority coefficient can be determined as the target node to be scheduled, and the resource in the target node is scheduled to process the current resource request.
[0073] When the resource scheduling method provided in the present specification is used for resource scheduling, the resource intervals can be divided in advance to determine the migration cost of each resource interval; when the resource scheduling is performed, the interval in which the node is located can be determined according to the remaining resource amount of the node, and the first priority coefficient of the node can be determined; then, the migration influence degree of each node can be determined according to the resource interval in which the node is located and the migration cost of each resource interval; finally, the second priority coefficient of the node can be determined according to the first priority coefficient and the migration influence degree of the node, and the node to be scheduled can be determined according to the second priority coefficient. When the resource scheduling is performed, the remaining resource amount of each node and the loss degree of the overall processing capability of the distributed system before and after the scheduling of each node are comprehensively considered, which not only ensures the balance of the resource scheduling, but also ensures the utilization rate of the resource scheduling, and ensures that the resource request with a large resource demand can be processed without a large number of idle nodes, thereby ensuring a high fulfillment rate.
[0074] Further, in step S100, when the resource intervals are divided in advance, in order to make the divided resource intervals have strong pertinence and obvious distinguishing effect, the resource intervals can be divided according to historical data. Specifically, the resource demand amount of each historical resource request can be obtained; and the resource intervals are divided according to the resource demand amount of each historical resource request, with the difference between the number of historical resource requests with resource demand amount falling into different resource intervals being within a preset range as a constraint.
[0075] After obtaining the historical resource requests in the historical data, the resource requirement quantity of each historical resource request can be obtained, and according to the distribution of the resource requirement quantity of the historical resource requests, the resource intervals are divided with the constraint that the difference between the number of historical resource requests falling into different resource intervals is within a preset range. The purpose of such division is to make the number of historical resource requests falling into each resource interval differ less, so that the division effect of each resource interval is more obvious.
[0076] For example, more intervals can be divided in the area where resource requests are concentrated, and the difference between the upper and lower boundaries of each resource interval is small; fewer intervals can be divided in the area where resource requests are less or more dispersed, and the difference between the upper and lower boundaries of each resource interval is large. When this division method is used, the final resource interval division may be that more resource intervals are divided near the resource quantity with more resource requests, and the difference between the upper and lower limits of each resource interval is small; and fewer resource intervals are divided near the resource quantity with less resource requests, and the difference between the upper and lower limits of each resource interval is large, so as to realize that the number of historical resource requests falling into each resource interval is similar.
[0077] Similarly, the migration cost of the divided resource interval can also be determined based on the historical resource requests in the historical data. Specifically, the migration cost of the resource interval is determined according to the proportion of the number of historical resource requests with resource requirement quantity falling into the resource interval in the total number of historical resource requests, wherein the proportion of the number of historical resource requests with resource requirement quantity falling into the resource interval in the total number of historical resource requests is positively correlated with the migration cost of the resource interval.
[0078] In actual application, the resource requests of users received may not be the same in resource requirement quantity. However, the resource requests with different resource requirement quantities are not evenly distributed, and according to the demand of users, there may be a case that the number of resource requests with part of resource requirement quantities is more. That is, the number of resource requests falling into each resource interval may be different. From the node aspect, when a node consumes resource quantity and migrates from the current resource interval to the adjacent previous resource interval, the node can no longer process resource requests falling into the current resource interval, and this part of resource requests can be regarded as the migration cost of the node in this migration. The specific calculation method can be as follows:
[0079]
[0080] wherein Cost represents the migration cost of the resource interval, req represents the resource request, Count(req) represents the number of historical resource requests in the resource interval, R k represents the upper boundary of the resource interval, and Rj This indicates the lower boundary of the resource range. The formula above represents the resource range, where Total(req) represents the total number of historical resource requests. The meaning of the formula is that the migration cost of a resource range can be expressed as the percentage of historical resource requests falling within that range out of the total number of historical resource requests.
[0081] In step S106, when calculating the node migration impact, since the node migration situation may differ when processing resource requests with different resource requirements, the node migration impact can be determined based on the resource range where the node is located and the migration cost, and the resource requirement of the current resource request to be processed. Specifically, based on the node's current remaining resources and the resource requirement of the current resource request, the estimated remaining resources of the node when processing the current resource request can be determined; based on the estimated remaining resources of the node, the target resource range to which the node will migrate when processing the current resource request can be determined; based on the resource range where the node is currently located, the target resource range, and the migration cost of each resource range, the total migration cost of the node can be determined; and based on the total migration cost of the node and the proportion of the number of nodes in the resource range where the node is currently located to the total number of nodes, the migration impact of the node can be determined.
[0082] When a new resource request is received, for each node, the estimated remaining resource amount of that node if it were to handle the current resource request can be calculated. Subtracting the resource requirement of the current resource request from the node's current remaining resource amount yields the estimated remaining resource amount for that node after handling the request. Based on the estimated remaining resource amount after handling the request, the target resource interval where the node will be located after handling the request can be determined, i.e., the resource interval where the node will be located after migration. Then, based on the resource intervals traversed during the migration and the migration cost of each resource partition, the total migration cost of the node can be determined. Specifically, the total migration cost of the node can be the sum of the migration costs of each resource interval between the node's current resource interval and the target resource interval, and the migration cost of the node's current resource interval.
[0083] For example, still using Figure 3The resource partition is divided in the illustrated manner. Assuming that the current residual resource amount of a node is 20C40G, the resource interval in which the node currently locates should be 16C32G~32C64G; if the resource demand amount of the current resource request received is 14C28G, when the node processes the resource request, the estimated residual resource amount of the node becomes 6C12G, and the target resource interval in which the node locates after processing the current resource request is 4C8G~8C16G; it can be seen that the node passes through the resource interval 8C16G~16C32G in the process of migrating from 16C32G~32C64G to 4C8G~8C16G. Assuming that the migration cost of the resource interval 8C16G~16C32G is 0.2 and the migration cost of the resource interval 16C32G~32C64G is 0.3, the total migration cost of the node is 0.2+0.3=0.5. Since the total migration cost of a node represents the size of the resource request processing capability lost by the node when the node migrates, it can be seen that the greater the total migration cost of a node, the greater the influence of the migration of the node on the overall processing capability of the resource scheduling system, and the smaller the migration influence degree of the node.
[0084] As described in step S106, the migration influence degree of a node represents the size of the influence on the overall processing capability of the distributed system when the node migrates. Therefore, in addition to being determined by the total migration cost of the node, the migration influence degree of the node can also be determined by the proportion of the number of nodes in the resource interval in which the node locates in the total number of nodes. When the number of nodes in a resource interval accounts for a large proportion in the total number of nodes, the migration of a node in the resource interval will not have a great influence on the overall resource scheduling system; when the number of nodes in a resource interval accounts for a small proportion in the total number of nodes, the migration of a node in the resource interval will have a great influence on the overall resource scheduling system.
[0085] From the above discussion, it can be seen that the greater the total migration cost of a node, the smaller the migration influence degree of the node; and the greater the proportion of the number of nodes in the resource interval in which the node locates in the total number of nodes, the greater the migration influence degree of the node. In other words, when determining the migration influence degree of a node, the total migration cost of the node is negatively correlated with the migration influence degree of the node, and the proportion of the number of nodes in the resource interval in which the node locates in the total number of nodes is positively correlated with the migration influence degree of the node.
[0086] The above is the resource scheduling method provided by the present specification. Based on the same idea, the present specification also provides a corresponding resource scheduling device, as shown in Figure 4 .
[0087] Figure 4 A schematic diagram of a resource scheduling device provided in the present specification, specifically comprising:
[0088] The acquisition module 200 acquires a pre-divided resource interval, wherein the resource at least includes a computing resource and / or a storage resource;
[0089] The migration cost determination module 202 determines, for each resource interval, a migration cost corresponding to the resource interval according to historical resource requests in which resource requirements fall into the resource interval;
[0090] The first priority coefficient determination module 204 determines, when receiving a current resource request, a first priority coefficient of each node in the distributed system and a resource interval in which the node currently locates according to a current remaining resource amount of the node;
[0091] The migration influence degree determination module 206 determines, for each node, a migration influence degree of the node according to the resource interval in which the node currently locates and the migration cost of each resource interval; the migration influence degree is used to represent an influence of a change of the resource interval in which the node locates on the distributed system after scheduling a resource of the node to process the current resource request;
[0092] The second priority coefficient determination module 208 determines, for each node, a second priority coefficient of the node according to the first priority coefficient and the migration influence degree of the node;
[0093] The scheduling module 210 selects a target node from the nodes according to the second priority coefficients of the nodes and schedules a resource of the target node to process the current resource request.
[0094] In an optional embodiment:
[0095] The device further comprises a division module 212, specifically configured to acquire resource requirements of each historical resource request; and divide resource intervals according to the resource requirements of the historical resource requests, with a difference between the number of historical resource requests in which resource requirements fall into different resource intervals being within a preset range as a constraint.
[0096] In an optional embodiment:
[0097] The migration cost determination module 202 is specifically configured to determine the migration cost of the resource interval according to a proportion of the number of historical resource requests in which resource requirements fall into the resource interval in the total number of historical resource requests, wherein the proportion is positively correlated with the migration cost of the resource interval.
[0098] In an optional embodiment:
[0099] The first priority coefficient determination module 204 is specifically used to determine the first priority coefficient of each node by making the current remaining resources of the node positively correlated with the first priority coefficient of the node.
[0100] In an alternative embodiment:
[0101] The migration impact determination module 206 is specifically used to determine the estimated remaining resources of the node when it is used to process the current resource request, based on the node's current remaining resources and the resource demand of the current resource request; to determine the target resource range to which the node will migrate when it is used to process the current resource request, based on the node's estimated remaining resources; to determine the total migration cost of the node based on the node's current resource range, the target resource range, and the migration cost of each resource range; and to determine the migration impact of the node based on the node's total migration cost and the proportion of nodes in the current resource range to the total number of nodes.
[0102] In an alternative embodiment:
[0103] The migration impact determination module 206 is specifically used to take the total migration cost of the node as the sum of the migration cost of each resource interval between the resource interval where the node is currently located and the target resource interval.
[0104] In an alternative embodiment:
[0105] The migration impact determination module 206 is specifically used to determine the migration impact of a node by means of a negative correlation between the total migration cost of the node and the migration impact of the node, and a positive correlation between the proportion of the number of nodes in the resource interval where the node is located and the total number of nodes.
[0106] In an alternative embodiment:
[0107] The second priority coefficient determination module 208 is specifically used to weight the first priority coefficient and migration influence of the node using a preset first weight corresponding to the first priority coefficient of the node and a second weight corresponding to the migration influence of the node, so as to obtain the second priority coefficient of the node.
[0108] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 The resource scheduling method provided.
[0109] This instruction manual also provides Figure 5 The diagram shows a schematic structural representation of the electronic device. Figure 5At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and can also include other hardware required by a business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to realize the above Figure 1 The resource scheduling method. Of course, in addition to the software implementation, the present specification does not exclude other implementation manners, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0110] It should be noted that all the actions of obtaining signals, information or data in this application are carried out in accordance with the corresponding data protection regulations and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.
[0111] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.
[0112] The controller can be implemented in any suitable way, for example, the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, such as software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that, in addition to being implemented in pure computer readable program code, the controller can equally well be implemented to perform the same functions using logic gates, switches, an application specific integrated circuit, a programmable logic controller and an embedded microcontroller, etc. by means of a logical programming of the method steps. The controller can thus be considered as a hardware component, and the means comprised therein for performing the various functions can be considered as structures within the hardware component. Alternatively, the means for performing the various functions can even be considered as both a software module implementing the method and a structure within the hardware component.
[0113] The systems, apparatuses, modules or units illustrated by the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0114] For the sake of description, the above apparatuses are described in various units with functions respectively. Of course, the functions of the units can be implemented in one or more software and / or hardware in implementing the present specification.
[0115] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage etc.) containing computer usable program code.
[0116] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0117] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0118] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0119] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0120] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory. The memory is an example of computer-readable media.
[0121] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0122] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0123] Those skilled in the art will appreciate that embodiments of the present specification can be provided as methods, systems or computer program products. Therefore, the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] The present specification can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.
[0125] The various embodiments described in this specification are described using a numbering of embodiments approach: these are each individually integrated contributions pertaining to different aspects of the description. For each embodiment, the description focuses on the differences from the other embodiments. In particular, the description of the system embodiments is relatively brief, as the system embodiments are largely analogous to the method embodiments. The relevant parts of the description of the method embodiments are therefore referred to.
[0126] The above description is embodied in the form of embodiments only and is not intended to limit the present specification. The present specification can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present application.
Claims
1. A resource scheduling method, characterized in that, The method is applied to a distributed system containing several nodes, and the method includes: Obtain a pre-divided resource range, wherein the resources include at least computing resources and / or storage resources; For each resource interval, based on the historical resource requests that fall within that resource interval, the migration cost corresponding to that resource interval is determined. The migration cost is used to characterize the amount of resource request processing capacity that a node in that resource interval will lose after migrating to the previous resource interval. When a current resource request is received, the first priority coefficient of each node and the resource range in which each node is currently located are determined based on the current remaining resources of each node in the distributed system. For each node, the migration impact degree of the node is determined based on the resource range in which the node is currently located and the migration cost of each resource range. The migration impact degree is used to characterize the impact of the change in the resource range in which the node is located on the distributed system after the resources of the node are scheduled to process the current resource request. The second priority coefficient of the node is determined based on its first priority coefficient and migration impact. Based on the second priority coefficient of each node, the node with the highest second priority coefficient is selected as the target node, and the resources of the target node are scheduled to process the current resource request. The first priority coefficient of each node is determined based on the current remaining resources of each node, specifically including: For each node, its first priority coefficient is determined by positively correlated with its current remaining resources. The migration impact of the node is determined based on its current resource range and the migration costs of each resource range, specifically including: Based on the node's current remaining resources and the resource demand of the current resource request, determine the estimated remaining resources of the node when it processes the current resource request. Based on the estimated remaining resources of the node, determine the target resource range to which the node will migrate when processing the current resource request. The total migration cost of the node is determined based on the current resource range of the node, the target resource range, and the migration cost of each resource range. The migration impact of a node is determined based on its total migration cost and the proportion of nodes within its current resource interval to the total number of nodes. The total migration cost of a node is determined based on its current resource interval, the target resource interval, and the migration cost of each resource interval, specifically including: The total migration cost of a node is calculated by summing the migration costs of all resource intervals between the node's current resource interval and the target resource interval, with the total migration cost of the node's current resource interval. The migration impact of a node is determined based on its total migration cost and the proportion of nodes within its current resource interval to the total number of nodes. This determination includes: The migration impact of a node is determined by a method in which the total migration cost of the node is negatively correlated with the migration impact of the node, and the proportion of the number of nodes in the resource interval where the node is located to the total number of nodes is positively correlated with the migration impact of the node.
2. The method as described in claim 1, characterized in that, Pre-dividing resource areas, specifically including: Obtain the resource requirements for each historical resource request; Based on the resource demand of each historical resource request, and constrained by the difference in the number of historical resource requests whose resource demand falls into different resource intervals within a preset range, resource intervals are divided.
3. The method as described in claim 1, characterized in that, Based on historical resource requests whose resource demand falls within this resource range, the migration cost corresponding to this resource range is determined, specifically including: The migration cost of a resource range is determined by the proportion of historical resource requests that fall within that range to the total number of historical resource requests, wherein the proportion is positively correlated with the migration cost of that resource range.
4. The method as described in claim 1, characterized in that, Based on the node's first priority coefficient and migration impact, the node's second priority coefficient is determined, specifically including: The first priority coefficient and the migration impact of the node are weighted by a preset first weight corresponding to the first priority coefficient of the node and a second weight corresponding to the migration impact of the node, so as to obtain the second priority coefficient of the node.
5. A resource scheduling device, characterized in that, include: The acquisition module acquires a pre-divided resource range, wherein the resources include at least computing resources and / or storage resources; The migration cost determination module determines the migration cost corresponding to each resource interval based on the historical resource requests that fall within that resource interval. The migration cost is used to characterize the amount of resource request processing capacity that a node in that resource interval will lose after migrating to the previous resource interval. The first priority coefficient determination module, when receiving a current resource request, determines the first priority coefficient of each node and the resource range in which each node is currently located based on the current remaining resources of each node in the distributed system. The migration impact determination module determines the migration impact of each node based on the current resource range in which the node is located and the migration cost of each resource range. The migration impact is used to characterize the impact of the change in the resource range in which the node is located on the distributed system after the resources of the node are scheduled to process the current resource request. The second priority coefficient determination module determines the second priority coefficient of each node based on its first priority coefficient and migration impact. The scheduling module selects the node with the highest second priority coefficient from all nodes as the target node based on the second priority coefficient of each node, and schedules the resources of the target node to process the current resource request. The first priority coefficient of each node is determined based on the current remaining resources of each node, specifically including: For each node, its first priority coefficient is determined by positively correlated with its current remaining resources. The migration impact of the node is determined based on its current resource range and the migration costs of each resource range, specifically including: Based on the node's current remaining resources and the resource demand of the current resource request, determine the estimated remaining resources of the node when it processes the current resource request. Based on the estimated remaining resources of the node, determine the target resource range to which the node will migrate when processing the current resource request. The total migration cost of the node is determined based on the current resource range of the node, the target resource range, and the migration cost of each resource range. The migration impact of a node is determined based on its total migration cost and the proportion of nodes within its current resource interval to the total number of nodes. The total migration cost of a node is determined based on its current resource interval, the target resource interval, and the migration cost of each resource interval, specifically including: The total migration cost of a node is calculated by summing the migration costs of all resource intervals between the node's current resource interval and the target resource interval, with the total migration cost of the node's current resource interval. The migration impact of a node is determined based on its total migration cost and the proportion of nodes within its current resource interval to the total number of nodes. This determination includes: The migration impact of a node is determined by a method in which the total migration cost of the node is negatively correlated with the migration impact of the node, and the proportion of the number of nodes in the resource interval where the node is located to the total number of nodes is positively correlated with the migration impact of the node.
6. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 4.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 4.
Citation Information
Patent Citations
Core resource allocation method and apparatus and multi-core system
CN104008013A
Method and device for migrating application to cloud platform, electronic equipment and storage medium
CN111897654A