Industrial task flow dynamic generation method and device, computer equipment and storage medium
By generating a task flow to be executed by pre-setting nodes and task templates, and dynamically updating the task flow in case of anomalies, the system solves the problems of insufficient self-recovery capability and node configuration flexibility in robot scheduling systems, thereby improving the efficiency of task flow generation and system reliability.
Patent Information
- Application Number
- CN202511428228.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-02-06
AI Technical Summary
Existing robot scheduling systems lack the ability to self-recover from anomalies during industrial task execution, leading to task failures and repetitive operations. Furthermore, the lack of flexibility in node configuration affects system reliability and reusability.
The system generates a task flow to be executed by pre-setting nodes and pre-setting task templates. It also dynamically updates the task flow when an exception occurs by using a pre-configured retry strategy, thereby generating a dynamic task flow, reducing the complexity of process setup and reducing repetitive operations caused by exceptions.
It improves the efficiency of dynamically generating task flows, reduces repetitive operations and time waste in case of exceptions, and enhances the reliability and flexibility of the system.
Smart Images

Figure CN121481031A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotics technology, and in particular to a method, apparatus, computer equipment, and storage medium for dynamically generating industrial task flows. Background Technology
[0002] With the rapid development of the Industrial Internet of Things (IIoT) and intelligent manufacturing, robot scheduling systems are playing an increasingly prominent role in logistics warehousing, production, and other fields. However, existing technologies still suffer from two major drawbacks in executing industrial task flows: insufficient self-recovery capability and lack of flexibility in node configuration. These shortcomings severely restrict the reliability and reusability of the systems.
[0003] Current mainstream robot scheduling systems generally suffer from two core problems in robot task execution. Taking robot navigation as an example, when positioning is lost, hardware malfunctions, or multiple concurrent malfunctions occur during navigation, the task flow will directly fail. In such cases, manual intervention is usually required. After handling the malfunction, the current task flow still fails, and the system needs to resend the current task flow. The recovery method after robot malfunctions is currently mainly based on the strategy of full task rollback, which cannot recover from the current failure node. This will cause the robot to repeat some communication or control actions.
[0004] Existing technologies generally employ hard-coding in task flow node orchestration. When different industrial scenarios require different robot control actions to fulfill the execution of transport tasks, it is usually necessary to develop new corresponding robot control action nodes to ensure the complete execution of the entire transport task flow. Therefore, improving the efficiency of dynamically generating task flows has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, computer equipment, and storage medium for dynamically generating industrial task flows, so as to improve the efficiency of dynamically generating task flows.
[0006] In a first aspect, this application provides a method for dynamically generating industrial task flows, the method comprising:
[0007] Based on the robot's preset nodes and preset task templates, determine the task flow to be executed;
[0008] Based on the task execution flowchart corresponding to the task flow to be executed, determine the sub-tasks corresponding to each preset node, and execute each sub-task through each preset node;
[0009] When an exception occurs during the execution of the subtask through the preset node, the task flow to be executed is updated according to the preset retry policy corresponding to each preset node, and a dynamic task flow is generated.
[0010] Secondly, this application also provides an industrial task flow dynamic generation device, the device comprising:
[0011] The task flow determination module is used to determine the task flow to be executed based on the robot's preset nodes and preset task templates;
[0012] The subtask execution module is used to determine the subtasks corresponding to each preset node according to the task execution flowchart corresponding to the task flow to be executed, and to execute each subtask through each preset node.
[0013] The dynamic task flow generation module is used to update the task flow to be executed according to the pre-configured pre-retry strategy corresponding to each pre-configured node when an exception occurs during the execution of the sub-task through the pre-configured node, and generate a dynamic task flow.
[0014] Thirdly, this application also provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the industrial task flow dynamic generation method as described above.
[0015] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the above-described method for dynamically generating industrial task flows.
[0016] This application discloses a method, apparatus, computer device, and storage medium for dynamically generating industrial task flows. The method includes determining a task flow to be executed based on preset nodes and preset task templates of a robot; determining subtasks corresponding to each preset node based on the task execution flowchart corresponding to the task flow to be executed, and executing each subtask through each preset node; when an exception occurs during the execution of the subtask through the preset node, updating the task flow to be executed according to a pre-configured preset retry strategy corresponding to each preset node, thereby generating a dynamic task flow. Through this method, this application generates tasks to be executed using preset nodes and templated task flows, reducing the complexity of process setup. By using node-based execution and dynamic retry strategies, the task execution logic is adjusted according to preset strategies when exceptions occur, effectively reducing repetitive operations and time waste caused by exceptions, and significantly improving the efficiency of dynamically generating task flows. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart of an industrial task flow dynamic generation method provided by an embodiment of this application;
[0019] Figure 2 A schematic block diagram of an industrial task flow dynamic generation device provided for embodiments of this application;
[0020] Figure 3 A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0023] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0024] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0025] This application provides a method, apparatus, computer device, and storage medium for dynamically generating industrial task flows. The method can be applied to a server, generating tasks to be executed through preset nodes and templated task flows, reducing the complexity of process setup. By using node-based execution and a dynamic retry strategy, the task execution logic is adjusted according to preset strategies when anomalies occur, effectively reducing repetitive operations and time waste caused by anomalies, significantly improving the efficiency of dynamically generating task flows. The server can be a standalone server or a server cluster.
[0026] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0027] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating an industrial task flow dynamic generation method provided in an embodiment of this application. This method can be applied to servers to generate tasks to be executed through preset nodes and templated task flows, reducing the complexity of process setup. By using node-based execution and a dynamic retry strategy, the task execution logic is adjusted according to preset strategies when anomalies occur, effectively reducing repetitive operations and time waste caused by anomalies, and significantly improving the efficiency of dynamically generating task flows.
[0028] like Figure 1 As shown, the method for dynamically generating industrial task flows specifically includes steps S10 to S30.
[0029] Step S10: Determine the task flow to be executed based on the robot's preset nodes and preset task templates;
[0030] Specifically, a node library is predefined in the system, which includes various types of preset nodes (such as robot movement nodes, rotation nodes, HTTP request nodes, condition judgment nodes, etc.). Each node is assigned a unique type identifier and configured with the parameters required for its execution (such as the target coordinates of the movement node and the URL address of the HTTP request node). This node information is stored in the database.
[0031] Users drag and drop the desired preset nodes from the node library through a graphical user interface, and define the execution order and logical relationship between nodes (such as sequence, branch, parallel) by connecting them, thereby constructing a complete and reusable preset task template (such as "shelf handling process template").
[0032] Upon receiving the execution instruction, a specific task instance is created based on the specified preset task template, which generates a task flow to be executed. The task flow to be executed inherits all nodes and structures of the template and assigns values to runtime parameters (such as specifying a specific robot number and target point for the moving node).
[0033] Step S20: Determine the subtasks corresponding to each preset node according to the task execution flowchart corresponding to the task flow to be executed, and execute each subtask through each preset node;
[0034] Specifically, the task execution engine loads the task flow to be executed, parses its task execution flowchart, constructs a directed graph structure in memory, and determines the execution order and dependencies of all preset nodes.
[0035] The task execution engine schedules and executes each preset node sequentially according to the flowchart logic. For the preset node that needs to be executed, the task execution engine locates the code component that executes the core function of the node based on its unique type identifier, loads the parameters configured when the preset node was instantiated, and executes the subtask corresponding to the preset node. For example, if the node is a "robot movement node", then a movement command is issued to the specified robot through the robot control interface; if the node is an "HTTP request node", then a network request is initiated to the target URL.
[0036] Step S30: When an exception occurs during the execution of the subtask through the preset node, the task flow to be executed is updated according to the preset retry strategy corresponding to each preset node, and a dynamic task flow is generated.
[0037] Specifically, when executing a subtask of any node, its execution status is monitored in real time, and any abnormal information (such as robot communication interruption, HTTP request timeout, or business logic failure) is immediately captured.
[0038] Pause the current task flow and query the preset retry policies of the preset nodes that have encountered the error. Each preset retry policy defines the retry behavior (such as unlimited retry, no retry, limited retry) and may include advanced options (such as "allow skipping" and "allow retrying again").
[0039] Based on the preset retry strategy retrieved, the subsequent execution logic is dynamically adjusted to update the task flow to be executed, thereby generating a dynamic task flow that adapts to exception information. Specific preset retry strategies may include:
[0040] Infinite retry: Automatically waits for a preset interval before re-executing the subtask of the current node, repeating this process until success;
[0041] No retry: Immediately mark the subtask's status as "abnormal pause" and wait for manual intervention;
[0042] Limited retries: Automatically retry within a preset number of loops. If the retry is successful, continue executing the subsequent nodes. If the current number of retries reaches the preset number of retries, then: if "Allow skip" is configured, the task execution engine will automatically skip the current abnormal node and continue executing the next node; if "Allow retry again" is configured, the task execution engine will pause the task and issue an alarm, waiting for manual confirmation. After manual intervention, "Retry again" can be selected, and the task execution engine will reset the retry counter and retry executing the node.
[0043] For nodes configured to retries a limited number of times, an additional option will be provided: allow retries. If the node is configured to allow retries, and an exception still occurs after the node has exhausted its retries, an additional option will appear on the interface: retry? With manual intervention, if retries are selected, the node will receive 10 attempts (the exact number of attempts equals the node's original configuration), and the system will continue executing that node. If the node is configured to disallow retries, and an exception still occurs after the node has exhausted its retries, the node will be stuck and unable to continue executing subsequent nodes.
[0044] For nodes configured to retries a limited number of times, an additional option will be available: allow skipping. If the node is configured to allow skipping, and an exception still occurs after multiple retries, the interface will display an additional option: skip? With manual intervention, if "yes" is selected, the faulty node will be skipped, and execution will continue to the next node. If "no" is selected, the node will remain stuck at the current node, preventing further execution.
[0045] In this specific embodiment, by packaging the system's capabilities and the robot's functions into nodes, relevant personnel can freely organize the nodes according to the needs of the site, allowing the system and robot to execute the relevant nodes according to the specified process. Due to this WYSIWYG orchestration mode, relevant personnel can visually understand the relevant business, correct existing business errors, and continuously explore various interesting orchestrations to realize various ingenious ideas.
[0046] For example, when selecting a process node, you can select a condition node to execute different processes based on the system attribute status;
[0047] For example, when selecting process-type nodes, you can choose parallel nodes to execute multiple nodes in parallel, thereby improving task execution efficiency;
[0048] For example, when selecting a communication node, you can choose an HTTP request node, which communicates and interacts with third-party systems during the process, enabling multiple systems to be organically combined and collaborated.
[0049] For example, when performing a handling task, you can select the robot's movement node to move a specific robot to a designated location; select the rotation node to rotate the robot at a specified angle; select the scripted robotic arm node to allow the robot to pick up relevant goods at a designated location, and so on.
[0050] This embodiment discloses a method, apparatus, computer equipment, and storage medium for dynamically generating industrial task flows. The method includes determining a task flow to be executed based on preset nodes and preset task templates of a robot; determining subtasks corresponding to each preset node based on the task execution flowchart corresponding to the task flow to be executed, and executing each subtask through each preset node; when an exception occurs during the execution of the subtask through the preset node, updating the task flow to be executed according to a pre-configured preset retry strategy corresponding to each preset node, thereby generating a dynamic task flow. Through this method, this application generates tasks to be executed using preset nodes and templated task flows, reducing the complexity of process setup. By using node-based execution and dynamic retry strategies, the task execution logic is adjusted according to preset strategies when exceptions occur, effectively reducing repetitive operations and time waste caused by exceptions, and significantly improving the efficiency of dynamically generating task flows.
[0051] based on Figure 1 In the illustrated embodiment, step S20 includes:
[0052] Each subtask is determined according to the node type of the preset node;
[0053] Specifically, the task execution engine reads the configuration information of the currently pending preset nodes in the task flow and obtains their node type identifiers. The task execution engine maintains a mapping registry between node types and execution logic. The mapping registry records the specific execution class or function corresponding to each node type. By querying this registry, the node type identifier is mapped to the code component that is actually responsible for executing its core function. After the execution component is determined, it defines and initializes a specific subtask based on the node's configuration parameters (such as target coordinates, URL, and judgment conditions). At this point, an abstract "node" is explicitly defined as a "subtask" with a specific goal and specific parameters.
[0054] Analyze the task execution flowchart to determine the execution order and dependencies between the preset nodes;
[0055] Specifically, the task execution engine loads the data structure of the task flow. The data structure contains all node entities and directed edges connecting these nodes. Based on the node and edge information of the flowchart, the task execution engine constructs a directed graph model in memory. In this graph, nodes represent subtasks, and directed edges represent constraints on the execution order.
[0056] The task execution engine analyzes the topology of the directed graph to accurately calculate the execution order and dependencies of all nodes. The order relationship determines which nodes should be executed sequentially, and the dependency relationship determines which nodes can be executed in parallel (such as branches after parallel nodes). The execution of which nodes depends on the output of one or more preceding nodes (such as the branch selection of a condition node depending on the execution result of its predecessor node).
[0057] According to the execution order of the nodes and the dependencies, each of the subtasks is executed through each of the preset nodes.
[0058] Specifically, the task execution engine acts as a scheduler, strictly following the node execution order and dependencies to schedule subtasks. For parallel nodes without dependencies, multiple threads or asynchronous tasks are created to trigger simultaneously; for nodes with a strict order, the next one is started only after the preceding node has successfully completed.
[0059] For each scheduled preset node, the task execution engine calls the mapped execution component and passes in the configuration parameters to execute the subtask defined for that preset node (e.g., issuing movement commands to the robot, sending HTTP requests, or performing conditional checks). After each subtask is executed, the task execution engine updates its status (success, failure, in progress) and determines the next step based on the execution result and the logic of the flowchart. If successful, it continues to execute the next node according to the flowchart; if it fails, it triggers the exception handling mechanism (e.g., retry).
[0060] For conditional nodes, the corresponding branch path is selected based on their execution results, and the subsequent execution order is dynamically adjusted.
[0061] In a specific embodiment, each subtask is determined according to the node type of the preset node, including:
[0062] When the preset node is the process node, the subtask is determined to be a process control operation task;
[0063] Specifically, the task execution engine identifies the type of the preset node to be executed as a "process node". Based on the specific subtype of the process node (such as loop or wait), the task execution engine maps it to the corresponding process control executor from the registry and defines a specific process control operation task according to the node's configuration parameters.
[0064] If the preset node is a loop node, the subtask is defined as "execute its nested subprocesses N times in a loop", where the number of loops N is a configuration parameter;
[0065] If the preset node is a waiting node, the subtask is defined as "suspending the current process and waiting for the duration or until an external event is received";
[0066] When the preset node is a loop node, the task execution engine will treat its nested sub-processes as a whole task block and repeatedly schedule and execute the task block several times.
[0067] When the preset node is a waiting node, the task execution engine will start a timer or register an event listener and pause the current thread until the condition is met before waking up the thread and continuing to execute subsequent nodes.
[0068] When the preset node is the condition node, the subtask is determined to be a conditional branch task;
[0069] Specifically, when the task execution engine identifies the current node as a "condition node", it maps it to the condition node executor. The condition node executor defines a specific conditional branch task based on the node's configuration parameters, evaluates one or more conditional expressions, selects an exit branch based on the result, and the task execution engine executes this conditional branch task.
[0070] The condition node executor calculates the value of the conditional expression. Based on the Boolean or numerical value of the evaluation result, it dynamically selects one of the possible exit paths from all possible exit paths of the condition node as the subsequent execution path. The task execution engine will then schedule the execution of the next node connected to that path. Unselected branch paths will be ignored.
[0071] If the preset node is the parallel node, the subtask is determined to be an initiating parallel task.
[0072] Specifically, the task execution engine identifies the current node as a "parallel node" and maps it to a parallel node executor. The parallel node executor defines a specific parallel task to initiate based on the node's configuration. The core of a parallel task is to create independent execution contexts for all its exit branches and initiate execution simultaneously.
[0073] based on Figure 1 In the illustrated embodiment, step S30 includes:
[0074] During the execution process of the sub-task through the preset node, monitor for any abnormal information.
[0075] Specifically, when the task execution engine calls the node execution component to run a subtask, it synchronously monitors the execution status of the task. When the subtask fails to execute (e.g., the robot returns an error code, the HTTP request throws a timeout exception, or the business logic verification fails), the task execution engine will immediately capture the thrown exception or error information. The task execution engine can perform preliminary classification of the exception (e.g., network exception, hardware exception, business exception).
[0076] When the abnormal information is detected, the execution task process is paused and the preset retry strategy is determined according to the node type of the preset node;
[0077] Specifically, once an exception is caught, the task execution engine immediately pauses the current task flow, suspends the current execution thread or sets its state to pause, in order to prevent the execution of subsequent nodes from continuing without handling the exception.
[0078] The task execution engine uses the unique type identifier of the current abnormal node as the key to query the corresponding node configuration entity and retrieve the preset retry strategy pre-configured for that type of node.
[0079] According to the preset retry strategy, the initial execution logic of each subtask executed through each preset node is adjusted to generate dynamic execution logic;
[0080] Specifically, the task execution engine parses the retry strategy obtained and dynamically generates or selects a new execution logic based on the strategy content to replace the original linear execution path (i.e., the initial execution logic).
[0081] If the strategy is "infinite retry": the generated dynamic execution logic is a loop structure, the logic is: "wait for the interval time → re-execute the current node → check if it is successful → if it fails, loop";
[0082] If the policy is "Disable retry": the generated dynamic execution logic is a termination and suspension structure, with the logic being: "Report exception → Set task status to 'Waiting for manual intervention' → Process paused".
[0083] If the strategy is "limited retries": the generated dynamic execution logic is a loop structure with a counter. The logic within the loop is the same as for "infinite retries", but an additional condition is added: if the system still fails after the preset number of retries, then:
[0084] If the configuration allows skipping, the dynamic logic becomes a jump structure: "Skip the current node and continue to the next node";
[0085] If the configuration allows retrying, the dynamic logic becomes a wait-for-external-event structure: "Report an exception and wait → If a 'retry again' instruction is received, reset the counter and re-enter the loop; if a 'skip' instruction is received, execute the jump";
[0086] If none of these are configured, the dynamic logic becomes a termination failure structure: "Report exception → Set task status to 'final failure' → End process".
[0087] The dynamic execution logic updates the task flow to be executed, thereby generating the dynamic task flow.
[0088] Specifically, the task execution engine applies the generated dynamic execution logic to the current task flow instance. This can be manifested as modifying the next pointer of the current node in memory, setting a retry counter in the context of the process instance, or setting a status flag to indicate the next action.
[0089] After the above adjustments, the original fixed "task flow to be executed" is assigned a new execution path at runtime. The new execution path dynamically determined according to the strategy after an exception occurs is called the "dynamic task flow".
[0090] The task execution engine resumes previously paused task processes based on the paths defined by the newly generated dynamic task flow, and continues to execute tasks (which may involve retrying the current node, executing the next node, or waiting).
[0091] In a specific embodiment, according to the preset retry strategy, the initial execution logic of executing each subtask through each preset node is adjusted to generate dynamic execution logic, including:
[0092] If the preset retry strategy is the infinite retry strategy, then when the abnormal information is detected, the dynamic execution logic is determined to control the preset node to cyclically execute the execution task process according to the preset time interval until the subtask is completed.
[0093] Specifically, after catching an exception, the task execution engine queries the configuration of the preset node and confirms that its preset retry strategy is "infinite retries". Based on this, the task execution engine generates a dynamic execution logic with a loop retry mechanism. The core definition of this logic is to control the execution flow to return to the current exception node itself, and insert a preset time interval between each retry. This loop logic replaces the original linear flow, generating a dynamic task flow characterized by continuously retrying the current node until the subtask of that node is successfully completed.
[0094] If the preset retry policy is the retry-disallowing policy, then when the abnormal information is detected, the dynamic execution logic is determined to control the preset node to suspend the execution of the task process;
[0095] Specifically, the task execution engine confirms that the preset retry policy of the preset node is "disable retries" (i.e., the number of retries is 0). Based on this, the task execution engine generates a paused dynamic execution logic, the core definition of which is to immediately terminate any retry attempts and set the task status to "abnormal pause".
[0096] If the preset retry strategy is the limited retry strategy, then when the abnormal information is detected, the dynamic execution logic is determined to execute the task process through the preset node according to the preset number of loops.
[0097] Specifically, the task execution engine confirms that the preset retry policy of the preset node is "limited retries" and obtains its configured preset loop count N (e.g., 3 retries). Based on this, the task execution engine generates a limited loop dynamic execution logic with a counter. The core definition is that retries are allowed, but the number of retries must not exceed the preset upper limit N (e.g., 3).
[0098] This finite loop logic generates a dynamic task flow. This task flow has two possible outcomes:
[0099] 1. If it succeeds within N retries, the dynamic task flow will revert to the original process.
[0100] 2. If the attempt fails after N retries, the logic will be adjusted again based on other advanced configurations of the node (such as whether skipping is allowed) to generate subsequent dynamic task flows (such as skipping the node or terminating it).
[0101] In a specific embodiment, if the preset retry strategy is the limited retry strategy, then when the abnormal information is detected, determining that the dynamic execution logic is to perform the execution task process through the preset node according to a preset number of loops includes:
[0102] Obtain the current loop count of executing the subtask through the preset node;
[0103] If the current loop count is less than the preset loop count, then the node state of the preset node is reset and the subtask is executed repeatedly until the current loop count reaches the preset loop count or the execution task process is completed.
[0104] If the current loop count equals the preset loop count, then the task execution process is terminated.
[0105] Specifically, at the beginning of the retry loop for an abnormal node, the task execution engine first initializes a retry counter and sets its initial value to 0. Before each retry loop begins, the task execution engine reads the current value of the counter, i.e. the current loop count, from the execution context of the preset node or the dedicated retry management module.
[0106] The task execution engine compares the current loop count with the preset loop count defined in the node configuration. If the current loop count is less than the preset loop count, the node state of the preset node is reset, the intermediate state that may have been left by the previous execution failure is cleaned up, the occupied resources (such as temporary locks and connections) are released, and the node's internal state machine is restored to the initial ready state that can be re-executed.
[0107] The subtask of the preset node is invoked again (i.e., the task execution process is restarted). If the subtask is successfully completed in this retry, the loop is immediately exited, the entire retry process ends, and the task execution engine continues to execute the next node in the process; if the retry fails again, the process continues.
[0108] If the current loop count is detected to be equal to the preset loop count, meaning the retries have reached the preset limit, then exit the retry loop, terminate the execution process of the current node's subtask, and mark the node's status as "final failure".
[0109] If "Allow skipping" is configured, the task execution engine will automatically skip this failed node and continue executing subsequent nodes;
[0110] If "Allow skipping" is not configured, the task execution engine will terminate the entire task flow and mark its status as "Terminated due to node failure".
[0111] Based on any of the above embodiments, in this embodiment, before step S10, the following is included:
[0112] The robot's system capabilities, system attributes, and system instructions are abstracted into configurable nodes, and a unique identifier is assigned to each configurable node.
[0113] Specifically, all the functions of the robot were comprehensively reviewed and summarized into three main categories:
[0114] System capabilities: The actions or functions that the robot can perform (e.g., movement, rotation, charging, grasping).
[0115] System attributes: The state or data of the robot or its environment (e.g., battery level, current speed, point coordinates, pallet status).
[0116] System commands: Low-level commands for controlling the system or external devices (e.g., setting speed, switching I / O ports on / off, sending CAN messages).
[0117] Each of the above functionalities is abstracted into a configurable node class. Each node class defines the general logical framework required to execute the function, and a globally unique string identifier is assigned to each abstracted node class.
[0118] The definitions of these node classes (including their unique identifiers, names, categories, default icons, and other metadata) are persistently stored in the system's node metadata database or configuration file to complete the node registration.
[0119] Assign operating parameters to each of the configurable nodes, and generate at least one preset node based on the operating parameters, the unique identifier, and the configurable nodes.
[0120] Specifically, the user-configured runtime parameters are bound to the unique identifier of the node itself, generating a specific, parameterized node instance in memory or the task flow configuration file. This node instance, containing specific parameter values, is the preset node. Through connections, this preset node is linked with other preset nodes according to business logic, ultimately forming a complete, executable preset task template.
[0121] Please see Figure 2 , Figure 2 This application provides a schematic block diagram of an industrial task flow dynamic generation device, which is used to execute the aforementioned industrial task flow dynamic generation method. The industrial task flow dynamic generation device can be configured on a server.
[0122] like Figure 2 As shown, the industrial task flow dynamic generation device 400 includes:
[0123] The task flow determination module 410 is used to determine the task flow to be executed based on the robot's preset nodes and preset task templates;
[0124] The subtask execution module 420 is used to determine the subtasks corresponding to each preset node according to the task execution flowchart corresponding to the task flow to be executed, and to execute each subtask through each preset node.
[0125] The dynamic task flow generation module 430 is used to update the task flow to be executed according to the pre-configured pre-retry strategy corresponding to each preset node when an abnormal information occurs during the execution of the sub-task through the preset node, and generate a dynamic task flow.
[0126] Furthermore, the subtask execution module 420 includes:
[0127] The subtask determination submodule is used to determine each subtask based on the node type of the preset node;
[0128] The flowchart parsing submodule is used to parse the task execution flowchart and determine the execution order and dependencies between the preset nodes.
[0129] The subtask execution submodule is used to execute each of the subtasks through each of the preset nodes according to the node execution order and the dependency relationship.
[0130] Furthermore, the subtask determination submodule includes:
[0131] The first subtask determination unit is used to determine the subtask as a process control operation task when the preset node is the process node.
[0132] The second subtask determination unit is used to determine the subtask as a conditional branch task when the preset node is the conditional node.
[0133] The third subtask determination unit is used to determine that the subtask is to initiate a parallel task when the preset node is the parallel node.
[0134] Furthermore, the dynamic task flow generation module 430 includes:
[0135] An anomaly information monitoring submodule is used to monitor whether there is any anomaly information during the execution process of the subtask through the preset node;
[0136] The preset retry strategy determination submodule is used to pause the execution task process and determine the preset retry strategy according to the node type of the preset node when the abnormal information is detected.
[0137] The dynamic execution logic generation submodule is used to adjust the initial execution logic of each subtask executed through each preset node according to the preset retry strategy, and generate dynamic execution logic.
[0138] The dynamic task flow generation submodule is used to update the task flow to be executed through the dynamic execution logic and generate the dynamic task flow.
[0139] Furthermore, the dynamic execution logic generation submodule includes:
[0140] The first logic generation unit is configured to, if the preset retry strategy is the infinite retry strategy, determine, upon detecting the abnormal information, that the dynamic execution logic is to control the preset node to cyclically execute the execution task process according to a preset time interval until the subtask is completed.
[0141] The second logic generation unit is used to determine, when the abnormal information is detected, that the dynamic execution logic is to control the preset node to suspend the execution of the task process if the preset retry policy is the retry-prohibited policy.
[0142] The third logic generation unit is used to determine, when the abnormal information is detected, that the dynamic execution logic is to perform the execution task process through the preset node according to the preset number of loops if the preset retry strategy is the limited retry strategy.
[0143] Furthermore, the third logic generation unit includes:
[0144] The current loop count acquisition subunit is used to acquire the current loop count of the subtask executed through the preset node;
[0145] The first execution subunit is configured to, when the current loop count is less than the preset loop count, reset the node state of the preset node and repeatedly execute the subtask until the current loop count reaches the preset loop count or the execution task process is completed.
[0146] The second execution subunit is used to terminate the execution task process when the current loop count is equal to the preset loop count.
[0147] Furthermore, the industrial task flow dynamic generation device 400 includes:
[0148] The identifier allocation module is used to abstract the robot's system capabilities, system attributes, and system instructions into configurable nodes, and to assign a unique identifier to each configurable node.
[0149] The preset node generation module is used to assign running parameters to each of the configurable nodes, and generate at least one preset node based on the running parameters, the unique identifier, and the configurable node.
[0150] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0151] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 3 It runs on the computer device shown.
[0152] Please see Figure 3 , Figure 3 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.
[0153] See Figure 3 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0154] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any method for dynamically generating industrial task flows.
[0155] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0156] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When these computer programs are executed by a processor, the processor can perform any dynamic generation method for industrial task flows.
[0157] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0158] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0159] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:
[0160] Based on the robot's preset nodes and preset task templates, determine the task flow to be executed;
[0161] Based on the task execution flowchart corresponding to the task flow to be executed, determine the sub-tasks corresponding to each preset node, and execute each sub-task through each preset node;
[0162] When an exception occurs during the execution of the subtask through the preset node, the task flow to be executed is updated according to the preset retry policy corresponding to each preset node, and a dynamic task flow is generated.
[0163] In one embodiment, subtasks corresponding to each preset node are determined based on the task execution flowchart corresponding to the task flow to be executed, and each subtask is executed through each preset node to achieve the following:
[0164] Each subtask is determined according to the node type of the preset node;
[0165] Analyze the task execution flowchart to determine the execution order and dependencies between the preset nodes;
[0166] According to the execution order of the nodes and the dependencies, each of the subtasks is executed through each of the preset nodes.
[0167] In one embodiment, each subtask is determined based on the node type of the preset node, for the purpose of implementing:
[0168] When the preset node is the process node, the subtask is determined to be a process control operation task;
[0169] When the preset node is the condition node, the subtask is determined to be a conditional branch task;
[0170] If the preset node is the parallel node, the subtask is determined to be an initiating parallel task.
[0171] In one embodiment, when an exception occurs during the execution of the subtask through the preset node, the task flow to be executed is updated according to the pre-configured preset retry policy corresponding to each preset node to generate a dynamic task flow, which is used to achieve:
[0172] During the execution process of the sub-task through the preset node, monitor for any abnormal information.
[0173] When the abnormal information is detected, the execution task process is paused and the preset retry strategy is determined according to the node type of the preset node;
[0174] According to the preset retry strategy, the initial execution logic of each subtask executed through each preset node is adjusted to generate dynamic execution logic;
[0175] The dynamic execution logic updates the task flow to be executed, thereby generating the dynamic task flow.
[0176] In one embodiment, according to the preset retry strategy, the initial execution logic of executing each of the subtasks through each of the preset nodes is adjusted to generate dynamic execution logic for implementing:
[0177] If the preset retry strategy is the infinite retry strategy, then when the abnormal information is detected, the dynamic execution logic is determined to control the preset node to cyclically execute the execution task process according to the preset time interval until the subtask is completed.
[0178] If the preset retry policy is the retry-disallowing policy, then when the abnormal information is detected, the dynamic execution logic is determined to control the preset node to suspend the execution of the task process;
[0179] If the preset retry strategy is the limited retry strategy, then when the abnormal information is detected, the dynamic execution logic is determined to execute the task process through the preset node according to the preset number of loops.
[0180] In one embodiment, if the preset retry strategy is the limited retry strategy, then when the abnormal information is detected, the dynamic execution logic is determined to execute the task process through the preset node according to a preset number of loops, for the purpose of:
[0181] Obtain the current loop count of executing the subtask through the preset node;
[0182] If the current loop count is less than the preset loop count, then the node state of the preset node is reset and the subtask is executed repeatedly until the current loop count reaches the preset loop count or the execution task process is completed.
[0183] If the current loop count equals the preset loop count, then the task execution process is terminated.
[0184] In one embodiment, before determining the task flow to be executed based on the robot's preset nodes and preset task templates, the following is used to achieve:
[0185] The robot's system capabilities, system attributes, and system instructions are abstracted into configurable nodes, and a unique identifier is assigned to each configurable node.
[0186] Assign operating parameters to each of the configurable nodes, and generate at least one preset node based on the operating parameters, the unique identifier, and the configurable nodes.
[0187] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the industrial task flow dynamic generation methods provided in the embodiments of this application.
[0188] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0189] The above description is merely a specific embodiment of this application, but the scope of protection 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 scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for dynamically generating industrial task flows, characterized in that, include: Based on the robot's preset nodes and preset task templates, determine the task flow to be executed; Based on the task execution flowchart corresponding to the task flow to be executed, determine the sub-tasks corresponding to each preset node, and execute each sub-task through each preset node; When an exception occurs during the execution of the subtask through the preset node, the task flow to be executed is updated according to the preset retry policy corresponding to each preset node, and a dynamic task flow is generated.
2. The method for dynamically generating industrial task flows according to claim 1, characterized in that, The step of determining the subtasks corresponding to each preset node based on the task execution flowchart corresponding to the task flow to be executed, and executing each subtask through each preset node, includes: Each subtask is determined according to the node type of the preset node; Analyze the task execution flowchart to determine the execution order and dependencies between the preset nodes; According to the execution order of the nodes and the dependencies, each of the subtasks is executed through each of the preset nodes.
3. The method for dynamically generating industrial task flows according to claim 2, characterized in that, The node types include process nodes, condition nodes, and parallel nodes. Determining each subtask based on the node type of the preset node includes: When the preset node is the process node, the subtask is determined to be a process control operation task; When the preset node is the condition node, the subtask is determined to be a conditional branch task; If the preset node is the parallel node, the subtask is determined to be an initiating parallel task.
4. The method for dynamically generating industrial task flows according to claim 1, characterized in that, When an exception occurs during the execution of the subtask through the preset node, the task flow to be executed is updated according to the pre-configured preset retry policy corresponding to each preset node to generate a dynamic task flow, including: During the execution process of the sub-task through the preset node, monitor for any abnormal information. When the abnormal information is detected, the execution task process is paused and the preset retry strategy is determined according to the node type of the preset node; According to the preset retry strategy, the initial execution logic of each subtask executed through each preset node is adjusted to generate dynamic execution logic; The dynamic execution logic updates the task flow to be executed, thereby generating the dynamic task flow.
5. The method for dynamically generating industrial task flows according to claim 4, characterized in that, The preset retry strategy includes an unlimited retry strategy, a no-retry strategy, and a limited retry strategy. The step of adjusting the initial execution logic of each subtask executed through each preset node according to the preset retry strategy to generate dynamic execution logic includes: If the preset retry strategy is the infinite retry strategy, then when the abnormal information is detected, the dynamic execution logic is determined to control the preset node to cyclically execute the execution task process according to the preset time interval until the subtask is completed. If the preset retry policy is the retry-disallowing policy, then when the abnormal information is detected, the dynamic execution logic is determined to control the preset node to suspend the execution of the task process; If the preset retry strategy is the limited retry strategy, then when the abnormal information is detected, the dynamic execution logic is determined to execute the task process through the preset node according to the preset number of loops.
6. The method for dynamically generating industrial task flows according to claim 5, characterized in that, If the preset retry strategy is the limited retry strategy, then when the abnormal information is detected, determining that the dynamic execution logic is to perform the execution task process through the preset node according to the preset number of loops includes: Obtain the current loop count of executing the subtask through the preset node; If the current loop count is less than the preset loop count, then the node state of the preset node is reset and the subtask is executed repeatedly until the current loop count reaches the preset loop count or the execution task process is completed. If the current loop count equals the preset loop count, then the task execution process is terminated.
7. The method for dynamically generating industrial task flows according to any one of claims 1 to 6, characterized in that, Before determining the task flow to be executed based on the robot's preset nodes and preset task templates, the following steps are included: The robot's system capabilities, system attributes, and system instructions are abstracted into configurable nodes, and a unique identifier is assigned to each configurable node. Assign operating parameters to each of the configurable nodes, and generate at least one preset node based on the operating parameters, the unique identifier, and the configurable nodes.
8. An industrial task flow dynamic generation device, characterized in that, include: The task flow determination module is used to determine the task flow to be executed based on the robot's preset nodes and preset task templates; The subtask execution module is used to determine the subtasks corresponding to each preset node according to the task execution flowchart corresponding to the task flow to be executed, and to execute each subtask through each preset node. The dynamic task flow generation module is used to update the task flow to be executed according to the pre-configured pre-retry strategy corresponding to each pre-configured node when an exception occurs during the execution of the sub-task through the pre-configured node, and generate a dynamic task flow.
9. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the industrial task flow dynamic generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the industrial task flow dynamic generation method as described in any one of claims 1 to 7.