Task optimization method and device, equipment, storage medium and program product

By constructing a directed acyclic graph and merging computation tasks, the problem of independent execution of computation tasks with the same data source within the same execution batch is solved, thereby improving data processing efficiency and computing resource utilization.

CN121996816APending Publication Date: 2026-05-08CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD
Filing Date
2024-11-05
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, the same computational tasks from the same data source within the same execution batch are executed independently, resulting in unnecessary computational overhead and reduced data processing efficiency.

Method used

By constructing a directed relational graph, converting it into a directed acyclic graph, and generating task execution batches based on the directed acyclic graph, computational tasks with the same data table or similar processing logic are merged, the scheduling logic is optimized, and redundant computations are reduced.

Benefits of technology

It improves data processing efficiency, reduces computational overhead, and optimizes the scheduling logic of computational tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121996816A_ABST
    Figure CN121996816A_ABST
Patent Text Reader

Abstract

The invention discloses a task optimization method and device, equipment, a storage medium and a program product, and relates to the technical field of big data analysis, and the task optimization method comprises the steps: obtaining at least two calculation tasks and task information of each calculation task in the at least two calculation tasks; according to the at least two calculation tasks and the task information of each calculation task in the at least two calculation tasks, constructing a directed relation graph; according to a directed acyclic graph corresponding to the directed relation graph, at least one task execution batch is generated, and the at least one task execution batch comprises a calculation task corresponding to at least one directed edge; and for a target task execution batch in the at least one task execution batch, performing task merging on the calculation tasks in the target task execution batch to obtain a merging result. According to the task optimization method, the calculation tasks with the same data source in the same execution batch can be optimized, so that the data processing efficiency is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of big data analysis technology, and in particular relates to a task optimization method, apparatus, device, storage medium and program product. Background Technology

[0002] Virtual Reality (VR) live streaming is a combination of virtual reality and live streaming. VR live streaming uses panoramic cameras to capture video and then transmits the video content to viewers in real time via the network. VR live streaming generates a large amount of real-time data, including user viewing behavior and interaction data. A data platform can collect, process, integrate, and transform this data to better utilize the data generated by VR live streaming, optimize live streaming strategies, and improve live streaming effects.

[0003] A data platform needs to address multiple issues, including data integration, data storage, data processing, and data services. Among these, optimizing data computation tasks is a crucial step in the data platform's processing, directly impacting the efficiency and accuracy of data processing.

[0004] In related technologies, optimizing data computation tasks typically involves dividing multiple computational tasks with dependencies into the same execution batch and executing them sequentially. This optimizes the scheduling logic within the same execution batch, ensuring that each computational task within the batch is scheduled only once, thereby reducing computational resource consumption. However, even with the aforementioned optimization method, computational tasks with the same data source within the same execution batch still need to be executed independently. This leads to unnecessary computational overhead and reduces data processing efficiency. Summary of the Invention

[0005] This application provides a task optimization method, apparatus, device, storage medium, and program product, which can optimize computational tasks with the same data source within the same execution batch, thereby effectively improving data processing efficiency.

[0006] In a first aspect, embodiments of this application provide a task optimization method, which includes:

[0007] Obtain at least two computation tasks and task information for each of the at least two computation tasks, the task information including a first data table and a second data table;

[0008] Based on at least two computation tasks and the task information of each of the at least two computation tasks, a directed relation graph is constructed. The directed relation graph includes a set of graph nodes and a set of directed edges. A graph node in the set of graph nodes represents a first data table or a second data table, and a directed edge in the set of directed edges represents a computation task in the at least two computation tasks.

[0009] Based on the directed acyclic graph corresponding to the directed relation graph, generate at least one task execution batch. The at least one task execution batch includes at least one computation task corresponding to a directed edge. The path lengths from the directed edges corresponding to all computation tasks in each task execution batch to the source node are equal. The source node is a graph node in the graph node set whose in-degree is zero and whose out-degree is greater than zero.

[0010] For a target task execution batch in at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merged result. The target task execution batch includes at least two computational tasks.

[0011] In some implementations of this application, generating at least one task execution batch based on the directed acyclic graph corresponding to the directed relation graph includes:

[0012] In a directed acyclic graph, select graph nodes with an in-degree of zero and an out-degree greater than zero, and construct a source node set;

[0013] For each source node in the source node set, perform the following steps to construct at least one task execution batch corresponding to the source node:

[0014] Traverse the multiple target directed edges associated with the source node. For each target directed edge, calculate the number of directed edges from the source node to the graph node pointed to by the target directed edge, and obtain the path length of the target directed edge.

[0015] Based on multiple target directed edges and the path length of each directed edge in the multiple target directed edges, at least one task execution batch is constructed, wherein the path lengths of the multiple directed edges corresponding to the multiple computation tasks in each task execution batch are the same.

[0016] In some implementations of the embodiments of this application, for a target task execution batch in at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merged result, including:

[0017] If there are at least two first target tasks in the target task execution batch, the at least two first target tasks are merged to obtain a merge result. The directed edge corresponding to each of the at least two first target tasks points from the first dependency data table to the second dependency data table. The first dependency data table is either the first data table or the second data table, and the second dependency data table is either the first data table or the second data table.

[0018] In some implementations of the embodiments of this application, for a target task execution batch in at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merged result, including:

[0019] If there are at least two second target tasks in the target task execution batch, the at least two second target tasks are merged to obtain a merge result. The directed edge corresponding to each of the at least two second target tasks points from the third dependency data table to the first data table or the second data table. The third dependency data table is either the first data table or the second data table.

[0020] In some implementations of this application, when there are at least two directed edges representing the second target in the target task execution batch, the computation tasks corresponding to the at least two directed edges representing the second target are merged to obtain a merged result, including:

[0021] If the number of at least two second target tasks in the target task execution batch is greater than the preset number, at least two second target tasks will be merged to obtain the merged result.

[0022] In some implementations of the embodiments of this application, for a target task execution batch in at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merged result, including:

[0023] If there are at least two second target tasks and at least two first target tasks in the target task execution batch, and one of the at least two second target tasks is a first target task, then the at least two first target tasks are merged to obtain the first subtask.

[0024] Merge at least two secondary objective tasks to obtain a second subtask;

[0025] The first and second subtasks are merged to obtain the merged result.

[0026] In some implementations of the embodiments of this application, for a target task execution batch in at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merged result, including:

[0027] For at least one target task execution batch in a task execution batch, the operators within the computational tasks of the target task execution batch are merged to obtain the merged result.

[0028] In some implementations of the embodiments of this application, a directed relation graph is constructed based on at least two computing tasks and the task information of each of the at least two computing tasks, including:

[0029] Based on at least two computing tasks and the task information of each computing task in at least two computing tasks, determine the dependencies between the computing tasks in at least two computing tasks;

[0030] Iterate through the task information of each of the at least two computation tasks, identify all participating data tables, and generate a graph node set, where each graph node in the graph node set represents either the first data table or the second data table.

[0031] Based on the dependencies between the computational tasks in at least two computational tasks and the set of graph nodes, construct a directed relation graph. The directed relation graph includes a set of directed edges. A directed edge in the set of directed edges represents one of the computational tasks in the at least two computational tasks. A directed edge points from one graph node to another graph node.

[0032] In some implementations of this application, before generating at least one task execution batch based on the directed acyclic graph corresponding to the directed relation graph, the task optimization method further includes:

[0033] The depth-first search algorithm is used to perform graph search on the directed graph to detect loops in the directed graph and obtain the detection results;

[0034] If the detection results indicate the presence of loops in the directed graph, the loops are removed according to a preset delooping strategy to obtain a directed acyclic graph corresponding to the directed graph. The preset delooping strategy includes at least one of the following:

[0035] The process involves deleting directed edges from loops, splitting graph nodes within loops, and modifying dependencies between computational tasks within loops.

[0036] In some implementations of the embodiments of this application, the first data table is used to store live streaming business data, and the second data table is used to store the result data obtained after the execution of the computing task, and the result data is determined based on the live streaming business data.

[0037] Secondly, embodiments of this application provide a task optimization apparatus, which includes:

[0038] The acquisition module is used to acquire at least two computing tasks and task information for each of the at least two computing tasks. The task information includes a first data table and a second data table.

[0039] The construction module is used to construct a directed relation graph based on at least two computing tasks and the task information of each of the at least two computing tasks. The directed relation graph includes a graph node set and a directed edge set. A graph node in the graph node set represents a first data table or a second data table, and a directed edge in the directed edge set represents a computing task in the at least two computing tasks.

[0040] The first generation module is used to generate at least one task execution batch based on the directed acyclic graph corresponding to the directed relation graph. The at least one task execution batch includes at least one computation task corresponding to a directed edge. The path lengths from the directed edges corresponding to all computation tasks in each task execution batch to the source node are equal. The source node is a graph node in the graph node set whose in-degree is zero and whose out-degree is greater than zero.

[0041] The merging module is used to merge the computational tasks in a target task execution batch within at least one task execution batch to obtain a merged result. The target task execution batch includes at least two computational tasks.

[0042] Thirdly, embodiments of this application provide an electronic device, the device including: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements a task optimization method as described in any of the first aspects.

[0043] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the task optimization method as described in any of the first aspects.

[0044] Fifthly, embodiments of this application provide a computer program product, which includes a computer program or instructions that, when executed by a processor, implement the task optimization method as described in any of the first aspects.

[0045] The task optimization method, apparatus, device, storage medium, and program product of this application embodiments acquire at least two computing tasks and their corresponding task information, and construct a directed relationship graph based on this information, illustrating the dependency relationship between computing tasks and data tables. After constructing the directed relationship graph, it is converted into a directed acyclic graph (DAG), and at least one task execution batch is generated based on the structure of the DAG. The computing tasks within each task execution batch satisfy the condition that the path length from the directed edge corresponding to the computing task to the source node is equal. Subsequently, for target task execution batches including at least two computing tasks, a task merging operation is further performed. By merging computing tasks with the same data table or similar processing logic, the scheduling logic within the same target task execution batch is optimized, and computational overhead is reduced and data processing efficiency is improved by reducing redundant computations. Attached Figure Description

[0046] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 A flowchart illustrating a task optimization method provided in some embodiments of this application is shown;

[0048] Figure 2 A flowchart illustrating a specific implementation of step 120 provided in some embodiments of this application is shown;

[0049] Figure 3 A schematic diagram of a directed relationship graph provided in some embodiments of this application is shown;

[0050] Figure 4 A flowchart illustrating a task optimization method provided in some embodiments of this application is shown;

[0051] Figure 5 A schematic diagram of a directed acyclic graph provided in some embodiments of this application is shown;

[0052] Figure 6 A flowchart illustrating a specific implementation of step 130 provided in some embodiments of this application is shown;

[0053] Figure 7 A flowchart illustrating a specific implementation of step 140 provided in some embodiments of this application is shown;

[0054] Figure 8 The present application shows a schematic diagram of the structure of a task optimization apparatus provided in some embodiments;

[0055] Figure 9 The diagram shows a schematic representation of the structure of an electronic device provided in some embodiments of this application. Detailed Implementation

[0056] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0057] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0058] To address the problems in related technologies, embodiments of this application provide a task optimization method, apparatus, device, storage medium, and program product. Based on this, the following description, in conjunction with the appendix... Figure 1 To be continued Figure 6 The task optimization method provided in this application will be described in detail through specific embodiments.

[0059] Figure 1 The diagram illustrates a flowchart of a task optimization method provided in some embodiments of this application. For example... Figure 1 As shown, the task optimization method includes steps 110 to 140.

[0060] Step 110: Obtain at least two computing tasks and task information for each of the at least two computing tasks. The task information includes a first data table and a second data table.

[0061] Step 120: Based on at least two computation tasks and the task information of each of the at least two computation tasks, construct a directed relation graph. The directed relation graph includes a set of graph nodes and a set of directed edges. A graph node in the set of graph nodes represents a first data table or a second data table, and a directed edge in the set of directed edges represents one of the at least two computation tasks.

[0062] Step 130: Based on the directed acyclic graph corresponding to the directed relation graph, generate at least one task execution batch. The at least one task execution batch includes a computation task corresponding to at least one directed edge. The path lengths from the directed edges corresponding to all computation tasks in each task execution batch to the source node are equal. The source node is a graph node in the graph node set whose in-degree is zero and whose out-degree is greater than zero.

[0063] Step 140: For at least one target task execution batch in a task execution batch, merge the computational tasks in the target task execution batch to obtain a merged result. The target task execution batch includes at least two computational tasks.

[0064] Therefore, by acquiring at least two computational tasks and their corresponding task information, and based on this information, a directed graph is constructed to illustrate the dependencies between computational tasks and data tables. After constructing the directed graph, it is converted into a directed acyclic graph (DAG), and at least one task execution batch is generated based on the structure of the DAG. Within each task execution batch, the computational tasks satisfy the condition that the path length from the directed edge corresponding to that task to the source node is equal. Subsequently, for target task execution batches comprising at least two computational tasks, a task merging operation is further performed. By merging computational tasks with the same data table or similar processing logic, the scheduling logic within the same target task execution batch is optimized, and computational overhead is reduced and data processing efficiency is improved by minimizing redundant computations.

[0065] The steps described above are explained in detail below.

[0066] First, regarding step 110, a computational task refers to any independent work unit that requires computer processing, such as data processing or computational analysis. Task information is data about the characteristics of the computational task, including but not limited to input data, the first data table containing the output data, the output data, the second data table containing the output data, and the execution logic. The first and second data tables refer to the data sources used in the computational task; the input and output data of the computational task are typically stored in tabular form and form the basis for the execution of the computational task.

[0067] In some embodiments of this application, a first data table for the computing task is used to store live streaming service data, and a second data table for the computing task is used to store the result data obtained when the computing task is completed. The result data is determined based on the live streaming service data.

[0068] For example, VR live streaming generates a large amount of live streaming data, including but not limited to user access records, user comments, user favorites, and user orders. To optimize VR live streaming, this data needs to be analyzed. This analysis can be broken down into different computational tasks, each responsible for processing specific live streaming data and generating corresponding outputs. At least two computational tasks may include, but are not limited to: calculating the number of active users on a given day, the user retention rate on a given day, the number of live streaming product orders on a given day, and the number of user comments on a given day. Based on this, the first data table can be a table storing live streaming data generated from user viewing behavior, such as user access records, comment records, and order records. The second data table can be a table storing the results of the computational tasks. After each computational task is completed, the result data is stored in the corresponding second data table for subsequent analysis and querying.

[0069] The following section will use at least two computational tasks, including computational tasks 1 to 3, as an example to explain the task information of the above computational tasks in detail.

[0070] Task 1: Calculate the number of active users on day A. This task requires extracting all user records that accessed the live stream on day A from the first data table and counting the number of users whose access time exceeded a preset duration. Correspondingly, the first data table stores user access records, and the second data table stores the calculation results for the number of active users on day A.

[0071] Task 2: Calculate the user retention rate on day A. This task requires comparing users who accessed the live stream on day A with users who accessed the live stream again on day A+1 to calculate the user retention rate on day A. Correspondingly, the first data table can be a data table storing user access records on day A and a data table storing user access records on day A+1, or a data table storing both user access records on day A and day A+1. The second data table is the data table containing the calculation results of the user retention rate on day A.

[0072] Task 3 calculates the number of orders for live-streaming product S on day A. This task requires counting the number of live-streaming product S ordered by all users on day A. Correspondingly, the first data table stores the order details for all users on day A, and the second data table stores the number of orders for live-streaming product S on day A. Next, regarding step 120, the directed graph is a graph used to represent the calculation tasks and their dependencies. Based on this, as... Figure 2 As shown, step 120 above may specifically include steps 121 to 123.

[0073] Step 121: Determine the dependencies between the computing tasks in the at least two computing tasks based on the task information of each computing task in the at least two computing tasks.

[0074] For example, a dependency relationship means that a computational task 'a' can only be executed after another computational task 'b' has been completed; thus, computational task 'a' depends on computational task 'b'. The dependencies between the various computational tasks in at least two computational tasks constitute a dependency set. Specifically, this dependency set includes all upstream tasks and all downstream tasks that each computational task depends on. For instance, if computational task 'a' depends on computational tasks 'b' and 'c', computational task 'b' depends on computational tasks 'd' and 'e', ​​and computational task 'c' depends on computational task 'f', then the dependency set of computational task 'a' is {b,c,d,e,f}; the direct upstream dependency set of computational task 'a' is {b,c}; the direct upstream dependency set of computational task 'd' is {b}; and the set of all downstream dependencies of task 'd' is {a,b}. Clearly defining the dependencies between at least two computational tasks helps optimize the execution order of computational tasks, avoid conflicts between computational tasks and unnecessary waiting time, thereby improving overall processing efficiency.

[0075] Step 122: Traverse the task information of each of the at least two computation tasks, identify all participating data tables, and generate a graph node set, where each graph node in the graph node set represents either the first data table or the second data table.

[0076] For example, identify all first and second data tables involved in at least two computational tasks, each data table (first or second) representing a graph node.

[0077] Step 123: Based on the dependencies between the computation tasks in at least two computation tasks and the set of graph nodes, construct a directed graph. The directed graph includes a set of directed edges. A directed edge in the set of directed edges represents one of the computation tasks in at least two computation tasks. A directed edge points from one graph node to another graph node.

[0078] For example, all computational tasks are listed, each task representing a directed edge. Each directed edge connects two different graph nodes, corresponding to the first data table (input) and the second data table (output) processed by that task. Each directed edge not only represents the execution logic of the computational task but also implicitly indicates the flow of data processing. Understandably, due to the complex dependencies between the computational tasks, this method of connecting directed edges exhibits a high degree of correlation. Specifically, the output (second data table) of one computational task (i.e., one directed edge) may happen to be the input (first data table) of another computational task (another directed edge).

[0079] For example, the following computational tasks need to be completed when performing business analysis on VR live streaming: Computational Task A: Extracting valid user information. Correspondingly, the first data table includes the original user data table, containing all information from user registration, and the second data table is the cleaned user data table, containing valid user information. Computational Task B: Statistical analysis of live streaming viewing time. Correspondingly, the first data table is a user live streaming record table, including but not limited to the user's live streaming identification (ID) and viewing time, and the second data table is a user viewing time statistics table, including but not limited to the user's viewing time. Computational Task C: User viewing preference analysis. Correspondingly, the first data table is the second data table of Computational Task A and the second data table of Computational Task B, namely the cleaned user data table and the user viewing time statistics table, while the second table is a user viewing preference table. It is evident that Computational Task C requires the cleaned user data table output by Computational Task A and the user viewing time statistics table output by Computational Task B as input live streaming business data to obtain user information for user viewing preference analysis. In this embodiment, the data table is used as a graph node and the computation task is used as a directed edge, which helps to understand the data transfer and transformation between different computation tasks and helps to optimize the computation task.

[0080] As a concrete example, at least two computational tasks include computational tasks 1 through 9. Computational tasks 1 and 2 belong to the same type, that is, the first data table for computational tasks 1 and 2 is T1, and the second data table is T2; the first data table for computational task 3 is T2, and the second data table is T5; the first data table for computational task 4 is T1, and the second data table is T3; the first data table for computational task 5 is T3, and the second data table is T5; the first data table for computational task 6 is T1, and the second data table is T4; the first data table for computational task 7 is T5, and the second data table is T4; the first data table for computational task 8 is T4, and the second data table is T6; the first data table for computational task 9 is T6, and the second data table is T5.

[0081] Therefore, computational tasks 1 and 2 both depend on T1 and produce T2. Computational task 3 depends on T2 (produced by computational tasks 1 or 2) and produces T5. Computational task 4 also depends on T1 but produces T3. Computational task 5 depends on T3 (produced by computational task 4) and also produces T5. Computational task 6 depends on T1 and produces T4. Computational task 7 depends on T5 (which can be produced by computational tasks 3 or 5) and produces T4. Computational task 8 depends on T4 (which can be produced by computational tasks 6 or 7) and produces T6. Computational task 9 depends on T6 (produced by computational task 8) and again produces T5. The directed relation graph generated in the above manner is as follows: Figure 3 As shown. See also Figure 3It can be seen that a cycle exists in the directed graph. Specifically, the cycle consists of computational tasks 9, T6, 8, T4, 7, and T5. This cycle indicates a circular dependency: to execute computational task 9, T6 is required as input, but T6 is generated by computational task 8, which in turn depends on T4; simultaneously, T4 can be generated by computational tasks 6 or 7, which in turn depends on T5; finally, T5 can be generated by computational tasks 3 or 5 (indirectly dependent on T3 and T1), but it can also be generated again by computational task 9.

[0082] This circular dependency prevents the business logic from determining a definite execution order to satisfy the dependencies of all tasks. To solve this problem, a de-cyclic operation needs to be performed on the directed graph, i.e., rearranging the execution order of tasks or modifying the dependencies between tasks to eliminate the cycle in the graph. Based on this, as... Figure 4 As shown, the task optimization method may further include steps 410 to 420.

[0083] Step 410: Use the depth-first search algorithm to perform graph search on the directed graph, detect loops in the directed graph, and obtain the detection results.

[0084] For example, Depth-First Search (DFS) is an algorithm used to traverse or search trees or graphs. During the traversal of a directed graph, DFS searches for cycles by exploring the branches of the graph as deeply as possible. Specifically, DFS starts from the initial node and searches along the depth direction of the directed graph until it cannot go any deeper, then backtracks to the previous node and continues exploring other branches. If a previously visited node is encountered during the DFS, or if a node is encountered again on a previously visited path, this indicates the existence of a cycle. This is because DFS constructs a tree structure, and if a reverse edge (i.e., returning to a previously visited node) occurs during tree construction, a cycle is considered to exist in the graph. When traversing the graph, visited nodes are placed on a recursive stack. If a newly visited node already exists on the recursive stack, it indicates the existence of a reverse edge, i.e., a cycle.

[0085] Step 420: If the detection results indicate the presence of loops in the directed graph, the loops are removed according to a preset delooping strategy to obtain a directed acyclic graph corresponding to the directed graph. The preset delooping strategy includes at least one of the following:

[0086] The process involves deleting directed edges from loops, splitting graph nodes within loops, and modifying dependencies between computational tasks within loops.

[0087] For example, deleting a directed edge in a cycle means directly removing the directed edge that causes the cycle. Splitting a graph node in a cycle means inserting an additional computational task or data table at a node in the cycle to break the original dependencies. Modifying the dependencies of computational tasks in a cycle means redesigning the dependencies of computational tasks so that they no longer form cycles.

[0088] As a concrete example, one or more edges can be selected for deletion based on business logic and computational task priorities. Specifically, it involves identifying which directed edges are relatively late in the execution order of cycles, deleting these identified edges to obtain an updated directed graph, and then re-checking whether other cycles exist in the updated graph until a directed acyclic graph is finally obtained. This approach not only eliminates circular dependencies but also ensures the continuity of business logic and the efficient execution of computational tasks. Based on this method... Figure 3 The directed graph shown is delooped to obtain the following result: Figure 5 The diagram shows a directed acyclic graph.

[0089] Furthermore, regarding step 130, computational tasks with dependencies are divided into different task execution batches so that they can be executed sequentially according to the task execution batches. Tasks within each task execution batch may be executed in parallel, but task execution batches must be executed sequentially. In a directed acyclic graph, the out-degree refers to the number of directed edges pointing from a graph node, and the in-degree refers to the number of directed edges pointing to a graph node. A graph node with an in-degree of zero and an out-degree greater than zero can represent the starting point of a task chain containing at least two computational tasks. Based on this, as... Figure 6 As shown, step 130 may specifically include steps 131 to 133.

[0090] Step 131: In the directed acyclic graph, select graph nodes with an in-degree of zero and an out-degree greater than zero to construct the source node set.

[0091] For example, each graph node in the directed acyclic graph is traversed, its in-degree and out-degree are checked, and graph nodes that meet the conditions are added to the source node set.

[0092] Step 132: For each source node in the source node set, perform the following steps to construct at least one task execution batch corresponding to the source node: traverse multiple target directed edges associated with the source node, and for each target directed edge, calculate the number of directed edges from the source node to the graph node pointed to by the target directed edge, and obtain the path length of the target directed edge.

[0093] For example, for each source node, the directed acyclic graph can be traversed starting from that source node using depth-first search and breadth-first search algorithms, recording the number of edges pointing to graph nodes that reach each target directed edge.

[0094] Step 133: Based on multiple target directed edges and the path length of each directed edge in the multiple target directed edges, construct at least one task execution batch, wherein the path lengths of the multiple directed edges corresponding to the multiple computation tasks in each task execution batch are the same.

[0095] For example, data structures such as hash tables or dictionaries can be used to group target directed edges with the same path length, with each group forming a batch of task executions.

[0096] In this embodiment of the application, by constructing a directed acyclic graph and arranging computational tasks with similar dependencies in the same batch of task execution, the waiting time between computational tasks is reduced and the execution efficiency of computational tasks is improved.

[0097] Then, in step 140, multiple computational tasks that can be executed in parallel or have similar dependencies are merged into a larger task for execution to reduce the overhead of task switching. Based on this, in some embodiments of this application, step 140 may specifically include merging the at least two first target tasks when there are at least two first target tasks in the target task execution batch, to obtain a merged result, wherein the directed edges corresponding to the at least two first target tasks all point from the first dependency data table to the second dependency data table, the first dependency data table being either the first data table or the second data table, and the second dependency data table being either the first data table or the second data table, that is, the upstream dependency data table and the downstream dependency data table of the at least two first target tasks are the same, belonging to the same category of computational tasks.

[0098] For example, business analysis of VR live streaming requires two computational tasks. The first task is to count the number of live streaming product orders per user based on different distribution channels. Correspondingly, the first dependent data table includes a user order information table, and the second dependent data table includes a user order count table. The user order information table includes, but is not limited to, fields such as user order ID, user ID, ordered live streaming product ID, order time, device type, and the distribution channel through which the order was obtained. The user order count table includes the distribution channel, device type, and the corresponding number of user orders. The second task is to count the number of live streaming product orders per user based on the type of electronic device, such as mobile phone, tablet, or computer. Again, the first dependent data table includes the user order information table, and the second dependent data table includes the user order count table. As we can see, both tasks depend on the user order information table and the user order count table, belonging to the same category of computational tasks. Therefore, to optimize the computation process, the computational logic of these two tasks can be merged into a larger task, thus achieving task merging.

[0099] Specifically, the user order information table is first scanned and processed to extract all necessary data fields involved in the first and second calculation tasks. Then, based on these data fields, the number of user orders is calculated simultaneously by both the delivery channel and the electronic device category. Next, the outputs of these two calculation tasks are stored in the user order count table. Thus, the calculation logic of the two tasks is integrated into a larger task, achieving task merging and further reducing the overhead of task switching.

[0100] Therefore, by merging the first target tasks that depend on the same data flow, namely performing data transformation or processing from the same source data table (first dependent data table) to the same target data table (second dependent data table), the overhead of task switching can be effectively reduced, computing resources can be utilized more effectively, and data processing speed can be significantly accelerated by reducing the overhead during task execution.

[0101] In some other embodiments of this application, step 140 may specifically include merging the at least two second target tasks in the target task execution batch to obtain a merge result, wherein the directed edge corresponding to each of the at least two second target tasks points from the third dependency data table to the first data table or the second data table, and the third dependency data table is either the first data table or the second data table. That is, the upstream dependency data tables of the at least two second target tasks are the same, but the downstream dependency data tables are different, and they are sibling tasks of different types.

[0102] For example, the second target task can share the read logic when reading the third dependent data table. For instance, if the same query or data filtering conditions are used, this logic can be merged. Therefore, by reducing the number of computational tasks and sharing computational steps, the overall efficiency of data processing can be improved. This is especially true when multiple tasks need to process large amounts of data simultaneously; merging computational tasks can reduce the consumption of system resources.

[0103] For example, business analysis of VR live streaming requires two computational tasks. The first task is to count the number of live streaming product orders by users based on different distribution channels. Correspondingly, the first dependent data table includes the user order information table, and the second dependent data table includes the user order count table based on distribution channel. The second task is to count the number of live streaming product orders by electronic device type, such as mobile phones, tablets, and computers. Again, the first dependent data table includes the user order information table, and the second dependent data table includes the user order count table based on device type. As we can see, both tasks rely on the same data table, the user order information table, and are related but different types of computational tasks. Therefore, to optimize the computation process, these two tasks can be merged.

[0104] Specifically, the user order information table is first scanned and processed to extract all necessary data fields involved in the first and second calculation tasks. Then, based on the extracted data fields, two calculation tasks are started simultaneously. The first calculation task calculates the number of user orders by delivery channel, and the second calculation task calculates the number of user orders by device type. Next, the outputs of the two calculation tasks are stored in a user order count table by delivery channel and a user order count table by device type, respectively. Thus, the two calculation tasks share the data scanning and processing phase, thereby reducing redundant computational overhead. In some embodiments of this application, step 140 may specifically include merging at least two second target tasks in the target task execution batch if the number of these two tasks exceeds a preset number, to obtain a merged result. For example, the preset number can be set based on the performance of the computing system under the current load and the resource utilization rate of the computing system, combined with the experience of business personnel. Therefore, by merging a preset number of second target tasks, the scale and number of merged calculation tasks can be controlled, achieving a balance between computing system performance and data processing efficiency. By merging a preset number of second target tasks, the number of calculation task scheduling operations can be reduced, lowering unnecessary computational overhead.

[0105] In some other embodiments of this application, such as Figure 7 As shown, step 140 may specifically include steps 141 to 143.

[0106] Step 141: If there are at least two second target tasks and at least two first target tasks in the target task execution batch, and there is one first target task among the at least two second target tasks, merge the at least two first target tasks to obtain the first subtask.

[0107] Step 142: Merge at least two second objective tasks to obtain a second subtask.

[0108] Step 143: Merge the first subtask and the second subtask to obtain the merged result.

[0109] For example, based on the above Figure 5 The specific task batches obtained are shown in Table 1 below.

[0110]

[0111] Table 1

[0112] Referring to Table 1 above, calculation task 1 and calculation task 2 are merged to obtain the first subtask. Then, calculation task 2, calculation task 4 and calculation task 6 are merged to obtain the second subtask. Finally, the first subtask and the second subtask are merged into a total task.

[0113] Therefore, by effectively merging similar or mergeable tasks in the target task execution batch, the number of tasks is reduced and data processing efficiency is improved.

[0114] In some embodiments of this application, step 140 may specifically include, for a target task execution batch in at least one task execution batch, merging the operators within the computational tasks of the target task execution batch to obtain a merged result.

[0115] Referring to the example above, if computation task 1 and computation task 2 belong to the same category of computation tasks, the operators of computation task 1 and computation task 2 are merged using the union operation, and the task names are marked with an underscore ("_"). Computation task 2, computation task 4, and computation task 6 are sibling tasks but different types of tasks, and their merged names are linked with a hyphen ("-"). Finally, computation task 1, computation task 2, computation task 4, and computation task 6, a total of four tasks, are merged into one computation task 1_2-4-6.

[0116] Based on the task optimization method provided in the above embodiments, this application also provides specific implementations of the task optimization apparatus. Please refer to the following embodiments.

[0117] First see Figure 8 The task optimization apparatus 800 provided in this application embodiment includes:

[0118] The acquisition module 810 is used to acquire at least two computing tasks and task information of each computing task in the at least two computing tasks. The task information includes a first data table and a second data table.

[0119] The construction module 820 is used to construct a directed relation graph based on at least two computing tasks and the task information of each of the at least two computing tasks. The directed relation graph includes a graph node set and a directed edge set. A graph node in the graph node set represents a first data table or a second data table, and a directed edge in the directed edge set represents a computing task in the at least two computing tasks.

[0120] The first generation module 830 is used to generate at least one task execution batch based on the directed acyclic graph corresponding to the directed relation graph. The at least one task execution batch includes at least one computation task corresponding to a directed edge. The path lengths from the directed edges corresponding to all computation tasks in each task execution batch to the source node are equal. The source node is a graph node in the graph node set whose in-degree is zero and whose out-degree is greater than zero.

[0121] The merging module 840 is used to merge the computational tasks in the target task execution batch for at least one task execution batch to obtain a merged result. The target task execution batch includes at least two computational tasks.

[0122] Therefore, the acquisition module 801 acquires at least two computational tasks and their corresponding task information, and the construction module 820 constructs a directed relational graph based on this information. This directed relational graph shows the dependencies between computational tasks and data tables. After constructing the directed relational graph, it is converted into a directed acyclic graph (DAG), and the first generation module 830 generates at least one task execution batch based on the structure of the DAG. Within each task execution batch, the computational tasks satisfy the condition that the path length from the directed edge corresponding to the computational task to the source node is equal. Subsequently, the merging module 840 further performs a task merging operation on the target task execution batch, which includes at least two computational tasks. By merging computational tasks with the same data table or similar processing logic, the scheduling logic within the same target task execution batch is optimized, and computational overhead is reduced and data processing efficiency is improved by reducing redundant computations.

[0123] In some embodiments of this application, the first generation module 803 in these embodiments may specifically be used for:

[0124] In a directed acyclic graph, select graph nodes with an in-degree of zero and an out-degree greater than zero, and construct a source node set;

[0125] For each source node in the source node set, perform the following steps to construct at least one task execution batch corresponding to the source node:

[0126] Traverse the multiple target directed edges associated with the source node. For each target directed edge, calculate the number of directed edges from the source node to the graph node pointed to by the target directed edge, and obtain the path length of the target directed edge.

[0127] Based on multiple target directed edges and the path length of each directed edge in the multiple target directed edges, at least one task execution batch is constructed, wherein the path lengths of the multiple directed edges corresponding to the multiple computation tasks in each task execution batch are the same.

[0128] In some embodiments of this application, the merging module 804 in this application embodiment can be specifically used to merge at least two first target tasks when there are at least two first target tasks in the target task execution batch, and obtain a merging result. The directed edge corresponding to each of the at least two first target tasks points from a first dependency data table to a second dependency data table. The first dependency data table is either a first data table or a second data table, and the second dependency data table is either a first data table or a second data table.

[0129] In some embodiments of this application, the merging module 804 in this application embodiment can be used to merge at least two second target tasks when there are at least two second target tasks in the target task execution batch, and obtain a merging result. The directed edge corresponding to each of the at least two second target tasks points from the third dependency data table to the first data table or the second data table. The third dependency data table is either the first data table or the second data table.

[0130] In some embodiments of this application, the merging module 804 in this application embodiment can be used to merge at least two second target tasks when the number of at least two second target tasks in the target task execution batch is greater than a preset number, and obtain a merging result.

[0131] In some embodiments of this application, the merging module 804 in these embodiments may specifically be used for:

[0132] If there are at least two second target tasks and at least two first target tasks in the target task execution batch, and one of the at least two second target tasks is a first target task, then the at least two first target tasks are merged to obtain the first subtask.

[0133] Merge at least two secondary objective tasks to obtain a second subtask;

[0134] The first and second subtasks are merged to obtain the merged result.

[0135] In some embodiments of this application, the merging module 804 in this application embodiment can be specifically used to merge the operators within the computational tasks of at least one target task execution batch to obtain a merging result.

[0136] In some embodiments of this application, the construction module 802 in these embodiments may specifically be used for:

[0137] Based on at least two computing tasks and the task information of each computing task in at least two computing tasks, determine the dependencies between the computing tasks in at least two computing tasks;

[0138] Iterate through the task information of each of the at least two computation tasks, identify all participating data tables, and generate a graph node set, where each graph node in the graph node set represents either the first data table or the second data table.

[0139] Based on the dependencies between the computational tasks in at least two computational tasks and the set of graph nodes, construct a directed relation graph. The directed relation graph includes a set of directed edges. A directed edge in the set of directed edges represents one of the computational tasks in the at least two computational tasks. A directed edge points from one graph node to another graph node.

[0140] In some embodiments of this application, the task optimization device may further include:

[0141] The second generation module is used to perform graph search on the directed graph using a depth-first search algorithm before generating at least one task execution batch step based on the directed acyclic graph corresponding to the directed graph, to detect loops in the directed graph and obtain the detection results.

[0142] The determination module is used to, when it is determined from the detection results that a loop exists in the directed graph, perform loop removal processing on the loop according to a preset loop removal strategy to obtain a directed acyclic graph corresponding to the directed graph. The preset loop removal strategy includes at least one of the following:

[0143] The process involves deleting directed edges from loops, splitting graph nodes within loops, and modifying dependencies between computational tasks within loops.

[0144] Figure 9 The diagram shows a schematic representation of the hardware structure of an electronic device provided in some embodiments of this application.

[0145] The electronic device may include a processor 901 and a memory 902 storing computer program instructions.

[0146] Specifically, the processor 901 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0147] Memory 902 may include mass storage for data or instructions. For example, and not limitingly, memory 902 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 902 may include removable or non-removable (or fixed) media. Where appropriate, memory 902 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 902 is non-volatile solid-state memory.

[0148] In a particular embodiment, memory 902 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the task optimization method according to the first aspect of this application.

[0149] The processor 901 reads and executes computer program instructions stored in the memory 902 to implement any of the task optimization methods in the above embodiments.

[0150] In one example, the electronic device may also include a communication interface 903 and a bus 910. For example, Figure 9 As shown, the processor 901, memory 902, and communication interface 903 are connected through bus 910 and complete communication with each other.

[0151] The communication interface 903 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0152] Bus 910 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 910 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0153] The electronic device can execute the task optimization method in the embodiments of this application, thereby achieving a combination Figures 1 to 8 The described task optimization methods and apparatus.

[0154] In addition, in conjunction with the task optimization methods in the above embodiments, this application also provides a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the task optimization methods in the above embodiments. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, etc.

[0155] Furthermore, in conjunction with the task optimization methods in the above embodiments, this application embodiment can provide a computer program product for implementation. This program product is stored in a storage medium and may specifically include a computer program or instructions. When executed by a processor, the computer program or instructions implement any of the task optimization methods in the above embodiments. This program product is executed by at least one processor to implement the various processes of the above task optimization method embodiments and achieves the same technical effects; therefore, to avoid repetition, further details are omitted here.

[0156] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0157] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0158] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0159] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0160] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A task optimization method, characterized in that, include: Obtain at least two computing tasks and task information for each of the at least two computing tasks, wherein the task information includes a first data table and a second data table; Based on the at least two computing tasks and the task information of each computing task, a directed relation graph is constructed. The directed relation graph includes a graph node set and a directed edge set. One graph node in the graph node set represents the first data table or the second data table, and one directed edge in the directed edge set represents one of the at least two computing tasks. Based on the directed acyclic graph corresponding to the directed relation graph, at least one task execution batch is generated. The at least one task execution batch includes a computation task corresponding to at least one directed edge. The path lengths from the directed edges corresponding to all computation tasks in each task execution batch to the source node are equal. The source node is a graph node in the graph node set whose in-degree is zero and whose out-degree is greater than zero. For a target task execution batch in the at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merged result. The target task execution batch includes at least two computational tasks.

2. The method according to claim 1, characterized in that, The step of generating at least one task execution batch based on the directed acyclic graph corresponding to the directed relation graph includes: In the directed acyclic graph, select graph nodes with an in-degree of zero and an out-degree greater than zero to construct a source node set; For each source node in the set of source nodes, perform the following steps to construct at least one task execution batch corresponding to the source node: Traverse the multiple target directed edges associated with the source node. For each target directed edge, calculate the number of directed edges from the source node to the graph node pointed to by the target directed edge, and obtain the path length of the target directed edge. Based on the multiple target directed edges and the path length of each directed edge in the multiple target directed edges, at least one task execution batch is constructed, wherein the path lengths of the multiple directed edges corresponding to the multiple computation tasks in each task execution batch are the same.

3. The method according to claim 1, characterized in that, For the target task execution batch in the at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merge result, including: If there are at least two first target tasks in the target task execution batch, the at least two first target tasks are merged to obtain a merge result. The directed edge corresponding to each of the at least two first target tasks points from a first dependency data table to a second dependency data table. The first dependency data table is either the first data table or the second data table, and the second dependency data table is either the first data table or the second data table.

4. The method according to claim 1, characterized in that, For the target task execution batch in the at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merge result, including: If there are at least two second target tasks in the target task execution batch, the at least two second target tasks are merged to obtain a merge result. The directed edge corresponding to each of the at least two second target tasks points from a third dependent data table to a first data table or a second data table. The third dependent data table is either the first data table or the second data table.

5. The method according to claim 4, characterized in that, When there are at least two directed edges representing the second target in the target task execution batch, the computation tasks corresponding to the at least two directed edges representing the second target are merged to obtain a merged result, including: If the number of at least two second target tasks in the target task execution batch is greater than a preset number, the at least two second target tasks are merged to obtain a merged result.

6. The method according to claim 4 or 5, characterized in that, For the target task execution batch in the at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merge result, including: If there are at least two second target tasks and at least two first target tasks in the target task execution batch, and one of the at least two second target tasks is a first target task, then the at least two first target tasks are merged to obtain a first subtask. The at least two second objective tasks are merged to obtain a second sub-task; The first subtask and the second subtask are merged to obtain the merged result.

7. The method according to claim 1, characterized in that, For the target task execution batch in the at least one task execution batch, the computational tasks in the target task execution batch are merged to obtain a merge result, including: For the target task execution batch in the at least one task execution batch, the operators within the computational tasks of the target task execution batch are merged to obtain a merged result.

8. The method according to claim 1, characterized in that, The step of constructing a directed relationship graph based on the at least two computing tasks and the task information of each of the at least two computing tasks includes: Based on the at least two computing tasks and the task information of each computing task in the at least two computing tasks, determine the dependencies between the computing tasks in the at least two computing tasks. Traverse the task information of each of the at least two computing tasks, identify all participating data tables, and generate a graph node set, wherein each graph node in the graph node set represents the first data table or the second data table; Based on the dependencies between the computational tasks in at least two computational tasks and the set of graph nodes, a directed graph is constructed. The directed graph includes a set of directed edges, where each directed edge represents one of the computational tasks in the at least two computational tasks, and the directed edge points from one graph node to another graph node.

9. The method according to claim 2, characterized in that, Before generating at least one task execution batch based on the directed acyclic graph corresponding to the directed relation graph, the method further includes: The directed graph is searched using a depth-first search algorithm to detect loops in the directed graph and obtain the detection results. If the detection results indicate the presence of a loop in the directed graph, the loop is removed using a preset delooping strategy to obtain a directed acyclic graph corresponding to the directed graph. The preset delooping strategy includes at least one of the following: The directed edges in the loop are deleted, the graph nodes in the loop are split, and the dependencies of the computational tasks in the loop are modified.

10. The method according to any one of claims 1 to 5, characterized in that, The first data table is used to store live streaming business data, and the second data table is used to store the result data obtained after the execution of the computing task is completed. The result data is determined based on the live streaming business data.

11. A task optimization device, characterized in that, The device includes: An acquisition module is used to acquire at least two computing tasks and task information for each of the at least two computing tasks, wherein the task information includes a first data table and a second data table. The construction module is used to construct a directed relation graph based on the at least two computing tasks and the task information of each computing task in the at least two computing tasks. The directed relation graph includes a graph node set and a directed edge set. One graph node in the graph node set represents the first data table or the second data table, and one directed edge in the directed edge set represents one of the at least two computing tasks. The first generation module is used to generate at least one task execution batch based on the directed acyclic graph corresponding to the directed relation graph. The at least one task execution batch includes at least one computation task corresponding to a directed edge. The path lengths from the directed edges corresponding to all computation tasks in each task execution batch to the source node are equal. The source node is a graph node in the graph node set whose in-degree is zero and whose out-degree is greater than zero. The merging module is used to merge the computational tasks in the target task execution batch within the at least one task execution batch to obtain a merged result. The target task execution batch includes at least two computational tasks.

12. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the task optimization method as described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the task optimization method as described in any one of claims 1-10.

14. A computer program product, characterized in that, Includes a computer program, which, when executed, implements the task optimization method according to any one of claims 1-10.