Task execution failure processing method, device, electronic device and storage medium

By determining the failed task node in the task node collection and applying the failed response strategy, continuing to execute the target task node that meets the conditions, the problem of waste of resources and inefficiency caused by failure of task scheduling in the existing technology is solved, and the multi-task scheduling is improved efficiency.

CN118567823BActive Publication Date: 2024-11-22CHENGDU CELIS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411058515.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-22
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

Existing task scheduling failure strategy In multi-task scheduling scenario, when any DAG node fails to execute, the entire DAG process will be directly set to failure, and other executing node tasks will be cancelled, resulting in waste of resources and inefficient execution.

Method used

By determining the currently failed task node in the task node collection, and based on the pre-set failure response strategy, determine the target task node that meets the continued execution conditions from the unexecuted task node, continue to execute the target task node, and stop other Execution of task nodes.

Benefits of technology

It avoids repeated execution of task nodes, reduces resource waste, improves task execution efficiency, and adapts to complex usage scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567823B_ABST
    Figure CN118567823B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to a method, device, electronic device and storage medium for processing task execution failure, the method comprising: determining the task node that currently fails to execute as a failed task node from a preset task node set; determining the target failure response strategy corresponding to the preset failed task node; based on the target failure response strategy, determining at least one target task node that meets the conditions for continuing execution from the currently unexecuted task nodes; continuing to execute at least one target task node, and stopping executing other task nodes other than at least one target task node in the task node set. The embodiment of the present application realizes that when some task nodes fail to execute, some target task nodes can be continued to execute according to the set identification response strategy, thereby avoiding the need for the task nodes being executed to be repeated again, reducing resource waste, and improving the efficiency of task execution.
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 method, device, electronic device and computer-readable storage medium for processing task execution failure. Background Art

[0002] At present, for multi-task scheduling scenarios, the relationship between multiple tasks is usually converted into DAG (directed acyclic graph), and each node in the DAG corresponds to a task. The current mainstream task scheduling failure strategy is that when any DAG node in the DAG fails to execute, the entire DAG process is directly set to fail, and other DAG node tasks being executed in the DAG are directly canceled. This will cause some nodes to be executed. Once a node execution fails, the executing nodes will be canceled, and the canceled nodes will need to be re-executed next time, resulting in resource waste and low execution efficiency. Summary of the invention

[0003] In view of this, in order to solve some or all of the above technical problems, the embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for processing task execution failure.

[0004] In a first aspect, an embodiment of the present application provides a method for processing task execution failure, the method comprising: determining a task node that currently fails to execute as a failed task node from a preset task node set; determining a target failure response strategy corresponding to the preset failed task node; based on the target failure response strategy, determining at least one target task node that meets the conditions for continuing execution from the currently unexecuted task nodes; continuing to execute at least one target task node, and stopping execution of other task nodes other than at least one target task node in the task node set.

[0005] In one possible implementation, based on the target failure response strategy, at least one target task node that meets the conditions for continuing execution is determined from the currently unexecuted task nodes, including: if the target failure response strategy is the first strategy, at least one task node that is currently being executed is determined from the task node set; and at least one target task node that meets the conditions for continuing execution is determined from at least one task node that is currently being executed.

[0006] In one possible implementation, at least one target task node that meets the conditions for continuing execution is determined from at least one task node currently being executed, including: if the target failure response strategy is the first sub-strategy included in the first strategy, the currently executing task node is determined as at least one target task node.

[0007] In one possible implementation, at least one target task node that meets the conditions for continuing execution is determined from at least one task node currently being executed, including: if the target failure response strategy is the second sub-strategy included in the first strategy, determining the execution progress of each task node in at least one task node currently being executed; and determining the task node that exceeds a preset progress in at least one task node currently being executed as at least one target task node.

[0008] In one possible implementation, determining the execution progress of each task node among at least one task node currently being executed includes: for each task node among at least one task node currently being executed, determining the current execution duration of the task node, and obtaining the durations consumed for the most recent N successful executions of the task node, where N is a preset integer greater than or equal to 1; determining a benchmark duration based on the N obtained durations; and determining the ratio of the current execution duration of the task node to the benchmark duration as the execution progress of the task node.

[0009] In one possible implementation, based on the target failure response strategy, at least one target task node that meets the conditions for continuing execution is determined from the currently unexecuted task nodes, including: if the target failure response strategy is the second strategy, from the currently unexecuted task nodes, a task node that does not depend on the failed task node during execution is determined as at least one target task node.

[0010] In one possible implementation, a task node that is not dependent on a failed task node during execution is determined from among the currently unexecuted task nodes as at least one target task node, including: for each task node among the currently unexecuted task nodes, determining whether the task node recurses to a failed task node in a step-by-step recursive manner toward the dependent upper-level task node; if it recurses to a failed task node, determining the task node as the target task node.

[0011] In one possible implementation, determining a target failure response strategy corresponding to a pre-set failed task node includes: determining whether a corresponding failure response strategy is pre-set for the failed task node; if a failure response strategy for the failed task node is set, determining the failure response strategy for the failed task node as the target failure response strategy; if a failure response strategy for the failed task node is not set, determining whether a corresponding failure response strategy is pre-set for a task node set; if a failure response strategy for the task node set is set, determining the failure response strategy for the task node set as the target failure response strategy; if no failure response strategy for the task node set is set, determining the default failure response strategy as the target failure response strategy.

[0012] In a second aspect, an embodiment of the present application provides a device for processing task execution failure, the device comprising: a first determination module, used to determine the task node that currently fails to execute as a failed task node from a preset task node set; a second determination module, used to determine the target failure response strategy corresponding to the preset failed task node; a third determination module, used to determine at least one target task node that meets the conditions for continuing execution from the currently unexecuted task nodes based on the target failure response strategy; an execution module, used to continue executing at least one target task node, and stop executing other task nodes other than at least one target task node in the task node set.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, a method of any embodiment of the method for processing task execution failure of the above-mentioned first aspect of the present application is implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any embodiment of the method for processing task execution failure of the first aspect described above is implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code runs on a device, the processor in the device implements a method of any embodiment of the method for processing task execution failure in the first aspect above.

[0016] The embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for processing task execution failure. When there is a failed task node that currently fails to execute in the task node set, a target failure response strategy corresponding to the preset failed task node is determined. Based on the target failure response strategy, at least one target task node that meets the conditions for continuing execution is determined from the currently unexecuted task nodes, the at least one target task node is continued to be executed, and the execution of other task nodes is stopped. This ensures that when some task nodes fail to execute, some target task nodes can be continued to be executed according to the set identification response strategy, rather than directly canceling the execution of the task nodes being executed, thereby avoiding the need to repeat the execution of the task nodes being executed, reducing resource waste and improving the efficiency of task execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] 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.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0020] Figure 1 A schematic diagram of existing failure response strategies;

[0021] Figure 2 A schematic diagram of another existing failure coping strategy;

[0022] Figure 3 A flowchart of a method for processing task execution failure provided in an embodiment of the present application;

[0023] Figure 4 A flowchart of another method for processing task execution failure provided in an embodiment of the present application;

[0024] Figure 5 A schematic diagram of a DAG for executing a first sub-strategy provided in an embodiment of the present application;

[0025] Figure 6 An exemplary flow chart executed when the first sub-strategy is triggered according to an embodiment of the present application;

[0026] Figure 7 A schematic diagram of a DAG for executing a second sub-strategy provided in an embodiment of the present application;

[0027] Figure 8 An exemplary flow chart executed when the second sub-strategy is triggered according to an embodiment of the present application;

[0028] Fig. 9 A schematic diagram of a DAG for executing the second strategy provided in an embodiment of the present application;

[0029] Fig.10 A schematic diagram of another DAG for executing the second strategy provided in an embodiment of the present application;

[0030] Fig.11 An exemplary flow chart for executing when triggering the second strategy provided in an embodiment of the present application;

[0031] Fig.12A schematic diagram of a DAG for executing multiple failure response strategies provided in an embodiment of the present application;

[0032] Fig.13 A flowchart of another method for processing task execution failure provided in an embodiment of the present application

[0033] Fig.14 A schematic diagram of the structure of a device for processing task execution failure provided in an embodiment of the present application;

[0034] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values ​​described in these embodiments do not limit the scope of the present application.

[0036] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.

[0037] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.

[0038] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0039] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0040] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0041] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.

[0042] Technologies, circuits, and devices known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, circuits, and devices should be considered as part of the specification.

[0043] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0044] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0045] The current mainstream task scheduling failure strategy is that when any DAG node in the DAG fails to execute, the entire DAG process is directly set to fail, and other DAG node tasks in the DAG that are being executed are directly canceled. Figure 1 As shown in the figure, assume that task nodes 1-1, 2-2, and 3-2 have been successfully executed, and 2-1 and 3-3 are being executed, but task 3-3 suddenly fails to execute and changes from the execution state to the failure state. At this time, node 2-1 will be cancelled; then the entire DAG is marked as ended. The biggest problem with this method is that the execution progress of task 2-1 may have reached 90%, but due to the failure of node 3-3, the task of node 2-1 is directly cancelled, and the task of node 3-1 that depends on node 2-1 cannot be executed. This will result in 90% of the data being calculated, but being passively cancelled due to the failure of 3-3, thus wasting all the previous work. When task node 2-1 needs to be restored, it needs to be executed from 0% to 100%, resulting in reduced efficiency and waste of resources.

[0046] For example, Figure 2As shown in the figure, except for nodes 3-4 and 4-1, all other nodes have been successfully executed. Assume that 3-4 and 4-1 are being executed, and node 3-4 suddenly fails to execute. According to the existing failure strategy, 4-1 will be cancelled. From a business perspective, 2-1, 3-1, 3-2, and 4-1 all belong to a set of business logic. If any of 2-1, 3-1, 3-2, and 4-1 fails, these four nodes need to be re-run together. So in this scenario, the failure of 3-4 causes 4-1 to be cancelled, which causes 2-1, 3-1, 3-2, and 4-1 to be re-run together. Therefore, there are major problems in terms of efficiency, resource utilization, and timeliness of tasks. Therefore, the current single failure strategy can no longer meet the increasingly complex usage scenarios.

[0047] In order to solve the technical problems of inefficient failure strategies and serious resource waste when node execution fails in the prior art multi-task scheduling, the present application provides a method for processing task execution failure, which can improve the efficiency of multi-task scheduling and save computing resources.

[0048] Figure 3 A flowchart of a method for processing a failed task execution provided in an embodiment of the present application. This method can be applied to one or more electronic devices such as vehicles (e.g., smart driving vehicles), desktop computers, portable computers, smart phones, laptops, servers, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. It is not specifically limited here.

[0049] like Figure 3 As shown, the method specifically includes:

[0050] Step 301: From a preset task node set, determine a task node that currently fails to execute as a failed task node.

[0051] In this embodiment, the task node set represents a series of executable tasks and the dependencies between tasks, and each node in the task node set represents a task. Usually, the task node set can be represented in the form of a directed acyclic graph (DAG). In the DAG graph, the nodes are divided into multiple levels, and the lines between the nodes represent the dependencies of the nodes, that is, for a node, the upper node connected to it is the parent node of the node, and the node can only be executed after the parent node is successfully executed; the lower node connected to it is the child node of the node, and the child node can only be executed after the node is successfully executed.

[0052] If a task node fails to execute, the task node can output a failure flag, so that the electronic device can determine the current failed task node.

[0053] Step 302: determine the target failure response strategy corresponding to the preset failed task node.

[0054] In this embodiment, the failure response strategy can be preset. Optionally, the failure response strategy can be set for the entire task node set, or the failure response strategy can be set for each task node separately. The failure response strategy can include at least one, and from at least one failure response strategy, the target failure response strategy corresponding to the failed task node can be preset. As an example, a failure response strategy can be: when the above-mentioned failed task node fails to execute, the currently executing node continues to execute, and the unexecuted node cancels execution. For another example, a failure response strategy can be: the task nodes that do not depend on the failed task node continue to execute, and other nodes cancel execution.

[0055] Step 303: Based on the target failure response strategy, at least one target task node that meets the execution continuation condition is determined from the currently unexecuted task nodes.

[0056] In this embodiment, different failure response strategies correspond to different ways of determining the target task node, and the corresponding relationship between the way of determining the target task node and the failure response strategy can be preset. The continued execution condition is reflected in the target failure response strategy. As an example, the failure response strategy is: when the above-mentioned failed task node fails to execute, the currently executing node continues to execute, and the unexecuted node cancels execution. Then the currently executing node is at least one target task node.

[0057] For another example, the failure response strategy may be: task nodes that are not dependent on the failed task node continue to execute, and other nodes cancel execution. Then the task node that is not dependent on the failed task node is at least one target task node.

[0058] Step 304, continue to execute at least one target task node, and stop executing other task nodes in the task node set except for the at least one target task node.

[0059] In this embodiment, when at least one target task node is executed, the entire task node set is marked as completed.

[0060] It should be noted that the above steps 301 to 304 are executed in real time. Therefore, after step 304, if a failed task node appears again during the execution of at least one target task node, steps 301 to 304 are re-executed based on the failed task node that appears again until there is no target task node that meets the conditions for continuing execution.

[0061] The method for processing task execution failure provided in the embodiment of the present application determines a target failure response strategy corresponding to a preset failed task node when there is a failed task node that is currently failing in execution in the task node set; based on the target failure response strategy, at least one target task node that meets the conditions for continuing execution is determined from the currently unexecuted task nodes, the at least one target task node continues to be executed, and the execution of other task nodes is stopped. This achieves that when some task nodes fail to execute, some target task nodes can continue to be executed according to the set identification response strategy, rather than directly canceling the execution of the task nodes being executed, thereby avoiding the need to repeat the execution of the task nodes being executed, reducing resource waste, and improving the efficiency of task execution.

[0062] In some optional implementations of this embodiment, such as Figure 4 As shown, step 303 includes:

[0063] Step 3031: If the target failure response strategy is the first strategy, determine at least one task node currently being executed from the task node set.

[0064] Among them, the first strategy can also be called a strict execution strategy, that is, once a failed task node appears, the currently executing task node can continue to execute if the conditions are met, and the node that has not started execution will no longer be executed.

[0065] Step 3032: Determine at least one target task node that meets the execution continuation condition from at least one task node currently being executed.

[0066] The condition for continuing execution may be reflected in the first strategy. The condition for continuing execution is used to determine the task node that can continue to be executed. For example, the condition for continuing execution may include: if at least one task node currently being executed is a target task node, then each task node currently being executed meets the condition for continuing execution. For another example, the condition for continuing execution may include: if, among at least one task node currently being executed, a task node whose execution progress is greater than or equal to a preset progress is a target task node, then, among the task nodes currently being executed, a task node whose execution progress is greater than or equal to a preset progress meets the condition for continuing execution.

[0067] This embodiment sets a first strategy to determine at least one target task node that meets the conditions for continuing execution from at least one task node currently being executed, so that the currently executing node can continue to execute instead of being completely canceled, thereby avoiding the need to repeat the execution of the task node when it is executed again, reducing the waste of computing resources and improving task execution efficiency.

[0068] In some optional implementations of this embodiment, the above step 3032 includes:

[0069] If the target failure response strategy is the first sub-strategy included in the first strategy, the currently executing task node is determined as at least one target task node.

[0070] The first sub-strategy includes the corresponding execution continuation condition, that is, all currently executing task nodes meet the execution continuation condition.

[0071] like Figure 5 As shown, in the DAG graph, task node 11-1 is independent of other nodes, task nodes 1-1, 2-1, and 3-1 have been executed, nodes 3-2 and 11-1 are in operation, and 3-2 suddenly fails to execute. Since the first sub-strategy is triggered, node 11-1 will continue to run. Node 4-1 is not an executing node and it is no longer running. After node 11-1 is executed, the entire DAG is marked as ended. When the DAG needs to be executed again, only nodes 4-1 and 3-2 need to be re-executed. According to the traditional failure strategy, the three nodes 4-1, 3-2, and 11-1 need to be re-executed. Therefore, the first sub-strategy saves the time consumed by re-execution.

[0072] like Figure 6 As shown, it shows an exemplary flow chart executed when the first sub-strategy is triggered. The flow chart specifically includes the following steps:

[0073] 1. When a DAG node fails, the first sub-strategy is triggered.

[0074] 2. Determine whether there are other running DAG nodes.

[0075] 3. If there are running DAG nodes, query them all and wait for them to finish execution; if there are no running DAG nodes, directly mark the end of this DAG, and the unrunning DAG nodes will no longer run.

[0076] 4. If the running DAG node has not finished running, it will wait for its execution to be completed; when all the running DAG nodes are executed, the DAG is marked as finished.

[0077] This embodiment sets the first sub-strategy to achieve the goal of continuing to run all executing task nodes when a task node fails to execute. When the task node set is started again, there is no need to repeatedly execute these nodes, thereby saving time for repeatedly executing task nodes and improving task execution efficiency.

[0078] In some optional implementations of this embodiment, step 3032 includes:

[0079] If the target failure response strategy is the second sub-strategy included in the first strategy, determine the execution progress of each task node in at least one task node currently being executed; and determine the task node that exceeds the preset progress in at least one task node currently being executed as at least one target task node.

[0080] The execution progress of the task node can be determined according to parameters such as execution time, amount of processed data, etc. For example, the amount of data processed by the task node can be counted in real time, and the ratio of the amount of processed data to the total amount of data to be processed can be used as the execution progress.

[0081] The preset progress can be set arbitrarily, for example, 70%. When the execution progress of a task node exceeds the preset progress, it means that the task node is about to be completed. At this time, you can wait for a short time to complete the execution of the task node.

[0082] When the execution progress of a task node does not exceed the preset progress, it means that the task node has just started execution. At this time, the execution of the node can be canceled. After canceling the execution of the node, the overall execution of the multi-task is not greatly affected.

[0083] like Figure 7 As shown in the DAG diagram, nodes 1-1 and 2-3 have been executed, and 2-1, 2-2, and 3-3 are all executing nodes. At this time, node 2-2 fails to execute, and nodes 2-1 and 3-3 are left as running nodes, so nodes 2-1 and 3-3 need to use the above algorithm to calculate the execution progress respectively. The execution progress of node 2-1 exceeds the preset progress, so node 2-1 is the target task node, which can continue to execute, and its subordinate nodes 3-1 and 3-2 are canceled. The execution progress of node 3-3 does not exceed the preset progress, so node 3-3 is not the target task node and needs to be canceled.

[0084] like Figure 8 As shown, it shows an exemplary flow chart executed when the second sub-strategy is triggered. The flow chart specifically includes the following steps:

[0085] 1. When a DAG node fails, the second sub-strategy is triggered.

[0086] 2. First, determine whether there are other running DAG nodes.

[0087] 3. If there are DAG nodes being executed, the execution progress of each DAG node being executed will be calculated; otherwise, the DAG will be marked as finished directly.

[0088] 4. If the execution progress of the DAG node being executed is greater than the preset progress, the DAG node continues to execute, otherwise it is cancelled.

[0089] 5. If the running DAG node has not finished running, it will wait for its execution to be completed; when all the running DAG nodes are executed and the canceled nodes are successfully canceled, the DAG mark is ended.

[0090] This embodiment sets the second sub-strategy to determine the execution progress of the currently executed task node, so that the task node that is about to be executed can continue to execute, avoiding the waste of resources caused by repeated execution. Canceling the execution of the task node that has just started to execute can adapt to more scenarios and make the task execution more flexible.

[0091] In some optional implementations of this embodiment, the execution progress of each task node in at least one task node currently being executed may be determined according to the following steps:

[0092] Step 1: for each task node in at least one task node currently being executed, determine the current execution time of the task node, and obtain the time taken for the most recent N successful executions of the task node.

[0093] Wherein, N is a preset integer greater than or equal to 1. For example, N is 10, that is, the time consumed by the most recent 10 successful executions of the task node is obtained.

[0094] Step 2: Determine a reference duration based on the N durations obtained.

[0095] As an example, an average value of N durations may be taken and the average duration may be used as the benchmark duration; in addition, a median, a maximum value, a minimum value, etc. may also be taken as the benchmark duration.

[0096] Step three: determine the ratio of the current execution time of the task node to the benchmark time as the execution progress of the task node.

[0097] As an example, suppose the above Figure 7 Node 2-1 in the example has been running for 490 seconds. The execution time of the last 10 records is shown in Table 1 below:

[0098] Table 1

[0099]

[0100] Substituting into the formula we get:

[0101] 470 / [(580+560+590+610+570+560+580+620+590+580) / 10] * 100% ≈80.48%>70%. So node 2-1 continues to run and is not affected by the failure of node 2-2.

[0102] Assume that DAG node 3-3 has been running for 300 seconds, and the execution time of the last 10 execution records is shown in Table 2 below:

[0103] Table 2

[0104]

[0105] Substituting into the formula we get:

[0106] 300 / [(1080+1050+1090+1020+1080+1070+1060+1120+1080+1010) / 10] *100% ≈ 28%<70%. Therefore, node 3-3 is affected by the failure of node 2-2, and DAG node 3-3 is cancelled.

[0107] This embodiment calculates the execution progress based on the statistical results by counting the execution time of the task node for the past N times. The calculation method is simple and efficient, and can accurately evaluate the execution progress of the currently executing task node, thereby helping to improve the pertinence and efficiency of the node execution failure strategy.

[0108] In some optional implementations of this embodiment, step 303 includes:

[0109] If the target failure response strategy is the second strategy, a task node that does not depend on the failed task node during execution is determined from the currently unexecuted task nodes as at least one target task node.

[0110] Specifically, the currently unfinished task nodes may include task nodes being executed and task nodes that have not yet started to be executed. Fig. 9 As shown, in the DAG diagram, assuming that nodes 1-1 and 1-2 are both completed nodes, 2-1 and 2-2 are being executed, and node 2-2 suddenly fails to execute, then nodes 2-1, 3-1, 3-2, 4-1, 3-3, and 3-4 are currently unfinished task nodes.

[0111] Since the second strategy can make the currently executable task nodes as fully executed as possible without strictly canceling the execution of all unexecuted task nodes, the second strategy can also be called a non-strict strategy.

[0112] Generally, since the above-mentioned task node set is represented in the form of a DAG graph, it is possible to determine which nodes are not dependent on the failed task node according to the dependency relationship between the nodes in the DAG graph.

[0113] like Fig. 9 As shown in the figure, node 2-2 suddenly fails to execute, because the parent node of 3-3 and 3-4 is 2-2, so 3-3 and 3-4 will not be executed. The parent nodes of 2-1 are 1-1 and 1-2, so 2-1 continues to execute. When 2-1 is executed successfully, 3-1 and 3-2 will be executed successfully. Ideally, after 3-1 and 3-2 are executed successfully, 4-1 will be executed. After 4-1 is executed successfully, there is no node that can be driven to execute, and the DAG is marked as ended. If any one of nodes 3-1 and 3-2 fails, 4-1 will no longer be executed. At this time, there is no node that can be driven in the entire DAG graph, and the DAG will also be marked as ended.

[0114] This embodiment determines the task nodes that do not depend on the failed task nodes during execution from the currently unexecuted task nodes, and uses these nodes as nodes that can continue to be executed. This can ensure that all executable nodes in the task node set are executed as much as possible, so that when the task nodes are restarted, more nodes do not need to be executed again, which can further save the execution time of the task nodes and improve the efficiency of task execution.

[0115] In some optional implementations of this embodiment, the following steps may be followed to determine a task node that is not dependent on a failed task node during execution as a target task node:

[0116] For each task node among the currently unexecuted task nodes, determine whether the task node recurses to the failed task node by recursing to the dependent superior task node step by step; if it recurses to the failed task node, determine the task node as the target task node.

[0117] like Fig.10 As shown, assume that nodes 1-1 and 1-2 have been executed. 2-2 and 2-3 are being executed, and the rest of the nodes have not been executed. At this time, node 2-3 suddenly fails to execute, because the parent nodes of 3-2 are 2-2 and 2-3. As long as any of them fails, 3-2 will not be executed again. The parent node of 4-2 and 4-3 is 3-2, so 4-2 and 4-3 will not be executed again. That is, for nodes 4-2, 4-3, and 3-2, it can be recursively traced back to the failed task node 2-3. Therefore, it is determined that nodes 4-2, 4-3, and 3-2 are not target task nodes, and the execution of these three nodes is canceled.

[0118] The parent node of node 2-1 is 1-1, which runs normally. If 2-1 and 2-2 are both executed successfully, 3-1 will be executed normally, and 4-1 will run normally after 3-1 is executed successfully. That is, for nodes 4-1, 3-1, 2-1, and 2-2, they will not recurse to the failed task node 2-3. Therefore, nodes 4-1, 3-1, 2-1, and 2-2 are all target task nodes, and these four nodes can be executed to the end.

[0119] The above is an ideal state. If it is not an ideal state, for example, if node 3-1 fails to execute, then 4-1 will not be executed. At this time, there is no executable node in the DAG, and the DAG mark ends.

[0120] like Fig.11 As shown, it shows an exemplary flow chart of determining the target task node by recursively going to the upper node level by level when the second strategy is triggered. The flow chart specifically includes the following steps:

[0121] 1. The DAG node fails to execute, triggering the second strategy.

[0122] 2. Determine whether there is an executable DAG node. If not, directly mark the end of DAG execution.

[0123] 3. If there are executable DAG nodes, the next step is to divide the regions. The division logic is: recurse all the executing and unexecuted DAG nodes upwards respectively. If any of the recursive upward nodes is a failed DAG node, it is divided into the non-executable region, otherwise it is divided into the executable region. Fig.10 As shown, region A is an executable region, and each node included therein can continue to be executed, and region B is a non-executable region, and all nodes included therein are canceled from being executed.

[0124] 4. After the area is divided, another judgment will be made, that is, whether there are still executable DAG nodes in the executable area (the judgment logic is: if the node under the executable area is not executed and all the parent nodes of the node are executed successfully, the node is judged to be an executable DAG node). If there is no executable node under the executable area, the DAG mark is directly ended.

[0125] 5. If there are executable DAG nodes under the executable area, execute the nodes of the executable area. If the node is executed successfully, execute the logic of step 4 again. If the node fails to execute, execute the logic of step 3 to re-divide the executable area and the non-executable area. Then, repeatedly execute steps 4 and 3 according to the execution results until step 4 determines that the DAG can be ended, then mark the DAG as ended.

[0126] This embodiment improves the accuracy of determining the target task nodes that can be continued to be executed by recursively returning each unexecuted task node to the dependent upper-level task node. Under the second strategy, all executable nodes can be executed to the greatest extent possible, thereby improving the efficiency of multi-task execution.

[0127] It should be noted that the first sub-strategy, the second sub-strategy, and the second strategy included in the above-mentioned first strategy can be used in any combination in the same task node set. Usually, the first sub-strategy and the second sub-strategy included in the first strategy can be applied to more important task nodes. When the execution of the node fails, in order to ensure the execution accuracy, it is necessary to cancel the unexecuted task nodes. The above-mentioned second strategy can be applied to unimportant task nodes. When the execution of the node fails, it is not necessary to stop executing other nodes, so that the nodes that do not depend on the node continue to execute.

[0128] For example, Fig.12 As shown, each node in the DAG diagram shown can be set to a different failure response strategy. Fig.12 If node 2-1 in the above fails to execute, the failure strategy is executed according to the second sub-strategy included in the above first strategy. If node 3-3 fails, the above second execution failure response strategy is executed according to the above second. The remaining nodes 1-1, 2-2, 2-3, 3-1, 3-2, and 3-4 execute the failure response strategy according to the first sub-strategy included in the first strategy. Combining the above various failure response strategy combinations can make the failure response strategy adapt to more complex multi-task scenarios.

[0129] In some optional implementations of this embodiment, such as Fig.13 As shown, step 302 includes:

[0130] Step 3021, determining whether a corresponding failure response strategy is pre-set for the failed task node.

[0131] If the corresponding failure response strategy is set, execute step 3022, otherwise execute step 3023. The failure response strategy set for the failed task node is a failure response strategy set specifically for a task node. When a task node fails to execute, the subsequent steps are executed according to the failure response strategy.

[0132] Step 3022: determine the failure response strategy for the failed task node as the target failure response strategy.

[0133] Step 3023, determining whether a corresponding failure response strategy is pre-set for the task node set.

[0134] If a corresponding failure response strategy is set for the task node set, execute step 3024, otherwise execute step 3025. The failure response strategy corresponding to the task node set is a failure response strategy specifically set for the task node set. When a task node fails to execute, the failure response strategy corresponding to the task node set can be automatically executed.

[0135] Step 3024: determine the failure response strategy for the task node set as the target failure response strategy.

[0136] Step 3025: determine the default failure response strategy as the target failure response strategy.

[0137] That is, when a task node fails to execute, if a failure response strategy is specially set for the task node and the task node set, the default failure response strategy is called. After executing step 3025, the subsequent steps can be executed according to the target failure response strategy.

[0138] The default failure response strategy is the default strategy adopted when no specific failure response strategy is set.

[0139] In combination with the above embodiments, the target failure response strategy is any one of the above-mentioned first sub-strategy, second sub-strategy, and second strategy.

[0140] This embodiment achieves more flexible configuration of failure response strategies for task node sets by setting failure response strategies for specific task nodes, setting failure response strategies for the entire task node set, and setting default failure response strategies, thereby improving the scenario adaptability of the method.

[0141] Fig.14 A structural diagram of a device for processing task execution failure provided in an embodiment of the present application. Specifically comprising: a first determination module 1401, used to determine the task node that currently fails to execute as a failed task node from a preset task node set; a second determination module 1402, used to determine the target failure response strategy corresponding to the preset failed task node; a third determination module 1403, used to determine at least one target task node that meets the conditions for continuing execution from the currently unexecuted task nodes based on the target failure response strategy; an execution module 1404, used to continue executing at least one target task node, and stop executing other task nodes other than at least one target task node in the task node set.

[0142] In some optional implementations of this embodiment, the third determination module includes: a first determination unit, used to determine at least one task node currently being executed from a task node set if the target failure response strategy is the first strategy; a second determination unit, used to determine at least one target task node that meets the conditions for continuing execution from at least one task node currently being executed.

[0143] In some optional implementations of this embodiment, the second determination unit is further used to: if the target failure response strategy is the first sub-strategy included in the first strategy, determine the currently executing task node as at least one target task node.

[0144] In some optional implementations of the present embodiment, the second determination unit includes: a first determination sub-unit, used to determine the execution progress of each task node in at least one task node currently being executed if the target failure response strategy is the second sub-strategy included in the first strategy; and a second determination sub-unit, used to determine the task node in at least one task node currently being executed that exceeds a preset progress as at least one target task node.

[0145] In some optional implementations of the present embodiment, the first determination subunit is further used to: for each task node of at least one task node currently being executed, determine the current execution duration of the task node, and obtain the durations consumed for the most recent N successful executions of the task node, where N is a preset integer greater than or equal to 1; determine a benchmark duration based on the N durations obtained; and determine the ratio of the current execution duration of the task node to the benchmark duration as the execution progress of the task node.

[0146] In some optional implementations of this embodiment, the third determination module includes: a third determination unit, which is used to determine, from the currently unexecuted task nodes, a task node that does not depend on the failed task node during execution, as at least one target task node if the target failure response strategy is the second strategy.

[0147] In some optional implementations of the present embodiment, the third determination unit includes: a third determination sub-unit, used to determine, for each task node among the currently unexecuted task nodes, whether the task node recurses to a failed task node in a step-by-step recursive manner to the dependent upper-level task node; and a fourth determination sub-unit, used to determine the task node as a target task node if it recurses to a failed task node.

[0148] In some optional implementations of the present embodiment, the second determination module includes: a fourth determination unit, used to determine whether a corresponding failure response strategy is pre-set for the failed task node; a fifth determination unit, used to determine the failure response strategy for the failed task node as the target failure response strategy if the failure response strategy for the failed task node is set; a sixth determination unit, used to determine whether a corresponding failure response strategy is pre-set for the task node set if the failure response strategy for the failed task node is not set; a seventh determination unit, used to determine the failure response strategy for the task node set as the target failure response strategy if the failure response strategy for the task node set is set; and an eighth determination unit, used to determine the default failure response strategy as the target failure response strategy if the failure response strategy for the task node set is not set.

[0149] The task execution failure processing device provided in this embodiment may be as follows: Fig.14 The task execution failure processing device shown in can execute all steps of the above-mentioned task execution failure processing methods, thereby achieving the technical effects of the above-mentioned task execution failure processing methods. Please refer to the above-mentioned relevant description for details. For the sake of concise description, it will not be repeated here.

[0150] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Fig.15 The electronic device 1500 shown includes: at least one processor 1501, a memory 1502, at least one network interface 1504 and other user interfaces 1503. The various components in the electronic device 1500 are coupled together via a bus system 1505. It is understood that the bus system 1505 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 1505 is not described in detail. Fig.15 Various buses are labeled as bus system 1505.

[0151] The user interface 1503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0152] It can be understood that the memory 1502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 1502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0153] In some embodiments, the memory 1502 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 15021 and an application program 15022 .

[0154] Among them, the operating system 15021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 15022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 15022.

[0155] In this embodiment, by calling the program or instruction stored in the memory 1502, specifically, the program or instruction stored in the application 15022, the processor 1501 is used to execute the method steps provided by each method embodiment, for example, including:

[0156] From a preset set of task nodes, determine the task node that currently fails to execute as a failed task node; determine a target failure response strategy corresponding to the preset failed task node; based on the target failure response strategy, determine at least one target task node that meets the conditions for continuing execution from the currently unexecuted task nodes; continue to execute at least one target task node, and stop executing other task nodes except at least one target task node in the task node set.

[0157] The method disclosed in the above embodiment of the present application can be applied to the processor 1501, or implemented by the processor 1501. The processor 1501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1501. The above processor 1501 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor are combined and executed. The software unit may be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1502, and the processor 1501 reads the information in the memory 1502 and completes the steps of the above method in combination with its hardware.

[0158] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.

[0159] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0160] The electronic device provided in this embodiment may be Fig.15 The electronic device shown in can execute all steps of the above-mentioned method for processing failure of each task execution, thereby achieving the technical effect of the above-mentioned method for processing failure of each task execution. Please refer to the above related description for details. For the sake of concise description, it will not be repeated here.

[0161] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0162] When one or more programs in the storage medium can be executed by one or more processors, the above-mentioned method for processing task execution failure executed on the electronic device side can be implemented.

[0163] The processor is used to execute the program stored in the memory to implement the following steps of the method for processing task execution failure executed on the electronic device side:

[0164] From a preset set of task nodes, determine the task node that currently fails to execute as a failed task node; determine a target failure response strategy corresponding to the preset failed task node; based on the target failure response strategy, determine at least one target task node that meets the conditions for continuing execution from the currently unexecuted task nodes; continue to execute at least one target task node, and stop executing other task nodes except at least one target task node in the task node set.

[0165] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different circuits to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0166] The steps of the circuits or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, software modules executed by a processor, or a combination of the two. The software modules may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0167] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be represented to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The steps, processes, and operations described in the text are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0168] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for processing task execution failure, characterized in that: The method comprises: From a preset task node set, determine the task node that currently fails to execute as a failed task node; Determine the target failure response strategy corresponding to the preset failed task node; Based on the target failure response strategy, determine at least one target task node that meets the execution continuation condition from the currently unexecuted task nodes; Continue to execute the at least one target task node, and stop executing other task nodes in the task node set except the at least one target task node; The determining of the preset target failure response strategy corresponding to the failed task node includes: Determine whether a corresponding failure response strategy is pre-set for the failed task node; If a failure response strategy for the failed task node is set separately, the failure response strategy for the failed task node is determined as the target failure response strategy; If no failure response strategy is set separately for the failed task node, determining whether a corresponding failure response strategy is pre-set for the task node set; If a failure response strategy for the task node set is set, the failure response strategy for the task node set is determined as the target failure response strategy; If no failure response strategy is set for the task node set, a default failure response strategy is determined as the target failure response strategy; The step of determining at least one target task node that meets the execution continuation condition from the currently unexecuted task nodes based on the target failure response strategy includes: If the target failure response strategy is the second sub-strategy included in the first strategy, determining the execution progress of each task node in at least one task node currently being executed; A task node that exceeds a preset progress in the at least one task node currently being executed is determined as the at least one target task node.

2. The method according to claim 1, characterized in that: The step of determining at least one target task node that meets the execution continuation condition from the currently unexecuted task nodes based on the target failure response strategy includes: If the target failure response strategy is the first strategy, determining at least one task node currently being executed from the task node set; At least one target task node that meets the execution continuation condition is determined from the at least one task node currently being executed.

3. The method according to claim 2, characterized in that The determining, from the at least one task node currently being executed, at least one target task node that meets the condition for continuing execution comprises: If the target failure response strategy is the first sub-strategy included in the first strategy, the currently executing task node is determined as the at least one target task node.

4. The method according to claim 1, characterized in that: The determining the execution progress of each task node in at least one task node currently being executed includes: For each task node of the at least one task node currently being executed, determine the current execution time of the task node, and obtain the time taken for the most recent N successful executions of the task node, where N is a preset integer greater than or equal to 1; Determine a benchmark duration based on the N durations obtained; The ratio of the current execution time of the task node to the reference time is determined as the execution progress of the task node.

5. The method according to claim 1, characterized in that The step of determining at least one target task node that meets the execution continuation condition from the currently unexecuted task nodes based on the target failure response strategy includes: If the target failure response strategy is the second strategy, a task node that is not dependent on the failed task node during execution is determined from the currently unexecuted task nodes as the at least one target task node.

6. The method according to claim 5, characterized in that The step of determining, from the currently unexecuted task nodes, a task node that is not dependent on the failed task node during execution as the at least one target task node comprises: For each task node in the currently unexecuted task nodes, determine whether the task node recurses to the failed task node in a recursive manner to the dependent upper-level task node; If the failed task node is recursively reached, the task node is determined as the target task node.

7. A device for processing task execution failure, characterized in that: The device comprises: A first determination module is used to determine a task node that has failed to execute currently as a failed task node from a preset task node set; A second determination module is used to determine a preset target failure response strategy corresponding to the failed task node; A third determination module is used to determine at least one target task node that meets the execution continuation condition from the currently unexecuted task nodes based on the target failure response strategy; An execution module, used to continue executing the at least one target task node, and stop executing other task nodes in the task node set except the at least one target task node; The second determining module comprises: A fourth determining unit, used to determine whether a corresponding failure response strategy is pre-set for the failed task node; a fifth determining unit, configured to determine the failure coping strategy for the failed task node as the target failure coping strategy if a failure coping strategy for the failed task node is set separately; a sixth determining unit, configured to determine whether a corresponding failure coping strategy is pre-set for the task node set if a failure coping strategy for the failed task node is not set separately; a seventh determining unit, configured to determine the failure coping strategy for the task node set as the target failure coping strategy if the failure coping strategy for the task node set is set; an eighth determining unit, configured to determine a default failure response strategy as the target failure response strategy if no failure response strategy is set for the task node set; The third determination module is further used for: If the target failure response strategy is the second sub-strategy included in the first strategy, determining the execution progress of each task node in at least one task node currently being executed; A task node that exceeds a preset progress in the at least one task node currently being executed is determined as the at least one target task node.

8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for processing task execution failure described in any one of claims 1 to 6 is implemented.