Online resource scheduling method, device, equipment, medium and product
By decomposing tasks into subtasks in heterogeneous clusters and performing secondary allocation based on execution time and sliding window adjustment factors, the problem of unbalanced resource allocation and real-time requirements is solved, and the computing resource utilization and response speed are improved.
Patent Information
- Application Number
- CN202411761741.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-25
AI Technical Summary
In heterogeneous cluster environments, resource allocation is unbalanced and difficult to meet real-time requirements, resulting in reduced system processing efficiency and increased response time.
By obtaining the task to be executed, decompose it into multiple subtasks, and assigning the subtasks at one time at the first moment. Calculate the execution time and reallocation time of each node, and determine the secondary allocation plan according to the sliding window adjustment factor and size to optimize resource utilization and response speed.
It improves the utilization rate of computing resources in heterogeneous clusters and the response speed of processing real-time data, and enhances the stability and reliability of the system.
Smart Images

Figure CN119883596A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing, and in particular to an online resource scheduling method, device, equipment, medium and product. Background Art
[0002] In recent years, heterogeneous clusters have become one of the important directions for the development of cloud computing. A single physical processor can no longer meet the needs of large-scale data processing. In a heterogeneous cluster, a task is usually decomposed into multiple subtasks, and these subtasks are assigned to multiple processor cores for simultaneous execution through a task scheduler. This can utilize the parallel processing capabilities of multi-core processors to improve the execution speed and efficiency of tasks.
[0003] Heterogeneous clusters can improve the reliability and fault tolerance of the system. When a processor core fails or a task is executed incorrectly, the task can be reallocated to other processor cores to ensure normal execution of the task, thereby improving the stability and reliability of the system. Heterogeneous clusters can provide higher computing performance and better resource utilization without increasing the number of physical servers. For cloud computing service providers, it can reduce service costs and improve service reliability and scalability. At the same time, for users, they can also obtain higher computing performance and more flexible resource management methods.
[0004] Although resource scheduling for heterogeneous clusters can improve the overall performance of cloud computing, provide users with a better cloud service experience, and bring better economic benefits to cloud service providers and users, there are currently two main shortcomings.
[0005] 1. Unbalanced resource allocation: In a heterogeneous cluster environment, resource allocation may be unbalanced. Some cores may be overloaded while other cores are lightly loaded, which may cause some tasks to be processed more slowly while other tasks can be completed faster, reducing the overall processing efficiency of the system.
[0006] 2. Difficulty meeting real-time requirements: In a heterogeneous cluster environment, some tasks may need to wait for a long time to get the processor core assigned. This will increase the task response time and reduce the system's real-time and user experience. Overloaded processor cores may cause system crashes or performance degradation due to excessive load, thus affecting the reliability and stability of the system.
[0007] In summary, an online resource scheduling method that can improve the utilization of computing resources in heterogeneous clusters and increase the response speed of processing real-time data is urgently needed. Summary of the invention
[0008] Based on the above technical problems, the embodiments of the present application provide an online resource scheduling method, device, equipment, medium and product, aiming to improve the utilization rate of computing resources in a heterogeneous cluster and the response speed of processing real-time data.
[0009] A first aspect of an embodiment of the present application provides an online resource scheduling method, the method comprising:
[0010] Obtaining a first task to be executed, and decomposing the first task into a plurality of subtasks;
[0011] Assigning a first subtask to a first node at a first moment;
[0012] In the case where the first node is occupied at the first moment, a first execution time and a second execution time of the first node are calculated respectively, the first execution time is used to express the total time required for the first node to complete the first subtask after completing the current subtask, and the second execution time is used to express the total time required for reallocating the first subtask to an idle node and executing the first subtask in the idle node;
[0013] Determining, according to an adjustment factor of a sliding window in a calculation period to which the first node belongs at the first moment, and a size of the sliding window of the first node, a size of an adjusted sliding window in a calculation period to which the first node belongs at the first moment;
[0014] A secondary allocation scheme for the first subtask is determined according to the first execution duration, the second execution duration, and the size of the adjusted sliding window.
[0015] Optionally, the method further comprises:
[0016] When the minimum value between the first execution duration and the second execution duration is not greater than the size of the adjusted sliding window, determining that the first subtask can be executed and completed within the adjusted sliding window of the first node;
[0017] When the first execution time is less than the second execution time, the first subtask is kept in the first node to wait for execution;
[0018] When the first execution duration is greater than the second execution duration, the first subtask is allocated to the idle node for execution.
[0019] Optionally, the method further comprises:
[0020] When the minimum value between the first execution duration and the second execution duration is greater than the size of the adjusted sliding window, determining that the first subtask cannot be executed and completed within the adjusted sliding window of the first node;
[0021] Allocating the first subtask to a second node other than the first node;
[0022] In the case where the second node is occupied at the first moment, a third execution time and a fourth execution time of the second node are calculated respectively, the third execution time is used to express the total time for the second node to complete the first subtask after completing the current subtask, and the fourth execution time is used to express the total time required to reallocate the first subtask to an idle node and complete the first subtask in the idle node;
[0023] Determining, according to the adjustment factor of the sliding window of the second node in the calculation period to which the first moment belongs and the size of the sliding window of the second node, the size of the adjusted sliding window of the second node in the calculation period to which the first moment belongs;
[0024] A secondary allocation scheme for the first subtask is determined according to the third execution duration, the fourth execution duration, and the size of the adjusted sliding window within the calculation cycle to which the second node belongs at the first moment.
[0025] Optionally, the method further comprises:
[0026] Calculate the response balance point of the first node at each moment in the computing cycle to which the first moment belongs according to the data transmission delay of the first node, the time for processing the subtask, the weight factor of the data transmission delay and the response time, and the number of times the first subtask is reallocated;
[0027] Calculate the total time that the first node is expected to complete the first subtask based on the data transmission delay, subtask processing time, response time, and the number of times the first subtask is reallocated of the first node;
[0028] An adjustment factor of the sliding window of the first node at each moment in a calculation cycle to which the first moment belongs is determined according to the response balance point and the total time expected to complete the first subtask.
[0029] Optionally, the method further comprises:
[0030] When the first node is not occupied at the first moment, the first subtask is allocated to the first node for execution.
[0031] Optionally, the method further comprises:
[0032] Set a task completion counter, the initial count of the counter is 0;
[0033] After the first node completes the first subtask, the counter count is increased by 1; and after each other subtask in the plurality of subtasks is completed, the counter count is increased by 1;
[0034] When the count value of the counter is consistent with the number of the plurality of subtasks, it is determined that the execution of the first task is completed.
[0035] A second aspect of an embodiment of the present application provides an online resource scheduling device, the device comprising:
[0036] A first task acquisition module, used to acquire a first task to be executed and decompose the first task into multiple subtasks;
[0037] A first subtask allocation module, used to allocate a first subtask to a first node at a first moment;
[0038] an execution duration calculation module, used to respectively calculate a first execution duration and a second execution duration of the first node when the first node is occupied at the first moment, wherein the first execution duration is used to express the total duration for the first node to complete the first subtask after completing the current subtask, and the second execution duration is used to express the total duration required for reallocating the first subtask to an idle node and executing the first subtask in the idle node;
[0039] a sliding window size determination module, configured to determine the size of the adjusted sliding window of the first node in the calculation period to which the first moment belongs according to the adjustment factor of the sliding window in the calculation period to which the first node belongs at the first moment and the size of the sliding window of the first node;
[0040] A secondary allocation scheme determining module is used to determine a secondary allocation scheme for the first subtask according to the first execution time, the second execution time and the size of the adjusted sliding window.
[0041] Optionally, the secondary allocation scheme determination module includes:
[0042] A first allocation scheme determination submodule is configured to determine that the first subtask can be executed and completed within the adjusted sliding window of the first node when the minimum value between the first execution duration and the second execution duration is not greater than the size of the adjusted sliding window;
[0043] A first allocation submodule, configured to, when the first execution time is less than the second execution time, continue to retain the first subtask in the first node to wait for execution;
[0044] A second allocation submodule is configured to allocate the first subtask to the idle node for execution when the first execution duration is greater than the second execution duration.
[0045] Optionally, the secondary allocation scheme determination module further includes:
[0046] A second allocation scheme determination submodule is configured to determine that the first subtask cannot be executed and completed within the adjusted sliding window of the first node when the minimum value between the first execution duration and the second execution duration is greater than the size of the adjusted sliding window;
[0047] A second node allocation submodule, used for allocating the first subtask to a second node other than the first node;
[0048] an execution duration calculation module, used to respectively calculate a third execution duration and a fourth execution duration of the second node when the second node is occupied at the first moment, the third execution duration being used to express the total duration for the second node to complete the first subtask after completing the current subtask, and the fourth execution duration being used to express the total duration required for reallocating the first subtask to an idle node and executing the first subtask in the idle node;
[0049] a sliding window size determination module, configured to determine the size of the adjusted sliding window of the second node in the calculation period to which the first moment belongs, according to the adjustment factor of the sliding window in the calculation period to which the second node belongs at the first moment, and the size of the sliding window of the second node;
[0050] A secondary allocation scheme determination module is used to determine the secondary allocation scheme of the first subtask based on the third execution time, the fourth execution time and the size of the adjusted sliding window within the calculation cycle to which the second node belongs at the first moment.
[0051] Optionally, the sliding window size determination module includes:
[0052] a response balance point calculation submodule, configured to calculate the response balance point of the first node at each moment in the calculation cycle to which the first moment belongs, according to the data transmission delay of the first node, the time for processing the subtask, the weight factor of the data transmission delay and the response time, and the number of times the first subtask is reallocated;
[0053] an expected total time calculation submodule, used to calculate the total time expected for the first node to complete the first subtask based on the data transmission delay of the first node, the time for processing the subtask, the response time, and the number of times the first subtask is reallocated;
[0054] The adjustment factor determination submodule is used to determine the adjustment factor of the sliding window of the first node at each moment in the calculation cycle to which the first moment belongs according to the response balance point and the total time expected to complete the first subtask.
[0055] Optionally, the online resource scheduling device further includes:
[0056] A primary allocation scheme determination module is used to allocate the first subtask to the first node for execution when the first node is not occupied at the first moment.
[0057] Optionally, the online resource scheduling device further includes:
[0058] A counter setting module is used to set a task completion counter, wherein the initial count of the counter is 0;
[0059] a counting module, configured to increase the counter by 1 after the first node completes the first subtask; and to increase the counter by 1 after each other subtask among the multiple subtasks is completed;
[0060] The task completion confirmation module is used to determine that the first task is completed when the count value of the counter is consistent with the number of the multiple subtasks.
[0061] A third aspect of an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, an online resource scheduling method as in the first aspect of an embodiment of the present application is implemented.
[0062] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the online resource scheduling method of the first aspect of the embodiment of the present application is implemented.
[0063] A fifth aspect of an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the online resource scheduling method of the first aspect of an embodiment of the present application.
[0064] According to the online resource scheduling method proposed in the embodiment of the present application, after obtaining the first task to be executed, the first task is first decomposed into multiple subtasks, and the multiple subtasks are allocated once at the first moment. The subtasks allocated to the idle node can be executed directly, and the subtasks allocated to the occupied first node need to calculate the total time to wait for the first node to complete the current subtask and then execute and complete the first subtask, that is, the first execution time. It is also necessary to calculate the total time required to reallocate the first subtask to the idle node and execute and complete the first subtask in the idle node, that is, the second execution time. According to the adjustment factor of the sliding window in the calculation cycle to which the first node belongs at the first moment and the sliding window size of the first node, the size of the sliding window adjusted in the calculation cycle is determined. Finally, the secondary allocation plan of the first subtask is determined according to the first execution time, the second execution time, and the size of the adjusted sliding window.
[0065] In this application, the first task is decomposed into multiple subtasks, which are executed in the nodes of the server respectively, and the subtasks can be secondary allocated according to the execution status of the current tasks of each node to achieve efficient scheduling of computing resources. By introducing the concept of adjustable elastic sliding window, the size of the sliding window can be adaptively adjusted in combination with the computing power of the current node. When the computing power is insufficient or excessive, the size of the sliding window can be adjusted to allocate tasks with appropriate workloads to the computing nodes, which effectively improves the response speed for real-time data processing and provides cloud users with higher computing performance and better cloud service experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0067] Figure 1 is a flow chart of an online resource scheduling method proposed in an embodiment of the present application;
[0068] Figure 2 This is a schematic diagram of an online resource scheduling system proposed in an embodiment of the present application;
[0069] Figure 3 is a structural block diagram of an online resource scheduling device provided by an embodiment of the present application;
[0070] Figure 4 It is a schematic diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0072] In the drawings, the size of the constituent elements, the thickness of the layer or the area may be exaggerated for the sake of clarity. Therefore, any implementation of the present disclosure is not necessarily limited to the size shown in the drawings, and the shapes and sizes of the components in the drawings do not reflect the true proportions. In addition, the drawings schematically show ideal examples, and any implementation of the present disclosure is not limited to the shapes or values shown in the drawings.
[0073] In related technologies, resource scheduling and management for heterogeneous clusters is the key to achieving higher resource utilization and better computing performance. Through dynamic resource monitoring, resource reservation, confirmation response and other technical means, the scheduling and management of virtual machine and physical server resources can be better achieved.
[0074] In the heterogeneous cluster resource scheduling scheme in the related art, there is a one-cloud-multiple-core scheduling method. When scheduling cloud server computing resources, cloud server computing resources are allocated to different physical machines through a scoring mechanism. After a physical machine obtains the computing resources of the cloud master server, the physical properties of each physical machine are updated, and each physical machine is re-scored in the next cycle, and so on, to complete the allocation and scheduling of all computing resources of the cloud server. However, in the actual operation of this invention, uneven resource allocation may occur. Some physical machines may be overloaded due to obtaining a large amount of computing resources, while other physical machines may not be fully utilized due to not obtaining enough computing resources. This uneven distribution of cloud server computing resources may cause some application performance to decline significantly.
[0075] In another related technology, a method for deploying containers in a multi-architecture cluster is provided. The invention first needs to calculate the available computing power of each computing node, and then normalize the available computing power of each node. Then, it needs to receive the deployment request information of the container in the multi-architecture cluster, and select the appropriate content distribution strategy based on the available computing power normalized in the early stage and the collected workload-related information. Through the collected workload-related information and content distribution strategy, the scheduler and proxy components are used to provide each node with the required computing resources. However, in some business scenarios with high real-time requirements, this solution requires a certain amount of time to implement and take effect. For example, for jobs such as real-time data processing and interactive applications, this delay may cause the system performance to decline or fail to meet the real-time requirements, thereby affecting the user experience of cloud users, and at the same time, it will reduce the utilization of computing resources to a certain extent.
[0076] Based on the drawbacks of the related technologies, this application proposes an online resource scheduling method. Figure 1 , Figure 1 1 is a flow chart of an online resource scheduling method proposed in an embodiment of the present application. Figure 1 As shown, the method may include steps S101 to S105:
[0077] Step S101: obtaining a first task to be executed, and decomposing the first task into a plurality of subtasks;
[0078] Step S102: assigning a first subtask to a first node at a first moment;
[0079] Step S103: when the first node is occupied at the first moment, respectively calculating a first execution time and a second execution time of the first node, wherein the first execution time is used to express the total time required for the first node to complete the first subtask after completing the current subtask, and the second execution time is used to express the total time required for reallocating the first subtask to an idle node and executing the first subtask in the idle node;
[0080] Step S104: determining the size of the adjusted sliding window of the first node in the calculation period to which the first node belongs at the first moment according to the adjustment factor of the sliding window in the calculation period to which the first node belongs at the first moment and the size of the sliding window of the first node;
[0081] Step S105: determining a secondary allocation scheme for the first subtask according to the first execution time, the second execution time, and the size of the adjusted sliding window.
[0082] In the embodiment of the present application, a cloud server contains multiple computing nodes. After the task is sent to the cloud server, it will be decomposed into multiple subtasks, and a distribution will be performed first, and each subtask will be assigned to different computing nodes. Since the remaining task conditions in each node may be different, after a subtask is distributed, it is necessary to check each node to confirm that the computing power of the node and the total amount of remaining tasks to be executed are what the node can carry, so as to prevent too many subtasks from being assigned to a node, so that the subtasks ranked later cannot be completed within the expected time, resulting in other subtasks in the same task being completed, but due to the incompleteness of individual subtasks in individual nodes, the entire task cannot be completed. Or it is also possible that there are too few tasks in a certain node, resulting in the idleness of the node, and the computing resources in the node cannot be fully utilized. Therefore, at the first moment when the first subtask is assigned to the first node, there are other unfinished tasks in the first node, that is, when it is occupied, it is necessary to calculate the time for the first task to continue waiting for execution at the first node and the time for switching to another idle node for execution.
[0083] In addition, it is also necessary to determine the size of the sliding window of the first node. The sliding window has an adjustable feature, so it can also be called an elastic sliding window. The elastic sliding window is an algorithm technology for data stream processing. It analyzes and processes the data stream in the form of a sliding window, and has the feature of dynamically adjusting the window size, which can more flexibly adapt to the characteristics of the data stream according to the actual situation of the data. In this application, the size of the sliding window of the first node is adjusted according to the adjustment factor of the sliding window in the calculation cycle to which the first node belongs at the first moment to determine the ability of the first node to carry tasks at present.
[0084] Then, based on the first execution time, the second execution time, and the calculated adjusted sliding window size of the first node, a secondary allocation plan for the first subtask is determined, which can be to continue waiting for execution in the first node, or to switch to an idle node that may appear at some subsequent moment for execution, or to reallocate it to another occupied node but with a stronger carrying capacity for execution.
[0085] Step S101: obtaining a first task to be executed, and decomposing the first task into a plurality of subtasks.
[0086] In an embodiment of the present application, after the server obtains the first task to be executed, it will decompose the first task into multiple subtasks to be executed. Generally speaking, the number of subtasks after decomposition should not exceed the number of nodes in the server used to execute computing tasks. In this way, after using an online algorithm to allocate multiple subtasks to different computing nodes, multiple subtasks can be executed simultaneously, thereby improving the efficiency of the overall task completion.
[0087] Step S102: allocating a first subtask to a first node at a first moment.
[0088] In an embodiment of the present application, after the first task is decomposed into multiple subtasks, the multiple subtasks need to be allocated once. Since the number of subtasks is not greater than the number of nodes in the server, each subtask is usually allocated to a different node during the allocation. This ensures that the computing resources in all nodes can be utilized as much as possible.
[0089] In an optional embodiment, assuming that the first task is W, it is decomposed into a plurality of subtasks W = w1, w2, ... w m , let the number of nodes in the server be n, so that m∈[1,n].
[0090] Step S103: When the first node is occupied at the first moment, the first execution time and the second execution time of the first node are calculated respectively. The first execution time is used to express the total time for the first node to complete the first subtask after completing the current subtask. The second execution time is used to express the total time required to reallocate the first subtask to an idle node and complete the first subtask in the idle node.
[0091] In an embodiment of the present application, after the first subtask is assigned to the first node at the first moment, if the first node is occupied, that is, there is a previous task in the first node that has not been completed, it is necessary to reconsider whether the assignment of the first subtask is reasonable. The specific method is to calculate the first execution time and the second execution time of the first node, wherein the first execution time is used to express that the first subtask continues to wait in the first node, and after the previous task is completed, the first subtask is started to be executed, and the total time corresponding to the whole process is determined as the first execution time of the first node; there is another situation, that is, the first subtask is assigned to another node in an idle state, or after waiting for a period of time, it is assigned to another node in an idle state, and then the first subtask is executed and completed in the idle node, and the total time corresponding to this process is determined as the second execution time of the first node.
[0092] Step S104: Determine the size of the adjusted sliding window of the first node in the calculation cycle to which the first node belongs at the first moment based on the adjustment factor of the sliding window in the calculation cycle to which the first node belongs at the first moment and the size of the sliding window of the first node.
[0093] In the embodiment of the present application, according to the above, the concept of elastic sliding window is introduced into the scenario of online resource scheduling. The sliding window of each node will change according to a series of factors such as the amount of tasks it carries. For example, when the data of the task to be processed is sensitive, it needs to be enlarged, and the size of the elastic sliding window should be increased accordingly. The present application also proposes an adjustment factor of the sliding window. According to the change of the adjustment factor, the size of the sliding window is changed to reflect the ability of the computing node to carry tasks in different computing cycles. The introduction of the concept of sliding window also makes it possible to judge the carrying capacity of a node instead of judging the situation within a fixed computing cycle, but to consider the situation within the adjustable elastic sliding window, so that the judgment of the working condition of the node is more accurate and closer to the actual situation. In the adjustment of real-time computing tasks, the scheduling plan made is more accurate.
[0094] Step S105: determining a secondary allocation scheme for the first subtask according to the first execution time, the second execution time, and the size of the adjusted sliding window.
[0095] In an embodiment of the present application, after determining the first execution time and the second execution time of the first node for the first subtask, the expected time to complete the first subtask under the current circumstances can be determined. In the above steps, the adjusted sliding window size of the first node in the current calculation cycle is calculated, and the adjusted sliding window size is compared with the first execution time and the second execution time to determine whether the first subtask that has been allocated once can be completed within the sliding window corresponding to the first node. If it cannot be completed, the first subtask needs to be allocated again.
[0096] By combining primary allocation with secondary allocation, the concept of sliding window is introduced to evaluate the computing power of each node in real time. For nodes that cannot carry their assigned subtasks after primary allocation, secondary allocation is performed, and the task status of each node is adjusted in real time to achieve dynamic allocation, thereby improving the overall computing power of the server.
[0097] In combination with the above embodiments, in one implementation, the present application further provides an online resource scheduling method, which specifically includes the following contents:
[0098] First, when the minimum value between the first execution duration and the second execution duration is not greater than the size of the adjusted sliding window, it is determined that the first subtask can be executed and completed within the adjusted sliding window of the first node.
[0099] In an embodiment of the present application, as described above, after each subtask is allocated once, it is also necessary to compare the adjusted sliding window size with the first execution time and the second execution time to determine whether the first subtask allocated to the first node can be completed within the adjusted sliding window of the first node. The adjusted sliding window refers to the size of the sliding window adjusted according to the actual working conditions of the first node within the calculation cycle to which the first moment belongs. When the minimum value between the first execution time and the second execution time is not greater than the size of the adjusted sliding window, it proves that the first subtask to be executed can be accommodated in the adjusted sliding window of the first node, and there is no need to allocate it a second time.
[0100] Specifically, when the first execution time is less than the second execution time, the first subtask is kept in the first node and waits for execution;
[0101] When the first execution duration is greater than the second execution duration, the first subtask is allocated to the idle node for execution.
[0102] In the embodiment of the present application, after determining that the first subtask does not need to be reassigned, it is also necessary to judge the specific execution status of the first subtask. When the first execution duration is less than the second execution duration, it proves that the first subtask continues to wait for the completion of the preceding task in the first node before executing it, which is a shorter option. In this case, it is like the first subtask remains in the first node waiting for execution. If the first execution duration is greater than the second execution duration, it means that during the process of the first subtask waiting for execution, there are other nodes that have completed the computing tasks therein and turned into an idle state. At this time, the first subtask is assigned to the idle node for execution, and the total duration generated is shorter, so the first subtask is assigned to the idle node for execution.
[0103] In combination with the above embodiments, in one implementation, the present application further provides an online resource scheduling method, which specifically includes the following contents:
[0104] First, when the minimum value between the first execution duration and the second execution duration is greater than the size of the adjusted sliding window, it is determined that the first subtask cannot be executed and completed within the adjusted sliding window of the first node.
[0105] In an embodiment of the present application, as described above, if the minimum value between the first execution duration and the second execution duration is greater than the size of the adjusted sliding window, it proves that the adjusted sliding window of the first node is insufficient to accommodate the first subtask to be executed. If the first subtask continues to wait in the first node, it may not be able to start calculation until after the sliding window of the current calculation cycle has passed. Compared with other subtasks belonging to the first task, its completion time will be particularly delayed, thereby affecting the progress of the overall task. Therefore, in this case, the first subtask needs to be redistributed.
[0106] Specifically, assigning the first subtask to a second node other than the first node;
[0107] In the case where the second node is occupied at the first moment, a third execution time and a fourth execution time of the second node are calculated respectively, the third execution time is used to express the total time for the second node to complete the first subtask after completing the current subtask, and the fourth execution time is used to express the total time required to reallocate the first subtask to an idle node and complete the first subtask in the idle node;
[0108] Determining, according to the adjustment factor of the sliding window of the second node in the calculation period to which the first moment belongs and the size of the sliding window of the second node, the size of the adjusted sliding window of the second node in the calculation period to which the first moment belongs;
[0109] A secondary allocation scheme for the first subtask is determined according to the third execution duration, the fourth execution duration, and the size of the adjusted sliding window within the calculation cycle to which the second node belongs at the first moment.
[0110] In the embodiment of the present application, in the case where the first node described above cannot carry the first subtask, a secondary allocation is performed, and the first subtask is allocated to a second node other than the first node. Similarly, the second node also needs to be calculated accordingly, and the time the first subtask waits for execution in the second node is used as the third execution time, and the time the first subtask is reallocated to the idle node for execution is used as the fourth execution time, and the size of the adjusted sliding window corresponding to the second node in the calculation cycle to which the first moment belongs is calculated. According to the method described above, the third execution time, the fourth execution time and the size of the adjusted sliding window of the second node are compared, and the allocation scheme of the first subtask is determined according to the comparison result.
[0111] In this way, subtasks are secondary allocated according to the computing power of different nodes, so that the scheduling of online resources is targeted. Real-time task distribution can be adjusted according to the working conditions of each node at different times, avoiding the long waiting time of a certain subtask delaying the completion of the overall task, and avoiding insufficient tasks in a certain node, resulting in idleness and waste of computing resources.
[0112] In combination with the above embodiments, in one implementation, the present application further provides an online resource scheduling method, which specifically includes the following contents:
[0113] First, based on the data transmission delay of the first node, the time for processing subtasks, the weight factor of data transmission delay and response time, and the number of times the first subtask is reallocated, the response balance point of the first node at each moment in the calculation cycle to which the first moment belongs is calculated.
[0114] In the embodiment of the present application, in the method for online resource scheduling, the answer balance point of each node is also introduced. The answer balance point (ACK-Points) is a method for adjusting the stability of the system, which aims to solve the performance problems caused by delayed responses in real time and dynamically, and adjust the balance point position adaptively according to the actual application scenario and the mode of data access, so as to ensure that the system has high stability and high performance during operation. By determining the answer balance point, the reliable transmission of data can be ensured. In combination with the online resource scheduling algorithm for heterogeneous clusters, the answer balance point of each computing node is obtained by building a model, which can effectively reduce the waste of computing resources caused by delays in the data transmission process. When a new subtask arrives, a more reasonable decision is made as to which computing nodes should be selected to serve the newly arrived load request. In the present application, the answer balance point is used to characterize the state of balance between the first execution time and the second execution time of the first subtask dispatched to the first node at the first moment as described above.
[0115] Specifically, when calculating the response balance point, it is also necessary to introduce the data transmission delay generated when the node processes the subtask. There is a delay caused by hardware or software reasons during the transmission process, which is an inevitable and uncontrollable time loss of task processing; relatively, each node will have a certain response time when performing a computing task. The response time refers to the time between the node receiving the command and executing the command, which not only includes the time to wait for the completion of the previous task, but also includes the certain time loss generated by the node receiving, understanding, and executing the instruction; among them, different nodes have different data transmission delays and response times when processing subtasks. Some nodes may have a longer response time but a shorter transmission delay, while some nodes may have the opposite. Therefore, in order to express the different computing characteristics generated by the unique data transmission delay and response time when the node processes the subtask, a weight factor is introduced here to reflect the differences between the computing characteristics of different nodes. The time to process a subtask refers to the time consumed by a node from the beginning to the completion of a subtask. At the same time, under ideal conditions, the time consumed by each node in the same service to process the same task can be considered to be the same, and the amount of subtasks assigned to each node is considered to be balanced. Therefore, the number of times a subtask is reallocated is introduced here to represent the time when a subtask is reallocated among multiple nodes waiting to be executed. The product of the time to process a subtask and the number of times a subtask is reallocated can represent the total waiting and execution time caused by the reallocation of the subtask among multiple nodes.
[0116] In an optional embodiment, for node i, the data transmission delay is set to τ i , set the response time to k i , set the time to process the subtask to δ i , and the weight factor of data transmission delay and response time is set to μ∈[0,1], where the relationship between data transmission delay and response time is:
[0117] F(τ,k)=μ·τ+(1-μ)·k, μ∈[0,1].
[0118] Therefore, it can be obtained that, after a subtask is allocated once, if the allocated node is occupied, the total processing time for the subtask to continue waiting for execution in the node is:
[0119]
[0120] If the subtask is reallocated to other computing nodes for execution, the total processing time that may be incurred is:
[0121]
[0122] If the node to which the subtask is assigned is not occupied during one allocation, the total time to process the subtask is:
[0123]
[0124] According to the above formula, the calculation formula of the response balance point θ, which is used to characterize the state of balance reached between the first execution duration and the second execution duration, can be obtained:
[0125] θ=τ i +(1-ω)·δ i / μ;
[0126] Then, the total time expected for the first node to complete the first subtask is calculated based on the data transmission delay of the first node, the time for processing the subtask, the response time, and the number of times the first subtask is reallocated.
[0127] In the embodiment of the present application, as described above, a series of calculation elements such as data transmission delay, subtask processing time, response time, and the number of times the first subtask is reallocated are introduced to calculate the response balance point of the first node. At the same time, it is also necessary to calculate the total time expected by the first node to complete the first subtask to determine whether the total time for the first subtask to complete the calculation in the first node is within the tolerable range of the node. Specifically, the total time expected to complete a subtask in node i can be expressed as:
[0128] S=τ i +k i +ω·δ i ;
[0129] Finally, according to the response balance point and the total time expected to complete the first subtask, the adjustment factor of the sliding window of the first node at each moment in the calculation cycle to which the first moment belongs is determined.
[0130] In the embodiment of the present application, after the response balance point of the first node and the total time expected to complete the first subtask are obtained, the adjustment factor of the sliding window of the first node at each moment in the calculation cycle to which the first moment belongs can be determined. By calculating and determining the adjustment factor of the sliding window of the node, the change in the size of the sliding window of the first node in the current calculation cycle can be determined, which also means the change in the current carrying capacity of the first node for the calculation task. The size of the sliding window is adjusted according to the adjustment factor, so that the first node can dynamically receive new tasks or assign new tasks to other nodes according to the execution of the current task, dynamically adjust the computing power of the node, and realize efficient scheduling of computing resources.
[0131] Specifically, for node i, the adjustment factor of its sliding window can be calculated by the following formula:
[0132]
[0133] Among them, t0 represents the current time, and T represents the calculation period.
[0134] In combination with the above embodiments, in one implementation, the present application further provides an online resource scheduling method, which specifically includes the following contents:
[0135] When the first node is not occupied at the first moment, the first subtask is allocated to the first node for execution.
[0136] In the embodiment of the present application, after the first subtask is assigned to the first node at the first moment, the situations discussed above are all in the state where the first node is occupied at that moment, so it is necessary to consider whether to continue to wait for execution of the first subtask in the first node or to reallocate it to other nodes for execution to minimize the total time consumption of the task. However, there is also a situation where the first node is in an unoccupied idle state during the first allocation, and when the first subtask is received, the calculation processing of the first subtask is directly started without the need for a second allocation.
[0137] In combination with the above embodiments, in one implementation, the present application further provides an online resource scheduling method, which specifically includes the following contents:
[0138] First, a task completion counter is set, and the initial count of the counter is 0.
[0139] In an embodiment of the present application, in order to determine the completion status of each subtask decomposed from the first task, the present application also proposes a method of setting a task completion counter, by counting the completed subtasks to determine the overall execution status of the first task, and when the execution starts, the initial count value of the counter is set to 0.
[0140] Then, after the first node completes the first subtask, the counter is incremented by 1; and after each other subtask in the plurality of subtasks is completed, the counter is incremented by 1.
[0141] In an embodiment of the present application, when each node completes a subtask belonging to the first task, the count of the counter is increased by 1, indicating that a subtask has been executed. In an optional embodiment, the executed subtasks can also be summarized into the same queue, which is only used to accommodate completed subtasks belonging to the same task.
[0142] Finally, when the count value of the counter is consistent with the number of the plurality of subtasks, it is determined that the execution of the first task is completed.
[0143] In an embodiment of the present application, when the counter finally reaches a count value that is consistent with the number of subtasks decomposed from the first task, it means that all subtasks included in the first task have been executed, and the first task is determined to be completed. At the same time, the count of the counter will be cleared and the resources in the above queue will be released to count the completion status of the next task.
[0144] In an optional embodiment, the present application also proposes an online resource scheduling system, such as Figure 2 As shown, Figure 2 This is a schematic diagram of an online resource scheduling system proposed in an embodiment of the present application, which includes eight modules: parameter setting module, data acquisition module, data receiving module, data cache module, calculation module, algorithm generation module, resource scheduling module and log module.
[0145] A parameter setting module, which is configured to: set various parameters for the constructed research model;
[0146] The data collection module is configured to: collect resource usage information of each node;
[0147] A data receiving module is configured to: receive computing resource request information from a cloud server;
[0148] A data cache module, which is configured to: store set parameters, collected relevant data and received relevant information;
[0149] A calculation module is configured to: calculate the total time to complete the subtask, the response balance point, etc. by combining relevant knowledge of statistics;
[0150] An algorithm generation module is configured to: decompose a newly acquired task into multiple subtasks, set an elastic sliding window, determine the size of the adjusted sliding window by answering a balance point, perform secondary allocation on the subtasks, and integrate resources for completed subtasks;
[0151] A resource scheduling module is configured to: assign newly arrived computing tasks to the selected nodes to complete resource scheduling;
[0152] The log module is configured to record the system operation status, events and error information during the execution of the system.
[0153] Among them, the user accesses the system through the terminal and makes a computing request, which is processed by the parameter setting module, data acquisition module, data receiving module, data caching module, computing module, algorithm generation module, and resource scheduling module. The tasks in the computing request are assigned to each computing node in the cloud server, and are dynamically allocated and adjusted according to the current usage of the cloud server. At the same time, the processing process is recorded in the log module to realize online resource scheduling of heterogeneous clusters.
[0154] Based on the same design concept, an embodiment of the present application provides an online resource scheduling device. Figure 3 , Figure 3 is a structural block diagram of an online resource scheduling device provided by an embodiment of the present application. Figure 3 As shown, the device comprises:
[0155] A first task acquisition module, used to acquire a first task to be executed and decompose the first task into multiple subtasks;
[0156] A first subtask allocation module, used to allocate a first subtask to a first node at a first moment;
[0157] an execution duration calculation module, used to respectively calculate a first execution duration and a second execution duration of the first node when the first node is occupied at the first moment, wherein the first execution duration is used to express the total duration for the first node to complete the first subtask after completing the current subtask, and the second execution duration is used to express the total duration required for reallocating the first subtask to an idle node and executing the first subtask in the idle node;
[0158] a sliding window size determination module, configured to determine the size of the adjusted sliding window of the first node in the calculation period to which the first moment belongs according to the adjustment factor of the sliding window in the calculation period to which the first node belongs at the first moment and the size of the sliding window of the first node;
[0159] A secondary allocation scheme determining module is used to determine a secondary allocation scheme for the first subtask according to the first execution time, the second execution time and the size of the adjusted sliding window.
[0160] Optionally, the secondary allocation scheme determination module includes:
[0161] A first allocation scheme determination submodule is configured to determine that the first subtask can be executed and completed within the adjusted sliding window of the first node when the minimum value between the first execution duration and the second execution duration is not greater than the size of the adjusted sliding window;
[0162] A first allocation submodule, configured to, when the first execution duration is less than the second execution duration, continue to retain the first subtask in the first node to wait for execution;
[0163] A second allocation submodule is configured to allocate the first subtask to the idle node for execution when the first execution duration is greater than the second execution duration.
[0164] Optionally, the secondary allocation scheme determination module further includes:
[0165] A second allocation scheme determination submodule is configured to determine that the first subtask cannot be executed and completed within the adjusted sliding window of the first node when the minimum value between the first execution duration and the second execution duration is greater than the size of the adjusted sliding window;
[0166] A second node allocation submodule, used for allocating the first subtask to a second node other than the first node;
[0167] an execution duration calculation module, used to respectively calculate a third execution duration and a fourth execution duration of the second node when the second node is occupied at the first moment, the third execution duration being used to express the total duration for the second node to complete the first subtask after completing the current subtask, and the fourth execution duration being used to express the total duration required for reallocating the first subtask to an idle node and executing the first subtask in the idle node;
[0168] a sliding window size determination module, configured to determine the size of the adjusted sliding window of the second node in the calculation period to which the first moment belongs, according to the adjustment factor of the sliding window in the calculation period to which the second node belongs at the first moment, and the size of the sliding window of the second node;
[0169] A secondary allocation scheme determination module is used to determine the secondary allocation scheme of the first subtask based on the third execution time, the fourth execution time and the size of the adjusted sliding window within the calculation cycle to which the second node belongs at the first moment.
[0170] Optionally, the sliding window size determination module includes:
[0171] a response balance point calculation submodule, configured to calculate the response balance point of the first node at each moment in the calculation cycle to which the first moment belongs, according to the data transmission delay of the first node, the time for processing the subtask, the weight factor of the data transmission delay and the response time, and the number of times the first subtask is reallocated;
[0172] an expected total time calculation submodule, used to calculate the total time expected for the first node to complete the first subtask based on the data transmission delay of the first node, the time for processing the subtask, the response time, and the number of times the first subtask is reallocated;
[0173] The adjustment factor determination submodule is used to determine the adjustment factor of the sliding window of the first node at each moment in the calculation cycle to which the first moment belongs according to the response balance point and the total time expected to complete the first subtask.
[0174] Optionally, the online resource scheduling device further includes:
[0175] A primary allocation scheme determination module is used to allocate the first subtask to the first node for execution when the first node is not occupied at the first moment.
[0176] Optionally, the online resource scheduling device further includes:
[0177] A counter setting module is used to set a task completion counter, wherein the initial count of the counter is 0;
[0178] a counting module, configured to increase the counter by 1 after the first node completes the first subtask; and to increase the counter by 1 after each other subtask among the multiple subtasks is completed;
[0179] The task completion confirmation module is used to determine that the first task is completed when the count value of the counter is consistent with the number of the multiple subtasks.
[0180] Based on the same design concept, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the online resource scheduling method described in any of the above embodiments of the present application are implemented.
[0181] Based on the same design concept, another embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the online resource scheduling method described in any of the above embodiments of the present application.
[0182] Based on the same design concept, another embodiment of the present application provides an electronic device, such as Figure 4 shown. Figure 4 This is a schematic diagram of an electronic device shown in an embodiment of the present application. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes, the steps in the online resource scheduling method described in any of the above embodiments of the present application are implemented.
[0183] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0184] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0185] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0186] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0187] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.
[0189] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0190] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0191] The above is a detailed introduction to an online resource scheduling method, device, equipment, medium and product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An online resource scheduling method, characterized in that: include: Obtaining a first task to be executed, and decomposing the first task into a plurality of subtasks; Assigning a first subtask to a first node at a first moment; In the case where the first node is occupied at the first moment, a first execution time and a second execution time of the first node are calculated respectively, the first execution time is used to express the total time required for the first node to complete the first subtask after completing the current subtask, and the second execution time is used to express the total time required for reallocating the first subtask to an idle node and executing the first subtask in the idle node; Determining, according to an adjustment factor of a sliding window in a calculation period to which the first node belongs at the first moment, and a size of the sliding window of the first node, a size of an adjusted sliding window in a calculation period to which the first node belongs at the first moment; A secondary allocation scheme for the first subtask is determined according to the first execution duration, the second execution duration, and the size of the adjusted sliding window.
2. The online resource scheduling method according to claim 1, characterized in that: include: When the minimum value between the first execution duration and the second execution duration is not greater than the size of the adjusted sliding window, determining that the first subtask can be executed and completed within the adjusted sliding window of the first node; When the first execution time is less than the second execution time, the first subtask is kept in the first node to wait for execution; When the first execution duration is greater than the second execution duration, the first subtask is allocated to the idle node for execution.
3. The online resource scheduling method according to claim 1, characterized in that: include: When the minimum value between the first execution duration and the second execution duration is greater than the size of the adjusted sliding window, determining that the first subtask cannot be executed and completed within the adjusted sliding window of the first node; Allocating the first subtask to a second node other than the first node; In the case where the second node is occupied at the first moment, a third execution time and a fourth execution time of the second node are calculated respectively, the third execution time is used to express the total time for the second node to complete the first subtask after completing the current subtask, and the fourth execution time is used to express the total time required to reallocate the first subtask to an idle node and complete the first subtask in the idle node; Determining, according to the adjustment factor of the sliding window of the second node in the calculation period to which the first moment belongs and the size of the sliding window of the second node, the size of the adjusted sliding window of the second node in the calculation period to which the first moment belongs; A secondary allocation scheme for the first subtask is determined according to the third execution duration, the fourth execution duration, and the size of the adjusted sliding window within the calculation cycle to which the second node belongs at the first moment.
4. The online resource scheduling method according to claim 1, characterized in that: Also includes: Calculate the response balance point of the first node at each moment in the computing cycle to which the first moment belongs according to the data transmission delay of the first node, the time for processing the subtask, the weight factor of the data transmission delay and the response time, and the number of times the first subtask is reallocated; Calculate the total time that the first node is expected to complete the first subtask based on the data transmission delay, subtask processing time, response time, and the number of times the first subtask is reallocated of the first node; An adjustment factor of the sliding window of the first node at each moment in a calculation cycle to which the first moment belongs is determined according to the response balance point and the total time expected to complete the first subtask.
5. The online resource scheduling method according to claim 1, characterized in that: include: When the first node is not occupied at the first moment, the first subtask is allocated to the first node for execution.
6. The online resource scheduling method according to any one of claims 1 to 5, characterized in that: Also includes: Set a task completion counter, the initial count of the counter is 0; After the first node completes the first subtask, adding 1 to the counter; as well as , after each other subtask in the plurality of subtasks is completed, the counter count is increased by 1; When the count value of the counter is consistent with the number of the plurality of subtasks, it is determined that the execution of the first task is completed.
7. An online resource scheduling device, characterized in that: The device comprises: A first task acquisition module, used to acquire a first task to be executed and decompose the first task into multiple subtasks; A first subtask allocation module, used to allocate a first subtask to a first node at a first moment; an execution duration calculation module, used to respectively calculate a first execution duration and a second execution duration of the first node when the first node is occupied at the first moment, wherein the first execution duration is used to express the total duration for the first node to complete the first subtask after completing the current subtask, and the second execution duration is used to express the total duration required for reallocating the first subtask to an idle node and executing the first subtask in the idle node; a sliding window size determination module, configured to determine the size of the adjusted sliding window of the first node in the calculation period to which the first moment belongs according to the adjustment factor of the sliding window in the calculation period to which the first node belongs at the first moment and the size of the sliding window of the first node; A secondary allocation scheme determining module is used to determine a secondary allocation scheme for the first subtask according to the first execution time, the second execution time and the size of the adjusted sliding window.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is executed by the processor, the online resource scheduling method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the online resource scheduling method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the online resource scheduling method according to any one of claims 1 to 6 is implemented.