Task processing method and device, electronic equipment, storage medium and program product

By using a directed acyclic graph to describe task dependencies and execute tasks asynchronously in the task processing system, the problems of low resource usage and low task processing efficiency in the existing technology are solved, and efficient and reliable task processing is achieved.

CN119356814APending Publication Date: 2025-01-24CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411413141.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The prior art has low resource utilization and low task processing efficiency when dealing with complex task scenarios. Especially in asynchronous execution scenarios, it is necessary to occupy the execution resource polling task execution results.

Method used

By receiving task requests from the client, arrange and generate a circular graph (DAG) to describe the order and dependence of the task, and to the DAG asynchronous execution task to avoid occupying the execution resources.

Benefits of technology

It improves task processing resource usage and task processing efficiency, saves time costs, and does not require execution resources in asynchronous scenarios, achieving efficient and reliable task advancement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356814A_ABST
    Figure CN119356814A_ABST
Patent Text Reader

Abstract

The invention provides a task processing method and device, electronic equipment, a storage medium and a program product. The method comprises the steps that a task request from a client side is received, the task request comprises a plurality of tasks, and each task comprises at least two sub-tasks with a dependency relationship; arranging the plurality of tasks, and generating a directed acyclic graph corresponding to the task request, the directed acyclic graph being used for indicating a sequence and a dependency relationship of executing the plurality of tasks; and executing a plurality of tasks according to the directed acyclic graph. According to the method, the technical effects of improving the resource utilization rate of task processing and improving the task processing efficiency are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task processing method, device, electronic device, storage medium and program product. Background Art

[0002] With the rapid development of social economy, computer technology is widely used in all aspects of social life, and the task logic in many task areas is becoming more and more complex. A task may contain multiple subtasks, each of which can be independently defined as a complete execution unit, and there are serial and parallel relationships between different tasks. Complex task scenarios may contain multiple tasks with certain correlations, and require task operations to be performed in a certain order.

[0003] At present, the method for handling complex task scenarios is to create a large task processing method and call each task operation according to the task logic sequence; during the execution of a task, the next task of the task needs to obtain the execution result of the task before it can be executed. The unexecuted tasks occupy system resources to synchronously wait for the execution results of their associated tasks, which seriously consumes system resources. If an asynchronous execution scenario is encountered, it is even more necessary to occupy execution resources to poll the task execution results. The above task processing scheme has the problems of low resource utilization and low task processing efficiency. Summary of the invention

[0004] The present application provides a task processing method, device, electronic device, storage medium and program product to solve the technical problems of low resource utilization and low task processing efficiency in task processing.

[0005] In a first aspect, the present application provides a task processing method, comprising:

[0006] Receive a task request from a client, where the task request includes multiple tasks, and each task includes at least two subtasks with dependencies;

[0007] Arrange multiple tasks and generate a directed acyclic graph corresponding to the task request. The directed acyclic graph is used to indicate the execution order and dependency relationship of multiple tasks.

[0008] According to the directed acyclic graph, multiple tasks are performed.

[0009] Optionally, in the above method, when executing multiple tasks, at least two subtasks in each task are executed asynchronously.

[0010] Optionally, in the above method, the task request includes multiple task identifiers, and the multiple tasks are arranged to generate a directed acyclic graph corresponding to the task request, including:

[0011] Acquire configuration information corresponding to multiple task identifiers from a task configuration database, wherein the configuration information corresponding to each task identifier includes a dependency relationship between the task corresponding to the task identifier and other tasks, and the task configuration database includes configuration information of multiple tasks;

[0012] A directed acyclic graph of task execution requests is generated according to configuration information corresponding to multiple task identifiers.

[0013] Optionally, the above method generates a directed acyclic graph of execution task requests according to the configuration information corresponding to the multiple task identifiers, including:

[0014] Based on multiple tasks, multiple task nodes are constructed, and one task node corresponds to one task;

[0015] According to the dependency relationship between the tasks in the configuration information corresponding to the multiple task identifiers, multiple directed edges are constructed, where one directed edge is used to indicate a pair of two tasks having a dependency relationship and an execution order of the two tasks;

[0016] A directed acyclic graph is generated according to the constructed multiple task nodes and multiple directed edges.

[0017] Optionally, the above method performs multiple tasks according to the directed acyclic graph, including:

[0018] According to the directed acyclic graph, a first thread is created, where the first thread is used to execute a first task among the multiple tasks, and the execution of the first task does not depend on the execution results of other tasks in the directed acyclic graph;

[0019] Obtain the execution result of the first task;

[0020] If the execution result of the first task indicates that its execution status is successful, create multiple second threads, and the multiple second threads are respectively used to execute multiple second tasks that have a dependency relationship with the first task;

[0021] Obtaining the execution result of the second task;

[0022] Repeat the above steps of creating threads to obtain the execution results of multiple tasks.

[0023] Optionally, the method as above further includes:

[0024] Determine the completion status of the task request based on the execution results of multiple tasks;

[0025] A first task response is sent to the client, where the first task response indicates a completion status of the task request.

[0026] Optionally, the above method, according to the execution results of the multiple tasks, determines the completion status of the task request, including:

[0027] If the execution results of the multiple tasks all indicate that their execution status is successful, determining the completion status of the task request is successful;

[0028] If the execution result of at least one task among the multiple tasks indicates that its execution status is execution failure, it is determined that the completion status of the task request is execution failure.

[0029] Optionally, the above method creates multiple second threads, including:

[0030] Determine respectively whether the execution of each second task depends on a third task, where the third task is other task among the plurality of tasks except the first task;

[0031] If it is determined that the execution of the second task depends on the third task, the second task is added to the queue to be executed, and after the execution result of the third task is obtained, a second thread of the second task is created;

[0032] If it is determined that the execution of the second task does not depend on the third task, a second thread of the second task is created.

[0033] Optionally, the method as above further includes:

[0034] If it is determined that the completion status of the task request is execution failure, the tasks that have not been executed among the multiple tasks will no longer be executed;

[0035] A second task response is sent to the client, where the second task response indicates that the task request execution failed.

[0036] Optionally, the method as above further includes:

[0037] When executing each task, start the thread corresponding to the task, execute the at least two subtasks asynchronously according to the dependency relationship between the at least two subtasks in the task, release the thread after the execution is completed, and establish a new thread to obtain the execution results of the at least two subtasks;

[0038] The execution result of the task is determined according to the execution results of at least two subtasks.

[0039] In a second aspect, the present application provides a task processing device, comprising:

[0040] A receiving module, used for receiving a task request from a client, wherein the task request includes multiple tasks, and each task includes at least two subtasks having a dependency relationship;

[0041] The acquisition module is used to arrange multiple tasks and generate a directed acyclic graph corresponding to the task request. The directed acyclic graph is used to indicate the execution order and dependency relationship of multiple tasks.

[0042] The execution module is used to execute multiple tasks according to the directed acyclic graph.

[0043] In a third aspect, the present application provides an electronic device, including:

[0044] a processor, and a memory communicatively coupled to the processor;

[0045] Memory stores computer-executable instructions;

[0046] The processor executes the computer execution instructions stored in the memory, so that the electronic device executes any one of the task processing methods in the first aspect.

[0047] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the task processing method as described in any one of the first aspects.

[0048] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which implements any task processing method in the first aspect when executed by a processor.

[0049] The task processing method, device, electronic device, storage medium and program product provided by the present application, wherein the task processing method comprises: receiving a task request from a client, wherein the task request comprises multiple tasks, and each task comprises at least two subtasks with dependencies; arranging multiple tasks, generating a directed acyclic graph corresponding to the task request, and the directed acyclic graph is used to indicate the execution order and dependencies of multiple tasks; and executing multiple tasks according to the directed acyclic graph. The method uses a directed acyclic graph to describe the interdependence of tasks, and the execution and advancement of tasks rely on the calculation of the directed acyclic graph. The processing process is efficient and reliable, and threads can be created in batches to execute multiple tasks synchronously, saving time costs. At least two subtasks in each task can be executed asynchronously without occupying execution resources, thereby achieving the technical effect of improving resource utilization of task processing and improving task processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0051] Figure 1 A flowchart of a task processing method provided in an embodiment of the present application;

[0052] Figure 2 A schematic diagram of an execution subject of a task processing method provided in an embodiment of the present application;

[0053] Figure 3A schematic diagram of a process flow of generating a directed acyclic graph of task requests provided in an embodiment of the present application;

[0054] Figure 4 A schematic diagram of a process for executing multiple tasks according to a directed acyclic graph provided in an embodiment of the present application;

[0055] Figure 5 A schematic diagram of a directed acyclic graph consisting of multiple tasks and dependencies between multiple tasks provided in an embodiment of the present application;

[0056] Figure 6 A flowchart of a subtask state machine provided in an embodiment of the present application;

[0057] Figure 7 A flowchart of a task state machine provided in an embodiment of the present application;

[0058] Figure 8 A schematic diagram of the structure of a task processing device provided in an embodiment of the present application;

[0059] Fig. 9 A hardware structure diagram of an electronic device provided in an embodiment of the present application.

[0060] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0061] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0062] First, the terms involved in this application are explained:

[0063] Directed Acyclic Graph: DAG is a graph structure in which the edges have directions and there is no path from a vertex back to the vertex along the edges. DAG is widely used in computer science and mathematics. In operating systems, task scheduling can use DAG to represent the dependencies between tasks. Each task is a vertex, and the edges represent the dependencies between tasks.

[0064] A task request refers to a specific task or requirement instruction submitted by a user to the system through the system interface or API (application programming interface) of the task processing system. After receiving the task request, the system will process it according to preset logic and rules, which may involve operations such as data storage, calculation, logical judgment, and interaction with other systems. It will eventually generate a response result and feed it back to the user.

[0065] In the prior art, the method for handling complex task scenarios is to create a large task processing method and call each task operation according to the task logic sequence; during the execution of a task, the next task of the task needs to obtain the execution result of the task before it can be executed. The unexecuted tasks occupy system resources to synchronously wait for the execution results of their associated tasks, which seriously consumes system resources. If an asynchronous execution scenario is encountered, it is even more necessary to occupy execution resources to poll the task execution results. Therefore, the prior art has problems such as low resource utilization and low task processing efficiency.

[0066] The task processing method, device, electronic device, storage medium and program product provided by the present application are designed to improve the efficiency of task processing and reduce the occupation of execution resources by task processing, so as to solve the technical problems of low efficiency of task processing and occupation of execution resources during task execution. The method receives a task request from a client, arranges multiple tasks in the task request, generates a directed acyclic graph corresponding to the task request, and the directed acyclic graph is used to indicate the order and dependency of executing multiple tasks, and then executes multiple tasks according to the directed acyclic graph. The execution and advancement of tasks in the method rely on the calculation of the directed acyclic graph, the processing process is efficient and reliable, and threads can be created in batches to execute multiple tasks synchronously, saving time and cost. The subtasks in the task can be executed in an asynchronous manner without occupying execution resources, thereby achieving the technical effect of improving the resource utilization rate of task processing and improving the efficiency of task processing.

[0067] The data transmission method provided in this application is intended to solve the above technical problems in the prior art.

[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0069] Figure 1 Schematic diagram of the task processing method provided in the embodiment of the present application Figure 1 The execution subject of the task processing method provided in this embodiment may be a task processing system, which may be a server, a computer, a mobile device, etc. Figure 1As shown, the task processing method provided in this embodiment includes:

[0070] S101, receiving a task request from a client, wherein the task request includes multiple tasks, and each task includes at least two subtasks having a dependency relationship.

[0071] In the embodiment of the present application, the task processing system includes an asynchronous task engine and a process orchestration, the asynchronous task engine is used to execute and control asynchronous tasks, and the process orchestration is used to orchestrate multiple tasks, such as Figure 2 As shown, the process orchestration includes an orchestration scheme, an execution plan, a node execution, a directed acyclic graph, and an expression engine, and the asynchronous task engine includes a task state machine, a task extension point, a subtask state machine, and a subtask extension point. Among them, the orchestration scheme is a choreography scheme for multiple tasks, the execution plan is a plan that indicates the sequence and dependency of the execution of multiple tasks, the execution plan uses a directed acyclic graph to describe the execution sequence and dependency of multiple tasks, the node execution is the execution of the node that refers to the task in the directed acyclic graph, and the expression engine is a component that can parse and calculate expressions; the task state machine is used to control the execution of tasks, and the subtask state machine is used to control the execution of subtasks. Each state of tasks and subtasks has its action extension point, and the extension point is formulated by the engine user through code. A possible implementation scheme is to implement a fixed interface method, and the engine automatically executes the extension point when the task and subtask flow to the corresponding state. An asynchronous task consists of a two-level structure of tasks and subtasks. Multiple tasks are independent of each other, and the order of task execution is resolved by process orchestration. A task contains one or more subtasks. If a subtask depends on the execution results of other subtasks and needs to wait until other subtasks are completed before it can be executed, this relationship is called a subtask dependency. There is an attribute in the subtask data structure that can record this dependency.

[0072] In an embodiment of the present application, a user submits a task request through a client, and a task processing system receives the task request from the client. The task request includes multiple tasks, and the task can be split into at least two subtasks. The specific splitting of the task into at least two subtasks and the dependency relationship between at least two subtasks in the task are pre-set.

[0073] S102: Arrange multiple tasks and generate a directed acyclic graph corresponding to the task request, where the directed acyclic graph is used to indicate the execution order and dependency relationship of the multiple tasks.

[0074] In an embodiment of the present application, a task request includes multiple task identifiers, and configuration information corresponding to the multiple task identifiers is obtained from a task configuration database. Based on the configuration information corresponding to the multiple task identifiers, a directed acyclic graph for executing the task request is generated.

[0075] In the embodiment of the present application, the task request includes multiple task identifiers, and the method for arranging the multiple tasks and generating a directed acyclic graph corresponding to the task request may also include:

[0076] According to the task identifier, configuration information corresponding to the multiple task identifiers is obtained from a task configuration database, wherein the configuration information corresponding to the task identifier includes dependency relationships between the tasks corresponding to the task identifiers; the task configuration database includes configuration information of the multiple tasks;

[0077] A directed acyclic graph of task execution requests is generated according to configuration information corresponding to multiple task identifiers.

[0078] In an embodiment of the present application, a task configuration database is pre-set, and the task configuration database includes configuration information of multiple tasks. Configuration information corresponding to multiple task identifiers is obtained from the task configuration database. According to the configuration information corresponding to the multiple task identifiers, the dependency relationship between the tasks corresponding to the multiple task identifiers is obtained, and a directed acyclic graph for executing task requests is generated. The configuration information of multiple tasks includes task identifiers, task types, parameters for task execution, whether the task supports batch execution, and other tasks and their task types that the task execution needs to rely on. Among them, the task identifier can uniquely determine a task, the task type refers to the operation that the system needs to perform when it can find the user-customized execution task based on the task type, the parameters for task execution refer to the input parameters for task execution, and the output parameters after the task execution, and the other task types that the task execution needs to rely on are one of the determining factors of the order of task execution in process scheduling. In some embodiments, in a resource scheduling scenario, the task type may refer to the resource type, the parameters for task execution may be the parameters required for resource creation and the attribute values ​​after creation, and whether the task supports batch execution may be whether the resource can be created in batches.

[0079] In an embodiment of the present application, the task configuration database also includes orchestration configuration information of multiple tasks, the orchestration configuration information includes an orchestration identifier, all tasks included in the orchestration, and task dependencies customized by the orchestration, wherein the orchestration identifier can uniquely identify the orchestration configuration of a task request, and all tasks included in the orchestration are a set of task identifiers. When arranging customized task dependencies, in addition to the fixed dependency of a task on other tasks, the user can also customize specific dependencies between tasks in this orchestration.

[0080] Among them, in the embodiment of the present application, the method of generating a directed acyclic graph of execution task requests according to the configuration information corresponding to the multiple task identifiers may also include:

[0081] According to the multiple tasks included in the configuration information corresponding to the multiple task identifiers, multiple task nodes are constructed, where one task node corresponds to one task;

[0082] According to the dependency relationship between the multiple tasks in the configuration information corresponding to the multiple task identifiers, multiple directed edges are constructed, where one directed edge is used to indicate a pair of two tasks having a dependency relationship and an execution order of the two tasks;

[0083] A directed acyclic graph is generated according to the constructed multiple task nodes and multiple directed edges.

[0084] In the embodiment of the present application, configuration information corresponding to multiple task identifiers is obtained, and the configuration information corresponding to the multiple task identifiers includes multiple tasks and dependencies between the tasks. A directed acyclic graph is constructed based on the multiple tasks and dependencies between the tasks. Figure 3 As shown, for each task, a task node list is created according to the task batch configuration and the number of executions of the task in the task execution parameters. A task node can refer to one task, and a task may correspond to multiple task nodes according to its batch configuration. For each task node, according to the dependency relationship between the task corresponding to the task identifier in the task node and other tasks, a directed edge is created for the dependency relationship of each task node to form a directed edge list, thereby constructing multiple task nodes and multiple directed edges, thereby generating a directed acyclic graph of the task request.

[0085] S103. Execute multiple tasks according to the directed acyclic graph.

[0086] In an embodiment of the present application, a directed acyclic graph is used to indicate multiple tasks for executing a task request, as well as dependencies and execution order of the multiple tasks. According to the directed acyclic graph, multiple tasks corresponding to the task request are executed.

[0087] In the embodiment of the present application, when executing multiple tasks, at least two subtasks in each task are executed asynchronously.

[0088] In an embodiment of the present application, when executing each task, the thread corresponding to the task is started, and at least two subtasks are asynchronously executed according to the dependency relationship between at least two subtasks in the task, and the thread is released after the execution is completed, and a new thread is established to obtain the execution results of at least two subtasks. According to the execution results of at least two subtasks, the execution result of the task can be determined. According to the directed acyclic graph, multiple tasks corresponding to the task request are executed, and the execution results of the multiple tasks are obtained through the asynchronous task engine. According to the execution results of the multiple tasks, the completion status of the task request is determined, and a task response is sent to the client, and the task response is used to indicate the completion status of the task request.

[0089] The task processing method provided by the present application receives a task request from a client, wherein the task request includes multiple tasks, and each task includes at least two subtasks with dependencies; multiple tasks are arranged to generate a directed acyclic graph corresponding to the task request, and the directed acyclic graph is used to indicate the execution order of multiple tasks and the dependencies; multiple tasks are executed according to the directed acyclic graph. The method uses a directed acyclic graph to describe the interdependence of tasks. The execution and advancement of tasks rely on the calculation of the directed acyclic graph. The processing process is efficient and reliable. Threads can also be created in batches to execute multiple tasks synchronously, saving time costs. At least two subtasks in each task can be executed asynchronously without occupying execution resources, achieving the technical effect of improving resource utilization and task processing efficiency in task processing.

[0090] Figure 4 Schematic diagram of the task processing method provided in the embodiment of the present application Figure 2 .like Figure 4 As shown in the above Figure 1 Based on the illustrated embodiment, a task processing method for executing multiple tasks according to a directed acyclic graph in the above step S103 is described in detail. The method includes:

[0091] S401. Create a first thread according to a directed acyclic graph, where the first thread is used to execute a first task among multiple tasks, and the execution of the first task does not depend on the execution results of other tasks in the directed acyclic graph.

[0092] In an embodiment of the present application, a first thread is created according to a directed acyclic graph, and the first thread is used to execute tasks that do not depend on the execution results of other tasks in the directed acyclic graph, that is, the first thread is used to execute tasks referred to by nodes with an in-degree of 0 in the directed acyclic graph. For example, according to the configuration information corresponding to multiple task identifiers, a directed acyclic graph for executing task requests is generated, such as Figure 5 As shown, the multiple tasks included in the task request are task A, task B, task C, task D, task E, task F, task G, and task H, among which task A and task B have no other dependent tasks, task C depends on task A, task D depends on task A and task E, task F depends on task C and task D, task E depends on task B, task G depends on task D and task E, and task H depends on task F and task G. According to tasks A to task H included in the task request, task nodes A to task nodes H are constructed; according to the dependency relationship between tasks A to task H, directed edges e1 to directed edges e10 are constructed; according to the constructed multiple task nodes A to H and multiple directed edges e1 to e10, a directed acyclic graph of the task request is generated. Among which, task A and task B have no other dependent tasks, so in Figure 5In the directed acyclic graph, the execution of the task does not depend on the execution results of other tasks in the directed acyclic graph. The first tasks are task A and task B, and a first thread is created to execute task A and task B.

[0093] S402: Obtain the execution result of the first task.

[0094] In the embodiment of the present application, the task state machine is started when the first thread is created, and the execution result and execution status of the first task are detected through the task state machine to obtain the execution result of the first task. For each first task, the input parameters of the task execution are obtained according to the configuration information of the task, and the system calls the user-customized task execution interface according to the task type, executes the user-customized task, returns the task identifier and the output parameters of the task execution, and obtains the execution result of the first task; the task identifier, task node identifier, input parameters of the task execution, execution status of the task and other information in the task execution process are associated into an execution process record, which is stored in the system's memory.

[0095] S403: If the execution result of the first task indicates that its execution status is successful, create multiple second threads, and the multiple second threads are respectively used to execute multiple second tasks that have a dependency relationship with the first task.

[0096] In the embodiment of the present application, the execution of the second task depends on the successful execution result of the first task. If the execution result of the first task indicates that its execution status is successful, then according to the directed acyclic graph corresponding to the task request, find the second task node that depends on the first task. Create multiple second threads for executing multiple second tasks that have a dependency relationship with the first task. For example, Figure 5 As shown, the first tasks are Task A and Task B, the second tasks that have a dependency relationship with Task A are Task C and Task D, and the second task that has a dependency relationship with Task B is Task E. When the execution results of Task A and Task B indicate that their execution status is successful, multiple second threads are created to execute Task C, Task D, and Task E.

[0097] In this embodiment of the present application, the method for creating multiple second threads may further include:

[0098] respectively determining whether the execution of each of the plurality of second tasks depends on a third task, where the third task is a task other than the first task among the plurality of tasks;

[0099] If it is determined that the execution of the second task depends on the third task, the second task is added to the queue to be executed, and after the execution result of the third task is obtained, a second thread of the second task is created;

[0100] If it is determined that the execution of the second task does not depend on the third task, a second thread of the second task is created.

[0101] In an embodiment of the present application, the second thread of the second task is created. The premise for executing each second task is that all the tasks on which the second task depends are executed. The execution of each second task requires obtaining the execution results of all the tasks on which it depends, and the execution results of all the tasks on which it depends can be used as input information for the execution of the second task. According to the directed acyclic graph of the task request, after the first task is completed, all the successor nodes of the task node corresponding to the first task in the directed acyclic graph are found, that is, the task nodes corresponding to multiple second tasks; for each successor node, all the predecessor nodes of the successor node are found, that is, the nodes of all other tasks on which the second task depends. The task on which the second task depends can be the first task, or it may be other tasks other than the first task, that is, the third task. If it is determined that the execution of the second task depends on the third task in addition to the first task, the second task is added to the queue to be executed, and after obtaining the execution result of the third task, the second thread of the second task is created; if it is determined that the execution of the second task does not depend on the third task, there is no need to wait for the execution result of the third task to create the second thread of the second task. If it is determined that all tasks referred to by the predecessor nodes of the node corresponding to the second task have been completed, that is, all tasks that the second task depends on have been completed, then the node of the second task is added to the set of nodes to be executed, and the second thread of the second task is created, and the thread is executed after the system resources are ready. Figure 5 As shown, the second task is task C, task D, and task E, wherein the execution of task D depends on task A and task E, task A is the first task, and task E is not the first task, so task E is the third task. The execution of the second task D depends on the third task E. After the execution result of the first task A indicates that its execution status is successful, the second task D is added to the queue to be executed until the execution result of the third task E indicates that its execution status is successful. After obtaining the execution result of the third task E, the second thread of the second task can be created and the second task D can be executed. The second task C depends on the first task A, the second task E depends on the first task B, and the second task C and the second task E have no dependent third task, so the second thread of the second task C and the second thread of the second task E are created.

[0102] S404: Obtain the execution result of the second task.

[0103] In an embodiment of the present application, a task state machine is started while creating a second thread. The task state machine can control the execution of the second task, detect the execution result of the second task, and record its execution status. The execution result and execution status of the second task are detected by the task state machine to obtain the execution result of the second task. For each second task, the input parameters of the task execution are obtained according to the configuration information of the task. The system calls the user-customized task execution interface according to the task type, executes the user-customized task, returns the task identifier and the output parameters of the task execution, and obtains the execution result of the second task; the task identifier, task node identifier, input parameters of the task execution, execution status of the task and other information in the execution process of the second task are associated into an execution process record, which is stored in the memory of the system.

[0104] S405: Repeat the above steps of creating threads to obtain execution results of multiple tasks.

[0105] In the embodiment of the present application, according to the dependencies and execution order of multiple tasks in the directed acyclic graph of the task request, the above-mentioned steps of creating threads are repeated to obtain the execution results of multiple tasks. Figure 5 As shown, task F depends on task C and task D, and task G depends on task D and task G. The above steps of creating threads are repeated. If the execution results of the second task C, the second task D, and the second task E all indicate that the execution status is successful, threads are created for task F and task G respectively, which are used to execute task F and task G that have a dependency relationship with the second task, and obtain the execution results of task F and task G; task H depends on task F and task G. The above steps of creating threads are repeated. If the execution results of task F and task G all indicate that their execution status is successful, a thread is created for task H, which is used to execute task H that has a dependency relationship with task F and task G, and obtain the execution result of task H. So far, the execution results of multiple tasks A to task H have been obtained.

[0106] In the embodiment of the present application, the method of repeating the above-mentioned step of creating threads to obtain the execution results of multiple tasks may also include:

[0107] When executing each task, start the thread corresponding to the task, execute the at least two subtasks asynchronously according to the dependency relationship between the at least two subtasks in the task, release the thread after the execution is completed, and establish a new thread to obtain the execution results of the at least two subtasks;

[0108] The execution result of the task is determined according to the execution results of at least two subtasks.

[0109] In an embodiment of the present application, when executing each task, the system starts the thread corresponding to the task. When the system resources are ready, according to the dependency relationship between at least two subtasks in the task, the non-dependent subtasks in the task are executed. After the subtask execution action starts, the thread is released, the system resources occupied by the subtask are released, and the specific execution of the subtask is handed over to other resources of the external system for execution without occupying system resources. The released system resources are used to execute other subtasks. After the subtasks executed in other resources are completed, the execution result of the subtask will be queried by the engine polling or notified by the external system to the engine, and the system will establish a new thread to obtain the execution result of the subtask. After the other subtasks in the task are successfully executed, a new thread is established to execute the subtask, and the new thread enters the list to be executed and starts to execute when the system resources are ready. The specific execution of the subtask is handed over to other resources of the external system to save system resources and the waiting time of other subtasks to be executed, and improve the processing efficiency of the task.

[0110] In an asynchronous scenario, system resources are not always occupied, and multiple subtasks can be executed at the same time. When system resources are insufficient, other unexecuted subtasks are put into the waiting list in turn, and the subtasks in the waiting list are executed in turn after the resources are released. Since the system is built on a fully asynchronous basis, the tasks will not be completed immediately.

[0111] In some embodiments, there is an attribute in the data structure of the subtask to record the dependency of the subtask, and the numbers of all dependent subtasks are recorded in this attribute, and the dependent subtasks or other subtasks that depend on the subtask are recorded. Multiple dependent tasks can be separated by commas. During the execution of multiple subtasks, the dependency of the subtasks can be obtained according to the configuration information of the task or the attribute information of the subtask itself, and the execution of each subtask can be controlled.

[0112] In the embodiment of the present application, the system detects the execution result of the subtask through the subtask state machine configured in the system to obtain the execution result of the subtask. Whether the execution result of the subtask is successful or failed, it can be obtained in two ways. The first way is that the user customizes the method of querying the execution result of the subtask, and the system polls and queries to obtain the execution result of the subtask. The second way is that the external system notifies the task processing system to obtain the execution result of the subtask, for example, the payment task often uses the payment result callback to obtain the execution result.

[0113] In the embodiment of the present application, the execution status of the subtask can be recorded by the subtask state machine configured in the asynchronous task engine in the task processing system. According to the task request, multiple tasks are arranged, and while generating a directed acyclic graph of multiple tasks, each task is automatically split into at least two subtasks, and the subtask state machine initializes at least two subtasks to the initialization state, such as Figure 6 As shown. When executing each of the multiple tasks, at least two subtasks are generated, and a ready event is emitted to each subtask in each task. If a subtask has no dependent subtasks or all dependent subtasks have been successfully executed, the flow will be transferred to the pending state, and a thread or object for executing this subtask will be delivered to the system at the same time. There are different implementations for delivering execution tasks, and thread pools and Runnable objects can be used. The subtask needs to wait for all other subtasks it depends on to complete, and obtain the execution results of other subtasks it depends on before executing this subtask. If there are unexecuted or failed subtasks among the other subtasks that the subtask depends on, the thread or object for executing the subtask cannot be delivered, and the state will not be changed to the pending state. For example, task A contains subtasks A1, A2, and A3. Subtask A2 depends on subtask A1, and subtask A3 depends on subtask A2. Subtask A1 has no dependent subtasks, and all subtasks are in the initialization state. When task A starts, it emits ready events to subtasks A1, A2, and A3 respectively. Since subtask A1, on which subtasks A2 and A3 depend, has not been completed, subtasks A2 and A3 cannot be transferred to the pending state. However, since subtask A1 has no dependent subtasks, it can be transferred to the pending state and a thread or object for executing this subtask is delivered to the system.

[0114] In an embodiment of the present application, when executing multiple tasks, the execution of subtasks in a task will occupy system resources. In order to improve system throughput and improve system resource utilization, at least two subtasks in each task are executed asynchronously. In an asynchronous scenario, when system resources are ready, the subtask in the pending state is started, and an execution event is emitted to the subtask. The subtask state flows to the executing state. At this time, the subtask will occupy system resources, and the thread corresponding to the parent task of the subtask is started, and an action to start execution is issued. After the subtask issues the action to start execution, the thread is released, and the subtask does not need to occupy system resources for execution. The system resources occupied by this subtask will be released, and the released system resources are used to execute the subtasks in the task waiting to be executed.

[0115] In the embodiment of the present application, in order to prevent the execution of the subtask from occupying too many system resources, after the subtask issues the action of starting execution, the system hands over the specific execution of the subtask to other resources, and releases the system resources occupied by the subtask at the same time. The released system resources are used to execute other subtasks to be executed, and the execution of other subtasks does not need to wait for the execution result of the subtask, so as to achieve the purpose of at least two subtasks in the asynchronous execution task, and can save system resources and the waiting time of other subtasks to be executed, and improve the processing efficiency of the task. Therefore, in the task processing system, the thread of the subtask issues the action of starting execution, which means that the execution of the subtask in the system has been completed, and the subtask has been handed over to other resources for execution. The specific execution of the subtask can be executed in the thread or object delivered in the state of waiting to be executed by calling the interface, or the subtask can be transferred to other resources of the device for execution, such as local resources. The system monitors the result of the execution of the subtask through the port on the server side. If the subtask is completed, the execution result will be returned to the asynchronous task engine, and the asynchronous task engine needs to establish a new thread to obtain the execution result of the subtask. According to the execution result of the subtask, if the execution result of the subtask indicates that the execution is successful, other subtasks having dependencies thereon are triggered, and ready events are emitted to the other subtasks.

[0116] The subtask state machine controls the execution of subtasks such as Figure 6 As shown, if the subtask is executed successfully, the engine receives the event of successful execution of the subtask, and emits the execution success event to the subtask. The subtask status changes to successful execution, and the execution result of the subtask is obtained. The engine executes the success extension point of the subtask, and the success extension point of the subtask includes many specific execution methods or actions, one of which is to emit a ready event to other subtasks that belong to the same task and depend on the subtask. If the subtask fails to execute, the engine receives the event of failed execution of the subtask, and emits the execution failure event to the subtask. The subtask status changes to execution failure. The engine executes the failure extension point of the subtask, and updates the execution status of other subtasks that belong to the same task and depend on the subtask to cancel through the interface of the failure extension point. After the task state machine detects that the status of the subtask in the task is canceled, the execution status of the parent task of the subtask will be updated to execution cancellation. According to the directed acyclic graph, all the successor task nodes of the parent task of the subtask are found, and the recursive call will also update the execution status of all the successor tasks that have a dependency relationship with the parent task of the subtask to execution cancellation.

[0117] In the embodiment of the present application, each state of a task and a subtask has its extension point, which includes many specific execution methods or actions. The extension point is formulated by the system user through code. A possible implementation scheme is to implement a fixed interface method. When the task and subtask flow to the corresponding state, the system automatically executes the extension point. The extension point contains a set of interfaces, and tasks and subtasks trigger events through the interface. Among them, the extension point can be an interface for sending ready events to other subtasks, or a ready event for a subtask in task execution to trigger another subtask to execute, and an interface that can record changes in the execution status of a task or subtask. The extension point of the subtask can trigger changes in the status of the parent task of the subtask.

[0118] In the embodiment of the present application, the execution result of a task is determined according to the execution results of at least two subtasks. The execution status of each task is determined by the status of all its subtasks, such as Figure 7 As shown, according to the execution results of at least two subtasks, the execution result of each task is determined, and the system detects the execution status of the task through the task state machine configured in the asynchronous task engine. According to the task request, multiple tasks are arranged to generate a directed acyclic graph of multiple tasks. In the task state machine, multiple tasks are initially in the waiting state. If the first subtask of the task starts to execute, the subtask state flows to the executing state, and the waiting state of the task flows to the executing state; if the execution result of the first subtask of the task is successful, the task flows to the partially successful state, and the engine executes the partially successful extension point, which is used to execute other subtasks contained in the task; if all subtasks contained in the task are successfully executed, all subtask success events are emitted to the task, and the execution state of the task flows to the successful execution, and the engine executes the successful extension point, which is used to execute the specified event after the task is successfully executed; if any subtask of the task fails to execute, the task state flows to the execution failure, and the engine executes the failed extension point, which is used to cancel the execution of subsequent tasks, and no longer execute the tasks that have not been executed in multiple tasks.

[0119] In an embodiment of the present application, the execution status of a task needs to be determined based on the execution status of all its subtasks. Extension points are also reserved for key points in the task execution process, which can be embedded in other target systems in the form of SDK (Software Development Kit), making it easy to operate and expand. The task execution process is efficient and reliable, thereby improving the efficiency of task execution.

[0120] S406: Determine the completion status of the task request according to the execution results of the multiple tasks.

[0121] In an embodiment of the present application, if the execution results of multiple tasks included in the task request all indicate that the execution status of the tasks is any one of successful execution, failed execution, or canceled execution, then it means that the task request has been executed. At this time, the completion status of the task request may be successful execution or failed execution.

[0122] In the embodiment of the present application, the method for determining the completion status of a task request according to the execution results of multiple tasks may also include:

[0123] If the execution results of the multiple tasks all indicate that their execution status is successful, determining the completion status of the task request is successful;

[0124] If the execution result of at least one task among the multiple tasks indicates that its execution status is execution failure, it is determined that the completion status of the task request is execution failure.

[0125] In an embodiment of the present application, the execution status of the execution process records of all tasks must be exhaustively enumerated, or the execution results of all tasks must be exhaustively enumerated. If the execution results of multiple tasks or the execution status of the execution process records all indicate that their execution status is successful, the completion status of the task request is updated to successful execution; if the execution result of at least one task among multiple tasks indicates that its execution status is failed execution or canceled execution, the completion status of the task request is failed execution.

[0126] In the embodiment of the present application, the method for determining the completion status of a task request according to the execution results of multiple tasks may also include:

[0127] If the execution result of any task among the multiple tasks indicates that its execution status is execution failure, determining the completion status of the task request is execution failure, and no longer executing the unexecuted tasks among the multiple tasks;

[0128] A second task response is sent to the client, where the second task response indicates that the task request execution failed.

[0129] In an embodiment of the present application, if the execution result of any task among multiple tasks indicates that its execution status is execution failure, the tasks that have not been executed among the multiple tasks will no longer be executed, the execution status of the tasks that have not been executed will be updated to execution cancellation, the completion status of the task request will be execution failure, and a second task response will be sent to the client, and the second task response indicating the failure of the task request to execute will be fed back to the client.

[0130] S407: Send a first task response to the client, where the first task response indicates a completion status of the task request.

[0131] In the embodiment of the present application, a first task response is generated according to the completion status of the task request, the first task response is sent to the client, and the first task response is fed back to the client.

[0132] Figure 8 This is a schematic diagram of the structure of the task processing device provided in the embodiment of the present application. The device of this embodiment can be in the form of software and / or hardware. Figure 8 As shown, a task processing device 800 provided in an embodiment of the present application includes: a receiving module 801, an acquiring module 802, and an executing module 803;

[0133] The receiving module 801 is used to receive a task request from a client, wherein the task request includes multiple tasks, and each task includes at least two subtasks having a dependency relationship;

[0134] The acquisition module 802 is used to arrange multiple tasks and generate a directed acyclic graph corresponding to the task request, where the directed acyclic graph is used to indicate the execution order and dependency relationship of the multiple tasks;

[0135] The execution module 803 is used to execute multiple tasks according to the directed acyclic graph.

[0136] Optionally, in the above method, the execution module 403 may also be used to:

[0137] When executing multiple tasks, at least two subtasks in each task are executed asynchronously.

[0138] Optionally, in the above method, the acquisition module 802 may also be used to:

[0139] According to the task identifier, configuration information corresponding to the multiple task identifiers is obtained from a task configuration database, wherein the configuration information corresponding to the task identifier includes dependency relationships between the tasks corresponding to the task identifiers; the task configuration database includes configuration information of the multiple tasks;

[0140] A directed acyclic graph of task execution requests is generated according to configuration information corresponding to multiple task identifiers.

[0141] Optionally, in the above method, the acquisition module 802 may also be used to:

[0142] According to the multiple tasks included in the configuration information corresponding to the multiple task identifiers, multiple task nodes are constructed, where one task node corresponds to one task;

[0143] According to the dependency relationship between the multiple tasks in the configuration information corresponding to the multiple task identifiers, multiple directed edges are constructed, where one directed edge is used to indicate a pair of two tasks having a dependency relationship and an execution order of the two tasks;

[0144] A directed acyclic graph is generated according to the constructed multiple task nodes and multiple directed edges.

[0145] Optionally, in the above method, the execution module 803 may also be used to:

[0146] According to the directed acyclic graph, a first thread is created, where the first thread is used to execute a first task among the multiple tasks, and the execution of the first task does not depend on the execution results of other tasks in the directed acyclic graph;

[0147] Obtain the execution result of the first task;

[0148] If the execution result of the first task indicates that its execution status is successful, create multiple second threads, and the multiple second threads are respectively used to execute multiple second tasks that have a dependency relationship with the first task;

[0149] Obtaining the execution result of the second task;

[0150] Repeat the above steps of creating threads to obtain the execution results of multiple tasks.

[0151] Optionally, in the above method, the execution module 803 may also be used to:

[0152] Determine the completion status of the task request based on the execution results of multiple tasks;

[0153] A first task response is sent to the client, where the first task response indicates a completion status of the task request.

[0154] Optionally, in the above method, the execution module 803 may also be used to:

[0155] If the execution results of the multiple tasks all indicate that their execution status is successful, determining the completion status of the task request is successful;

[0156] If the execution result of at least one task among the multiple tasks indicates that its execution status is execution failure, it is determined that the completion status of the task request is execution failure.

[0157] Optionally, in the above method, the execution module 803 may also be used to:

[0158] respectively determining whether the execution of each of the plurality of second tasks depends on a third task, where the third task is a task other than the first task among the plurality of tasks;

[0159] If it is determined that the execution of the second task depends on the third task, the second task is added to the queue to be executed, and after the execution result of the third task is obtained, a second thread of the second task is created;

[0160] If it is determined that the execution of the second task does not depend on the third task, a second thread of the second task is created.

[0161] Optionally, in the above method, the execution module 803 may also be used to:

[0162] If the execution result of any task among the multiple tasks indicates that its execution status is execution failure, determining the completion status of the task request is execution failure, and no longer executing the unexecuted tasks among the multiple tasks;

[0163] A second task response is sent to the client, where the second task response indicates that the task request execution failed.

[0164] Optionally, in the above method, the execution module 803 may also be used to:

[0165] When executing each task, start the thread corresponding to the task, execute the at least two subtasks asynchronously according to the dependency relationship between the at least two subtasks in the task, release the thread after the execution is completed, and establish a new thread to obtain the execution results of the at least two subtasks;

[0166] The execution result of the task is determined according to the execution results of at least two subtasks.

[0167] Fig. 9 The hardware structure diagram of the electronic device provided in the embodiment of the present application. Fig. 9 As shown, the electronic device 900 provided in this embodiment includes:

[0168] At least one processor 901 and a memory 902. Optionally, the device 900 further includes a communication component 903. The processor 901, the memory 902 and the communication component 903 are connected via a bus 904.

[0169] In a specific implementation process, at least one processor 901 executes the computer execution instructions stored in the memory 902, so that at least one processor 901 executes the above method.

[0170] The specific implementation process of the processor 901 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0171] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0172] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0173] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0174] The embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the task processing method.

[0175] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which implements the task processing method when executed by a processor.

[0176] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0177] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0178] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0179] It should be further noted that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flow chart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0180] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0181] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0182] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0183] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0184] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0186] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A task processing method, characterized in that: include: Receiving a task request from a client, wherein the task request includes a plurality of tasks, and each task includes at least two subtasks having a dependency relationship; Arrange the multiple tasks to generate a directed acyclic graph corresponding to the task request, wherein the directed acyclic graph is used to indicate the execution order and dependency relationship of the multiple tasks; The plurality of tasks are executed according to the directed acyclic graph.

2. The method according to claim 1, characterized in that When executing the multiple tasks, at least two subtasks in each task are executed asynchronously.

3. The method according to claim 1 or 2, characterized in that: The task request includes a plurality of task identifiers, and the arranging the plurality of tasks to generate a directed acyclic graph corresponding to the task request includes: Acquire configuration information corresponding to the multiple task identifiers from a task configuration database, wherein the configuration information corresponding to each task identifier includes a dependency relationship between the task corresponding to the task identifier and other tasks, and the task configuration database includes configuration information of multiple tasks; A directed acyclic graph for executing the task request is generated according to the configuration information corresponding to the multiple task identifiers.

4. The method according to claim 3, characterized in that Generating a directed acyclic graph for executing the task request according to the configuration information corresponding to the multiple task identifiers includes: According to the multiple tasks, construct multiple task nodes, one task node corresponds to one task; Constructing a plurality of directed edges according to the dependency relationship between the tasks in the configuration information corresponding to the plurality of task identifiers, wherein one directed edge is used to indicate a pair of two tasks having a dependency relationship and an execution order of the two tasks; The directed acyclic graph is generated according to the constructed multiple task nodes and the multiple directed edges.

5. The method according to claim 1 or 2, characterized in that: The performing of the plurality of tasks according to the directed acyclic graph comprises: Creating a first thread according to the directed acyclic graph, where the first thread is used to execute a first task among the multiple tasks, where the execution of the first task does not depend on the execution results of other tasks in the directed acyclic graph; Obtaining the execution result of the first task; If the execution result of the first task indicates that its execution status is successful, create multiple second threads, and the multiple second threads are respectively used to execute multiple second tasks that have a dependency relationship with the first task; Obtaining the execution result of the second task; Repeat the above steps of creating threads to obtain the execution results of the multiple tasks.

6. The method according to claim 5, characterized in that The method further comprises: Determining a completion status of the task request according to the execution results of the multiple tasks; A first task response is sent to the client, where the first task response indicates a completion status of the task request.

7. The method according to claim 6, characterized in that Determining the completion status of the task request according to the execution results of the multiple tasks includes: If the execution results of the multiple tasks all indicate that their execution status is successful, determining the completion status of the task request is successful; If the execution result of at least one task among the multiple tasks indicates that its execution status is execution failure, it is determined that the completion status of the task request is execution failure.

8. The method according to claim 5, characterized in that The creating the plurality of second threads comprises: respectively determining whether the execution of each second task depends on a third task, wherein the third task is a task other than the first task among the plurality of tasks; If it is determined that the execution of the second task depends on the third task, the second task is added to a queue to be executed, and after the execution result of the third task is obtained, a second thread of the second task is created; If it is determined that the execution of the second task does not depend on the third task, a second thread of the second task is created.

9. The method according to claim 7, characterized in that: The method further comprises: If it is determined that the completion status of the task request is execution failure, no longer executing the tasks that have not been executed among the multiple tasks; A second task response is sent to the client, where the second task response indicates that the task request has failed to execute.

10. The method according to claim 5, characterized in that The method further comprises: When executing each task, start the thread corresponding to the task, execute the at least two subtasks in the task asynchronously according to the dependency relationship between the at least two subtasks, release the thread after the execution is completed, and establish a new thread to obtain the execution results of the at least two subtasks; The execution result of the task is determined according to the execution results of the at least two subtasks.

11. A task processing device, characterized in that: include: A receiving module, configured to receive a task request from a client, wherein the task request includes a plurality of tasks, and each task includes at least two subtasks having a dependency relationship; An acquisition module, used to arrange the multiple tasks and generate a directed acyclic graph corresponding to the task request, wherein the directed acyclic graph is used to indicate the execution order and dependency relationship of the multiple tasks; An execution module is used to execute the multiple tasks according to the directed acyclic graph.

12. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the task processing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the task processing method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the task processing method according to any one of claims 1 to 10 is implemented.