WO2025190012A1 - Task management method and apparatus, and computer program product - Google Patents
Task management method and apparatus, and computer program productInfo
- Publication number
- WO2025190012A1 WO2025190012A1 PCT/CN2025/076941 CN2025076941W WO2025190012A1 WO 2025190012 A1 WO2025190012 A1 WO 2025190012A1 CN 2025076941 W CN2025076941 W CN 2025076941W WO 2025190012 A1 WO2025190012 A1 WO 2025190012A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- task
- business
- scheduled
- tasks
- execution
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
Definitions
- the present disclosure relates to the technical field of task scheduling, and in particular to a task management method and device, and a computer program product.
- Scheduled tasks are primarily used in business systems to automatically execute repetitive tasks, such as data backup, log cleanup, and data synchronization, or to periodically execute specific operations based on business needs, such as generating reports, sending emails, and updating data. Scheduled tasks can also be used to execute resource-intensive operations, such as data statistics and index rebuilds, during off-peak hours, minimizing impact on business system performance and saving costs.
- the relevant information of scheduled tasks is statically configured in the code, and scheduled tasks cannot be added or deleted dynamically.
- the technical problem to be solved by the present disclosure is to provide a task management method and device, and a computer program product, which can realize the dynamic start and stop of scheduled tasks.
- the embodiments of the present disclosure provide the following technical solutions:
- a task management method comprising:
- a target operation is performed on the scheduled task, where the target operation includes at least one of the following:
- adding a scheduled task in the business system includes:
- deleting a scheduled task in the business system includes:
- modifying a scheduled task in a business system includes:
- Modify the execution period of the scheduled task in the database of the business system or delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system;
- the method further includes:
- the scheduled task is executed regularly according to the execution cycle of the scheduled task.
- the method further includes:
- Execute subsequent business tasks based on the execution results of the scheduled task including any of the following:
- the business task is executed, wherein the execution of the business task depends on the execution result of the preceding task.
- the method further includes:
- Execute subsequent business tasks based on the execution results of the scheduled tasks including:
- Step a acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
- Step b traverse the business tasks in the association condition set
- Step c determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
- Step d remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
- Step e Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
- Step f executing the business tasks in the order of tasks in the task output list.
- the present disclosure also provides a task management device, including:
- the task processor is configured to, in response to an operation instruction for a scheduled task, perform a target operation on the scheduled task, where the target operation includes at least one of the following:
- the task processor includes:
- the adding unit is used to store the task information and execution cycle of the scheduled task in the database of the business system; and call addCronTask to load the scheduled task into the memory of the business system.
- the task processor includes:
- the deletion unit is used to modify the execution status of the scheduled task in the database of the business system to disabled or invalid; or, delete the task information and execution cycle of the scheduled task in the database of the business system; call cancelCronTask to delete the scheduled task in the memory of the business system.
- the task processor includes:
- a changing unit is used to change the execution period of the scheduled task in the database of the business system; or to delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system; call updateTaskInfo to change the execution period of the scheduled task in the memory of the business system.
- the apparatus further comprises:
- a query module is used to query whether there is a valid scheduled task in the business system when the business system is started;
- a loading module is used to call addCronTask to load a valid scheduled task into the memory of the business system if there is one;
- the execution module is used to execute the scheduled task regularly according to the execution cycle of the scheduled task.
- the apparatus further comprises:
- the business task execution module is used to execute subsequent business tasks according to the execution result of the scheduled task, including any of the following:
- the business task is executed, wherein the execution of the business task depends on the execution result of the preceding task.
- the apparatus further comprises:
- the business task execution module is used to execute subsequent business tasks according to the execution results of the scheduled tasks, including:
- Step a acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
- Step b traverse the business tasks in the association condition set
- Step c determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
- Step d remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
- Step e Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
- Step f executing the business tasks in the order of tasks in the task output list.
- An embodiment of the present disclosure further provides a computer program product, comprising computer instructions, which implement the steps of the above method when executed by a processor.
- the scheduled task after receiving the operation instruction for the scheduled task, the scheduled task can be added, deleted or modified in the business system, thereby realizing the dynamic start and stop of the scheduled task, and further realizing the addition of an efficient and flexible business system.
- FIGS 1 and 2 are schematic diagrams of the structure of the task management device disclosed herein;
- FIG3 is a schematic diagram of adding a scheduled task according to an embodiment of the present disclosure.
- FIG4 is a schematic diagram of deleting a scheduled task according to an embodiment of the present disclosure.
- FIG5 is a schematic diagram of changing a scheduled task according to an embodiment of the present disclosure.
- FIG6 is a schematic diagram of a process for executing a scheduled task according to an embodiment of the present disclosure
- 7-9 are schematic diagrams of the execution logic of business tasks according to an embodiment of the present disclosure.
- FIG10 is a schematic diagram of a process for performing task scheduling according to an embodiment of the present disclosure.
- the open source job scheduling framework Quartz can be used for scheduled task management, and job scheduling and task management can be implemented in Java applications.
- problems 1) Complex configuration: The configuration of Quartz is relatively complex, and you need to be familiar with the framework's configuration files and properties, as well as related application programming interfaces (APIs) and concepts. 2) It is impossible to flexibly adjust scheduled tasks according to needs.
- the execution time of scheduled tasks can also be written into the code, that is, the configuration of scheduled tasks is static and cannot be dynamically modified at runtime. If you need to dynamically adjust the execution time or execution cycle of the scheduled task, you need to restart the application.
- the embodiments of the present disclosure provide a task management method and apparatus, and a computer program product, which can realize dynamic start and stop of scheduled tasks.
- the present disclosure provides a task management method, including:
- a target operation is performed on the scheduled task, where the target operation includes at least one of the following:
- the scheduled task after receiving an operation instruction for a scheduled task, the scheduled task can be added, deleted or modified in the business system, thereby realizing dynamic start and stop of the scheduled task, and further realizing the addition of an efficient and flexible business system.
- the task manager can receive operation instructions and add, delete, or modify scheduled tasks according to the operation instructions.
- the task manager can save task information of scheduled tasks, update the execution period of scheduled tasks, start scheduled tasks, and stop scheduled tasks.
- adding a scheduled task in the business system includes:
- the task information of the scheduled task includes but is not limited to the task name, task content, execution time, etc. of the scheduled task.
- the task manager can store the task information and execution cycle of the scheduled task in the database of the business system, and store the scheduled task in the memory of the business system, that is, the Map container, so that the specific logic in the scheduled task can be executed regularly according to the set execution cycle.
- the role of the Map container is to control the dynamic start and stop of the scheduled task under the running state of the business system and modify the execution cycle of the scheduled task.
- deleting a scheduled task in the business system includes:
- all relevant information of the scheduled task in the database of the business system may be deleted, or only the execution status of the scheduled task in the database may be changed.
- modifying a scheduled task in a business system includes:
- Modify the execution period of the scheduled task in the database of the business system or delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system;
- the relevant information of the old scheduled task in the business system database can be deleted and the relevant information of the new scheduled task can be rewritten, or the execution cycle of the scheduled task can be directly changed in the business system database.
- statically configuring a scheduled task if the scheduled task needs to be modified, it is necessary to modify the code and recompile it, which is not flexible enough.
- the scheduled task also needs to be recompiled and deployed before it takes effect, which is slow to take effect.
- statically configuring tasks various abnormal situations need to be considered, making management and maintenance more difficult.
- scheduled tasks can be modified at any time and flexibly according to actual needs. Modifications to scheduled tasks can take effect immediately during operation, which is real-time.
- the technical solution of this embodiment can monitor and manage scheduled tasks during operation, ensuring the stability and reliability of scheduled tasks.
- the method further includes:
- the scheduled task is executed regularly according to the execution cycle of the scheduled task.
- the business system when the business system starts, it first queries whether there is a valid scheduled task in the database. If so, the addCronTask method is executed to write the scheduled task into the memory, and then the scheduled task is executed according to the execution cycle of the scheduled task; if not, the loading is completed directly.
- the visualization screen can communicate with the server through websocket.
- the page of the visualization screen communicates with the server through websocket.
- the scheduled task information of each component in the page can be configured and changed, and the scheduled task can be started; the execution time can be set by the page to perform periodic execution of the scheduled task; when the page is closed, the websocket connection between the page and the server is disconnected, and the scheduled task can be canceled to avoid executing invalid tasks and consuming memory; in this embodiment, the page of the visualization screen supports online modification of scheduled tasks and takes effect immediately.
- Task scheduling is to execute different subsequent business tasks based on the execution results of the scheduled task after the scheduled task is completed.
- Task scheduling can be divided into three types of execution logic, including any of the following:
- the business task is executed, wherein the execution of the business task depends on the execution results of the predecessor tasks.
- Task A and Task B are predecessor tasks of Task C.
- Task C is executed according to the execution results of Task A and Task B;
- task A is executed first. After the completion of task A, task B is triggered to be executed. After the completion of task B, task C is triggered to be executed.
- business task A is a predecessor task of business task C, and the execution of business task C depends on the execution result of business task A.
- business task A is a predecessor task of business task D, and the execution of business task D depends on the execution result of business task A.
- business task D will also change synchronously;
- business task A is a predecessor task of business task G, and the execution of business task G depends on the execution result of business task A.
- business task B is a predecessor task of business task C
- the execution of business task C depends on the execution result of business task B.
- business task D is a predecessor task of business task B.
- the execution of business task B depends on the execution result of business task D.
- business task D is the predecessor task of business task E.
- the execution of business task E depends on the execution result of business task D.
- business task F is the predecessor task of business task E.
- the execution of business task E depends on the execution result of business task F.
- business task G is the predecessor task of business task F.
- the execution of business task F depends on the execution result of business task G.
- business task B is the predecessor task of business task G.
- the execution of business task G depends on the execution result of business task B.
- the execution logic output according to the above association relationship is as follows:
- this embodiment can arrange tasks and implement more complex system functions by scheduling and executing different tasks.
- the method further includes:
- Executing subsequent business tasks according to the execution result of the scheduled task includes:
- Step a acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
- Step b traverse the business tasks in the association condition set
- Step c determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
- Step d remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
- Step e Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
- Step f executing the business tasks in the order of tasks in the task output list.
- business task A is a predecessor task of business task C, and the execution of business task C depends on the execution result of business task A.
- business task A is a predecessor task of business task D, and the execution of business task D depends on the execution result of business task A.
- business task D will also change synchronously;
- business task A is a predecessor task of business task G, and the execution of business task G depends on the execution result of business task A.
- business task B is a predecessor task of business task C
- the execution of business task C depends on the execution result of business task B.
- business task D is a predecessor task of business task B.
- the execution of business task B depends on the execution result of business task D.
- business task D is the predecessor task of business task E.
- the execution of business task E depends on the execution result of business task D.
- business task F is the predecessor task of business task E.
- the execution of business task E depends on the execution result of business task F.
- business task G is the predecessor task of business task F.
- the execution of business task F depends on the execution result of business task G.
- business task B is the predecessor task of business task G.
- the execution of business task G depends on the execution result of business task B.
- the data of business task B changes, the data in business task G will also change synchronously.
- the execution logic output according to the method shown in Figure 10 is as follows: execute business tasks A, D, B, C, G, F, and E in sequence, that is, only a total of 7 executions are required to obtain the required data, that is, one conditional query requires querying the database 7 times.
- the technical solution of this embodiment can also reduce the amount of query data returned.
- the present disclosure also provides a task management device, including:
- the task processor is configured to, in response to an operation instruction for a scheduled task, perform a target operation on the scheduled task, where the target operation includes at least one of the following:
- the scheduled task after receiving an operation instruction for a scheduled task, the scheduled task can be added, deleted or modified in the business system, thereby realizing dynamic start and stop of the scheduled task, and further realizing the addition of an efficient and flexible business system.
- the task manager can receive operation instructions and add, delete, or modify scheduled tasks according to the operation instructions.
- the task manager can save task information of scheduled tasks, update the execution period of scheduled tasks, start scheduled tasks, and stop scheduled tasks.
- the task processor includes:
- the adding unit is used to store the task information and execution cycle of the scheduled task in the database of the business system; and call addCronTask to load the scheduled task into the memory of the business system.
- the task information of the scheduled task includes but is not limited to the task name, task content, execution time, etc. of the scheduled task.
- the task manager can store the task information and execution cycle of the scheduled task in the database of the business system, and store the scheduled task in the memory of the business system, that is, the Map container, so that the specific logic in the scheduled task can be executed regularly according to the set execution cycle.
- the role of the Map container is to control the dynamic start and stop of the scheduled task under the running state of the business system and modify the execution cycle of the scheduled task.
- the task processor includes:
- the deletion unit is used to modify the execution status of the scheduled task in the database of the business system to disabled or invalid; or, delete the task information and execution cycle of the scheduled task in the database of the business system; call cancelCronTask to delete the scheduled task in the memory of the business system.
- all relevant information of the scheduled task in the database of the business system may be deleted, or only the execution status of the scheduled task in the database may be changed.
- the task processor includes:
- a changing unit is used to change the execution period of the scheduled task in the database of the business system; or to delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system; call updateTaskInfo to change the execution period of the scheduled task in the memory of the business system.
- the relevant information of the old scheduled task in the business system database can be deleted and the relevant information of the new scheduled task can be rewritten, or the execution cycle of the scheduled task can be directly changed in the business system database.
- statically configuring a scheduled task if the scheduled task needs to be modified, it is necessary to modify the code and recompile it, which is not flexible enough.
- the scheduled task also needs to be recompiled and deployed before it takes effect, which is slow to take effect.
- statically configuring tasks various abnormal situations need to be considered, making management and maintenance more difficult.
- scheduled tasks can be modified at any time and flexibly according to actual needs. Modifications to scheduled tasks can take effect immediately during operation, which is real-time.
- the technical solution of this embodiment can monitor and manage scheduled tasks during operation, ensuring the stability and reliability of scheduled tasks.
- the apparatus further comprises:
- a query module is used to query whether there is a valid scheduled task in the business system when the business system is started;
- a loading module is used to call addCronTask to load a valid scheduled task into the memory of the business system if there is one;
- the execution module is used to execute the scheduled task regularly according to the execution cycle of the scheduled task.
- the business system when the business system starts, it first queries whether there is a valid scheduled task in the database. If so, the addCronTask method is executed to write the scheduled task into the memory, and then the scheduled task is executed according to the execution cycle of the scheduled task; if not, the loading is completed directly.
- Task scheduling is to execute different subsequent business tasks according to the execution results of the scheduled task after the scheduled task is completed; task scheduling can be divided into three types of execution logic, and the device also includes:
- the business task execution module is used to execute subsequent business tasks according to the execution result of the scheduled task, including any of the following:
- Task A is executed first. After Task A is completed, Task B is triggered. After Task B is completed, Task C is triggered.
- Task A and Task B are predecessor tasks of Task C.
- Task C is executed based on the execution results of Task A and Task B;
- Task A and Task B are predecessor tasks of Task C. After executing Task A or Task B, execute Task C according to the execution result of Task A or Task B.
- this embodiment can arrange tasks and realize more complex system functions by scheduling and executing different tasks.
- the business task execution module is used to execute subsequent business tasks according to the execution results of the scheduled tasks, including:
- Step a acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
- Step b traverse the business tasks in the association condition set
- Step c determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
- Step d remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
- Step e Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
- Step f executing the business tasks in the order of tasks in the task output list.
- An embodiment of the present disclosure further provides a computer program product, comprising computer instructions, which implement the steps of the above method when executed by a processor.
- An embodiment of the present application further provides a computer program/program product, which is stored in a storage medium.
- the computer program/program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
- the computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes a number of instructions for causing a terminal or network-side device to execute the methods described in each embodiment of the present application.
- a storage medium such as ROM, RAM, magnetic disk, optical disk, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请主张在2024年03月13日在中国提交的中国专利申请号No.202410288761.5的优先权,其全部内容通过引用包含于此。This application claims priority to Chinese patent application No. 202410288761.5 filed in China on March 13, 2024, the entire contents of which are incorporated herein by reference.
本公开涉及任务调度技术领域,特别是指一种任务管理方法及装置、计算机程序产品。The present disclosure relates to the technical field of task scheduling, and in particular to a task management method and device, and a computer program product.
定时任务在业务系统中的作用主要是定期自动执行一些重复性的任务,例如数据备份、日志清理、数据同步等,或者根据业务需求定期执行一些特定的操作,例如生成报表、发送邮件、更新数据等,以满足业务需求。定时任务还可以在非高峰期执行一些资源消耗较大的操作,例如数据统计、索引重建等,避免影响业务系统的性能,同时也可以节省成本。Scheduled tasks are primarily used in business systems to automatically execute repetitive tasks, such as data backup, log cleanup, and data synchronization, or to periodically execute specific operations based on business needs, such as generating reports, sending emails, and updating data. Scheduled tasks can also be used to execute resource-intensive operations, such as data statistics and index rebuilds, during off-peak hours, minimizing impact on business system performance and saving costs.
相关技术中,定时任务的相关信息都是在代码中静态配置的,不能动态添加或删除定时任务。In related technologies, the relevant information of scheduled tasks is statically configured in the code, and scheduled tasks cannot be added or deleted dynamically.
本公开要解决的技术问题是提供一种任务管理方法及装置、计算机程序产品,能够实现定时任务的动态启停。The technical problem to be solved by the present disclosure is to provide a task management method and device, and a computer program product, which can realize the dynamic start and stop of scheduled tasks.
为解决上述技术问题,本公开的实施例提供技术方案如下:To solve the above technical problems, the embodiments of the present disclosure provide the following technical solutions:
一方面,提供一种任务管理方法,包括:In one aspect, a task management method is provided, comprising:
响应于针对定时任务的操作指令,对所述定时任务执行目标操作,所述目标操作包括以下至少一项:In response to an operation instruction for a scheduled task, a target operation is performed on the scheduled task, where the target operation includes at least one of the following:
在业务系统中添加定时任务;Add scheduled tasks in the business system;
在业务系统中删除定时任务;Delete scheduled tasks in the business system;
在业务系统中更改定时任务。Modify the scheduled tasks in the business system.
一些实施例中,所述在业务系统中添加定时任务包括:In some embodiments, adding a scheduled task in the business system includes:
将所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;Storing the task information and execution period of the scheduled task in the database of the business system;
调用addCronTask将所述定时任务加载到所述业务系统的内存中。Call addCronTask to load the scheduled task into the memory of the business system.
一些实施例中,所述在业务系统中删除定时任务包括:In some embodiments, deleting a scheduled task in the business system includes:
将所述业务系统的数据库中所述定时任务的执行状态修改为停用或无效;或,删除所述业务系统的数据库中所述定时任务的任务信息和执行周期;Modify the execution status of the scheduled task in the database of the business system to be disabled or invalid; or delete the task information and execution cycle of the scheduled task in the database of the business system;
调用cancelCronTask将所述业务系统的内存中的所述定时任务删除。Call cancelCronTask to delete the scheduled task in the memory of the business system.
一些实施例中,所述在业务系统中更改定时任务包括:In some embodiments, modifying a scheduled task in a business system includes:
对所述业务系统的数据库中所述定时任务的执行周期进行更改;或,对所述业务系统的数据库中所述定时任务的任务信息和执行周期进行删除,并将修改后的所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;Modify the execution period of the scheduled task in the database of the business system; or delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system;
调用updateTaskInfo更改所述业务系统的内存中所述定时任务的执行周期。Call updateTaskInfo to change the execution period of the scheduled task in the memory of the business system.
一些实施例中,对所述定时任务执行目标操作之后,所述方法还包括:In some embodiments, after performing the target operation on the scheduled task, the method further includes:
在所述业务系统启动时,查询所述业务系统中是否存在有效的定时任务;When the business system is started, query whether there is a valid scheduled task in the business system;
若存在有效的定时任务,调用addCronTask将所述有效的定时任务加载到所述业务系统的内存中;If there is a valid scheduled task, call addCronTask to load the valid scheduled task into the memory of the business system;
根据所述定时任务的执行周期定时执行所述定时任务。The scheduled task is executed regularly according to the execution cycle of the scheduled task.
一些实施例中,执行所述定时任务之后,所述方法还包括:In some embodiments, after executing the scheduled task, the method further includes:
根据所述定时任务的执行结果执行后续的业务任务,包括以下任一项:Execute subsequent business tasks based on the execution results of the scheduled task, including any of the following:
按照预设的任务顺序,顺序执行多个所述业务任务;Execute multiple business tasks in sequence according to the preset task order;
在执行完所述业务任务的所有前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果;After all predecessor tasks of the business task are executed, executing the business task, wherein the execution of the business task depends on the execution results of the predecessor tasks;
在执行完所述业务任务的任一前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果。After any preceding task of the business task is executed, the business task is executed, wherein the execution of the business task depends on the execution result of the preceding task.
一些实施例中,执行所述定时任务之后,所述方法还包括:In some embodiments, after executing the scheduled task, the method further includes:
根据所述定时任务的执行结果执行后续的业务任务,包括:Execute subsequent business tasks based on the execution results of the scheduled tasks, including:
步骤a、根据所述业务任务的关联关系条件集合获取所有的后置任务,所述后置任务的执行依赖于所述关联关系条件集合中其他业务任务的执行结果,所述关联关系条件集合包括存在关联关系的多个所述业务任务;Step a: acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
步骤b、遍历所述关联关系条件集合中的业务任务;Step b: traverse the business tasks in the association condition set;
步骤c、判断所述关联关系条件集合中的一业务任务是否包含在所述后置任务中;如果是,转向步骤b,如果不是,转向步骤d;Step c: determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
步骤d、从所述关联关系条件集合中移除该业务任务,将该业务任务保存在任务输出列表中,转向步骤e;Step d: remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
步骤e、判断所述关联关系条件集合是否为空,如果是,转向步骤f,如果不是,转向步骤a;Step e: Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
步骤f、按照所述任务输出列表中的任务顺序执行业务任务。Step f: executing the business tasks in the order of tasks in the task output list.
本公开的实施例还提供了一种任务管理装置,包括:The present disclosure also provides a task management device, including:
任务处理器,用于响应于针对定时任务的操作指令,对所述定时任务执行目标操作,所述目标操作包括以下至少一项:The task processor is configured to, in response to an operation instruction for a scheduled task, perform a target operation on the scheduled task, where the target operation includes at least one of the following:
在业务系统中添加定时任务;Add scheduled tasks in the business system;
在业务系统中删除定时任务;Delete scheduled tasks in the business system;
在业务系统中更改定时任务。Modify the scheduled tasks in the business system.
一些实施例中,所述任务处理器包括:In some embodiments, the task processor includes:
添加单元,用于将所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;调用addCronTask将所述定时任务加载到所述业务系统的内存中。The adding unit is used to store the task information and execution cycle of the scheduled task in the database of the business system; and call addCronTask to load the scheduled task into the memory of the business system.
一些实施例中,所述任务处理器包括:In some embodiments, the task processor includes:
删除单元,用于将所述业务系统的数据库中所述定时任务的执行状态修改为停用或无效;或,删除所述业务系统的数据库中所述定时任务的任务信息和执行周期;调用cancelCronTask将所述业务系统的内存中的所述定时任务删除。The deletion unit is used to modify the execution status of the scheduled task in the database of the business system to disabled or invalid; or, delete the task information and execution cycle of the scheduled task in the database of the business system; call cancelCronTask to delete the scheduled task in the memory of the business system.
一些实施例中,所述任务处理器包括:In some embodiments, the task processor includes:
更改单元,用于对所述业务系统的数据库中所述定时任务的执行周期进行更改;或,对所述业务系统的数据库中所述定时任务的任务信息和执行周期进行删除,并将修改后的所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;调用updateTaskInfo更改所述业务系统的内存中所述定时任务的执行周期。A changing unit is used to change the execution period of the scheduled task in the database of the business system; or to delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system; call updateTaskInfo to change the execution period of the scheduled task in the memory of the business system.
一些实施例中,所述装置还包括:In some embodiments, the apparatus further comprises:
查询模块,用于在所述业务系统启动时,查询所述业务系统中是否存在有效的定时任务;A query module is used to query whether there is a valid scheduled task in the business system when the business system is started;
加载模块,用于若存在有效的定时任务,调用addCronTask将所述有效的定时任务加载到所述业务系统的内存中;A loading module is used to call addCronTask to load a valid scheduled task into the memory of the business system if there is one;
执行模块,用于根据所述定时任务的执行周期定时执行所述定时任务。The execution module is used to execute the scheduled task regularly according to the execution cycle of the scheduled task.
一些实施例中,所述装置还包括:In some embodiments, the apparatus further comprises:
业务任务执行模块,用于根据所述定时任务的执行结果执行后续的业务任务,包括以下任一项:The business task execution module is used to execute subsequent business tasks according to the execution result of the scheduled task, including any of the following:
按照预设的任务顺序,顺序执行多个所述业务任务;Execute multiple business tasks in sequence according to the preset task order;
在执行完所述业务任务的所有前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果;After all predecessor tasks of the business task are executed, executing the business task, wherein the execution of the business task depends on the execution results of the predecessor tasks;
在执行完所述业务任务的任一前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果。After any preceding task of the business task is executed, the business task is executed, wherein the execution of the business task depends on the execution result of the preceding task.
一些实施例中,所述装置还包括:In some embodiments, the apparatus further comprises:
业务任务执行模块,用于根据所述定时任务的执行结果执行后续的业务任务,包括:The business task execution module is used to execute subsequent business tasks according to the execution results of the scheduled tasks, including:
步骤a、根据所述业务任务的关联关系条件集合获取所有的后置任务,所述后置任务的执行依赖于所述关联关系条件集合中其他业务任务的执行结果,所述关联关系条件集合包括存在关联关系的多个所述业务任务;Step a: acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
步骤b、遍历所述关联关系条件集合中的业务任务;Step b: traverse the business tasks in the association condition set;
步骤c、判断所述关联关系条件集合中的一业务任务是否包含在所述后置任务中;如果是,转向步骤b,如果不是,转向步骤d;Step c: determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
步骤d、从所述关联关系条件集合中移除该业务任务,将该业务任务保存在任务输出列表中,转向步骤e;Step d: remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
步骤e、判断所述关联关系条件集合是否为空,如果是,转向步骤f,如果不是,转向步骤a;Step e: Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
步骤f、按照所述任务输出列表中的任务顺序执行业务任务。Step f: executing the business tasks in the order of tasks in the task output list.
本公开的实施例还提供了一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行时实现如上所述的方法的步骤。An embodiment of the present disclosure further provides a computer program product, comprising computer instructions, which implement the steps of the above method when executed by a processor.
本公开的实施例具有以下有益效果:The embodiments of the present disclosure have the following beneficial effects:
上述方案中,在接收到针对定时任务的操作指令后,能够在业务系统中添加、删除或者更改定时任务,从而实现定时任务的动态启停,进而实现增加高效、灵活的业务系统。In the above solution, after receiving the operation instruction for the scheduled task, the scheduled task can be added, deleted or modified in the business system, thereby realizing the dynamic start and stop of the scheduled task, and further realizing the addition of an efficient and flexible business system.
图1和图2为本公开任务管理装置的结构示意图;Figures 1 and 2 are schematic diagrams of the structure of the task management device disclosed herein;
图3为本公开实施例添加定时任务的示意图;FIG3 is a schematic diagram of adding a scheduled task according to an embodiment of the present disclosure;
图4为本公开实施例删除定时任务的示意图;FIG4 is a schematic diagram of deleting a scheduled task according to an embodiment of the present disclosure;
图5为本公开实施例更改定时任务的示意图;FIG5 is a schematic diagram of changing a scheduled task according to an embodiment of the present disclosure;
图6为本公开实施例执行定时任务的流程示意图;FIG6 is a schematic diagram of a process for executing a scheduled task according to an embodiment of the present disclosure;
图7-图9为本公开实施例业务任务的执行逻辑示意图;7-9 are schematic diagrams of the execution logic of business tasks according to an embodiment of the present disclosure;
图10为本公开实施例进行任务编排的流程示意图。FIG10 is a schematic diagram of a process for performing task scheduling according to an embodiment of the present disclosure.
为使本公开的实施例要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。In order to make the technical problems, technical solutions and advantages to be solved by the embodiments of the present disclosure more clear, they will be described in detail below with reference to the accompanying drawings and specific embodiments.
相关技术中,可以利用开源的作业调度框架Quartz做定时任务管理,在Java应用程序中实现作业调度和任务管理。但存在以下问题:1)、配置复杂:Quartz的配置相对复杂,需要熟悉框架的配置文件和属性,以及相关的应用程序编程接口(Application Programming Interface,API)和概念。2)、无法灵活地根据需求调整定时任务。另外,还可以将定时任务执行时间写到代码中,即定时任务的配置是静态的,无法在运行时动态修改,如果需要动态调整定时任务的执行时间或执行周期,需要重新启动应用程序。In related technologies, the open source job scheduling framework Quartz can be used for scheduled task management, and job scheduling and task management can be implemented in Java applications. However, there are the following problems: 1) Complex configuration: The configuration of Quartz is relatively complex, and you need to be familiar with the framework's configuration files and properties, as well as related application programming interfaces (APIs) and concepts. 2) It is impossible to flexibly adjust scheduled tasks according to needs. In addition, the execution time of scheduled tasks can also be written into the code, that is, the configuration of scheduled tasks is static and cannot be dynamically modified at runtime. If you need to dynamically adjust the execution time or execution cycle of the scheduled task, you need to restart the application.
本公开实施例是提供一种任务管理方法及装置、计算机程序产品,能够实现定时任务的动态启停。The embodiments of the present disclosure provide a task management method and apparatus, and a computer program product, which can realize dynamic start and stop of scheduled tasks.
本公开实施例提供一种任务管理方法,包括:The present disclosure provides a task management method, including:
响应于针对定时任务的操作指令,对所述定时任务执行目标操作,所述目标操作包括以下至少一项:In response to an operation instruction for a scheduled task, a target operation is performed on the scheduled task, where the target operation includes at least one of the following:
在业务系统中添加定时任务;Add scheduled tasks in the business system;
在业务系统中删除定时任务;Delete scheduled tasks in the business system;
在业务系统中更改定时任务。Modify the scheduled tasks in the business system.
本实施例中,在接收到针对定时任务的操作指令后,能够在业务系统中添加、删除或者更改定时任务,从而实现定时任务的动态启停,进而实现增加高效、灵活的业务系统。In this embodiment, after receiving an operation instruction for a scheduled task, the scheduled task can be added, deleted or modified in the business system, thereby realizing dynamic start and stop of the scheduled task, and further realizing the addition of an efficient and flexible business system.
本实施例中,如图1和图2所示,可以由任务管理器接收操作指令,并根据操作指令对定时任务进行添加、删除或者更改。任务管理器可以保存定时任务的任务信息、更新定时任务的执行周期、启动定时任务以及停止定时任务。In this embodiment, as shown in Figures 1 and 2, the task manager can receive operation instructions and add, delete, or modify scheduled tasks according to the operation instructions. The task manager can save task information of scheduled tasks, update the execution period of scheduled tasks, start scheduled tasks, and stop scheduled tasks.
一些实施例中,如图3所示,所述在业务系统中添加定时任务包括:In some embodiments, as shown in FIG3 , adding a scheduled task in the business system includes:
将所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;Storing the task information and execution period of the scheduled task in the database of the business system;
调用addCronTask将所述定时任务加载到所述业务系统的内存中。Call addCronTask to load the scheduled task into the memory of the business system.
其中,定时任务的任务信息包括但不限于定时任务的任务名称、任务内容、执行时间等,任务管理器可以将定时任务的任务信息和执行周期存储在所述业务系统的数据库中,并将定时任务存放在业务系统的内存即Map容器中,即可根据设置的执行周期去定时执行该定时任务中的具体逻辑,其中,Map容器的作用是用来控制业务系统运行状态下的定时任务的动态启停以及修改定时任务的执行周期。Among them, the task information of the scheduled task includes but is not limited to the task name, task content, execution time, etc. of the scheduled task. The task manager can store the task information and execution cycle of the scheduled task in the database of the business system, and store the scheduled task in the memory of the business system, that is, the Map container, so that the specific logic in the scheduled task can be executed regularly according to the set execution cycle. Among them, the role of the Map container is to control the dynamic start and stop of the scheduled task under the running state of the business system and modify the execution cycle of the scheduled task.
在添加定时任务时,可以先根据定时任务的任务名称在业务系统的数据库中进行检索,判断数据库中是否已经存在该定时任务的任务名称,如果已经存在该定时任务的任务名称,返回错误提醒。如果数据库中不存在该定时任务的任务名称,则将该定时任务的任务名称、执行时间、执行周期等信息存储在数据库中,并加载在Map容器中。When adding a scheduled task, you can first search the business system database based on the scheduled task name to determine whether the scheduled task name already exists in the database. If the scheduled task name already exists, an error message will be returned. If the scheduled task name does not exist in the database, the scheduled task name, execution time, execution cycle and other information will be stored in the database and loaded into the Map container.
相关技术中,在静态配置定时任务后,需要添加定时任务时,需要在代码中进行修改并重新编译,不够灵活;在静态配置任务时,需要考虑各种异常情况,管理和维护难度较大。本实施例中,可以根据实际需求随时、灵活地进行定时任务的添加;并且定时任务的添加可以在运行过程中立即生效,具有实时性;通过本实施例的技术方案可以在运行过程中对定时任务进行监控和管理,保证定时任务的稳定性和可靠性。In related technologies, after statically configuring scheduled tasks, adding scheduled tasks requires code modifications and recompilation, which is inflexible. Static configuration also requires consideration of various exceptions, making management and maintenance difficult. In this embodiment, scheduled tasks can be added flexibly and at any time based on actual needs. Furthermore, added scheduled tasks can take effect immediately during operation, providing real-time performance. The technical solution of this embodiment allows scheduled tasks to be monitored and managed during operation, ensuring their stability and reliability.
一些实施例中,如图4所示,所述在业务系统中删除定时任务包括:In some embodiments, as shown in FIG4 , deleting a scheduled task in the business system includes:
将所述业务系统的数据库中所述定时任务的执行状态修改为停用或无效;或,删除所述业务系统的数据库中所述定时任务的任务信息和执行周期;Modify the execution status of the scheduled task in the database of the business system to be disabled or invalid; or delete the task information and execution cycle of the scheduled task in the database of the business system;
调用cancelCronTask将所述业务系统的内存中的所述定时任务删除。Call cancelCronTask to delete the scheduled task in the memory of the business system.
本实施例中,在删除定时任务时,可以将业务系统的数据库中定时任务的相关信息都删除,也可以仅更改数据库中定时任务的执行状态。In this embodiment, when deleting a scheduled task, all relevant information of the scheduled task in the database of the business system may be deleted, or only the execution status of the scheduled task in the database may be changed.
相关技术中,在静态配置定时任务后,需要删除定时任务时,需要在代码中进行修改并重新编译,不够灵活;在静态配置任务时,需要考虑各种异常情况,管理和维护难度较大。本实施例中,可以根据实际需求随时、灵活地进行定时任务的删除;并且定时任务的删除可以在运行过程中立即生效,具有实时性;通过本实施例的技术方案可以在运行过程中对定时任务进行监控和管理,保证定时任务的稳定性和可靠性。In related technologies, after statically configuring a scheduled task, deleting it requires code modification and recompilation, which is inflexible. Static configuration also requires consideration of various exceptions, making management and maintenance difficult. In this embodiment, scheduled tasks can be deleted flexibly and at any time based on actual needs. Furthermore, deletion of a scheduled task takes effect immediately during operation, providing real-time performance. The technical solution of this embodiment allows for monitoring and management of scheduled tasks during operation, ensuring their stability and reliability.
一些实施例中,如图5所示,所述在业务系统中更改定时任务包括:In some embodiments, as shown in FIG5 , modifying a scheduled task in a business system includes:
对所述业务系统的数据库中所述定时任务的执行周期进行更改;或,对所述业务系统的数据库中所述定时任务的任务信息和执行周期进行删除,并将修改后的所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;Modify the execution period of the scheduled task in the database of the business system; or delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system;
调用updateTaskInfo更改所述业务系统的内存中所述定时任务的执行周期。Call updateTaskInfo to change the execution period of the scheduled task in the memory of the business system.
本实施例中,在对定时任务进行修改时,可以将业务系统的数据库中旧的定时任务的相关信息进行删除,再重新写入新的定时任务的相关信息,也可以直接在业务系统的数据库中更改定时任务的执行周期。In this embodiment, when modifying a scheduled task, the relevant information of the old scheduled task in the business system database can be deleted and the relevant information of the new scheduled task can be rewritten, or the execution cycle of the scheduled task can be directly changed in the business system database.
相关技术中,在静态配置定时任务后,需要修改定时任务时,需要在代码中进行修改并重新编译,不够灵活;并且定时任务需要重新编译和部署后才能生效,生效较慢;在静态配置任务时,需要考虑各种异常情况,管理和维护难度较大。本实施例中,可以根据实际需求随时、灵活地进行定时任务的修改;并且定时任务的修改可以在运行过程中立即生效,具有实时性;通过本实施例的技术方案可以在运行过程中对定时任务进行监控和管理,保证定时任务的稳定性和可靠性。In related technologies, after statically configuring a scheduled task, if the scheduled task needs to be modified, it is necessary to modify the code and recompile it, which is not flexible enough. The scheduled task also needs to be recompiled and deployed before it takes effect, which is slow to take effect. When statically configuring tasks, various abnormal situations need to be considered, making management and maintenance more difficult. In this embodiment, scheduled tasks can be modified at any time and flexibly according to actual needs. Modifications to scheduled tasks can take effect immediately during operation, which is real-time. The technical solution of this embodiment can monitor and manage scheduled tasks during operation, ensuring the stability and reliability of scheduled tasks.
一些实施例中,如图6所示,对所述定时任务执行目标操作之后,所述方法还包括:In some embodiments, as shown in FIG6 , after executing the target operation on the scheduled task, the method further includes:
在所述业务系统启动时,查询所述业务系统中是否存在有效的定时任务;When the business system is started, query whether there is a valid scheduled task in the business system;
若存在有效的定时任务,调用addCronTask将所述有效的定时任务加载到所述业务系统的内存中;If there is a valid scheduled task, call addCronTask to load the valid scheduled task into the memory of the business system;
根据所述定时任务的执行周期定时执行所述定时任务。The scheduled task is executed regularly according to the execution cycle of the scheduled task.
本实施例中,在业务系统启动时先去查询数据库中是否存在有效的定时任务,如若存在则执行addCronTask方法将定时任务写进内存中,然后根据定时任务的执行周期执行定时任务;如若不存在则直接加载结束。In this embodiment, when the business system starts, it first queries whether there is a valid scheduled task in the database. If so, the addCronTask method is executed to write the scheduled task into the memory, and then the scheduled task is executed according to the execution cycle of the scheduled task; if not, the loading is completed directly.
一具体示例中,可以通过可视化大屏与服务端通过websocket进行通信,在可视化大屏处于打开状态时,可视化大屏的页面即与服务端通过websocket进行通信,可以根据可视化大屏的配置页面,对页面中各个组件的定时任务信息进行配置和更改,并启动定时任务;通过页面设置执行时间,可以进行定时任务的周期执行;当页面关闭时,页面与服务端之间断开websocket连接,即可取消定时任务,避免执行无效任务消耗内存;本实施例中,通过可视化大屏的页面,支持定时任务的在线修改并立即生效。In a specific example, the visualization screen can communicate with the server through websocket. When the visualization screen is open, the page of the visualization screen communicates with the server through websocket. According to the configuration page of the visualization screen, the scheduled task information of each component in the page can be configured and changed, and the scheduled task can be started; the execution time can be set by the page to perform periodic execution of the scheduled task; when the page is closed, the websocket connection between the page and the server is disconnected, and the scheduled task can be canceled to avoid executing invalid tasks and consuming memory; in this embodiment, the page of the visualization screen supports online modification of scheduled tasks and takes effect immediately.
在执行定时任务后,本实施例的技术方案还可以进行任务编排。任务编排是在定时任务执行完毕后,根据定时任务的执行结果去执行不同的后续的业务任务;任务编排可以分为三类执行逻辑,包括以下任一项:After executing a scheduled task, the technical solution of this embodiment can also perform task scheduling. Task scheduling is to execute different subsequent business tasks based on the execution results of the scheduled task after the scheduled task is completed. Task scheduling can be divided into three types of execution logic, including any of the following:
在执行完所述业务任务的所有前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果,如图7所示,任务A和任务B为任务C的前置任务,则在执行完任务A和任务B后,根据任务A和任务B的执行结果执行任务C;After all predecessor tasks of the business task are executed, the business task is executed, wherein the execution of the business task depends on the execution results of the predecessor tasks. As shown in Figure 7, Task A and Task B are predecessor tasks of Task C. After Task A and Task B are executed, Task C is executed according to the execution results of Task A and Task B;
在执行完所述业务任务的任一前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果,如图8所示,任务A和任务B为任务C的前置任务,则在执行完任务A或任务B后,根据任务A或任务B的执行结果执行任务C;After completing any of the predecessor tasks of the business task, execute the business task, where the execution of the business task depends on the execution result of the predecessor task. For example, as shown in FIG8 , if Task A and Task B are predecessor tasks of Task C, then after completing Task A or Task B, execute Task C based on the execution result of Task A or Task B.
按照预设的任务顺序,顺序执行多个所述业务任务,所有业务任务的执行都依赖于前一个业务任务执行完毕才开始执行,如图9所示,先执行任务A,任务A执行完毕后触发执行任务B,任务B执行完毕后触发执行任务C。According to the preset task order, multiple business tasks are executed sequentially. The execution of all business tasks depends on the completion of the previous business task. As shown in Figure 9, task A is executed first. After the completion of task A, task B is triggered to be executed. After the completion of task B, task C is triggered to be executed.
一具体示例中,作为条件数据的业务任务A、B、C、D、E、F、G之间存在关联关系:业务任务A为业务任务C的前置任务,业务任务C的执行依赖于业务任务A的执行结果,当业务任务A的数据变化时,业务任务C中的数据也会同步变化;业务任务A为业务任务D的前置任务,业务任务D的执行依赖于业务任务A的执行结果,当业务任务A的数据变化时,业务任务D中的数据也会同步变化;业务任务A为业务任务G的前置任务,业务任务G的执行依赖于业务任务A的执行结果,当业务任务A的数据变化时,业务任务G中的数据也会同步变化;业务任务B为业务任务C的前置任务,业务任务C的执行依赖于业务任务B的执行结果,当业务任务B的数据变化时,业务任务C中的数据也会同步变化;业务任务D为业务任务B的前置任务,业务任务B的执行依赖于业务任务D的执行结果,当业务任务D的数据变化时,业务任务B中的数据也会同步变化;业务任务D为业务任务E的前置任务,业务任务E的执行依赖于业务任务D的执行结果,当业务任务D的数据变化时,业务任务E中的数据也会同步变化;业务任务F为业务任务E的前置任务,业务任务E的执行依赖于业务任务F的执行结果,当业务任务F的数据变化时,业务任务E中的数据也会同步变化;业务任务G为业务任务F的前置任务,业务任务F的执行依赖于业务任务G的执行结果,当业务任务G的数据变化时,业务任务F中的数据也会同步变化;业务任务B为业务任务G的前置任务,业务任务G的执行依赖于业务任务B的执行结果,当业务任务B的数据变化时,业务任务G中的数据也会同步变化。现有技术中,按照上述关联关系输出的执行逻辑如下:In a specific example, there is an association relationship between business tasks A, B, C, D, E, F, and G as conditional data: business task A is a predecessor task of business task C, and the execution of business task C depends on the execution result of business task A. When the data of business task A changes, the data in business task C will also change synchronously; business task A is a predecessor task of business task D, and the execution of business task D depends on the execution result of business task A. When the data of business task A changes, the data in business task D will also change synchronously; business task A is a predecessor task of business task G, and the execution of business task G depends on the execution result of business task A. When the data of business task A changes, the data in business task G will also change synchronously; business task B is a predecessor task of business task C, and the execution of business task C depends on the execution result of business task B. When the data of business task B changes, the data in business task C will also change synchronously; business task D is a predecessor task of business task B. Tasks, the execution of business task B depends on the execution result of business task D. When the data of business task D changes, the data in business task B will also change synchronously; business task D is the predecessor task of business task E. The execution of business task E depends on the execution result of business task D. When the data of business task D changes, the data in business task E will also change synchronously; business task F is the predecessor task of business task E. The execution of business task E depends on the execution result of business task F. When the data of business task F changes, the data in business task E will also change synchronously; business task G is the predecessor task of business task F. The execution of business task F depends on the execution result of business task G. When the data of business task G changes, the data in business task F will also change synchronously; business task B is the predecessor task of business task G. The execution of business task G depends on the execution result of business task B. When the data of business task B changes, the data in business task G will also change synchronously. In the prior art, the execution logic output according to the above association relationship is as follows:
执行前置任务A,执行业务任务C;Execute pre-task A and business task C;
执行前置任务A,执行业务任务D;Execute pre-task A and business task D;
执行前置任务D,执行业务任务B;Execute pre-task D and business task B;
执行前置任务B,执行业务任务C;Execute pre-task B and business task C;
执行前置任务B,执行业务任务G;Execute the pre-task B and the business task G;
执行前置任务G,执行业务任务F;Execute the pre-task G and the business task F;
执行前置任务F,执行业务任务E;Execute pre-task F and business task E;
执行前置任务D,执行业务任务E;Execute pre-task D and business task E;
执行前置任务A,执行业务任务G;Execute pre-task A and business task G;
执行前置任务G,执行业务任务F;Execute the pre-task G and the business task F;
执行前置任务F,执行业务任务E;Execute pre-task F and business task E;
执行前置任务B,执行业务任务C;Execute pre-task B and business task C;
执行前置任务B,执行业务任务G;Execute the pre-task B and the business task G;
执行前置任务G,执行业务任务F;Execute the pre-task G and the business task F;
执行前置任务F,执行业务任务E;Execute pre-task F and business task E;
执行前置任务D,执行业务任务B;Execute pre-task D and business task B;
执行前置任务B,执行业务任务C;Execute pre-task B and business task C;
执行前置任务B,执行业务任务G;Execute the pre-task B and the business task G;
执行前置任务G,执行业务任务F;Execute the pre-task G and the business task F;
执行前置任务F,执行业务任务E;Execute pre-task F and business task E;
执行前置任务D,执行业务任务E;Execute pre-task D and business task E;
执行前置任务F,执行业务任务E;Execute pre-task F and business task E;
执行前置任务G,执行业务任务F;Execute the pre-task G and the business task F;
执行前置任务F,执行业务任务E。Execute the prerequisite task F and the business task E.
从执行结果来看共计需执行24次,即一次条件查询需查询数据库24次,任务执行的效率较低,占用的资源较多。为了节省资源,提高任务执行的效率,本实施例可以对任务进行编排,通过对不同任务的调度和执行,实现更加复杂的系统功能。From the execution results, it can be seen that a total of 24 executions are required, that is, one conditional query requires querying the database 24 times, which is inefficient and consumes a lot of resources. To save resources and improve the efficiency of task execution, this embodiment can arrange tasks and implement more complex system functions by scheduling and executing different tasks.
一些实施例中,执行所述定时任务之后,所述方法还包括:In some embodiments, after executing the scheduled task, the method further includes:
根据所述定时任务的执行结果执行后续的业务任务,如图10所示,包括:Executing subsequent business tasks according to the execution result of the scheduled task, as shown in FIG10 , includes:
步骤a、根据所述业务任务的关联关系条件集合获取所有的后置任务,所述后置任务的执行依赖于所述关联关系条件集合中其他业务任务的执行结果,所述关联关系条件集合包括存在关联关系的多个所述业务任务;Step a: acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
步骤b、遍历所述关联关系条件集合中的业务任务;Step b: traverse the business tasks in the association condition set;
步骤c、判断所述关联关系条件集合中的一业务任务是否包含在所述后置任务中;如果是,转向步骤b,如果不是,转向步骤d;Step c: determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
步骤d、从所述关联关系条件集合中移除该业务任务,将该业务任务保存在任务输出列表中,转向步骤e;Step d: remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
步骤e、判断所述关联关系条件集合是否为空,如果是,转向步骤f,如果不是,转向步骤a;Step e: Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
步骤f、按照所述任务输出列表中的任务顺序执行业务任务。Step f: executing the business tasks in the order of tasks in the task output list.
一具体示例中,作为条件数据的业务任务A、B、C、D、E、F、G之间存在关联关系:业务任务A为业务任务C的前置任务,业务任务C的执行依赖于业务任务A的执行结果,当业务任务A的数据变化时,业务任务C中的数据也会同步变化;业务任务A为业务任务D的前置任务,业务任务D的执行依赖于业务任务A的执行结果,当业务任务A的数据变化时,业务任务D中的数据也会同步变化;业务任务A为业务任务G的前置任务,业务任务G的执行依赖于业务任务A的执行结果,当业务任务A的数据变化时,业务任务G中的数据也会同步变化;业务任务B为业务任务C的前置任务,业务任务C的执行依赖于业务任务B的执行结果,当业务任务B的数据变化时,业务任务C中的数据也会同步变化;业务任务D为业务任务B的前置任务,业务任务B的执行依赖于业务任务D的执行结果,当业务任务D的数据变化时,业务任务B中的数据也会同步变化;业务任务D为业务任务E的前置任务,业务任务E的执行依赖于业务任务D的执行结果,当业务任务D的数据变化时,业务任务E中的数据也会同步变化;业务任务F为业务任务E的前置任务,业务任务E的执行依赖于业务任务F的执行结果,当业务任务F的数据变化时,业务任务E中的数据也会同步变化;业务任务G为业务任务F的前置任务,业务任务F的执行依赖于业务任务G的执行结果,当业务任务G的数据变化时,业务任务F中的数据也会同步变化;业务任务B为业务任务G的前置任务,业务任务G的执行依赖于业务任务B的执行结果,当业务任务B的数据变化时,业务任务G中的数据也会同步变化。In a specific example, there is an association relationship between business tasks A, B, C, D, E, F, and G as conditional data: business task A is a predecessor task of business task C, and the execution of business task C depends on the execution result of business task A. When the data of business task A changes, the data in business task C will also change synchronously; business task A is a predecessor task of business task D, and the execution of business task D depends on the execution result of business task A. When the data of business task A changes, the data in business task D will also change synchronously; business task A is a predecessor task of business task G, and the execution of business task G depends on the execution result of business task A. When the data of business task A changes, the data in business task G will also change synchronously; business task B is a predecessor task of business task C, and the execution of business task C depends on the execution result of business task B. When the data of business task B changes, the data in business task C will also change synchronously; business task D is a predecessor task of business task B. Tasks, the execution of business task B depends on the execution result of business task D. When the data of business task D changes, the data in business task B will also change synchronously; business task D is the predecessor task of business task E. The execution of business task E depends on the execution result of business task D. When the data of business task D changes, the data in business task E will also change synchronously; business task F is the predecessor task of business task E. The execution of business task E depends on the execution result of business task F. When the data of business task F changes, the data in business task E will also change synchronously; business task G is the predecessor task of business task F. The execution of business task F depends on the execution result of business task G. When the data of business task G changes, the data in business task F will also change synchronously; business task B is the predecessor task of business task G. The execution of business task G depends on the execution result of business task B. When the data of business task B changes, the data in business task G will also change synchronously.
本实施例中,依照图10所示的方法输出的执行逻辑如下:依次执行业务任务A、D、B、C、G、F、E,即共计只需执行7次即可获取所需数据,即一次条件查询需查询数据库7次。In this embodiment, the execution logic output according to the method shown in Figure 10 is as follows: execute business tasks A, D, B, C, G, F, and E in sequence, that is, only a total of 7 executions are required to obtain the required data, that is, one conditional query requires querying the database 7 times.
在百万级数据量下,采用相关技术获取所需数据需要耗时大概15s,采用本实施例的技术方案获取所需数据需要耗时大概4s,大大提高了任务执行的效率,另外,通过本实施例的技术方案还可以减少查询数据的量级返回。With a data volume of millions, it takes about 15 seconds to obtain the required data using related technologies, while it takes about 4 seconds to obtain the required data using the technical solution of this embodiment, which greatly improves the efficiency of task execution. In addition, the technical solution of this embodiment can also reduce the amount of query data returned.
本公开的实施例还提供了一种任务管理装置,包括:The present disclosure also provides a task management device, including:
任务处理器,用于响应于针对定时任务的操作指令,对所述定时任务执行目标操作,所述目标操作包括以下至少一项:The task processor is configured to, in response to an operation instruction for a scheduled task, perform a target operation on the scheduled task, where the target operation includes at least one of the following:
在业务系统中添加定时任务;Add scheduled tasks in the business system;
在业务系统中删除定时任务;Delete scheduled tasks in the business system;
在业务系统中更改定时任务。Modify the scheduled tasks in the business system.
本实施例中,在接收到针对定时任务的操作指令后,能够在业务系统中添加、删除或者更改定时任务,从而实现定时任务的动态启停,进而实现增加高效、灵活的业务系统。In this embodiment, after receiving an operation instruction for a scheduled task, the scheduled task can be added, deleted or modified in the business system, thereby realizing dynamic start and stop of the scheduled task, and further realizing the addition of an efficient and flexible business system.
本实施例中,如图1和图2所示,可以由任务管理器接收操作指令,并根据操作指令对定时任务进行添加、删除或者更改。任务管理器可以保存定时任务的任务信息、更新定时任务的执行周期、启动定时任务以及停止定时任务。In this embodiment, as shown in Figures 1 and 2, the task manager can receive operation instructions and add, delete, or modify scheduled tasks according to the operation instructions. The task manager can save task information of scheduled tasks, update the execution period of scheduled tasks, start scheduled tasks, and stop scheduled tasks.
一些实施例中,所述任务处理器包括:In some embodiments, the task processor includes:
添加单元,用于将所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;调用addCronTask将所述定时任务加载到所述业务系统的内存中。The adding unit is used to store the task information and execution cycle of the scheduled task in the database of the business system; and call addCronTask to load the scheduled task into the memory of the business system.
其中,定时任务的任务信息包括但不限于定时任务的任务名称、任务内容、执行时间等,任务管理器可以将定时任务的任务信息和执行周期存储在所述业务系统的数据库中,并将定时任务存放在业务系统的内存即Map容器中,即可根据设置的执行周期去定时执行该定时任务中的具体逻辑,其中,Map容器的作用是用来控制业务系统运行状态下的定时任务的动态启停以及修改定时任务的执行周期。Among them, the task information of the scheduled task includes but is not limited to the task name, task content, execution time, etc. of the scheduled task. The task manager can store the task information and execution cycle of the scheduled task in the database of the business system, and store the scheduled task in the memory of the business system, that is, the Map container, so that the specific logic in the scheduled task can be executed regularly according to the set execution cycle. Among them, the role of the Map container is to control the dynamic start and stop of the scheduled task under the running state of the business system and modify the execution cycle of the scheduled task.
在添加定时任务时,可以先根据定时任务的任务名称在业务系统的数据库中进行检索,判断数据库中是否已经存在该定时任务的任务名称,如果已经存在该定时任务的任务名称,返回错误提醒。如果数据库中不存在该定时任务的任务名称,则将该定时任务的任务名称、执行时间、执行周期等信息存储在数据库中,并加载在Map容器中。When adding a scheduled task, you can first search the business system database based on the scheduled task name to determine whether the scheduled task name already exists in the database. If the scheduled task name already exists, an error message will be returned. If the scheduled task name does not exist in the database, the scheduled task name, execution time, execution cycle and other information will be stored in the database and loaded into the Map container.
相关技术中,在静态配置定时任务后,需要添加定时任务时,需要在代码中进行修改并重新编译,不够灵活;在静态配置任务时,需要考虑各种异常情况,管理和维护难度较大。本实施例中,可以根据实际需求随时、灵活地进行定时任务的添加;并且定时任务的添加可以在运行过程中立即生效,具有实时性;通过本实施例的技术方案可以在运行过程中对定时任务进行监控和管理,保证定时任务的稳定性和可靠性。In related technologies, after statically configuring scheduled tasks, adding scheduled tasks requires code modifications and recompilation, which is inflexible. Static configuration also requires consideration of various exceptions, making management and maintenance difficult. In this embodiment, scheduled tasks can be added flexibly and at any time based on actual needs. Furthermore, added scheduled tasks can take effect immediately during operation, providing real-time performance. The technical solution of this embodiment allows scheduled tasks to be monitored and managed during operation, ensuring their stability and reliability.
一些实施例中,所述任务处理器包括:In some embodiments, the task processor includes:
删除单元,用于将所述业务系统的数据库中所述定时任务的执行状态修改为停用或无效;或,删除所述业务系统的数据库中所述定时任务的任务信息和执行周期;调用cancelCronTask将所述业务系统的内存中的所述定时任务删除。The deletion unit is used to modify the execution status of the scheduled task in the database of the business system to disabled or invalid; or, delete the task information and execution cycle of the scheduled task in the database of the business system; call cancelCronTask to delete the scheduled task in the memory of the business system.
本实施例中,在删除定时任务时,可以将业务系统的数据库中定时任务的相关信息都删除,也可以仅更改数据库中定时任务的执行状态。In this embodiment, when deleting a scheduled task, all relevant information of the scheduled task in the database of the business system may be deleted, or only the execution status of the scheduled task in the database may be changed.
相关技术中,在静态配置定时任务后,需要删除定时任务时,需要在代码中进行修改并重新编译,不够灵活;在静态配置任务时,需要考虑各种异常情况,管理和维护难度较大。本实施例中,可以根据实际需求随时、灵活地进行定时任务的删除;并且定时任务的删除可以在运行过程中立即生效,具有实时性;通过本实施例的技术方案可以在运行过程中对定时任务进行监控和管理,保证定时任务的稳定性和可靠性。In related technologies, after statically configuring a scheduled task, deleting it requires code modification and recompilation, which is inflexible. Static configuration also requires consideration of various exceptions, making management and maintenance difficult. In this embodiment, scheduled tasks can be deleted flexibly and at any time based on actual needs. Furthermore, deletion of a scheduled task takes effect immediately during operation, providing real-time performance. The technical solution of this embodiment allows for monitoring and management of scheduled tasks during operation, ensuring their stability and reliability.
一些实施例中,所述任务处理器包括:In some embodiments, the task processor includes:
更改单元,用于对所述业务系统的数据库中所述定时任务的执行周期进行更改;或,对所述业务系统的数据库中所述定时任务的任务信息和执行周期进行删除,并将修改后的所述定时任务的任务信息和执行周期存储在所述业务系统的数据库中;调用updateTaskInfo更改所述业务系统的内存中所述定时任务的执行周期。A changing unit is used to change the execution period of the scheduled task in the database of the business system; or to delete the task information and execution period of the scheduled task in the database of the business system, and store the modified task information and execution period of the scheduled task in the database of the business system; call updateTaskInfo to change the execution period of the scheduled task in the memory of the business system.
本实施例中,在对定时任务进行修改时,可以将业务系统的数据库中旧的定时任务的相关信息进行删除,再重新写入新的定时任务的相关信息,也可以直接在业务系统的数据库中更改定时任务的执行周期。In this embodiment, when modifying a scheduled task, the relevant information of the old scheduled task in the business system database can be deleted and the relevant information of the new scheduled task can be rewritten, or the execution cycle of the scheduled task can be directly changed in the business system database.
相关技术中,在静态配置定时任务后,需要修改定时任务时,需要在代码中进行修改并重新编译,不够灵活;并且定时任务需要重新编译和部署后才能生效,生效较慢;在静态配置任务时,需要考虑各种异常情况,管理和维护难度较大。本实施例中,可以根据实际需求随时、灵活地进行定时任务的修改;并且定时任务的修改可以在运行过程中立即生效,具有实时性;通过本实施例的技术方案可以在运行过程中对定时任务进行监控和管理,保证定时任务的稳定性和可靠性。In related technologies, after statically configuring a scheduled task, if the scheduled task needs to be modified, it is necessary to modify the code and recompile it, which is not flexible enough. The scheduled task also needs to be recompiled and deployed before it takes effect, which is slow to take effect. When statically configuring tasks, various abnormal situations need to be considered, making management and maintenance more difficult. In this embodiment, scheduled tasks can be modified at any time and flexibly according to actual needs. Modifications to scheduled tasks can take effect immediately during operation, which is real-time. The technical solution of this embodiment can monitor and manage scheduled tasks during operation, ensuring the stability and reliability of scheduled tasks.
一些实施例中,所述装置还包括:In some embodiments, the apparatus further comprises:
查询模块,用于在所述业务系统启动时,查询所述业务系统中是否存在有效的定时任务;A query module is used to query whether there is a valid scheduled task in the business system when the business system is started;
加载模块,用于若存在有效的定时任务,调用addCronTask将所述有效的定时任务加载到所述业务系统的内存中;A loading module is used to call addCronTask to load a valid scheduled task into the memory of the business system if there is one;
执行模块,用于根据所述定时任务的执行周期定时执行所述定时任务。The execution module is used to execute the scheduled task regularly according to the execution cycle of the scheduled task.
本实施例中,在业务系统启动时先去查询数据库中是否存在有效的定时任务,如若存在则执行addCronTask方法将定时任务写进内存中,然后根据定时任务的执行周期执行定时任务;如若不存在则直接加载结束。In this embodiment, when the business system starts, it first queries whether there is a valid scheduled task in the database. If so, the addCronTask method is executed to write the scheduled task into the memory, and then the scheduled task is executed according to the execution cycle of the scheduled task; if not, the loading is completed directly.
在执行定时任务后,本实施例的技术方案还可以进行任务编排。任务编排是在定时任务执行完毕后,根据定时任务的执行结果去执行不同的后续的业务任务;任务编排可以分为三类执行逻辑,所述装置还包括:After executing the scheduled task, the technical solution of this embodiment can also perform task scheduling. Task scheduling is to execute different subsequent business tasks according to the execution results of the scheduled task after the scheduled task is completed; task scheduling can be divided into three types of execution logic, and the device also includes:
业务任务执行模块,用于根据所述定时任务的执行结果执行后续的业务任务,包括以下任一项:The business task execution module is used to execute subsequent business tasks according to the execution result of the scheduled task, including any of the following:
按照预设的任务顺序,顺序执行多个所述业务任务,如图9所示,先执行任务A,任务A执行完毕后触发执行任务B,任务B执行完毕后触发执行任务C;Execute multiple business tasks in sequence according to the preset task order. As shown in FIG9 , Task A is executed first. After Task A is completed, Task B is triggered. After Task B is completed, Task C is triggered.
在执行完所述业务任务的所有前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果,如图7所示,任务A和任务B为任务C的前置任务,则在执行完任务A和任务B后,根据任务A和任务B的执行结果执行任务C;After all predecessor tasks of the business task are executed, the business task is executed, wherein the execution of the business task depends on the execution results of the predecessor tasks. As shown in Figure 7, Task A and Task B are predecessor tasks of Task C. After Task A and Task B are executed, Task C is executed based on the execution results of Task A and Task B;
在执行完所述业务任务的任一前置任务后,执行所述业务任务,其中,所述业务任务的执行依赖于所述前置任务的执行结果,如图8所示,任务A和任务B为任务C的前置任务,则在执行完任务A或任务B后,根据任务A或任务B的执行结果执行任务C。After executing any predecessor task of the business task, execute the business task, wherein the execution of the business task depends on the execution result of the predecessor task. As shown in Figure 8, Task A and Task B are predecessor tasks of Task C. After executing Task A or Task B, execute Task C according to the execution result of Task A or Task B.
为了节省资源,提高任务执行的效率,本实施例可以对任务进行编排,通过对不同任务的调度和执行,实现更加复杂的系统功能。所述装置还包括:In order to save resources and improve the efficiency of task execution, this embodiment can arrange tasks and realize more complex system functions by scheduling and executing different tasks.
业务任务执行模块,用于根据所述定时任务的执行结果执行后续的业务任务,包括:The business task execution module is used to execute subsequent business tasks according to the execution results of the scheduled tasks, including:
步骤a、根据所述业务任务的关联关系条件集合获取所有的后置任务,所述后置任务的执行依赖于所述关联关系条件集合中其他业务任务的执行结果,所述关联关系条件集合包括存在关联关系的多个所述业务任务;Step a: acquiring all post-tasks according to the association condition set of the business task, wherein the execution of the post-task depends on the execution results of other business tasks in the association condition set, and the association condition set includes a plurality of the business tasks having an association relationship;
步骤b、遍历所述关联关系条件集合中的业务任务;Step b: traverse the business tasks in the association condition set;
步骤c、判断所述关联关系条件集合中的一业务任务是否包含在所述后置任务中;如果是,转向步骤b,如果不是,转向步骤d;Step c: determine whether a business task in the association condition set is included in the post-task; if yes, proceed to step b; if not, proceed to step d;
步骤d、从所述关联关系条件集合中移除该业务任务,将该业务任务保存在任务输出列表中,转向步骤e;Step d: remove the business task from the association relationship condition set, save the business task in the task output list, and go to step e;
步骤e、判断所述关联关系条件集合是否为空,如果是,转向步骤f,如果不是,转向步骤a;Step e: Determine whether the association relationship condition set is empty. If so, go to step f; if not, go to step a.
步骤f、按照所述任务输出列表中的任务顺序执行业务任务。Step f: executing the business tasks in the order of tasks in the task output list.
本公开的实施例还提供了一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行时实现如上所述的方法的步骤。An embodiment of the present disclosure further provides a computer program product, comprising computer instructions, which implement the steps of the above method when executed by a processor.
在本公开各方法实施例中,所述各步骤的序号并不能用于限定各步骤的先后顺序,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,对各步骤的先后变化也在本公开的保护范围之内。In the various method embodiments of the present disclosure, the serial numbers of the steps cannot be used to limit the order of the steps. For ordinary technicians in this field, without paying any creative work, changes to the order of the steps are also within the scope of protection of the present disclosure.
本申请实施例另提供了一种计算机程序/程序产品,所述计算机程序/程序产品被存储在存储介质中,所述计算机程序/程序产品被至少一个处理器执行以实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a computer program/program product, which is stored in a storage medium. The computer program/program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或是还包括为这种过程、方法、物品或装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限于按照示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted or combined. In addition, the features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助计算机软件产品加必需的通用硬件平台的方式来实现,当然也可以通过硬件。该计算机软件产品存储在存储介质(如ROM、RAM、磁碟、光盘等)中,包括若干指令,用以使得终端或网络侧设备执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of a computer software product plus a necessary general hardware platform, or of course, by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes a number of instructions for causing a terminal or network-side device to execute the methods described in each embodiment of the present application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式的实施方式,这些实施方式均属于本申请的保护之内。The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms of implementation methods without departing from the purpose of this application and the scope of protection of the claims. These implementation methods are all within the protection of this application.
Claims (15)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410288761.5 | 2024-03-13 | ||
| CN202410288761.5A CN120653374A (en) | 2024-03-13 | 2024-03-13 | Task management method and device and computer program product |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025190012A1 true WO2025190012A1 (en) | 2025-09-18 |
Family
ID=97001920
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2025/076941 Pending WO2025190012A1 (en) | 2024-03-13 | 2025-02-12 | Task management method and apparatus, and computer program product |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN120653374A (en) |
| WO (1) | WO2025190012A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070112612A1 (en) * | 2005-11-17 | 2007-05-17 | Dollens Joseph R | Method and system for managing non-game tasks with a game |
| CN111966474A (en) * | 2020-08-11 | 2020-11-20 | 武汉遂意语联网络科技有限公司 | Method and device for controlling timing task |
| CN113961322A (en) * | 2021-10-18 | 2022-01-21 | 广州新丝路信息科技有限公司 | A multi-system-oriented timing task execution method and device |
| CN117112175A (en) * | 2023-08-28 | 2023-11-24 | 上海得帆信息技术有限公司 | Timing task control method and equipment for dynamic addition and deletion and storage medium |
| CN117193953A (en) * | 2022-05-31 | 2023-12-08 | 腾讯科技(深圳)有限公司 | Task processing method and device, electronic equipment and storage medium |
-
2024
- 2024-03-13 CN CN202410288761.5A patent/CN120653374A/en active Pending
-
2025
- 2025-02-12 WO PCT/CN2025/076941 patent/WO2025190012A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070112612A1 (en) * | 2005-11-17 | 2007-05-17 | Dollens Joseph R | Method and system for managing non-game tasks with a game |
| CN111966474A (en) * | 2020-08-11 | 2020-11-20 | 武汉遂意语联网络科技有限公司 | Method and device for controlling timing task |
| CN113961322A (en) * | 2021-10-18 | 2022-01-21 | 广州新丝路信息科技有限公司 | A multi-system-oriented timing task execution method and device |
| CN117193953A (en) * | 2022-05-31 | 2023-12-08 | 腾讯科技(深圳)有限公司 | Task processing method and device, electronic equipment and storage medium |
| CN117112175A (en) * | 2023-08-28 | 2023-11-24 | 上海得帆信息技术有限公司 | Timing task control method and equipment for dynamic addition and deletion and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120653374A (en) | 2025-09-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7779298B2 (en) | Distributed job manager recovery | |
| US20200167359A1 (en) | Query task processing based on memory allocation and performance criteria | |
| CN112445598B (en) | Task scheduling method and device based on quartz, electronic equipment and medium | |
| CN110175677A (en) | Automatic update method, device, computer equipment and storage medium | |
| US12210892B2 (en) | Method for implementing smart contract based on blockchain | |
| CN112579569B (en) | Data migration method and device | |
| JP2016541056A (en) | Computer apparatus, method and apparatus for scheduling business flows | |
| CN116382694A (en) | Method for improving compiling speed of Maven engineering in container environment | |
| CN111857984A (en) | Job invocation processing method, device and computer equipment in banking system | |
| WO2025190012A1 (en) | Task management method and apparatus, and computer program product | |
| CN115658248A (en) | Task scheduling method and device, electronic equipment and storage medium | |
| US11275571B2 (en) | Unified installer | |
| KR20010110097A (en) | Archiving in workflow-management-systems | |
| CN118193272A (en) | A JVM system problem location method and device | |
| CN115373886A (en) | Service group container shutdown method, device, computer equipment and storage medium | |
| CN115878124A (en) | A method and system for automated continuous integration in cloud-native scenarios | |
| CN116028544B (en) | Timing task dynamic adding method based on OPENSTACK | |
| JP3437284B2 (en) | Service processing system | |
| CN112801613A (en) | Method, device, equipment and medium for realizing business process | |
| CN106055322A (en) | Flow scheduling method and device | |
| CN120743887B (en) | A method and apparatus for state detection of graph database tasks | |
| JP2002268899A (en) | Information processor, dynamic change method for operation environment of program and program | |
| CN111930475B (en) | Method and device for starting ETT operation | |
| CN111104095A (en) | Method for realizing Quartz multitask management control | |
| CN101821713A (en) | The user co-routine interface that is used for customizing SIP and SDP agreement |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 25769186 Country of ref document: EP Kind code of ref document: A1 |