Job scheduling methods, devices, equipment, storage media and program products

By obtaining executor status information through the coordinator, identifying target executors, and assigning jobs, the problem of the framework-side database being unable to perceive executor load is solved, thus achieving executor load balancing and efficient job execution.

CN116185590BActive Publication Date: 2025-12-02INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310159766.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2025-12-02
Estimated Expiration
2043-02-23

AI Technical Summary

Technical Problem

In distributed scheduling scenarios, the framework-side database cannot perceive the job execution status in the executor, which may lead to excessive CPU and memory load on some executors, potentially causing them to crash and reducing executor efficiency.

Method used

The coordinator obtains the executor's running status information, identifies the target executor, and distributes jobs evenly based on the number of jobs and performance parameters. The remote procedure call service is used to send jobs to ensure executor load balancing.

Benefits of technology

It reduces the possibility of actuator downtime, improves the efficiency of actuator operation, and achieves a balanced distribution of workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116185590B_ABST
    Figure CN116185590B_ABST
Patent Text Reader

Abstract

This invention provides a job scheduling method, apparatus, device, storage medium, and program product. The method determines the jobs to be executed in the framework-side database. The jobs to be executed are those that meet the execution conditions. Based on the received running status information of each executor, the method determines the target executor corresponding to the job to be executed and sends the job to be executed to the target executor. The target executor is used to execute the job to be executed, so that the workload of each executor on the application side is kept balanced, the phenomenon of rapid increase in workload in a certain executor is reduced, the possibility of a certain executor crashing is reduced, and the efficiency of executor in executing jobs is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of job scheduling technology, and in particular to a job scheduling method, apparatus, equipment, storage medium, and program product. Background Technology

[0002] In a distributed scheduling scenario, jobs run in executors on the application side. There are multiple executors on one application side, and the framework-side database is used to schedule the jobs in each executor to achieve job execution.

[0003] However, the framework-side database cannot detect whether jobs in each executor have been completed. If an executor has many jobs, it can lead to a surge in CPU and memory usage within a given timeframe, potentially causing the executor to crash and preventing jobs from executing. Therefore, preventing executor crashes and improving job execution efficiency are urgent problems to be solved. Summary of the Invention

[0004] This invention provides a job scheduling method, apparatus, device, storage medium, and program product to prevent actuator downtime and improve the efficiency of actuator in performing jobs.

[0005] In a first aspect, the present invention provides a job scheduling method, the method comprising:

[0006] Identify the jobs to be executed in the framework-side database; the jobs to be executed are those that meet the execution conditions.

[0007] The target executor corresponding to the task to be executed is determined based on the received running status information of each executor.

[0008] The job to be executed is sent to the target executor; the target executor is used to execute the job to be executed.

[0009] Optionally, the running status information includes the number of jobs and performance parameters; the number of jobs represents the number of jobs in the executor; the performance parameters represent the remaining memory usage and / or the remaining CPU usage.

[0010] Optionally, determining the target executor corresponding to the task to be executed based on the received running status information of each executor includes:

[0011] For each actuator, determine whether the number of jobs is less than the job number threshold corresponding to the actuator. If it is less, mark the actuator as the first actuator. The job number threshold is positively correlated with the initial hardware performance of the actuator.

[0012] By comparing the performance parameters corresponding to the first actuator, the actuator with the highest performance parameter is determined as the target actuator.

[0013] Optionally, determining the jobs to be executed in the framework-side database includes:

[0014] Retrieve the type of each job from the framework-side database; the type includes a timing type and a dependency type; the dependency type indicates that the job meets the execution conditions when the dependent job completes its execution.

[0015] For timed tasks, determine whether the current time meets the timed execution conditions corresponding to the task. If it does, then determine the task as a task to be executed.

[0016] For jobs with dependency types, determine whether the corresponding dependent job is a job to be executed. If so, determine that the job is a job to be executed.

[0017] Optionally, sending the job to be executed to the target executor includes:

[0018] When there are multiple jobs to be executed, multiple threads are started between the target executor;

[0019] The scheduling information of the job to be executed is obtained from the framework-side database, and the scheduling information and the job start instruction for the timed job are sent to the target executor through the multiple threads; the target executor is used to start executing the timed job according to the job start instruction, and to start executing the corresponding dependent job when the dependent job is completed.

[0020] Optionally, the method further includes:

[0021] The system receives performance parameters sent periodically by each executor; these performance parameters are determined by the executor based on the job being executed; wherein, when the job being executed belongs to a job group, the performance parameters are determined by the job with the highest performance consumption in the job group; the job group represents a group of jobs with dependencies.

[0022] In a second aspect, the present invention provides a job scheduling device, the device comprising:

[0023] The first determining module is used to determine the jobs to be executed in the framework-side database; the jobs to be executed are jobs that meet the execution conditions.

[0024] The second determining module is used to determine the target executor corresponding to the job to be executed based on the received running status information of each executor.

[0025] A sending module is used to send the job to be executed to the target executor; the target executor is used to execute the job to be executed.

[0026] Thirdly, the present invention provides an electronic device, comprising: at least one processor and a memory;

[0027] The memory stores the instructions that the computer executes;

[0028] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the method as described in any of the first aspects.

[0029] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method of any one of the first aspects.

[0030] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects.

[0031] This invention provides a job scheduling method, apparatus, device, storage medium, and program product. By identifying jobs to be executed in the framework-side database (jobs that meet execution conditions), the method determines a target executor corresponding to the job to be executed based on the received running status information of each executor. The method then sends the job to the target executor to execute it. This ensures that the workload of all executors on the application side remains balanced, reduces the phenomenon of a rapid increase in workload in a particular executor, reduces the possibility of a particular executor crashing, and improves the efficiency of executor job execution. Attached Figure Description

[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0033] Figure 1 This is an application scenario diagram of a job scheduling method provided in an embodiment of the present invention;

[0034] Figure 2 A flowchart illustrating a job scheduling method provided in an embodiment of the present invention;

[0035] Figure 3 A flowchart illustrating another job scheduling method provided in an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram illustrating the sending of a task to be executed to a target executor, as provided in an embodiment of the present invention.

[0037] Figure 5 This is a schematic diagram of the structure of a job scheduling device provided in an embodiment of the present invention;

[0038] Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention.

[0039] The accompanying drawings have illustrated specific embodiments of the invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention.

[0041] A job refers to the business logic that needs to be completed during application runtime. Applications typically require the execution of many jobs. The framework-side database can store job execution information, allowing the jobs to be executed in executors. For example, in a bank transaction process, there is a job that deducts service fees periodically. For an application with a large number of jobs, a distributed job approach can be used, meaning multiple executors exist, each capable of executing jobs from the framework-side database.

[0042] However, for distributed jobs, the framework-side database cannot detect whether a job has been completed after scheduling it. When allocating jobs to various executors, the database can only send them randomly or based on the number of jobs sent to each executor. However, different jobs and different executors result in different execution times for each job. Therefore, it's possible that one executor has a large number of jobs while another has fewer, leading to a situation where a single executor is executing a large number of jobs simultaneously within a certain timeframe. This causes a spike in CPU and memory usage on that executor, and in severe cases, can lead to a system crash, preventing all jobs on that executor from running and reducing its efficiency.

[0043] Figure 1 This is an application scenario diagram of a job scheduling method provided in an embodiment of the present invention, such as... Figure 1As shown, this application sets up a coordinator, which is located on a different device from the framework-side database, allowing them to transmit data. Each executor is also located on a different device; for example, there are n executors, each capable of transmitting data with the coordinator. The coordinator receives the running status of each executor and determines the jobs to be executed in the framework-side database. Based on the running status of each executor, it assigns an executor to each job, ensuring a balanced distribution of jobs across executors, preventing executor downtime, and improving executor efficiency.

[0044] Figure 2 This is a flowchart illustrating a job scheduling method provided in an embodiment of the present invention. The method is applied to a coordinator, which can be implemented in software or hardware. The method includes steps S201 to S203:

[0045] Step S201: Determine the jobs to be executed in the framework-side database.

[0046] Optionally, a job to be executed is a job that meets the execution conditions but has not been assigned an executor. The framework-side database stores the execution information of each job corresponding to the application, such as execution conditions and scheduling information. Execution conditions indicate the conditions that a job must meet to be executed; scheduling information indicates the specific content that the job needs to perform. When assigning an executor to a job, the coordinator can first determine the jobs to be executed. For example, if the execution condition for job 1 is 8:00 and the current time is 7:55, then this job can be determined as a job to be executed.

[0047] Step S202: Determine the target executor corresponding to the job to be executed based on the received running status information of each executor.

[0048] Each actuator can proactively send its running status information to the coordinator. For example, each actuator can periodically send its running status information to the coordinator every 5 minutes. Alternatively, the coordinator can send a message to each actuator to retrieve its running status information, and each actuator can then send its running status information back to the coordinator after receiving the message.

[0049] Optionally, the running status information includes the number of jobs and performance parameters; the number of jobs indicates the number of jobs in the executor; the performance parameters indicate the remaining memory usage and / or the remaining CPU usage.

[0050] The tasks in an executor include tasks currently being executed and tasks awaiting execution. The number of tasks refers to the sum of the number of tasks currently being executed and the number of tasks awaiting execution. The number of tasks in an executor can be used to measure the executor's current task execution capacity. When the number of tasks is high, it indicates that the executor's current task execution capacity is weak, and it is not advisable to assign more tasks to that executor. When the number of tasks is low, it indicates that the executor's current task execution capacity is strong, and tasks can be assigned to that executor.

[0051] In addition, performance parameters can be used to represent the operating status of the executor. Each executor is a hardware device, and the memory size and CPU of the hardware device can measure the hardware's processing capacity for jobs. During job execution, memory and CPU are consumed, and the remaining memory usage and / or CPU usage of the executor can measure its current job execution capability. For example, a smaller performance parameter indicates a weaker current job execution capability of the executor, making it inconvenient to assign jobs to that executor; a larger performance parameter indicates a stronger current job execution capability of the executor, making it suitable to assign jobs to that executor.

[0052] By analyzing the number of jobs and performance parameters in the actuator, we can intuitively measure the actuator's current ability to perform jobs, thus accurately identifying the target actuator corresponding to the job to be performed.

[0053] Upon receiving the operational status information from each executor, the target executor corresponding to the task to be executed can be determined based on this information. The target executor determined based on the operational status information of each executor is the one with the strongest capability to currently execute the task, thus enabling the determination of the target executor based on the current capability of the executor to perform the task.

[0054] Step S203: Send the job to be executed to the target executor; the target executor is used to execute the job.

[0055] Once the target executor is determined, the job to be executed can be sent to the target executor, causing the job to be executed in the target executor. When sending the job to be executed, it can be done based on the Remote Procedure Call (RPC) service. This service allows a program on one device to call a program on another device, offering the advantage of convenient data transmission.

[0056] This invention provides a job scheduling method. The method determines the jobs to be executed in the framework-side database. The jobs to be executed are those that meet the execution conditions. Based on the running status information of each executor received, the method determines the target executor corresponding to the job to be executed, sends the job to the target executor, and the target executor executes the job. This keeps the workload of all executors on the application side balanced, reduces the phenomenon of rapid increase in workload in a certain executor, reduces the possibility of a certain executor crashing, and improves the efficiency of executors in executing jobs.

[0057] Figure 3 This is a flowchart illustrating another job scheduling method provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the method includes:

[0058] Step S301: Obtain the type of each job in the framework-side database; the type includes timing type and dependency type. The dependency type indicates that the job meets the execution conditions when the dependent job is completed;

[0059] Step S302: For timed jobs, determine whether the current time meets the timed execution conditions corresponding to the job. If it does, determine that the job is a job to be executed.

[0060] Step S303: For jobs with dependency types, determine whether the corresponding dependent job is a job to be executed. If so, determine that the job is a job to be executed.

[0061] Steps S301 to S303 above constitute the process of determining the job to be executed. Specifically, the type of each job can be obtained from the framework-side database first. The type includes a timing type and a dependency type. For a timing type job, the obtained information also includes the timing execution conditions. For a dependency type job, the obtained information also includes the job that it depends on.

[0062] For a given task, if the task type is scheduled, then it is determined whether the current time meets the task's scheduled execution conditions. For example, task 1 is a scheduled task with the execution condition of daily execution at 8:00 AM. If the current time is 7:55 AM, then task 1 is a task awaiting execution. In other words, if the difference between the current time and the task's execution time is a preset time, then the task is determined to be a task awaiting execution. The preset time can be set according to actual circumstances.

[0063] For a given job, if the job type is dependency-based, it can be determined whether the dependent job is a job awaiting execution. If so, then the job itself is also a job awaiting execution. For example, both job 2 and job 3 are dependency-based jobs. The execution condition for job 2 is the completion of job 3, and the execution condition for job 3 is the completion of job 4. Job 4 is a timed job. When job 4 is a job awaiting execution, then job 2 and job 3 are also jobs awaiting execution.

[0064] By identifying the dependent job as a job to be executed, the executor is also identified as a job to be executed, eliminating the need for the executor to return information indicating the completion of the dependent job after execution. This reduces information transmission, simplifies processing logic, and improves the efficiency of identifying jobs to be executed, as well as the efficiency of job execution.

[0065] Step S304: Receive performance parameters sent periodically by each executor through the remote procedure call service; the performance parameters are determined by the executor based on the job being executed; where, when the job being executed belongs to a job group, the performance parameters are determined by the job with the highest performance consumption in the job group; a job group represents a group of jobs with dependencies.

[0066] Each actuator can periodically send its performance parameters and job count to the coordinator. For example, it can determine its own performance parameters and job count every five minutes and send them to the coordinator.

[0067] When determining performance parameters, they can be based on the performance consumption of the currently executing job. When there are dependent jobs, the dependencies can be obtained. For example, if the execution condition for job 2 is the completion of job 3, and the execution condition for job 3 is the completion of job 4, then jobs 2, 3, and 4 are considered a job group. When a job in a job group is marked as a high-performance consuming job, the performance parameters are calculated based on the performance consumption of that high-performance consuming job when the job group begins execution. This is because when the coordinator determines the target job, the running status information of each executor may be information received several minutes ago, and the current running status information of each executor cannot be determined. In extreme cases, when an executor reports its running status information, it is executing job 1; when the coordinator determines the target executor, that executor is executing job 2. If job 1 has low performance consumption and job 2 has high performance consumption, determining the executor's performance parameters based on the performance consumption of job 1 would result in a large error. Therefore, when executing any job in a job group, the performance parameters of that executor can be determined based on the job with the highest performance consumption in that group.

[0068] When the aforementioned actuator actively sends performance parameters to the coordinator, it determines the corresponding performance parameters based on the job with the highest performance consumption in a job group. This allows for more accurate determination of performance parameters, enabling the coordinator to accurately identify the target actuator based on the performance parameters and improving the accuracy of the identified target actuator.

[0069] Step S305: For each executor, determine whether the number of jobs is less than the job number threshold corresponding to the executor. If it is less, mark the executor as the first executor.

[0070] When determining the target executor, the relationship between the number of jobs for each executor and the corresponding job number threshold can be determined first. If the number of jobs is less than the job number threshold, it indicates that the executor initially meets the conditions, and the executor is marked as the first executor. The job number threshold for each executor is determined by the coordinator.

[0071] The job quantity threshold is positively correlated with the initial hardware performance of the executor. Optionally, for each executor, the coordinator can obtain the initial hardware performance of that executor and determine the job quantity threshold based on that performance. The job quantity threshold represents the number of jobs that an executor can run simultaneously. The size of the job quantity threshold is determined by the initial hardware performance of the executor; higher initial hardware performance results in a larger job quantity threshold, and vice versa. Initial hardware performance can include initial memory, initial CPU size, etc.

[0072] Step S306: Compare the performance parameters of the first actuators and determine the actuator with the highest performance parameters as the target actuator.

[0073] When there are multiple first executors, the performance parameters corresponding to each first executor can be compared, namely the remaining memory usage and / or the remaining CPU usage, and the executor with the larger performance parameter is determined as the target executor.

[0074] Based on the above steps S305 and S306, the optimal target actuator can be determined.

[0075] Optionally, when determining the target executor corresponding to the job to be executed based on the received running status information of each executor, a score can also be calculated for each executor based on the running status information, and the executor with the higher score is determined as the target executor. Specifically, for a single executor, the score calculation process can be as follows: calculate the difference between the job quantity threshold corresponding to the executor and the job quantity; calculate the weighted sum of the difference and performance parameters, where the weight corresponding to the difference is the first weight, and the weight corresponding to the performance parameters is the second weight. The first and second weights can be set according to actual conditions.

[0076] Based on the number of jobs, job thresholds, and performance parameters of each actuator, the target actuator can be accurately determined, and the number of jobs in each actuator can be balanced, avoiding the phenomenon of a rapid increase in the number of jobs in some actuators.

[0077] Step S307: When there are multiple jobs to be executed, start multiple threads between the target executor and the target executor.

[0078] When there are multiple jobs to be executed, a target executor can be identified to execute multiple jobs. This simplifies the process of identifying the target executor. At the same time, the coordinator only needs to transmit information with one target executor, without having to establish connections with multiple executors.

[0079] Since there are multiple jobs to be executed, multiple threads can be started when sending the jobs to the target executor, thereby improving the efficiency of transmitting multiple jobs to the target executor.

[0080] Optionally, multiple threads between the target executor and the target executor may be identified, including:

[0081] Determine the number of timed jobs among the pending jobs, and then determine the number of threads to start based on the number of timed jobs.

[0082] Figure 4 This is a schematic diagram illustrating the sending of a job to be executed to a target executor, as provided in an embodiment of the present invention. Figure 4 As shown, there are 6 jobs to be executed, 3 of which are timed jobs and 3 are dependent jobs. Since dependent jobs require the completion of a timed job or another dependent job, 3 threads can be started between the coordinator and the target executor, namely thread 1, thread 2 and thread 3, to ensure that timed jobs can be transmitted to the target executor in a timely manner. When the timed job in one thread has been transmitted, the dependent job is then transmitted.

[0083] Step S308: Obtain the scheduling information of the job to be executed from the framework-side database, and send the scheduling information and the job start instruction for the timed type job to the target executor through multiple threads; the target executor is used to start executing the timed type job according to the job start instruction, and to start executing the corresponding dependent type job when the dependent job is completed.

[0084] After starting multiple threads, the scheduling information of the jobs to be executed can be obtained from the framework's database, which is the specific content that the jobs need to perform. The obtained scheduling information, along with the job start command, is then sent to the target executor through multiple threads.

[0085] Specifically, when sending a job start command, for timed jobs, a job start command can be sent directly; for dependent jobs, a dependent job and a job start command can be sent. When the target executor executes the dependent job, it will first obtain the execution status of the dependent job. When the dependent job is completed, it will directly start executing the dependent job.

[0086] When multiple jobs to be executed correspond to one target executor, multiple threads are established between the coordinator and the target executor to improve the efficiency of the transmission of scheduling information for the jobs to be executed and ensure the timely execution of scheduled jobs.

[0087] Figure 5 This is a schematic diagram of a job scheduling device provided in an embodiment of the present invention. The device 50 includes:

[0088] The first determining module 501 is used to determine the jobs to be executed in the framework-side database; the jobs to be executed are jobs that meet the execution conditions.

[0089] The second determining module 502 is used to determine the target executor corresponding to the job to be executed based on the received running status information of each executor.

[0090] The sending module 503 is used to send the job to be executed to the target executor; the target executor is used to execute the job to be executed.

[0091] Optionally, the running status information includes the number of jobs and performance parameters; the number of jobs represents the number of jobs in the executor; the performance parameters represent the remaining memory usage and / or the remaining CPU usage.

[0092] Optionally, the second determining module 502 is specifically used for:

[0093] For each actuator, determine whether the number of jobs is less than the job number threshold corresponding to the actuator. If it is less, mark the actuator as the first actuator. The job number threshold is positively correlated with the initial hardware performance of the actuator.

[0094] By comparing the performance parameters corresponding to the first actuator, the actuator with the highest performance parameter is determined as the target actuator.

[0095] Optionally, the first determining module 501 is specifically used for:

[0096] Retrieve the type of each job from the framework-side database; the type includes a timing type and a dependency type; the dependency type indicates that the job meets the execution conditions when the dependent job completes its execution.

[0097] For timed tasks, determine whether the current time meets the timed execution conditions corresponding to the task. If it does, then determine the task as a task to be executed.

[0098] For jobs with dependency types, determine whether the corresponding dependent job is a job to be executed. If so, determine that the job is a job to be executed.

[0099] Optionally, the sending module 503 is specifically used for:

[0100] When there are multiple jobs to be executed, multiple threads are started between the target executor;

[0101] The scheduling information of the job to be executed is obtained from the framework-side database, and the scheduling information and the job start instruction for the timed job are sent to the target executor through the multiple threads; the target executor is used to start executing the timed job according to the job start instruction, and to start executing the corresponding dependent job when the dependent job is completed.

[0102] Optionally, the device further includes a receiving module, specifically used for:

[0103] The system receives performance parameters sent periodically by each executor via a remote procedure call service. These performance parameters are determined by the executor based on the job being executed. When the job being executed belongs to a job group, the performance parameters are determined by the job with the highest performance consumption in the job group. The job group represents a set of jobs with dependencies.

[0104] The job scheduling device provided in this embodiment of the invention can achieve the above-mentioned... Figures 2 to 4 The job scheduling method in the illustrated embodiment has a similar implementation principle and technical effect, and will not be described again here.

[0105] Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Figure 6 As shown, the electronic device provided in this embodiment includes at least one processor 601 and a memory 602. The processor 601 and the memory 602 are connected via a bus 603.

[0106] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to execute the method in the above method embodiment.

[0107] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0108] In the above Figure 6 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0109] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage.

[0110] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0111] This invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in the above embodiments.

[0112] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the above method embodiments.

[0113] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0114] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0115] 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.

[0116] 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.

[0117] 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), 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.

[0118] 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 job scheduling method, characterized in that, The method includes: Obtain the type and corresponding association information of each job in the framework side database; the type includes timing type and dependency type. The timing type job is associated with the timing execution condition, and the dependency type job is associated with the dependent job and is used to indicate that the job meets the execution condition when the dependent job is completed. For timed tasks, determine whether the current time differs from the task execution time in the timed execution conditions by a preset duration; if so, determine that the task is a task to be executed. For jobs with dependency types, determine whether the corresponding dependent job is a job to be executed; if so, determine that the job is a job to be executed. The system receives performance parameters and job counts periodically sent by each executor via a remote procedure call service. The job count represents the sum of the number of jobs currently being executed and the number of jobs waiting to be executed in the executor. The performance parameters include remaining memory usage and / or remaining CPU usage. The performance parameters are determined by the executor based on the jobs currently being executed. Wherein, when the job being executed belongs to a job group, the performance parameters are determined by the job with the highest performance consumption in the job group. The job group represents a group of jobs with dependencies. For each actuator, determine whether the number of jobs in that actuator is less than the job number threshold corresponding to that actuator. If it is less, then mark the actuator as the first actuator. The job number threshold is positively correlated with the initial hardware performance of the actuator. By comparing the performance parameters corresponding to the first actuators, the actuator with the highest performance parameter is determined as the target actuator; the target actuator is used to execute the job to be executed. When there are multiple jobs to be executed, multiple threads are started between the target executor; The scheduling information of the job to be executed is obtained from the framework-side database, and the scheduling information and the job start instruction for the timed job are sent to the target executor through the multiple threads; the target executor is used to start executing the timed job according to the job start instruction, and to start executing the corresponding dependent job when the dependent job is completed.

2. A job scheduling device, characterized in that, The device includes: The first determining module is used to obtain the type of each job and its corresponding association information in the framework-side database. The type includes a timing type and a dependency type. The timing type job is associated with a timing execution condition, and the dependency type job is associated with a dependent job and is used to indicate that the job meets the execution condition when the dependent job is completed. For the timing type job, it is determined whether the current time differs from the job execution time in the timing execution condition by a preset duration. If so, the job is determined to be a job to be executed. For the dependency type job, it is determined whether the corresponding dependent job is a job to be executed. If so, the job is determined to be a job to be executed. The receiving module is used to receive performance parameters and job counts periodically sent by each executor through a remote procedure call service. The job count represents the sum of the number of jobs currently being executed and the number of jobs waiting to be executed in the executor. The performance parameters include remaining memory usage and / or remaining CPU usage. The performance parameters are determined by the executor based on the jobs being executed. Wherein, when the job being executed belongs to a job group, the performance parameters are determined by the job with the highest performance consumption in the job group. The job group represents a group of jobs with dependencies. The second determining module is used to determine, for each executor, whether the number of jobs in that executor is less than the job number threshold corresponding to that executor; if it is less, then the executor is marked as the first executor; the job number threshold is positively correlated with the initial hardware performance of the executor; the performance parameters corresponding to the first executor are compared, and the executor with the highest performance parameter is determined as the target executor; the target executor is used to execute the job to be executed; The sending module is used to start multiple threads with the target executor when there are multiple jobs to be executed; obtain the scheduling information of the jobs to be executed from the framework-side database, and send the scheduling information and job start instructions for timed jobs to the target executor through the multiple threads; the target executor is used to start executing the timed job according to the job start instructions, and start executing the corresponding dependent job when the dependent job is completed.

3. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in claim 1.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in claim 1.

5. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method as described in claim 1.

Citation Information

Patent Citations

  • Job scheduling method based on Raft algorithm

    CN110618863A

  • Service node scheduling method and device, equipment and storage medium

    CN110912967A

  • Distributed task processing method and system, electronic equipment and storage medium

    CN115686790A

  • Scale control server, scale control method, and scale control program

    JP2015060279A