Dynamic Batch Job Scheduling Method and Device

Through the dynamic batch job scheduling method, the average job time and job ID sorting are used to adjust the job execution sequence number, which solves the inefficiency problem caused by the randomness of job scheduling in the prior art, and achieves more efficient job execution.

CN113449991BActive Publication Date: 2025-06-17INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110727227.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-29
Publication Date
2025-06-17
Estimated Expiration
2041-06-29

AI Technical Summary

Technical Problem

The existing batch scheduling framework lacks a dynamic adjustment mechanism when job scheduling, resulting in the random order of job execution when the jobs that can be executed simultaneously exceed the concurrency limit, which cannot achieve the shortest total time-consuming, affecting the overall performance of the batch.

Method used

A dynamic batch job scheduling method is provided. By obtaining the batch job table and job time of batch jobs, calculating the average job time of each job, sorting it according to the average job time and job ID, and dynamically adjusting the execution sequence of the job to optimize the job scheduling sequence.

Benefits of technology

By dynamically adjusting the execution order of jobs, the operation execution efficiency is significantly improved, the total time consumption is reduced, the problem of low job scheduling efficiency in the prior art is overcome, and simple and low-cost dynamic multi-task scheduling is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113449991B_ABST
    Figure CN113449991B_ABST
Patent Text Reader

Abstract

A dynamic batch job scheduling method and device, which can be used in the financial field and other fields. The method includes: obtaining a batch job table of batch jobs and multiple job times of each job within a preset time period; determining the average job time of each job within the preset time period according to the job times of each job; traversing the batch job table forward, and sequentially obtaining the jobs in the batch jobs according to the job ID and average job time of each job. According to the preset variable values, preset job dependencies and initial execution sequence numbers of each job, adjust the execution sequence numbers of the obtained jobs and their pre-jobs and update the preset variable values until the forward traversal of the batch job table is completed. The present invention greatly improves the job execution efficiency, overcomes the shortcoming of low job scheduling efficiency in the existing batch framework, has a simple implementation and low implementation cost, and achieves the purpose of dynamic multi-task scheduling for effectively improving job scheduling efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of batch job scheduling, and particularly to a dynamic batch job scheduling method and device. Background Art

[0002] Currently, the common batch scheduling frameworks are the Entegor batch framework and the dbf batch framework. The task scheduling order is determined based on time and dependency relationships, without a dynamic adjustment mechanism. However, when the Entegor batch framework and the dbf batch framework schedule jobs, when the number of jobs that can be executed simultaneously exceeds the concurrency limit, the jobs that enter the queue for execution first are random, resulting in a random actual job execution order. This randomness of the job order leads to the total time taken for all jobs to complete not being the shortest, affecting the overall performance of the batch. Summary of the Invention

[0003] Aiming at the problems existing in the prior art, the main purpose of the embodiments of the present invention is to provide a dynamic batch job scheduling method and device, achieving the purposes of simple implementation, low implementation cost, and effectively improving job scheduling efficiency.

[0004] To achieve the above object, an embodiment of the present invention provides a dynamic batch job scheduling method, the method comprising:

[0005] Obtain a batch job table of batch jobs and multiple job times of each job within a preset time period; wherein, the batch job table includes the initial execution sequence number and job ID of each job in the batch jobs;

[0006] Determine the average job time of each job within the preset time period according to the job times of each job;

[0007] Traverse the batch job table in the forward direction, and sequentially obtain the jobs in the batch jobs according to the job ID and average job time of each job, and adjust the execution sequence number of the obtained job and its preceding jobs and update the preset variable value according to the preset variable value, preset job dependency relationship of the batch job, and the initial execution sequence number of each job, until the forward traversal of the batch job table is completed.

[0008] Optionally, in an embodiment of the present invention, the method further comprises:

[0009] After the forward traversal of the batch job table is completed, traverse the batch job table in the reverse direction and perform reverse adjustment on the execution sequence numbers of the jobs in the batch job.

[0010] Optionally, in an embodiment of the present invention, the sequentially obtaining the jobs in the batch jobs according to the job ID and average job time of each job includes:

[0011] Obtain the jobs in the batch job in sequence according to the order of the average job time of each job in the batch job from largest to smallest and the order of the job IDs of each job from smallest to largest.

[0012] Optionally, in an embodiment of the present invention, the adjustment of the execution sequence of the obtained job and its pre-job by the batch job according to the preset variable value, the preset job dependency, and the initial execution sequence of each job includes:

[0013] Compare the preset variable value of the batch job with the initial execution sequence of each job to obtain a first comparison result, and adjust the execution sequence of the obtained job according to the first comparison result;

[0014] Determine the pre-job corresponding to the obtained job according to the preset job dependency, compare the adjusted execution sequence with the execution sequence of the pre-job to obtain a second comparison result, and adjust the execution sequence of the pre-job according to the second comparison result.

[0015] An embodiment of the present invention further provides a dynamic batch job scheduling device, and the device includes:

[0016] A data acquisition module, configured to acquire a batch job table of a batch job and multiple job times of each job within a preset time period; wherein, the batch job table includes the initial execution sequence and job ID of each job in the batch job;

[0017] An average job time module, configured to determine the average job time of each job within a preset time period according to the job times of each job;

[0018] An execution sequence adjustment module, configured to traverse the batch job table forward, obtain the jobs in the batch job in sequence according to the job ID and average job time of each job, and adjust the execution sequence of the obtained job and its pre-job and update the preset variable value according to the preset variable value, the preset job dependency, and the initial execution sequence of each job in the batch job until the forward traversal of the batch job table is completed.

[0019] Optionally, in an embodiment of the present invention, the device further includes:

[0020] A reverse adjustment module, configured to, after the forward traversal of the batch job table is completed, traverse the batch job table in reverse and perform reverse adjustment on the execution sequence of the jobs in the batch job.

[0021] Optionally, in an embodiment of the present invention, the execution sequence adjustment module is further configured to obtain the jobs in the batch job in sequence according to the order of the average job time of each job in the batch job from largest to smallest and the order of the job IDs of each job from smallest to largest.

[0022] Optionally, in an embodiment of the present invention, the execution sequence adjustment module includes:

[0023] A first adjustment unit, configured to compare the preset variable value of the batch job with the initial execution sequence numbers of each job to obtain a first comparison result, and adjust the execution sequence numbers of the obtained jobs according to the first comparison result;

[0024] A second adjustment unit, configured to determine the prerequisite jobs corresponding to the obtained jobs according to the preset job dependency relationship, compare the adjusted execution sequence numbers with the execution sequence numbers of the prerequisite jobs to obtain a second comparison result, and adjust the execution sequence numbers of the prerequisite jobs according to the second comparison result.

[0025] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the above method is implemented.

[0026] The present invention also provides a computer-readable storage medium, which stores a computer program for executing the above method.

[0027] By adopting a dynamic adjustment method for the scheduling sequence of jobs in the same session, the present invention replaces the previous random execution order of jobs in the same session, greatly improving the job execution efficiency, overcoming the shortcoming of low job scheduling efficiency in the existing batch framework, with simple implementation and low implementation cost, achieving the purpose of dynamically multi-task scheduling for effectively improving job scheduling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0029] Figure 1 It is a flowchart of a dynamic batch job scheduling method according to an embodiment of the present invention;

[0030] Figure 2 It is a flowchart of execution sequence adjustment in an embodiment of the present invention;

[0031] Figure 3 It is a flowchart of batch job scheduling in a specific embodiment of the present invention;

[0032] Figure 4 It is a structural schematic diagram of a dynamic batch job scheduling device according to an embodiment of the present invention;

[0033] Figure 5 The structural schematic diagram of the dynamic batch job scheduling device in a specific embodiment of the present invention;

[0034] Figure 6 The structural schematic diagram of the execution sequence adjustment module in an embodiment of the present invention;

[0035] Figure 7 The structural schematic diagram of the electronic device provided by an embodiment of the present invention. Specific embodiments

[0036] The embodiments of the present invention provide a dynamic batch job scheduling method and device, which can be used in the financial field or other fields. It should be noted that the dynamic batch job scheduling method and device of the present invention can be used in the financial field and can also be used in any field other than the financial field. The application field of the dynamic batch job scheduling method and device of the present invention is not limited.

[0037] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0038] As Figure 1 shown in the flowchart of a dynamic batch job scheduling method in an embodiment of the present invention, the execution subject of the dynamic batch job scheduling method provided by the embodiment of the present invention includes but is not limited to a computer. The method includes:

[0039] Step S1, obtaining a batch job table of batch jobs and multiple job times of each job within a preset time period; wherein, the batch job table includes the initial execution sequence number and job ID of each job in the batch job.

[0040] Among them, before executing a certain session of job scheduling using the batch scheduling framework, first obtain the batch job table of the batch jobs in this session, and the multiple job times of each job in the batch jobs in this session within a preset time period. Specifically, the preset time period can be 7 days. In addition, a set of batch jobs with the same start execution time is called a batch session.

[0041] Furthermore, the batch job table records the initial execution sequence number and job ID of each job in the batch jobs in this session.

[0042] Step S2, determining the average job time of each job within the preset time period according to the job time of each job.

[0043] Among them, according to the multiple operation times of each operation within a preset time period, the average operation time of each operation can be determined. Specifically, within the preset time period, for example, 7 days, the ratio of the total operation time of each operation to 7 is the average operation time of each operation.

[0044] Step S3, traverse the batch operation table forward. According to the operation ID and average operation time of each operation, obtain the operations in the batch operation in sequence, and adjust the execution sequence of the obtained operation and its pre-operation, and update the preset variable value according to the preset variable value, preset operation dependency and the initial execution sequence number of each operation until the forward traversal of the batch operation table is completed.

[0045] Among them, traverse the batch operation information table forward, and obtain the operations of this session in the order of the average operation time for batch execution and the operation ID within a preset time period. Specifically, the larger the average operation time, the earlier it is obtained. If the average operation times are the same, the smaller the operation ID, the earlier it is obtained.

[0046] Furthermore, use the preset variable value and the initial execution sequence number to adjust the execution sequence number of the operation obtained this time. Specifically, the initial value of the preset variable value can be 1.

[0047] Furthermore, if the preset variable value is less than the initial execution sequence number of the operation obtained this time, set the execution sequence number of this operation to the preset variable value, otherwise keep the initial execution sequence number of this operation.

[0048] Furthermore, use the preset variable value and the preset operation dependency to adjust the execution sequence number of the pre-operation of the operation obtained this time. Among them, the operation dependency can be configured in the batch framework. The pre-operation is the dependent operation of the current operation, and the operation execution times are set to be the same, and the actual scheduling sequence is determined by the dependency. Traverse all the pre-operations of the operation obtained this time. If the execution sequence number of this operation is less than the execution sequence number of its pre-operation, set the execution sequence number of its pre-operation to the execution sequence number of this operation, otherwise the execution sequence number of the pre-operation remains unchanged.

[0049] Furthermore, after completing the adjustment of the execution sequence numbers of the operation obtained this time and its pre-operations, update the preset variable value. Specifically, increment the preset variable value by one. Repeat the processes of operation acquisition, adjustment of the execution sequence number of the operation obtained this time and its pre-operations, and update of the preset variable value until the forward traversal of the batch operation table is completed, that is, the traversal of the operations in this batch session is completed.

[0050] As an embodiment of the present invention, the method further includes: after the forward traversal of the batch operation table is completed, traverse the batch operation table in reverse and adjust the execution sequence numbers of the operations in the batch operation in reverse.

[0051] Among them, after the forward traversal of the batch job table is completed, the execution order of the pre-jobs is adjusted by reverse traversal, and the execution serial numbers are adjusted in reverse.

[0052] Specifically, the jobs are obtained according to the average job time of each job within a preset time period and the order of the job IDs. The smaller the average job time, the earlier it is obtained. If the average job times are the same, the larger the job ID, the earlier it is obtained. Verify whether the execution serial numbers of all the pre-jobs of the job obtained this time are less than or equal to the execution serial number of this job. If not, set the execution serial number of the pre-job to the execution serial number of this job.

[0053] As an embodiment of the present invention, obtaining the jobs in the batch jobs in sequence according to the job IDs and average job times of the jobs includes: obtaining the jobs in the batch jobs in sequence according to the order of the average job times of the jobs in the batch jobs from large to small and the order of the job IDs of the jobs from small to large.

[0054] Among them, when forward traversing the batch job information table, the jobs in this session are obtained according to the average batch execution job time and the order of the job IDs within a preset time period. Specifically, the larger the average job time, the earlier it is obtained. If the average job times are the same, the smaller the job ID, the earlier it is obtained.

[0055] As an embodiment of the present invention, as Figure 2 shown, adjusting the execution serial numbers of the obtained jobs and their pre-jobs according to the preset variable value, the preset job dependency relationship, and the initial execution serial number includes:

[0056] Step S21, comparing the preset variable value of the batch job with the initial execution serial number of each job to obtain a first comparison result, and adjusting the execution serial number of the obtained job according to the first comparison result;

[0057] Step S22, determining the pre-jobs corresponding to the obtained jobs according to the preset job dependency relationship, comparing the adjusted execution serial number with the execution serial number of the pre-job to obtain a second comparison result, and adjusting the execution serial number of the pre-job according to the second comparison result.

[0058] Among them, if the first comparison result is that the preset variable value is less than the initial execution serial number of the job obtained this time, set the execution serial number of this job to the preset variable value, otherwise keep the initial execution serial number of this job.

[0059] Furthermore, the execution serial numbers of the pre-jobs of the job obtained this time are adjusted by using the preset variable value and the preset job dependency relationship. Among them, the job dependency relationship can be configured in the batch framework. The pre-job is the dependent job of the current job. The job execution times are set to be the same, and the actual scheduling order is determined by the dependency relationship.

[0060] Specifically, traverse all the prerequisite jobs of the jobs obtained this time. If the second comparison result shows that the execution sequence number of this job is less than that of its prerequisite job, then set the execution sequence number of its prerequisite job to the execution sequence number of this job; otherwise, the execution sequence number of the prerequisite job remains unchanged.

[0061] In a specific embodiment of the present invention, as Figure 3 shown is the flowchart of batch job scheduling in a specific embodiment of the present invention. The present invention marks the execution sequence number for the jobs in the current session according to the average job time of each job, and the execution sequence number satisfies that the execution sequence number of the prerequisite job of this job is not later than the execution sequence number of this job. When scheduling jobs, the batch jobs in the same session are scheduled according to the job dependency relationship and the execution sequence number. The specific process of adjusting the job execution sequence number is as follows.

[0062] 1) After a batch of jobs in a certain session is completed, establish a variable a and assign it a value of 1, and set the job execution sequence number of this session to 9999.

[0063] 2) Calculate the average consumption time of the batch jobs in this session in the past 7 days (preset time period).

[0064] 3) Traverse the batch job information table in the positive direction, and obtain the jobs in this session according to the order of the average consumption time of batch execution in 7 days and the job IDs of each job. The larger the consumption time, the earlier it is obtained; for jobs with the same consumption time, the smaller the job ID, the earlier it is obtained.

[0065] 4) Adjust the execution sequence number of the obtained job (which can be configured in the job information table). If the variable a is less than the execution sequence number of this job, then set the execution sequence number of this job to a; otherwise, keep the initial execution sequence number of this job.

[0066] 5) Adjust the execution sequence number of the prerequisite jobs of the obtained job. In the batch framework, the job dependency relationship can be configured originally. The prerequisite job is the dependent job of the current job, and the job execution time is set the same. The actual scheduling order is determined by the dependency relationship. Traverse all the prerequisite jobs. If the execution sequence number of this job is less than that of its prerequisite job, then set the execution sequence number of its prerequisite job to the execution sequence number of this job; otherwise, the execution sequence number of the prerequisite job remains unchanged.

[0067] 6) Increment the variable a, check whether all the jobs in the current batch session have been traversed. If not, continue to obtain jobs, and loop to execute steps 4 and 5 until all the jobs in the current batch session have been traversed.

[0068] 7) Traverse in reverse order to adjust the execution order of the prerequisite jobs. Obtain the jobs according to the time-consuming order of batch execution in the previous 7 days and the job IDs. The job with less time-consuming is obtained first. If the time-consuming is the same, the job with a larger job ID is obtained first. Verify whether the execution serial numbers of all prerequisite jobs of this job batch are less than or equal to the execution serial number of this job. Otherwise, set the execution serial number of the prerequisite job to the execution serial number of this job.

[0069] In a specific embodiment of the present invention, the present invention adopts a dynamic adjustment method for the job scheduling order of the same session to replace the previous random order execution of jobs in the same session, which improves the job execution efficiency compared with the previous one. The following is an example.

[0070] Specifically, assume that the concurrency limit of the batch jobs in the same session is 10, and there are 101 downstream jobs in this session. Among them, 100 jobs take 5 minutes and 1 job takes 50 minutes, and the jobs have no dependencies. If the jobs are randomly executed without using the method of the present invention, when the job taking 50 minutes is executed last, the overall time-consuming reaches 100 minutes. If the dynamic batch job scheduling method of the present invention is adopted, the scheduling framework will give priority to executing the 50-minute job, and the overall time-consuming is 55 minutes. By comparison, it is found that under this assumption condition, the overall time-consuming of the batch of the present invention has decreased by 45%, and the batch execution efficiency has been greatly improved.

[0071] The present invention adopts a dynamic adjustment method for the job scheduling order of the same session to replace the previous random order execution of jobs in the same session, which greatly improves the job execution efficiency, overcomes the shortcoming of low job scheduling efficiency in the existing batch framework, is simple to implement, has a low implementation cost, and achieves the purpose of dynamic multi-task scheduling for effectively improving job scheduling efficiency.

[0072] As Figure 4 shown is a schematic structural diagram of a dynamic batch job scheduling device according to an embodiment of the present invention. The device shown in the figure includes:

[0073] A data acquisition module 10, configured to acquire a batch job table of batch jobs and multiple job times of each job within a preset time period; wherein, the batch job table includes the initial execution serial number and job ID of each job in the batch jobs.

[0074] Among them, before executing the job scheduling of a certain session by using the batch scheduling framework, first acquire the batch job table of the batch jobs in this session, and multiple job times of each job in the batch jobs in this session within a preset time period. Specifically, the preset time period can be 7 days. In addition, a set of batch jobs with the same start execution time is called a batch session.

[0075] Further, the batch job table records the initial execution serial number and job ID of each job in the batch jobs of this session.

[0076] The average operation time module 20 is used to determine the average operation time of each operation within a preset time period according to the operation time of each operation in it.

[0077] Among them, according to the multiple operation times of each operation within a preset time period, the average operation time of each operation can be determined. Specifically, within a preset time period, for example, 7 days, the ratio of the total operation time of each operation to 7 is the average operation time of each operation.

[0078] The execution sequence adjustment module 30 is used to traverse the batch operation table in the forward direction, obtain the operations in the batch operation according to the operation ID and average operation time of each operation in turn, and adjust the execution sequence of the obtained operation and its pre-operation according to the preset variable value, preset operation dependency and the initial execution sequence of each operation, and update the preset variable value until the forward traversal of the batch operation table is completed.

[0079] Among them, when traversing the batch operation information table in the forward direction, the operations of this session are obtained in the order of the average operation time and operation ID within the preset time period. Specifically, the larger the average operation time, the earlier it is obtained. If the average operation times are the same, the smaller the operation ID, the earlier it is obtained.

[0080] Furthermore, the execution sequence of the operation obtained this time is adjusted by using the preset variable value and the initial execution sequence. Specifically, the initial value of the preset variable value can be 1.

[0081] Furthermore, if the preset variable value is less than the initial execution sequence of the operation obtained this time, the execution sequence of this operation is set to the preset variable value, otherwise the initial execution sequence of this operation is maintained.

[0082] Furthermore, the execution sequence of the pre-operation of the operation obtained this time is adjusted by using the preset variable value and the preset operation dependency. Among them, the operation dependency can be configured in the batch framework. The pre-operation is the dependent operation of the current operation, and the operation execution times are set the same, and the actual scheduling sequence is determined by the dependency. Traverse all the pre-operations of the operation obtained this time. If the execution sequence of this operation is less than the execution sequence of its pre-operation, the execution sequence of its pre-operation is set to the execution sequence of this operation, otherwise the execution sequence of the pre-operation remains unchanged.

[0083] Furthermore, after the execution sequence adjustment of the operation obtained this time and its pre-operation is completed, the preset variable value is updated. Specifically, the preset variable value is incremented by one. Repeat the processes of operation acquisition, execution sequence adjustment of the operation obtained this time and its pre-operation, and update of the preset variable value until the forward traversal of the batch operation table is completed, that is, the traversal of the operations in this batch session is completed.

[0084] As an embodiment of the present invention, such asFigure 5 As shown, the device further includes:

[0085] A reverse adjustment module 40, configured to perform a reverse traversal of the batch job table after the forward traversal of the batch job table is completed, and perform a reverse adjustment on the execution sequence numbers of the jobs in the batch job.

[0086] Wherein, after the forward traversal of the batch job table is completed, the execution order of the prerequisite jobs is adjusted in reverse, and the execution sequence numbers are adjusted in reverse.

[0087] Specifically, the jobs are obtained according to the average job time of each job within a preset time period and the job ID order. The smaller the average job time, the earlier it is obtained. If the average job times are the same, the larger the job ID, the earlier it is obtained. Verify whether the execution sequence numbers of all prerequisite jobs of the currently obtained job are less than or equal to the execution sequence number of this job. If not, set the execution sequence number of the prerequisite job to the execution sequence number of this job.

[0088] As an embodiment of the present invention, the execution sequence number adjustment module is further configured to sequentially obtain the jobs in the batch job according to the order of the average job times of the jobs in the batch job from large to small and the order of the job IDs of the jobs from small to large.

[0089] As an embodiment of the present invention, as Figure 6 shown, the execution sequence number adjustment module 30 includes:

[0090] A first adjustment unit 31, configured to compare the preset variable value of the batch job with the initial execution sequence numbers of the jobs to obtain a first comparison result, and perform an execution sequence number adjustment on the obtained jobs according to the first comparison result;

[0091] A second adjustment unit 32, configured to determine the prerequisite jobs corresponding to the obtained jobs according to the preset job dependency relationship, compare the adjusted execution sequence number with the execution sequence number of the prerequisite jobs to obtain a second comparison result, and perform an execution sequence number adjustment on the prerequisite jobs according to the second comparison result.

[0092] Based on the same application concept as the above-mentioned dynamic batch job scheduling method, the present invention also provides the above-mentioned dynamic batch job scheduling device. Since the principle of solving problems by this dynamic batch job scheduling device is similar to that of a dynamic batch job scheduling method, the implementation of this dynamic batch job scheduling device can refer to the implementation of a dynamic batch job scheduling method, and the repeated parts will not be elaborated.

[0093] By adopting a dynamic adjustment method for the job scheduling sequence in the same session, the present invention replaces the previous random sequence execution of jobs in the same session, greatly improving the job execution efficiency, overcoming the shortcoming of low job scheduling efficiency in the existing batch framework, being simple to implement and having a low implementation cost, and achieving the purpose of dynamically multi-task scheduling for effectively improving job scheduling efficiency.

[0094] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the above method is implemented.

[0095] The present invention also provides a computer-readable storage medium storing a computer program for executing the above method.

[0096] As Figure 7 shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power supply 170. It should be noted that the electronic device 600 does not necessarily have to include Figure 7 all the components shown in Figure 7 ; in addition, the electronic device 600 may further include

[0097] components not shown in Figure 7 ; reference may be made to the prior art.

[0098] Among them, the memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. The above information related to failures can be stored, and in addition, programs for executing relevant information can be stored. And the central processing unit 100 can execute the program stored in the memory 140 to implement information storage or processing, etc.

[0099] The input unit 120 provides input to the central processing unit 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to supply power to the electronic device 600. The display 160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0100] The memory 140 may be a solid-state memory, for example, a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that stores information even when power is off, can be selectively erased and has more data stored. An example of this type of memory is sometimes referred to as an EPROM, etc. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142 for storing application programs and function programs or the processes for operating the electronic device 600 by the central processing unit 100.

[0101] The memory 140 may also include a data storage unit 143 for storing data such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers of the electronic device for communication functions and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).

[0102] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.

[0103] Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, etc. The communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby implementing normal telecommunication functions. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is also coupled to the central processing unit 100, so that recording can be performed on the local machine through the microphone 132 and the sound stored on the local machine can be played through the speaker 131.

[0104] Those skilled in the art should understand that the embodiments of the present invention may be provided as a method, a system, or a computer program product. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) that contain computer-usable program code.

[0105] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.

[0106] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.

[0108] Specific embodiments are applied in the present invention to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A dynamic batch job scheduling method, characterized in that, The method includes: Obtaining a batch job table of a batch job and multiple job times of each job within a preset time period; wherein, the batch job table includes the initial execution sequence number and job ID of each job in the batch job; Determining the average job time of each job within the preset time period according to the job times of each job, specifically including: Determining the average job time of each job as the ratio of the total job time of each job within the preset time period to the preset time period; Traversing the batch job table forward, and sequentially obtaining the jobs in the batch job according to the job ID and average job time of each job, and adjusting the execution sequence numbers of the obtained job and its preceding jobs and updating the preset variable value according to the preset variable value, preset job dependency relationship of the batch job and the initial execution sequence number of each job until the forward traversal of the batch job table is completed; The sequentially obtaining the jobs in the batch job according to the job ID and average job time of each job includes: Sequentially obtaining the jobs in the batch job according to the order from large to small of the average job time of each job in the batch job and the order from small to large of the job ID of each job; Adjusting the execution sequence number of the job obtained this time by using the preset variable value and the initial execution sequence number; Adjusting the execution sequence number of the preceding job of the job obtained this time by using the preset variable value and the preset job dependency relationship.

2. The method according to claim 1, characterized in that, The method further includes: After the forward traversal of the batch job table is completed, performing a reverse traversal of the batch job table and reversely adjusting the execution sequence numbers of the jobs in the batch job.

3. The method according to claim 1, characterized in that, The adjusting the execution sequence numbers of the obtained job and its preceding jobs according to the preset variable value, preset job dependency relationship of the batch job and the initial execution sequence number of each job includes: Comparing the preset variable value of the batch job with the initial execution sequence number of each job to obtain a first comparison result, and adjusting the execution sequence number of the obtained job according to the first comparison result; Determining the preceding job corresponding to the obtained job according to the preset job dependency relationship, comparing the adjusted execution sequence number with the execution sequence number of the preceding job to obtain a second comparison result, and adjusting the execution sequence number of the preceding job according to the second comparison result.

4. A dynamic batch job scheduling device, characterized in that, The device includes: A data acquisition module, configured to obtain a batch job table of a batch job and multiple job times of each job within a preset time period; wherein, the batch job table includes the initial execution sequence number and job ID of each job in the batch job; An average job time module, configured to determine the average job time of each job within the preset time period according to the job times of each job; An execution sequence number adjustment module, configured to traverse the batch job table forward, sequentially obtain the jobs in the batch job according to the job ID and average job time of each job, and adjust the execution sequence numbers of the obtained job and its preceding jobs and update the preset variable value according to the preset variable value, preset job dependency relationship of the batch job and the initial execution sequence number of each job until the forward traversal of the batch job table is completed; The average operation time module is specifically configured to determine the average operation time of each operation as the ratio of the total operation time of each operation within a preset time period to the preset time period; The execution sequence adjustment module is further configured to sequentially obtain the operations in the batch operation according to the order of the average operation time of each operation in the batch operation from large to small and the order of the operation IDs of each operation from small to large; use a preset variable value and an initial execution sequence to adjust the execution sequence of the operation obtained this time; use a preset variable value and a preset operation dependency relationship to adjust the execution sequence of the previous operation of the operation obtained this time.

5. The device according to claim 4, characterized in that, The device further includes: A reverse adjustment module, configured to perform a reverse traversal of the batch operation table after the forward traversal of the batch operation table is completed, and perform a reverse adjustment on the execution sequence of the operations in the batch operation.

6. The device according to claim 4, characterized in that, The execution sequence adjustment module includes: A first adjustment unit, configured to compare the preset variable value of the batch operation with the initial execution sequence of each operation to obtain a first comparison result, and adjust the execution sequence of the obtained operation according to the first comparison result; A second adjustment unit, configured to determine the previous operation corresponding to the obtained operation according to a preset operation dependency relationship, compare the adjusted execution sequence with the execution sequence of the previous operation to obtain a second comparison result, and adjust the execution sequence of the previous operation according to the second comparison result.

7. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Scheduling scheme generation method and device

    CN109871270A