Multi-task arrangement processing method and device, storage medium and computer equipment
The multi-task scheduling method addresses inefficiencies in task management by automating task execution order and parallel processing, improving efficiency and accuracy in complex environments.
Patent Information
- Application Number
- CN202411326388.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing task management systems struggle with low efficiency and accuracy when handling multi-task parallel processing and strict sequence requirements due to insufficient flexibility in adapting to complex business environments, necessitating manual adjustment and monitoring.
A multi-task scheduling method that involves obtaining a target file, determining dependency orders, marking subtasks for execution in a cache, executing them in parallel, and updating completion status to manage complex task dependencies automatically.
This method enhances task execution efficiency and accuracy by ensuring tasks are executed in the correct order, reducing errors, and optimizing resource use through parallel processing and real-time monitoring.
Smart Images

Figure CN119225932A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a multi-task scheduling processing method, device, storage medium and computer equipment. Background Art
[0002] In the current task management field, task management systems have become an indispensable core pillar, especially in dealing with complex business processes, realizing automated operation and maintenance, and mastering large-scale distributed computing scenarios. These systems can manage task execution through intelligent scheduling strategies, thereby greatly improving overall operational efficiency and response speed.
[0003] However, as the business environment becomes increasingly complex, the execution order and dependencies between tasks become intricate, and existing task management systems often fail to provide sufficient flexibility to adapt to such changes. As a result, task management systems need to rely on manual adjustment and monitoring when faced with multi-task parallel processing and strict sequence requirements, resulting in low efficiency and accuracy. Summary of the invention
[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect that the task management system in the prior art needs to rely on manual adjustment and monitoring when facing multi-task parallel processing and strict sequence requirements, resulting in low efficiency and accuracy.
[0005] The present application provides a multi-task scheduling processing method, the method comprising:
[0006] Obtaining a target file to be processed, and performing task arrangement on the target file to obtain a main task including a plurality of subtasks; wherein each subtask includes at least one task node;
[0007] Determine the dependency order of each subtask in the main task, and mark each subtask as to be executed in the dependency order through a task calling interface and record them in the cache in sequence to form a target main task;
[0008] Obtaining the first subtask to be executed from the cache as the target subtask, and executing each task node in the target subtask in parallel to obtain an execution result;
[0009] When it is detected that each task node in the execution result is marked as completed, updating the mark of the target subtask in the cache to completed;
[0010] Return to the step of obtaining the first subtask to be executed from the cache as the target subtask and subsequent steps thereof, until there is no subtask to be executed in the cache, marking the target main task as completed.
[0011] Optionally, the task scheduling of the target file to obtain a main task including a plurality of subtasks includes:
[0012] Performing task parsing on the target file to obtain multiple subtasks and dependencies between the subtasks;
[0013] The subtasks are sequentially arranged based on the dependency relationship, and a main task is generated according to the arrangement result.
[0014] Optionally, performing task parsing on the target file to obtain multiple subtasks includes:
[0015] Performing node parsing on the target file to obtain multiple task nodes;
[0016] Determine the group number in each task node, and combine the task nodes with the same group number to form a subtask;
[0017] Among them, the dependency relationship between each task node in each subtask is parallel.
[0018] Optionally, the step of marking each subtask as to be executed and recording it in a cache in the dependency order through the task calling interface to form a target main task includes:
[0019] Create a task calling interface and obtain the file address of the target file;
[0020] Uploading the file address to the task calling interface so that the task calling interface reads the main task corresponding to the target file to obtain a reading result;
[0021] Each subtask in the read result is marked as to be executed, and each marked subtask is recorded in sequence into the cache in the dependency order to form a target main task.
[0022] Optionally, executing each task node in the target subtask in parallel to obtain an execution result includes:
[0023] Execute each task node in the target subtask in parallel, and monitor the execution status of each task node during the execution process;
[0024] The real-time status of each task node in the monitoring result is read at a preset time interval as the execution result of the target subtask.
[0025] Optionally, the method further comprises:
[0026] If it is detected that there is a task node marked as an execution exception in the execution result, the target subtask is marked as an execution exception in the cache, and the execution operation of the target subtask is stopped;
[0027] Generate an execution exception notification of the target main task, and push the execution exception notification to the user end.
[0028] Optionally, the method further comprises:
[0029] After marking the target main task as completed, generating an execution completion notification of the target main task, and pushing the execution completion notification to the user end.
[0030] The present application also provides a multi-task scheduling processing device, comprising:
[0031] A task scheduling module is used to obtain a target file to be processed, and perform task scheduling on the target file to obtain a main task including multiple subtasks; wherein each subtask includes at least one task node;
[0032] A main task cache module is used to determine the dependency order of each subtask in the main task, and mark each subtask as to be executed in the dependency order through a task call interface and record them in the cache in sequence to form a target main task;
[0033] A subtask execution module, used to obtain the first subtask to be executed from the cache as a target subtask, and execute each task node in the target subtask in parallel to obtain an execution result;
[0034] A subtask marking module, configured to update the mark of the target subtask in the cache to execution completion when it is detected that each task node in the execution result is marked as execution completion;
[0035] The main task marking module is used to return the first subtask to be executed obtained from the cache as the target subtask and its subsequent steps until there are no subtasks to be executed in the cache, marking the target main task as completed.
[0036] The present application also provides a storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-task scheduling processing method described in any one of the above embodiments.
[0037] The present application also provides a computer device, comprising: one or more processors, and a memory;
[0038] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the multi-task scheduling processing method described in any one of the above embodiments are performed.
[0039] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0040] The multi-task scheduling processing method, device, storage medium and computer equipment provided by the present application can first obtain the target file to be processed, and perform task scheduling on the target file to obtain a main task containing multiple subtasks, thereby realizing the automatic scheduling of multiple tasks and improving efficiency. Since each subtask in the main task obtained by scheduling has a dependency order, and each subtask includes at least one task node, each subtask can be marked as to be executed in accordance with the dependency order through the task call interface, and then recorded in the cache in sequence to form a target main task, so as to ensure the accuracy of the execution order of the target main task during the execution process; in the process of task execution, the first subtask to be executed can be obtained from the cache as the target subtask, and each task node in the target subtask can be executed in parallel to obtain the execution result; wherein, the efficiency of task execution can be further improved by parallel execution operation. When it is detected that each task node in the execution result is marked as completed, the mark of the target subtask in the cache can be updated to completed, and then the next subtask to be executed can be continued until there is no subtask to be executed in the cache, and the target main task is marked as completed. Through this method, the present application can flexibly arrange the execution order of multiple tasks according to the dependencies between subtasks, reduce errors caused by confused dependencies or incorrect task execution order, and execute nodes in parallel within subtasks, further improving multitasking efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0042] Figure 1 A flowchart of a multi-task scheduling processing method provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a process of forming a target main task provided in an embodiment of the present application;
[0044] Figure 3A schematic diagram of the structure of a multi-task scheduling processing device provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] As the business environment becomes increasingly complex, the execution order and dependencies between tasks become intricate, and existing task management systems often fail to provide sufficient flexibility to adapt to such changes. As a result, task management systems need to rely on manual adjustment and monitoring when faced with multi-task parallel processing and strict sequence requirements, resulting in low efficiency and accuracy.
[0048] Based on this, this application proposes the following technical solutions, see below for details:
[0049] In one embodiment, Figure 1 As shown, Figure 1 A flowchart of a multi-task scheduling processing method provided in an embodiment of the present application; the present application provides a multi-task scheduling processing method, which specifically includes the following:
[0050] S110: Obtain a target file to be processed, and perform task scheduling on the target file to obtain a main task including a plurality of subtasks; wherein each subtask includes at least one task node.
[0051] In this step, the user can arrange and process multiple tasks through the task management system. During this process, the task management system can first obtain the target file to be processed selected by the user, and then arrange the tasks for the target file to obtain a main task containing multiple subtasks, so that the efficiency of multi-task processing can be achieved through the automatic arrangement of the target files.
[0052] The target file refers to the file that needs to be operated, analyzed or converted, which can include a JSON file. In the target file, it can contain multiple operation modules, each of which represents an operation event. Therefore, the task management system can divide the target file into multiple subtasks and arrange them in sequence to form a main task, and each subtask includes at least one node.
[0053] Specifically, when the task management system schedules tasks for the target file, it can use a pre-set task scheduling mechanism to flexibly schedule tasks for the target file. The task scheduling mechanism here can be based on task levels or based on the logical relationship between tasks, which is not limited here. Therefore, through the scheduling results of the task scheduling mechanism, the task management system can accurately control the execution order of the main task, thereby improving the efficiency of multi-tasking, reducing the complexity of manual operations, and ensuring the efficient execution of multiple tasks.
[0054] S120: Determine the dependency order of each subtask in the main task, and mark each subtask as to be executed in the dependency order through the task calling interface and record them in the cache in sequence to form a target main task.
[0055] In this step, after the main task is arranged through step S110, the task management system can first determine the dependency order of each subtask in the main task, and then mark each subtask as to be executed according to the dependency order through the task scheduling interface and record them in the cache in sequence to form the target main task, thereby realizing multi-task processing of the target main task.
[0056] It can be understood that the dependency order refers to the execution relationship between the various subtasks during the execution of the main task; in other words, the execution of a subtask depends on the completion of the previous subtask. After the previous subtask is completed, the subsequent subtasks that depend on this subtask can continue to execute. For example, in a data processing scenario, the previous subtask is mainly responsible for data cleaning. Only after data cleaning is completed can the subsequent subtask responsible for data analysis be started. Therefore, this dependency order can ensure that the task management system can process according to the logical process of the arrangement, avoid conflicts between subtasks or data inconsistencies, and thus improve the flexibility of multi-task arrangement.
[0057] Furthermore, the task scheduling interface refers to the functional interface used to perform task scheduling operations in the task management system, which is mainly responsible for scheduling and managing each subtask to be executed according to the determined dependency order. In this application, the task scheduling interface can mark each subtask as to be executed in the order of dependency of the main task and record it in the cache in order, ensuring that the tasks are executed in the established order, and ultimately achieving efficient processing of multiple tasks.
[0058] S130: Obtain the first subtask to be executed from the cache as the target subtask, and execute each task node in the target subtask in parallel to obtain an execution result.
[0059] In this step, after recording each subtask in order into the cache through step S120, the task management system can obtain the first subtask to be executed from the cache and use it as the target subtask. Then, each task node in the target subtask can be executed in parallel to obtain the execution result, thereby improving the efficiency of task processing through the parallel execution of task nodes.
[0060] It can be understood that since the various subtasks to be executed in the target main task in the cache are recorded in sequence according to their dependency order, the first subtask among the subtasks to be executed recorded in the cache is the subtask with the first priority in the dependency order. Here, the task management system can obtain this subtask as the target subtask and start the execution operation, so that after the execution is completed, the subtask with the next priority in the dependency order can be started, thereby avoiding errors caused by incorrect task execution order or confusion in dependency relationships, and improving the efficiency and accuracy of task processing.
[0061] Specifically, the task management system can first obtain the first subtask to be executed from the cache and set it as the target subtask that needs to be executed currently, so that each task node in the target subtask can be identified and processed. Among them, in order to improve the overall task processing efficiency, the task management system can process these task nodes in parallel, that is, multiple task nodes can be executed on different threads or computing resources at the same time, without having to rely on the single-threaded sequential execution method. Through the parallel execution of task nodes, the task management system can make full use of the system's multi-core computing power and distributed architecture, and significantly shorten the overall execution time of the task.
[0062] S140: When it is detected that each task node in the execution result is marked as completed, the mark of the target subtask in the cache is updated to completed.
[0063] In this step, after the execution result of the target subtask is generated through step S130, the task management system can detect the execution result in real time, and when it is detected that each task node in the execution result is marked as completed, the mark of the target subtask in the cache is updated to completed, thereby realizing real-time monitoring of the execution progress of the target subtask, and then quickly starting the next subtask, thereby improving the efficiency of task processing.
[0064] It is understandable that, since the target subtask is composed of multiple task nodes and each task node is executed in parallel, the execution progress of each task node will be different due to task differences. Therefore, in order to ensure that each task node in the target subtask can be executed, the task management system can detect the execution result of the target subtask, and the execution result is saved in the cache, which actually records the execution progress of each task node in the target subtask in real time. When it is detected that each task node is marked as completed, it means that the target subtask is completed. Therefore, the task management system can update the mark of the completed target subtask in the cache to avoid conflicts in the execution of subsequent subtasks.
[0065] Specifically, during the execution of the target subtask, the task management system can accurately and in real time monitor the execution progress of each task node in the target subtask. After detecting that each task node is marked as completed, the task management system can update the mark of the corresponding target subtask to completed, and immediately release related resources to optimize the use efficiency of system memory and resources, thereby effectively reducing delays and resource waste in task scheduling.
[0066] S150: Return to obtain the first subtask to be executed from the cache as the target subtask and its subsequent steps, until there is no subtask to be executed in the cache, marking the target main task as completed.
[0067] In this step, after the target subtask is updated to be completed in step S140, the task management system can continue to obtain other subtasks to be executed from the cache for task execution. When obtaining subtasks to be executed, the task management system can first determine whether there are subtasks to be executed in the cache; if so, the first subtask to be executed in the cache can be obtained as the target subtask and the task operation can be started; if not, the target main task can be marked as completed.
[0068] It can be understood that when the mark of the subtask with the first priority in the dependency order in the cache is updated to completed, the subtask with the next priority in the dependency order will become the first subtask to be executed in the cache. Therefore, through this dependency order management, the task management system can maintain efficient operation in complex multi-task scenarios, ensuring that each subtask to be executed is executed smoothly in the dependency order, thereby reducing errors caused by incorrect task execution order or confusion in dependency relationships, and improving task execution efficiency.
[0069] In the above embodiment, when performing multi-task arrangement processing, the target file to be processed can be obtained first, and the target file can be arranged to obtain a main task containing multiple subtasks, thereby realizing the automatic arrangement of multiple tasks and improving efficiency. Since each subtask in the arranged main task has a dependency order, and each subtask includes at least one task node, each subtask can be marked as to be executed in accordance with the dependency order through the task call interface and then recorded in the cache in sequence to form a target main task, thereby ensuring the accuracy of the execution order of the target main task during the execution process; in the process of task execution, the first subtask to be executed can be obtained from the cache as the target subtask, and each task node in the target subtask can be executed in parallel to obtain the execution result; wherein, the efficiency of task execution can be further improved by parallel execution operation. When it is detected that each task node in the execution result is marked as completed, the mark of the target subtask in the cache can be updated to completed, and then the next subtask to be executed can be continued until there is no subtask to be executed in the cache, and the target main task is marked as completed. Through this method, the present application can flexibly arrange the execution order of multiple tasks according to the dependencies between subtasks, reduce errors caused by confused dependencies or incorrect task execution order, and execute nodes in parallel within subtasks, further improving multitasking efficiency.
[0070] In one embodiment, in step S110, task scheduling is performed on the target file to obtain a main task including multiple subtasks, which may include:
[0071] S111: Perform task parsing on the target file to obtain multiple subtasks and dependencies between the subtasks.
[0072] S112: Arrange the subtasks in sequence based on the dependency relationship, and generate a main task according to the arrangement result.
[0073] In this embodiment, when the task management system schedules tasks for a target file, it can first perform task analysis on the target file to obtain multiple subtasks and dependencies between the subtasks, and then sequentially schedule the subtasks based on the dependencies, and generate a main task based on the scheduling results. This can achieve automated task scheduling while avoiding execution conflicts between subtasks.
[0074] Specifically, the task management system can first perform task parsing on the target file, and analyze the content of the target file during the parsing process, extract the task information therein, so that it can be divided into multiple subtasks, and the dependency relationship between each subtask can be clarified, and then each subtask can be arranged in sequence based on the dependency relationship to generate a main task. Therefore, there is a dependency order between each subtask in the generated main task, that is, the execution order. According to the dependency order, the task management system can automatically execute the main task to ensure that each subtask will not conflict or hinder each other during the execution process, thereby improving the efficiency and accuracy of execution.
[0075] In one embodiment, in step S111, the target file is parsed to obtain multiple subtasks, which may include:
[0076] S1111: parse the target file for nodes to obtain multiple task nodes.
[0077] S1112: Determine the group number in each task node, and combine task nodes with the same group number to form a subtask.
[0078] In this embodiment, when parsing subtasks, the task management system can first parse the nodes of the target file to form multiple task nodes, then determine the group number in each task node, and combine nodes with the same group number to form subtasks.
[0079] It is understandable that the target file contains multiple operation modules, each of which represents a task node, and its content field may include module name, module code, notification method, group number and sequence number, etc. Among them, the group number refers to the identifier used to classify and organize the task nodes. It can divide these nodes into different groups according to the functions, attributes or execution requirements of the task nodes. Task nodes with the same group number usually have similar characteristics or execution order. Therefore, in the present application, the task management system can combine task nodes with the same group number to form subtasks. At this time, the subtask can be regarded as a group of tasks that can be processed in combination, and the dependency relationship between each task node in the subtask is parallel, so as to improve the efficiency of task processing.
[0080] In one embodiment, Figure 2 As shown, Figure 2 A schematic diagram of a process of forming a target main task provided in an embodiment of the present application; Figure 2 In step S120, each subtask is marked as to be executed and recorded in the cache in the dependency order through the task calling interface to form a target main task, which may include:
[0081] S121: Create a task calling interface and obtain the file address of the target file.
[0082] S122: Upload the file address to the task calling interface, so that the task calling interface reads the main task corresponding to the target file to obtain a reading result.
[0083] S123: Mark each subtask in the read result as to be executed, and record each marked subtask in the cache in sequence according to the dependency order to form a target main task.
[0084] In this embodiment, when the task management system records the main task into the cache, it can first create a task calling interface and obtain the file address of the target file, so that the file address can be uploaded to the task calling interface, so that the task calling interface can read the main task corresponding to the target file to obtain the reading result. Then the task management system can mark each subtask in the reading result as to be executed, and record the marked subtasks in sequence into the cache according to the dependency order in the main task to form the target main task, so as to ensure that the target main task can be executed in sequence according to its dependency order, thereby improving the efficiency and accuracy of task execution.
[0085] It is understandable that the task call interface created by the task management system can serve as a bridge for the system to interact with external data or files. Through the task call interface, the task management system can effectively interact with external target files. During the interaction, the task management system can first obtain the file address of the target file, which represents the storage location of the target file in the task management system. Therefore, after uploading the file address to the task scheduling interface, the task management system can access the target file through the task scheduling interface and read its corresponding main task, and according to the dependency order in the main task, record the marked subtasks in the dependency order in sequence to the cache to form the target main task, thereby ensuring that the target main task can be started and executed in sequence according to the dependency order arranged in advance, avoiding execution conflicts caused by incorrect order or improper dependency between tasks.
[0086] In one embodiment, in step S130, each task node in the target subtask is executed in parallel to obtain an execution result, which may include:
[0087] S131: Execute each task node in the target subtask in parallel, and monitor the execution status of each task node during the execution process.
[0088] S132: Read the real-time status of each task node in the monitoring result at a preset time interval as the execution result of the target subtask.
[0089] In this embodiment, when executing the target subtask, the task management system can first execute each task node in the target subtask in parallel, and monitor the execution status of each task node during the execution process. Then the task management system can read the real-time status of each task node in the monitoring result at a preset time interval as the execution result of the target subtask, so as to realize real-time monitoring of the execution status of the target subtask and serve as the basis for refined management of multi-task processing processes.
[0090] Specifically, the task management system can use multiple threads to execute each task node in the target subtask in parallel, and continuously track and monitor the execution status of each task node through internal monitoring execution. At the same time, the task management system can also read the monitoring results regularly at preset time intervals to obtain the real-time status of each task node, and update the execution status of each task node under the target subtask in the cache according to the read real-time status, and use the latest execution status of each task node in the cache as the execution result of the target subtask.
[0091] It should be noted that by updating the execution status of each task node in the cache in real time, the present application can maintain a high degree of flexibility and controllability during the execution of complex tasks, ensuring that each task node is completed as expected, and ultimately achieving efficient management and execution of multi-task processing; if an abnormality occurs in one of the task nodes, the task management system can also quickly identify the abnormal task node and process it, thereby improving the efficiency and accuracy of task execution.
[0092] In one embodiment, the method may further include:
[0093] S160: If it is detected that there is a task node in the execution result marked as an execution exception, the target subtask execution exception is marked in the cache, and the execution operation of the target subtask is stopped.
[0094] S170: Generate an execution exception notification of the target main task, and push the execution exception notification to the user end.
[0095] In this embodiment, when the task management system detects that there is a task node marked as an execution exception in the execution result, it can mark the corresponding target subtask as an execution exception in the cache and stop the execution operation of the target subtask; then, the task management system can generate an execution exception notification for the target main task where the target subtask is located, and push the execution exception notification to the user end, so that the user can promptly check the exception of the target main task and improve the task processing efficiency.
[0096] It is understandable that there are dependencies between the subtasks in the target main task, and the execution of subsequent subtasks depends on the execution results of the previous subtask. If the task node in the previous subtask executes abnormally, continuing to execute the task may cause the abnormal impact to expand. Therefore, by stopping the execution of the target subtask, the task management system can prevent the impact of the abnormality from further expanding, thereby improving the refined management of the task process.
[0097] It should be noted that, since the dependency relationship of task nodes in the same subtask is parallel, when a task node in the target subtask is marked as an execution exception, it does not affect the execution progress of other task nodes being executed.
[0098] Furthermore, when the task management system detects that there is a task node marked as an execution exception in the execution result, it can also start the attempt mechanism to restart the execution of the task node. If the task node still cannot eliminate the exception after the restart times exceed the preset number of attempts, it can directly generate an execution exception notification of the target main task and push the execution exception notification to the user end, so that the user can conduct an in-depth investigation of the exception. Therefore, through the attempt mechanism, this application can further reduce manual intervention and improve the automated management capabilities of the task management system.
[0099] In one embodiment, the method may further include:
[0100] S180: After marking the target main task as completed, generating an execution completion notification of the target main task, and pushing the execution completion notification to the user end.
[0101] In this embodiment, after marking the completion of the target main task, the task management system can also generate an execution completion notification of the target main task, and push the execution completion notification to the user end to ensure that the user can receive feedback as soon as the task is completed, and then can promptly understand the execution status of the task and perform subsequent processing or adjustments as needed.
[0102] The multi-task scheduling processing device provided in an embodiment of the present application is described below. The multi-task scheduling processing device described below and the multi-task scheduling processing method described above can be referenced to each other.
[0103] In one embodiment, Figure 3 As shown, Figure 3 A schematic diagram of the structure of a multi-task scheduling processing device provided in an embodiment of the present application; the present application also provides a multi-task scheduling processing device, including
[0104] The task scheduling module 210 is used to obtain the target file to be processed and schedule the target file to obtain a main task including multiple subtasks; wherein each subtask includes at least one task node.
[0105] The main task cache module 220 is used to determine the dependency order of each subtask in the main task, and mark each subtask as to be executed in the dependency order through the task call interface and record them in the cache in sequence to form a target main task.
[0106] The subtask execution module 230 is used to obtain the first subtask to be executed from the cache as a target subtask, and execute each task node in the target subtask in parallel to obtain an execution result.
[0107] The subtask marking module 240 is used to update the mark of the target subtask in the cache to execution completion when it is detected that each task node in the execution result is marked as execution completion.
[0108] The main task marking module 250 is used to return to obtain the first subtask to be executed from the cache as the target subtask and its subsequent steps until there are no subtasks to be executed in the cache, marking the target main task as completed.
[0109] In the above embodiment, when performing multi-task arrangement processing, the target file to be processed can be obtained first, and the target file can be arranged to obtain a main task containing multiple subtasks, thereby realizing the automatic arrangement of multiple tasks and improving efficiency. Since each subtask in the arranged main task has a dependency order, and each subtask includes at least one task node, each subtask can be marked as to be executed in accordance with the dependency order through the task call interface and then recorded in the cache in sequence to form a target main task, thereby ensuring the accuracy of the execution order of the target main task during the execution process; in the process of task execution, the first subtask to be executed can be obtained from the cache as the target subtask, and each task node in the target subtask can be executed in parallel to obtain the execution result; wherein, the efficiency of task execution can be further improved by parallel execution operation. When it is detected that each task node in the execution result is marked as completed, the mark of the target subtask in the cache can be updated to completed, and then the next subtask to be executed can be continued until there is no subtask to be executed in the cache, and the target main task is marked as completed. Through this method, the present application can flexibly arrange the execution order of multiple tasks according to the dependencies between subtasks, reduce errors caused by confused dependencies or incorrect task execution order, and execute nodes in parallel within subtasks, further improving multitasking efficiency.
[0110] In one embodiment, the task orchestration module 210 may include:
[0111] The task parsing submodule is used to perform task parsing on the target file to obtain multiple subtasks and the dependencies between the subtasks.
[0112] The sequential scheduling submodule is used to sequentially schedule each subtask based on the dependency relationship and generate the main task according to the scheduling results.
[0113] In one embodiment, the task parsing submodule may include:
[0114] The node parsing unit is used to perform node parsing on the target file to obtain multiple task nodes.
[0115] The node grouping unit is used to determine the grouping number in each task node, and to combine the task nodes with the same grouping number to form subtasks; wherein the dependency relationship between the task nodes in each subtask is parallel.
[0116] In one embodiment, the main task cache module 220 may include:
[0117] The interface creation submodule is used to create a task calling interface and obtain the file address of the target file.
[0118] The task reading submodule is used to upload the file address to the task calling interface so that the task calling interface reads the main task corresponding to the target file to obtain the reading result.
[0119] The task recording submodule is used to mark each subtask in the reading result as to be executed, and record each marked subtask in the cache in sequence according to the dependency order to form a target main task.
[0120] In one embodiment, the subtask execution module 230 may include:
[0121] The node parallel execution submodule is used to execute each task node in the target subtask in parallel and monitor the execution status of each task node during the execution process.
[0122] The node status monitoring submodule is used to read the real-time status of each task node in the monitoring result at a preset time interval as the execution result of the target subtask.
[0123] In one embodiment, the apparatus may further include:
[0124] The exception monitoring submodule is used to mark the target subtask execution exception in the cache and stop the execution operation of the target subtask if it detects that there is a task node marked as execution exception in the execution result.
[0125] The exception push submodule is used to generate an execution exception notification of the target main task and push the execution exception notification to the user end.
[0126] In one embodiment, the apparatus may further include:
[0127] The completion push module is used to generate a target main task execution completion notification after marking the target main task execution completion, and push the execution completion notification to the user end.
[0128] In one embodiment, the present application also provides a storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-task orchestration processing method described in any of the above embodiments.
[0129] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-task orchestration processing method as described in any one of the above embodiments.
[0130] Indicatively, Figure 4 As shown, Figure 4 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 4 The computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions that can be executed by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the multi-tasking scheduling processing method of any of the above embodiments.
[0131] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.
[0132] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0133] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0134] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0135] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-task scheduling processing method, characterized in that: The method comprises: Obtaining a target file to be processed, and performing task arrangement on the target file to obtain a main task including a plurality of subtasks; wherein each subtask includes at least one task node; Determine the dependency order of each subtask in the main task, and mark each subtask as to be executed in the dependency order through a task calling interface and record them in the cache in sequence to form a target main task; Obtaining the first subtask to be executed from the cache as the target subtask, and executing each task node in the target subtask in parallel to obtain an execution result; When it is detected that each task node in the execution result is marked as completed, updating the mark of the target subtask in the cache to completed; Return to the step of obtaining the first subtask to be executed from the cache as the target subtask and subsequent steps thereof, until there is no subtask to be executed in the cache, marking the target main task as completed.
2. The multi-task scheduling processing method according to claim 1, characterized in that: The task arrangement of the target file to obtain a main task including multiple subtasks includes: Performing task parsing on the target file to obtain multiple subtasks and dependencies between the subtasks; The subtasks are sequentially arranged based on the dependency relationship, and a main task is generated according to the arrangement result.
3. The multi-task scheduling processing method according to claim 2, characterized in that: The target file is parsed for tasks to obtain multiple subtasks, including: Performing node parsing on the target file to obtain multiple task nodes; Determine the group number in each task node, and combine the task nodes with the same group number to form a subtask; Among them, the dependency relationship between each task node in each subtask is parallel.
4. The multi-task scheduling processing method according to claim 1, characterized in that: The step of marking each subtask as to be executed and recording it in a cache in the dependency order through the task calling interface to form a target main task includes: Create a task calling interface and obtain the file address of the target file; Uploading the file address to the task calling interface so that the task calling interface reads the main task corresponding to the target file to obtain a reading result; Each subtask in the read result is marked as to be executed, and each marked subtask is recorded in sequence into the cache in the dependency order to form a target main task.
5. The multi-task scheduling processing method according to claim 1, characterized in that: The executing each task node in the target subtask in parallel to obtain an execution result includes: Execute each task node in the target subtask in parallel, and monitor the execution status of each task node during the execution process; The real-time status of each task node in the monitoring result is read at a preset time interval as the execution result of the target subtask.
6. The multi-task scheduling processing method according to claim 1, characterized in that: The method further comprises: If it is detected that there is a task node marked as an execution exception in the execution result, the target subtask is marked as an execution exception in the cache, and the execution operation of the target subtask is stopped; Generate an execution exception notification of the target main task, and push the execution exception notification to the user end.
7. The multi-task scheduling processing method according to claim 1, characterized in that: The method further comprises: After marking the target main task as completed, generating an execution completion notification of the target main task, and pushing the execution completion notification to the user end.
8. A multi-task scheduling processing device, characterized in that: include: A task scheduling module is used to obtain a target file to be processed, and perform task scheduling on the target file to obtain a main task including multiple subtasks; wherein each subtask includes at least one task node; A main task cache module is used to determine the dependency order of each subtask in the main task, and mark each subtask as to be executed in the dependency order through a task call interface and record them in the cache in sequence to form a target main task; A subtask execution module, used to obtain the first subtask to be executed from the cache as a target subtask, and execute each task node in the target subtask in parallel to obtain an execution result; A subtask marking module, configured to update the mark of the target subtask in the cache to execution completion when it is detected that each task node in the execution result is marked as execution completion; The main task marking module is used to return the first subtask to be executed obtained from the cache as the target subtask and its subsequent steps until there are no subtasks to be executed in the cache, marking the target main task as completed.
9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-task scheduling processing method as claimed in any one of claims 1 to 7.
10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the multi-task scheduling processing method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Task scheduling method and device and computer readable storage medium
CN113238838A
Task scheduling method and device, storage medium and electronic equipment
CN118535301A
Method and apparatus for processing task in a multi-core digital signal processing system
WO2017070900A1
Intelligent task scheduling method, device and apparatus and storage medium
WO2020186787A1
Graph task scheduling method, execution-end device, storage medium, and program product
WO2023045478A1
