Distributed job scheduling method and device, equipment and storage medium
By acquiring job attributes, resource usage, and priority information, and combining this with executor load information, a resource load and concurrency balancing strategy is adopted to solve the problem of uneven job distribution in computer systems, achieving balanced executor allocation and efficient distribution of important jobs.
Patent Information
- Application Number
- CN202311256247.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-09-26
AI Technical Summary
In existing technologies, computer systems suffer from uneven data allocation, especially when distributing a large number of jobs. The scheduler cannot obtain real-time load changes of executors and the actual resource usage of jobs, resulting in some executors being overloaded.
By acquiring the attribute information, resource usage information, and priority information of the jobs to be assigned, a job distribution strategy is determined, and a target executor is selected based on this information. The resource load information of the executor is acquired in real time, and a balancing strategy based on resource load and concurrency is adopted to distribute jobs to ensure balanced job allocation.
When a large number of jobs are distributed, the scheduler can distribute the jobs evenly to certain centralized executors, ensuring balanced job distribution among executors and supporting efficient load distribution and priority distribution of important jobs.
Smart Images

Figure CN117369999B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a distributed job scheduling method, apparatus, device, and storage medium. Background Technology
[0002] Currently, with the development of information technology, the amount of data is increasing explosively, causing many computer systems to need to process large amounts of data. To solve the problem of computer systems processing large amounts of data, the computer field has proposed setting up a large number of executors and using a scheduler to distribute data processing jobs to multiple executors in a distributed manner, enabling computer systems to handle large amounts of data.
[0003] Related technologies have developed job scheduling engines for computer systems, such as the open-source product Airflow. These engines schedule jobs by configuring a weight for each job to be assigned, where the weight represents priority. Jobs with higher weights will be assigned to executors first. The strategy takes into account the load of the executors and selects executors with lower loads to execute the jobs, thus achieving job load balancing to a certain extent and avoiding assigning too many jobs to executors with higher loads.
[0004] However, the weights in the above strategy cannot reflect the actual resource usage of the jobs to be assigned. When multiple jobs are to be distributed to executors at the same time, the different jobs occupy different physical resources, and the scheduler cannot receive the actual resource usage of the jobs and there is a lag in the scheduler's response to changes in the load on the executors. As a result, when a large number of jobs are distributed, the scheduler will concentrate a large number of resource-intensive jobs to certain concentrated executors, resulting in an uneven distribution of data jobs. Summary of the Invention
[0005] The main objective of this application is to provide a distributed job scheduling method, apparatus, device, and storage medium, which aims to solve the technical problem of uneven distribution of data jobs in the prior art.
[0006] To achieve the above objectives, this application provides a distributed job scheduling method, which includes:
[0007] Obtain the attribute information, resource usage information, and priority information of the job to be assigned;
[0008] Based on the attribute information, a job distribution strategy is determined;
[0009] Determine the target executor corresponding to the job distribution strategy;
[0010] Obtain the current resource load information of the target executor, and distribute the job to be assigned to the corresponding target executor based on the resource occupancy information, the priority information, and the resource load information of the target executor.
[0011] Optionally, the step of obtaining the attribute information of the job to be assigned includes:
[0012] Obtain the historical hardware resource usage value of a preset number of jobs to be assigned, wherein the historical hardware resource usage value is the hardware resource value of the executor occupied by the job to be assigned when it runs on the executor;
[0013] The difference between the historical hardware resource usage values is calculated to obtain the difference result;
[0014] Determine whether the difference result is greater than a preset difference threshold;
[0015] Jobs to be assigned with a difference result greater than a preset difference threshold are identified as having unstable program operation attributes, while jobs to be assigned with a difference result less than or equal to a preset difference threshold are identified as having stable program operation attributes.
[0016] Optionally, the attribute information includes program stability attributes and program instability attributes, and the step of determining the job distribution strategy based on the attribute information includes:
[0017] If the attribute information of the job to be assigned is a program running stability attribute, then the job distribution strategy for the job to be assigned is determined to be a resource load balancing strategy.
[0018] If the attribute information of the job to be assigned is an unstable program running attribute, then the job distribution strategy for the job to be assigned is determined to be a balanced strategy based on the number of concurrent users.
[0019] Optionally, the target executor is specifically each executor under the executor group, wherein when the resources of the executor group are insufficient to allocate the jobs to be allocated, the number of executors in the executor group is expanded to meet the resource allocation of the jobs to be allocated.
[0020] Optionally, the step of obtaining the current resource load information of the target executor and distributing the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor includes:
[0021] If the job distribution strategy is a balanced strategy based on the number of concurrent users, then obtain the current number of concurrent jobs of the target executor, and calculate the current job concurrency ratio of the target executor based on the number of concurrent jobs;
[0022] Based on the priority information of the jobs to be assigned, the distribution order of the jobs to be assigned is determined;
[0023] Based on the resource usage information of the jobs to be assigned and the current job concurrency ratio of the target executor, the jobs to be assigned are distributed to the corresponding target executors according to the distribution order.
[0024] Optionally, the step of obtaining the current resource load information of the target executor and distributing the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor includes:
[0025] If the job distribution strategy is a resource load balancing strategy, then the hardware configuration information of the target executor is obtained, and the hardware configuration information is quantified into hardware resource values;
[0026] The resource usage information of the jobs to be assigned is quantified into hardware resource usage values;
[0027] Based on the priority information of the jobs to be assigned, the distribution order of the jobs to be assigned is determined;
[0028] Based on the hardware resource value of the target executor and the hardware resource occupancy value of the job to be assigned, the job to be assigned is distributed to the corresponding target executor in accordance with the distribution order.
[0029] Optionally, the step of distributing the jobs to be assigned to the corresponding target executors based on the hardware resource value of the target executor and the hardware resource occupancy value of the jobs to be assigned, according to the distribution order, includes:
[0030] Obtain the current job execution information of the target executor;
[0031] Based on the job operation information and the hardware resource value, calculate the current remaining resource ratio of the target executor;
[0032] Based on the remaining resource ratio of the target executor and the hardware resource occupancy value of the job to be assigned, the job to be assigned is distributed to the corresponding target executor in accordance with the distribution order.
[0033] This application also provides a distributed job scheduling device, the distributed job scheduling device comprising:
[0034] The acquisition module is used to acquire the attribute information, resource usage information, and priority information of the job to be assigned.
[0035] The strategy determination module is used to determine the job distribution strategy based on the attribute information.
[0036] An executor determination module is used to determine the target executor corresponding to the job distribution strategy.
[0037] The allocation module is used to obtain the current resource load information of the target executor, and distribute the job to be allocated to the corresponding target executor based on the resource occupancy information, the priority information, and the resource load information of the target executor.
[0038] This application also provides a distributed job scheduling device, which includes: a memory, a processor, and a program stored in the memory for implementing the distributed job scheduling method.
[0039] The memory is used to store programs that implement the distributed job scheduling method;
[0040] The processor is used to execute a program that implements the distributed job scheduling method, so as to implement the steps of the distributed job scheduling method.
[0041] This application also provides a storage medium storing a program implementing a distributed job scheduling method, wherein the program implementing the distributed job scheduling method is executed by a processor to implement the steps of the distributed job scheduling method.
[0042] This application determines the corresponding job distribution strategy and target executor by using the attribute information of the jobs to be assigned, and obtains the load changes of the executor and the actual resource consumption of the jobs in real time. In this way, when a large number of jobs are distributed, the scheduler will distribute the jobs evenly to some concentrated executors, so that the job distribution of the executors is balanced. Attached Figure Description
[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0044] Figure 1 This is a flowchart illustrating the first embodiment of the distributed job scheduling method of this application;
[0045] Figure 2 This is a schematic diagram illustrating the scenario in which jobs are allocated within the executor group according to the distributed job scheduling method of this application;
[0046] Figure 3 This is a flowchart illustrating the second embodiment of the distributed job scheduling method of this application;
[0047] Figure 4 This is a schematic diagram of the modules of the distributed job scheduling device of this application;
[0048] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0049] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0050] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0051] Reference Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the distributed job scheduling method of this application.
[0052] In the first embodiment, the distributed job scheduling method includes the following steps:
[0053] Step S100: Obtain the attribute information, resource usage information, and priority information of the job to be assigned;
[0054] It should be noted that the execution entity of the distributed job scheduling method is a distributed job scheduling device. Preferably, the distributed job scheduling device is a job scheduling platform, but it can also be other server-side devices with data transmission and data processing functions. No specific restrictions are imposed here.
[0055] It is understood that the pending job refers to a task to be assigned to an executor for execution, which requires the use of some of the executor's hardware resources during execution. The attribute information of the pending job includes stable attributes and unstable attributes. The classification of attributes is determined based on the operating characteristics of the pending job. Pending jobs with unstable attributes have different resource usage at different times or in different execution sessions, and the differences are large. Therefore, it is impossible to convert the resource load value of the pending job. On the contrary, pending jobs with stable attributes have relatively stable resource usage at different times or in different execution sessions, so the resource load value of the pending job can be converted.
[0056] It should be noted that the concept of a "job" in the above context refers to a program unit that needs to be scheduled and executed in the scheduling system, and will be executed after the conditions are met. An executor is a server responsible for executing jobs, usually multiple servers, on which the execution program is installed. Users initiate job execution, obtain the job execution results, and feed the results back to the scheduler. The scheduler is the engine program in the scheduling system responsible for scheduling selection and judgment. When the job's prerequisites are met, the scheduler, based on a load balancing algorithm, allocates different jobs to the executors in the group. The resource usage information of the jobs to be allocated includes the executor resource value required for the job to run. Specifically, the executor resource value required for the job to run refers to the hardware resources of the server where the executor is located that the job needs to occupy during actual operation. Under normal circumstances, the number of resources occupied by each job each time it runs should be similar and statistically quantifiable. Based on the historical operation of the job, the resource usage value during the job's operation is statistically analyzed. This value represents the average hardware and software resource usage of the job during its historical operation, which can truly reflect the resource usage of the job and is used for load balancing. The resource usage information of the jobs to be allocated also includes the number of jobs.
[0057] Understandably, the priority information of the jobs to be assigned is an attribute of the job, used to describe the importance of the job. When executor resources are contested, the order of assignment is determined by the priority, with important jobs generally having a higher priority than ordinary jobs. The executor hardware resource value refers to a resource value quantified by the executor's hardware resource indicators such as CPU, memory, and I / O (similar to a resource pool). When a job is assigned, the executor resource value required for that job to run is subtracted. When the value becomes 0, it means that the resources are fully loaded, and the scheduler will not assign any more jobs to that executor. The maximum number of concurrent jobs that an executor can run is a configuration of the executor, indicating the maximum number of jobs that this executor can run.
[0058] In specific implementations, the device obtains the attribute information of the job to be assigned through the following methods:
[0059] Obtain the historical hardware resource usage values of a preset number of jobs to be assigned, wherein the historical hardware resource usage values are the hardware resource values of the executor occupied by the jobs to be assigned when they run on the executor; calculate the difference between each of the historical hardware resource usage values to obtain a difference result; determine whether the difference result is greater than a preset difference threshold; identify jobs to be assigned with a difference result greater than the preset difference threshold as having an unstable program running attribute, and identify jobs to be assigned with a difference result less than or equal to the preset difference threshold as having a stable program running attribute.
[0060] It should be noted that the historical hardware resource usage value refers to the hardware resources that the job needs to occupy on the server where the executor is located when it is actually running at a historical point in time. Usually, the job will record the corresponding hardware resource usage value during the testing phase. The device will count the historical hardware resource usage value for a preset number of times, which is usually the historical hardware resource usage value for a preset number of recent points in time.
[0061] In a specific implementation, the device calculates the difference between multiple historical hardware resource occupancy values of each job to be assigned. If the difference between the historical hardware resource occupancy values is too large (i.e., the difference result is greater than a preset difference threshold), it indicates that the program of the job to be assigned is unstable. If the difference between the historical hardware resource occupancy values is small (i.e., the difference result is less than or equal to the preset difference threshold), it indicates that the program of the job to be assigned is stable.
[0062] Step S200: Determine the job distribution strategy based on the attribute information;
[0063] It should be noted that this application selects different job distribution strategies based on the attribute information of the jobs to be assigned, so as to realize distributed job scheduling for each job to be assigned. Specifically, for jobs to be assigned with stable program operation attributes, the executors can be evenly distributed to the job based on the executor resource value required for the operation of such jobs. For jobs to be assigned with unstable program operation attributes, the executors can be evenly distributed to the job based on the number of such jobs.
[0064] In a specific implementation, the method by which the device determines the job distribution strategy based on the attribute information includes:
[0065] If the attribute information of the job to be assigned is a program running stability attribute, then the job distribution strategy for the job to be assigned is determined to be a resource load balancing strategy.
[0066] If the attribute information of the job to be assigned is an unstable program running attribute, then the job distribution strategy for the job to be assigned is determined to be a balanced strategy based on the number of concurrent users.
[0067] Step S300: Determine the target executor corresponding to the job distribution strategy;
[0068] It is understood that the target executor refers to an executor that currently has certain hardware resources and can undertake job tasks. Moreover, the executor has a corresponding job distribution strategy preset during development. That is, the job to be assigned with stable program operation attributes can only be assigned / or sent to the executor developed based on the resource load balancing strategy. Similarly, the job to be assigned with unstable program operation attributes can only be assigned / or sent to the executor developed based on the concurrency balancing strategy.
[0069] It should be noted that the load balancing strategy described in this application supports two balancing strategies, the choice of which strategy to use depends on the configuration of the executor group. One is a load balancing strategy based on the number of concurrent requests, corresponding to concurrent executors; the other is a load balancing strategy based on resource load, corresponding to resource load-type executors. When the jobs in an executor group cannot be quantified into specific hardware metrics such as CPU and memory, the resource load-based strategy is not suitable because the actual load of the job cannot be quantified, thus the concurrent request-based load balancing strategy is appropriate. Conversely, if the resources required for job execution are quantifiable, the resource load balancing strategy is used, meaning the corresponding executor group should be a load-type executor group.
[0070] Furthermore, this application proposes an executor grouping model, where at least one executor forms an executor group. An executor group refers to a set of peer executors. Jobs distributed to any executor within the group yield consistent results. Generally, a job corresponds to an executor group rather than a single executor. This is primarily to address distributed horizontal scaling, high availability, and the elimination of single points of failure. Jobs are distributed to individual executors within an executor group based on load. When resources are insufficient, executors can be horizontally scaled. Specifically, when expanding an executor group, the user only needs to upload the characteristic information (e.g., IP address) of the executor to be added to the corresponding executor group. See [link to relevant documentation]. Figure 2 The scheduler distributes jobs according to the execution group configured for the job. Jobs configured with different executor groups will be distributed to different executor groups to be actually executed. An executor group contains multiple executors. The scheduler will simultaneously make distribution judgments for tens of thousands of jobs. These jobs point to different executor groups. How to efficiently distribute jobs and distribute them relatively evenly is a problem that must be solved. This application proposes the following load balancing algorithm to solve this problem.
[0071] Step S400: Obtain the current resource load information of the target executor, and distribute the job to be assigned to the corresponding target executor based on the resource occupancy information, priority information, and resource load information of the job to be assigned.
[0072] It is understood that the current resource load information of the target executor refers to the executor hardware resource value. Specifically, the executor hardware resource value is a resource value quantified from the hardware resource indicators of the executor such as CPU, memory, and IO. When a job is distributed, the executor resource value required for the job to run will be subtracted.
[0073] In a specific implementation, the device obtains the current resource load information of the target executor, and distributes the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor. The specific methods include the following:
[0074] If the job distribution strategy is a concurrency-based balancing strategy, then the current number of concurrent jobs on the target executor is obtained, and the current job concurrency ratio of the target executor is calculated based on the number of concurrent jobs; the distribution order of the jobs to be assigned is determined based on the priority information of the jobs to be assigned; and the jobs to be assigned are distributed to the corresponding target executors according to the distribution order based on the resource usage information of the jobs to be assigned and the current job concurrency ratio of the target executor.
[0075] In the specific implementation, under the load balancing strategy based on the number of concurrent users, the device does not need to consider the hardware resource value, but only the number of jobs that have been distributed to each executor. When N jobs with priorities P1-PN need to be distributed, the concurrent ratio of jobs for each executor from N1 to N5 on that day will be calculated respectively: LoadRatio = number of jobs distributed on the executor / maximum concurrent number of jobs that the executor can run at the same time. Based on the LoadRatio in ascending order, the jobs to be distributed are distributed in descending order of priority. The LoadRatio is calculated in real time during the distribution process to ensure load balancing.
[0076] In a specific implementation, the device obtains the current resource load information of the target executor, and distributes the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor. The method further includes the following:
[0077] If the job distribution strategy is a resource load balancing strategy, then the hardware configuration information of the target executor is obtained and the hardware configuration information is quantified into hardware resource values; the resource occupancy information of the job to be assigned is quantified into hardware resource occupancy values; the distribution order of the job to be assigned is determined based on the priority information of the job to be assigned; and the job to be assigned is distributed to the corresponding target executor according to the distribution order based on the hardware resource values of the target executor and the hardware resource occupancy values of the job to be assigned.
[0078] In the specific implementation, under a resource load balancing strategy, for example, in an executor group with five executors (N1-N5), the device quantifies the hardware resource value (X1-X5) of each executor based on its CPU, memory, I / O, and other hardware configurations. Based on the CPU, memory, and I / O usage of each job running on an executor, a 7-day equivalent value (Y) is calculated as the executor resource value required for job execution. When N jobs with priorities P1-PN need to be distributed, assuming J jobs are already executing on a certain executor, the load ratio (LoadRatio) for each executor from N1 to N5 on that day is calculated: (X-(J1*Y1+J2*Y2+J3*Y3+J4*Y4+…Jn*Yn)) / X, where LoadRatio represents the proportion of remaining executor resources based on hardware load. Based on the LoadRatio in ascending order, jobs are distributed in descending order of priority, with LoadRatio calculated in real-time during the distribution process to ensure load balancing.
[0079] This application determines the corresponding job distribution strategy and target executors by using the attribute information of the jobs to be assigned, and obtains the load changes of the executors and the actual resource consumption of the jobs in real time. This enables the scheduler to evenly distribute jobs to a certain number of concentrated executors when a large number of jobs are being distributed, thus achieving balanced job allocation across executors. Specifically, when issuing jobs, the device prioritizes issuing high-priority jobs, meaning important jobs are issued first. The device also supports efficient load distribution for high concurrency of a large number of jobs, ensuring balanced distribution. Each job calculates an average load based on historical load data, and during issuance, the average load of the jobs is combined with the current remaining load of the executors to ensure load balance.
[0080] Based on the first embodiment described above, this application also provides another embodiment, referring to... Figure 3 The distributed job scheduling method includes:
[0081] In a specific implementation, the method by which the device distributes the jobs to be assigned to the corresponding target executors according to the distribution order based on the hardware resource value of the target executor and the hardware resource occupancy value of the jobs to be assigned includes the following:
[0082] Step A100: Obtain the current job execution information of the target executor;
[0083] It is understood that the current job running information of the target executor refers to the relevant information that the target executor is executing before executing the job to be assigned, including but not limited to the hardware resource utilization rate, estimated running time, and estimated remaining available resources of the current running cycle.
[0084] Step A200: Based on the job operation information and the hardware resource value, calculate the current remaining resource ratio of the target executor;
[0085] Step A300: Based on the remaining resource ratio of the target executor and the hardware resource occupancy value of the job to be assigned, the job to be assigned is distributed to the corresponding target executor according to the distribution order.
[0086] In practice, by calculating the current remaining resource ratio of each target actuator, the effective and balanced allocation of tasks to the target actuators can be achieved, thereby improving the accuracy of the balanced allocation of actuator tasks.
[0087] This application also provides a distributed job scheduling device, referring to... Figure 4 The distributed job scheduling device includes:
[0088] The acquisition module 10 is used to acquire the attribute information, resource usage information, and priority information of the job to be assigned;
[0089] The strategy determination module 20 is used to determine the job distribution strategy based on the attribute information;
[0090] Executor determination module 30 is used to determine the target executor corresponding to the job distribution strategy;
[0091] The allocation module 40 is used to obtain the current resource load information of the target executor, and distribute the job to be allocated to the corresponding target executor based on the resource occupancy information, the priority information and the resource load information of the target executor.
[0092] Optionally, the acquisition module 10 includes:
[0093] The resource occupancy value acquisition module is used to acquire the historical hardware resource occupancy value of a preset number of jobs to be assigned, wherein the historical hardware resource occupancy value is the hardware resource value of the executor occupied by the job to be assigned when it runs on the executor;
[0094] The difference calculation module is used to calculate the difference between the historical hardware resource occupancy values to obtain the difference result.
[0095] The difference judgment module is used to determine whether the difference result is greater than a preset difference threshold;
[0096] The attribute determination module is used to determine the job to be assigned with the difference result greater than a preset difference threshold as an unstable attribute of program operation, and to determine the job to be assigned with the difference result less than or equal to the preset difference threshold as a stable attribute of program operation.
[0097] Optionally, the strategy determination module 20 includes:
[0098] The resource load strategy determination module is used to determine the job distribution strategy based on resource load balancing if the attribute information of the job to be assigned is a stable program running attribute.
[0099] The concurrency quantity strategy determination module is used to determine the job distribution strategy based on the concurrency quantity if the attribute information of the job to be assigned is an unstable program running attribute.
[0100] Optionally, the allocation module 40 includes:
[0101] The job concurrency ratio calculation module is used to obtain the current number of concurrent jobs of the target executor and calculate the current job concurrency ratio of the target executor based on the number of concurrent jobs if the job distribution strategy is a balanced strategy based on the number of concurrent jobs.
[0102] The distribution order determination module is used to determine the distribution order of the jobs to be assigned based on the priority information of the jobs to be assigned;
[0103] The first distribution module is used to distribute the jobs to be assigned to the corresponding target executors according to the distribution order, based on the resource occupancy information of the jobs to be assigned and the current job concurrency ratio of the target executors.
[0104] Optionally, the allocation module 40 further includes:
[0105] The first resource quantization module is used to obtain the hardware configuration information of the target executor and quantify the hardware configuration information into hardware resource values if the job distribution strategy is a resource load balancing strategy.
[0106] The second resource quantification module is used to quantify the resource occupancy information of the job to be assigned into hardware resource occupancy values;
[0107] The distribution order determination module is used to determine the distribution order of the jobs to be assigned based on the priority information of the jobs to be assigned;
[0108] The second distribution module is used to distribute the job to be assigned to the corresponding target executor according to the distribution order, based on the hardware resource value of the target executor and the hardware resource occupancy value of the job to be assigned.
[0109] Optionally, the second distribution module includes:
[0110] The job operation information acquisition module is used to acquire the current job operation information of the target executor;
[0111] The remaining resource ratio calculation module is used to calculate the current remaining resource ratio of the target executor based on the job operation information and the hardware resource value.
[0112] The third distribution module is used to distribute the jobs to be assigned to the corresponding target executors according to the distribution order, based on the remaining resource ratio of the target executor and the hardware resource occupancy value of the jobs to be assigned.
[0113] The specific implementation of the distributed job scheduling device in this application is basically the same as the embodiments of the distributed job scheduling method described above, and will not be repeated here.
[0114] Reference Figure 5 , Figure 5 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of this application.
[0115] like Figure 5 As shown, the terminal may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0116] Optionally, the distributed job scheduling device may also include a rectangular user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, etc. The rectangular user interface may include a display screen and an input submodule such as a keyboard. Optionally, the rectangular user interface may also include a standard wired interface or a wireless interface. The network interface may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0117] Those skilled in the art will understand that Figure 1 The distributed job scheduling device structure shown does not constitute a limitation on the distributed job scheduling device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0118] like Figure 5 As shown, the memory 1005, serving as a storage medium, may include an operating system, a network communication module, and a distributed job scheduler. The operating system is a program that manages and controls the hardware and software resources of the distributed job scheduling device, supporting the operation of the distributed job scheduler and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the distributed job scheduling system.
[0119] exist Figure 5 In the distributed job scheduling device shown, the processor 1001 is used to execute the distributed job scheduling program stored in the memory 1005 to implement the steps of the distributed job scheduling method described above.
[0120] The specific implementation of the distributed job scheduling device in this application is basically the same as the embodiments of the above-described distributed job scheduling method, and will not be repeated here.
[0121] This application also provides a storage medium storing a program implementing a distributed job scheduling method, wherein the program implementing the distributed job scheduling method is executed by a processor to implement the distributed job scheduling method as follows:
[0122] Obtain the attribute information, resource usage information, and priority information of the job to be assigned;
[0123] Based on the attribute information, a job distribution strategy is determined;
[0124] Determine the target executor corresponding to the job distribution strategy;
[0125] Obtain the current resource load information of the target executor, and distribute the job to be assigned to the corresponding target executor based on the resource occupancy information, the priority information, and the resource load information of the target executor.
[0126] Optionally, the step of obtaining the attribute information of the job to be assigned includes:
[0127] Obtain the historical hardware resource usage value of a preset number of jobs to be assigned, wherein the historical hardware resource usage value is the hardware resource value of the executor occupied by the job to be assigned when it runs on the executor;
[0128] The difference between the historical hardware resource usage values is calculated to obtain the difference result;
[0129] Determine whether the difference result is greater than a preset difference threshold;
[0130] Jobs to be assigned with a difference result greater than a preset difference threshold are identified as having unstable program operation attributes, while jobs to be assigned with a difference result less than or equal to a preset difference threshold are identified as having stable program operation attributes.
[0131] Optionally, the attribute information includes program stability attributes and program instability attributes, and the step of determining the job distribution strategy based on the attribute information includes:
[0132] If the attribute information of the job to be assigned is a program running stability attribute, then the job distribution strategy for the job to be assigned is determined to be a resource load balancing strategy.
[0133] If the attribute information of the job to be assigned is an unstable program running attribute, then the job distribution strategy for the job to be assigned is determined to be a balanced strategy based on the number of concurrent users.
[0134] Optionally, the target executor is specifically each executor under the executor group, wherein when the resources of the executor group are insufficient to allocate the jobs to be allocated, the number of executors in the executor group is expanded to meet the resource allocation of the jobs to be allocated.
[0135] Optionally, the step of obtaining the current resource load information of the target executor and distributing the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor includes:
[0136] If the job distribution strategy is a balanced strategy based on the number of concurrent users, then obtain the current number of concurrent jobs of the target executor, and calculate the current job concurrency ratio of the target executor based on the number of concurrent jobs;
[0137] Based on the priority information of the jobs to be assigned, the distribution order of the jobs to be assigned is determined;
[0138] Based on the resource usage information of the jobs to be assigned and the current job concurrency ratio of the target executor, the jobs to be assigned are distributed to the corresponding target executors according to the distribution order.
[0139] Optionally, the step of obtaining the current resource load information of the target executor and distributing the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor includes:
[0140] If the job distribution strategy is a resource load balancing strategy, then the hardware configuration information of the target executor is obtained, and the hardware configuration information is quantified into hardware resource values;
[0141] The resource usage information of the jobs to be assigned is quantified into hardware resource usage values;
[0142] Based on the priority information of the jobs to be assigned, the distribution order of the jobs to be assigned is determined;
[0143] Based on the hardware resource value of the target executor and the hardware resource occupancy value of the job to be assigned, the job to be assigned is distributed to the corresponding target executor in accordance with the distribution order.
[0144] Optionally, the step of distributing the jobs to be assigned to the corresponding target executors based on the hardware resource value of the target executor and the hardware resource occupancy value of the jobs to be assigned, according to the distribution order, includes:
[0145] Obtain the current job execution information of the target executor;
[0146] Based on the job operation information and the hardware resource value, calculate the current remaining resource ratio of the target executor;
[0147] Based on the remaining resource ratio of the target executor and the hardware resource occupancy value of the job to be assigned, the job to be assigned is distributed to the corresponding target executor in accordance with the distribution order.
[0148] The specific implementation of the storage medium in this application is basically the same as the embodiments of the distributed job scheduling method described above, and will not be repeated here.
[0149] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the distributed job scheduling method described above.
[0150] The specific implementation of the computer program product in this application is basically the same as the embodiments of the distributed job scheduling method described above, and will not be repeated here.
[0151] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0152] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0154] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A distributed job scheduling method, characterized in that, The distributed job scheduling method includes: Obtain the attribute information, resource usage information, and priority information of the job to be assigned; Based on the attribute information, a job distribution strategy is determined; Determine the target executor corresponding to the job distribution strategy; Obtain the current resource load information of the target executor, and distribute the job to be assigned to the corresponding target executor based on the resource occupancy information, the priority information, and the resource load information of the target executor; The step of obtaining the attribute information of the job to be assigned includes: Obtain the historical hardware resource usage value of a preset number of jobs to be assigned, wherein the historical hardware resource usage value is the hardware resource value of the executor occupied by the job to be assigned when it runs on the executor; The difference between the historical hardware resource usage values is calculated to obtain the difference result; Determine whether the difference result is greater than a preset difference threshold; The jobs to be assigned with a difference result greater than a preset difference threshold are identified as having unstable program operation attributes, while the jobs to be assigned with a difference result less than or equal to the preset difference threshold are identified as having stable program operation attributes. The attribute information includes program stability attributes and program instability attributes. The step of determining the job distribution strategy based on the attribute information includes: If the attribute information of the job to be assigned is a program running stability attribute, then the job distribution strategy for the job to be assigned is determined to be a resource load balancing strategy. If the attribute information of the job to be assigned is an unstable program running attribute, then the job distribution strategy for the job to be assigned is determined to be a balanced strategy based on the number of concurrent users.
2. The distributed job scheduling method as described in claim 1, characterized in that, The target executor specifically refers to each executor under the executor group. When the resources of the executor group are insufficient to allocate the jobs to be allocated, the number of executors in the executor group is expanded to meet the resource allocation needs of the jobs to be allocated.
3. The distributed job scheduling method as described in claim 1, characterized in that, The step of obtaining the current resource load information of the target executor and distributing the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor includes: If the job distribution strategy is a balanced strategy based on the number of concurrent users, then obtain the current number of concurrent jobs of the target executor, and calculate the current job concurrency ratio of the target executor based on the number of concurrent jobs; Based on the priority information of the jobs to be assigned, the distribution order of the jobs to be assigned is determined; Based on the resource usage information of the jobs to be assigned and the current job concurrency ratio of the target executor, the jobs to be assigned are distributed to the corresponding target executors according to the distribution order.
4. The distributed job scheduling method as described in claim 1, characterized in that, The step of obtaining the current resource load information of the target executor and distributing the job to be assigned to the corresponding target executor based on the resource occupancy information of the job to be assigned, the priority information, and the resource load information of the target executor includes: If the job distribution strategy is a resource load balancing strategy, then the hardware configuration information of the target executor is obtained, and the hardware configuration information is quantified into hardware resource values; The resource usage information of the jobs to be assigned is quantified into hardware resource usage values; Based on the priority information of the jobs to be assigned, the distribution order of the jobs to be assigned is determined; Based on the hardware resource value of the target executor and the hardware resource occupancy value of the job to be assigned, the job to be assigned is distributed to the corresponding target executor in accordance with the distribution order.
5. The distributed job scheduling method as described in claim 4, characterized in that, The step of distributing the jobs to be assigned to the corresponding target executors according to the distribution order based on the hardware resource value of the target executor and the hardware resource occupancy value of the jobs to be assigned includes: Obtain the current job execution information of the target executor; Based on the job operation information and the hardware resource value, calculate the current remaining resource ratio of the target executor; Based on the remaining resource ratio of the target executor and the hardware resource occupancy value of the job to be assigned, the job to be assigned is distributed to the corresponding target executor in accordance with the distribution order.
6. A distributed job scheduling device, characterized in that, The distributed job scheduling device includes: The acquisition module is used to acquire the attribute information, resource usage information, and priority information of the job to be assigned. The strategy determination module is used to determine the job distribution strategy based on the attribute information; An executor determination module is used to determine the target executor corresponding to the job distribution strategy. The allocation module is used to obtain the current resource load information of the target executor, and distribute the job to be allocated to the corresponding target executor based on the resource occupancy information, the priority information and the resource load information of the target executor. The acquisition module is used to achieve: Obtain the historical hardware resource usage value of a preset number of jobs to be assigned, wherein the historical hardware resource usage value is the hardware resource value of the executor occupied by the job to be assigned when it runs on the executor; The difference between the historical hardware resource usage values is calculated to obtain the difference result; Determine whether the difference result is greater than a preset difference threshold; The jobs to be assigned with a difference result greater than a preset difference threshold are identified as having unstable program operation attributes, while the jobs to be assigned with a difference result less than or equal to the preset difference threshold are identified as having stable program operation attributes. The attribute information includes program stability attributes and program instability attributes, and the strategy determination module is used to implement: If the attribute information of the job to be assigned is a program running stability attribute, then the job distribution strategy for the job to be assigned is determined to be a resource load balancing strategy. If the attribute information of the job to be assigned is an unstable program running attribute, then the job distribution strategy for the job to be assigned is determined to be a balanced strategy based on the number of concurrent users.
7. A distributed job scheduling device, characterized in that, The distributed job scheduling device includes: a memory, a processor, and a program stored in the memory for implementing the distributed job scheduling method. The memory is used to store programs that implement the distributed job scheduling method; The processor is used to execute a program that implements the distributed job scheduling method to implement the steps of the distributed job scheduling method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores a program that implements a distributed job scheduling method, which is executed by a processor to implement the steps of the distributed job scheduling method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
MPP (Massively Parallel Processing) cluster task scheduling method based on system load
CN105302638A
Task scheduling method and device for distributed tasks and electronic device
CN113051063A
