Finite-state agent behavior decision-making method, device and equipment, medium and product
By constructing a system action graph and a set of logical mappings, and combining task description information, the initial decisions of the agent are generated, which solves the problems of insufficient interpretability, reliability and scalability of existing agent behavior decision-making methods, and realizes automated processing from natural language to task execution.
Patent Information
- Application Number
- CN202511668657.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-17
AI Technical Summary
Existing methods for agent behavior decision-making have shortcomings in terms of interpretability, reliability, automation, and scalability. In particular, deep reinforcement learning based on end-to-end training is costly and has low sample utilization efficiency, planning based on large language models has poor reliability, and planning based on traditional symbolic methods is costly and not easily scalable.
A method for making decisions about the behavior of intelligent agents in finite states is proposed. By acquiring relevant system information, an Action Graph is constructed, which includes nodes and edges. Nodes contain functions, operations, and tasks, while edges contain dependencies. By combining a set of logical mappings and task description information, the initial decision is determined, including task identification, operation sequence, data dependency constraints, and cost evaluation metrics.
It achieves fully automated processing from natural language task description to task execution, and the generated decisions are theoretically correct and practically executable, improving operational efficiency and resource utilization while reducing knowledge construction costs.
Smart Images

Figure CN121541944A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, apparatus, device, medium and product for making decisions on the behavior of an intelligent agent in finite states. Background Technology
[0002] With the rapid development of artificial intelligence technology, especially the breakthrough of Large Language Models (LLM), controlling intelligent agents to complete complex tasks using natural language instructions has become a hot topic. Existing technologies for intelligent agent behavior decision-making can be categorized as follows: 1. Deep reinforcement learning based on end-to-end training: This method learns action decisions through extensive interaction with the environment, exhibiting good task adaptability. However, it suffers from high training costs, low sample utilization efficiency, and a lack of interpretability in the learned decisions (a "black box" model). 2. Methods based on Large Language Models (LLM) to generate action plans: Leveraging the powerful code generation or step-by-step reasoning capabilities of LLM, it can directly output operation sequences or codes based on task descriptions, offering high flexibility. However, the generated plans have poor reliability, often containing logical errors or unexecutable "illusion" operations. 3. Methods based on traditional symbolic planning (such as PDDL): This method uses formal languages to define states, actions, and goals, generating action sequences through a planner. The results are relatively accurate and verifiable, but building and maintaining a complete behavioral model capable of describing complex systems requires significant manual effort, resulting in high costs and limited scalability.
[0003] In summary, existing methods for intelligent agent behavior decision-making have significant shortcomings in terms of interpretability, reliability, automation, and scalability. Summary of the Invention
[0004] This invention provides a method, apparatus, device, medium, and product for making decisions on the behavior of an intelligent agent in finite states, in order to solve at least one of the above-mentioned problems.
[0005] According to one aspect of the present invention, a method for making decisions on the behavior of an intelligent agent in finite states is provided, comprising:
[0006] Obtain relevant system information;
[0007] A system action graph is constructed based on relevant system information. The action graph includes nodes and edges. Nodes include functions, operations, and tasks. Edges include dependencies between functions and operations, dependencies between functions and tasks, and dependencies between operations.
[0008] Based on the Action-Graph, a set of logical mappings is constructed, wherein the set of logical mappings includes: an initial set of functions, a set of operations, and the dependencies between functions and operations;
[0009] An initial decision is determined based on the logical mapping set, Action-Graph, and task description information, wherein the initial decision includes at least one of the following: task identifier, operation sequence, data dependency constraints, and cost evaluation metrics.
[0010] According to another aspect of the present invention, a finite-state agent behavior decision-making device is provided, the finite-state agent behavior decision-making device comprising:
[0011] The system-related information acquisition module is used to acquire system-related information;
[0012] The system action graph creation module is used to construct a system action graph based on system-related information. The action graph includes nodes and edges. Nodes include functions, operations, and tasks. Edges include dependencies between functions and operations, dependencies between functions and tasks, and dependencies between operations.
[0013] The logical mapping set determination module is used to construct a logical mapping set based on the Action-Graph, wherein the logical mapping set includes: an initial function set, an operation set, and a function-operation mapping relationship set;
[0014] The initial decision determination module is used to determine an initial decision based on a logical mapping set, an Action-Graph, and task description information, wherein the initial decision includes at least one of the following: task identifier, operation sequence, data dependency constraints, and cost evaluation indicators.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the finite-state intelligent agent behavior decision-making method according to any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the finite-state intelligent agent behavior decision-making method according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer program product is provided, which, when executed by a processor, implements a finite-state intelligent agent behavior decision-making method as described in any of the embodiments of the present invention.
[0021] This invention, through obtaining system-related information, constructs a system action graph (Action-Graph) based on this information. The Action-Graph includes nodes and edges; nodes include functions, operations, and tasks; edges include dependencies between functions and operations, dependencies between functions and tasks, and dependencies between operations. Based on the Action-Graph, a logical mapping set is constructed, including an initial function set, an operation set, and dependencies between functions and operations. Based on the logical mapping set, the Action-Graph, and task description information, an initial decision is determined, including at least one of task identifier, operation sequence, data dependency constraints, and cost evaluation metrics. By constructing a finite-state system action graph and organically combining Action-Graph-based augmentation generation with symbolic programming, an end-to-end automated process suitable for intelligent agents is constructed, achieving fully automated processing from natural language task description to task execution.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of a finite-state agent behavior decision-making method according to an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of the structure of a finite-state intelligent agent behavior decision-making device according to an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0030] Example 1
[0031] Figure 1 This is a flowchart illustrating a finite-state agent behavior decision-making method provided in an embodiment of the present invention. This embodiment is applicable to finite-state agent behavior decision-making. The method can be executed by the finite-state agent behavior decision-making device in this embodiment, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:
[0032] S110, obtain system-related information.
[0033] In this embodiment, system-related information includes user manuals, case records, practice reports, operation step records, system teaching materials, etc.
[0034] In this embodiment, the method for obtaining system-related information can be as follows: collecting, parsing, and structuring system-related data to complete system behavior analysis in terms of both function and task dimensions. The input object includes multiple source documents D_doc={d1,d2,…,dn}, each document may contain natural language descriptions such as task objectives, function descriptions, and operation steps.
[0035] In a specific example, the format of the multi-source document D_doc is standardized and metadata (source, time, task category, component category) is annotated to obtain a standardized text set D_std. This can be achieved through a document parser (PDF parser / HTML parser), OCR recognition (for scanned documents), and unified encoding conversion (Unicode Transformation Format-8-bit, UTF-8), which will not be elaborated here.
[0036] S120, Construct a system action graph based on relevant system information.
[0037] The Action-Graph includes nodes and edges. Nodes include functions, operations, and tasks. Edges include dependencies between functions and operations, dependencies between functions and tasks, and dependencies between operations.
[0038] In this embodiment, the method for constructing a system action graph based on system-related information can be as follows: The system-related information is parsed to obtain an initial function set, an operation set, and the dependencies between functions and operations. The initial function set includes: function name, a list of descriptions related to the function name, and a set of tasks related to the function name. The operation set includes: operation type, target object, input conditions, and output conditions. The dependencies between functions and operations include: function name, a sequence of operations related to the function name, a dependency graph of the operation sequence, and a set of tasks related to the function name. The action graph is then constructed based on the initial function set, the operation set, and the dependencies between functions and operations.
[0039] Optionally, construct an Action-Graph based on system-related information, including:
[0040] The system-related information is parsed to obtain the initial function set, operation set, and the dependency relationship between functions and operations.
[0041] The initial function set includes: function name, description list related to function name, and task set related to function name; the operation set includes: operation type, target, input condition, and output condition; and the dependency relationship between function and operation includes: function name, operation sequence related to function name, dependency graph of operation sequence, and task set related to function name.
[0042] In this embodiment, syntactic analysis and semantic segmentation methods, such as dependency parsing and vector similarity clustering of the BERT model, are used to process the standardized document D_std, outputting an initial function set C_cap={CapName,[c1,c2,…,cm],[TaskDesr]}, where CapName is the function name, [c1,c2,…,cm] is a list of descriptions related to CapName, and [TaskDesr] is the set of tasks related to the function name, that is, the set of different tasks (abbreviated descriptions) to which CapName belongs. Sequence labeling models (such as BiLSTM-CRF, Transformer-Tagger, general LLM, etc.) are used to identify the action verbs and their objects in C_cap={CapName,[c1,c2,…,cm] ,[TaskDesr]}. In this embodiment, the Action description format is defined as: [Action Type][Target Object][Input / Output Conditions]. The output result is an operation set A_act={a1,a2,…,ak}, where ak is the k-th Action. It also outputs the dependency relationship between functions and operations R_cap-act={CapName,[…ai,ai+1…],Adepgraph,[TaskDesr]}, where […ai,ai+1…] is the sequence of operations related to CapName, and Adepgraph is the dependency graph of the operation sequence, which is a graph structure description of the sequential dependency relationship between operations between […ai,ai+1…].
[0043] Construct the Action-Graph based on the initial set of functions, the set of operations, and the dependencies between functions and operations.
[0044] In this embodiment, by performing semantic parsing and information extraction on the document, the scattered natural language description is transformed into a mapping record of system capabilities and system actions, thereby realizing the transformation from document data to Action-Graph, and finally forming a comprehensive, semantically clear, and well-structured Action-Graph.
[0045] In this embodiment, R_cap-act is stored in a structured database or knowledge graph storage engine, forming a two-dimensional organization with [capability-task dimension] and [capability-operation dimension] as indexes. Specifically, it can be implemented using a graph database (Neo4j), RDF triple storage (GraphDB), or document database (MongoDB).
[0046] This embodiment uses a two-dimensional knowledge organization format indexed by [capability-task dimension] and [capability-operation dimension], supports multiple storage engines such as graph database (Neo4j) and RDF triple storage (GraphDB), enhances the queryability and scalability of knowledge, and lays a solid foundation for efficient symbolic reasoning.
[0047] This embodiment automatically parses and constructs a structured system capability-operation raw library (Ation-Graph) from multi-source heterogeneous documents (user manuals, case records, best practice reports, etc.), achieving automated acquisition and structured representation of domain knowledge. This overcomes the bottleneck of traditional symbolic planning methods relying on manual knowledge engineering, significantly reducing knowledge construction costs. This embodiment employs a two-layer parsing architecture of "semantic unit segmentation and capability candidate extraction" and "operation step extraction and standardization." It accurately identifies action verbs and operation objects through sequence labeling models (BiLSTM-CRF, Transformer-Tagger, etc.) and uniformly defines the Action description format, achieving high-precision conversion from unstructured text to standardized operation instructions.
[0048] S130, construct a set of logical mappings based on the Action-Graph.
[0049] The logical mapping set includes: an initial function set, an operation set, and the dependencies between functions and operations.
[0050] In this embodiment, the logical mapping relationship between system capabilities or business tasks and system actions can be clearly understood based on the action graph, which is the logical mapping set L_cap-act.
[0051] S140, determine the initial decision based on the logical mapping set, Action-Graph, and task description information.
[0052] The initial decision includes at least one of the following: task identifier, operation sequence, data dependency constraints, and cost evaluation indicators.
[0053] In this embodiment, the task description information includes: key action objectives, initial conditions, constraints, and priorities. The key action objectives include the specific operations the user expects to complete (such as "sorting," "generating charts," "summarizing statistics," etc.), the constraints include time limits, resource limits, data range, operation order, etc., and the priorities reflect the user's ranking of the importance of different capabilities.
[0054] In this embodiment, the method for determining the initial decision based on the logical mapping set, Action-Graph, and task description information can be as follows: a symbolic knowledge base is generated based on the logical mapping set and Action-Graph, wherein the symbolic knowledge base includes: a logical description set, mapping relationships between functions and operations, and logical constraints of each task; the initial decision is determined based on the symbolic knowledge base, Action-Graph, and task description information.
[0055] Optionally, an initial decision is determined based on the logical mapping set, the Action-Graph, and the task description information, including:
[0056] A symbolic knowledge base is generated based on the logical mapping set and the Action-Graph.
[0057] In this embodiment, the symbolic knowledge base includes: a set of logical descriptions, a mapping relationship between functions and operations, and logical constraints for each task.
[0058] In this embodiment, the symbolic knowledge base can be generated based on the logical mapping set and the Action-Graph as follows: each action in the operation set is transformed into a logical description to obtain a logical description set; each task in the task set related to the function name in the dependency relationship between function and operation is taken as an object to obtain the logical constraints of each task, wherein the logical constraints of the task include: the set of functions that make up the task, the execution order of the functions, and data dependency constraints; and a symbolic knowledge base is generated based on the logical description set, the logical constraints of each task, and the dependency relationship between function and operation.
[0059] The initial decision is determined based on the symbolic knowledge base, Action-Graph, and task description information.
[0060] In this embodiment, the initial decision can be determined based on the symbolic knowledge base, Action-Graph, and task description information by determining the initial decision based on the initial conditions of the task in the task description information, the Action-Graph, and the set of logical descriptions in the symbolic knowledge base.
[0061] In a specific example, forward reasoning is first performed. Based on the initial conditions of the task to be completed (i.e., known premises and inputs, etc.) and the Precond(ak) and Effect(ak) in the logical description set, possible sequences of operation operations for completing the task are gradually expanded. Here, Precond(ak) is the set of preconditions for the operation, and Effect(ak) is the set of operation results. The detailed implementation process is as follows: Forward reasoning starts from the initial state State_0 of the task and, based on the currently available system resources, input data, and other initial conditions, applies executable Actions to expand the state step by step. Specifically, the current state set S_current={State_0} is initialized first, where State_0 contains the initial conditions of the task, available resources, and input parameters, etc.; then, all Action(ak) in the ActionLogic logical description set are traversed. Action(ak) is obtained by converting each ak in the operation set A_act into a predicate logic or action logic description. Check if the precondition Precond(ak) is satisfied by any state in S_current; if so, apply the Action to generate a new state State_new, update the state attributes according to Effect(ak), and add State_new to the candidate state set S_candidate; repeat the above process until the target state is reached or all possible operation sequences have been traversed. During forward inference, the parent state and triggering Action of each state need to be recorded to form a state transition graph G_forward={(State_i, Action_j, State_k)}, and finally find the complete Action sequence from State_0 to the target state State_goal by backtracking. Then, reverse reasoning is performed to match possible Action sequences by deducing the Effects required for the target task. The detailed implementation process is as follows: Reverse reasoning starts from the task target State_goal and determines the preconditions and necessary operations required to achieve the target through reverse reasoning. The specific process is as follows: First, the necessary conditions of the target state State_goal are extracted into a target set G_current={Goal_1, Goal_2, ..., Goal_m}. The targets may come from the task's logical constraints TaskConstraints, such as the expected output and state attribute requirements. Then, a reverse search is performed in ActionLogic to find all Action candidate sets A_candidates whose Effect(ak) can satisfy a certain target in G_current. For each candidate Action(ak), its Precond(ak) is transformed into a new sub-target set and recursively added to the queue to be solved. During the solution process, the mapping relationship between functions and operations CapRules and TaskConstraints is applied for pruning to exclude operation sequences that do not conform to capability dependencies or violate constraints. The reverse reasoning process constructs a target dependency tree G_backward={(Goal_i,Action_j,SubGoals)}, ultimately matching the sub-goals of the leaf nodes with the initial state State_0, verifying the reachability of the operation sequence, and outputting the reverse reasoning operation sequence Path_backward. Hybrid reasoning is achieved by combining forward and reverse searches, and constraint checks are performed during the reasoning process to ensure that the generated operation sequence meets the task logic requirements. A heuristic evaluation function can also be introduced to optimize the optimality of the operation sequence. The detailed implementation process is as follows: Hybrid reasoning simultaneously initiates both forward and reverse search processes, merging operation sequences at the intermediate meeting point, significantly improving reasoning efficiency. Specifically, the forward state space S_forward and the reverse target space G_backward are maintained in parallel, with the two search boundaries alternately expanded in each iteration. During forward expansion, it is checked whether the newly generated State_new satisfies a sub-goal in G_backward; during reverse expansion, it is checked whether the newly generated sub-goal SubGoal already exists in S_forward; when an intersection node State_meet or Goal_meet is detected, the search is terminated and the operation sequences are merged. During the merging process, constraint consistency checks are performed to verify whether the execution order and data flow meet the TaskConstraints requirements; at the same time, a heuristic evaluation function is introduced. Evaluate the quality of the operation sequence and prioritize expanding nodes with lower scores. Among these, , These are the weighting coefficients. The larger the size, the more emphasis is placed on cost. The larger the size, the more emphasis is placed on compliance constraints. Cost estimation measures the "cost" of a sequence of operations, such as quantifiable costs like sequence length, time consumption, and resource usage. ConstraintViolation measures the degree to which the sequence of operations violates rules, such as whether it deviates from the planning scope or violates safety restrictions; generally, a value closer to 0 is better. The final output is a complete inference sequence of operations that satisfies all constraints and has the optimal cost, recorded in the initial decision P_task.
[0062] ;
[0063] Here, TaskID is the unique identifier of the task, Path is the operation sequence, ConstraintsSatisfied indicates that the operation sequence satisfies all execution order and data dependency constraints, and Cost is the cost evaluation index of the operation sequence, such as estimated execution time, peak memory usage, number of operation steps, and complexity level.
[0064] Optionally, a symbolic knowledge base is generated based on the logical mapping set and the Action-Graph, including:
[0065] Each action in the set of operations is transformed into a logical description, resulting in a set of logical descriptions.
[0066] In this embodiment, each ak in the operation set A_act is first transformed into a predicate logic or action logic description, resulting in a logic description set ActionLogic. This logic description set includes multiple Actions, defined as follows: It can be generated through template matching or rules, where Precond(ak) is the set of preconditions for the operation and Effect(ak) is the set of results for the operation.
[0067] By taking each task in the set of tasks related to the function name in the dependency relationship between function and operation as an object, the logical constraints of each task are obtained.
[0068] The logical constraints of the task include: the set of functions that make up the task, the execution order of the functions, and data dependency constraints.
[0069] In this embodiment, each task description TaskDesr_j in the task set of R_cap-act, which represents the dependency relationship between functions and operations, is used as an object to form a task-centric expression: The first part indicates that the task consists of several functions, and the second part indicates the execution order of these functions and data dependency constraints. Then, a suitable representation method is selected, such as logical expression (Prolog / ASP), planning representation (PDDL), LISP, etc., to convert the original expression into formal logic (which can be based on rule templates or model generation methods).
[0070] A symbolic knowledge base is generated based on the logical description set, the logical constraints of each task, and the dependencies between functions and operations.
[0071] In a specific example, the Action data structure is: (:action{type or name}:parameters{input description}:precondition{precondition}:effect{output or effect description}); the set of all Action formal logic is denoted as ActionLogic; the relationship between Cap and Action is denoted as CapRules, with a data structure of [("CapName"=(and / or / nullActionList)),...], a simple example being [("Data Cleaning"=(and select-range remove-duplica test rim-text)),("Data Import"=(or import-csv import-excel import-sql)),("Data Sorting"=sort-range)]; task objectives and functions, dependency order and... Data flow relationships are transformed into logical constraints, denoted as TaskConstraints. These constraints are extracted from Task(Tj) and include execution order and data flow. The data structure is: (:task{task name description}:constraints(and(execution-order{execution order description})(data-flow{data dependency description}))). A simple example is: (:taskT_analysis:constraints(and(execution-order"data sorting""create pivot table")(data-flow"data sorting"create pivot table"))). Finally, all symbolic representations and rules are integrated to output a symbolic knowledge base K_sym={ActionLogic,CapRules,TaskConstraints}. ActionLogic is the set of logical descriptions, CapRules is the mapping relationship between functions and operations, and TaskConstraints is the logical constraint for each task.
[0072] In this embodiment, the functions, operations, and dependencies in the Attion-Graph are transformed into inferable symbolic representations and rule sets to obtain a symbolic knowledge base.
[0073] Optionally, after determining the initial decision based on the logical mapping set, Action-Graph, and task description information, the following steps are also included:
[0074] Semantic parsing is performed on the task description information to obtain the target information.
[0075] The target information includes: the key action targets of the task, the constraints of the task, and the priority of the task.
[0076] In this embodiment, the method for obtaining target information by semantically parsing the task description information can be as follows: Semantic parsing is performed on the user-input task description information (TaskDesc). Target information is extracted using methods such as dependency parsing, entity recognition, and task intent classification. The target information includes: key action objectives of the task, constraints of the task, and priority of the task. Key action objectives include the specific operations the user expects to complete (such as "sorting," "generating charts," "summarizing statistics," etc.). Constraints include time limits, resource limits, data range, and operation order. Priority information reflects the user's ranking of the importance of different capabilities.
[0077] Based on the target information and logical mapping set, a target task object is generated.
[0078] In this embodiment, the target task object includes: task identifier, target function set, and constraint objects corresponding to each task.
[0079] In this embodiment, the method for generating a target task object based on the target information and logical mapping set can be as follows: mapping the target information to an initial function set and an operation set to obtain a target function set, wherein the target function set includes at least one of the following: function name, function priority, function weight, and function parameter dictionary; symbolizing the constraints of the task to obtain the constraint object corresponding to each task; and generating the target task object based on the target function set and the constraint object corresponding to each task.
[0080] The first decision is generated based on the target task object, the symbolic knowledge base, and the initial decision.
[0081] In this embodiment, the first decision includes at least one of the following: task identifier, operation sequence, data dependency constraint, and cost evaluation index.
[0082] Based on the target task object, the symbolic knowledge base, and the initial decision, the first decision can be generated as follows: Input the target task object and the symbolic knowledge base into the symbolic reasoning engine to obtain the first decision. The first decision is defined as TaskPlan={TaskID,Path=[a1→a2→...→an],ConstraintsSatisfied,Cost}, where TaskID is the task identifier, Path=[a1→a2→...→an] is the operation sequence, ConstraintsSatisfied is the data dependency constraint, and Cost is the cost evaluation metric. The symbolic reasoning engine determines the initial decision based on the logical mapping set, the Action-Graph, and the task description information.
[0083] Optionally, based on the target information and logical mapping set, a target task object is generated, including:
[0084] The target information is mapped to the initial function set and operation set to obtain the target function set.
[0085] In this embodiment, the target function set includes at least one of the following: function name, function priority, function weight, and function parameter dictionary.
[0086] In this embodiment, the parsed target information is mapped to the initial function set C_cap and operation set A_act, forming the target function set TargetCaps. The mapping process uses a semantic similarity matching method to match the user's described action intent with the system's predefined capability names. Each TargetCaps member object contains: CapName (capability name), Required (whether it is required, boolean value), Priority (priority, integer value), and Params (parameter dictionary, containing the specific parameters required for the execution of the capability).
[0087] The constraints of the tasks are symbolized to obtain the constraint objects corresponding to each task.
[0088] In this embodiment, the constraints involved in the task are classified and symbolized to form constraint objects corresponding to each task. For example, there are temporal constraints (including max_execution_time, maximum execution time, and timeout threshold), resource constraints (including max_memory, maximum memory usage, and require_gpu, indicating whether a GPU is needed), operational constraints (including execution_order, data_dependencies, and business constraints), and business constraints (including time_range, data_source, and output_format, indicating specific business requirements).
[0089] Based on the set of target functions and the constraint objects corresponding to each task, generate target task objects.
[0090] In this embodiment, the target function set and the constraint objects corresponding to each task are integrated to generate a target task object TaskStruct={TaskID, TargetCaps, Constraints}. TaskID is the unique identifier of the task (e.g., "TASK_SALES_ANALYSIS_202310"), TargetCaps is the target function set, and Constraints is the constraint object corresponding to each task. This object serves as the standard input for subsequent calls to the symbolic inference engine.
[0091] Optionally, after generating the first decision based on the target task object, the symbolic knowledge base, and the initial decision, the following steps are also included:
[0092] The first decision is analyzed to obtain the analysis result.
[0093] The parsing results include at least one of the following: the number of operations, resource consumption, execution time, and constraint satisfaction for each operation sequence.
[0094] Based on the analysis results, redundant operations and / or operations to be merged are determined.
[0095] The first decision is optimized based on the redundant operations and / or the operations to be merged to obtain the target decision.
[0096] In this embodiment, the generated first decision is optimized to improve operational efficiency, reduce resource consumption, and meet additional constraints.
[0097] In this embodiment, the operation sequence in the first decision is analyzed to evaluate the number of operations, resource consumption, execution time, and constraint satisfaction of each operation sequence. By traversing each operation in the Path, the total execution time, peak memory consumption, and operation complexity are calculated cumulatively to identify potentially redundant operations or operation steps that can be merged.
[0098] Optionally, the first decision is optimized based on the redundant operations and / or the operations to be merged to obtain the target decision, including:
[0099] The operation sequence in the first decision is adjusted based on the heuristic evaluation function, the redundant operations and / or operations to be merged, the priority of the task, and the constraints of the task to obtain the second decision.
[0100] In this embodiment, based on the task priority, task constraints, and system performance indicators, a heuristic evaluation function or optimization algorithm (such as shortest path optimization) is used. The operation sequence is adjusted using search, genetic algorithms, or constrained optimization methods. The heuristic evaluation function can be: , and Weighting coefficients (e.g.) =0.7, =0.3), adjusting the efficiency and resource consumption based on the different priorities of the task. During the optimization process, unnecessary intermediate steps are identified and eliminated. For example, if the output of an operation is not used by subsequent operations, the operation can be deleted; if multiple operations can be combined into a single operation, operations are merged to reduce the number of execution steps.
[0101] The second decision is verified based on the constraints corresponding to the task.
[0102] In this embodiment, the logical correctness of the decisions and the consistency of constraints are maintained during the optimization process to ensure that the optimized sequence still satisfies the dependencies between functions and operations defined in the Action-Graph. After each adjustment of the operation sequence, it is necessary to verify whether the adjustment violates the `execution_order` and `data_dependencies` constraints defined in `Constraints`. If the constraints are violated, the adjustment is rolled back and other optimization schemes are tried.
[0103] If the verification is successful, the second decision will be adopted as the target decision.
[0104] In this embodiment, an optimized decision is generated: OptimizedTaskPlan={TaskID, PathOptimized=[a1→a2→...→an], ConstraintsSatisfied, CostOptimized}, where PathOptimized is the optimized operation sequence, which may have fewer operation steps than the original Path; ConstraintsSatisfied confirms that the optimized decision still satisfies all constraints; CostOptimized is the optimized cost evaluation, including the optimized time_estimate, memory_peak, step_count, and complexity, and each indicator should be better than or equal to the indicator before optimization.
[0105] Optional, also includes:
[0106] Based on the dependencies between functions and operations, the mapping relationships between functions and operations, and the logical constraints of the task, the target decision is statically verified.
[0107] If the static verification passes, then each operation in the operation sequence of the target decision is executed in the simulation environment.
[0108] If execution fails, return to the operation that determines the initial decision based on the logical mapping set, Action-Graph, and task description information, until execution succeeds.
[0109] In this embodiment, firstly, static validation is performed on the OptimizedTaskPlan to check whether the operation sequence satisfies the dependency relationship R_cap-act between functions and operations defined in the Action-Graph. Static validation ensures the logical integrity of the operation chain by checking whether the precondition (Precond) of each operation in PathOptimized can be satisfied by the Effect of the preceding operation. It also verifies whether the operation sequence conforms to the mapping relationship between functions and operations defined in CapRules, and whether it meets the logical constraints of the task. Then, each operation is executed in the order of the operation sequence in a simulation environment, and the preconditions and effects of the operations are dynamically validated to ensure the feasibility of the operations. Dynamic validation can execute the operation sequence in PathOptimized in a sandbox environment or a simulation environment. For example, in an Excel application scenario, the openpyxl library is used to simulate execution in a Python environment. During execution, it is monitored whether each operation can be completed successfully, whether the operation result meets the expected Effect definition, and whether resource conflicts or operation anomalies occur during the entire execution process. If the operation fails or the result does not meet expectations, the failed operation node and the reason for failure are recorded. Next, if operational or resource conflicts are detected during simulation, the symbolic inference engine is invoked to regenerate alternative paths to ensure the executability of the task plan. Failure information is fed back to the ActionPlan symbolic inference engine, marking the failed operations or paths in K_sym. The inference engine adjusts its search decisions based on the failure information, generating new alternative operation sequences. If an executable operation sequence cannot be generated after multiple attempts, the user is notified of the task's inability to complete and the specific reason. Finally, verified task decisions are stored in a database or knowledge graph, and a TaskID index is created for querying and version management, enabling external systems to access and reuse task decisions.
[0110] The technical solution provided in this embodiment can transform a user's natural language task description into an optimized and verified executable decision, ensuring that the generated decision is theoretically correct and practically executable. At the same time, the optimization process improves the execution efficiency and resource utilization of the plan.
[0111] In this embodiment, to further improve the construction efficiency and coverage of the Action Graph, multimodal learning technology can be introduced. This involves simultaneously processing system interface screenshots, operation video recordings, demonstration animations, and other data to automatically extract operation steps and relationships, enriching the graph content. To address the potentially huge search space of complex tasks, more advanced optimization algorithms, such as Monte Carlo Tree Search (MCTS) or deep learning-guided heuristic search, can be integrated into the symbolic inference engine to generate near-optimal solutions within a reasonable timeframe. To enhance the system's adaptability, an online learning mechanism can be introduced. By recording the success rate of planning results and user feedback, the confidence level of nodes in the Action-Graph, the cost estimation of operations, or the heuristic function parameters of the inference engine can be dynamically adjusted, enabling continuous system optimization.
[0112] The symbolic knowledge representation (K_sym) in this embodiment can be further combined with a domain ontology to leverage the rich semantic relationships and reasoning capabilities of the ontology to verify the logical consistency of the generated plan and discover potential new combinations of operation sequences. To improve the processing performance of large-scale systems, the storage and reasoning process of the Action-Graph can be distributed. For example, subgraphs of different functional modules can be stored in different graph database shards, and parallel subgraph queries and path searches can be performed during reasoning, with the results finally merged. A visual interactive interface can be developed, not only to display the final plan but also to allow users to intervene in the plan generation process, such as manually specifying or excluding certain operation steps and adjusting the priority of constraints, thus achieving a hybrid human-machine collaborative planning approach.
[0113] The TaskPlan generated in this invention can be further converted into a standard workflow description language (such as BPMN or Apache Airflow DAG), and directly integrated into existing workflow engines or automated operation and maintenance platforms for execution, greatly expanding the scope of application of the results. For unexpected states that may occur during operation execution (such as operation failure or insufficient resources), the real-time replanning capability of the inference engine can be enhanced. When the monitoring module detects that the state deviates from expectations, it can quickly call the symbolic inference engine to generate a new response plan based on the latest state. A shared "Action-Graph knowledge base" can be built, and Action-Graphs built by different systems or users can be uploaded and shared after being anonymized. Existing high-quality graphs can be retrieved and adapted for rapid initialization, avoiding building from scratch and promoting knowledge reuse.
[0114] The technical solution of this embodiment obtains system-related information; constructs a system action graph (Action-Graph) based on the system-related information, wherein the Action-Graph includes nodes and edges, nodes include functions, operations, and tasks, and edges include dependencies between functions and operations, dependencies between functions and tasks, and dependencies between operations; constructs a logical mapping set based on the Action-Graph, wherein the logical mapping set includes an initial function set, an operation set, and dependencies between functions and operations; and determines an initial decision based on the logical mapping set, the Action-Graph, and task description information, wherein the initial decision includes at least one of task identifier, operation sequence, data dependency constraints, and cost evaluation indicators. By constructing a finite-state system action graph and organically combining Action-Graph-based augmented generation with symbolic programming, an end-to-end automated process suitable for intelligent agents is constructed, realizing fully automated processing from natural language task description to task execution.
[0115] Example 2
[0116] This embodiment uses the automation of Microsoft Excel software operations as an example to demonstrate the specific implementation process of this invention. In this embodiment, the user can execute tasks such as creating tables, drawing bar charts, and sorting and summing data in tables through a natural language command agent. The system finds the optimal decision to complete the task and executes and verifies it. The real-time system of this embodiment is developed based on the Python language, runs on the Windows operating system, and interacts with the Microsoft Excel application. In practical applications, the target software system and target task are not limited. Engineers with basic knowledge of machine learning and software engineering can refer to the ideas and steps of this invention to further refine the implementation. In practical application scenarios, this invention has universality and is not limited to specific software, specific frameworks, or specific model structures.
[0117] To provide a more comprehensive explanation of the specific implementation details of this invention, this embodiment fully demonstrates the entire process from system function analysis and action map construction to final decision-making. In practical applications, this invention can be applied to any software automation scenario or a combination thereof, without departing from the innovativeness of this embodiment.
[0118] Phase 1: System Functionality - Behavior Parsing and Action-Graph Construction. This phase involves parsing multi-source Excel documents and constructing the Excel Action-Graph. The specific process is as follows:
[0119] Step 101: System Function - Behavior Analysis.
[0120] Step 101.1 Raw Data Collection and Formatting: The system automatically collects a multi-source document dataset related to Excel, Escel_D_doc, including official Excel help documents (PDF format), MSDN online reference documents (HTML format), internal enterprise Excel best practice guides (Word documents), and user operation log documents. These heterogeneous documents are parsed using a document parser (e.g., using the pdfplumber library to parse PDF documents and the BeautifulSoup library to parse HTML web pages) and OCR recognition technology (for scanned documents), uniformly converting them into UTF-8 encoded plain text format and annotating metadata (including document source, timestamp, task category, component category, etc.), ultimately obtaining a standardized text set, Excel_D_std. This process uses existing technology and will not be described in detail further.
[0121] Step 101.2 Semantic Unit Segmentation and Functional Candidate Extraction: The Sentence-BERT model is used to semantically embed the text in Excel-std, and clustering algorithms (such as DBSCAN) are used to aggregate statements describing similar functions. For example, the following functional description statements are extracted from the document to form a functional candidate set C_cap: C1={"CapName":"Data Sorting","Description List":["Sort data in the selected area in ascending or descending order by a specified column","Sorting data based on multiple keywords"],"Related Tasks":["Data Analysis","Report Preparation"]}; C2={"CapName":"Conditional Formatting","Description List":["Automatically apply cell formatting based on cell values","Visualize data using data bars, color levels, or icon sets"],"Related Tasks":["Data Visualization","Anomaly Detection"]}... The output of this step is a functional candidate set C_cap containing system function descriptions, providing a foundation for subsequent extraction operations.
[0122] Step 102: Attion-Graph Construction.
[0123] Step 102.1 Operation Step Extraction and Standardization: Information is extracted from the description list in C_cap using a BERT-CRF-based sequence labeling model. Action verbs and operation objects are identified and formatted as standard Actions. Actions are extracted from C1["Description List"]: a1={"Action Type":"Sorting","Target Object":"Data Range","Input Conditions":"Target Range, KeyColumn, Order","Output Effect":"Data in the specified range is sorted by KeyColumn in Order"}; Actions are extracted from C2["Description List"]: a2={"Action Type":"Application","Target Object":"Conditional Formatting","Input Conditions":"Target Range, Formatting Rule (e.g., CellValue>100)","Output Effect":"Cells within the target range that conform to the Rule have their styles changed"}. Simultaneously, a mapping relationship between functions and operations, R_cap-act, is established.
[0124] For example, R1={"CapName":"Data Sorting","ActionSeq":[a1],"Adepgraph":null}.
[0125] Step 102.2 Action-Graph Construction and Storage: Store R_cap-act in a graph database (Neo4j). Node types in the graph include: Capability, Action, and Task. Edge relationship types include: HAS_ACTION (capability owns an action), BELONGS_TO_TASK (capability belongs to a task), and NEXT_STEP (dependency between actions). This ultimately forms Excel's Action-Graph, laying the foundation for subsequent symbolic reasoning. For example, the "Data Sorting" capability node points to the a1 action node through the HAS_ACTION relationship, and points to the "Data Cleaning" task node through the BELONGS_TO_TASK relationship.
[0126] Phase Two: Construction of a Symbolic Reasoning System Based on Action-Graph
[0127] Step 201: Symbolic Knowledge Representation and Logical Rule Construction: Transform the functions / operations / dependencies in the Excel-Action-Graph into a set of inferable symbolic representations and rules. The input objects are L_cap-act and Excel-Action-Graph. The specific processing flow is as follows: First, transform each ak in the Action set A_act into a predicate logic or action logic description, defined as Action(ak):[Precond(ak)]→[Effect(ak)], where Precond(ak) is the set of preconditions for the operation, and Effect(ak) is the set of results for the operation. Then, encode the task attribution relationship TaskDesr in R_cap-act into constraints, forming... The rules are defined; a Programmatic Digital Representation (PDDL) knowledge representation method is selected; finally, all symbolic representations are integrated with the rules to output a symbolic knowledge base Excel_K_sym={ActionLogic,CapRules,TaskConstraints}. For example, the operation "Create PivotTable" is defined as:
[0128] (:action create-pivot-table
[0129] :parameters (?wb - workbook ?ws - worksheet ?range - range
[0130] ?rows - column ?values - column ?op - operation)
[0131] :precondition (and (workbook-open ?wb)
[0132] (worksheet-exists ?wb ?ws)
[0133] (range-valid ?ws ?range)
[0134] (data-range ?range))
[0135] :effect (and (pivot-table-created ?rows ?values ?op)
[0136] (not (data-selected))))
[0137] The rules for the "data analysis" task are expressed as follows:
[0138] (:task T_analysis
[0139] :requirements (and (capability "data sorting")
[0140] (capability "Create PivotTable")
[0141] (capability "Generate chart"))
[0142] :constraints (and (execution-order "data sorting" "create pivot table")
[0143] (data-flow "Data Sorting "Creating PivotTables"))
[0144] The final output of the symbolic knowledge base is shown below:
[0145] Excel_K_sym = {
[0146] ActionLogic: [
[0147] create-pivot-table[Precond, Effect],
[0148] sort-range[Precond,Effect],
[0149] insert-chart[Precond,Effect]
[0150] ],
[0151] CapRules: [
[0152] ("data sorting"=sort-range)
[0153] ("Create PivotTable")
[0154] ("Generate chart"=insert-chart)
[0155] ],
[0156] TaskConstraints: [
[0157] ( ),
[0158] (execution-order sort-range create-pivot-table),
[0159] (data-flow sort-range create-pivot-table) ]
[0161] }
[0162] Step 202: Implementation of the ActionPlan Symbolic Inference Engine: A symbolic inference engine is implemented based on Excel_K_sym to support the mapping from task objectives to executable operations. The input objects are Excel_K_sym and Excel-Action-Graph. The specific processing flow is as follows: First, forward inference is performed, gradually expanding the possible task completion operation sequence based on the initial conditions and the Precond and Effect of Action(ak); then, backward inference is performed, matching the possible Action sequence by deducing the Effect required for the target task; next, hybrid inference is implemented by combining forward and backward search, and constraint consistency checks are performed during the inference process to ensure that the generated operation sequence meets the task logic requirements. A heuristic evaluation function can also be introduced to optimize the optimality of the operation sequence; finally, the inference result is output as an inference result set P_task={TaskID,Path=[a1→a2→…→an],ConstraintsSatisfied,Cost}. For example, for a data analysis task of summing, ranking, and visualizing sales figures, an example of the output inference result set is as follows:
[0163] P_task = {
[0164] TaskID: "TASK_DATA_ANALYSIS_001",
[0165] Path: [
[0166] sort-range[Range: "A1:D100", KeyColumn: "Date", Order: "Ascending"]
[0167] → create-pivot-table[Rows: "Product Category", Values: "Sales Revenue", Op:"Sum"]
[0168] → insert-chart[ChartType: "Column Chart", DataSource: "PivotTable Range"]
[0169] ],
[0170] ConstraintsSatisfied: true,
[0171] Cost: {
[0172] time_estimate: 8.5,
[0173] memory_peak: 250,
[0174] step_count: 3,
[0175] Complexity: "Medium"
[0176] }
[0177] }
[0178] Phase 3: Task planning based on the ActionPlan symbolic reasoning engine. This phase implements the process from "task description" to "task execution plan" generation. The specific steps are as follows:
[0179] Step 301: Task parsing and target mapping. This step transforms the natural language task description in Excel into system-recognizable targets and constraints. The detailed process is as follows: First, semantic parsing is performed on the task description information TaskDesc. Using dependency parsing, the key action targets, constraints, and priorities of the task are extracted. Then, the parsed target information is mapped to the initial function set and operation set, forming a target function set TargetCaps={Cap_i,…,Cap_j} associated with Excel operations. Next, the constraints involved in the task, including time constraints, resource constraints, and operation sequence constraints, are converted into symbolic constraint expressions and added to TaskConstraints. Finally, the target capability set and constraints are integrated to generate a structured task target object TaskStruct={TaskID,TargetCaps,Constraints}. In this embodiment, after parsing the task description information "Help me analyze this month's sales data, summarize sales revenue by product category, and generate a bar chart," the generated structured target task object is shown below:
[0180] TaskStruct = {
[0181] TaskID: "TASK_SALES_ANALYSIS_202310",
[0182] TargetCaps: [
[0183] {
[0184] CapName: "Data Sorting",
[0185] Required: true,
[0186] Priority: 1,
[0187] Params: {range: "Sales data region", key: "Date"}
[0188] },
[0189] {
[0190] CapName: "Create PivotTable",
[0191] Required: true,
[0192] Priority: 1,
[0193] Params: {rows: "Product Category", values: "Sales Revenue", operation: "Sum"}
[0194] },
[0195] {
[0196] CapName: "Generate Chart",
[0197] Required: true,
[0198] Priority: 1,
[0199] Params: {type: "Bar Chart", title: "Sales Summary by Category"}
[0200] }
[0201] ],
[0202] Constraints: {
[0203] temporal: {
[0204] max_execution_time: 10,
[0205] timeout: 15
[0206] },
[0207] resource: {
[0208] max_memory: 500,
[0209] require_gpu: false
[0210] },
[0211] operational: {
[0212] execution_order: ["Data sorting", "Create pivot table", "Generate chart"],
[0213] data_dependencies: {
[0214] "Create PivotTable": {"requires": "Sorting Data"},
[0215] "Generate Chart": {"requires": "Create PivotTable"}
[0216] }
[0217] },
[0218] business: {
[0219] time_range: "this month",
[0220] data_source: "Sales Data Table",
[0221] output_format: "Excel workbook"
[0222] }
[0223] }
[0224] }
[0225] Step 302: Symbolic Reasoning Planning and Operation Sequence Generation. The ActionPlan symbolic reasoning engine is used to generate the operation sequence from the initial state to the target task. The input objects are TaskStruct and Excel_K_sym. The detailed processing is as follows: First, initialize the initial state S_0 of the Excel software, defining information such as the Excel startup state, functional component states, and table data states. Then, starting from S_0, based on the preconditions Precond and Effects of each Action(ak), forward reasoning is used to expand the reachable state space. Simultaneously, starting from the task target state, backward reasoning is used to deduce the required Action sequence. Next, forward and backward reasoning are combined, employing a hybrid search decision to narrow the search space, accelerate operation path generation, and continuously check the consistency of task constraints and system states during the reasoning process to eliminate infeasible paths. Finally, cost and heuristic optimization are used to optimize the generated operation sequence, and the final decision is output.
[0226] TaskPlan={TaskID,Path=[a1→a2→…→an],ConstraintsSatisfied,Cost}.
[0227] Step 303: Optimize the decision generated in the previous step. Specifically, the process involves: First, analyzing the operation sequence in TaskPlan to evaluate the number of operations, resource consumption, execution time, and constraint satisfaction for each path. In this embodiment, taking an Excel sales data analysis task as an example, the initial decision is: Path = [Select data range → Sort by date → Create pivot table (rows: product category, values: sum of sales) → Select pivot table data → Insert bar chart]. Analysis shows this path contains 5 operation steps, with an estimated total execution time of 8.5 seconds and a peak memory consumption of approximately 250MB. Then, based on task priority (execution efficiency is the highest priority in this embodiment), constraints, and system performance indicators, a search algorithm combined with a heuristic evaluation function is used to adjust the operation sequence. In this embodiment, the heuristic function h(n) is defined as minimizing the weighted sum of operation time and resource consumption: , and Weighting coefficients (e.g.) =0.7, =0.3). During optimization, the logical correctness and constraint consistency of the path are continuously maintained, ensuring that the optimized sequence still satisfies the operation dependencies R_cap-act defined in Excel-Action-Graph. After optimization, it was found that the operations "selecting data range" and "selecting pivot table data" can be combined for execution. Meanwhile, the "sort by date" operation is not a necessary step for generating the final pivot table and chart, and a new operation sequence is generated after optimization. Finally, the optimized decision is output: OptimizedTaskPlan={TaskID:TASK_EXCEL_SALES_001,PathOptimized=[Create pivot table (rows: product category, values: sum of sales) → insert bar chart based on pivot table],ConstraintsSatisfied:True,CostOptimized:3.2 seconds}. Through this optimization step, the number of operation steps is reduced from 5 to 2, the execution time is reduced from 8.5 seconds to 3.2 seconds, and the peak memory usage is reduced from 250MB to 180MB, significantly improving execution efficiency.
[0228] Step 304, Verification and Storage: This step verifies the feasibility of the TaskPlan generated in the previous step and stores it. The detailed process is as follows: First, static verification is performed on the OptimizedTaskPlan to check if the operation sequence satisfies the R_cap-act defined in Excel-Action-Graph. The verifier checks whether the preconditions for the "Create PivotTable" operation [workbook is open, worksheet exists, data range is valid] and the preconditions for the "Insert Bar Chart" operation [data source is valid] are met. Verification shows that all operation dependencies conform to the definitions in Action-Graph. Then, the operations are executed sequentially in the Python openpyxl simulation environment to dynamically verify the preconditions and effects of the operations. In this embodiment, the operation sequence in the OptimizedTaskPlan is executed sequentially in the simulation environment to verify that the "Create PivotTable" operation can indeed generate the correct summary report, and the "Insert Bar Chart" operation can successfully generate a bar chart based on the pivot table data, and no resource conflicts or operational anomalies occur during the entire execution process. Next, if operational or resource conflicts are detected during the simulation, the symbolic inference engine is invoked to regenerate alternative paths. In this embodiment, the simulation execution process proceeded normally, and no replanning was required. Finally, the validated task execution plan is stored in a MongoDB database, and a TaskID index is created for querying and version management. The stored data structure includes fields such as TaskID (task identifier), PathOptimized (optimized operation sequence), ConstraintsSatisfied (constraint satisfaction status), CostOptimized (optimized cost estimate), Timestamp, and Version. In this embodiment, task TASK_EXCEL_SALES_001 was successfully stored in the database, and corresponding version management and query interfaces were generated, allowing external systems to call the task plan via a RESTful API, thus achieving task plan sharing and reuse.
[0229] Example 3
[0230] Figure 2 This is a schematic diagram of a finite-state agent behavior decision-making device provided in an embodiment of the present invention. This embodiment is applicable to finite-state agent behavior decision-making. The device can be implemented using software and / or hardware, and can be integrated into any device that provides finite-state agent behavior decision-making functionality, such as… Figure 2 As shown, the finite-state intelligent agent behavior decision-making device specifically includes: a system-related information acquisition module 210, a system action graph creation module 220, a logical mapping set determination module 230, and an initial decision determination module 240.
[0231] Among them, the system-related information acquisition module is used to acquire system-related information;
[0232] The system action graph creation module is used to construct a system action graph based on system-related information. The action graph includes nodes and edges. Nodes include functions, operations, and tasks. Edges include dependencies between functions and operations, dependencies between functions and tasks, and dependencies between operations.
[0233] The logical mapping set determination module is used to construct a logical mapping set based on the Action-Graph, wherein the logical mapping set includes: an initial function set, an operation set, and a function-operation mapping relationship set;
[0234] The initial decision determination module is used to determine an initial decision based on a logical mapping set, an Action-Graph, and task description information, wherein the initial decision includes at least one of the following: task identifier, operation sequence, data dependency constraints, and cost evaluation indicators.
[0235] The above-described products can perform the methods provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for performing the methods.
[0236] Example 4
[0237] Figure 3 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0238] like Figure 3As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0239] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0240] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as finite-state agent behavior decision-making methods.
[0241] In some embodiments, the finite-state agent behavior decision-making method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the finite-state agent behavior decision-making method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the finite-state agent behavior decision-making method by any other suitable means (e.g., by means of firmware).
[0242] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0243] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0244] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0245] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0246] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0247] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0248] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0249] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the finite-state intelligent agent behavior decision-making method according to any embodiment of the invention.
[0250] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0251] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for finite state agent behavior decision making, the method comprising: The method comprises the following steps: acquiring system-related information; constructing an Action-Graph according to the system-related information, wherein the Action-Graph comprises nodes and edges, the nodes comprise functions, operations and tasks, and the edges comprise dependency relationships between functions and operations, dependency relationships between functions and tasks, and dependency relationships between operations and operations; constructing a logical mapping set according to the Action-Graph, wherein the logical mapping set comprises an initial function set, an operation set and dependency relationships between functions and operations; determining an initial decision according to the logical mapping set, the Action-Graph and task description information, wherein the initial decision comprises at least one of a task identifier, an operation sequence, a data dependency constraint and a cost evaluation index.
2. The method of claim 1, wherein, The method for constructing the Action-Graph according to the system-related information comprises the following steps: parsing the system-related information to obtain an initial function set, an operation set and dependency relationships between functions and operations, wherein the initial function set comprises a function name, a description list related to the function name and a task set related to the function name, the operation set comprises an operation type, an action object, an input condition and an output condition, and the dependency relationships between functions and operations comprise a function name, an operation sequence related to the function name, a dependency relationship graph of the operation sequence and a task set related to the function name; constructing the Action-Graph according to the initial function set, the operation set and the dependency relationships between functions and operations.
3. The method of claim 1, wherein, The method for determining the initial decision according to the logical mapping set, the Action-Graph and the task description information comprises the following steps: generating a symbolic knowledge base according to the logical mapping set and the Action-Graph, wherein the symbolic knowledge base comprises a logical description set, a mapping relationship between functions and operations and a logical constraint of each task; determining the initial decision according to the symbolic knowledge base, the Action-Graph and the task description information.
4. The method of claim 3, wherein, The method for generating the symbolic knowledge base according to the logical mapping set and the Action-Graph comprises the following steps: transforming each action in the operation set into a logical description to obtain the logical description set; taking each task in the task set related to the function name in the dependency relationships between functions and operations as an object to obtain the logical constraint of each task, wherein the logical constraint of each task comprises a function set constituting the task, an execution order of the functions and a data dependency constraint; generating the symbolic knowledge base according to the logical description set, the logical constraint of each task and the dependency relationships between functions and operations.
5. The method of claim 3, wherein, After determining the initial decision according to the logical mapping set, the Action-Graph and the task description information, the method further comprises the following steps: performing semantic parsing on the task description information to obtain target information, wherein the target information comprises a key action target of the task, a constraint condition of the task and a priority of the task; generating a target task object according to the target information and the logical mapping set; generating a first decision according to the target task object, the symbolic knowledge base and the initial decision.
6. The method of claim 5, wherein, According to the target information and the logical mapping set, a target task object is generated, including: mapping the target information into an initial function set and an operation set to obtain a target function set, wherein the target function set includes at least one of a function name, a priority of the function, a weight of the function, and a parameter dictionary of the function; symbolically processing a constraint condition of a task to obtain a constraint object corresponding to each task; generating the target task object according to the target function set and the constraint object corresponding to each task.
7. The method of claim 5, wherein, After generating a first decision according to the target task object, the symbolic knowledge base, and the initial decision, the method further includes: parsing the first decision to obtain a parsing result, wherein the parsing result includes at least one of an operation quantity, a resource occupation, an execution time, and a constraint satisfaction degree of each operation sequence; determining redundant operations and / or operations to be merged according to the parsing result; optimizing the first decision according to the redundant operations and / or the operations to be merged to obtain a target decision.
8. The method of claim 7, wherein, Optimizing the first decision according to the redundant operations and / or the operations to be merged to obtain a target decision includes: adjusting an operation sequence in the first decision based on a heuristic evaluation function, the redundant operations and / or the operations to be merged, a priority of a task, and a constraint condition of the task to obtain a second decision; verifying the second decision according to the constraint object corresponding to the task; if the verification is passed, taking the second decision as the target decision.
9. The method of claim 7, wherein, The method further includes: performing a static verification on the target decision based on a dependency relationship between functions and operations, a mapping relationship between the functions and the operations, and a logical constraint of the task; if the static verification is passed, executing each operation in the operation sequence of the target decision in a simulation environment; if the execution fails, returning to perform an operation according to the logical mapping set, the Action-Graph, and the task description information to determine the initial decision until the execution is successful.
10. A finite state agent behavior decision apparatus, characterized by, The method includes: a system-related information acquisition module configured to acquire system-related information; a system action graph creation module configured to construct a system action graph Action-Graph according to the system-related information, wherein the Action-Graph includes nodes and edges, the nodes include functions, operations, and tasks, and the edges include a dependency relationship between functions and operations, a dependency relationship between functions and tasks, and a dependency relationship between operations and operations; a logical mapping set determination module configured to construct a logical mapping set according to the Action-Graph, wherein the logical mapping set includes an initial function set, an operation set, and a function-operation mapping relationship set; an initial decision determination module configured to determine an initial decision according to the logical mapping set, the Action-Graph, and task description information, wherein the initial decision includes at least one of a task identifier, an operation sequence, a data dependency constraint, and a cost evaluation index.
11. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected in communication with the at least one processor; and The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method for behavior decision of a finite-state agent according to any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to implement the method for behavior decision of a finite-state agent according to any one of claims 1-9 when executed.
13. A computer program product, characterised in that, The computer program product comprises a computer program which, when executed by a processor, implements the method for behavior decision of a finite-state agent according to any one of claims 1-9.