Task process arrangement method and device, and electronic equipment
By using a visual graphical interface to draw task execution flow charts and configure task execution plans in task scheduling, the problem of unclear task execution cycles is solved, visual arrangement and scheduling of tasks is realized, and the efficiency and flexibility of task scheduling are improved.
Patent Information
- Application Number
- CN202010729398.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-07-27
AI Technical Summary
Existing technology cannot realize visual arrangement of tasks in task scheduling, resulting in unclear task execution cycles and the need for repeated adjustments, making it impossible to provide continuous services.
Draw a task execution flow chart according to the logical sequence of the target task through a visual graphical interface, determine and configure the task execution plan, allow task nodes to be shardable types for parallel execution, and monitor task status in real time.
It realizes the visual arrangement and scheduling of tasks, simplifies operations, improves the efficiency and flexibility of task scheduling, can adjust task processes according to actual needs, and supports the execution of complex tasks and multi-process collaboration.
Smart Images

Figure CN111861235B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task flow scheduling method and device, and electronic equipment. Background Art
[0002] With the development of society and the advancement of technology, people have more and more demands for task scheduling and execution. By setting scheduled tasks, related tasks can be automatically executed or users can be automatically reminded, thereby reducing users' tedious work and facilitating their work.
[0003] When performing task scheduling, the prior art generally requires developers to arrange task scripts through coding and implement task scheduling management by running task scripts. However, the above-mentioned task process arrangement method requires developers to encode task scripts and cannot achieve visual arrangement of tasks. Summary of the invention
[0004] The embodiments of the present invention provide a task flow arrangement method and device, which can realize visual arrangement of tasks.
[0005] In a first aspect, an embodiment of the present invention provides a task flow scheduling method, including:
[0006] Determining at least one configuration parameter in the task execution schedule;
[0007] Configuring the at least one configuration parameter in the task execution plan table to generate a target task execution plan table, wherein the target task execution plan table includes at least one target task;
[0008] According to the target task execution schedule, at least one target task in the target task schedule is executed in a logical order, and a task execution flow chart is drawn through a visual graphic interface;
[0009] When at least two target tasks are executed in parallel, the task node is written as a shardable task so that the executor can execute the task in parallel after identification;
[0010] Execute the task execution process corresponding to the task execution flow chart.
[0011] Preferably,
[0012] Further including:
[0013] Receiving an execution result of the task execution process;
[0014] According to the received execution result, at least one identification information is set for the at least one target task to visualize the execution result, wherein the identification information is used to represent feedback information on the execution result of the at least one target task, and the feedback information includes: a completion status of the at least one target task and an abnormal status of the at least one target task;
[0015] According to the at least one identification information, performing exception handling on the target task execution process corresponding to the abnormal state;
[0016] Preferably,
[0017] Further including:
[0018] When a new task execution process is needed, determining at least one new task execution process, wherein the at least one new task execution process includes at least one new task, and the at least one new task is not included in the task execution flow chart;
[0019] Determine at least one new configuration parameter corresponding to the at least one new task execution process;
[0020] Performing parameter configuration on the at least one newly added configuration parameter;
[0021] Determining a logical relationship between the at least one newly added task included in the at least one newly added task execution process and the at least one target task;
[0022] According to the task execution flowchart and the logical relationship between the at least one newly added task and the at least one target task, a newly added task execution flowchart is drawn through the visual graphic interface.
[0023] Preferably,
[0024] Further including:
[0025] When there are at least two task execution flowcharts, determining whether there is an association relationship between a first task execution flowchart and a second task execution flowchart among the at least two task execution flowcharts;
[0026] If it is determined that the first task execution flowchart and the second task execution flowchart are associated with each other, executing:
[0027] S1: Determine a first target task and a second target task that are associated with each other, wherein the first target task is included in the first task execution flowchart, and the second target task is included in the second task execution flowchart;
[0028] S2: Determine whether the target first task needs to be executed first and the target second task needs to be executed after the target first task is completed. If so, execute step S3; otherwise, execute step S5;
[0029] S3: marking the current execution state of the target second task by a pause mark;
[0030] S4: when the execution of the target first task is completed, cancel the pause mark of the target second task, and trigger the target second task to start execution;
[0031] S5: Determine whether the target second task needs to be executed first and the target first task needs to be executed after the target second task is executed. If so, execute step S6;
[0032] S6: marking the current execution state of the target first task by the pause mark;
[0033] S7: When the target second task is executed, cancel the pause mark of the target first task, and trigger the target first task to start execution.
[0034] Preferably,
[0035] The configuration parameters include: task configuration parameters and condition trigger configuration parameters;
[0036] The step of determining at least one configuration parameter in the task execution schedule includes:
[0037] Determine at least one target task configuration parameter and at least one target condition trigger configuration parameter in the task execution schedule, wherein the target condition configuration parameter includes: year, month, day, hour, minute, second, and week;
[0038] The configuring the at least one configuration parameter in the task execution plan table to generate a target task execution plan table includes:
[0039] Configuring the at least one target task configuration parameter and the at least one target condition configuration parameter in the task execution plan table;
[0040] Generate the target task execution schedule according to the configuration information, wherein the configuration information includes condition trigger information;
[0041] The task execution process corresponding to the task execution flow chart includes:
[0042] Determining whether a trigger condition corresponding to the conditional trigger information is met;
[0043] When it is determined that the trigger condition corresponding to the conditional trigger information is met, the task execution process corresponding to the task execution flow chart is executed.
[0044] In a second aspect, an embodiment of the present invention provides a task flow scheduling device, including:
[0045] A determination module, used to determine at least one configuration parameter in the task execution schedule;
[0046] A configuration module, configured to configure the at least one configuration parameter determined by the determination module to generate a target task execution schedule, wherein the target task execution schedule includes at least one target task;
[0047] A process processing module is used to draw a task execution flowchart through a visual graphical interface according to the target task execution plan table of the configuration module, according to the logical order of task execution for at least one target task in the target task plan table; when at least two target tasks are executed in parallel, the task node is written as a task of a shardable type so that the executor executes the task in parallel after identification; and the task execution process corresponding to the task execution flowchart is executed.
[0048] Preferably,
[0049] Further including:
[0050] A receiving module, used for receiving the execution result of the task execution process;
[0051] A setting module, configured to set at least one identification information for the at least one target task according to the execution result received by the receiving module, so as to visualize the execution result, wherein the identification information is used to represent feedback information on the execution result of the at least one target task, and the feedback information includes: a completion status of the at least one target task and an abnormal status of the at least one target task;
[0052] An exception handling module, used for performing exception handling on the target task execution process corresponding to the abnormal state according to the at least one identification information set by the setting module;
[0053] Preferably,
[0054] Further including:
[0055] Added a new process module to perform:
[0056] When a new task execution process is needed, determining at least one new task execution process, wherein the at least one new task execution process includes at least one new task, and the at least one new task is not included in the task execution flow chart;
[0057] Determine at least one new configuration parameter corresponding to the at least one new task execution process;
[0058] Performing parameter configuration on the at least one newly added configuration parameter;
[0059] Determining a logical relationship between the at least one newly added task included in the at least one newly added task execution process and the at least one target task;
[0060] According to the task execution flowchart and the logical relationship between the at least one newly added task and the at least one target task, a newly added task execution flowchart is drawn through the visual graphic interface.
[0061] Preferably,
[0062] Further including:
[0063] Associated task processing module, used to perform:
[0064] When there are at least two task execution flowcharts, determining whether there is an association relationship between a first task execution flowchart and a second task execution flowchart among the at least two task execution flowcharts;
[0065] If it is determined that the first task execution flowchart and the second task execution flowchart are associated with each other, executing:
[0066] S1: Determine a first target task and a second target task that are associated with each other, wherein the first target task is included in the first task execution flowchart, and the second target task is included in the second task execution flowchart;
[0067] S2: Determine whether the target first task needs to be executed first and the target second task needs to be executed after the target first task is completed. If so, execute step S3; otherwise, execute step S5;
[0068] S3: marking the current execution state of the target second task by a pause mark;
[0069] S4: when the execution of the target first task is completed, cancel the pause mark of the target second task, and trigger the target second task to start execution;
[0070] S5: Determine whether the target second task needs to be executed first and the target first task needs to be executed after the target second task is executed. If so, execute step S6;
[0071] S6: marking the current execution state of the target first task by the pause mark;
[0072] S7: When the target second task is executed, cancel the pause mark of the target first task, and trigger the target first task to start execution.
[0073] Preferably,
[0074] The configuration parameters include: task configuration parameters and condition trigger configuration parameters;
[0075] The determination module is used to determine at least one target task configuration parameter and at least one target condition trigger configuration parameter in the task execution schedule, wherein the target condition configuration parameter includes: year, month, day, hour, minute, second, and week;
[0076] The configuration module is used to configure the at least one target task configuration parameter and the at least one target condition configuration parameter in the task execution schedule; generate the target task execution schedule according to the configuration information, wherein the configuration information includes condition trigger information;
[0077] The process processing module is used to determine whether the trigger condition corresponding to the conditional trigger information is met; when it is determined that the trigger condition corresponding to the conditional trigger information is met, execute the task execution process corresponding to the task execution flowchart.
[0078] In a third aspect, the present invention provides an electronic device, comprising: at least one memory and at least one processor;
[0079] The at least one memory is used to store a machine-readable program;
[0080] The at least one processor is used to call the machine-readable program to execute any method described in the first aspect.
[0081] In a fourth aspect, the present invention provides a computer-readable medium having computer instructions stored thereon, wherein when the computer instructions are executed by a processor, the processor is caused to execute any of the methods described in the first aspect.
[0082] The embodiment of the present invention provides a task flow arrangement method and device. When performing task scheduling, due to the unclear execution cycle of some tasks, it is necessary to repeatedly adjust according to the actual operation of the project, and the project needs to be restarted after each adjustment, and it is impossible to visually arrange the tasks according to actual needs to provide continuous services. Therefore, in order to realize the visual arrangement of tasks, a task execution flow chart can be drawn according to the logical order of target task execution through a visual graphical interface, and the configuration parameters corresponding to each target task need to be determined, and the configuration parameters of the target task are configured accordingly in the task plan execution table. The task execution schedule after user configuration is a target task execution schedule that meets user needs. Based on the configured target task execution schedule, the user can draw a task execution flow chart in a visual graphical interface according to his own task execution logic and the logical relationship between each target task. At the same time, for task nodes with loop traversal, they can be written as tasks of a shardable type, and the executor can execute the task in a parallel manner after identification, and the traversed elements are collected and then executed in segments. Drawing a process through a visual graphical interface can arrange the execution logic of multiple tasks, and realize the scheduling of complex tasks while ensuring simple operation. Through the above process, there is no need for developers to code and run task scripts, and tasks can be visually arranged to achieve task scheduling according to actual business needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0084] Figure 1 is a flowchart of a task process arrangement method provided by an embodiment of the present invention;
[0085] Figure 2 is a flowchart of another task flow arrangement method provided by an embodiment of the present invention;
[0086] Figure 3 is a schematic diagram of a task flow arrangement device provided by an embodiment of the present invention;
[0087] Figure 4 It is a schematic diagram of another task flow scheduling device provided by an embodiment of the present invention.
[0088] Figure 5 is a schematic diagram of another task flow arrangement device provided by an embodiment of the present invention;
[0089] Figure 6 It is a schematic diagram of another task flow scheduling device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0090] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0091] like Figure 1 As shown, an embodiment of the present invention provides a task flow arrangement method, which may include the following steps:
[0092] Step 101: Determine at least one configuration parameter in a task execution plan table;
[0093] Step 102: configuring at least one configuration parameter in the task execution plan table to generate a target task execution plan table, wherein the target task execution plan table includes at least one target task;
[0094] Step 103: According to the target task execution plan table, at least one target task in the target task plan table is drawn into a task execution flow chart through a visual graphic interface according to the logical order of task execution;
[0095] Step 104: When at least two target tasks are to be executed in parallel, the task node is written as a task of a shardable type, so that the executor executes the task in parallel after identification;
[0096] Step 105: Execute the task execution process corresponding to the task execution flow chart.
[0097] In an embodiment of the present invention, when the task scheduling is actually performed, since the execution cycle of some tasks is unclear, it is necessary to repeatedly adjust according to the actual operation of the project, and the project needs to be restarted after each adjustment, and it is impossible to visually arrange the tasks according to the actual needs to provide continuous services. Therefore, in order to realize the visual arrangement of tasks, a task execution flow chart can be drawn according to the logical order of the execution of the target task through a visual graphical interface, and the configuration parameters corresponding to the task need to be determined for each target task, and the configuration parameters of the target task are configured accordingly in the task plan execution table. The task execution schedule after user configuration is a target task execution schedule that meets the user's needs. Based on the configured target task execution schedule, the user can draw a task execution flow chart in the visual graphical interface according to his own task execution logic and the logical relationship between each target task. At the same time, for the task nodes with loop traversal, it can be written as a task of a shardable type, and the executor can execute the task in a parallel manner after identification, and the traversed elements are collected and executed in segments. The execution logic of multiple tasks can be arranged by drawing a process through a visual graphical interface, and the scheduling of complex tasks can be realized while ensuring simple operation. Through the above process, there is no need for developers to code and run task scripts, and tasks can be visually arranged to achieve task scheduling according to actual business needs.
[0098] In order to view and monitor the running status of the task in real time, in one embodiment of the present invention, the above embodiment further includes:
[0099] Receive the execution result of the task execution process;
[0100] According to the received execution result, at least one identification information is set for at least one target task to visualize the execution result, wherein the identification information is used to represent feedback information on the execution result of the at least one target task, and the feedback information includes: a completion status of the at least one target task and an abnormal status of the at least one target task;
[0101] According to the at least one piece of identification information, an exception handling is performed on the target task execution process corresponding to the abnormal state.
[0102] In an embodiment of the present invention, since the existing task scheduling system cannot view the running status of the task online in real time, in order to view and supervise the running status of the task in real time, the running status of each target task can be determined according to the execution result of the task execution process, and identification information used to characterize the running status of the target task can be set for each target task according to the execution result of each target task. The user can view the corresponding identification information through a visual graphical interface to monitor the running status of the task in real time, visualize the execution status of the task in real time, and perform basic monitoring of the task at the same time, so as to timely discover the defects of the task and make improvements, thereby improving work efficiency.
[0103] In order to add a new task execution process, in one embodiment of the present invention, the above embodiment further includes:
[0104] When a new task execution process is needed, determining at least one new task execution process, wherein the at least one new task execution process includes at least one new task, and the at least one new task is not included in the task execution flow chart;
[0105] Determine at least one new configuration parameter corresponding to at least one new task execution process;
[0106] Perform parameter configuration on at least one newly added configuration parameter;
[0107] Determining a logical relationship between at least one newly added task included in at least one newly added task execution process and at least one target task;
[0108] According to the task execution flowchart and the logical relationship between at least one newly added task and at least one target task, a newly added task execution flowchart is drawn through a visual graphic interface.
[0109] In an embodiment of the present invention, when it is necessary to add new parts based on the executed task execution flowchart according to actual project requirements, the original task execution flowchart can be used as a template, and the newly added configuration parameters are first configured for the newly added parts. After the newly added configuration parameters are configured and the user creates a logical relationship through a visual graphical interface, the newly added execution process can be run. At the same time, when creating multiple similar task execution flowcharts, the same parts can be extracted to make a process template, and corresponding prototype attributes can be designed for parameter configuration of the different parts, so as to facilitate the arrangement of multiple task execution flowcharts.
[0110] In order to achieve multi-process collaboration, in one embodiment of the present invention, the above embodiment further includes:
[0111] When there are at least two task execution flowcharts, determining whether there is an association relationship between the first task execution flowchart and the second task execution flowchart in the at least two task execution flowcharts;
[0112] If it is determined that there is a correlation between the first task execution flowchart and the second task execution flowchart, execute:
[0113] S1: Determine a first target task and a second target task that are associated with each other, wherein the first target task is included in a first task execution flow chart, and the second target task is included in a second task execution flow chart;
[0114] S2: Determine whether the target first task needs to be executed first and the target second task needs to be executed after the target first task is completed. If so, execute step S3; otherwise, execute step S5;
[0115] S3: marking the current execution state of the target second task by a pause mark;
[0116] S4: when the execution of the target first task is completed, cancel the pause mark of the target second task, and trigger the target second task to start execution;
[0117] S5: Determine whether the target second task needs to be executed first and the target first task needs to be executed after the target second task is executed. If so, execute step S6;
[0118] S6: marking the current execution state of the target first task by the pause mark;
[0119] S7: When the target second task is executed, the pause mark of the target first task is cancelled, and the target first task is triggered to start execution.
[0120] In an embodiment of the present invention, after visually arranging the tasks, a plurality of task execution flowcharts that are interrelated can support the function of multi-process collaboration. When it is necessary to define the execution sequence between two task execution flowcharts on a certain node in time, a pause mark can be added to the task execution flowchart. When it is necessary to wait for the progress and execution result of the target task in another task execution flowchart, the current target task corresponding to the current task execution flowchart can mark the current execution state with a pause mark, and then wait for the result of another process, and the current process will resume operation after obtaining the execution result of another process.
[0121] In order to determine the target task execution schedule, in one embodiment of the present invention, the configuration parameters in the above embodiment include: task configuration parameters and condition trigger configuration parameters;
[0122] In the above embodiment, step 101 determines at least one configuration parameter in the task execution plan table, which can be implemented in the following way:
[0123] Determine at least one target task configuration parameter and at least one target condition trigger configuration parameter in the task execution plan table, wherein the target condition configuration parameter includes: year, month, day, hour, minute, second, and week;
[0124] In the above embodiment, step 102 configures at least one configuration parameter in the task execution schedule to generate a target task execution schedule, which can be implemented in the following manner:
[0125] Configure at least one target task configuration parameter and at least one target condition configuration parameter in the task execution plan table;
[0126] Generate a target task execution schedule based on the configuration information, wherein the configuration information includes condition trigger information;
[0127] Step 105 in the above embodiment executes the task execution flow chart corresponding to the task execution flow chart, which can be specifically implemented through the following process:
[0128] Determine whether the trigger condition corresponding to the conditional trigger information is met;
[0129] When it is determined that the trigger condition corresponding to the conditional trigger information is met, the task execution flow corresponding to the task execution flow chart is executed.
[0130] In the embodiment of the present invention, since it is necessary to configure the parameters corresponding to each target task to generate a target execution schedule, and each target task must be triggered and executed under certain conditions, in addition to configuring the basic task configuration parameters, it is also necessary to configure the conditional trigger configuration parameters corresponding to the trigger conditions. For example, a specific trigger cycle can be input in the visual graphical interface for simple triggering, a delay time can be input for triggering, or a Cron expression can be input for triggering. In the Cron expression trigger, the user can click the mouse to select the year, month, day, hour, minute, second, week and other information required for the task trigger, and the Cron expression can be automatically generated. At the same time, only when the trigger conditions corresponding to the conditional trigger information are met will the execution of the process corresponding to the target task be triggered. Therefore, it is necessary to determine whether the trigger conditions corresponding to the conditional trigger information are met. When it is determined that the trigger conditions corresponding to the conditional trigger information are met, the task execution process corresponding to the task execution flow chart is automatically executed.
[0131] In one embodiment of the present invention, scheduled tasks are an important scenario in software development, and they play an important service both for users and service providers. Initially, the system was only required to perform specific jobs at the planned time point (which may be one-time or periodic). Such scheduled tasks are relatively simple to implement and can meet most of the needs. With the iterative development of software, the use scenarios of scheduled tasks are constantly enriched, the demand is increasing, and the task triggering is becoming more and more complex. In this case, dynamic task management is required. For example, some tasks need to be executed in a chain, and the execution of the subsequent tasks depends on the execution results of the previous tasks. In this case, scheduled tasks are required to support task scheduling. Therefore, the present invention can be applied to dynamic scheduled task management systems in complex situations, which is of great significance to the good development of project ecology.
[0132] The Quartz framework is a set of open source lightweight task scheduling frameworks developed based on Java. The framework provides a powerful and flexible scheduling mechanism while retaining the simplicity of the method of use. It can be used for basic timed tasks such as fixed-point triggering and periodic triggering after simple configuration. However, if it is used in a complex production environment, it is necessary to ensure that it has good operability and the characteristics of handling complex tasks, such as the processing of chain tasks and parallel tasks, and at the same time, it is also necessary to ensure its easy extensibility to adapt to the ever-increasing needs in the production environment. The present invention can build a set of easy-to-operate and expandable visual task management system based on Quartz. The system can integrate Quartz and Web, and use visual operations to perform task scheduling management. The operator only needs to pay attention to the logical configuration of the scheduling of the task, without having to care about the specific implementation of the timed task, thereby minimizing the operator's demand for professional knowledge.
[0133] like Figure 2 To more clearly illustrate the technical solution and advantages of the present invention, a task flow scheduling method is provided in detail below in accordance with an embodiment of the present invention, which may include the following steps:
[0134] Step 201: Determine at least one target task configuration parameter and at least one target condition trigger configuration parameter in the task execution plan table, wherein the target condition configuration parameter includes: year, month, day, hour, minute, second, week and other information.
[0135] Step 202: configure at least one target task configuration parameter and at least one target condition configuration parameter in the task execution plan table.
[0136] Step 203: Generate a target task execution schedule according to the configuration information, wherein the configuration information includes condition trigger information, and wherein the target task execution schedule includes at least one target task.
[0137] Step 204: According to the target task execution schedule, at least one target task in the target task schedule is executed in a logical order, and a task execution flow chart is drawn through a visual graphic interface.
[0138] Specifically, common tasks include scheduled tasks, delayed tasks, fixed frequency tasks, Cron expression tasks, and conditional trigger tasks. Users can use a visual graphical interface to draw the task execution process, or write a task process DSL script. After the system loads and publishes it, the tasks can be run in sequence according to the process. The process itself can support series, parallel, delay, retry mechanism, loop, and fence mechanism, which can meet most process scenarios.
[0139] If you write a task process DSL script, you can implement functions such as scheduling group management, process filters, and failover based on metaprogramming technology. Using scheduling metaprogramming, one scheduling plan can correspond to one scheduling process group, that is, the ability to dynamically switch processes during operation. At the same time, you can add filters between process nodes to filter the execution of some tasks and end the process early. The above two functions can achieve the failover function of scheduling. When an exception occurs during the execution process, it can automatically switch to the post-abnormal process or terminate the process to avoid system crashes and provide the ability to fail quickly and safely.
[0140] For example, in terms of task scheduling, in addition to simple scheduling of a single task, complex scheduling of multiple tasks can also be achieved. In the visual graphical interface, different tasks can be linked according to their internal dependencies in the form of a DAG graph by dragging and drawing, thereby achieving visual arrangement of complex scheduling tasks. At the same time, through the DAG graph, you can intuitively observe the upstream and downstream execution status of a task, determine the reason why a task is not executed, and which tasks will be affected by deleting a task, etc., which is convenient for management.
[0141] Step 205: When at least two target tasks are to be executed in parallel, the task node is written as a task of a shardable type, so that the executor executes the task in parallel after identification.
[0142] Step 206: Determine whether the trigger condition corresponding to the conditional trigger information is satisfied.
[0143] Step 207: When it is determined that the trigger condition corresponding to the conditional trigger information is met, the task execution flow corresponding to the task execution flow chart is executed.
[0144] Step 208: Receive the execution result of the task execution process.
[0145] Step 209: Based on the received execution results, at least one identification information is set for at least one target task to visualize the execution results, wherein the identification information is used to characterize feedback information on the execution results of at least one target task, and the feedback information includes: the completion status of at least one target task and the abnormal status of at least one target task.
[0146] Step 210: According to at least one piece of identification information, perform exception handling on the target task execution process corresponding to the abnormal state.
[0147] Specifically, visual arrangement of tasks can also perform statistical analysis on task execution results. After each task is executed, the information is persisted in the database, and after statistical analysis, line graphs, bar graphs and other visual charts of historical execution task information are generated, which can clearly observe the total number of tasks in the scheduling system, the total number of task runs, the number of successful runs, the number of failed runs, etc.; according to the number of successful and failed executions of tasks, further analysis is performed to obtain task stability charts, and the complexity of tasks is analyzed according to the execution overhead of tasks, etc., so as to provide data for implementation and development personnel to optimize task codes, scheduling processes, etc., and improve system stability.
[0148] Visual orchestration can also include visual viewing of system load, memory, process, CPU and other information, making it easier for users to understand the performance and usage of the current system and allocate and use server resources more reasonably.
[0149] Step 211: when a new task execution process is needed, at least one new task execution process is determined, wherein the at least one new task execution process includes at least one new task, and the at least one new task is not included in the task execution flow chart.
[0150] Step 212: Determine at least one newly added configuration parameter corresponding to at least one newly added task execution process.
[0151] Step 213: Perform parameter configuration on at least one newly added configuration parameter.
[0152] Step 214: Determine a logical relationship between at least one newly added task included in at least one newly added task execution process and at least one target task.
[0153] Step 215: Draw a new task execution flowchart through a visual graphic interface according to the task execution flowchart and the logical relationship between the at least one new task and the at least one target task.
[0154] Specifically, tasks can be dynamically added, updated, and destroyed. Task addition supports system built-in tasks, service calls, and uploading of task executable files.
[0155] Step 216: When there are at least two task execution flowcharts, for a first task execution flowchart and a second task execution flowchart among the at least two task execution flowcharts, determine whether there is an association relationship between the first task execution flowchart and the second task execution flowchart.
[0156] Step 217: If it is determined that the first task execution flowchart and the second task execution flowchart are associated, determine the target first task and the target second task that are associated, wherein the target first task is included in the first task execution flowchart, and the target second task is included in the second task execution flowchart.
[0157] Step 218: Determine whether the target first task needs to be executed first and the target second task needs to be executed after the target first task is completed. If so, execute step 219; otherwise, execute step 221.
[0158] Step 219: Mark the current execution state of the target second task with a pause mark.
[0159] Step 220: When the target first task is executed, cancel the pause mark of the target second task, and trigger the target second task to start execution.
[0160] Step 221: Determine whether the target second task needs to be executed first and the target first task needs to be executed after the target second task is completed. If so, execute step 222.
[0161] Step 222: Mark the current execution state of the target first task with a pause mark.
[0162] Step 223: When the target second task is executed, cancel the pause mark of the target first task and trigger the target first task.
[0163] The present invention can provide a variety of task registration solutions, such as: system built-in, service call and script call.
[0164] 1. System built-in tasks are tasks that are directly written into the scheduling system. Such tasks are generally tasks directly related to the scheduling system, such as data persistence and backup of the scheduling system itself. Such tasks are directly registered to the scheduling system and are uniformly managed and executed by the scheduling system. These basic tasks can also be scheduled as needed to achieve more complex functions.
[0165] 2. Service call mainly refers to the dispatching system directly calling services provided by other systems. This type of call method is suitable for tasks with strong dependencies on business systems. The dispatching system only needs to call the specified service according to the trigger. It can be called through URL and service registration center. When there are fewer services, it is simple and easy to manage to call directly using URL. When there are more and more services, service URL configuration management becomes very difficult, and it can be called through the service registration center.
[0166] 3. Script call, providing a method to start and manage processes. This method can be used to execute Python scripts, jar package programs, shell scripts, etc. These scripts or programs are separated from the business system and can be easily modified and repeatedly uploaded to the scheduling system. The development is simple and does not invade the business system. Using custom scripts to create scheduling system tasks is the main task registration solution.
[0167] like Figure 3 As shown, an embodiment of the present invention provides a task flow arrangement device, the device comprising:
[0168] A determination module 301 is used to determine at least one configuration parameter in a task execution schedule;
[0169] The configuration module 302 is used to configure at least one configuration parameter determined by the determination module 301 to generate a target task execution schedule, wherein the target task execution schedule includes at least one target task;
[0170] The process processing module 303 is used to draw a task execution flowchart through a visual graphical interface according to the target task execution plan table of the configuration module 302, according to the logical order of task execution for at least one target task in the target task plan table; when at least two target tasks are executed in parallel, the task node is written as a task of a shardable type so that the executor executes the task in parallel after identification; and the task execution process corresponding to the task execution flowchart is executed.
[0171] In an embodiment of the present invention, when the task scheduling is actually performed, since the execution cycle of some tasks is unclear, it is necessary to adjust repeatedly according to the actual operation of the project, and the project needs to be restarted after each adjustment, and it is impossible to visually arrange the tasks according to the actual needs to provide continuous services. Therefore, in order to realize the visual arrangement of tasks, a task execution flow chart can be drawn according to the logical order of the execution of the target task through a visual graphical interface, and for each target task, the configuration parameters corresponding to the task need to be determined by a determination module, and the configuration parameters of the target task are configured accordingly in the task plan execution table through a configuration module. The task execution schedule after user configuration is a target task execution schedule that meets user needs. Based on the configured target task execution schedule, the user can draw a task execution flow chart in a visual graphical interface through a process processing module according to his own task execution logic and the logical relationship between each target task. At the same time, for task nodes with loop traversal, it can be written as a task of a shardable type, and the executor can execute the task in a parallel manner after identification, and the traversed elements are collected and executed in segments. Drawing a process through a visual graphical interface can arrange the execution logic of multiple tasks, and realize the scheduling of complex tasks while ensuring simple operation. Through the above process, there is no need for developers to code and run task scripts, and tasks can be visually arranged to achieve task scheduling according to actual business needs.
[0172] based on Figure 3 The task flow arrangement device shown in FIG. Figure 4 As shown, in one embodiment of the present invention, it further includes:
[0173] The receiving module 304 is used to receive the execution result of the task execution process;
[0174] The setting module 305 is used to set at least one identification information for at least one target task according to the execution result received by the receiving module 304, so as to visualize the execution result, wherein the identification information is used to represent the feedback information of the execution result of the at least one target task, and the feedback information includes: the completion status of the at least one target task and the abnormal status of the at least one target task;
[0175] The exception handling module 306 is used to perform exception handling on the target task execution process corresponding to the abnormal state according to the at least one identification information set by the setting module 305;
[0176] based on Figure 3 The task flow arrangement device shown in FIG. Figure 5 As shown, in one embodiment of the present invention, it further includes:
[0177] Add a new process module 307 to execute:
[0178] When a new task execution process is needed, determining at least one new task execution process, wherein the at least one new task execution process includes at least one new task, and the at least one new task is not included in the task execution flow chart;
[0179] Determine at least one new configuration parameter corresponding to at least one new task execution process;
[0180] Perform parameter configuration on at least one newly added configuration parameter;
[0181] Determining a logical relationship between at least one newly added task included in at least one newly added task execution process and at least one target task;
[0182] According to the task execution flowchart and the logical relationship between at least one newly added task and at least one target task, a newly added task execution flowchart is drawn through a visual graphic interface.
[0183] based on Figure 3 The task flow arrangement device shown in FIG. Figure 6 As shown, further comprising:
[0184] The associated task processing module 308 is used to execute:
[0185] When there are at least two task execution flowcharts, determining whether there is an association relationship between the first task execution flowchart and the second task execution flowchart in the at least two task execution flowcharts;
[0186] If it is determined that there is a correlation between the first task execution flowchart and the second task execution flowchart, execute:
[0187] S1: Determine a first target task and a second target task that are associated with each other, wherein the first target task is included in a first task execution flow chart, and the second target task is included in a second task execution flow chart;
[0188] S2: Determine whether the target first task needs to be executed first and the target second task needs to be executed after the target first task is completed. If so, execute step S3; otherwise, execute step S5;
[0189] S3: marking the current execution state of the target second task by a pause mark;
[0190] S4: when the execution of the target first task is completed, cancel the pause mark of the target second task, and trigger the target second task to start execution;
[0191] S5: Determine whether the target second task needs to be executed first and the target first task needs to be executed after the target second task is executed. If so, execute step S6;
[0192] S6: marking the current execution state of the target first task by a pause mark;
[0193] S7: When the target second task is executed, the pause mark of the target first task is cancelled, and the target first task is triggered to start execution.
[0194] In one embodiment of the present invention, the configuration parameters include: task configuration parameters and condition trigger configuration parameters;
[0195] The determination module 301 is used to determine at least one target task configuration parameter and at least one target condition trigger configuration parameter in the task execution plan table, wherein the target condition configuration parameter includes: year, month, day, hour, minute, second, and week;
[0196] Configuration module 302, configured to configure at least one target task configuration parameter and at least one target condition configuration parameter in the task execution schedule; generate a target task execution schedule according to the configuration information, wherein the configuration information includes condition trigger information;
[0197] The process processing module 303 is used to determine whether the trigger condition corresponding to the conditional trigger information is satisfied; when it is determined that the trigger condition corresponding to the conditional trigger information is satisfied, the task execution process corresponding to the task execution flow chart is executed.
[0198] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the task flow arrangement device. In other embodiments of the present invention, the task flow arrangement device may include more or fewer components than those shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0199] The information interaction, execution process and other contents between the units in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.
[0200] The embodiment of the present invention also provides a task flow arrangement device, comprising: at least one memory and at least one processor;
[0201] at least one memory for storing a machine-readable program;
[0202] At least one processor is used to call a machine-readable program to execute the task flow scheduling method in any embodiment of the present invention.
[0203] An embodiment of the present invention further provides a computer-readable medium on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the task flow scheduling method in any embodiment of the present invention.
[0204] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.
[0205] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0206] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0207] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0208] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0209] Each embodiment of the present invention has at least the following beneficial effects:
[0210] 1. In the embodiment of the present invention, when the task scheduling is actually performed, due to the unclear execution cycle of some tasks, it is necessary to repeatedly adjust according to the actual operation of the project, and the project needs to be restarted after each adjustment, and it is impossible to visually arrange the tasks according to the actual needs to provide continuous services. Therefore, in order to realize the visual arrangement of tasks, the task execution flow chart can be drawn according to the logical order of the target task execution through the visual graphical interface, and the configuration parameters corresponding to the task need to be determined for each target task, and the configuration parameters of the target task are configured accordingly in the task plan execution table. The task execution schedule after user configuration is a target task execution schedule that meets the user's needs. Based on the configured target task execution schedule, the user can draw the task execution flow chart in the visual graphical interface according to his own task execution logic and the logical relationship between each target task. At the same time, for the task nodes with loop traversal, it can be written as a task of a shardable type, and the executor can execute the task in parallel after identification, and the traversed elements are collected and executed in segments. The execution logic of multiple tasks can be arranged by drawing the process through the visual graphical interface, and the scheduling of complex tasks can be realized while ensuring simple operation. Through the above process, there is no need for developers to code and run task scripts. Visual arrangement of tasks can be realized according to actual business needs to achieve task scheduling.
[0211] 2. In one embodiment of the present invention, since the existing task scheduling system cannot view the running status of tasks online in real time, in order to view and supervise the running status of tasks in real time, the running status of each target task can be determined according to the execution result of the task execution process, and identification information used to characterize the running status of each target task can be set for each target task according to the execution result of each target task. The user can view the corresponding identification information through a visual graphical interface to monitor the running status of the task in real time, visualize the execution status of the task in real time, and perform basic monitoring on the task at the same time, so as to timely discover the defects of the task and make improvements, thereby improving work efficiency;
[0212] 3. In one embodiment of the present invention, when it is necessary to add a new task execution flowchart based on the actual project requirements, the original task execution flowchart can be used as a template, and the newly added configuration parameters are first configured for the newly added part. After the newly added configuration parameters are configured and the user creates a logical relationship through a visual graphical interface, the newly added execution process can be run. At the same time, when creating multiple similar task execution flowcharts, the same parts can be extracted to make a process template, and the corresponding prototype attributes can be designed for parameter configuration of the different parts, so that multiple task execution flowcharts can be easily arranged;
[0213] 4. In one embodiment of the present invention, after visually arranging the tasks, multiple task execution flowcharts that are interrelated can support the function of multi-process collaboration. When it is necessary to define the execution sequence between two task execution flowcharts on a certain node in time, a pause mark can be added to the task execution flowchart. When it is necessary to wait for the progress and execution result of the target task in another task execution flowchart, the current target task corresponding to the current task execution flowchart can mark the current execution state with a pause mark, and then wait for the result of another process, and the current process will resume operation after obtaining the execution result of another process.
[0214] 5. In one embodiment of the present invention, since it is necessary to configure the parameters corresponding to each target task to generate a target execution schedule, and each target task must be triggered and executed under certain conditions, in addition to configuring the basic task configuration parameters, it is also necessary to configure the conditional trigger configuration parameters corresponding to the trigger conditions. For example, a specific trigger cycle can be input in the visual graphical interface for simple triggering, a delay time can be input for triggering, or a Cron expression can be input for triggering. In the Cron expression trigger, the user can click the mouse to select the year, month, day, hour, minute, second, week and other information required for the task trigger, and the Cron expression can be automatically generated. At the same time, only when the trigger conditions corresponding to the conditional trigger information are met will the execution of the process corresponding to the target task be triggered. Therefore, it is necessary to determine whether the trigger conditions corresponding to the conditional trigger information are met. When it is determined that the trigger conditions corresponding to the conditional trigger information are met, the task execution process corresponding to the task execution flow chart is automatically executed.
[0215] It should be noted that not all steps and modules in the above-mentioned processes and system structure diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0216] In the above embodiments, the hardware unit can be realized by mechanical means or electrical means. For example, a hardware unit can include permanent dedicated circuits or logic (such as special processors, FPGA or ASIC) to complete the corresponding operation. The hardware unit can also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which can be temporarily set by software to complete the corresponding operation. Concrete implementation (mechanical means or dedicated permanent circuits or temporarily set circuits) can be determined based on cost and time considerations.
[0217] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A task flow arrangement method, characterized in that: include: Determining at least one configuration parameter in the task execution schedule; Configuring the at least one configuration parameter in the task execution plan table to generate a target task execution plan table, wherein the target task execution plan table includes at least one target task; According to the target task execution schedule, at least one target task in the target task schedule is executed in a logical order, and a task execution flow chart is drawn through a visual graphic interface; When at least two target tasks are executed in parallel, the task node is written as a shardable task so that the executor can execute the task in parallel after identification; Execute the task execution process corresponding to the task execution flow chart; Further including: Receiving an execution result of the task execution process; According to the received execution result, at least one identification information is set for the at least one target task to visualize the execution result, wherein the identification information is used to represent feedback information on the execution result of the at least one target task, and the feedback information includes: a completion status of the at least one target task and an abnormal status of the at least one target task; According to the at least one identification information, performing exception handling on the target task execution process corresponding to the abnormal state; Further including: When a new task execution process is needed, determining at least one new task execution process, wherein the at least one new task execution process includes at least one new task, and the at least one new task is not included in the task execution flow chart; Determine at least one new configuration parameter corresponding to the at least one new task execution process; Performing parameter configuration on the at least one newly added configuration parameter; Determining a logical relationship between the at least one newly added task included in the at least one newly added task execution process and the at least one target task; According to the task execution flowchart and the logical relationship between the at least one newly added task and the at least one target task, drawing a newly added task execution flowchart through the visual graphic interface; Further including: When there are at least two task execution flowcharts, determining whether there is an association relationship between a first task execution flowchart and a second task execution flowchart among the at least two task execution flowcharts; If it is determined that the first task execution flowchart and the second task execution flowchart are associated with each other, executing: S1: Determine a first target task and a second target task that are associated with each other, wherein the first target task is included in the first task execution flowchart, and the second target task is included in the second task execution flowchart; S2: Determine whether the target first task needs to be executed first and the target second task needs to be executed after the target first task is completed. If so, execute step S3; otherwise, execute step S5; S3: marking the current execution state of the target second task by a pause mark; S4: when the execution of the target first task is completed, cancel the pause mark of the target second task, and trigger the target second task to start execution; S5: Determine whether the target second task needs to be executed first and the target first task needs to be executed after the target second task is executed. If so, execute step S6; S6: marking the current execution state of the target first task by the pause mark; S7: when the target second task is executed, cancel the pause mark of the target first task, and trigger the target first task to start execution; The configuration parameters include: task configuration parameters and condition trigger configuration parameters; The step of determining at least one configuration parameter in the task execution schedule includes: Determine at least one target task configuration parameter and at least one target condition trigger configuration parameter in the task execution schedule, wherein the target condition trigger configuration parameter includes: year, month, day, hour, minute, second, and week; The configuring the at least one configuration parameter in the task execution plan table to generate a target task execution plan table includes: Configuring the at least one target task configuration parameter and the at least one target condition configuration parameter in the task execution plan table; Generate the target task execution schedule according to the configuration information, wherein the configuration information includes condition trigger information; The task execution process corresponding to the task execution flow chart includes: Determining whether a trigger condition corresponding to the conditional trigger information is met; When it is determined that the trigger condition corresponding to the conditional trigger information is met, the task execution process corresponding to the task execution flow chart is executed.
2. The task process arrangement device is characterized in that: include: A determination module, used to determine at least one configuration parameter in the task execution schedule; A configuration module, configured to configure the at least one configuration parameter determined by the determination module to generate a target task execution schedule, wherein the target task execution schedule includes at least one target task; A process processing module is used to draw a task execution flow chart through a visual graphical interface according to the target task execution plan table of the configuration module, at least one target task in the target task plan table according to the logical order of task execution; when at least two target tasks are executed in parallel, the task node is written as a task of a shardable type so that the executor executes the task in parallel after identification; and the task execution process corresponding to the task execution flow chart is executed; Further including: A receiving module, used for receiving the execution result of the task execution process; A setting module, configured to set at least one identification information for the at least one target task according to the execution result received by the receiving module, so as to visualize the execution result, wherein the identification information is used to represent feedback information on the execution result of the at least one target task, and the feedback information includes: a completion status of the at least one target task and an abnormal status of the at least one target task; An exception handling module, used for performing exception handling on the target task execution process corresponding to the abnormal state according to the at least one identification information set by the setting module; Further including: Added a new process module to perform: When a new task execution process is needed, determining at least one new task execution process, wherein the at least one new task execution process includes at least one new task, and the at least one new task is not included in the task execution flow chart; Determine at least one new configuration parameter corresponding to the at least one new task execution process; Performing parameter configuration on the at least one newly added configuration parameter; Determining a logical relationship between the at least one newly added task included in the at least one newly added task execution process and the at least one target task; According to the task execution flowchart and the logical relationship between the at least one newly added task and the at least one target task, drawing a newly added task execution flowchart through the visual graphic interface; Further including: Associated task processing module, used to perform: When there are at least two task execution flowcharts, determining whether there is an association relationship between a first task execution flowchart and a second task execution flowchart among the at least two task execution flowcharts; If it is determined that the first task execution flowchart and the second task execution flowchart are associated with each other, executing: S1: Determine a first target task and a second target task that are associated with each other, wherein the first target task is included in the first task execution flowchart, and the second target task is included in the second task execution flowchart; S2: Determine whether the target first task needs to be executed first and the target second task needs to be executed after the target first task is completed. If so, execute step S3; otherwise, execute step S5; S3: marking the current execution state of the target second task by a pause mark; S4: when the execution of the target first task is completed, cancel the pause mark of the target second task, and trigger the target second task to start execution; S5: Determine whether the target second task needs to be executed first and the target first task needs to be executed after the target second task is executed. If so, execute step S6; S6: marking the current execution state of the target first task by the pause mark; S7: when the target second task is executed, cancel the pause mark of the target first task, and trigger the target first task to start execution; The configuration parameters include: task configuration parameters and condition trigger configuration parameters; The determination module is used to determine at least one target task configuration parameter and at least one target condition trigger configuration parameter in the task execution schedule, wherein the target condition trigger configuration parameter includes: year, month, day, hour, minute, second, and week; The configuration module is used to configure the at least one target task configuration parameter and the at least one target condition configuration parameter in the task execution schedule; generate the target task execution schedule according to the configuration information, wherein the configuration information includes condition trigger information; The process processing module is used to determine whether the trigger condition corresponding to the conditional trigger information is met; when it is determined that the trigger condition corresponding to the conditional trigger information is met, execute the task execution process corresponding to the task execution flowchart.
3. An electronic device, characterized in that include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method of claim 1.
4. A computer-readable medium, characterized in that The computer readable medium stores computer instructions, which, when executed by a processor, cause the processor to perform the method of claim 1 .
