Task execution method, apparatus, device, medium, and product

By automatically executing unexecuted and failed tasks using pre-stored task parameters when task scheduling returns to normal, the problem of manual task operation caused by task scheduling anomalies is solved, achieving automated and efficient task recovery.

CN115879713BActive Publication Date: 2026-03-17CHINA CONSTRUCTION BANK +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

When the task scheduling service malfunctions, important tasks cannot be executed automatically, requiring a large amount of manual operation, which is prone to errors.

Method used

A task execution method and apparatus are provided. By pre-storing a target task table with task parameters, after task scheduling returns to normal, the method automatically detects unexecuted and failed tasks and executes them according to the stored parameters, thus avoiding manual operation.

Benefits of technology

It reduces labor costs and the probability of errors, and enables automated task recovery and execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115879713B_ABST
    Figure CN115879713B_ABST
Patent Text Reader

Abstract

The application discloses a task execution method, device, equipment, medium and product. The method comprises the following steps: in the case that the task scheduling is recovered from an abnormal state to a normal state, a target task table is acquired; in the case that the target task state is an unexecuted state, a target task is executed according to a target task parameter; in the case that the target state is an execution failure state, it is determined whether the target execution times are less than the target maximum execution times; in the case that the target execution times are less than the target maximum execution times, the target task is executed according to the target task parameter. In this way, after the task scheduling is recovered from the abnormal state to the normal state, the unexecuted and execution failure tasks can be automatically found, and the tasks are executed based on the pre-stored task parameters, so that manual operation is not needed, the labor cost is reduced, and the error probability is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of task processing, and particularly relates to a task execution method, device, equipment, medium and product. BACKGROUND

[0002] Generally, the execution of a certain task needs to rely on a specific task scheduling service. Once the task scheduling service is abnormal, the tasks that should be executed cannot be executed within the time of processing the exception. When the task scheduling service recovers to normal, these tasks have already been missed and cannot be automatically executed again. However, the execution of some important tasks is indispensable.

[0003] In the related art, an operation and maintenance personnel usually needs to manually execute a specified task, and even a developer needs to reconfigure task parameters to execute the missed task. However, the number of tasks is usually huge, and therefore a large amount of manpower is needed for manual operation, which not only has high labor cost but also is prone to human errors. SUMMARY

[0004] The embodiments of the present application provide a task execution method, device, equipment, medium and product, which can automatically discover unexecuted and failed tasks after the task scheduling recovers from an abnormal state to a normal state, and execute the tasks based on pre-stored task parameters, without manual operation, thereby reducing labor cost and error probability.

[0005] In a first aspect, the embodiments of the present application provide a task execution method, which comprises:

[0006] In the case that the task scheduling recovers from an abnormal state to a normal state, a target task table is acquired, the target task table comprising target task parameters, a target task state, a target executed number and a target maximum execution number corresponding to a target task;

[0007] In the case that the target task state is an unexecuted state, the target task is executed according to the target task parameters;

[0008] In the case that the target state is a failed execution state, it is determined whether the target executed number is less than the target maximum execution number;

[0009] In the case that the target executed number is less than the target maximum execution number, the target task is executed according to the target task parameters.

[0010] In a second aspect, the embodiments of the present application provide a task execution device, which comprises:

[0011] The acquisition module is configured to acquire a target task table in a case where the task scheduling is recovered from the abnormal state to the normal state, the target task table including target task parameters corresponding to a target task, a target task state, a target executed number of times, and a target maximum number of times of execution.

[0012] The first execution module is configured to execute the target task according to the target task parameters in a case where the target task state is an unexecuted state.

[0013] The determination module is configured to determine whether the target executed number of times is less than the target maximum number of times of execution in a case where the target state is an execution failure state.

[0014] The second execution module is configured to execute the target task according to the target task parameters in a case where the target executed number of times is less than the target maximum number of times of execution.

[0015] In a third aspect, an electronic device is provided, the device including a processor and a memory storing computer program instructions.

[0016] The processor, when executing the computer program instructions, implements the task execution method shown in any one of the embodiments of the first aspect.

[0017] In a fourth aspect, a computer storage medium is provided, the computer storage medium storing computer program instructions, the computer program instructions, when executed by a processor, implementing the task execution method shown in any one of the embodiments of the first aspect.

[0018] In a fifth aspect, a computer program product is provided, the instructions in the computer program product being executed by a processor of an electronic device, so that the electronic device executes the task execution method shown in any one of the embodiments of the first aspect.

[0019] The task execution method, device, equipment, medium, and product provided in the embodiments of the present application can acquire a target task table in a case where the task scheduling is recovered from an abnormal state to a normal state, the target task table including target task parameters corresponding to a target task and a target task state, then can execute the target task according to the target task parameters in a case where the target task state is an unexecuted state, and can execute the target task according to the target task parameters in a case where the target state is an execution failure state and the target executed number of times is less than the target maximum number of times of execution. That is, the task execution method, device, equipment, medium, and product provided in the embodiments of the present application pre-store task parameters in a target task table, can automatically find unexecuted and execution failure tasks after the task scheduling is recovered from an abnormal state to a normal state, and execute the task based on the pre-stored task parameters, without manual operation, thereby reducing the labor cost and the probability of errors. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced as follows, and other drawings can be obtained by those of ordinary skill in the art without any creative effort on the premise that they do not pay any creative effort.

[0021] Figure 1 is a flowchart of a task execution method provided by one embodiment of the present application;

[0022] Figure 2 is a flowchart of another task execution method provided by one embodiment of the present application;

[0023] Figure 3 is a structural schematic diagram of a task execution device provided by one embodiment of the present application;

[0024] Figure 4 is a structural schematic diagram of an electronic device provided by one embodiment of the present application. DETAILED DESCRIPTION

[0025] The features and exemplary embodiments of various aspects of the present application will be described in detail below, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of these specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.

[0026] It should be noted that, in this paper, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the elements defined by the statement "include" do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0027] In addition, it should be noted that the acquisition, storage, use, processing and other data in the technical solutions of the present application all comply with the relevant provisions of national laws and regulations.

[0028] As the background, in the daily business scenario, to run a batch task, it needs to rely on a specific scheduling service. Once the scheduling service hangs up, there are specified tasks that need to be executed but are not executed within the fault handling time. After the scheduling service recovers, the task has been flipped and cannot automatically run the batch flipped task again. For indispensable tasks, the operation and maintenance personnel usually need to manually execute the specified task, and even the developer needs to reconfigure the task parameters. The operation and maintenance personnel need to handle the emergency at night, which is very inconvenient for operation and maintenance.

[0029] In the related art, the configuration file is generally modified by the scheduling center, compiled and packaged, and the executor is integrated and deployed into the existing business project. The project configuration file configures the address of the scheduling center management platform. The scheduling service writes the task to be executed, calls the task interface, and sets the retry number on the management platform interface to create a batch running task.

[0030] However, the retry mechanism in the related art only re-runs the failed batch task, but cannot automatically retry the task that has been flipped. When manually retrying, the accurate batch running parameters of the task need to be input, for example, the batch running task should be run at 1:00 on January 2 to count the daily active user number of January 1. However, due to the server downtime on January 2, it is not restored until January 3. At this time, the operation and maintenance personnel need to manually fill in January 1 as the task parameter to execute the daily active user number of January 1. If there are thousands of tasks, a large amount of manpower needs to be invested, and the process is prone to errors.

[0031] The task execution method provided by the embodiments of the present application can obtain a target task table in the case that the task scheduling is restored from an abnormal state to a normal state. The target task table includes target task parameters corresponding to a target task and a target task state. Then, in the case that the target task state is an unexecuted state, the target task can be executed according to the target task parameters. In the case that the target state is an execution failure state and the target execution number is less than the target maximum execution number, the target task can be executed according to the target task parameters. That is, the task execution method, device, equipment, medium and product provided by the embodiments of the present application pre-store the task parameters in the target task table. When the task scheduling is restored from an abnormal state to a normal state, the unexecuted and execution failure tasks can be automatically discovered and executed based on the pre-stored task parameters, without manual operation. Not only the labor cost is reduced, but also the error probability is reduced.

[0032] Figure 1 A flowchart of a task execution method provided by an embodiment of the present application is shown. It should be noted that the task execution method can be applied to a task execution device, such as Figure 1 The task execution method can include the following steps:

[0033] S110, in a case where the task scheduling is recovered from the abnormal state to the normal state, obtaining a target task table;

[0034] S120, in a case where the target task state is the unexecuted state, executing the target task according to the target task parameter;

[0035] S130, in a case where the target state is the execution failure state, determining whether the target executed times is less than the target maximum execution times;

[0036] S140, in a case where the target executed times is less than the target maximum execution times, executing the target task according to the target task parameter.

[0037] Therefore, in a case where the task scheduling is recovered from the abnormal state to the normal state, the target task table including the target task parameter and the target task state corresponding to the target task can be obtained, and then in a case where the target task state is the unexecuted state, the target task can be executed according to the target task parameter, and in a case where the target state is the execution failure state and the target executed times is less than the target maximum execution times, the target task can be executed according to the target task parameter. That is, the task execution method, device, equipment, medium and product provided by the embodiments of the present application prestore the task parameters in the target task table, when the task scheduling is recovered from the abnormal state to the normal state, the unexecuted and execution failure tasks can be automatically found and executed based on the prestored task parameters, without manual operation, which not only reduces the labor cost, but also reduces the error probability.

[0038] S110 is related to, the task scheduling is recovered from the abnormal state to the normal state, which can mean that the module responsible for the task scheduling service fails and is then repaired. The target task table can be a database table. The target task table can include the target task parameter, the target task state, the target executed times and the target maximum execution times corresponding to the target task.

[0039] The target task parameter can be a parameter required for executing the target task. The target task state can be an unexecuted state, an execution failure state or an execution success state. The target executed times can be the number of times the target task has been executed. The target maximum execution times can be the maximum number of times the target task can be executed.

[0040] In some embodiments, as shown in Figure 2 In order to automatically execute the missed tasks after the task scheduling is recovered from the abnormal state to the normal state, before S110, the method can further include the following steps:

[0041] S150, receiving a first input of a user to a preset task table;

[0042] S160, in response to the first input, configuring task data corresponding to the plurality of tasks in the preset task table respectively to obtain a target task table.

[0043] Here, the preset task table can include task name, task type, task parameter, task state, executed number of times, maximum number of execution times, planned start time, priority, actual execution start time, actual execution end time, and failure reason, etc.

[0044] The first input can be an input of entering task data under a plurality of fields in the preset task table.

[0045] The target task table can include task data corresponding to a plurality of tasks, and the task data can include task parameter, task state, executed number of times, maximum number of execution times, planned start time, and priority, and can also include task name, task type, actual execution start time, actual execution end time, and failure reason, etc.

[0046] Among them, the actual execution start time, the actual execution end time, and the failure reason, etc. can be generated according to the actual execution of the task.

[0047] The initial value of the task state can be an unexecuted state, which can be updated according to the actual execution of the task thereafter.

[0048] The initial value of the executed number of times can be 0, which can be updated according to the actual execution of the task thereafter.

[0049] The task name of different tasks can be different. The task type can facilitate viewing and statistical management.

[0050] The planned start time can be a pre-set time to start executing the task.

[0051] The task state can be an unexecuted state, an execution success state, or an execution failure state. Exemplarily, 0 can represent the unexecuted state, 1 can represent the execution success state, and 2 can represent the execution failure state.

[0052] The task parameter can be a parameter required for executing the task. When the number of task parameters is multiple, the multiple task parameters can be separated by commas. Exemplarily, a certain task is to count the number of daily active users of the previous day at 01:00 every day, and the date of the previous day can be the task parameter corresponding to the task.

[0053] Some tasks can be long-term execution failures due to special reasons. In order to avoid wasting resources by repeatedly executing the task, the maximum number of execution times can be set, and when the number of task execution times reaches the maximum number of execution times, the task can no longer be executed, thereby avoiding wasting resources.

[0054] In this way, by configuring the target task table, the task data corresponding to multiple tasks can be stored in the target task table in advance, so that the missed tasks can be executed automatically after the task scheduling returns to normal from an abnormal state, without having to wait for the task scheduling to become abnormal and return to normal before manually entering the data.

[0055] Regarding S120, task orchestration (Spring Task: Scheduler) technology can be used to execute tasks. If the target task is in an inactive state, it indicates that the target task was missed due to a task scheduling exception, and therefore the target task can be executed according to its parameters.

[0056] Regarding S130, task orchestration (Spring Task: Scheduler) technology can be used to execute tasks. If the target task status is "failed," it indicates that the target task failed to execute due to a task scheduling exception or was unable to be re-executed due to a task scheduling exception. However, to avoid wasting resources by continuously re-executing the task, it is necessary to first determine whether the number of times the target task has been executed is less than the target maximum number of executions.

[0057] Regarding S140, if the number of times the target has been executed is less than the maximum number of times the target can be executed, the target task can be executed according to the target task parameters; if the number of times the target has been executed is not less than the maximum number of times the target can be executed, the target task will not be executed.

[0058] Furthermore, if the target task status is "execution successful", it indicates that the target task has already been executed successfully before the task scheduling exception occurred, so there is no need to execute it again.

[0059] In some implementations, to ensure smoother task execution, the above-mentioned execution of the target task based on the target task parameters may include:

[0060] If the target task table includes at least one first task, execute at least one first task and the target task in descending order of priority.

[0061] The first task can be a task that meets preset conditions.

[0062] The preset conditions can be:

[0063] The first task and the target task have the same planned start time, and the task status corresponding to the first task is in an inactive state.

[0064] Alternatively, the first task and the target task have the same planned start time, the first task is in a failed execution state, and the first task has been executed less than the maximum number of times.

[0065] Here, if there are at least one other task that needs to be executed after the task scheduling returns to normal from an abnormal state, they can be executed in the order of their planned start times, corresponding to the at least one task and the target task, respectively. However, if there is a first task with the same planned start time as the target task, they need to be executed in descending order of priority, corresponding to the first task and the target task, respectively.

[0066] The first task can be a task that needs to be executed when the task scheduling returns to normal from an abnormal state, and it is the same task whose scheduled start time is the same as that of the target task.

[0067] For example, when task scheduling recovers from an abnormal state to a normal state, there are three tasks that need to be executed: A, B, and C. Task A has a planned start time of 01:00 and a priority of 1; Task B has a planned start time of 01:01 and a priority of 1; and Task C has a planned start time of 01:00 and a priority of 2. The execution order could then be: Task C, Task A, Task B.

[0068] In this way, tasks that originally needed to be executed at the same time can be executed in order of priority, thus making the execution of tasks smoother.

[0069] In some implementations, to facilitate determining the number of times the task has been executed, after executing the target task according to the target task parameters as described above, the method may further include:

[0070] Increment the number of times the target task has been executed by 1.

[0071] Here, if the target task status is not executed, the number of times the target task has been executed is 0 before the target task is executed according to the target task parameters, and the number of times the target task has been executed is updated to 1 after the target task is executed according to the target task parameters.

[0072] If the target task status is in the execution failure state, then before executing the target task according to the target task parameters, the number of times the target task has been executed is n (n is a positive integer). After executing the target task according to the target task parameters, the number of times the target task has been executed is updated to n+1.

[0073] In this way, the number of times a task has been executed can be automatically updated based on the task's execution status, so as to determine whether the task has exceeded the maximum number of executions. If the number of times a task has been executed exceeds the maximum number of executions, the task can be stopped to avoid wasting resources.

[0074] In some implementations, to perform the task more accurately, after executing the target task according to the target task parameters as described above, the method may further include:

[0075] If the target task is executed successfully, update the target task status to "execution successful".

[0076] If the target task fails to execute, update the target task status to "execution failed".

[0077] Here, whether after S120 or S140, if the target task is executed successfully, the target task status corresponding to that target task can be updated to the execution successful status; if the target task fails to execute, the target task status corresponding to that target task can be updated to the execution failed status.

[0078] In this way, the task status can be automatically updated based on the task's execution status, so as to determine whether the task needs to be re-executed later.

[0079] In some implementations, to facilitate determining the cause of task failure, the method may further include:

[0080] If the target task fails to execute, the reason for the failure is saved in the target task table.

[0081] Here, if the target task fails to execute, the reason for the failure can be saved in the failure reason field of the target task table so as to prompt the user for the reason why the target task failed to execute.

[0082] In this way, by automatically saving the reasons for the failure of the target task, it is easy to determine the reasons for the task execution failure, so that users can take corresponding measures.

[0083] Based on the same inventive concept, embodiments of this application also provide a task execution device. The following, in conjunction with... Figure 3 The task execution device provided in the embodiments of this application will be described in detail.

[0084] Figure 3 A schematic diagram of the structure of a task execution device provided in one embodiment of this application is shown.

[0085] like Figure 3 As shown, the task execution device may include:

[0086] The acquisition module 301 is used to acquire the target task table when the task scheduling returns to normal from an abnormal state. The target task table includes the target task parameters, target task status, number of times the target has been executed, and maximum number of times the target has been executed.

[0087] The first execution module 302 is used to execute the target task according to the target task parameters when the target task status is not executed.

[0088] The determination module 303 is used to determine whether the number of times the target has been executed is less than the maximum number of times the target can be executed when the target status is an execution failure status;

[0089] The second execution module 304 is used to execute the target task according to the target task parameters when the number of times the target has been executed is less than the maximum number of times the target can be executed.

[0090] Therefore, when task scheduling returns to normal from an abnormal state, a target task table can be obtained. This table includes target task parameters and target task status. Then, if the target task status is "not executed," the target task can be executed according to the target task parameters. If the target task status is "executed but failed" and the number of times it has been executed is less than the maximum number of times it can be executed, the target task can still be executed according to the target task parameters. In other words, the task execution method, apparatus, device, medium, and product provided in this application pre-store task parameters in the target task table. When task scheduling returns to normal from an abnormal state, it can automatically detect unexecuted and failed tasks and execute them based on the pre-stored task parameters, eliminating the need for manual operation. This not only reduces labor costs but also lowers the probability of errors.

[0091] In some embodiments, to facilitate the automatic execution of missed tasks after task scheduling returns to normal from an abnormal state, the task execution device may further include:

[0092] The receiving module is used to receive the user's first input on the preset task table before obtaining the target task table when the task scheduling returns to normal from an abnormal state.

[0093] The configuration module is used to respond to the first input and configure the task data corresponding to multiple tasks in the preset task table to obtain the target task table. The task data includes task parameters, task status, number of executions, maximum number of executions, planned start time and priority.

[0094] In some implementations, to facilitate smoother task execution, both the first execution module 302 and the second execution module 304 may include:

[0095] The execution submodule is used to execute at least one first task and the target task in descending order of priority, provided that the target task table includes at least one first task. The first task is a task that meets preset conditions.

[0096] The preset conditions are:

[0097] The first task and the target task have the same planned start time, and the task status corresponding to the first task is in an inactive state.

[0098] Alternatively, the first task and the target task have the same planned start time, the first task is in a failed execution state, and the first task has been executed less than the maximum number of times.

[0099] In some embodiments, to facilitate determining the number of times the task has been executed, the task execution device may further include:

[0100] The counting module is used to increment the number of times the target task has been executed by 1 after the target task is executed according to the target task parameters.

[0101] In some embodiments, to perform the task more accurately, the task execution device may further include:

[0102] The first update module is used to update the target task status to the execution success status after the target task is executed according to the target task parameters, if the target task is executed successfully.

[0103] The second update module is used to update the target task status to an execution failure status if the target task fails to execute.

[0104] In some embodiments, to facilitate determining the cause of task execution failure, the task execution device may further include:

[0105] The save module is used to save the reason for the failure of the target task to the target task table if the target task fails to execute.

[0106] Figure 4 A schematic diagram of the structure of an electronic device provided in one embodiment of this application is shown.

[0107] like Figure 4 As shown, the electronic device 4 is a structural diagram of an exemplary hardware architecture of an electronic device capable of implementing the task execution method and task execution apparatus according to the embodiments of this application. This electronic device may refer to the electronic device in the embodiments of this application.

[0108] The electronic device 4 may include a processor 401 and a memory 402 storing computer program instructions.

[0109] Specifically, the processor 401 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0110] Memory 402 may include a large-capacity memory for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), a floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to an integrated gateway disaster recovery device. In a particular embodiment, memory 402 is non-volatile solid-state memory. In a particular embodiment, memory 402 may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, generally, memory 402 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.

[0111] The processor 401 implements any of the task execution methods described in the above embodiments by reading and executing computer program instructions stored in the memory 402.

[0112] In one example, the electronic device may also include a communication interface 403 and a bus 404. Wherein, as... Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 404 and complete communication with each other.

[0113] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0114] Bus 404 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 404 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0115] The electronic device can execute the task execution method in the embodiments of this application, thereby achieving the combination Figures 1 to 3 The described task execution method and apparatus.

[0116] Furthermore, in conjunction with the task execution methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the task execution methods in the above embodiments.

[0117] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0118] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0119] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0120] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, 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, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0121] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A task execution method characterized by, The method comprises the following steps: In the case that the task scheduling is recovered from an abnormal state to a normal state, a target task table is obtained, wherein the target task table comprises target task parameters, a target task state, a target executed number of times, and a target maximum number of times of execution corresponding to a target task; In the case that the target task state is an unexecuted state, the target task is executed according to the target task parameters; In the case that the target state is an execution failure state, it is determined whether the target executed number of times is less than the target maximum number of times of execution; In the case that the target executed number of times is less than the target maximum number of times of execution, the target task is executed according to the target task parameters; The execution of the target task according to the target task parameters comprises the following steps: If there is at least one first task that needs to be executed in the case that the task scheduling is recovered from an abnormal state to a normal state, the at least one first task and the target task are executed in the order of the planned start time corresponding to the at least one first task and the target task, respectively; If there is a first task with the same planned start time as the target task, the first task and the target task are executed in the order of the priority corresponding to the first task and the target task, respectively.

2. The method of claim 1, wherein, Before the target task table is obtained in the case that the task scheduling is recovered from an abnormal state to a normal state, the method further comprises the following steps: Receiving a first input of a user on a preset task table; In response to the first input, configuring task data corresponding to a plurality of tasks in the preset task table to obtain the target task table, wherein the task data comprises task parameters, a task state, an executed number of times, a maximum number of times of execution, a planned start time, and a priority.

3. The method of claim 1, wherein, The execution of the target task according to the target task parameters comprises the following steps: In the case that the target task table comprises at least one first task, the at least one first task and the target task are executed in the order of the priority corresponding to the at least one first task and the target task from high to low, wherein the first task is a task that meets a preset condition, The preset condition is that: The planned start time corresponding to the first task and the target task is the same, and the task state corresponding to the first task is an unexecuted state, Or, the planned start time corresponding to the first task and the target task is the same, the task state corresponding to the first task is an execution failure state, and the executed number of times corresponding to the first task is less than the maximum number of times of execution.

4. The method of claim 1, wherein, After the execution of the target task according to the target task parameters, the method further comprises the following steps: The target executed number of times corresponding to the target task is increased by 1.

5. The method of claim 1, wherein, After the execution of the target task according to the target task parameters, the method further comprises the following steps: In the case that the target task is executed successfully, the target task state is updated to an execution success state; In the case that the target task is executed unsuccessfully, the target task state is updated to an execution failure state.

6. The method of claim 5, wherein, The method further comprises the following steps: In the case that the target task is executed unsuccessfully, the failure reason of the target task is saved to the target task table.

7. A task execution apparatus characterized by comprising: The device comprises: The acquisition module is configured to acquire a target task table including target task parameters, a target task state, a target executed number of times, and a target maximum number of times of execution of a target task in a case where task scheduling is recovered from an abnormal state to a normal state. The first execution module is configured to execute the target task according to the target task parameters in a case where the target task state is an unexecuted state. The determination module is configured to determine whether the target executed number of times is less than the target maximum number of times of execution in a case where the target state is an execution failure state. The second execution module is configured to execute the target task according to the target task parameters in a case where the target executed number of times is less than the target maximum number of times of execution, and is further configured to execute at least one first task and the target task according to a priority order corresponding to the at least one first task and the target task, respectively, in a case where there is at least one first task that needs to be executed in a case where task scheduling is recovered from an abnormal state to a normal state, and is further configured to execute a first task and the target task according to a priority order corresponding to the first task and the target task, respectively, in a case where there is a first task having a same planned start time as the target task.

8. An electronic device, comprising: The device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the task execution method according to any one of claims 1-6.

9. A computer storage medium, characterized in that The computer storage medium stores computer program instructions, and the computer program instructions are executed by a processor to implement the task execution method according to any one of claims 1-6.

10. A computer program product, characterised in that, The instructions in the computer program product are executed by a processor of an electronic device to enable the electronic device to perform the task execution method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Abnormal task retrying method and device

    CN107967189A

  • Work task compensation processing method and device, computer device and storage medium

    CN109542591A

  • Abnormality processing method and device and electronic equipment

    CN115113939A