A task planning method and device
By establishing task subgraphs and scoring and filtering target paths, control instructions executable by automated equipment are generated, solving the problems of low efficiency and poor operability in natural language task target processing in existing technologies, and realizing efficient task planning and execution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA SOUTHERN POWER GRID ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, task planning for automated equipment relies on predefined rule sets, which cannot handle complex task objectives described in natural language, and lacks coordination between multiple tasks and operability at the execution level, resulting in low planning efficiency and poor executability.
A task subgraph is built based on natural language task instructions. Target task paths are filtered through scoring criteria and converted into control instruction sequences. Considering resource conflicts between nodes, connection relationships, and semantic similarity between adjacent entity nodes, control instructions that can be executed by automated equipment are generated.
This technology enables automated equipment to efficiently generate executable control command sequences based on natural language instructions, improving the efficiency of task planning and ensuring the operability of execution.
Smart Images

Figure CN122131733A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of production planning technology, and in particular to a task planning method and apparatus. Background Technology
[0002] In industrial automation, intelligent manufacturing and other scenarios, automated equipment such as robots are often required to automatically complete the planning of tasks based on actual work needs. This planning includes path planning and motion scheduling planning.
[0003] In related technologies, the planning of automated equipment usually relies on predefined rule sets or fixed equipment table structures, which cannot handle complex task objectives described by users in natural language. Furthermore, the planning algorithms for automated equipment often remain at the graph theory level, only considering the shortest distance or minimizing resource consumption, while ignoring the coordination between multiple tasks and the operability at the execution level. This results in something that is theoretically feasible but unusable in actual scheduling and execution.
[0004] Therefore, how to efficiently complete the task planning of practically executable automated equipment has become an urgent technical problem to be solved. Summary of the Invention
[0005] Therefore, it is necessary to provide a task planning method and apparatus to address the aforementioned technical problems.
[0006] Firstly, this application provides a task planning method, including:
[0007] Based on the obtained natural language task instructions, a task subgraph corresponding to the natural language task instructions is established;
[0008] Multiple initial task paths are obtained by searching the task subgraph based on the start and end nodes identified from the natural language task instructions.
[0009] Each initial task path is scored based on a preset scoring standard to determine the target task path whose score is greater than the preset scoring threshold. The scoring standard includes an evaluation based on the verification of the connection relationship between entities in the task subgraph, an evaluation based on the verification of the usage conflict of adjacent entity nodes in the task path, and an evaluation based on the semantic similarity of adjacent entity nodes in the task path.
[0010] The control instruction sequence is obtained by transforming the target task path. The control instruction sequence is used to instruct the corresponding automated equipment to execute the task.
[0011] In one embodiment, based on the acquired natural language task instructions, a task subgraph corresponding to the natural language task instructions is established, including:
[0012] The context representation sequence of the task description is determined based on the natural language task instructions, and the context representation sequence includes multiple semantic embedding vectors;
[0013] Calculate the semantic matching degree between each semantic embedding vector and each entity node included in the pre-built full knowledge graph; the full knowledge graph includes entity nodes and relation edges mapped from all devices and data included in the current working environment of the automated equipment.
[0014] Candidate matching nodes are determined from all entity nodes based on the semantic matching degree calculation results, and a task subgraph is constructed based on the candidate matching nodes.
[0015] In one embodiment, each initial task path is scored based on a preset scoring standard, and a target task path with a score greater than a preset scoring threshold is determined, including:
[0016] The initial task paths are scored one by one based on the scoring criteria. Paths with scores greater than the scoring threshold and whose overlap with the task paths stored in the cache set is less than the preset upper limit of structural redundancy are added to the cache set. The cache set is used to temporarily store paths with scores greater than the scoring threshold.
[0017] In one embodiment, a control instruction sequence is obtained based on the target task path. This control instruction sequence is used to instruct the corresponding automated equipment to perform the task, including:
[0018] Each target task path is compressed to obtain the compressed target task path.
[0019] Each compressed target task path is verified based on a preset legality verification function to obtain a verified compressed task path, and a target compressed task path is determined from all verified compressed task paths; the target compressed task path is in the form of an entity node sequence.
[0020] The action entity nodes included in the target compression task path are matched with templates in the preset template library. The matching templates are then bound to the corresponding action entity nodes to obtain a structured execution plan corresponding to the target compression task path. The structured execution plan consists of multiple triples, each triple corresponding to an entity node. Each triple includes the corresponding entity node, the bound template, and the actual data field value.
[0021] Transform the structured execution plan into a time-ordered sequence of control instructions.
[0022] In one embodiment, path compression is performed on each target task path to obtain a compressed target task path, including:
[0023] Based on a preset sliding window, sub-path segments are determined in each target task path, and the semantic similarity and path content redundancy of the two ends of each sub-path segment are calculated.
[0024] If the semantic similarity between the two endpoints is greater than a preset similarity threshold, and the redundancy of the path content is greater than a preset redundancy threshold, the corresponding sub-path segment is compressed into a single auxiliary node. Based on the compressed single auxiliary node, the compressed target task path is obtained.
[0025] In one embodiment, each compressed target task path is verified based on a preset validity check function to obtain a verified compressed task path, including:
[0026] After obtaining the compressed target task path, for each compressed target task path, the legality result of the corresponding compressed target task path is calculated based on the connectivity of the start and end nodes in the compressed target task path, the proportion of the compressed key entity nodes to all entity nodes in the compressed target task path, the number of constraint conflict relationships, and the preset weight parameters.
[0027] If the detected validity result is less than the preset validity threshold, the target task path is recompressed;
[0028] If the detected validity result is greater than or equal to the validity threshold, the compressed target task path is determined to have passed the validity check, and the verified compressed task path is obtained.
[0029] In one embodiment, matching the action entity nodes included in the target compression task path with templates in a preset template library includes:
[0030] Determine the similarity between the semantic feature vector of each template and the semantic feature vector of each action entity node; wherein, each template includes the semantic feature vector of the template description text and the template field requirements;
[0031] Determine the set of attributes connected to each action entity node, and the coverage of template field requirements for each template;
[0032] Based on the similarity of the semantic feature vectors of each template and each action entity node, and the template field requirements, the structural difference between each template and each action entity node is calculated.
[0033] Based on the similarity, coverage, and structural difference between each template and each action entity node, the matching result between each template and each action entity node is calculated.
[0034] For each action entity node, the template with the highest matching result is used as the template that matches the action entity node.
[0035] In one embodiment, the method further includes:
[0036] After matching each action entity node with the template, traverse each entity node in the target compression task path. If two consecutive adjacent action entity nodes are detected to be structurally connected and the similarity between the template field requirements corresponding to the adjacent action entity nodes is less than the preset similarity threshold, bind any one of the adjacent action entity nodes to the template with the second highest matching result.
[0037] In one embodiment, converting the structured execution plan into a time-ordered sequence of control instructions includes:
[0038] Collect the status data of each entity node included in the target compression task path, and bind the status data to the corresponding entity node;
[0039] For the entity nodes included in the structured execution plan, construct the corresponding scheduling graph containing the execution order;
[0040] Based on the scheduling diagram, the triples corresponding to each entity node, the resource dependencies between entity nodes, and the preset resource priorities, the execution order in the structured execution plan is adjusted to obtain the adjusted structured execution plan.
[0041] The adjusted structured execution plan is converted into a sequence of control instructions.
[0042] Secondly, this application also provides a task planning apparatus, comprising:
[0043] The acquisition module is used to build a task subgraph corresponding to the acquired natural language task instructions.
[0044] The search module is used to search the task subgraph based on the start and end nodes identified from the natural language task instructions to obtain multiple initial task paths.
[0045] The scoring module is used to score each initial task path based on preset scoring criteria and determine the target task path with a score greater than the preset scoring threshold. The scoring criteria include evaluation based on the verification of the connection relationship between entities in the task subgraph, evaluation based on the verification of the usage conflict of adjacent entity nodes in the task path, and evaluation based on the semantic similarity of adjacent entity nodes in the task path.
[0046] The execution module is used to convert the target task path into a sequence of control instructions, which is used to instruct the corresponding automated equipment to perform the task.
[0047] The aforementioned task planning method and apparatus establish a task subgraph corresponding to the acquired natural language task instructions. Multiple initial task paths are obtained by searching the task subgraph based on the start and end nodes identified from the natural language task instructions. Each initial task path is scored according to a preset scoring standard to determine a target task path with a score greater than a preset scoring threshold. The scoring standard includes evaluation based on the verification of connection relationships between entities in the task subgraph, evaluation based on the verification of usage conflicts between adjacent entity nodes in the task path, and evaluation based on the semantic similarity between adjacent entity nodes in the task path. A control instruction sequence is generated based on the target task path, and the control instruction sequence is used to instruct the corresponding automated equipment to execute the task. Through this embodiment, a control instruction sequence that can be understood and directly executed by automated equipment can be automatically generated based on natural language task instructions, without any manual intervention. Only data setup preparation is required in advance, effectively improving the efficiency of task planning. Furthermore, since resource conflicts between nodes, verification of connection relationships, and the similarity of adjacent entity nodes are considered when establishing the target task path, the established control instruction sequence is basically guaranteed to be executable and implementable, ensuring operability at the execution level. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is a diagram illustrating the application environment of the task planning method in one embodiment;
[0050] Figure 2 This is a flowchart illustrating a task planning method in one embodiment;
[0051] Figure 3 This is a flowchart illustrating the process of creating a task subgraph in one embodiment;
[0052] Figure 4 This is a flowchart illustrating the process of generating a control command sequence in one embodiment;
[0053] Figure 5 This is a flowchart illustrating the process of generating a compressed target task path in one embodiment.
[0054] Figure 6 This is a flowchart illustrating the process of generating a target compression task path in one embodiment;
[0055] Figure 7 This is a schematic diagram illustrating the process of matching entity nodes with templates in one embodiment;
[0056] Figure 8 This is a schematic diagram illustrating the process of generating a control instruction sequence in one embodiment;
[0057] Figure 9 This is a structural block diagram of a task planning device in one embodiment. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0059] The technical background of this application will be explained below.
[0060] With the development of industrial automation, robot collaboration and intelligent manufacturing, task scheduling and path planning are gradually evolving from rule-driven to semantic understanding and knowledge modeling, so that automated equipment such as robots can automatically complete the execution plan of tasks according to actual work needs. This plan includes the aforementioned path planning and motion scheduling planning.
[0061] In related technologies, task planning methods mostly focus on path planning algorithms or single-layer decision optimization algorithms, lacking a systematic coupling between task semantics, graph structure knowledge, and actual control execution. Traditional task planning for automated equipment typically relies on predefined rule sets or fixed equipment table structures, failing to handle complex goals described by users in natural language, and struggling to achieve automatic mapping between path structures and control commands. While some systems attempt to model task dependencies using knowledge graphs or flowcharts, these models are often static and cannot be linked with dynamically generated semantic task inputs.
[0062] Furthermore, task planning algorithms often remain at the graph theory level, only considering the shortest distance or minimizing resource consumption, while ignoring the semantic consistency between tasks and the operability at the execution level. This results in paths that are theoretically feasible but unusable in actual scheduling and execution.
[0063] Furthermore, in related technologies, there is a lack of a unified description mechanism between the knowledge layer and the execution layer. There is a gap between the generated path nodes and the actual control interface, requiring manual reconfiguration of instructions. In other words, the planned path cannot be automatically converted into control instructions for automated equipment, which seriously affects the system's automation level and scalability.
[0064] In summary, the above description illustrates the main problems existing in the relevant technologies: the efficiency and feasibility of task planning for automated equipment are low.
[0065] Furthermore, the above description also illustrates some minor problems in the related technologies: difficulty in recognizing natural language instructions; lack of a unified description mechanism between the knowledge layer and the execution layer, resulting in a gap between the generated path and the control interface of the real automated equipment; difficulty in mapping between path structure and control commands, etc.
[0066] Based on this, this application provides a task planning method: Based on the acquired natural language task instructions, a task subgraph corresponding to the natural language task instructions is established; the start and end nodes identified from the natural language task instructions are searched in the task subgraph to obtain multiple initial task paths; each initial task path is scored based on a preset scoring standard to determine a target task path with a score greater than a preset scoring threshold. The scoring standard includes evaluation based on the verification of connection relationships between entities in the task subgraph, evaluation based on the verification of usage conflicts between adjacent entity nodes in the task path, and evaluation based on the semantic similarity of adjacent entity nodes in the task path; a control instruction sequence is obtained from the target task path, and the control instruction sequence is used to instruct the corresponding automated equipment to execute the task. This application can efficiently generate executable control instructions, thereby controlling the corresponding automated equipment to execute the corresponding task. See the following embodiments for details:
[0067] The task planning method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Based on the acquired natural language task instructions, a task subgraph corresponding to the natural language task instructions is established; multiple initial task paths are obtained by searching the task subgraph based on the start and end nodes identified from the natural language task instructions; each initial task path is scored based on a preset scoring standard to determine the target task path with a score greater than a preset scoring threshold. The scoring standard includes evaluation based on the verification of connection relationships between entities in the task subgraph, evaluation based on the verification of usage conflicts between adjacent entity nodes in the task path, and evaluation based on the semantic similarity of adjacent entity nodes in the task path; a control instruction sequence is obtained by converting the target task path, and the control instruction sequence is used to instruct the corresponding automated equipment to execute the task. This application can efficiently generate executable control instructions, thereby controlling the corresponding automated equipment to execute the corresponding task. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The terminal 102 is used to acquire and / or collect operational status data from each node in the actual working environment. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0068] In one exemplary embodiment, such as Figure 2 As shown, a task planning method is provided, which can be applied to... Figure 1 Taking the server in the example of this, the explanation includes:
[0069] S210, Based on the acquired natural language task instructions, establish a task subgraph corresponding to the natural language task instructions.
[0070] Among them, the natural language task instruction is the unstructured natural language task objective T directly input by the user or the scheduling system. textFor example, the aforementioned natural language task instruction could be "Schedule the robot from workstation A to workstation C, passing through workstation B in the process, and prioritizing the use of mobile platform M1." This instruction is passed to the computing server as a task description. In practical applications, UTF-8 encoding (8-bit Unicode Transformation Format) can be used, supporting a maximum of 1024 characters. The source can include the scheduling terminal interface, the MES system (Manufacturing Execution System), or the task generation module.
[0071] The above task subgraph (abbreviated as G) task This is a knowledge graph built based on natural language task instructions. This subgraph includes entity nodes and relational edges related to the natural language task instructions. Entity nodes include, but are not limited to, devices, materials, channels, and attributes existing in the current environment. The relational edges between entity nodes are established based on the current actual working environment. Each entity node corresponds to a representation vector e. j This representation vector is used to characterize the structure and semantic position of the node, and can be used to uniformly calculate and store all nodes in the current actual environment before actual computation.
[0072] In this embodiment, a corresponding knowledge graph can be directly constructed based on natural language task instructions. For example, "Schedule the robot from work station A to work station C, which must pass through work station B, and prioritize the use of mobile platform M1" will include at least work stations A, C, B, and mobile platform M1, as well as other entity nodes within at least one hop connected to work stations A, B, C, and M1, and the relationship edges between entities. Alternatively, a full knowledge graph of the current environment can be established first, that is, all entity nodes such as tasks, devices, and regions contained in the current environment are pre-processed with graph embedding, and the nodes and their relationship edges related to the natural language task instructions are extracted from the full knowledge graph to obtain the above-mentioned task subgraph.
[0073] S220: Based on the start and end nodes identified from the natural language task instructions, a search is performed in the task subgraph to obtain multiple initial task paths.
[0074] The starting node is the node corresponding to the physical location where the automated equipment begins to execute the task, as identified from the natural language task instructions, such as workstation A. Similarly, the ending node is the node corresponding to the final physical location where the automated equipment completes the task, as identified from the natural language task instructions, such as workstation C. The initial task path is a sequence of all consecutive nodes in the task subgraph that start from the starting node and reach the ending node, with relational edges between each adjacent node. This path represents a potentially physically traversable route or operation sequence.
[0075] In this embodiment, a large language model can be used to identify natural language task instructions, thereby parsing the intent of the start and end nodes in the text. This allows for matching the corresponding entity nodes in the task subgraph, enabling path start and end control through the start and end nodes. In practical applications, this can be achieved through e start and e end To mark the entry and exit points of each initial task path, for example, in the task text "From A to C, you must pass through B", the server will automatically set A as the starting point, C as the ending point, and B as a mandatory intermediate node included in the graph.
[0076] Then, using the starting node as the root node, a depth-first search algorithm is executed on the task subgraph to obtain multiple initial task paths that guarantee path connectivity.
[0077] S230, each initial task path is scored based on a preset scoring standard to determine the target task path whose score is greater than the preset scoring threshold. The scoring standard includes an evaluation based on the verification of the connection relationship between entities in the task subgraph, an evaluation based on the verification of the usage conflict of adjacent entity nodes in the task path, and an evaluation based on the semantic similarity of adjacent entity nodes in the task path.
[0078] The scoring criteria consist of a set of evaluation dimensions used to measure each initial task path. Each dimension yields a numerical score for that path, and the total score for the path is obtained by combining all dimensions. The verification of connections between entities involves checking whether a valid edge exists between each pair of adjacent nodes in the task subgraph. If it exists, the value is 1; otherwise, it is 0. The evaluation of conflicts between adjacent entity nodes involves detecting whether two adjacent entity nodes in the task path need to simultaneously occupy the same non-shared resource in physical time, such as the same robot, the same track, or the same workstation. If a conflict exists, the score is 1; otherwise, it is 0. The evaluation of semantic similarity between adjacent entity nodes involves detecting the cosine distance between the vector representations of two adjacent entity nodes in the task, thereby measuring their similarity in function or type.
[0079] In this embodiment of the application, the above scoring criteria can be specifically expressed as:
[0080]
[0081] in, Represents a sequence of path nodes. Represents consecutive edges in a path. This is a graph structure constraint judgment function, which is used to calculate the evaluation of the verification based on the connection relationship between entities in the task subgraph; This indicates whether there are device or resource conflicts in the path segment. It is used to calculate the evaluation of the usage conflict verification based on adjacent entity nodes in the task path. If two nodes are bound to the same resource or there are mutually exclusive devices, this item is 1; otherwise, it is 0. This represents the semantic consistency score between two nodes, used to evaluate the semantic similarity between adjacent entity nodes in the task path. Similarity calculation is based on the semantic feature vectors of the two entity nodes. The hyperparameters α and β control the strength of the conflict penalty and semantic weighting. The system defaults to α=1.5 and β=0.2, but these hyperparameters can be adjusted according to actual needs in practical applications. R task The connection relationships between entities in the task subgraph are represented by relation edges. The evaluation formula introduced above introduces a fusion scoring mechanism that considers structural constraints, resource logic, and semantic continuity to influence path quality, providing a more interpretable and strategic basis for path structure evaluation.
[0082] After calculating each initial task path, the paths with scores greater than a preset threshold are retained as target task paths. The threshold can be set manually according to actual needs, such as 0.7.
[0083] S240: The control instruction sequence is obtained by converting the target task path. The control instruction sequence is used to instruct the corresponding automated equipment to perform the task.
[0084] The control command sequence refers to translating the operational actions corresponding to each node into a command sequence that the automated equipment can recognize and execute, according to the order of the nodes in the target task path (or the adjusted order of the nodes). For example, first move to point A, then grab the item at point A. Automated equipment refers to machines that can automatically perform tasks such as movement, operation, and detection in physical space, including robots, automated guided vehicles, robotic arms, and conveyor belt systems.
[0085] In this embodiment, if the target task path includes multiple paths, the best single path can be selected for execution. For example, the data status of the devices (such as robots, conveyor belts, workstations, etc.) that each path depends on in the current environment can be collected. If the critical resources of a certain path are occupied, the path is temporarily disabled. Alternatively, the path with the shortest execution time can be selected for execution. Alternatively, the path with the highest score can be selected for execution. Alternatively, the path with a lower conflict risk can be selected for execution. For example, if there are multiple resource competition relationships between a certain entity node in the path, the conflict risk of that path is high. The best single path can be selected from multiple target task paths through pre-set rules, converted into a control command sequence, and sent to the corresponding automated equipment to complete the task execution.
[0086] Through the embodiments of this application, a sequence of control instructions that can be understood and directly executed by automated equipment can be automatically generated based on natural language task instructions, without the need for manual intervention throughout the process. Only data setup preparation work needs to be done in advance, which effectively improves the efficiency of task planning. Furthermore, since resource conflicts between nodes, verification of connection relationships, and similarity between adjacent entity nodes are considered when establishing the target task path, it is basically guaranteed that the established control instruction sequence is executable and can be implemented, ensuring operability at the execution level.
[0087] In one exemplary embodiment, such as Figure 3 As shown, based on the acquired natural language task instructions, a task subgraph corresponding to the natural language task instructions is established, including:
[0088] S310, determine the context representation sequence of the task description based on the natural language task instructions, the context representation sequence includes multiple semantic embedding vectors.
[0089] Here, the context representation sequence refers to the ordered list of vectors corresponding to the natural language task. This sequence includes multiple semantic embedding vectors, which reflect the position of the semantic embedding vector in the semantic space. The closer the spatial distance between two vectors, the more similar the corresponding lexical terms are.
[0090] In this embodiment, the natural language task is input into a large model based on the Transformer architecture. The aforementioned context representation sequence has been extracted, and its word vectors are generated by the WordPiece embedding module. After 12 layers of multi-head attention computation, the task description context representation sequence is obtained. Where n is the number of tokens in the text. Let d represent the semantic embedding vector of the i-th token, with dimension d=768. This model has been fine-tuned in the domain of the scheduling task dataset and has the ability to parse the semantics of scheduling targets.
[0091] S320 calculates the semantic matching degree between each semantic embedding vector and each entity node included in the pre-established full knowledge graph; the full knowledge graph includes entity nodes and relation edges mapped from all devices and data included in the current working environment of the automated equipment.
[0092] The full knowledge graph refers to a pre-built graph structure that covers all physical objects and their relationships in the current working environment of automated equipment. An entity node is a point in the knowledge graph, corresponding to a unique physical or data object. A relationship edge is a directed or undirected line connecting two entity nodes in the knowledge graph, and corresponds to a relationship type such as "adjacent," "reachable," etc.
[0093] In this embodiment, during the initialization phase, graph embedding processing is performed on the various entity nodes such as tasks, devices, and regions obtained in the current working environment to generate a full knowledge graph. Each entity node in the full knowledge graph corresponds to an entity vector representation. Where j is the index of an entity in the graph, the embedding method uses a three-layer graph convolutional network (GCN), and each layer updates the entity vector using the following structure-aware propagation method:
[0094]
[0095] in, Let be the vector representation of entity j after the update at layer l+1. ReLU is a commonly used activation function in this field. Let k be the vector representation of the neighboring entity k at level l. Representing entities The set of adjacent nodes, Let be the graph convolution weight matrix of the l-th layer. After multiple iterations, the final representation vector of each node is... The embedding is uniformly calculated and stored before system deployment to characterize its structure and semantic position. The structural position refers to the connection position and relation position of this entity in the knowledge graph, that is, which nodes it is connected to, what dependency chain it is on, and what the constraints are before and after it. The semantic position refers to the functional role and meaning of this entity in the task semantics, that is, whether it is a detection station, a handling robot, a target area, or an intermediate constraint node.
[0096] In summary, the construction of the full knowledge graph can then be completed.
[0097] Then, the semantic matching degree between each semantic embedding vector and each entity node included in the pre-built full knowledge graph is calculated. In practical applications, in order to align the semantic representation with the structural entities, the task context representation... With entity embedding Simultaneously mapped to a unified space, an attention matching matrix S is constructed:
[0098]
[0099] in, These are the linear transformation matrices for the query and the key, respectively, obtained through training. Let i be the vector representation of the i-th token in the task context. This is a scaling factor used to normalize the dot product result. This represents the semantic matching degree between the semantic embedding vector of the i-th token in the task text and the j-th graph entity node.
[0100] S330: Based on the calculation results of semantic matching degree, candidate matching nodes are determined from all entity nodes, and task subgraphs are constructed based on the candidate matching nodes.
[0101] In this embodiment, the maximum value of i is taken from each column j and sorted, and the top k entities are selected as the aforementioned candidate matching nodes. , where k=10 is an empirical value that can be pre-configured.
[0102] Then, starting from the candidate matching nodes, a first-order adjacency subgraph is constructed. Specifically, the adjacency relationship nodes of all candidate matching nodes are extracted from the full knowledge graph. , forming a task subgraph ,in:
[0103] ;
[0104] Among them, e l For the adjacent entity nodes of the above candidate matching nodes, R task This refers to the connection relationships between the extracted candidate matching nodes and their first-order adjacent entities, thus forming the relation edges of the subgraph.
[0105] This structure includes entity nodes directly related to the task objective and entities connected by first-order relationships. Irrelevant edge types, such as equipment maintenance history and fault report chains, are removed, and only constraints related to path scheduling, such as sequential dependencies, resource consumption, and regional accessibility, are retained.
[0106] Through the embodiments of this application, the conversion of natural language instructions into structured graph subgraphs can be completed, and the accuracy of entity selection and the connectability of the structural space are guaranteed by the semantic structure fusion mechanism.
[0107] In an exemplary embodiment, each initial task path is scored based on a preset scoring standard, and a target task path with a score greater than a preset scoring threshold is determined, including:
[0108] The initial task paths are scored one by one based on the scoring criteria. Paths with scores greater than the scoring threshold and whose overlap with the task paths stored in the cache set is less than the preset upper limit of structural redundancy are added to the cache set. The cache set is used to temporarily store paths with scores greater than the scoring threshold.
[0109] In this embodiment, when calculating each initial task path based on the scoring criteria, in addition to the three evaluation criteria mentioned above (evaluation based on the verification of connection relationships between entities in the task subgraph, evaluation based on the verification of usage conflicts between adjacent entity nodes in the task path, and evaluation based on the semantic similarity between adjacent entity nodes in the task path), this embodiment also defines a penalty term to suppress paths with excessively high structural repetition rates in the candidate set. The complete path selection mechanism is as follows:
[0110]
[0111] in, The above scoring threshold is used (the default value can be 0.7). The current path P and the set of existing paths in the cache set. The maximum structural overlap rate is defined as the maximum overlap rate between the current path and the node sets in existing paths. δ is the upper limit of structural redundancy rate, which defaults to 0.6.
[0112] In other words, each initial task path is scored. For paths exceeding a scoring threshold, an overlap rate check is performed between the current task path and existing paths in the cache set that also exceed the scoring threshold. If the maximum overlap rate between the current path and the node sets of existing paths is less than a preset structural redundancy threshold, the current path is added to the cache set. It's understandable that when evaluating the overlap rate of the first path in the initial task path, the cache set is empty; the aforementioned current path is any path in the initial task path. In summary, after traversing each path in the initial task path, the path cached in the cache set is used as the target task path.
[0113] The embodiments of this application can balance the quality of the path structure and the degree of overlap between multiple paths, thereby achieving a dual guarantee of structural rationality and path diversity. Ultimately, the aforementioned target task path set is obtained. Each path P i It is a node sequence that has undergone triple constraint evaluation and overlap rate evaluation, and has structural coherence, resource conflict avoidance capability and semantic smoothness.
[0114] In one exemplary embodiment, such as Figure 4As shown, a control instruction sequence is obtained based on the target task path. This control instruction sequence is used to instruct the corresponding automated equipment to execute the task, including:
[0115] S410 performs path compression on each target task path to obtain the compressed target task path.
[0116] In this embodiment, path compression processing is performed on each target task path. The compression processing includes, in one embodiment, for each task path, starting from the first node e1, examining each node ei in the sequence in turn, checking whether its successor node e(i+2) (skipping e(i+1)) can be directly reached from ei. If it can be directly reached (i.e. there is a valid relationship edge in the task subgraph), and the relationship edge is feasible and does not violate the task logic (e.g., e(i+1) is not a necessary node specified in the task instruction), then e(i+1) can be judged as a redundant node and deleted. The above steps are repeated to traverse each target task path until there are no more nodes that can be deleted. In another embodiment, a window of preset length can be selected and slid along each target task path to obtain multiple sub-path segments. The semantic similarity and path content redundancy of the nodes at both ends of the sub-path segment are calculated. If the similarity between the nodes at both ends is high and the content redundancy is high, the sub-path segment is compressed into a virtual single node. In this embodiment, the compression does not apply to the underlying geometric motion trajectory of the automated equipment, but rather to redundant nodes in the task layer / control layer path, such as duplicate confirmation nodes, duplicate status reporting nodes, and equivalent function nodes. In other words, the effect of compression in this embodiment is not to reduce the physical distance traveled by the automated equipment, but to reduce control commands, reduce duplicate task judgments, and reduce scheduling complexity.
[0117] In summary, by using the two compression methods described above, each target task path is compressed to obtain the compressed target task path corresponding to each target task path.
[0118] S420 verifies each compressed target task path based on a preset legality verification function to obtain a verified compressed task path, and determines a target compressed task path from all verified compressed task paths; the target compressed task path is in the form of an entity node sequence.
[0119] The validity check function is used to check whether the compressed path is still a high-quality path. The validity check function can be used to check the validity of the path by considering the connectivity between the start node and the end node in the compressed target task path, the proportion of the set of compressed key nodes, and the constraint conflict relationships in the compressed path.
[0120] In this embodiment, a validity verification function is used to perform validity verification on each compressed target task path, obtaining the verification result for each compressed target task path. Only the paths that pass verification are retained as target compressed task paths. This step outputs two variables: one is the set of compressed task paths that pass verification. The other is the path compression operation record. It contains information such as compressed segments, semantic similarity, compressed nodes, and verification scores, providing a basis for subsequent task scheduling plan mapping and execution log backtracking.
[0121] Then, based on preset rules, an optimal target compression task path is determined from all verified compression task paths. If the verified compression task paths include multiple paths, the best single path can be selected for execution. For example, the data status of the devices (such as robots, conveyor belts, workstations, etc.) that each path depends on in the current environment can be collected. If the critical resources of a certain path are occupied, the path is temporarily disabled. Alternatively, the path with the shortest execution time can be selected. Alternatively, the path with the highest score can be selected. Alternatively, the path with a lower conflict risk can be selected. For example, if there are multiple resource competition relationships for a certain entity node in the path, the conflict risk of that path is high, etc. A single best path can be selected from multiple verified compression task paths through preset rules.
[0122] S430: Match the action entity nodes included in each target compression task path with the templates in the preset template library, and bind the matching templates to the action entity nodes to obtain the structured execution plan corresponding to each target compression task path; the structured execution plan consists of multiple triples, each triple corresponds to an entity node, and each triple includes the corresponding entity node, the bound template, and the actual data field value.
[0123] Among them, template library M is a structured execution action library built by engineers during the deployment phase based on commonly used categories of scheduled tasks. Each template This corresponds to a standardized operational behavior, such as "grabbing," "transferring," "inspecting," "coding," and "waiting." Each template contains three parts: first, a semantic description text, such as "transfer the workpiece from its current position to the target position"; second, a vectorized representation of this description text generated by a large model encoder, which uses the same contextual representation as the natural language task instruction extraction. The dimension is the same as the entity vector (default is 1). Finally, there is the field requirement definition. This refers to the entity attributes that the template requires as parameters. For example, material handling operations typically require fields such as start point location, end point location, and material type. These fields correspond one-to-one with the edge relationships defined in the graph, such as "hasOrigin", "hasTarget", and "hasObject".
[0124] The structured execution plan described above consists of multiple triples, each triple corresponding to an entity node in the target compression task path. The triple takes the form of: , respectively represent the path node, the bound template, and the field value filling, that is, the actual data field values mentioned above, which are generally status data, such as the actual operating parameters of the device, the device occupancy status, etc.
[0125] In this embodiment, a pre-built and stored template library is read, and each template is matched with the action entity node of the target compression task path. The template and entity node can be matched from the perspective of semantic vector, field requirements, etc., so as to determine the template with the highest matching degree with each action entity node, and the matching template is bound to the action entity node.
[0126] At this point, each ordered action entity node in the target compression task path corresponds to a matching template. Each template has its field definitions bound, and these fields need to be filled with the actual operating parameters of the device. In practical applications, the actual operating parameters of the device (including but not limited to the automated device itself and the resources required by the automated device) can be read from the real-time data acquisition module. In summary, each node corresponds to its own identifier, a bound template, and actual data field values.
[0127] S440 converts the structured execution plan into a time-ordered sequence of control instructions.
[0128] Among them, a time-ordered sequence means that each entity in the sequence has a clear sequential order, and the next instruction can only be executed after the previous instruction has been executed.
[0129] In this embodiment, multiple structured execution plans are included, and the optimal executable structured execution plan can be selected according to actual needs or preset filtering rules. Then, the instruction output interface can be automatically selected based on the type of automated equipment. For example, if the automated equipment is a robot control system, the ROS Action (Robot Operating System Action) interface is called to send requests; if it is a production line PLC (Programmable Logic Controller), the parameter sequence is converted into register values and sent to the corresponding bus address; if it is a distributed scheduling cluster, JSON format (JavaScript Object Notation) instruction packets are sent through MQTT (Message Queuing Telemetry Transport) or HTTP (Hypertext Transfer Protocol) interfaces. The system's control interface module has a multi-adaptation mechanism, loading the interface specification files (JSON Schema format) of each device during the initialization phase to achieve a consistent mapping from templates to control interfaces.
[0130] The control command sequence includes two types of results: the first type is the scheduling control sequence. Each element All are executable control instructions, including command type, parameter fields, resource binding, execution time, and synchronization flags; the second type is a scheduling graph. It records task nodes, dependencies, and resource usage information for subsequent scheduling backtracking and anomaly recovery. This embodiment achieves a complete mapping from structured task planning to physical control layer execution commands, enabling path optimization results to truly drive physical devices to execute tasks.
[0131] In one exemplary embodiment, such as Figure 5 As shown, path compression is performed on each target task path to obtain the compressed target task path, including:
[0132] S510, based on a preset sliding window, determines sub-path segments in each target task path and calculates the semantic similarity and path content redundancy of the two endpoints of each sub-path segment.
[0133] The preset sliding window is a preset sliding length. The sliding window includes one less entity node. Path content redundancy is used to represent the set of task nodes in the sub-path segment that appear repeatedly in other parts of the path to the same target task.
[0134] In this embodiment, a sliding window of a preset length is first defined. For each target task path, the sliding window slides along the target task path, and the sliding length is selected. The sub-path segments are calculated, and the semantic similarity between the nodes at both ends of the segment and the redundancy of the path content are calculated. Specifically, this can be represented as:
[0135]
[0136] Among them, e i and e j It is the semantic embedding vector of the start and end nodes of the sub-path segment. This is the semantic similarity threshold (default 0.85). The above path content redundancy is represented by η, which is the structural redundancy threshold (default 0.6).
[0137] S520: If the semantic similarity between the two endpoints is greater than a preset similarity threshold and the redundancy of the path content is greater than a preset redundancy threshold, the corresponding sub-path segment is compressed into a single auxiliary node. Based on the compressed single auxiliary node, the compressed target task path is obtained.
[0138] In this embodiment, when the semantic similarity between the two endpoints is greater than a preset similarity threshold, and the path content redundancy is greater than a preset redundancy threshold, the corresponding sub-path segment is determined to be a structural fragment with semantic repetition or operational equivalence, and can be considered for compression into a single auxiliary node. The semantics of this node are determined by This is represented and used as the representative node after compression.
[0139] By using the above method, each sub-path segment in the target task path is traversed to achieve compression of each target task path.
[0140] The embodiments of this application can achieve the compression of the target task path. The focus of compression in this embodiment is not to reduce the physical distance traveled by automated equipment, but to reduce control commands, reduce repetitive task judgments, and reduce scheduling complexity.
[0141] In one exemplary embodiment, such as Figure 6 As shown, each compressed target task path is verified based on a preset validity check function to obtain the target compressed task path; the target compressed task path is in the form of a sequence of entity nodes, including:
[0142] S610 After obtaining the compressed target task path, for each compressed target task path, the legality result of the corresponding compressed target task path is calculated based on the connectivity of the start node and end node in the compressed target task path, the proportion of the compressed key entity node to all entity nodes in the compressed target task path, the number of constraint conflict relationships, and the preset weight parameters.
[0143] The validity check function is used to quantitatively evaluate whether a compressed target task path meets the task execution requirements. The connectivity between the start and end nodes in the target task path is determined by whether there exists at least one path consisting of valid relation edges from the start node to the end node in the task subgraph. This parameter reflects whether the compressed path retains basic reachability. The proportion of compressed critical entity nodes to all entity nodes in the compressed target task path is the ratio of the critical nodes compressed and merged in the above steps (critical nodes are pre-marked as "critical," and are generally mandatory nodes specified in the task instructions) to all entity nodes retained after compression. A higher proportion indicates that the compression operation has removed more critical nodes, potentially leading to incomplete task logic. Constraint conflict relationships refer to adjacent node pairs or path segments in the compressed path that violate preset constraints.
[0144] In this embodiment, a legality verification function is used to verify the legality of each compressed target task path, resulting in a legality score for each compressed target path. The legality verification score is calculated based on the connectivity of the start and end nodes in the compressed target task path, the proportion of compressed key entity nodes to all entity nodes in the compressed target task path, the number of constraint conflict relationships, and preset weight parameters. The legality verification function can be expressed as:
[0145]
[0146] in, The result of the validity check of the compressed path P'. Determine if the path still remains from arrive connectivity, This indicates the proportion of the set of critical nodes that are lost in the path. This is the set of key nodes defined in the original path. This indicates the constraint conflicts that occur in the compressed path. Penalty coefficients for different constraint types (e.g., the coefficient for "resource conflict" is higher than that for "path order recommendation") The three loss weighting parameters are set (default values are 1.0, 0.5, and 2.0).
[0147] S620: If the detected validity result is less than the preset validity threshold, the target task path is recompressed.
[0148] In this embodiment, all paths can be compressed first, and then their legality can be verified one by one. Alternatively, a heuristic greedy strategy can be used to prioritize compressing segments with high semantic repetition and non-critical tasks, and then immediately call [the appropriate algorithm] after each compression. The system verifies the validity of path segments; if the verification fails, the operation is rolled back. Furthermore, to avoid frequently compressing failed path segments, a path segment compression attempt caching mechanism is introduced to avoid redundant calculations. Considering the characteristics of applicable scenarios, such as robot operation path planning and multi-station production line scheduling, path compression not only reduces invalid jumps in task paths but also significantly reduces the number of control commands and communication load. Especially in heterogeneous device collaborative tasks, it avoids execution-level problems such as "redundant reporting" and "repetitive actions," making the path optimization results more engineering-feasible.
[0149] S630: If the detected validity result is greater than or equal to the validity threshold, determine that the compressed target task path has passed the validity check and obtain the verified compressed task path.
[0150] In one exemplary embodiment, such as Figure 7 As shown, each entity node included in each target compression task path is matched with a template in the preset template library, including:
[0151] S710, determine the similarity between the semantic feature vector of each template and the semantic feature vector of each action entity node; wherein, each template includes the semantic feature vector of the template description text and the template field requirements.
[0152] In this embodiment of the application, multiple compressed and legitimate target compression paths have been obtained above. It needs to be further transformed into a set of task execution plans with clear semantic annotations and actual executable structures. Each path Node sequence in This represents the task entities that the scheduling system will execute sequentially. Action entity nodes are entity nodes, but they do not yet possess a template structure capable of issuing execution instructions. Therefore, it is necessary to bind a semantic role to each action entity node in the path, and combine this with the system template library. The mapping generates action plans, enabling the structural path to complete the transformation from a graph structure to scheduled actions.
[0153] Calculate the similarity between the semantic feature vector of each template and the semantic feature vector of each action entity node, representing the similarity. Furthermore, each template includes three parts of information: a semantic description text, such as "move the workpiece from its current position to the target position"; a vectorized representation of this description text generated by the same large-model encoder as in step one; and a semantic description text. That is, the semantic feature vector of the template description text, with the same dimension as the entity vector (default is 1). Finally, there is the field requirement definition. This refers to which entity attributes the template needs as parameters. For example, handling operations typically require fields such as start location, end location, and material type.
[0154] S720, determine the set of attributes connected to each action entity node, and the coverage of template field requirements for each template.
[0155] In this context, the set of attributes connected to each action entity node is the set of attributes connected to that action entity node through relation edges in the task subgraph. ,like There are edges Then "hasTarget" will be used as an entity node. One of the fields.
[0156] In this embodiment, the coverage rate of the action entity node and the template field requirements of each template is calculated. The closer the value is to 1, the better the node can meet the field requirements of the template.
[0157] S730: Based on the similarity of the semantic feature vectors of each template and each action entity node, and the template field requirements, the structural difference between each template and each entity node is calculated.
[0158] In this embodiment, the structural difference degree between each template and action entity node is calculated to penalize templates that are semantically similar but have severely mismatched field structures, denoted as... .
[0159] S740 calculates the matching result between each template and each action entity node based on the similarity, coverage, and structural difference between each template and each action entity node.
[0160] In this embodiment of the application, the calculation of the above matching method can be expressed as:
[0161]
[0162] Among them, T t For a template set, there is .
[0163] The parameters β and λ are hyperparameters, which are set to 0.5 and 0.3 by default and can be adjusted during deployment.
[0164] S750: For each action entity node, the template with the highest matching result is used as the template that matches the action entity node.
[0165] In this embodiment, the template with the highest matching result is used as the template that matches the action entity node. It should be noted that in this embodiment, template matching is not performed on all entity nodes in the target compression task path. As mentioned above, some entity nodes are just data or an attribute. The nodes that need to be template matched in this application are action entity nodes with "executable task semantics", such as handling station, inspection station, assembly task node, etc. Resource nodes, attribute nodes, status nodes, and data nodes in the graph are generally not directly matched with templates.
[0166] The following example illustrates this: Taking a typical industrial workshop scenario as an example, if there are action entity nodes in the path... This node, "Inspection Station Q", has connecting edges. and Then the field set This includes two items: "hasEquipment" and "hasMode". The system will search the template library for all templates that match "Workstation Type = Inspection", such as visual inspection and dimensional inspection, and calculate whether their template fields, such as inspection equipment and inspection mode, match the current fields. If the fields of the visual inspection template are defined as... If the field coverage is 1 and it highly matches the semantic description, then it is selected as the optimal template.
[0167] In one exemplary embodiment, the method further includes:
[0168] After matching each action entity node with the template, traverse each entity node in the target compression task path. If two consecutive adjacent action entity nodes are detected to be structurally connected and the similarity between the template field requirements corresponding to the adjacent action entity nodes is less than the preset similarity threshold, bind any one of the adjacent action entity nodes to the template with the second highest matching result.
[0169] In this embodiment, after completing the template binding, the semantic consistency of the target compression task path can be optimized to prevent sudden changes in template type or jumps in operation intent within the task logic. Therefore, this application introduces a regularization loss function:
[0170]
[0171] Where cos is the cosine similarity function. For node e j The bound template T * (e) j The semantic embedding vector is used to penalize semantic differences between adjacent templates. If two consecutive nodes are structurally connected but have completely different template types (such as template field requirements), the value of this term is too large, reflecting poor task continuity. The system sets a regularization threshold θ=1.2. If the path regularization loss exceeds this value, the template is retried for the intermediate jump segment. The template is rematched for either of the two adjacent action entity nodes, and the template with the second highest matching result is selected for binding, while keeping the field structure unchanged.
[0172] In summary, after template binding, the target compression task path is converted into a structured execution plan, which consists of multiple triples: These represent path nodes, bound templates, and field value population, respectively, resulting in two types of structured data: one is the execution plan set. One type can be directly recognized by the scheduler for instruction generation; the other type is a collection of annotation information. This is used to construct semantic explanation documents for paths, facilitating visualization, auditing, and human-computer interface display.
[0173] In one exemplary embodiment, such as Figure 8 As shown, converting a structured execution plan into a time-ordered sequence of control instructions includes:
[0174] S810 collects the status data of each entity node included in the target compression task path and binds the status data to the corresponding entity node.
[0175] The aforementioned status data is collected from the task scheduling center, device management system, and path generation module. Each execution template... Each field has its own definition, and these fields need to be filled with the actual operating parameters of the device. The system first reads the status dataset of the device and resources from the real-time data acquisition module. These data are collected by PLC controllers, industrial buses (such as Profinet and Modbus), or robot control system API interfaces, and include current workstation occupancy status, resource availability indicators, task execution time feedback, and safety interlock status. All collected data is standardized and stored in a time-series database, provided for retrieval in key-value structure, for example, {"Equipment A": Idle, "Robot Arm 1": Occupied, "Conveyor Belt 2": Standby}. This information serves as dynamic input for the generation of subsequent scheduling instructions, ensuring synchronization and consistency between instruction generation and equipment status.
[0176] In this embodiment of the application, the above field values are filled in the filling positions based on the collected status data.
[0177] S820 constructs a corresponding scheduling graph containing the execution order for the entity nodes included in the structured execution plan.
[0178] The above scheduling diagram includes: Where V represents the set of task nodes to be executed, and each node corresponds to a template binding instance, i.e., the triple mentioned above. E represents the order or resource dependency between nodes. This information comes from the path structure and template attributes. The scheduling graph is used to visualize the constraints between tasks.
[0179] In this embodiment of the application, a corresponding scheduling graph is first constructed based on the entity nodes included in the structure execution plan.
[0180] S830 adjusts the execution order in the structured execution plan based on the scheduling diagram, the triples corresponding to each entity node, the resource dependencies between entity nodes, and the preset resource priorities, to obtain the adjusted structured execution plan.
[0181] In this embodiment, the execution plan of the target structure is adjusted by performing topological sorting according to the scheduling graph, and the tasks of different nodes are first arranged into an initial order according to their dependencies. If shared resources are found between nodes during the sorting process, the system marks resource conflict edges on the scheduling graph and uses a pre-established resource priority table. Arbitration is then conducted. The resource priority table, defined by system administrators during the deployment phase (e.g., {robot > conveyor belt > bin}), is used to determine the scheduling priority of similar equipment, thereby adjusting the execution order of the structured execution plan to obtain the adjusted structured execution plan.
[0182] S840 converts the adjusted structured execution plan into a sequence of control instructions.
[0183] In this embodiment of the application, during the instruction generation process, in order to ensure that the path transformation result has time controllability and execution coordination, the system designs a timing constraint correction function. The task order obtained from topological sorting is transformed into a time-ordered sequence of control instructions. The instruction scheduling formula is as follows:
[0184]
[0185] in, This indicates that a topological sort of the scheduling graph is performed to obtain a sequence of tasks without circular dependencies. Based on this, instruction time offset correction, conflict task delay allocation and device interface matching are completed. The function contains three sub-processes: (1) Timing adjustment module: Based on the template execution time estimate and the collected resource status information, the task execution time is dynamically adjusted. If the resource is busy, a waiting command is automatically inserted; (2) Resource coordination module: The shared device task is locked. For example, when two tasks share the robotic arm, the second task will generate an instruction flag=1 with a waiting flag; (3) Interface conversion module: The standardized template fields are converted into an interface format that the actual controller can recognize. For example, for PLC devices, it is converted into bytecode instructions, and for robot control systems, it is converted into ROS behavior requests.
[0186] Taking a typical manufacturing task as an example, let's assume a structured execution plan. for:
[0187] .
[0188] The system will use the interface mapping table of each template. Generate three control commands:
[0189] For template transfer, generate instructions. ;
[0190] For the detection template, generate instructions. ;
[0191] For the packaging template, generate instructions .
[0192] If the detection task and the handling task share a workstation, the system will automatically set a delay in the resource coordination module. ,exist During the adjustment phase, a waiting operation is inserted to avoid device conflicts.
[0193] In practical applications, after generating the control command sequence, the server or computing system automatically selects the command output interface based on the device type. If the target is a robot control system, the ROS Action interface is called to send the request; if it is a production line PLC controller (Programmable Logic Controller), the parameter sequence is converted into register values and sent to the corresponding bus address; if it is a distributed scheduling cluster, JSON format command packets are sent via MQTT (Message Queuing Telemetry Transport) or HTTP (Hypertext Transfer Protocol) interfaces. The system's control interface module has a multi-adaptation mechanism, loading the interface specification files (JSON Schema format) of each device during the initialization phase to achieve a consistent mapping from templates to control interfaces.
[0194] In summary, the embodiments of this application realize a complete mapping from structured task planning to physical control layer execution commands, enabling path planning results to drive physical devices to execute tasks.
[0195] This application also provides a preferred embodiment of a task planning method.
[0196] 1. First, the server or computing system receives natural language task instructions issued manually or by the upper-level system through data acquisition equipment. The natural language task instructions are input into a language model based on the Transformer architecture and supervised fine-tuned on industrial scheduling task corpus to obtain the context representation sequence of the task description. Then, combined with the pre-built full knowledge graph, entity nodes with semantic similarity to the context representation sequence and their first-order adjacency relationships are extracted to generate a task subgraph and determine the start and end nodes of the task path.
[0197] 2. Based on the aforementioned start and end nodes, path search is performed in the task subgraph to obtain at least one target task path that satisfies connectivity constraints, conflict checking constraints, and semantic similarity constraints. This provides a structural foundation for subsequent path optimization and execution plan transformation. The generation of this path set not only needs to ensure the structural connectivity of the paths but also needs to consider multiple types of constraints, including task dependencies, resource binding, equipment exclusivity, workstation order, and process flow matching. All these constraints originate from the edge information in the task subgraph. Therefore, the path construction process is essentially a constrained graph structure search problem.
[0198] 3. The target task path is compressed and its validity reconstructed to obtain a validated compressed task path. This process eliminates semantically repetitive or structurally redundant nodes while retaining task nodes marked as unskippable in the task knowledge graph. It also ensures that the compressed path satisfies the constraints of the original graph and maintains connectivity from the path's starting point to its ending point. In other words, this step not only eliminates redundant path operations but also ensures that path compression does not disrupt the resource scheduling logic and task dependency order previously guaranteed by the graph.
[0199] Understandably, although the target task path conforms to the graph constraints, the presence of numerous equivalent task nodes, auxiliary process nodes, and relay stations in the actual graph structure often leads to structural redundancy, semantic duplication, and even wasted execution resources. For example, a single process flow may have multiple inspection station nodes with equivalent functions. If a task requires only one inspection action, but the path mistakenly includes multiple equivalent nodes, it will result in duplicate execution, path lengthening, and task delays. Therefore, the purpose of path compression is not only to reduce the number of nodes, but more importantly, to improve path execution efficiency without disrupting task logic and to provide the scheduling system with a more optimized execution sequence input.
[0200] 4. Determine a target compression task path from all verified compression task paths, bind matching templates to the action entity nodes in the target compression task path, and fill in the required status data parameter fields of the templates to form the above structured task execution plan.
[0201] 5. Generate a scheduling diagram based on the structured task execution plan. Adjust the resource priorities among various entity nodes in the form of the scheduling diagram to facilitate the generation of a timing-coordinated and resource-conflict-free control instruction sequence to drive the corresponding physical devices to execute the corresponding tasks. This step primarily aims to convert the structured task execution plan output in the previous step into a final control instruction sequence that can be directly recognized and executed by the scheduling control system. Each execution plan... Includes the corresponding path node and the execution template it is bound to. and template field filling information .
[0202] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0203] Based on the same inventive concept, this application also provides a task planning apparatus for implementing the task planning method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more task planning apparatus embodiments provided below can be found in the limitations of the task planning method described above, and will not be repeated here.
[0204] In one exemplary embodiment, such as Figure 9 As shown, a task planning device is provided, comprising:
[0205] The acquisition module 91 is used to establish a task subgraph corresponding to the acquired natural language task instructions based on the acquired natural language task instructions.
[0206] Search module 92 is used to search in the task subgraph based on the start node and end node identified from the natural language task instructions to obtain multiple initial task paths;
[0207] The scoring module 93 is used to score each initial task path based on a preset scoring standard, and to determine the target task path whose score is greater than the preset scoring threshold. The scoring standard includes an evaluation based on the verification of the connection relationship between entities in the task subgraph, an evaluation based on the verification of the usage conflict of adjacent entity nodes in the task path, and an evaluation based on the semantic similarity of adjacent entity nodes in the task path.
[0208] The execution module 94 is used to convert the target task path into a sequence of control instructions, which is used to instruct the corresponding automated equipment to perform the task.
[0209] Each module in the aforementioned task planning device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0210] The aforementioned task planning apparatus is also used to execute any of the task planning methods described above.
[0211] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement any of the task planning methods described above.
[0212] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the task planning methods described above.
[0213] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the task planning methods described above.
[0214] In one embodiment, this application also provides a task planning system, which includes a task input module and a planning module. The task input module is used to receive natural language task instructions, and the planning module is used to execute any of the task planning methods described above according to the natural language task instructions.
[0215] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0216] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0217] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A task planning method, characterized in that, The method includes: Based on the obtained natural language task instructions, a task subgraph corresponding to the natural language task instructions is established; Based on the start and end nodes identified from the natural language task instructions, a search is performed in the task subgraph to obtain multiple initial task paths; Each initial task path is scored based on a preset scoring standard to determine the target task path whose score is greater than the preset scoring threshold. The scoring standard includes an evaluation based on the verification of the connection relationship between entities in the task subgraph, an evaluation based on the verification of the usage conflict of adjacent entity nodes in the task path, and an evaluation based on the semantic similarity of adjacent entity nodes in the task path. The control instruction sequence is obtained by converting the target task path, and the control instruction sequence is used to instruct the corresponding automated equipment to perform the task.
2. The method according to claim 1, characterized in that, The step of establishing a task subgraph corresponding to the acquired natural language task instructions includes: A contextual representation sequence of the task description is determined based on the natural language task instructions, the contextual representation sequence including multiple semantic embedding vectors; Calculate the semantic matching degree between each semantic embedding vector and each entity node included in the pre-established full knowledge graph; the full knowledge graph includes entity nodes and relation edges mapped from all devices and data included in the current working environment of the automated equipment. Based on the calculation results of the semantic matching degree, candidate matching nodes are determined from all entity nodes, and the task subgraph is constructed based on the candidate matching nodes.
3. The method according to claim 1, characterized in that, The step of scoring each initial task path based on a preset scoring standard and determining the target task path with a score greater than a preset scoring threshold includes: The initial task paths are scored one by one based on the scoring criteria. Paths whose scores are greater than the scoring threshold and whose overlap with the task paths stored in the cache set is less than the preset upper limit of structural redundancy are added to the cache set. The cache set is used to temporarily store paths whose scores are greater than the scoring threshold.
4. The method according to any one of claims 1 to 3, characterized in that, The control instruction sequence obtained based on the target task path, the control instruction sequence being used to instruct the corresponding automated equipment to execute the task, includes: Each of the target task paths is compressed to obtain the compressed target task path. Each compressed target task path is verified based on a preset legality verification function to obtain a verified compressed task path, and a target compressed task path is determined from all verified compressed task paths; the target compressed task path is in the form of an entity node sequence. The action entity nodes included in the target compression task path are matched with templates in the preset template library, and the matching templates are bound to the corresponding action entity nodes to obtain a structured execution plan corresponding to the target compression task path. The structured execution plan consists of multiple triples, each triple corresponding to an entity node, and each triple includes the corresponding entity node, the bound template, and the actual data field value. The structured execution plan is converted into a time-ordered sequence of control instructions.
5. The method according to claim 4, characterized in that, The step of performing path compression processing on each of the target task paths to obtain compressed target task paths includes: Based on a preset sliding window, sub-path segments are determined in each target task path, and the semantic similarity and path content redundancy of the two ends of each sub-path segment are calculated. If the semantic similarity between the two endpoints is greater than a preset similarity threshold, and the redundancy of the path content is greater than a preset redundancy threshold, the corresponding sub-path segment is compressed into a single auxiliary node, and the compressed target task path is obtained based on the compressed single auxiliary node.
6. The method according to claim 4, characterized in that, The method of verifying each compressed target task path based on a preset validity check function to obtain a valid compressed task path includes: After obtaining the compressed target task path, for each compressed target task path, the legality result of the corresponding compressed target task path is calculated based on the connectivity of the start and end nodes in the compressed target task path, the proportion of the compressed key entity nodes to all entity nodes in the compressed target task path, the number of constraint conflict relationships, and the preset weight parameters. If the validity result is found to be less than a preset validity threshold, the target task path is recompressed. If the validity result is detected to be greater than or equal to the validity threshold, the compressed target task path is determined to have passed the validity check, and the verified compressed task path is obtained.
7. The method according to claim 4, characterized in that, The step of matching the action entity nodes included in the target compression task path with templates in a preset template library includes: Determine the similarity between the semantic feature vector of each template and the semantic feature vector of each action entity node; wherein, each template includes the semantic feature vector of the template description text and the template field requirements; Determine the set of attributes connected to each action entity node, and the coverage of template field requirements for each template; Based on the similarity of the semantic feature vectors of each template and each action entity node, and the template field requirements, the structural difference between each template and each action entity node is calculated. Based on the similarity, coverage, and structural difference between each template and each action entity node, the matching result between each template and each action entity node is calculated. For each action entity node, the template with the highest matching result is used as the template that matches the action entity node.
8. The method according to claim 7, characterized in that, The method further includes: After matching each action entity node with the template, traverse each entity node in the target compression task path. If two consecutive adjacent action entity nodes are detected to be structurally connected, and the similarity between the template field requirements corresponding to the adjacent action entity nodes is less than a preset similarity threshold, bind any one of the adjacent action entity nodes to the template with the second highest matching result.
9. The method according to claim 4, characterized in that, The step of converting the structured execution plan into a time-ordered sequence of control instructions includes: Collect the status data of each entity node included in the target compression task path, and bind the status data to the corresponding entity node; For the entity nodes included in the structured execution plan, construct a corresponding scheduling graph containing the execution order; Based on the scheduling graph, the triples corresponding to each entity node, the resource dependencies between entity nodes, and the preset resource priorities, the execution order in the structured execution plan is adjusted to obtain the adjusted structured execution plan. The adjusted structured execution plan is converted into the control instruction sequence.
10. A task planning device, characterized in that, The device includes: The acquisition module is used to build a task subgraph corresponding to the acquired natural language task instructions. The search module is used to search the task subgraph based on the start node and end node identified from the natural language task instructions to obtain multiple initial task paths. The scoring module is used to score each initial task path based on a preset scoring standard, and to determine the target task path whose score is greater than the preset scoring threshold. The scoring standard includes an evaluation based on the verification of the connection relationship between entities in the task subgraph, an evaluation based on the verification of the usage conflict of adjacent entity nodes in the task path, and an evaluation based on the semantic similarity of adjacent entity nodes in the task path. An execution module is used to convert the target task path into a sequence of control instructions, which is used to instruct the corresponding automated equipment to perform the task.