CN115756769A - Task execution method and device and electronic equipment - Google Patents

Task execution method and device and electronic equipment Download PDF

Info

Publication number
CN115756769A
CN115756769A CN202211273781.2A CN202211273781A CN115756769A CN 115756769 A CN115756769 A CN 115756769A CN 202211273781 A CN202211273781 A CN 202211273781A CN 115756769 A CN115756769 A CN 115756769A
Authority
CN
China
Prior art keywords
execution
task
subtasks
subtask
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211273781.2A
Other languages
Chinese (zh)
Inventor
陈子昂
贾海闯
张振领
刘尚秋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211273781.2A priority Critical patent/CN115756769A/en
Publication of CN115756769A publication Critical patent/CN115756769A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application provides a task execution method, a task execution device and electronic equipment, wherein the task execution method comprises the following steps: receiving task configuration information configured for a task to be executed, wherein the task to be executed comprises a plurality of subtasks, and the task configuration information comprises dependency relationships among the plurality of subtasks and execution time limits of the subtasks; constructing an execution sequence of a plurality of subtasks according to the dependency relationship and the execution time limit; according to the execution sequence, a plurality of subtasks are executed. The multiple subtasks can be executed according to the execution sequence by configuring the dependency relationship and the execution time limit, so that the multiple subtasks are prevented from being executed out of order, and the execution efficiency of the subtasks is improved. And if the subtask needs to be inserted or deleted, only the task configuration information needs to be modified, and the code of the original subtask does not need to be modified, so that the multiplexing of the subtask can be improved.

Description

Task execution method and device and electronic equipment
Technical Field
The present application relates to the field of testing technologies, and in particular, to a method and an apparatus for task execution and an electronic device.
Background
With the development of big data, in the process of executing the tasks, the tasks have the characteristics of multiple association relations, multiple executed subtasks, complex association relations among the subtasks, variable execution sequences of the subtasks, high coupling, low cohesion and the like, so that the problem of low execution efficiency of the subtasks is also caused.
In view of the above problems, the method used in the related art is to write the execution methods of the subtasks according to specific business logic, where each execution method is a separate execution subtask, and this makes it difficult to reuse the code of the subtask. How to change the above problems in the existing task processing process to improve the task execution efficiency and make the code of the subtask reusable is a major problem in the task execution process at present.
Disclosure of Invention
The embodiment of the application provides a task execution method and device and electronic equipment, and aims to solve the problems that at present, task execution efficiency is low and codes are difficult to reuse.
A first aspect of the present application provides a task execution method, including: receiving task configuration information configured for a task to be executed, wherein the task to be executed comprises a plurality of subtasks, and the task configuration information comprises dependency relationships among the plurality of subtasks and execution time limits of the subtasks; constructing an execution sequence of a plurality of subtasks according to the dependency relationship and the execution time limit; according to the execution sequence, a plurality of subtasks are executed.
In one embodiment of the present application, the executing of the plurality of subtasks is performed in an execution order, which includes: when the execution of the current subtask is abnormal, acquiring the log information for executing the current subtask; if the emergency plan of the current subtask is obtained, updating the current subtask according to the emergency plan; and executing the updated current subtask.
In an embodiment of the present application, the executing the plurality of subtasks according to the execution order further includes: if the emergency plan of the current subtask is not obtained, generating a directed acyclic graph of the current subtask according to the log information and the execution plan; displaying a directed acyclic graph, wherein the directed acyclic graph comprises a plurality of nodes, the nodes represent subtasks, and the directed acyclic graph is used for indicating workers to modify task configuration information; receiving task configuration information modified by a worker; and executing the current subtask and the backup task of the current subtask based on the modified task configuration information.
In one embodiment of the present application, displaying a directed acyclic graph includes: displaying the node of the current subtask as a first color, and displaying an error report log and error report time of the node of the current subtask; and displaying the unexecuted nodes as a second color.
In one embodiment of the present application, displaying the directed acyclic graph further comprises: and if the error reporting time of the current subtask exceeds the execution time limit of the unexecuted node, displaying the unexecuted node as a third color.
In one embodiment of the present application, the task configuration information includes: the execution operation method of the subtask executes a plurality of subtasks, and comprises the following steps: and when the current subtask is executed, executing the current subtask according to the execution operation method of the current subtask.
A second aspect of the present application provides a task execution apparatus, including:
the task configuration information comprises dependency relationships among the multiple subtasks and execution time limits of the subtasks;
the analysis module is used for constructing the execution sequence of the plurality of subtasks according to the dependency relationship and the execution time limit;
and the execution module is used for executing a plurality of subtasks according to the execution sequence.
In an embodiment of the present application, the execution module is specifically configured to, when a current subtask is abnormal in execution, obtain log information for executing the current subtask; if the emergency plan of the current subtask is obtained, updating the current subtask according to the emergency plan; and executing the updated current subtask.
In an embodiment of the application, the execution module is further configured to generate a directed acyclic graph of the current subtask according to the log information and the execution plan if the emergency plan of the current subtask is not obtained; displaying a directed acyclic graph, wherein the directed acyclic graph comprises a plurality of nodes, the nodes represent subtasks, and the directed acyclic graph is used for indicating workers to modify task configuration information; receiving task configuration information modified by a worker; and executing the current subtask and the backup task of the current subtask based on the modified task configuration information.
In an embodiment of the application, when the execution module displays the directed acyclic graph, the execution module is specifically configured to display that a node of a current subtask is in a first color, and display an error log and error reporting time of the node of the current subtask; and displaying the unexecuted nodes as a second color.
In an embodiment of the application, when the execution module displays the directed acyclic graph, if the error reporting time of the current subtask exceeds the execution time limit of the unexecuted node, the execution module is specifically further configured to display that the unexecuted node is a third color.
In one embodiment of the present application, the task configuration information further includes: the data source information executing module is specifically used for acquiring target data according to the data source information; based on the target data, a plurality of subtasks are executed in an execution order.
In one embodiment of the present application, the task configuration information includes: the execution operation method of the subtask and the execution module are specifically used for executing the current subtask according to the execution operation method of the current subtask when the current subtask is executed.
A third aspect of the present application provides an electronic device comprising a memory and a processor; wherein, the first and the second end of the pipe are connected with each other,
the memory is used for storing program codes;
the processor is used for calling the program codes to realize the task execution method of any one of the above items.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes an electronic device to perform any of the task execution methods described above.
A fifth aspect of the application provides a computer program product, the computer program product comprising: a computer program, the computer program being stored in a readable storage medium, from which the computer program can be read by at least one processor of the electronic device, execution of the computer program by the at least one processor causing the electronic device to perform the task performance method of any of the first aspects.
According to the technical scheme, the task configuration information configured for the task to be executed is received, the task to be executed comprises a plurality of subtasks, and the task configuration information comprises dependency relationships among the plurality of subtasks and execution time limits of the subtasks; constructing an execution sequence of a plurality of subtasks according to the dependency relationship and the execution time limit; according to the execution sequence, a plurality of subtasks are executed. The multiple subtasks can be executed according to the execution sequence by configuring the dependency relationship and the execution time limit, so that the multiple subtasks are prevented from being executed out of order, and the execution efficiency of the subtasks is improved. Moreover, if the subtasks need to be inserted or deleted, only the task configuration information needs to be modified, and the codes of the original subtasks do not need to be modified, so that the multiplexing of the subtasks can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a task execution method provided in the present application;
FIG. 2 is a flowchart illustrating steps of a task execution method according to an embodiment of the present application;
FIG. 3 is a diagram illustrating a task execution method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating steps of another task execution method according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating steps of a method for resuming execution of a subtask according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a directed acyclic graph provided in an embodiment of the present application;
fig. 7 is a block diagram of a task execution device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the related art, a task execution method is to write sub-task execution methods according to specific business logic, each execution method is an independent execution sub-task, but this method can implement the business logic of the sub-tasks, but causes independence of the sub-tasks, and when the business logic of the task is complex, and when a processing sequence of the sub-tasks needs to be newly added, deleted or exchanged, the original sub-tasks need to be developed and modified again, which is very easy to generate unnecessary influence on the execution of the sub-tasks. In another task execution mode, when a subtask is abnormally executed, although continuation after breakpoint reset of the subtask can be supported, support is insufficient for special situations that extra operation needs to be temporarily performed or a backup subtask needs to be temporarily modified, generally, association among the subtasks needs to be manually combed under the condition that a task is wrong, and multiple subtasks are manually re-run, so that time for resuming execution of the subtasks is long.
In order to solve the above problems, the task execution method provided by the present application receives task configuration information configured for a task to be executed, where the task to be executed includes a plurality of subtasks, and the task configuration information includes dependency relationships among the plurality of subtasks and execution time limits of the subtasks; constructing an execution sequence of a plurality of subtasks according to the dependency relationship and the execution time limit; and executing a plurality of subtasks according to the execution sequence. The multiple subtasks can be executed according to the execution sequence by configuring the dependency relationship and the execution time limit, so that the multiple subtasks are prevented from being executed out of sequence, and the execution efficiency of the subtasks is improved. And if the subtask needs to be inserted or deleted, only the task configuration information needs to be modified, and the code of the original subtask does not need to be modified, so that the multiplexing of the subtask can be improved.
Fig. 1 is a schematic view of an application scenario of the task execution method provided in the present application. As shown in fig. 1, an application scenario of the present application is report summarization, for example, a data table B1 is obtained in a database A1, a data table B2 is obtained in a database A2, and a data table B3 is obtained in a database A3, and then a task to be processed is executed based on the data table B1, the data table B2, and the data table B3, so as to obtain a summarized table target data table.
Fig. 1 is only an application scenario provided by way of example, and the task execution method provided in the embodiment of the present application may be applied to any scenario in which a task is executed, which is not described in detail herein.
The technical solution of the present application will be described in detail below with reference to specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Referring to fig. 2, a flowchart of steps of a task execution method provided in an embodiment of the present application specifically includes the following steps:
s201, receiving task configuration information for task configuration to be executed.
The task to be executed is a general name of a type of matching program and comprises a plurality of subtasks, and each subtask has the attributes of latest starting execution time, latest ending execution time and the like. There are a preamble relationship and a backup relationship between the subtasks. For example, the sub-task C may execute the sub-task D after the execution is completed, and it may be said that the sub-task C is a preceding sub-task of the sub-task D and the sub-task D is a backup sub-task of the sub-task.
For example, the summary task of the report is a task to be processed.
Further, the task configuration information is configured by the staff, and the task configuration information comprises the dependency relationship among the multiple subtasks and the execution time limit of the subtasks. In addition, the task configuration information further includes: the task to be processed comprises a plurality of subtasks, an execution operation method of each subtask, and data source information.
Illustratively, the pending tasks include subtask E1, subtask E2, subtask E3, subtask E4, and subtask E5. Wherein, the dependency relationship is as follows: executing subtask E2 requires the processing results applied to subtask E1, executing subtask E3 requires the processing results of subtask E1, executing subtask E4 requires the processing results of subtask E2 and subtask E3, and executing subtask E5 requires the processing results of subtask E4. Wherein the execution time limit comprises the latest starting execution time and the latest ending execution time of each subtask. For example, the execution time limit of the subtask E1 includes a latest start execution time of 9, the latest end execution time is 9, the execution time limit of the subtask E2 includes a latest start execution time of 9, the latest end execution time is 9.
In the embodiment of the application, the staff can configure the task configuration information as required, and the task configuration information is used for guiding the execution of the task to be processed.
S202, constructing the execution sequence of the plurality of subtasks according to the dependency relationship and the execution time limit.
Wherein the dependency relationship can indicate the order of execution of the subtasks. The execution time limit can indicate the execution time of the sub-task. Further, the execution order of the plurality of subtasks can be obtained.
In summary, for example, the sub task E1 is executed first, the sub tasks E2 and E3 are executed after the execution of the sub task E1 is completed, the sub task E4 is executed after the execution of the sub task E3 is completed, and the sub task E5 is executed after the execution of the sub task E4 is completed.
Illustratively, referring to fig. 1 and 3, subtask E1 is to extract the name of the customer who transacts the day in the bank from data table B1. The subtask E2 is to extract the historical deposit information corresponding to the name from the data table B2. The subtask E3 is to extract the historical withdrawal information corresponding to the name from the data table B3. The subtask E4 is to analyze the withdrawal information and the deposit information to obtain an analysis result, where the analysis result includes: average monthly withdrawal, peak monthly withdrawal, total withdrawal, etc., average monthly deposit of money, peak monthly deposit of money, total deposit of money, etc. And the subtask E5 integrates the analysis result corresponding to the name, and finally obtains a summary data table.
In the embodiment of the application, the execution sequence can be generated according to the task configuration information, and the execution sequence can indicate that the subtasks are executed according to the sequence, so that the execution error caused by the complex cross execution of the associated subtasks is avoided, and the execution efficiency is reduced.
And S203, executing a plurality of subtasks according to the execution sequence.
Illustratively, the task execution device provided by the embodiment of the present application includes: the device comprises a storage module, an analysis module, an execution module, a monitoring module and a recovery module. The storage module is used for receiving task configuration information configured for the tasks to be executed and then storing the task configuration information in the storage module. The analysis module can generate an execution sequence according to the task configuration information. The execution module is a core module of the task execution device, can generate a task execution route according to the execution sequence, and executes each subtask according to the execution sequence by adopting the execution route. In addition, the execution module may further record an execution log of the subtasks, and push the execution log to the monitoring module, and the monitoring module may generate a list for recording the execution log for each subtask according to the execution log, so as to clearly record an execution state of each subtask, where the execution state includes: not executed, in process of execution or completed. The recovery module can respond to the executed abnormal subtasks according to the emergency plan configured by the staff, or generate a directed acyclic graph of the current subtask according to the execution log and the execution sequence provided by the monitoring module, and display the task configuration information for the staff to modify, so that the current executed abnormal subtask and the subsequent subtasks can be continuously executed in the execution module.
Furthermore, after the execution of each task is completed, the storage resources are cleaned, so that the storage resources are released, and the execution of subsequent tasks is facilitated.
The task configuration information configured for the task to be executed is received, the task to be executed comprises a plurality of subtasks, and the task configuration information comprises dependency relationships among the plurality of subtasks and execution time limits of the subtasks; constructing an execution sequence of a plurality of subtasks according to the dependency relationship and the execution time limit; according to the execution sequence, a plurality of subtasks are executed. The multiple subtasks can be executed according to the execution sequence by configuring the dependency relationship and the execution time limit, so that the multiple subtasks are prevented from being executed out of order, and the execution efficiency of the subtasks is improved. And if the subtask needs to be inserted or deleted, only the task configuration information needs to be modified, and the code of the original subtask does not need to be modified, so that the multiplexing of the subtask can be improved.
On the basis of the foregoing embodiments, an embodiment of the present application provides another task execution method, specifically referring to fig. 4, which specifically includes the following steps:
s401, receiving task configuration information configured for a task to be executed.
The task to be executed comprises a plurality of subtasks, and the task configuration information comprises the dependency relationship among the subtasks and the execution time limit of the subtasks. The task configuration information further includes: and (4) data source information. The task configuration information further includes: and executing operation method of the subtask.
Wherein, the data source information comprises: the data source database, as shown in fig. 1, the data source information is database A1, database A2, and database A3. The execution operation method comprises the following steps: the operation is performed on specific data. For example, the execution operation method of the subtask E1 is to perform an extraction operation on the name in the data table B1. The execution operation method of the subtask E2 is an extraction operation of the deposit information of the data table B2.
S402, constructing the execution sequence of the plurality of subtasks according to the dependency relationship and the execution time limit.
The specific implementation process of this step refers to S202, which is not described herein again.
And S403, acquiring target data according to the data source information.
Specifically, the target data is acquired in the corresponding data source according to the data source information. The target data may be a data table such as data table B1 acquired in database A1, data table B2 acquired in database A2, and data table B3 acquired in database A3 in fig. 1.
In addition, each subtask is stored in a bean object in the execution route, and is executed in order in the pipeline mode. And when the subtask is executed, calling the monitoring module to record the execution log of the subtask. And calling the monitoring module to update the state of the subtask after all bean objects are correctly executed until all subtasks are executed.
And S404, executing a plurality of subtasks according to the execution sequence based on the target data.
Referring to fig. 3, the subtask specifically processes the target data (e.g., data table B1, data table B2, and data table B3) during the execution process.
In an alternative embodiment, the executing of the plurality of subtasks is performed in an execution order, which includes: when the current subtask is abnormal in execution, the recovery process shown in fig. 5 is triggered, specifically, the multiple subtasks are executed according to the following steps:
s501, obtaining the log information of the current subtask.
The sub-task execution exception includes that the sub-task is executed overtime or the sub-task cannot be executed, for example, the sub-task is not executed and completed when the latest execution completion time is exceeded, or the sub-task is not executed after the latest execution start time.
And S502, determining whether an emergency plan for the log information of the current subtask exists.
The emergency plan is configured by the staff in advance, and the emergency plan refers to modification of configuration information corresponding to the subtasks, for example, if the current subtask is recorded in the log information as an overdue unexecuted state, the emergency plan may include a latest execution duration for delaying the subtask.
In the embodiment of the present application, the emergency plan may be set according to actual service requirements, which is not limited herein.
Further, if there is an emergency plan for the log information for the current subtask, S503 is executed. If the current subtask does not have the emergency plan for the log information, S505 is executed.
S503, acquiring the emergency plan of the current subtask, and updating the current subtask according to the emergency plan.
Specifically, the updating of the current subtask specifically is to update configuration information of the current subtask, including an execution time limit, a dependency relationship with other subtasks, an execution operation method, and the like.
And S504, executing the updated current subtask.
Wherein, the updated current subtask can be executed according to the configuration information.
And S505, generating a directed acyclic graph of the current subtask according to the log information and the execution plan.
Referring to FIG. 5, a directed acyclic graph of a current subtask includes the current subtask, a preceding subtask of the current subtask, and a backup subtask.
S506, a directed acyclic graph is displayed.
If the terminal device executes the embodiment of the application, the directed acyclic graph can be displayed on the terminal device, and if the server executes the embodiment of the application, the directed acyclic graph is sent to the terminal device to be displayed.
The directed acyclic graph comprises a plurality of nodes, the nodes represent subtasks, and the directed acyclic graph is used for indicating workers to modify task configuration information.
Further, displaying the directed acyclic graph includes: displaying the node of the current subtask as a first color, and displaying an error report log and error report time of the node of the current subtask; and displaying the unexecuted nodes as a second color.
Optionally, displaying the directed acyclic graph further comprises: and if the error reporting time of the current subtask exceeds the execution time limit of the unexecuted node, displaying the unexecuted node as a third color.
For example, referring to fig. 6, in the generated directed acyclic graph 61, if an exception occurs during execution of the subtask E2, it is determined that the subtask E2 is the current subtask, the node displaying the subtask E2 of the directed acyclic graph 61 is displayed in a first color, such as red, to prompt a worker that the subtask E2 is abnormal during the operation process, and an error report log and an error report time are displayed beside the node, where the error report time refers to a time when the exception occurs, and the error report log includes: the configured latest execution start time and latest execution end time, and the actual execution start time and execution status.
In an alternative embodiment, subtasks E4 and E5 are not executed, and the corresponding node is displayed in a second color, such as gray.
In an alternative embodiment, referring to FIG. 6, if the error time exceeds the execution time limit (latest start time) of the subtask E4, the subtask E4 is displayed in a third color, such as yellow. If the error time does not exceed the execution time limit of the subtask E5, the subtask E5 still displays the second color, which is gray.
After the directed acyclic graph 61 is displayed, the worker can clearly determine the reason why the subtask E2 is abnormal, and if the subtask E2 is an abnormal task, the subtask E4 is also abnormal when time out.
And S507, receiving task configuration information modified by the staff.
The worker can determine the reason of the abnormality according to the directed acyclic graph, and further modify task configuration information of the current subtask and the backup unexecuted subtask, such as modifying dependency relationship, execution time limit or data source information of the current subtask and the backup task.
And S508, executing the current subtask and the backup task of the current subtask based on the modified task configuration information.
In summary, fig. 5 is a recovery process of an abnormal subtask, that is, when the execution of the to-be-processed task is abnormal, the recovery flow is triggered when the execution of the current subtask occurs. After receiving the error reporting information of the current subtask, the execution module records the error reporting information into the monitoring module, and triggers the recovery module to perform recovery operation on the subtask. The recovery module firstly confirms whether the execution abnormity of the current subtask matches with the emergency plan configured by the worker, and if the execution abnormity matches with the emergency plan, the configuration information of the current subtask is changed according to the emergency plan, so that the execution module executes the current subtask again. And if not, acquiring task configuration information from the storage module, acquiring the execution sequence of the subtasks through the analysis module, and sending the execution sequence and the execution log of the current route to a Directed Acyclic Graph (DAG) for generating visualization. Each node in the directed acyclic graph marks the execution entry of the node according to the execution log, and executes the log record and the execution result; the edges of the nodes in the directed acyclic graph may display the latest end time and the actual end time of the configuration of the preamble subtask and the latest start time and the actual start time of the configuration of the backup subtask. In addition, the abnormal node corresponding to the current subtask is marked with red, and an error report log and an error report time are additionally displayed. Nodes which do not execute the subtask are marked with grey bits, and only the task identification of the subtask can be recorded. Nodes whose predecessor tasks of the current subtask are exception tasks will be marked yellow, representing that they will not be executed.
Further, the directed acyclic graph will be provided to the worker as a brief report of the task. When the task brief report is used, the unexecuted subtasks of the task brief report read the execution log in real time according to the task identification. The staff can modify the task configuration information of the execution parameters, the execution sequence, the execution time limit and the like of the current subtask and the unexecuted subtask according to the task brief report, wherein only the task configuration information of the abnormal current subtask and the backup task of the current subtask in the task execution brief report can be modified, and other subtasks can be continuously executed according to the original task configuration information because of not being limited by the subtask.
It can be understood that after the worker submits new task configuration information according to the task execution brief, the execution module continues to execute the current subtask according to the new task configuration information, if the current subtask is abnormal again, the execution log (including abnormal information) continues to be collected and the recovery module re-executes the above operation, and if the new task configuration information enables the current subtask to be normally executed, the monitoring module normally records the execution log and ends the process.
The method and the device realize the execution of the tasks to be processed based on the DAG, realize the low coupling and high cohesion among the subtasks by splitting each subtask of the tasks to be processed, and simultaneously realize the flexible modification of the dependency relationship among the subtasks based on the pipeline mode characteristics, thereby meeting the scheduling execution requirement of complex tasks. In addition, a recovery function of the subtasks is provided, the function of pre-configuring the emergency plan is provided, the basic problem occurring in the execution abnormity of the subtasks can be solved, the abnormity which can be estimated by a manual operation part is avoided, and the supply of the acyclic graph to workers can know the abnormity condition in time and make correct solution treatment in time is provided.
Referring to fig. 7, a schematic diagram of a task performing device 70 according to an embodiment of the present application is provided, where the task performing device 70 includes:
the configuration module 71 is configured to receive task configuration information configured for a task to be executed, where the task to be executed includes a plurality of subtasks, and the task configuration information includes dependency relationships among the plurality of subtasks and execution time limits of the subtasks;
the analysis module 72 is used for constructing the execution sequence of the plurality of subtasks according to the dependency relationship and the execution time limit;
and the execution module 73 is used for executing a plurality of subtasks according to the execution sequence.
In an embodiment of the present application, the executing module 73 is specifically configured to, when a current subtask is abnormal in execution, obtain log information for executing the current subtask; if the emergency plan of the current subtask is obtained, updating the current subtask according to the emergency plan; and executing the updated current subtask.
In an embodiment of the present application, the executing module 73 is further configured to generate a directed acyclic graph of the current subtask according to the log information and the execution plan if the emergency plan of the current subtask is not obtained; displaying a directed acyclic graph, wherein the directed acyclic graph comprises a plurality of nodes, the nodes represent subtasks, and the directed acyclic graph is used for indicating workers to modify task configuration information; receiving task configuration information modified by a worker; and executing the current subtask and the backup task of the current subtask based on the modified task configuration information.
In an embodiment of the present application, when the execution module 73 displays the directed acyclic graph, if the error reporting time of the current subtask exceeds the execution time limit of the unexecuted node, the execution module is specifically further configured to display the unexecuted node as a third color.
In one embodiment of the present application, the task configuration information further includes: a data source information executing module 73, configured to specifically acquire target data according to the data source information; based on the target data, a plurality of subtasks are executed in an execution order.
In one embodiment of the present application, the task configuration information includes: the execution module 73 is specifically configured to execute the current subtask according to the execution operation method of the current subtask when the current subtask is executed.
Specifically, the task execution device receives task configuration information configured for a task to be executed, wherein the task to be executed comprises a plurality of subtasks, and the task configuration information comprises dependency relationships among the plurality of subtasks and execution time limits of the subtasks; constructing an execution sequence of a plurality of subtasks according to the dependency relationship and the execution time limit; according to the execution sequence, a plurality of subtasks are executed. The multiple subtasks can be executed according to the execution sequence by configuring the dependency relationship and the execution time limit, so that the multiple subtasks are prevented from being executed out of order, and the execution efficiency of the subtasks is improved. And if the subtask needs to be inserted or deleted, only the task configuration information needs to be modified, and the code of the original subtask does not need to be modified, so that the multiplexing of the subtask can be improved. In addition, please refer to the content of the embodiment of the task execution method for the specific work content of each module of the task execution device, which is not described herein again.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or can be implemented in the form of hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the processing module may be a processing element that is separately configured, or may be integrated into a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and a processing element of the apparatus calls and executes a function of the processing module. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when some of the above modules are implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. As another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may be embodied as a bank server or a blockchain platform. As shown in fig. 8, the electronic device may include: a processor 81, a memory 82, a communication interface 83, and a system bus 84. Wherein, the memory 82 and the communication interface 83 are connected with the processor 81 through the system bus 84 and complete mutual communication, the memory 82 is used for storing computer execution instructions, the communication interface 83 is used for communicating with other devices, and the processor 81 implements the scheme of the above embodiment when executing the computer execution instructions.
The system bus mentioned in fig. 8 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus. The communication interface is used for realizing communication between the database access device and other equipment (such as a client, a read-write library and a read-only library). The memory may comprise Random Access Memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor may be a general-purpose processor, including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
Optionally, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the electronic device is caused to execute the method according to the embodiment shown above.
Optionally, an embodiment of the present application further provides a computer program product, where the computer program product includes: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the execution of the computer program by the at least one processor causing the electronic device to perform the method of the above-described embodiment.
In the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship; in the formula, the character "/" indicates that the preceding and following related objects are in a relationship of "division". "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
It is to be understood that the various numerical references referred to in the embodiments of the present application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of the present application. In the embodiment of the present application, the sequence numbers of the above-mentioned processes do not mean the sequence of execution, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method of task execution, comprising:
receiving task configuration information configured for a task to be executed, wherein the task to be executed comprises a plurality of subtasks, and the task configuration information comprises dependency relationships among the subtasks and execution time limits of the subtasks;
constructing an execution sequence of the plurality of subtasks according to the dependency relationship and the execution time limit;
and executing the plurality of subtasks according to the execution sequence.
2. The task execution method of claim 1, wherein the executing the plurality of subtasks in the execution order comprises:
when the execution of the current subtask is abnormal, acquiring the log information for executing the current subtask;
if the emergency plan of the current subtask is obtained, updating the current subtask according to the emergency plan;
and executing the updated current subtask.
3. The task execution method of claim 2, wherein the executing the plurality of subtasks in the execution order further comprises:
if the emergency plan of the current subtask is not obtained, generating a directed acyclic graph of the current subtask according to the log information and the execution plan;
displaying the directed acyclic graph, wherein the directed acyclic graph comprises a plurality of nodes, the nodes represent subtasks, and the directed acyclic graph is used for indicating workers to modify the task configuration information;
receiving task configuration information modified by the staff;
and executing the current subtask and the backup task of the current subtask based on the modified task configuration information.
4. The task execution method of claim 3, wherein displaying the directed acyclic graph comprises:
displaying the node of the current subtask as a first color, and displaying an error report log and an error report time of the node of the current subtask;
and displaying the unexecuted nodes as a second color.
5. The task execution method of claim 3, wherein displaying the directed acyclic graph further comprises:
and if the error reporting time of the current subtask exceeds the execution time limit of the unexecuted node, displaying the unexecuted node as a third color.
6. The task execution method according to any one of claims 1 to 5, wherein the task configuration information further includes: data source information, said executing said plurality of subtasks in said execution order comprising:
acquiring target data according to the data source information;
and executing the plurality of subtasks according to the execution sequence based on the target data.
7. The task execution method according to any one of claims 1 to 5, wherein the task configuration information includes: the method for executing the subtasks comprises the following steps:
and when the current subtask is executed, executing the current subtask according to the execution operation method of the current subtask.
8. A task execution apparatus, comprising:
the task configuration information comprises a dependency relationship among the subtasks and the execution time limit of the subtasks;
the analysis module is used for constructing the execution sequence of the plurality of subtasks according to the dependency relationship and the execution time limit;
and the execution module is used for executing the plurality of subtasks according to the execution sequence.
9. An electronic device comprising a memory and a processor; wherein the content of the first and second substances,
the memory is used for storing program codes;
the processor is used for calling the program code to realize the task execution method according to any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, causes an electronic device to execute a task execution method according to any one of claims 1 to 7.
CN202211273781.2A 2022-10-18 2022-10-18 Task execution method and device and electronic equipment Pending CN115756769A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211273781.2A CN115756769A (en) 2022-10-18 2022-10-18 Task execution method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211273781.2A CN115756769A (en) 2022-10-18 2022-10-18 Task execution method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115756769A true CN115756769A (en) 2023-03-07

Family

ID=85352252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211273781.2A Pending CN115756769A (en) 2022-10-18 2022-10-18 Task execution method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115756769A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117151868A (en) * 2023-10-25 2023-12-01 四川智筹科技有限公司 AI-based distributed intelligent division engine implementation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117151868A (en) * 2023-10-25 2023-12-01 四川智筹科技有限公司 AI-based distributed intelligent division engine implementation method
CN117151868B (en) * 2023-10-25 2024-01-26 四川智筹科技有限公司 AI-based distributed intelligent division engine implementation method

Similar Documents

Publication Publication Date Title
CN109634728B (en) Job scheduling method and device, terminal equipment and readable storage medium
CN107784404B (en) Method and device for alarming in service processing process
CN108255620B (en) Service logic processing method, device, service server and system
CN108388507A (en) Batch script testing method and device
CN108491254A (en) A kind of dispatching method and device of data warehouse
CN110633977A (en) Payment exception processing method and device and terminal equipment
CN112905323B (en) Data processing method, device, electronic equipment and storage medium
US20130232192A1 (en) Operations task management system and method
CN115756769A (en) Task execution method and device and electronic equipment
EP3131041A1 (en) Testing of enterprise resource planning systems
CN113297060A (en) Data testing method and device
EP2913757A1 (en) Method, system, and computer software product for test automation
CN112990871A (en) Document processing method and related equipment
CN109885431B (en) Method and apparatus for backing up data
CN107992420B (en) Management method and system for test item
CN107423140B (en) Return code identification method and device
WO2019223171A1 (en) Workflow management method and system, computer device and storage medium
CN115619529A (en) Abnormal asset card processing method and device
CN114238324A (en) Checking method and device for host station, electronic equipment and storage medium
CN109597819B (en) Method and apparatus for updating a database
CN112132544A (en) Inspection method and device of business system
CN112419052A (en) Transaction testing method and device, electronic equipment and readable storage medium
CN112732415B (en) Transaction processing method, device and equipment based on resource exchange proxy system
CN112950138B (en) Collaborative development state management method, device and server
CN109714211B (en) Marketing interface troubleshooting method and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination