Resource scheduling method, related device and storage medium

By combining historical load trends and instantaneous load changes in a distributed architecture to dynamically adjust resource allocation, the problems of lag and inaccuracy in resource allocation in existing technologies are solved, achieving more efficient resource utilization.

CN121996424APending Publication Date: 2026-05-08北京科杰科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
北京科杰科技有限公司
Filing Date
2026-01-27
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, the distributed architecture resource management system YARN performs static allocation based solely on the current resource usage during resource scheduling. This results in resource allocation lag and inaccuracy, making it impossible to predict node resource demand trends and causing physical resource waste or delays.

Method used

By acquiring the physical resource utilization and task priority of each node, and combining the overall load change trend, instantaneous load growth rate and acceleration within a preset historical time window, the resource allocation strategy is dynamically adjusted, including expanding and reclaiming physical resources.

Benefits of technology

It enables more accurate resource allocation, avoids waste of physical resources and scheduling delays, and improves resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121996424A_ABST
    Figure CN121996424A_ABST
Patent Text Reader

Abstract

The invention relates to the field of resource scheduling, and provides a resource scheduling method, a related device and a storage medium, and the method comprises the steps: obtaining the physical resource utilization rate of each node and the priority of each task in each node; if the physical resource utilization rate of any node exceeds a first threshold value corresponding to the node, determining the physical resource capacity expansion amount of the node and performing capacity expansion based on the comprehensive load change trend, the instantaneous load increase speed and the instantaneous load increase acceleration of the node in a preset historical time window; and if the physical resource utilization rate of any node is lower than a second threshold value of the physical resource utilization rate of the node and the duration exceeds a preset duration, recovering the physical resource of the node based on the priority of each task in the node. According to the method and the device, the physical resource demand trend of each node can be pre-judged, and the physical resources are pre-allocated to each node according to the physical resource demand trend of each node, so that the waste and delay of the physical resources are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of resource scheduling, and more specifically to a resource scheduling method, related apparatus, and storage medium. Background Technology

[0002] Existing technologies often employ distributed architectures (such as Hadoop) to process massive amounts of data. Resource scheduling within these distributed architectures is typically handled by a resource management system (YARN). However, current YARN scheduling is based solely on the resource usage of each node at the current moment, employing a static resource allocation strategy. Since static allocation can only allocate resources based on the current resource demands of each node and cannot predict future resource demand trends, it leads to delays and inaccuracies in resource allocation. Summary of the Invention

[0003] This application provides a resource scheduling method, related apparatus, and storage medium that can predict the physical resource demand trend of each node and perform predictive physical resource allocation for each node based on the physical resource demand trend, thereby avoiding physical resource waste and delays; in addition, allocating resources based on resource demand trends is also more accurate.

[0004] In a first aspect, embodiments of this application provide a resource scheduling method applied to a distributed cluster, wherein the distributed cluster has multiple nodes, and the method includes: Obtain the physical resource utilization of each node, as well as the priority of each task within each node; If the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, then based on the overall load change trend of that node under a preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of that node, the physical resource expansion capacity of that node is determined, and the physical resource expansion capacity of that node is expanded based on the physical resource expansion capacity; wherein, the overall load change trend includes rapid growth, steady growth and decline. If the physical resource utilization rate of any node is lower than the second threshold of physical resource utilization rate for that node and the duration exceeds the preset duration, then the physical resources of that node will be reclaimed based on the priority of each task in that node.

[0005] In one implementation, the overall load change trend of any node is determined based on the following method: Get the increase in physical resource usage for this node at each time step within a preset historical time window; Based on the increase in physical resource usage at each time step and the weight of each time step, the overall load change trend of the node is determined; wherein, in the preset historical time window, the weight of the earlier time step is less than the weight of the later time step.

[0006] In one implementation, the overall load change trend is determined based on the following formula:

[0007] If S1 ≥ S1, then the overall load change trend is rapid growth; 0≤ If <S1, then the overall load trend is a steady increase; If the value is less than 0, the overall load trend is downward. in, This represents the overall load change trend value at the current time t, where T represents the number of time steps included in the preset historical time window. ) represents the increase in physical resource usage at time step (tk). S1 represents the weight corresponding to the time step ending at (tk), where k∈[0,T-1] and k is a positive integer, and S1 is a first preset value greater than zero.

[0008] In one implementation, determining the physical resource expansion capacity of a node based on its comprehensive load change trend within a preset historical time window, as well as its instantaneous load growth rate and instantaneous load growth acceleration, includes: If the overall load of the node changes rapidly and the instantaneous load growth rate of the node is greater than the second preset value, then the physical resource gap of the node is expanded according to the first ratio to obtain the physical resource expansion capacity. If the overall load change trend of the node is a steady increase, and the instantaneous load growth rate of the node is between 0 and a second preset value, then the physical resource gap of the node is expanded according to the second ratio to obtain the physical resource expansion capacity, wherein the second ratio is less than the first ratio. If the overall load of the node is decreasing and the instantaneous load growth rate of the node is less than 0, then the physical resource gap of the node is reduced according to the third ratio to obtain the physical resource expansion capacity.

[0009] In one implementation, the physical resource expansion capacity of the node is determined based on the following formula:

[0010] in, Represents the expansion of physical resource capacity. Represents the current physical resource gap, This represents the instantaneous load growth rate of the node at the current moment. This represents the instantaneous load growth acceleration of the node at the current moment.

[0011] In this embodiment of the application, expanding the physical resources of the node based on the physical resource expansion capacity includes: Based on the physical resource expansion capacity and the preset maximum expansion capacity for a single time step, the total number of expansion time steps is determined; wherein the expansion capacity of each time step does not exceed the preset maximum expansion capacity for a single time step. The node is expanded step by step according to the total expansion time steps.

[0012] In this embodiment of the application, the reclaiming of the node's physical resources based on the priority of each task in the node includes: Determine the target task, which is the lowest priority task in this node; According to a preset ratio, the physical resources occupied by the target task are gradually recovered. After each recovery of physical resources, it is determined whether the physical resource utilization rate of the node has reached a preset range. If not, the recovery continues; if so, the recovery ends.

[0013] Secondly, embodiments of this application provide a resource scheduling apparatus that implements the resource scheduling method corresponding to the first aspect described above. The function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function, and the modules can be software and / or hardware.

[0014] In one embodiment, the resource scheduling device includes: The input / output module is configured to obtain the physical resource utilization of each node and the priority of each task in each node; The processing module is configured to, when the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, determine the physical resource expansion capacity of that node based on the comprehensive load change trend of that node under a preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of that node, and expand the physical resources of that node based on the physical resource expansion capacity; wherein, the comprehensive load change trend includes rapid growth, steady growth, and decline; If the physical resource utilization rate of any node is lower than the second threshold of physical resource utilization rate of that node and the duration exceeds the preset duration, then the physical resources of that node will be reclaimed based on the priority of each task in that node.

[0015] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the resource scheduling method as described in the first aspect.

[0016] Fourthly, embodiments of this application provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the resource scheduling method described in the first aspect.

[0017] Fifthly, embodiments of this application provide a chip including a processor coupled to a transceiver for executing the technical solution provided in the first aspect of this application. In one possible design, the chip can also be a dedicated hardware structure for implementing the technical solution provided in the first aspect above; for example, processing involving neural network models can be implemented by a dedicated neural network processor or a graphics processor.

[0018] In a sixth aspect, embodiments of this application provide a chip system including a processor for implementing the functions involved in the first aspect above, such as generating or processing information involved in the resource scheduling method provided in the first aspect above.

[0019] In one possible design, the aforementioned chip system further includes a memory connected to the processor via a circuit structure. This memory stores program instructions and data necessary for the terminal. The chip system can be composed of a single chip or may include chips and other discrete devices. Further optionally, the chip also includes a communication interface to which the processor connects. The communication interface receives data and / or information that needs to be processed. The processor obtains the data and / or information from the communication interface, processes the data and / or information, and outputs the processing result through the communication interface. This communication interface can be an input / output interface.

[0020] In a seventh aspect, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a computer, cause the computer to execute the resource scheduling method provided in the first aspect.

[0021] Compared to existing technologies, this application embodiment comprehensively judges the future physical resource change trend of each node based on the overall load change trend of each node within a preset historical time window, as well as the instantaneous load growth rate and acceleration. Then, it issues instructions to expand or reclaim physical resources for each node. Because this application embodiment comprehensively judges the future load change trend of a node based on the overall load change trend, instantaneous load growth rate, and acceleration, and then determines how to schedule resources, rather than directly expanding or reclaiming resources based on the current resource utilization as in existing technologies, the resource scheduling method in this application embodiment can expand physical resources in advance for nodes whose future physical resource demand may increase significantly, reducing scheduling lag. Conversely, it will not blindly expand physical resources for nodes whose future physical resource demand may decrease, avoiding waste of physical resources caused by incorrect scheduling. Attached Figure Description

[0022] The objectives, features, and advantages of the embodiments of this application will become readily understood by referring to the accompanying drawings and the detailed description of the embodiments. Wherein: Figure 1 This is a flowchart illustrating a resource scheduling method according to an embodiment of this application; Figure 2 This is a schematic diagram of the structure of the resource scheduling device according to an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a computing device according to an embodiment of this application; Figure 4 This is a schematic diagram of a server structure in one embodiment of this application.

[0023] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0024] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects (e.g., the first preset value and the second preset value represent different preset values, and so on), and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The division of modules in the embodiments of this application is merely a logical division; in actual applications, there may be other division methods. For example, multiple modules may be combined into or integrated into another system, or some features may be ignored or not performed. Additionally, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interface, indirect coupling between modules, or electrical or other similar forms of communication connection, none of which are limited in the embodiments of this application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of this application.

[0025] This application also provides a resource scheduling method, related apparatus, and storage medium, which can be applied to a resource scheduling system in a distributed cluster scenario.

[0026] In existing technologies, resource scheduling in distributed clusters is mostly based on the current physical resource usage of each node. For example, if a node has a shortage of physical resources, its capacity is increased accordingly; if the node's current physical resource usage is low, its current physical resources are maintained, or its physical resources are reclaimed. However, this static scheduling strategy based solely on current physical resource usage is prone to incorrect allocation of physical resources or scheduling delays for nodes or tasks that immediately need physical resources.

[0027] For example, for a certain node, suppose the node currently has a physical resource shortage, but the utilization rate of the node's physical resources is rapidly decreasing. That is, after a short period of time, the node will no longer have a physical resource shortage, or even have a physical resource surplus. If the static scheduling method in the existing technology is used, the node will be expanded immediately after it is determined that the node has a physical resource shortage. Obviously, this scheduling method will incorrectly schedule more physical resources for the node, thus wasting physical resources.

[0028] For example, consider a node that has no physical resource shortage, but whose physical resource utilization is growing rapidly. This means that the node's demand for physical resources will increase significantly in a short period of time. If the static scheduling method in the existing technology is used, the node's physical resources will not be expanded when it is determined that the node currently has no physical resource shortage. Therefore, when the node's physical resource demand surges, expanding the node will obviously be delayed.

[0029] Compared to existing technologies, in this embodiment, based on the comprehensive load change trend of each node within a preset historical time window, as well as the instantaneous load growth rate and acceleration, the future load change of each node is comprehensively judged. Then, instructions are issued to expand or reclaim physical resources for them. This allows for the expansion of physical resources in advance for nodes whose future physical resource demand may increase significantly, reducing scheduling lag. For nodes whose future physical resource demand may decrease, expansion will not be carried out blindly, avoiding waste of physical resources caused by incorrect scheduling.

[0030] It should be noted that the computing devices involved in the embodiments of this application may be servers and / or terminal devices.

[0031] The server involved in the embodiments of this application can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing software, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, big data resource services, and artificial intelligence platforms.

[0032] Reference Figure 1 , Figure 1 This is a flowchart illustrating a resource scheduling method provided in an embodiment of this application. The method can be executed by a resource scheduling device and can be applied to distributed clusters requiring resource scheduling, performing resource scheduling on each node in the distributed cluster. The method includes steps 101-102: Step 101: Obtain the physical resource utilization rate of each node and the priority of each task in each node.

[0033] In this embodiment of the application, the resource scheduling method can be applied to the resource management system (Yet Another Resource Negotiator, YARN) of a distributed architecture (Hadoop). The distributed cluster includes multiple nodes. In YARN, a Resource Manager (RM) and an Application Master (AM) are deployed. The RM can monitor the physical resource usage of each node. The AM is deployed on each node, and in any given node, each task corresponds to an AM. The AM can determine the priority, task status, resource requirements, etc. of its corresponding task.

[0034] In addition, in the embodiments of this application, the physical resources of each node may include CPU and memory. The physical resources involved in this application refer to the objects of resource scheduling. For example, when scheduling CPU resources, the physical resource is CPU, and when scheduling memory resources, the physical resource is memory.

[0035] In this embodiment of the application, the physical resource utilization of each node can be obtained based on RM, and the priority of each task in each node can be obtained based on the AM corresponding to each task.

[0036] Step 102: If the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, then based on the comprehensive load change trend of that node under the preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of that node, determine the physical resource expansion capacity of that node, and expand the physical resources of that node based on the physical resource expansion capacity; wherein, the comprehensive load change trend includes rapid growth, steady growth and decline; If the physical resource utilization rate of any node is lower than the second threshold of physical resource utilization rate for that node and the duration exceeds the preset duration, then the physical resources of that node will be reclaimed based on the priority of each task in that node.

[0037] In this embodiment of the application, for any node, a first threshold and a second threshold representing the physical resource utilization rate can be preset, wherein the first threshold is less than 1 to ensure that each node has safe quantity redundancy, the first threshold is greater than the second threshold, and the second threshold is greater than 0.

[0038] In this embodiment, if the current physical resource utilization rate of a node is greater than a first threshold, it indicates that most of the node's physical resources are currently occupied by various tasks, and the safety redundancy is also partially occupied by tasks. If the current physical resource utilization rate of a node is lower than a second threshold, it indicates that most of the node's physical resources are currently available and not occupied by the node's tasks. If the current physical resource utilization rate of a node is between the first and second thresholds, it indicates that the node's physical resources can normally meet the current node's physical resource requirements and have a safety redundancy.

[0039] In this embodiment, when it is determined that the physical resource utilization of a certain node exceeds a first threshold, it can be preliminarily judged that most of the physical resources of the node are occupied by various tasks at the current moment, and the safety redundancy is also occupied by some tasks. Therefore, a preliminary judgment can be made that the physical resources of the node need to be expanded. However, in order to avoid the impact of a sudden increase in physical resources at the current moment, after determining that the physical resource utilization of the current moment is higher than the first threshold, this application also needs to determine the comprehensive load change trend of the node under a preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of the node. Based on the comprehensive load change trend under the preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of the node, it is determined whether to expand the node and by how much physical resources.

[0040] In this embodiment of the application, after determining that the physical resource utilization rate of a certain node at the current moment is higher than the first threshold corresponding to that node, the overall load change trend of that node can be determined based on the following method: Get the increase in physical resource usage for this node at each time step within a preset historical time window; Based on the increase in physical resource usage at each time step and the weight of each time step, the overall load change trend of the node is determined; wherein, in the preset historical time window, the weight of the earlier time step is less than the weight of the later time step.

[0041] In this embodiment of the application, the preset historical time window is a time window before the current moment. For example, the preset historical time window can be 30 seconds, 1 minute, 2 minutes, or 5 minutes before the current moment.

[0042] In the embodiments of this application, the length of each time step can also be preset, for example, each time step is 1 second, or 10 seconds, or 30 seconds, or 1 minute, etc.

[0043] In this embodiment of the application, the increase in physical resource usage at each time step can be obtained based on the RM. For example, the RM records the physical resource usage of the node at the beginning of each time step. Then, the difference between the physical resource usage at the beginning of any time step (the end of the previous time step) and the physical resource usage at the end of the previous time step (the beginning of the next time step) is the increase in physical resource usage for that time step.

[0044] Furthermore, in this embodiment, for each time step within a preset historical time window, the increase in physical resource usage corresponding to an earlier time step has a smaller impact on the judgment of the overall load change trend at the current moment, while the increase in physical resource usage corresponding to a later time step has a greater impact on the judgment of the overall load change trend at the current moment. Therefore, different weights can be assigned to the increase in physical resource usage corresponding to each time step according to the order of the time steps within the preset historical time window. The weight of the increase in physical resource usage of a time step further away from the current moment is smaller, and the weight of the increase in physical resource usage of a time step closer to the current moment is larger.

[0045] In this embodiment of the application, the overall load change trend of any node can be determined based on the following formula (1) and judgment conditions: (1) If S1 ≥ S1, then the overall load change trend is rapid growth; 0≤ If <S1, then the overall load trend is a steady increase; If the value is less than 0, the overall load trend is downward. in, This represents the overall load change trend value at the current time t, where T represents the number of time steps included in the preset historical time window. ) represents the increase in physical resource usage at time step (tk). S1 represents the weight corresponding to the time step ending at (tk), where k∈[0,T-1] and k is a positive integer, and S1 is a first preset value greater than zero.

[0046] Assuming the preset historical time window is 5 minutes and each time step is 1 minute, then a preset historical time window contains 5 time steps, i.e., T=5. Therefore, k can be 0, 1, 2, 3, or 4, as shown in Table 1 below. Table 1 shows the physical resource usage of a node at the end of each time step preceding time t. Table 1

[0047] Where, when k=0, = =70%, meaning that the physical resource utilization at time t is 70%. = =65%, representing the physical resource usage at the start time of a time step ending at time t. =5%, which means that the physical resource usage growth rate is 5% in the first time step before time t; When k=1, = =65%, meaning the physical resource usage at time (t-1) is 65%. = =58%, representing the physical resource usage at the start time of the time step ending at time (t-1). =7%, which means that the physical resource usage growth rate is 7% in the second time step before time t; When k=2, = =58%, meaning the physical resource usage at time (t-2) is 58%. = =50%, representing the physical resource usage at the start time of the time step ending at time (t-2). =8%, which means that the physical resource usage growth rate is 8% in the third time step before time t; When k=3 = =50%, meaning the physical resource usage at time (t-3) is 50%. = =45%, representing the physical resource usage at the start time of the time step ending at time (t-3). =5%, which means that the physical resource usage growth rate is 5% in the fourth time step before time t; When k=4 = =45%, representing the physical resource usage at time (t-4) as 45%. = =40%, representing the physical resource usage at the start time of the time step ending at time (t-4). =5%, which means that the physical resource usage growth rate is 5% in the fifth time step before time t; Furthermore, in the implementation of this application, the weights corresponding to each time step before the current time can be determined using an exponential decay method, for example: When k=0, the weight of the first time step preceding time t is: = =1; When k=1, the weight of the second time step before time t is: = ; When k=2, the weight of the third time step before time t is: = ; When k=3, the weight of the fourth time step preceding time t is: = ; When k=4, the weight of the fifth time step before time t is: = ; Where, 0 < <1, therefore, > > > > That is, the closer the time step is to the current time, the greater its weight, and the farther away the time step is from the current time, the smaller its weight.

[0048] in, This can be preset. Once the physical resource usage growth at each time step within the preset historical time window is determined, as well as the corresponding weight of each time step, the overall load change trend value within the preset historical time window, ending at the current time t, can be calculated. .

[0049] In this embodiment of the application, a first preset value S1 can also be set, which is the comprehensive load change trend value calculated under a preset historical time window with the current time t as the end time. Afterwards, if If ≥S1, it indicates that, taking the current time t as the end time, the overall load change trend within the preset historical time window is rapid growth, meaning the load of this node is continuously and rapidly increasing; if 0≤ <S1 indicates that, taking the current time t as the end time, the overall load change trend within the preset historical time window is increasing, but the increase is relatively stable, meaning the load at this node is rising steadily; if If <0, it means that the overall load change trend under the preset historical time window before the current time t is downward, that is, the load of the node is gradually decreasing.

[0050] In existing technologies, once it is determined that the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, a capacity expansion operation is immediately performed on that node based on the physical resource gap. However, based on the comprehensive load change trend analysis of the aforementioned preset historical time window, it can be seen that for any node at a certain moment, when its physical resource utilization rate exceeds the first threshold corresponding to that node, the overall load of that node may also be on a downward trend. Moreover, even if the load of that node at the current moment is on an upward trend, the upward trend includes rapid growth and steady growth. When the load of a node approaches zero, the load is basically not increasing. Therefore, blindly expanding the load of this node based on the physical resource gap will inevitably lead to a waste of physical resources when the overall load is decreasing. When the load is growing rapidly, if the expansion is based solely on the physical resource gap, the physical resource gap will continue to appear in a short period of time. When the node is expanded again in the future, it will cause a lag in the expansion of physical resources.

[0051] In this embodiment of the application, if the physical resource utilization rate of a certain node exceeds the first threshold corresponding to the node at the current time, the basic expansion capacity can be determined based on the physical resource utilization rate of the node and the first threshold of resource utilization corresponding to the node, as shown in the following formula (2): Vbase=Uthreshold Ucurrent(2) Wherein, Uthreshold represents the physical resource utilization rate of the node at the current moment, and Ucurrent represents the first threshold of the node. The difference between the two is the physical resource gap Vbase of the node at the current moment. Additionally, Vbase is the percentage of the node's physical resource gap to its total physical resources. Multiplying this by the node's total physical resources yields the node's basic expansion capacity at the current moment. In this embodiment, after determining the node's physical resource gap at the current moment, the node is not immediately expanded based on this gap. Instead, the instantaneous load growth rate and instantaneous load growth acceleration of the node at the current moment are calculated, and combined with the node's comprehensive load change trend within a preset historical time window, the basic expansion capacity corresponding to the node is adjusted to avoid wasting physical resources or causing delays.

[0052] For example, in this embodiment of the application, if the overall load change trend of the node is rapid growth and the instantaneous load growth rate of the node is greater than the second preset value, then the physical resource gap of the node is expanded according to the first ratio to obtain the physical resource expansion capacity. If the overall load change trend of the node is a steady increase, and the instantaneous load growth rate of the node is between 0 and a second preset value, then the physical resource gap of the node is expanded according to the second ratio to obtain the physical resource expansion capacity, wherein the second ratio is less than the first ratio. If the overall load of the node is decreasing and the instantaneous load growth rate of the node is less than 0, then the physical resource gap of the node is reduced according to the third ratio to obtain the physical resource expansion capacity.

[0053] Specifically, when the overall load of a node shows a rapid growth trend, and the instantaneous load growth rate of the node is greater than the second preset value, it indicates that the load of the node is growing rapidly, both within the preset historical time window and at the current moment. If expansion is only based on the physical resource gap at the current moment, a second expansion will inevitably be needed. When the second expansion is carried out, it will cause expansion lag. Therefore, the basic expansion capacity can be significantly increased based on the first ratio to obtain the physical resource expansion capacity.

[0054] In addition, when the overall load change trend of the node is a steady increase, and the instantaneous load growth rate of the node is greater than 0 and less than the second preset value, it indicates that the load of the node is increasing, but the increase is relatively stable, whether under the preset historical time window or at the current moment. In this case, the basic expansion capacity can be increased by a small amount based on the second ratio to obtain the physical resource expansion capacity.

[0055] In addition, when the total physical resources of the node show a decreasing trend and the instantaneous load growth rate of the node is less than 0, it indicates that the load of the node is decreasing both under the preset historical time window and at the current moment. Although there is a physical resource gap at the current moment, as the load decreases, there is a high probability that there will be no physical resource gap in the future. If the capacity is expanded immediately based on the current physical resource gap, there is a high probability that the physical resources will be idle in the future, thus causing a waste of physical resources. Therefore, the basic expansion capacity can be reduced based on the third ratio to obtain the physical resource expansion capacity.

[0056] In this embodiment of the application, the physical resource expansion capacity of the node can be determined based on the following formula (3): (3) in, Represents the expansion of physical resource capacity. Represents the current physical resource gap, This represents the instantaneous load growth rate of the node at the current moment. This represents the instantaneous load growth acceleration of the node at the current moment.

[0057] As shown in formula (3) above, This is the first derivative of the node's load at the current moment, representing the load growth rate at the current moment. It is the second derivative of the node's load at the current moment, representing the acceleration of the node's load growth at the current moment. The second preset value is a value greater than zero.

[0058] when When the load is greater than or equal to the second preset value, the load is increasing rapidly, and at this time, there is a shortage of physical resources. Expanding capacity based on existing capacity; when When the value is greater than 0 and less than the second preset value, the load is increasing, but the rate of increase is less than [a certain value]. The rate of increase when it is greater than or equal to the second preset value, at which point the current physical resource gap... Expanding the capacity based on the existing capacity, but by a smaller amount than the previous expansion. The expansion range when it is greater than or equal to the second preset value; when A value less than 0 indicates a decrease in load, which corresponds to a current physical resource gap. Reduce capacity expansion on the basis of existing capacity; In addition, when When the value is greater than zero, the load increases faster, indicating that the load will increase further in the future. At this time, an additional capacity expansion ratio should be added. When the value is less than zero, the rate of load increase slows down, thus reducing the load. Expansion To minimize the impact of excessive expansion; When the load change rate remains stable at zero, then based on You can simply expand the capacity.

[0059] In this embodiment of the application, after determining the physical resource expansion capacity of the node, the node can be expanded based on the following method: Based on the physical resource expansion capacity and the preset maximum expansion capacity for a single time step, the total number of expansion time steps is determined; wherein the expansion capacity of each time step does not exceed the preset maximum expansion capacity for a single time step. The node is expanded step by step according to the total expansion time steps.

[0060] Each node can preset its maximum expansion capacity per time step. Therefore, once the physical resource expansion capacity is determined... Then, the number of expansion steps can be determined according to the preset maximum expansion capacity of a single time step, and then each time step can be expanded according to the preset maximum expansion capacity of a single time step. Alternatively, in other embodiments, the expansion capacity of each time step may not exceed the preset maximum expansion capacity of a single time step, for example, by expanding the node in steps according to half of the preset maximum expansion capacity of a single time step. In this embodiment of the application, the step-by-step expansion method can achieve a smooth transition and prevent the distributed cluster from becoming unstable due to excessive adjustment at once.

[0061] In addition, in this embodiment of the application, two adjacent expansion operations can be performed according to a first preset time interval.

[0062] The above describes how resource scheduling works when the physical resource utilization of a node exceeds the first threshold. Next, we will describe how resource scheduling works when the physical resource utilization is below the second threshold.

[0063] In this embodiment, the second threshold is less than the first threshold. When the physical resource utilization of a node is lower than the second threshold, it indicates that the node has a low load at the current moment and its physical resources are largely idle. However, to avoid the low physical resource utilization at the current moment being caused by a sudden drop in load, in this embodiment, after determining that the physical resource utilization of a node is lower than the second threshold, the physical resources of the node are not immediately reclaimed. Instead, the physical resource utilization of the node is monitored for a period of time until the duration of the physical resource utilization of the node being lower than the second threshold exceeds a preset duration. At this time, it can be determined that the physical resource utilization of the node is lower than the second threshold and is not caused by a sudden drop in load. The physical resources of the node can then be reclaimed.

[0064] In this embodiment of the application, the physical resources of the node can be reclaimed in the following ways: Determine the target task, which is the lowest priority task in this node; According to a preset ratio, the physical resources occupied by the target task are gradually recovered. After each recovery of physical resources, it is determined whether the physical resource utilization rate of the node has reached a preset range. If not, the recovery continues; if so, the recovery ends.

[0065] In this embodiment of the application, after determining that the node needs to reclaim physical resources, the priority of each task in the node can be determined first, and then the physical resources occupied by the low-priority tasks can be reclaimed first.

[0066] In this embodiment of the application, the target task is the task with the lowest current priority among the nodes that need to reclaim physical resources. After the target task is determined, the physical resources occupied by the node are reclaimed step by step. The physical resources reclaimed each time do not exceed a preset proportion of the physical resources occupied by the task, so as to avoid system errors caused by reclaiming all the physical resources occupied by the task at once.

[0067] In addition, in this embodiment of the application, after each physical resource is recycled, it is determined whether the utilization rate of the recycled physical resources of the node has reached a preset range, such as whether it has reached between the second threshold and the first threshold. If it has, it means that the load is in a normal state and there is no need to recycle again. If it has not, it means that the current load is still low and physical resources need to be recycled until the utilization rate of the physical resources of the node reaches between the second threshold and the first threshold.

[0068] In addition, in this embodiment of the application, two adjacent recovery actions can be performed according to a second preset time interval.

[0069] In this embodiment, based on the comprehensive load change trend of each node under a preset historical time window, as well as the instantaneous load growth rate and acceleration, the future physical resource changes of each node are comprehensively judged. Then, instructions are made to expand physical resources or reclaim physical resources. Thus, for nodes whose physical resources may increase significantly in the future, physical resources can be expanded in advance to reduce scheduling lag. For nodes whose physical resource demand may decrease in the future, expansion will not be carried out blindly to avoid waste of physical resources caused by incorrect scheduling.

[0070] The above describes a resource scheduling method in the embodiments of this application. The following describes a resource scheduling device (e.g., a server) that performs the above resource scheduling method.

[0071] See Figure 2 ,like Figure 2 The diagram illustrates the structure of a resource scheduling device, which can be applied to resource scheduling scenarios in distributed clusters. The resource scheduling device may include an input / output module 601 and a processing module 602. The functional implementations of the processing module 602 and the input / output module 601 can be found in [reference needed]. Figure 1 The operations performed in the corresponding embodiments will not be described in detail here. For example, the processing module 602 can be used to control the sending, receiving, and acquiring operations of the input / output module 601.

[0072] The input / output module 601 is configured to obtain the physical resource utilization rate of each node and the priority of each task in each node. The processing module 602 is configured to, when the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, determine the physical resource expansion capacity of that node based on the comprehensive load change trend of that node under a preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of that node, and expand the physical resources of that node based on the physical resource expansion capacity; wherein, the comprehensive load change trend includes rapid growth, steady growth, and decline; If the physical resource utilization rate of any node is lower than the second threshold of physical resource utilization rate of that node and the duration exceeds the preset duration, then the physical resources of that node will be reclaimed based on the priority of each task in that node.

[0073] In some implementations, the processing module 602 is further configured to: Get the increase in physical resource usage for this node at each time step within a preset historical time window; Based on the increase in physical resource usage at each time step and the weight of each time step, the overall load change trend of the node is determined; wherein, in the preset historical time window, the weight of the earlier time steps is less than the weight of the later time steps.

[0074] In some implementations, the processing module 602 is further configured to determine the overall load change trend based on the following formula:

[0075] If S1 ≥ S1, then the overall load change trend is rapid growth; 0≤ If <S1, then the overall load trend is a steady increase; If the value is less than 0, the overall load trend is downward. in, This represents the overall load change trend value at the current time t, where T represents the number of time steps included in the preset historical time window. ) represents the increase in physical resource usage at time step (tk). S1 represents the weight corresponding to the time step ending at (tk), where k∈[0,T-1] and k is a positive integer, and S1 is a first preset value greater than zero.

[0076] In some implementations, the processing module 602 is further configured to: If the overall load of the node changes rapidly and the instantaneous load growth rate of the node is greater than the second preset value, then the physical resource gap of the node is expanded according to the first ratio to obtain the physical resource expansion capacity. If the overall load change trend of the node is a steady increase, and the instantaneous load growth rate of the node is between 0 and a second preset value, then the physical resource gap of the node is expanded according to the second ratio to obtain the physical resource expansion capacity, wherein the second ratio is less than the first ratio. If the overall load of the node is decreasing and the instantaneous load growth rate of the node is less than 0, then the physical resource gap of the node is reduced according to the third ratio to obtain the physical resource expansion capacity.

[0077] In some implementations, the processing module 602 is further configured to: The physical resource expansion capacity of this node is determined based on the following formula:

[0078] in, Represents the expansion of physical resource capacity. Represents the current physical resource gap, This represents the instantaneous load growth rate of the node at the current moment. This represents the instantaneous load growth acceleration of the node at the current moment.

[0079] In some implementations, the processing module 602 is further configured to: Based on the physical resource expansion capacity and the preset maximum expansion capacity for a single time step, the total number of expansion time steps is determined; wherein the expansion capacity of each time step does not exceed the preset maximum expansion capacity for a single time step. The node is expanded step by step according to the total expansion time steps.

[0080] In some implementations, the processing module 602 is further configured to: Determine the target task, which is the lowest priority task in this node; According to a preset ratio, the physical resources occupied by the target task are gradually recovered. After each recovery of physical resources, it is determined whether the physical resource utilization rate of the node has reached a preset range. If not, the recovery continues; if so, the recovery ends.

[0081] In this embodiment, the processing module 602 comprehensively judges the future physical resource changes of each node based on the overall load change trend of each node under the preset historical time window, as well as the instantaneous load growth rate and acceleration. Then, it issues instructions to expand physical resources or reclaim physical resources. Thus, for nodes whose physical resources may increase significantly in the future, physical resources can be expanded in advance to reduce scheduling lag. For nodes whose physical resource demand may decrease in the future, physical resources will not be expanded blindly to avoid waste of physical resources caused by incorrect scheduling.

[0082] The resource scheduling device 60 in this application embodiment has been described above from the perspective of modular functional entities. The resource scheduling device in this application embodiment will be described below from the perspective of hardware processing.

[0083] It should be noted that, Figure 2 The physical device corresponding to the input / output module 601 shown can be a transceiver, radio frequency circuit, communication module, and input / output (I / O) interface, etc., and the physical device corresponding to the processing module 602 can be a processor.

[0084] Figure 2 The devices shown can all have the following characteristics: Figure 3 The structure shown, when Figure 2 The resource scheduling device 60 shown has, for example: Figure 3 When the structure shown is used, Figure 3 The processor and transceiver in the device can perform the same or similar functions as the processing module 602 and input / output module 601 provided in the aforementioned device embodiments. Figure 3 The memory storage processor in the memory needs to call computer programs when executing the above resource scheduling method.

[0085] This application also relates to a chip system including at least one processor and an interface circuit. The processor includes a plurality of vector storage units. The processor is used to perform instruction and / or data interaction through the interface circuit, causing the chip system to perform the methods of any of the above embodiments.

[0086] In one possible implementation, the chip system may also directly include a memory in which computer programs or computer instructions are stored.

[0087] For example, the memory can be volatile memory or non-volatile memory, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM).

[0088] This application also relates to a processor, which includes a plurality of storage units for calling computer programs or computer instructions stored in the memory to cause the processor to execute the methods described in any of the above embodiments.

[0089] For example, in the embodiments of this application, the processor is an integrated circuit chip with signal processing capabilities. For instance, the processor may be an FPGA, a general-purpose processor, a DSP, an ASIC, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, a SoC, a CPU, a network processor (NP), a microcontroller unit (MCU), a PLD, or other integrated chips, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. In one possible implementation, the embodiments of this application also provide a computer-readable storage medium storing program code, which, when executed on the computer, causes the computer to perform the above-described method embodiments.

[0090] This application also provides a server; please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1100 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1122 (e.g., one or more processors) and memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing application programs 1142 or data 1144. The memory 1132 and storage media 1130 may be temporary or persistent storage. The program stored in the storage media 1130 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 1122 may be configured to communicate with the storage media 1130 and execute the series of instruction operations in the storage media 1130 on the server 1100.

[0091] Server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.

[0092] The steps performed by the server in the above embodiments can be based on this Figure 4 The structure of server 1100 shown. For example, as in the above embodiment, by Figure 2 The steps performed by the resource scheduling device 60 shown can be based on this Figure 4 The server structure is shown. For example, the central processing unit 1122 performs the following operations by calling instructions from memory 1132: The physical resource utilization of each node and the priority of each task in each node are obtained through the input / output interface 1158. When the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, the physical resource expansion capacity of that node is determined based on the comprehensive load change trend of that node under a preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of that node, and the physical resource expansion capacity of that node is expanded based on the physical resource expansion capacity; wherein, the comprehensive load change trend includes rapid growth, steady growth, and decline. If the physical resource utilization rate of any node is lower than the second threshold of physical resource utilization rate of that node and the duration exceeds the preset duration, then the physical resources of that node will be reclaimed based on the priority of each task in that node.

[0093] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0094] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0095] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, apparatuses, or modules, and may be electrical, mechanical, or other forms.

[0096] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0097] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0098] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0099] The computer program product includes one or more computer instructions. When the computer program is loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. 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. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).

[0100] The technical solutions provided in the embodiments of this application have been described in detail above. Specific examples have been used in the embodiments of this application to illustrate the principles and implementation methods of the embodiments of this application. The description of the above embodiments is only for the purpose of helping to understand the methods and core ideas of the embodiments of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of this application. Therefore, the content of this specification should not be construed as a limitation on the embodiments of this application.

Claims

1. A resource scheduling method applied to a distributed cluster, wherein the distributed cluster has multiple nodes, characterized in that, The method includes: Obtain the physical resource utilization of each node, as well as the priority of each task within each node; If the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, then based on the overall load change trend of that node under a preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of that node, the physical resource expansion capacity of that node is determined, and the physical resource expansion capacity of that node is expanded based on the physical resource expansion capacity; wherein, the overall load change trend includes rapid growth, steady growth and decline. If the physical resource utilization rate of any node is lower than the second threshold of physical resource utilization rate for that node and the duration exceeds the preset duration, then the physical resources of that node will be reclaimed based on the priority of each task in that node.

2. The resource scheduling method as described in claim 1, characterized in that, The overall load change trend of any node is determined based on the following method: Get the increase in physical resource usage for this node at each time step within a preset historical time window; Based on the increase in physical resource usage at each time step and the weight of each time step, the overall load change trend of the node is determined; wherein, in the preset historical time window, the weight of the earlier time step is less than the weight of the later time step.

3. The resource scheduling method as described in claim 2, wherein the overall load change trend is determined based on the following formula: If S1 ≥ S1, then the overall load change trend is rapid growth; 0≤ If <S1, then the overall load trend is a steady increase; If the value is less than 0, the overall load trend is downward. in, This represents the overall load change trend value at the current time t, where T represents the number of time steps included in the preset historical time window. ) represents the increase in physical resource usage at time step (tk). S1 represents the weight corresponding to the time step ending at (tk), where k∈[0,T-1] and k is a positive integer, and S1 is a first preset value greater than zero.

4. The resource scheduling method as described in claim 1, wherein determining the physical resource expansion capacity of the node based on the comprehensive load change trend of the node within a preset historical time window, and the instantaneous load growth rate and instantaneous load growth acceleration of the node, includes: If the overall load of the node changes rapidly and the instantaneous load growth rate of the node is greater than the second preset value, then the physical resource gap of the node is expanded according to the first ratio to obtain the physical resource expansion capacity. If the overall load change trend of the node is a steady increase, and the instantaneous load growth rate of the node is between 0 and a second preset value, then the physical resource gap of the node is expanded according to the second ratio to obtain the physical resource expansion capacity, wherein the second ratio is less than the first ratio. If the overall load of the node is decreasing and the instantaneous load growth rate of the node is less than 0, then the physical resource gap of the node is reduced according to the third ratio to obtain the physical resource expansion capacity.

5. The resource scheduling method as described in claim 1, wherein the physical resource expansion capacity of the node is determined based on the following formula: in, Represents the expansion of physical resource capacity. Represents the current physical resource gap, This represents the instantaneous load growth rate of the node at the current moment. This represents the instantaneous load growth acceleration of the node at the current moment.

6. The resource scheduling method as described in claim 1, wherein expanding the physical resources of the node based on the physical resource expansion capacity includes: Based on the physical resource expansion capacity and the preset maximum expansion capacity for a single time step, the total number of expansion time steps is determined; wherein the expansion capacity of each time step does not exceed the preset maximum expansion capacity for a single time step. The node is expanded step by step according to the total expansion time steps.

7. The resource scheduling method as described in claim 1, wherein reclaiming the physical resources of the node based on the priority of each task in the node includes: Determine the target task, which is the lowest priority task in this node; According to a preset ratio, the physical resources occupied by the target task are gradually recovered. After each recovery of physical resources, it is determined whether the physical resource utilization rate of the node has reached a preset range. If not, the recovery continues; if so, the recovery ends.

8. A resource scheduling device, characterized in that, The device includes: The input / output module is configured to obtain the physical resource utilization of each node and the priority of each task in each node; The processing module is configured to, when the physical resource utilization rate of any node exceeds the first threshold corresponding to that node, determine the physical resource expansion capacity of that node based on the comprehensive load change trend of that node under a preset historical time window, as well as the instantaneous load growth rate and instantaneous load growth acceleration of that node, and expand the physical resources of that node based on the physical resource expansion capacity; wherein, the comprehensive load change trend includes rapid growth, steady growth, and decline; If the physical resource utilization rate of any node is lower than the second threshold of physical resource utilization rate of that node and the duration exceeds the preset duration, then the physical resources of that node will be reclaimed based on the priority of each task in that node.

9. A computing device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It includes instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1-7.