Parallel partitioned scheduled task processing method and system
By configuring timing tasks in the parallel partition system and using the locking and grab mechanism to execute timing tasks, the problems of timing tasks configuration complexity and execution exceptions are solved, and efficient and reliable timing task processing is achieved.
Patent Information
- Application Number
- CN202111534899.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the prior art, when timing tasks are shared by the database in parallel partitions, the configuration complexity is high and it is difficult to detect abnormal execution in time, resulting in the timing tasks being unable to continue execution.
By acquiring and analyzing the received timing task data, configuring the timing cycle and timing tasks in the preset database, multiple parallel partitions read the task identifier according to the timing cycle and execute the timing tasks by locking and grabbing, calculate the estimated end time and update the task identifier.
It realizes the unified configuration of multiple parallel partitions to execute timing tasks in parallel, which reduces the configuration complexity. When task execution is abnormal at any time, other partitions can be discovered and taken over in time to avoid failure interruptions.
Smart Images

Figure CN114327871B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a parallel partitioned scheduled task processing method and system. Background Art
[0002] In the prior art, with the advancement of processors, multiple tasks can be processed simultaneously. To improve the processing efficiency, the current technical environment has developed parallel partitioning technology. Processors are assigned to partitions that process parallel jobs. The partitions where parallel jobs are running may depend on the number of processors, applications, and system load. When parallel partitions share a database, since scheduled tasks may not be executed multiple times, scheduled tasks are usually configured on a certain partition. Multiple scheduled tasks may need to be configured separately on multiple partitions, which will also increase the complexity of the configuration. When a scheduled task is executed abnormally, if it cannot be discovered in time, the scheduled task will not be executed later. For this reason, the industry urgently needs an effective scheduled task processing method to solve this problem. Summary of the invention
[0003] The present invention aims to provide a method and system for processing scheduled tasks in parallel partitions, which can reduce the complexity of configuration and prevent the problem that the scheduled tasks cannot be continued due to execution exceptions on the basis of effectively completing the scheduled tasks.
[0004] To achieve the above-mentioned purpose, the present invention provides a method for processing scheduled tasks for parallel partitions, the method comprising: acquiring and parsing received scheduled task data to obtain a timing period and one or more scheduled tasks, and configuring the timing period and the scheduled tasks in a preset database; multiple parallel partitions read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier; the estimated end time of the scheduled task is obtained by calculating the occurrence time of the snatch result, and the task identifier of the corresponding scheduled task is updated by the occurrence time of the snatch result and the estimated end time; the parallel partition in the idle state detects the completion status of the scheduled task through the task identifier of the scheduled task according to the timing period, and performs a new round of locking and snatching according to the completion status or updates the task identifier of the corresponding scheduled task through the actual execution completion time of the scheduled task.
[0005] In the above-mentioned parallel partitioned scheduled task processing method, preferably, the task identifier includes a time registration table, and the time registration table is used to register the task trigger time, execution end time and planned end time of the scheduled task.
[0006] In the above-mentioned parallel partitioned scheduled task processing method, preferably, multiple parallel partitions read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier, including: multiple parallel partitions obtain the scheduled task polling time according to the current time and the timing period, analyze the time registration table according to the scheduled task polling time to obtain the task status of the scheduled task; when the task status is a task to be executed, execute the scheduled task by locking and snatching.
[0007] In the above-mentioned parallel partitioned scheduled task processing method, preferably, the estimated end time of the scheduled task is calculated based on the occurrence time of the snatch result, and the task identifier of the corresponding scheduled task is updated according to the occurrence time of the snatch result and the estimated end time, including: calculating the task execution period according to the task trigger time and the execution end time; calculating the estimated end time according to the occurrence time of the snatch result and the task execution period; replacing the task trigger time and the planned end time in the task identifier of the corresponding scheduled task respectively with the occurrence time of the snatch result and the estimated end time.
[0008] In the above-mentioned parallel partitioned scheduled task processing method, preferably, the task status of the scheduled task is obtained by analyzing the time registration table according to the scheduled task polling time, including: when the task trigger time is empty, the task status of the scheduled task is a task to be executed; when the task trigger time is less than the execution end time, and the execution end time is less than or equal to the planned end time, the task status of the scheduled task is a task to be executed; when the task trigger time is greater than the execution end time, and the planned end time is greater than the current time, the task status of the scheduled task is an executing task; when the task trigger time is greater than the execution end time, and the planned end time is less than the current time, the task status of the scheduled task is a completed task.
[0009] In the above-mentioned parallel partition scheduled task processing method, preferably, a new round of lock snatching is performed according to the completion status or the task identifier of the corresponding scheduled task is updated through the actual execution completion time of the scheduled task, including: when the completion status is execution completion, the planned end time is updated to the actual execution completion time of the scheduled task; when the completion status is not execution completion, the parallel partition in the idle state executes snatching to obtain the corresponding scheduled task by means of lock snatching.
[0010] In the above-mentioned parallel partitioned scheduled task processing method, preferably, the method further comprises: when the scheduled task is not completed after a predetermined number of lock snatches, marking the scheduled task as an invalid task and prompting it to a predetermined area.
[0011] The present invention also provides a parallel partitioned scheduled task processing system, the system includes a configuration module and multiple parallel partitions; the configuration module is used to obtain and parse the received scheduled task data to obtain a timing period and one or more scheduled tasks, and configure the timing period and the scheduled tasks in a preset database; the multiple parallel partitions are used to read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier; the estimated end time of the scheduled task is calculated according to the occurrence time of the snatch result, and the task identifier of the corresponding scheduled task is updated through the occurrence time of the snatch result and the estimated end time; and the parallel partition in the idle state detects the completion status of the scheduled task through the task identifier of the scheduled task according to the timing period, and performs a new round of locking and snatching according to the completion status or updates the task identifier of the corresponding scheduled task through the actual execution completion time of the scheduled task.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0013] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above method.
[0014] The parallel partitioned scheduled task processing method and system provided by the present invention can realize the parallel execution of multiple parallel partitions with only a unified configuration, without the need for separate configuration on multiple partitions, effectively improving work efficiency and reducing configuration complexity; at the same time, when any defined task is executed abnormally, other parallel partitions can be discovered in time and take over the execution, avoiding the occurrence of scheduled task failure interruption. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0016] Figure 1 A flowchart of a method for processing scheduled tasks in parallel partitions provided by an embodiment of the present invention;
[0017] Figure 2 A schematic diagram of a snatching process of a scheduled task provided by an embodiment of the present invention;
[0018] Figure 3 A schematic diagram of updating a task identifier provided by an embodiment of the present invention;
[0019] Figure 4 A schematic diagram of the structure of the scheduled task processing of parallel partitions provided by an embodiment of the present invention;
[0020] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The following will describe the implementation methods of the present invention in detail with reference to the accompanying drawings and embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that as long as there is no conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.
[0022] In addition, the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order different from that shown here.
[0023] Please refer to Figure 1 As shown, the method for processing scheduled tasks in parallel partitions provided by the present invention comprises:
[0024] S101 acquires and parses received scheduled task data to obtain a scheduled period and one or more scheduled tasks, and configures the scheduled period and the scheduled tasks in a preset database;
[0025] S102, the plurality of parallel partitions read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier;
[0026] S103: Calculate the estimated end time of the scheduled task according to the occurrence time of the snatch result, and update the task identifier of the corresponding scheduled task according to the occurrence time of the snatch result and the estimated end time;
[0027] S104 The parallel partition in idle state detects the completion status of the scheduled task through the task identifier of the scheduled task according to the timing period, and performs a new round of lock snatching according to the completion status or updates the task identifier of the corresponding scheduled task through the actual execution completion time of the scheduled task.
[0028] In the above embodiment, the partition attempts to obtain the task to be executed by locking the data. Before unlocking, the locking operations of other partitions will be in a waiting state. After the current partition obtains the task, it updates the start execution time of the task and then unlocks it. At this time, other partitions will know that the task has started to execute and there is no need to repeat the execution. Some partitions will detect the tasks being executed when they have not grabbed the task, have completed the task, or have no tasks to be executed. Therefore, when an abnormal situation occurs, other parallel partitions in idle state complete the reprocessing of the scheduled task. The parallel partition in idle state can be a parallel partition that has not grabbed the scheduled task and has completed the scheduled task, or a parallel partition that does not need to process the currently received scheduled task immediately.
[0029] In one embodiment of the present invention, the task identifier includes a time registration table, and the time registration table is used to register the task trigger time, execution end time and planned end time of the scheduled task. Therefore, each parallel partition can determine the state of the scheduled task according to the time registration table to confirm whether to snatch it; for details, please refer to Figure 2 As shown, the plurality of parallel partitions read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier, including:
[0030] S201, multiple parallel partitions obtain a scheduled task polling time according to the current time and the timing cycle, and analyze the time registration table according to the scheduled task polling time to obtain the task status of the scheduled task;
[0031] S202: When the task status is a task to be executed, the scheduled task is executed by locking and snatching.
[0032] The specific analysis process will be described in detail in the subsequent embodiments, and will not be given examples here.
[0033] Please refer to Figure 3 As shown, in one embodiment of the present invention, the estimated end time of the scheduled task is calculated according to the occurrence time of the snatch result, and the task identifier of the corresponding scheduled task is updated according to the occurrence time of the snatch result and the estimated end time, including:
[0034] S301 calculates the task execution period according to the task trigger time and execution end time;
[0035] S302 calculates the estimated end time according to the occurrence time of the snatch result and the task execution cycle;
[0036] S303 replaces the task triggering time and the planned end time in the task identifier of the corresponding scheduled task respectively by the occurrence time of the snatching result and the expected end time.
[0037] Specifically, in actual work, each parallel partition determines the preset task execution cycle according to the task trigger time and execution end time recorded in the time registration table, and the expected end time can be determined based on the task execution cycle and the current time, that is, the time when the snatch result occurs. Thus, the occurrence time of the snatch result and the expected end time replace the task trigger time and the planned end time in the task identifier, respectively, so as to facilitate the subsequent judgment of the execution status of the scheduled task.
[0038] In one embodiment of the present invention, the task status of the scheduled task is obtained by analyzing the time registration table according to the polling time of the scheduled task, including: when the task trigger time is empty, the task status of the scheduled task is a task to be executed; when the task trigger time is less than the execution end time, and the execution end time is less than or equal to the planned end time, the task status of the scheduled task is a task to be executed; when the task trigger time is greater than the execution end time, and the planned end time is greater than the current time, the task status of the scheduled task is a task being executed; when the task trigger time is greater than the execution end time, and the planned end time is less than the current time, the task status of the scheduled task is a task that has been completed. Of course, in actual work, the task trigger time, execution end time and planned end time in the time registration table can all be controlled, and the calculation of the task execution cycle can be solved by using a pre-made standard execution time. Relevant technicians in this field can choose to set it according to actual needs, and the present invention does not impose any restrictions here.
[0039] In one embodiment of the present invention, a new round of lock snatching is performed according to the completion status or the task identifier of the corresponding scheduled task is updated through the actual execution completion time of the scheduled task, including: when the completion status is execution completion, the planned end time is updated to the actual execution completion time of the scheduled task; when the completion status is not completed, the parallel partition in the idle state performs snatching by lock snatching to obtain the corresponding scheduled task. Further, the method also includes: when the completion status of the scheduled task is not completed after the predetermined number of lock snatching, the scheduled task is marked as an invalid task and prompted to the predetermined area. Specifically, in actual work, the task snatching link gives priority to the tasks that are normally completed, and the tasks that are not correctly executed are carried out after the tasks to be executed are completed. Each scheduled task can also be set with an effective mark and an exception handling number. Only the tasks with the effective mark as valid may be the tasks to be processed; when the exception handling number is detected and tried to be executed again, it will be automatically increased by 1; for tasks that have failed to be executed correctly for many times, when the number of retries reaches the configured threshold, the task will be marked as an invalid task, waiting for the management personnel to check and manually re-validate.
[0040] To facilitate a clearer understanding of the above embodiments provided by the present invention, the above embodiments will be integrated and explained below by taking actual work as an example. Relevant technical personnel in the field should know that this example is only to explain one application method of the present invention and does not impose any limitation on it.
[0041] Scheduled tasks are centrally configured in the database. Each parallel partition reads the configuration of the same scheduled task when it starts. For example, if scheduled tasks TaskA, TaskB, and TaskC need to be executed every five minutes, and the scheduled service is started at 12:01, it can be calculated that the execution time of the next scheduled task should be 12:05.
[0042] At the scheduled time (12:05), each parallel partition grabs the execution right of the scheduled task by locking. Suppose the HostA partition grabs TaskA, the HostB partition grabs TaskB and TaskC, and the HostC partition does not grab any task.
[0043] The recipient executes the task, and the start execution time of TaskA, TaskB and TaskC will be set to 12:05. According to the preset execution time of the task, the planned end time of the task is updated (if the estimated execution time is not configured or the estimated execution time is greater than the time interval, the estimated execution time is considered to be 80%*time interval). Assuming that the estimated execution time of TaskA, TaskB and TaskC is 1 minute, 2 minutes and not set, the estimated end time of the three tasks will be updated to 12:06, 12:07 and 12:09;
[0044] Those who have not obtained the task check the execution status of the previous round of scheduled tasks. Assuming that TaskA and TaskB start subsequent execution at 12:05 and complete, the execution result will be updated to execution success or execution failure, and the end time will be updated to the actual end time. However, TaskC has not been completed. When the timing arrives at 12:10, TaskA and TaskB will continue to be snatched for execution. The partitions that have not snatched the task (possibly HostA, HostB or HostC) will find that TaskC is the task that failed to be executed normally in the previous round (the timing arrives at 12:10, and each partition can find that the planned end time of TASK C is 12:09, which is less than the current 12:10, and it is a scheduled task that failed to be executed correctly. At this time, the scheduled task that failed to be executed correctly should be snatched in the same way as snatching a new task (lock acquisition, then update the status)). These tasks that failed to be executed normally will also be snatched for execution again.
[0045] Please refer to Figure 4As shown, the present invention also provides a parallel partitioned scheduled task processing system, the system includes a configuration module and multiple parallel partitions; the configuration module is used to obtain and parse the received scheduled task data to obtain a timing period and one or more scheduled tasks, and configure the timing period and the scheduled tasks in a preset database; the multiple parallel partitions are used to read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier; the estimated end time of the scheduled task is calculated according to the occurrence time of the snatch result, and the task identifier of the corresponding scheduled task is updated through the occurrence time of the snatch result and the estimated end time; and the parallel partition in the idle state detects the completion status of the scheduled task through the task identifier of the scheduled task according to the timing period, and performs a new round of locking and snatching according to the completion status or updates the task identifier of the corresponding scheduled task through the actual execution completion time of the scheduled task.
[0046] The parallel partitioned scheduled task processing method and system provided by the present invention can realize the parallel execution of multiple parallel partitions with only a unified configuration, without the need for separate configuration on multiple partitions, effectively improving work efficiency and reducing configuration complexity; at the same time, when any defined task is executed abnormally, other parallel partitions can be discovered in time and take over the execution, avoiding the occurrence of scheduled task failure interruption.
[0047] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0048] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above method.
[0049] like Figure 5 As 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 is worth noting that the electronic device 600 does not necessarily have to include Figure 5 In addition, the electronic device 600 may also include Figure 5 For components not shown, reference may be made to the prior art.
[0050] like Figure 5 As shown, the central processor 100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 100 receives inputs and controls the operations of various components of the electronic device 600.
[0051] The memory 140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 100 may execute the program stored in the memory 140 to implement information storage or processing.
[0052] The input unit 120 provides input to the CPU 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0053] The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, 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, which is used to store application programs and function programs or processes for executing the operation of the electronic device 600 through the central processor 100.
[0054] 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 for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0055] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0056] 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 LAN module. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby realizing a common telecommunication function. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 130 is also coupled to the central processor 100, so that the sound can be recorded on the local machine through the microphone 132, and the sound stored on the local machine can be played through the speaker 131.
[0057] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. 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 storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0058] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0059] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0060] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0061] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for processing scheduled tasks in parallel partitions, characterized in that: The method comprises: Acquire and parse the received scheduled task data to obtain a timing cycle and one or more scheduled tasks, and configure the timing cycle and the scheduled tasks in a preset database; The plurality of parallel partitions read the task identifier of the scheduled task according to the timing cycle, and execute the scheduled task by locking and snatching according to the task identifier; The estimated end time of the scheduled task is calculated according to the occurrence time of the snatch result, and the task identifier of the corresponding scheduled task is updated according to the occurrence time of the snatch result and the estimated end time; The parallel partition in the idle state detects the completion status of the scheduled task through the task identifier of the scheduled task according to the timing period, and performs a new round of lock snatching according to the completion status or updates the task identifier of the corresponding scheduled task through the actual execution completion time of the scheduled task.
2. The method for processing scheduled tasks in parallel partitions according to claim 1, characterized in that: The task identifier includes a time registration table, and the time registration table is used to register the task trigger time, execution end time and planned end time of the scheduled task.
3. The method for processing scheduled tasks in parallel partitions according to claim 2, characterized in that: The plurality of parallel partitions read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier, including: The plurality of parallel partitions obtain a scheduled task polling time according to the current time and the timing cycle, and analyze the time registration table according to the scheduled task polling time to obtain a task status of the scheduled task; When the task status is a task to be executed, the scheduled task is executed by locking and snatching.
4. The method for processing scheduled tasks in parallel partitions according to claim 3, characterized in that: Calculating the estimated end time of the scheduled task according to the occurrence time of the snatch result, and updating the task identifier of the corresponding scheduled task according to the occurrence time of the snatch result and the estimated end time includes: The task execution cycle is calculated based on the task trigger time and execution end time; The estimated end time is calculated based on the occurrence time of the snatch result and the task execution cycle; The task trigger time and the planned end time in the task identifier of the corresponding scheduled task are replaced respectively by the occurrence time of the snatch result and the expected end time.
5. The method for processing scheduled tasks in parallel partitions according to claim 3, characterized in that: Analyzing the time registration table according to the scheduled task polling time to obtain the task status of the scheduled task includes: When the task trigger time is empty, the task status of the scheduled task is a task to be executed; When the task trigger time is less than the execution end time, and the execution end time is less than or equal to the planned end time, the task status of the scheduled task is a pending task; When the task trigger time is greater than the execution end time, and the planned end time is greater than the current time, the task status of the scheduled task is executing the task; When the task trigger time is greater than the execution end time, and the planned end time is less than the current time, the task status of the scheduled task is that the execution task has been completed.
6. The method for processing scheduled tasks in parallel partitions according to claim 3, characterized in that: Performing a new round of lock grabbing according to the completion status or updating the task identifier of the corresponding scheduled task through the actual execution completion time of the scheduled task includes: When the completion status is execution completion, the planned end time is updated to the actual execution completion time of the scheduled task; When the completion status is that the execution is not completed, the parallel partition in the idle state executes snatching to obtain the corresponding scheduled task by means of lock snatching.
7. The method for processing scheduled tasks in parallel partitions according to claim 1, characterized in that: The method further comprises: When the scheduled task is not completed after the predetermined number of lock grabs, the scheduled task is marked as an invalid task and prompted to a predetermined area.
8. A parallel partitioned scheduled task processing system, characterized in that: The system includes a configuration module and a plurality of parallel partitions; The configuration module is used to obtain and parse the received scheduled task data to obtain a timing cycle and one or more scheduled tasks, and configure the timing cycle and the scheduled tasks in a preset database; The plurality of parallel partitions are used to read the task identifier of the scheduled task according to the timing period, and execute the scheduled task by locking and snatching according to the task identifier; The estimated end time of the scheduled task is calculated based on the time when the snatch result occurs, and the task identifier of the corresponding scheduled task is updated through the time when the snatch result occurs and the estimated end time; and the parallel partition in the idle state detects the completion status of the scheduled task through the task identifier of the scheduled task according to the timing period, and performs a new round of lock snatching based on the completion status or updates the task identifier of the corresponding scheduled task through the actual execution completion time of the scheduled task.
9. An electronic device comprising a memory, a processor, and a computer program stored in 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 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for causing a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Task scheduling method and device
CN108563502A
Task scheduling method and system, scheduling center server and storage medium
CN110046039A