A heterogeneous demand-driven method and system for constructing and verifying the functional chain of intelligent agents and verifying contracts.
By constructing heterogeneous requirement constraint graphs and function contracts, the problems of parameter matching and execution condition determination for multi-source business requirements were solved, achieving the stability and traceability of the function chain and reducing the need for repeated calculations and manual investigation.
Patent Information
- Application Number
- CN202611408788.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-11-17
AI Technical Summary
When dealing with multi-source business needs, existing technologies struggle to accurately determine the basis for the requirements of each parameter and execution condition in the generation process, resulting in poor stability and traceability of the functional chain generation results. Furthermore, anomaly detection usually requires manual investigation or regeneration of the entire functional chain.
By constructing a heterogeneous requirement constraint graph, establishing evidence anchor points between requirement nodes and their original locations, combining function contracts for module matching and dependency orchestration, generating candidate function chains, and performing pre-execution verification, the smallest set of unmet conditions that failed verification is located and repaired.
It improves the structural integrity and traceability of multi-source demand information, reduces the generation of invalid candidate functions, lowers the possibility of anomalies during the operation of the function chain, and improves the executability and repair efficiency of the function chain.
Smart Images

Figure CN123114684A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically to a method and system for constructing and verifying functional chains and contracts of intelligent agents driven by heterogeneous requirements. Background Technology
[0002] With the development of large language models and intelligent agent technology, the approach of describing tasks based on natural language and having intelligent agents call software functions to complete task processing is gradually being applied. Intelligent agents can call different types of function modules such as database queries, predictive analysis, simulation calculations, approval workflows, and report generation according to user needs, and form workflows or function chains according to a certain calling order, thereby reducing the usage threshold of complex business systems.
[0003] In business scenarios such as power grid material supply chain, power grid planning, and audit supervision, a business requirement typically involves information from multiple sources, including textual descriptions, business tables, event logs, indicator thresholds, and chart trends. Information from different sources may use different field names, units of measurement, and time expressions, and there may also be entity referencing, data dependencies, conditional constraints, and execution sequence relationships between different pieces of information. Therefore, the intelligent agent not only needs to identify the processing objective corresponding to the business requirement, but also needs to determine the source of the requirement data, the input-output relationships of function modules, and the execution conditions that each processing step should meet.
[0004] Existing intelligent agent workflow generation methods typically utilize large language models or retrieval-enhanced generation techniques to parse natural language requirements and generate RPA processes, workflow definitions, or tool call sequences accordingly. Methods based on knowledge graphs or domain ontology organize pre-defined business processes, operations, data, and rules into structured knowledge and retrieve corresponding processes or processing nodes based on user needs. Furthermore, semantic Web service composition methods can combine multiple atomic services based on their input, output, and invocation conditions. Orchestration methods based on task graphs or directed acyclic graphs can break down complex tasks into multiple subtasks and assign appropriate intelligent agents or tools according to the dependencies between these subtasks.
[0005] However, existing methods, when handling multi-source business requirements, typically convert the requirements from different sources into a unified text or structured description, which can easily lead to the loss of the correspondence between the requirement content and the original source location. When there are field differences, constraint conflicts, or entity referencing relationships between different sources, it is difficult to accurately determine the basis for the requirements of each parameter and execution condition in the generation process. At the same time, existing function matching and process orchestration methods usually focus on the relevance between function semantics and task content, making it difficult to determine whether the corresponding input data has been provided by user requirements, business context, or upstream function modules before the function is actually called, based on the input and output requirements, calling order, and execution conditions of each function module. This may result in the generation of a semantically reasonable but actually unexecutable function chain.
[0006] Furthermore, when the generated function chain has issues such as missing inputs, incompatible data types, conflicting call orders, or unmet execution conditions, existing methods typically only detect anomalies after the function chain has actually run, and it is difficult to accurately trace the cause of the verification failure back to the corresponding requirement and its original location. For anomalies caused by local function modules or local dependencies, manual investigation or regeneration of the entire function chain is often required, which can easily lead to duplicate calculations and affect the stability and traceability of the function chain generation results.
[0007] Therefore, finding a solution to the aforementioned technical problems is of great significance. Summary of the Invention
[0008] To address the limitations of existing technologies in matching and orchestrating function modules and verifying function chains before execution while preserving multi-source demand information, as well as accurately locating unmet conditions and addressing function chains after verification failures, this invention proposes a heterogeneous demand-driven intelligent agent function chain construction and contract verification method and system.
[0009] Firstly, a method for constructing and verifying the functional chain of intelligent agents driven by heterogeneous requirements is provided, including: Based on the acquired multi-source demand information, a heterogeneous demand constraint graph is constructed, and evidence anchor points are established between the demand nodes in the heterogeneous demand constraint graph and the original demand locations. Based on the heterogeneous requirement constraint diagram and the pre-registered function contracts, the function modules in the preset function library are matched and their dependencies are orchestrated to generate candidate function chains. The function contracts are used to characterize the input and output requirements and execution conditions of the function modules. The available variable status is propagated according to the function call order in the candidate function chain, and the candidate function chain is verified before execution based on the input available status before the execution of each function module and the function contract. When the candidate function chain fails the pre-execution verification, the minimum unmet condition set that caused the verification failure is determined, the candidate function chain is updated and repaired according to the evidence anchor point corresponding to the minimum unmet condition set, and the updated and repaired candidate function chain is re-verified before execution, and the executable function chain that passes the verification is output.
[0010] Secondly, a heterogeneous demand-driven intelligent agent function chain construction and contract verification system is provided, characterized by comprising: The construction module is used to construct a heterogeneous demand constraint graph based on the acquired multi-source demand information, and to establish evidence anchor points between the demand nodes in the heterogeneous demand constraint graph and the original demand locations. The matching module is used to match and orchestrate the function modules in the preset function library based on the heterogeneous requirement constraint diagram and the pre-registered function contracts, and generate candidate function chains. The function contracts are used to characterize the input and output requirements and execution conditions of the function modules. The verification module is used to propagate the available variable status according to the function call order in the candidate function chain, and to perform pre-execution verification of the candidate function chain based on the input available status before the execution of each function module and the function contract; The output module is used to determine the minimum unmet condition set that caused the verification failure when the candidate function chain fails the pre-execution verification, update and repair the candidate function chain according to the evidence anchor point corresponding to the minimum unmet condition set, re-perform the pre-execution verification of the updated and repaired candidate function chain, and output the executable function chain that passed the verification.
[0011] In another aspect, the present invention also provides an electronic device, comprising: at least one processor and a memory; the memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, a heterogeneous demand-driven intelligent agent function chain construction and contract verification method as described above is implemented.
[0012] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, it implements the above-described method for constructing and verifying a heterogeneous demand-driven intelligent agent functional chain.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a method and system for constructing and verifying functional chains and contracts of intelligent agents driven by heterogeneous requirements. It constructs a heterogeneous requirement constraint graph based on multi-source requirement information and uses evidence anchors to retain the correspondence between requirement nodes and their original positions. Furthermore, it combines pre-registered function contracts to match and orchestrate the dependencies of function modules, generating candidate functional chains. It propagates the state of available variables according to the function call order in the candidate functional chains and performs pre-execution verification. When verification fails, it determines the minimum unmet condition set, updates and repairs the candidate functional chains accordingly, and re-verifies them, thus forming a closed-loop processing procedure from multi-source requirement analysis, function module orchestration, pre-execution verification, failure cause localization, to functional chain repair.
[0014] This invention uses a heterogeneous requirement constraint graph to uniformly represent requirement data, requirement constraints and their interrelationships from different sources, and retains the source location of the corresponding requirement content through evidence anchors. This allows function parameters, execution conditions and verification results to be traced back to the corresponding original sentences, business fields, event logs or chart features along the requirement nodes, improving the structural integrity of multi-source requirement information and the traceability of the functional chain construction results, and facilitating the review of parameter sources and processing basis.
[0015] This invention matches function modules based on heterogeneous requirement constraint graphs and function contracts. Before function orchestration, it excludes function modules that cannot provide required inputs, have incompatible input / output data types, or do not meet execution conditions. This reduces invalid candidates that only semantically match the requirements but cannot actually be called. Furthermore, by combining requirement node relationships and input / output connections between function modules for dependency orchestration, it helps improve the rationality of function call order and data transfer relationships in the candidate function chain.
[0016] This invention dynamically propagates the state of available variables according to the function call order and verifies them based on the available input state and function contract before the execution of each function module. It can identify situations such as input fields existing in the function chain but not yet generated before the current function call, and input fields existing but whose type, state, or execution conditions do not meet the function call requirements. This allows problems such as missing inputs, call order conflicts, and unmet contracts to be discovered before the actual execution of the function chain, reducing the possibility of invalid calls or execution anomalies during the operation of the function chain and improving the executability of the generated intelligent agent function chain.
[0017] This invention identifies the minimum set of unmet conditions that cause verification failure when a candidate function chain fails pre-execution verification. By combining this with corresponding evidence anchors to locate missing fields, unmet conditions, conflicting constraints, and their sources, it improves the interpretability of verification failure results. It generates targeted clarification information for missing or ambiguous requirement data and repairs candidate function chains locally for function incompatibilities, call order conflicts, or function contract conflicts. This preserves function modules and dependencies unaffected by verification failures, reducing the reasoning and computational overhead of regenerating and repeatedly verifying the entire function chain, thus improving the stability and efficiency of the function chain repair process.
[0018] Furthermore, this invention constructs and verifies the functional chain based on the relationships between demand nodes, function modules, and function contracts, and its processing mechanism does not depend on specific business scenarios. After replacing the corresponding function libraries, contract libraries, and domain knowledge, it can be applied to different business scenarios such as material supply chain, power grid planning, and audit supervision, demonstrating good scalability and reusability. Attached Figure Description
[0019] Figure 1 This is a flowchart of the heterogeneous demand-driven intelligent agent function chain construction and contract verification method of the present invention. Figure 2 This is a schematic diagram of the overall architecture of the heterogeneous demand-driven intelligent agent function chain construction and contract verification method of the present invention; Figure 3 This is a schematic diagram of the heterogeneous demand-driven intelligent agent functional chain construction and contract verification system of the present invention. Figure 4 This is a schematic diagram of an electronic device structure according to the present invention. Detailed Implementation
[0020] This invention provides a method for constructing functional chains and verifying contracts for intelligent agents driven by heterogeneous requirements. Building upon the existing process of "heterogeneous requirement input—requirement graph construction—function matching—candidate chain generation—contract verification—clarification or partial repair—executable chain output," it further establishes a processing chain of "multi-source requirement evidence access—evidence anchoring and requirement constraint graph construction—function contract registration—contract-aware candidate matching—candidate functional chain search and pruning—dynamic state propagation and two-level verification—failure location and partial repair—tracing output and optional result write-back." This method is executed within a computer system and involves the structured transformation of requirement data, graph data construction, function pattern matching, candidate chain search, symbolic state set update, conditional expression verification, and execution plan output.
[0021] This invention comprises four core mechanisms: (1) Multi-source demand evidence anchoring and demand constraint graph construction mechanism: inputs such as natural language, standard documents, tables, charts, images, and logs are standardized into demand evidence units, and target, entity, constraint, time, data and intent nodes are extracted. Relationships such as need, constraint, precedence, consumption, generation and reference are established, and the source type, version and original location index are retained in the nodes. (2) Function Contract Registration and Contract-Aware Candidate Matching Mechanism: The input / output patterns, preconditions, postconditions, permissions, timing, resources, and exception rules of functions are registered. Permission constraints, timing constraints, and resource constraints are encoded in the preconditions, postconditions, or exception rules according to their effective stage. Requirement nodes are mapped to corresponding function fields and contract terms. Candidate matching considers semantics, knowledge association, input / output compatibility, and hard constraint conflicts. (3) Candidate function chain search and two-level verification mechanism: In the candidate function chain search stage, a candidate function dependency graph is constructed based on the requirement dependency, function input and output compatibility relationship and contract hard constraints. Only coarse-grained input and output coverage check and path pruning are performed to form candidate chains. Then, the candidate chains are first subjected to function-level static contract verification and then chain-level dynamic symbol state propagation verification to check the input completeness, preconditions, postconditions and abnormal rules. (4) Failure location, local repair and retrospective write-back mechanism: Locate the smallest unmet condition set M from the first failed chain edge or failed function, and only perform repair actions such as replacement function, addition of transformation function or adjustment of order within the restricted neighborhood, and select the minimum cost scheme according to the repair cost; finally output the executable function chain, contract version and four-level traceability record of "requirement evidence - requirement node - function field / contract clause - verification / execution result".
[0022] To better understand the present invention, the following description, in conjunction with the accompanying drawings and embodiments, will further illustrate the content of the present invention.
[0023] Example 1: A heterogeneous demand-driven method for constructing functional chains and verifying contracts of intelligent agents, such as... Figure 1 As shown, it includes: Step 1: Construct a heterogeneous demand constraint graph based on the acquired multi-source demand information, and establish evidence anchor points between the demand nodes in the heterogeneous demand constraint graph and the original demand locations; Step 2: Based on the heterogeneous requirement constraint graph and the pre-registered function contracts, match and orchestrate the function modules in the preset function library to generate candidate function chains; Step 3: Propagate the available variable status according to the function call order in the candidate function chain, and perform pre-execution verification on the candidate function chain based on the input available status before the execution of each function module and the function contract; Step 4: When the candidate function chain fails the pre-execution verification, determine the minimum unmet condition set that caused the verification failure, update and repair the candidate function chain according to the evidence anchor point corresponding to the minimum unmet condition set, and re-perform the pre-execution verification of the updated and repaired candidate function chain, and output the executable function chain that passed the verification.
[0024] Among them, the function contract is used to characterize the input and output requirements and execution conditions of the function module.
[0025] Specifically, a heterogeneous requirement graph with source identifiers is constructed to express goals, entities, constraints, time, data, and intents from different sources in a unified graph structure, while preserving the path back to the original content; a requirement-function matching mechanism combining hard feasibility filtering and multi-dimensional joint scoring is established to consider input-output patterns and business constraints simultaneously before and after semantic recommendation; a traceable binding relationship is established between requirement nodes, function fields, and contract terms, so that each input, precondition, and postcondition can explain its requirement basis; a symbolic pre-execution verification of candidate function chains is performed on a function-by-function basis through a dynamic set of available variable states to reject chains with missing inputs, incorrect order, or unsatisfied contracts in advance; when verification fails, the minimum unsatisfied condition set M is extracted to form targeted clarification issues or modify only the affected local function chains, reducing global regeneration.
[0026] In this embodiment, during the step of constructing a heterogeneous demand constraint graph and establishing evidence anchors based on multi-source demand information in step 1, since demand information from different sources may differ in field names, units of measurement, time expressions, and entity references, the multi-source demand information can be standardized first, retaining the demand content before and after standardization and its original source, in order to improve the accuracy of nodes and node relationships in the heterogeneous demand constraint graph. Specifically, this includes: Based on the acquired multi-source demand information, the multi-source demand information is subjected to field name unification, unit conversion, time expression normalization and cross-source entity alignment to obtain multiple demand evidence units. Record the source type, source identifier, version information, source location, timestamp, original value, and standardized value of each requirement evidence unit, and establish evidence anchor points between each requirement evidence unit and the corresponding original requirement location; The target node, entity node, constraint node, time node, data node, and intent node are extracted from the requirement evidence unit to obtain the requirement node; Based on the business relationships between different demand nodes, establish at least one of the following node relationships: demand relationship, constraint relationship, prior relationship, consumption relationship, generation relationship and referential relationship. Then, associate each demand node with the corresponding evidence anchor point to obtain a heterogeneous demand constraint graph.
[0027] Specifically, the system parses the received multi-source requirement information, mapping fields with the same meaning but different names to unified field names, converting data expressed in different units of measurement to a unified measurement standard, converting relative time, absolute time, and time intervals into a unified time expression format, and aligning entities from different sources that indicate the same business object. After normalization, information that can independently represent a requirement and locate the original requirement is divided into requirement evidence units, and their source type, source identifier, version information, source location, timestamp, original value, and standardized value are recorded respectively. The system extracts target nodes, entity nodes, constraint nodes, time nodes, data nodes, and intent nodes based on the content represented by the requirement evidence units, and establishes corresponding node relationships based on the business dependencies, constraints, time sequence, data input / output, and referential information between each node. Each requirement node is also associated with the evidence anchor point corresponding to its source requirement evidence unit, thus forming a heterogeneous requirement constraint graph that can both represent the requirement content and its interrelationships and locate the basis of the original requirement.
[0028] In one specific embodiment, receiving service requirement input... ,in For the input set of multi-source business requirements, For natural language or canonical document text, For tables, metrics, and other structured / semi-structured data, For logs or event sequences, Provides features for charts, image summaries, or graphs. Performs character cleaning, field naming standardization, unit conversion, time expression normalization, and cross-source entity alignment on various inputs, and records the source type, file / table name, version, field or sentence position, timestamp, original value, and normalized value for each normalized requirement evidence unit.
[0029] Construct the heterogeneous requirement constraint graph shown in formula (1). The node type set includes objectives, entities, constraints, time, data, and intents; the edge type set includes needs, constraints, precedence, consumption, generation, and reference. In addition to semantic representation, each node is also bound to a source evidence identifier; when constraints from different sources conflict with each other, the conflict evidence and its source are retained, rather than being directly overwritten during the graph construction phase. Edges are jointly inferred based on language dependencies, temporal expressions, field references, input-output relationships, and business rules.
[0030] (1) in, This is a heterogeneous demand constraint diagram. For the set of demand nodes, For the set of demand edges, and These are node type mappings and edge type mappings, respectively. It is represented by nodes; each node simultaneously stores the source type and the original location identifier.
[0031] In this embodiment, during step 2, which involves matching and orchestrating dependencies between function modules based on heterogeneous requirement constraint diagrams and function contracts, the heterogeneous requirement constraint diagram describes business requirements and their relationships, while the preset function library registers callable function modules. Since they use different descriptive methods, they cannot directly form an executable call flow. Therefore, requirement nodes can be converted into inputs, outputs, and execution requirements that function modules can recognize through contract binding relationships. These requirements are then combined with the relationships between requirement nodes and the data connection relationships between function modules to sort and combine them, thereby converting structured requirements into a candidate function chain with a clear calling order. Specifically, this includes: Based on the function contracts corresponding to each function module in the preset function library, a contract binding relationship is established between the requirement nodes and function modules in the heterogeneous requirement constraint graph. Based on the contract binding relationship, candidate function modules matching each requirement node are determined from the preset function library; Based on the node relationships in the heterogeneous requirement constraint graph and the input-output connection relationships between candidate function modules, the candidate function modules are sorted and combined to generate a candidate function chain.
[0032] Specifically, the preset function library registers multiple function modules that can perform different processing functions. Each function module has a corresponding function contract that describes its input requirements, output results and execution conditions.
[0033] The system analyzes the requirement data, processing objectives, and constraints represented by each requirement node in the heterogeneous requirement constraint diagram, and establishes a correspondence between them and the input fields, output fields, and contract terms of the function module to form a contract binding relationship.
[0034] Based on this, the system retrieves function modules from a pre-defined function library that can complete the corresponding processing tasks according to the fields and execution requirements of each requirement node, forming candidate function modules. Subsequently, based on the sequential relationships, data requirement relationships, and data generation relationships between requirement nodes in the heterogeneous requirement constraint diagram, as well as the input-output connection relationships between different candidate function modules, the system determines the calling dependencies between candidate function modules, sorts and combines the candidate function modules, and generates one or more candidate function chains.
[0035] In one specific embodiment, before matching function modules, the function modules and their contracts can be structurally registered, as shown in formula (2). In addition to function descriptions, input modes, and output modes, the contract records preconditions, postconditions, permissions, timing, resource requirements, and exception rules; among these, permission constraints, timing constraints, and resource constraints are encoded in the preconditions according to their effective stage. Postconditions Or exception handling rules In this context, no separate contract component is established. The above conditions are expressed using structured expressions that can be determined by the rule engine, expression interpreter, or symbolic execution module.
[0036] (2) in, For the first in the function library A function module, For function module indexing; For function description, For input mode, For output mode, For function contracts; , and These represent the preconditions, postconditions, and exception handling rules, respectively.
[0037] In this embodiment, during the step of matching function modules in the preset function library, the function modules may lack required inputs, be incompatible with the data types of the upstream output, or lack the necessary permissions and resources for execution. Therefore, a hard feasibility filter can be performed on the function modules based on the contract binding relationship first, and then the filtered function modules can be scored for their suitability. This avoids including uncallable function modules in the candidate range and improves the matching degree between the candidate function modules and the requirements and execution environment. Specifically, this includes: Based on the contract binding relationship, determine the function modules that have established contract binding relationships with each demand node, as well as the input fields, output fields, and contract terms in the function modules that correspond to the demand nodes and are used to characterize the execution conditions of the function modules; Based on the multi-source demand information, the data nodes in the heterogeneous demand constraint diagram, and the output fields that can be provided by other function modules, the function modules are subjected to hard feasibility filtering, and function modules that meet the preset hard feasibility conditions are retained to obtain candidate function modules. The candidate function modules are scored based on at least two of the following: semantic adaptability, input-output compatibility, constraint satisfaction, and historical execution success rate or simulation execution success rate, and the candidate function modules are determined accordingly. Among them, the hard feasibility conditions include that the required input fields of the function module can be provided, the input and output data types are compatible with each other, and the permission constraints, timing constraints and resource constraints corresponding to the contract terms are met.
[0038] Specifically, the system determines the function modules associated with each requirement node based on the contract binding relationship, and reads the required input fields, output fields, and contract terms of the corresponding function modules.
[0039] For each function module, the system queries whether its required input fields can be assigned values by data nodes in multi-source requirement information, heterogeneous requirement constraint diagrams, or output fields provided by other function modules; for input fields that need to receive output from other function modules, the system compares whether the data types, data formats, and value requirements of the corresponding input fields and output fields are compatible; at the same time, the system compares the requirement constraints represented by the requirement nodes with the contract terms to determine whether the current execution environment meets the corresponding permission requirements, call sequence requirements, and resource requirements.
[0040] For any function module that fails to meet any hard feasibility condition, it is removed from the matching pool. For the candidate function modules that pass the hard feasibility filter, a comprehensive score is further calculated based on their semantic fit with the requirement node, the degree of input-output connectivity, the degree of requirement constraint satisfaction, and the success rate of historical or simulation execution. The candidate function modules for subsequent dependency orchestration are determined according to the scoring results.
[0041] In a specific embodiment, for the requirement graph nodes and function modules, hard conflict pruning is first performed to determine whether the required inputs can be provided by the requirement evidence, requirement graph data nodes, or other candidate function supply outputs, whether the data types are consistent, and whether the permissions, time limits, resources, and business hard constraints are met; the pruned functions are jointly scored according to formula (3), and the Top-ranked functions are selected based on a comprehensive evaluation of semantic adaptation, knowledge association, input-output compatibility, constraint satisfaction, and historical execution. Primary and alternative functions, where Reserve a number of predefined candidate functions and establish a binding record for requirement nodes, function fields, and contract terms.
[0042] (3) in, The overall matching score between the requirement element and the function module. Indexing for required elements, For function module indexing; Indicates semantic similarity. Indicates the degree of knowledge relevance. Indicates input / output compatibility. Indicates the degree of constraint satisfaction. Indicates the first The historical or simulation execution success rate of each function module; , , , and These are the non-negative weights of the five indicators mentioned above, and their sum is 1. Hard feasibility filtering is performed before joint scoring to avoid selecting uncallable functions based solely on semantic similarity.
[0043] For functions in the candidate chain The matching score corresponding to one or more demand nodes bound to it will be used. The results are synthesized according to preset aggregation rules to obtain a function-level comprehensive matching score. , for use in formula (4). Aggregation rules can be weighted summation, arithmetic mean or maximum value, and should be consistent within the same functional chain search task.
[0044] In this embodiment, during the process of performing dependency orchestration on candidate function modules and generating candidate function chains, the same requirement node may correspond to multiple candidate function modules, and different candidate function modules may form various input-output combinations. If all combinations are searched directly, a large number of invalid paths with incomplete inputs, incompatible types, or failure to meet function contracts will be generated. Therefore, a candidate function dependency graph can be constructed first, and invalid paths can be pruned. Then, the remaining paths can be searched and sorted to narrow down the function chain search range and improve the generation efficiency and execution feasibility of candidate function chains. Specifically, this includes: Based on the prior, demand, consumption, and production relationships in the heterogeneous demand constraint graph, as well as the input-output connection relationships between different candidate function modules, a candidate function dependency graph is constructed. Based on the coverage of required inputs, the compatibility of input and output data types, and the satisfaction of function contracts, the function paths in the candidate function dependency graph are pruned. The function paths retained after pruning are searched and their call order is arranged to generate multiple candidate function chains. The multiple candidate function chains are then sorted according to function matching results, dependency violations, missing inputs, and contract violations.
[0045] Specifically, the system treats candidate function modules as function nodes in the candidate function dependency graph. Based on the precedence, requirement, consumption, and production relationships in the heterogeneous requirement constraint graph, it determines the order and data dependencies of each function node in the business processing. Simultaneously, it compares the input and output fields of different candidate function modules. When the output of one candidate function module can provide input for another, and the calling order of the two conforms to the node relationships between corresponding requirement nodes, a directed dependency edge is established between them.
[0046] After constructing the candidate function dependency graph, check the coverage of required inputs in each function path, the data type compatibility of inputs and outputs of adjacent function modules, and the satisfaction of relevant function contracts, and delete function paths with deterministic missing values or conflicts. For the function paths retained after pruning, perform path searching and call order sorting to form multiple candidate function chains. Then, determine the order of the candidate function chains based on the function matching results and the dependency violations, missing inputs, and contract violations present in each candidate function chain.
[0047] In one specific embodiment, a candidate function dependency graph is established based on the prior, required, consumed, and generated relationships in the demand graph, as well as the input-output compatibility relationships and contract constraints between functions. During the search phase, contract hard gating and coarse-grained input-output coverage checks are employed to prune paths that clearly cannot form valid chains due to missing mandatory inputs, incompatible data types, or hard constraint conflicts. Then, candidate function chains are formed through graph search, bundle search, heuristic search, or topological sorting, and sorted according to formula (4). This phase only involves candidate chain construction and coarse-grained pruning, without maintaining the dynamic state set defined in formula (5).
[0048] (4) in, To obtain the optimal functional chain according to formula (4), Represents any candidate functional chain. For the set of candidate functional chains; The length of the candidate functional chain. For the position index of the function within the chain, Indicates the first in the candidate chain The function index corresponding to each position The function-level comprehensive matching score is obtained according to the aforementioned aggregation rules. For candidate chains The penalties in the middle are formed by dependency violations, missing inputs, and contract violations. This is a non-negative penalty coefficient.
[0049] In this embodiment, during step 3, which involves propagating the available variable state according to the function call order and performing pre-execution verification of the candidate function chain, simply confirming that the candidate function chain as a whole contains a certain input field does not guarantee that the input field was generated before the corresponding function module was called. Therefore, the available variable state can be dynamically updated according to the actual call order, and the input and function contract of the current function module can be verified one by one to detect problems such as incorrect input generation timing, conflicting function call order, or unmet execution conditions before the function chain actually runs. Specifically, this includes: Initialize the available variable state set with the multi-source demand information, the data nodes in the heterogeneous demand constraint diagram, and the available business context; According to the function call order in the candidate function chain, determine in turn whether all inputs of the current function module are included in the set of available variable states before the execution of the current function module, and verify the function contract corresponding to the current function module; When the current function module passes the verification, the output of the current function module is added to the available variable state set, and the next function module is then verified. When the current function module fails verification, the first function module or function dependency edge that fails verification in the candidate function chain is determined, and the corresponding verification failure type and associated fields are recorded. Starting from the function module or function dependency edge that fails verification, the candidate function dependency graph and the contract binding relationship are traversed in reverse to remove conditions that have been met or are unrelated to verification failure, and the minimum set of unmet conditions is obtained. The minimum set of unsatisfied conditions includes at least one of the following: missing input, false preconditions, conflicting execution order, incompatible input and output, and conflicting requirement constraints.
[0050] Specifically, the system adds directly usable data from multi-source demand information, data nodes from heterogeneous demand constraint diagrams, and variables from the current available business context to the initial available variable state set. Then, it selects function modules sequentially according to the calling order determined by the candidate function chain. Before calling each current function module, it checks whether all the inputs required by that function module already exist in the current available variable state set, and checks whether the current variable state and execution environment satisfy the function contract corresponding to that function module.
[0051] When the current function module passes validation, its expected output is added to the available variable state set as a variable that can be used in subsequent steps, and validation continues for the next function module. When the current function module fails validation, the propagation of state stops, and the first function module or function dependency edge that fails validation, the validation failure type, and associated fields are recorded. Starting from this failure position, the system searches backward along the candidate function dependency graph and contract binding relationship to find the input sources, requirement nodes, and constraints related to the failure result, and excludes conditions that are already met or will not affect the current validation result, obtaining the minimum set of unsatisfied conditions consisting of missing inputs, invalid preconditions, order conflicts, type incompatibility, or requirement constraint conflicts.
[0052] In one specific embodiment, the candidate chains obtained in the aforementioned steps undergo two levels of verification. The first level is function-level static contract verification, which checks whether contract terms such as input / output patterns, preconditions, postconditions, permissions, timing, and resources are satisfied. The second level is chain-level dynamic symbol verification, which initializes the chain with user input, requirement graph data nodes, and available business context. . The initial set of available variable states for symbolic deduction before execution; obtained step by step according to formula (5). Each variable state includes at least a field identifier, data type, source, and currently identifiable value range or constraint state. Then, according to formula (6), check the input completeness, preconditions, and postconditions of each function when symbolic derivation reaches the corresponding step, and verify whether there is a corresponding processing path for the exception rules.
[0053] (5) (6) In equation (5), This indicates that the symbol derivation before execution has reached the [number]th [number]. The set of available variable states obtained after the step. Symbolic deduction of the first The set of available variable states prior to each function Indicates the first in the candidate chain The output pattern of each function; in equation (6), This indicates the input mode of the function. This indicates the preconditions for the function. This indicates the postcondition of the function. This means that all required input must be available before execution. This indicates that the precondition is met. This indicates that the postcondition can be determined at the symbol level or schema level based on the field type, source, value range, or constraint status.
[0054] This verification method can identify errors where a field exists in the entire chain but has not yet been generated in the current execution step, or where a field exists but its value range or state does not satisfy the contract.
[0055] If verification fails, record the first failing function or the first failing chain edge, the failure check type, and related fields. Starting from the failing field, failing edge, or unmet condition, traverse backwards on the function dependency graph and the requirement-function-contract binding graph, eliminating satisfied or irrelevant conditions to obtain the minimum set of unmet conditions necessary to eliminate the failure. . It may include one or more of the following: missing input, unmet preconditions, execution order conflict, incompatible input / output, or conflicting business constraints; and will be based on the binding record. Each element in the process traces back to one or more requirement nodes and the location of the original evidence.
[0056] In this embodiment, during step 4, which involves updating the candidate function chain based on the minimum unmet condition set and re-performing pre-execution verification, the processing methods required for different verification failure reasons differ. Furthermore, when a single function module or local dependency has a problem, it is not necessary to regenerate the entire candidate function chain. Therefore, demand-side problems and function-side problems can be distinguished based on the minimum unmet condition set, and targeted clarification or local function chain repair can be performed respectively. Simultaneously, the result with lower repair cost can be selected based on the repair scope and additional call volume, thereby reducing the computational resource consumption caused by repeated chain construction and verification, and maintaining the stability of unaffected chain segments. Specifically, this includes: When the minimum unsatisfied condition set corresponds to missing requirement data and / or ambiguity in requirement content, directional clarification information is generated based on the corresponding evidence anchor point, and the heterogeneous requirement constraint graph and the contract binding relationship are updated based on the received supplementary requirement information. When the minimum unsatisfied condition set corresponds to function incompatibility, execution order conflict and / or function contract conflict, within the local scope consisting of the function module that failed verification and its associated function modules, function module replacement, data conversion function insertion, function call order adjustment and / or redundant function deletion are performed. Based on the scope of function chain modification, the number of additional function calls, and the elimination of unmet conditions, the repair cost corresponding to each local repair result is determined, and the local repair results whose repair costs meet the preset conditions are used to re-perform the pre-execution verification. Output the function call order, function parameter binding relationship and function contract version corresponding to the re-verified executable function chain, and establish a traceability record between the original requirement location, evidence anchor point, requirement node, function field or contract terms and the verification result.
[0057] Specifically, the system categorizes the conditions in the smallest unsatisfied condition set.
[0058] When a condition is not met due to missing requirement data or ambiguity in the expression of the requirement, the original requirement location is located based on the evidence anchor point associated with the condition, and targeted clarification information is generated around the missing or ambiguous content; after receiving supplementary requirement information, the corresponding requirement nodes, node relationships and contract binding relationships are updated.
[0059] When the failure to meet the conditions is caused by incompatible function modules, conflicting function call order, or conflicting function contracts, the function module that failed verification and its directly dependent function modules are identified. This scope is designated as the local repair scope, and within this scope, function module replacement, data conversion function insertion, function call order adjustment, or redundant function deletion are performed.
[0060] For different local repair results, the repair cost is determined based on the scope of the modified function chain, the number of additional function calls, and the degree of elimination of the minimum unmet conditions. Local repair results that meet the preset repair cost conditions are then selected for re-verification before execution. Upon successful verification, the function call order, parameter binding relationships, and function contract versions of the executable function chain are output. The verification results are then associated with the corresponding function fields or contract terms, requirement nodes, evidence anchors, and the original requirement location, forming a traceable record spanning the requirement source, function chain construction, and verification results.
[0061] In one specific embodiment, when When dealing with data not provided by the user or ambiguous constraints, generate data that is only applicable to... A targeted clarification request; when When failure is caused by incompatible function inputs and outputs, unreasonable execution order, or contract conflicts, repair actions are generated only within the failed function and its affected restricted neighborhood. These actions include selecting alternative functions, adding transformation functions, adjusting the order, or deleting redundant functions. The minimum cost repair solution is selected based on the scope of modification, the number of additional calls, and the degree of constraint recovery. After completion, the process flows back to the re-search step and the pre-execution verification step is executed again.
[0062] The output includes a verified executable function chain, parameter bindings for each function, execution order, contract version, and verification results. Simultaneously, a four-level traceability record is generated: "Requirement Evidence—Requirement Node—Function Fields / Contract Terms—Verification / Execution Results." This completes the function chain construction and pre-execution verification. The function chain can then be converted into a workflow definition, function call sequence, or agent execution plan, and executed by the execution engine. The execution results returned by the execution engine serve as optional feedback information and can be written back to the corresponding requirement node and source evidence according to the aforementioned four-level traceability relationship for subsequent verification, updates, or chain reconstruction.
[0063] The present invention has the following beneficial effects: (1) Improve the structural integrity and traceability of multi-source demand information. By retaining the source location of nodes, function parameters and contract conditions can be traced back to the original sentences, fields, logs or chart features, which facilitates review by business personnel; (2) Reduce the selection of functions that are semantically correct but unusable in execution. Hard feasibility filtering excludes functions with missing input, inconsistent types, or that violate hard constraints before joint scoring, reducing invalid candidates; (3) Move function chain errors forward to be detected before execution. Dynamic availability variable state propagation can identify inputs that "exist globally but are not available in the current step" and "fields exist but the current value domain or state does not meet the contract". Combined with precondition and postcondition checks, it improves the executability of the function chain; (4) Improve the interpretability and stability of failure handling. The minimum unmet condition set M can clearly indicate which fields are missing, which condition is not met, or which type of constraint is conflicting, and trace back to the source of the requirement, avoiding a general return of failure; (5) Reduce global regeneration. Functions that have passed verification remain unchanged, and repairs are only performed on failed functions and affected successor subgraphs, which reduces the overhead of repeated inference and repeated verification; (6) It has cross-scenario reuse capability. The function library, contract library and domain knowledge base are replaceable, and the core requirement graph, binding, verification and backtracking mechanism can be used in scenarios such as material supply chain, power grid planning, audit supervision.
[0064] Example 2: The invention will now be described in detail using the construction of a specific emergency replenishment and procurement function chain as an example.
[0065] First, the business personnel input: "Based on the current inventory and the requisition trend over the past three months, develop an emergency replenishment plan for Class A transformers, prioritizing suppliers that can deliver within two weeks, and complete the approval and transportation arrangements." The system simultaneously receives the inventory table, historical requisition table, supplier delivery records, and logistics anomaly logs.
[0066] (1) S1: The system normalizes the natural language, inventory table, requisition table and logistics log. The "Available Quantity" field in the inventory table is marked as the source of the data node, "within two weeks" in the text is normalized to a delivery time limit of ≤14 days, and delay events in the logistics log form anomaly constraints.
[0067] (2) S2: Generate target node “form and execute replenishment plan”, entity node “Class A transformer, supplier, warehouse”, data node “current inventory, usage quantity, supplier capacity”, constraint node “delivery time limit ≤ 14 days, priority delivery supplier”, time node “last three months”, and establish relationships such as “usage data precedes demand forecast”, “demand forecast generates replenishment quantity”, and “delivery time limit constrains supplier selection”.
[0068] (3) S3-S4: The function library includes inventory query, demand forecast, supplier screening, procurement approval, transportation scheduling and warehousing registration. The system first excludes candidate functions that lack supplier capacity input or only output text descriptions, and then scores them based on semantics, knowledge association, input and output and constraint satisfaction.
[0069] (4) S5: Generate candidate chain "Inventory Inquiry → Demand Forecast → Supplier Screening → Procurement Approval → Transportation Scheduling → Warehousing Registration". The replenishment quantity output by the demand forecast function is bound to the quantity input of the supplier screening function; the delivery time limit constraint is bound to the preconditions of the supplier screening.
[0070] (5) S6: Perform symbolic deduction on the candidate chain before execution. When verifying the transportation scheduling function, it was found that the required input "destination warehouse loading and unloading time window" was not present. middle.
[0071] (6) S7: The system extracts the minimum set of unsatisfied conditions. The content is "Destination warehouse loading and unloading time window"; after backtracking, it was found that neither the natural language nor the inventory table provides this field.
[0072] (7) S8: The system generates a targeted clarification: "Please confirm the date on which the destination warehouse can receive the goods and the daily loading and unloading time; the remaining steps of the current function chain have been verified." After the user adds "working days 9:00-16:00", only the transportation scheduling function parameters are updated and re-verified, and the aforementioned function is not regenerated.
[0073] (8) S9: Output complete executable function chain, parameter binding and source traceability record.
[0074] Example 3: The invention will be described in detail below using the construction of a specific audit abnormal transaction verification function chain as an example.
[0075] First, business personnel input: "Check for abnormal payments from high-risk suppliers this quarter, linking contracts, approval records, and invoices to form a traceable audit evidence chain and verification report." The system simultaneously receives transaction tables, contract ledgers, approval logs, and risk lists.
[0076] (1) S1-S2: Construct the target node "form audit verification report", entity nodes "supplier, contract, payment, invoice, approver", constraint nodes "this quarter, high-risk supplier, traceable evidence", data nodes "transaction table, contract ledger, approval log, risk list", and establish relationships such as payment pointing to contract, contract constraining invoice, and approval log being generated before the report.
[0077] (2) S3-S5: Candidate functions include risk list screening, abnormal transaction detection, contract association, approval chain verification, invoice consistency verification, evidence encapsulation, and report generation. The system binds "evidence traceability" as a prerequisite for the report generation function: each abnormality must have transaction records, contract / invoice association results, and approval chain records.
[0078] (3) S6: The first candidate chain arranges "report generation" before "approval chain verification". Before execution, the dynamic symbol state propagation finds that the approval evidence fields required by the report generation function have not yet entered the available variable state set. The precondition is not met, and the candidate chain is rejected.
[0079] (4) S7-S8: The system backtracking found that there was an edge in the requirement diagram that "approval log is generated before report generation", so the approval chain verification function was moved before the report generation; if a payment record is missing a contract number, then only for that record, a clarification is initiated: "Please select the corresponding contract or explain that there is no contract basis for payment".
[0080] (5) S9: The final output is a verified check chain, and each conclusion in the report is accompanied by the original transaction line number, contract number, invoice number and approval log event identifier.
[0081] Example 4: This embodiment uses, as follows: Figure 2 The overall architecture diagram shown illustrates the relationship between multi-source demand evidence access, evidence anchoring and demand constraint graph construction, function contract registration, contract-aware candidate matching, candidate function chain search and pruning, dynamic state propagation and two-level verification, failure location and local repair, and trace output and optional result write-back. In Example 1, formulas (5) and (6) respectively describe the core computational rules of dynamic symbolic state propagation and chain-level contract verification before execution.
[0082] The components and their numbers are as follows: (1) A module for receiving more than 100 sources of demand evidence, used to receive text and specification documents, tables and charts, images and logs, and record version and location index; (2) 200 Evidence Anchoring and Demand Constraint Graph Construction Module, used for element extraction, constraint typification, source evidence anchoring and conflict evidence retention; (3) 300 Function Contract Registration Module, used to register function input and output modes, preconditions and postconditions, permissions, timing, resources and exception rules, wherein the permissions, timing and resource constraints are encoded into preconditions, postconditions or exception rules according to the effective stage; (4) 400 Contract-Aware Candidate Matching Module, used for semantic adaptation, knowledge association, input-output compatibility evaluation and hard conflict pruning; (5) 500 Candidate Function Chain Search and Pruning Module, used to construct candidate function dependency graphs, perform coarse-grained input / output coverage checks, candidate chain search and sorting, and path pruning; (6) 600 Dynamic State Propagation and Two-Level Verification Module, used to perform function-level static contract verification, chain-level dynamic symbolic state propagation and contract verification, and generate verification results; (7) 700 Failure Location and Local Repair Module, used to locate the first failed function or failure chain edge, extract the minimum unsatisfied condition set M, generate restricted neighborhood repair actions and select repair scheme; (8) 800 Traceability Output and Optional Result Write-back Module, used to output the executable function chain, contract version and four-level traceability record of "requirement evidence - requirement node - function field / contract clause - verification / execution result"; after the execution engine actually runs, the returned execution result can be written back to the corresponding requirement node and source evidence as optional feedback information.
[0083] It should be noted that the extraction of demand elements can be achieved by a large language model, a sequence labeling model, a rule engine, or a combination thereof; this invention does not limit the specific model.
[0084] The requirement graph can be stored in a graph database, a relational database's chart structure, or an in-memory graph structure; node representation can use vector concatenation, attention fusion, or rule encoding.
[0085] Function contracts can be represented using JSON Schema, domain-specific languages, regular expressions, logical formulas, or program assertions.
[0086] Candidate chain search can employ beam search, heuristic search, and A... Dynamic programming, constraint solving, or greedy strategies based on topological sorting can be used.
[0087] The minimum unsatisfied condition set M can be achieved through reverse slicing, minimizing conflict sets, dependency graph backtracking, or constraint solvers.
[0088] Targeted clarification can be accomplished through natural language questions, structured forms, or field selectors; local fixes may include replacing functions, adding data transformation functions, rearranging order, or removing redundant functions.
[0089] The executable function chain can output as a workflow definition, function call JSON, BPMN, DAG plan, or a list of tasks to be executed by multiple agents.
[0090] Example 5: Based on the same inventive concept, this invention also provides a heterogeneous demand-driven intelligent agent functional chain construction and contract verification system, such as... Figure 3 As shown, it includes: The construction module is used to construct a heterogeneous demand constraint graph based on the acquired multi-source demand information, and to establish evidence anchor points between the demand nodes in the heterogeneous demand constraint graph and the original demand locations. The matching module is used to match and orchestrate the function modules in the preset function library based on the heterogeneous requirement constraint diagram and the pre-registered function contracts, and generate candidate function chains. The function contracts are used to characterize the input and output requirements and execution conditions of the function modules. The verification module is used to propagate the available variable status according to the function call order in the candidate function chain, and to perform pre-execution verification of the candidate function chain based on the input available status before the execution of each function module and the function contract; The output module is used to determine the minimum unmet condition set that caused the verification failure when the candidate function chain fails the pre-execution verification, update and repair the candidate function chain according to the evidence anchor point corresponding to the minimum unmet condition set, re-perform the pre-execution verification of the updated and repaired candidate function chain, and output the executable function chain that passed the verification.
[0091] Preferably, the construction module constructs a heterogeneous demand constraint graph based on the acquired multi-source demand information, including: Based on the acquired multi-source demand information, the multi-source demand information is subjected to field name unification, unit conversion, time expression normalization and cross-source entity alignment to obtain multiple demand evidence units. Record the source type, source identifier, version information, source location, timestamp, original value, and standardized value of each requirement evidence unit, and establish evidence anchor points between each requirement evidence unit and the corresponding original requirement location; The target node, entity node, constraint node, time node, data node, and intent node are extracted from the requirement evidence unit to obtain the requirement node; Based on the business relationships between different demand nodes, establish at least one of the following node relationships: demand relationship, constraint relationship, prior relationship, consumption relationship, generation relationship and referential relationship. Then, associate each demand node with the corresponding evidence anchor point to obtain a heterogeneous demand constraint graph.
[0092] Preferably, the matching module is specifically used for: Based on the function contracts corresponding to each function module in the preset function library, a contract binding relationship is established between the requirement nodes and function modules in the heterogeneous requirement constraint graph. Based on the contract binding relationship, candidate function modules matching each requirement node are determined from the preset function library; Based on the node relationships in the heterogeneous requirement constraint graph and the input-output connection relationships between candidate function modules, the candidate function modules are sorted and combined to generate a candidate function chain.
[0093] Preferably, the matching module determines candidate function modules that match each requirement node from the preset function library based on the contract binding relationship, including: Based on the contract binding relationship, determine the function modules that have established contract binding relationships with each demand node, as well as the input fields, output fields, and contract terms in the function modules that correspond to the demand nodes and are used to characterize the execution conditions of the function modules; Based on the multi-source demand information, the data nodes in the heterogeneous demand constraint diagram, and the output fields that can be provided by other function modules, the function modules are subjected to hard feasibility filtering, and function modules that meet the preset hard feasibility conditions are retained to obtain candidate function modules. The candidate function modules are scored based on at least two of the following: semantic adaptability, input-output compatibility, constraint satisfaction, and historical execution success rate or simulation execution success rate, and the candidate function modules are determined accordingly. The hard feasibility conditions include that the required input fields of the function module can be provided, the input and output data types are compatible with each other, and the permission constraints, timing constraints, and resource constraints corresponding to the contract terms are met.
[0094] Preferably, the matching module sorts and combines the candidate function modules based on the node relationships in the heterogeneous demand constraint graph and the input-output connection relationships between the candidate function modules to generate a candidate function chain, including: Based on the prior, demand, consumption, and production relationships in the heterogeneous demand constraint graph, as well as the input-output connection relationships between different candidate function modules, a candidate function dependency graph is constructed. Based on the coverage of required inputs, the compatibility of input and output data types, and the satisfaction of function contracts, the function paths in the candidate function dependency graph are pruned. The function paths retained after pruning are searched and their call order is arranged to generate multiple candidate function chains. The multiple candidate function chains are then sorted according to function matching results, dependency violations, missing inputs, and contract violations.
[0095] Preferably, the verification module is specifically used for: Initialize the available variable state set with the multi-source demand information, the data nodes in the heterogeneous demand constraint diagram, and the available business context; According to the function call order in the candidate function chain, determine in turn whether all inputs of the current function module are included in the set of available variable states before the execution of the current function module, and verify the function contract corresponding to the current function module; When the current function module passes the verification, the output of the current function module is added to the available variable state set, and the next function module is then verified. When the current function module fails verification, the first function module or function dependency edge that fails verification in the candidate function chain is determined, and the corresponding verification failure type and associated fields are recorded. Starting from the function module or function dependency edge that fails verification, the candidate function dependency graph and the contract binding relationship are traversed in reverse to remove conditions that have been met or are unrelated to verification failure, and the minimum set of unmet conditions is obtained. The minimum set of unsatisfied conditions includes at least one of the following: missing input, false preconditions, execution order conflict, incompatible input and output, and conflicting requirements constraints.
[0096] Preferably, the output module updates and repairs the candidate function chain based on the evidence anchor points corresponding to the minimum unsatisfied condition set, and re-verifies the updated and repaired candidate function chain before execution, outputting the executable function chain that passes the verification, including: When the minimum unsatisfied condition set corresponds to missing requirement data and / or ambiguity in requirement content, directional clarification information is generated based on the corresponding evidence anchor point, and the heterogeneous requirement constraint graph and the contract binding relationship are updated based on the received supplementary requirement information. When the minimum unsatisfied condition set corresponds to function incompatibility, execution order conflict and / or function contract conflict, within the local scope consisting of the function module that failed verification and its associated function modules, function module replacement, data conversion function insertion, function call order adjustment and / or redundant function deletion are performed. Based on the scope of function chain modification, the number of additional function calls, and the elimination of unmet conditions, the repair cost corresponding to each local repair result is determined, and the local repair results whose repair costs meet the preset conditions are used to re-perform the pre-execution verification. Output the function call order, function parameter binding relationship and function contract version corresponding to the re-verified executable function chain, and establish a traceability record between the original requirement location, evidence anchor point, requirement node, function field or contract terms and the verification result.
[0097] Example 6 like Figure 4As shown, the present invention also provides an electronic device, which may be a computer device, a microcontroller device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, processor, and transceiver component are connected via a bus; the memory can be used to store executable programs, and an exemplary executable program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, which can be accessed and / or modified when instructions are executed.
[0098] The processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, and it is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the storage medium to implement the corresponding method flow or corresponding function, so as to realize the steps of the heterogeneous demand-driven intelligent agent function chain construction and contract verification method in the above embodiments.
[0099] Example 7 Based on the same inventive concept, this invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory). This readable storage medium is a memory device within an electronic device used to store programs and data. It is understood that the storage medium here can include both built-in storage media within the electronic device and extended storage media supported by the electronic device. The storage medium provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more executable programs (including program code). It should be noted that the storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. Loading and executing one or more instructions stored in the storage medium by the processor can implement the steps of the heterogeneous demand-driven intelligent agent function chain construction and contract verification method described in the above embodiments.
[0100] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0101] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0102] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0103] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0104] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.
Claims
1. A method for constructing and verifying functional chains and contracts of intelligent agents driven by heterogeneous requirements, characterized in that, include: Based on the acquired multi-source demand information, a heterogeneous demand constraint graph is constructed, and evidence anchor points are established between the demand nodes in the heterogeneous demand constraint graph and the original demand locations. Based on the heterogeneous requirement constraint diagram and the pre-registered function contracts, the function modules in the preset function library are matched and their dependencies are orchestrated to generate candidate function chains. The function contracts are used to characterize the input and output requirements and execution conditions of the function modules. The available variable status is propagated according to the function call order in the candidate function chain, and the candidate function chain is verified before execution based on the input available status before the execution of each function module and the function contract. When the candidate function chain fails the pre-execution verification, the minimum unmet condition set that caused the verification failure is determined, the candidate function chain is updated and repaired according to the evidence anchor point corresponding to the minimum unmet condition set, and the updated and repaired candidate function chain is re-verified before execution, and the executable function chain that passes the verification is output.
2. The method according to claim 1, characterized in that, The construction of a heterogeneous demand constraint graph based on the acquired multi-source demand information includes: Based on the acquired multi-source demand information, the multi-source demand information is subjected to field name unification, unit conversion, time expression normalization and cross-source entity alignment to obtain multiple demand evidence units. Record the source type, source identifier, version information, source location, timestamp, original value, and standardized value of each requirement evidence unit, and establish evidence anchor points between each requirement evidence unit and the corresponding original requirement location; The target node, entity node, constraint node, time node, data node, and intent node are extracted from the requirement evidence unit to obtain the requirement node; Based on the business relationships between different demand nodes, establish at least one of the following node relationships: demand relationship, constraint relationship, prior relationship, consumption relationship, generation relationship and referential relationship. Then, associate each demand node with the corresponding evidence anchor point to obtain a heterogeneous demand constraint graph.
3. The method according to claim 2, characterized in that, The process of matching and orchestrating dependencies of function modules in a preset function library based on the heterogeneous requirement constraint graph and pre-registered function contracts to generate candidate function chains includes: Based on the function contracts corresponding to each function module in the preset function library, a contract binding relationship is established between the requirement nodes and function modules in the heterogeneous requirement constraint graph. Based on the contract binding relationship, candidate function modules matching each requirement node are determined from the preset function library; Based on the node relationships in the heterogeneous requirement constraint graph and the input-output connection relationships between candidate function modules, the candidate function modules are sorted and combined to generate a candidate function chain.
4. The method according to claim 3, characterized in that, The step of determining candidate function modules matching each requirement node from the preset function library based on the contract binding relationship includes: Based on the contract binding relationship, determine the function modules that have established contract binding relationships with each demand node, as well as the input fields, output fields, and contract terms in the function modules that correspond to the demand nodes and are used to characterize the execution conditions of the function modules; Based on the multi-source demand information, the data nodes in the heterogeneous demand constraint diagram, and the output fields that can be provided by other function modules, the function modules are subjected to hard feasibility filtering, and function modules that meet the preset hard feasibility conditions are retained to obtain candidate function modules. The candidate function modules are scored based on at least two of the following: semantic adaptability, input-output compatibility, constraint satisfaction, and historical execution success rate or simulation execution success rate, and the candidate function modules are determined accordingly. The hard feasibility conditions include that the required input fields of the function module can be provided, the input and output data types are compatible with each other, and the permission constraints, timing constraints, and resource constraints corresponding to the contract terms are met.
5. The method according to claim 3, characterized in that, The process of sorting and combining the candidate function modules based on the node relationships in the heterogeneous demand constraint graph and the input-output connection relationships between candidate function modules to generate a candidate function chain includes: Based on the prior, demand, consumption, and production relationships in the heterogeneous demand constraint graph, as well as the input-output connection relationships between different candidate function modules, a candidate function dependency graph is constructed. Based on the coverage of required inputs, the compatibility of input and output data types, and the satisfaction of function contracts, the function paths in the candidate function dependency graph are pruned. The function paths retained after pruning are searched and their call order is arranged to generate multiple candidate function chains. The multiple candidate function chains are then sorted according to function matching results, dependency violations, missing inputs, and contract violations.
6. The method according to claim 5, characterized in that, The step of propagating the available variable state according to the function call order in the candidate function chain, and performing pre-execution verification of the candidate function chain based on the input available state before the execution of each function module and the function contract, includes: Initialize the available variable state set with the multi-source demand information, the data nodes in the heterogeneous demand constraint diagram, and the available business context; According to the function call order in the candidate function chain, determine in turn whether all inputs of the current function module are included in the set of available variable states before the execution of the current function module, and verify the function contract corresponding to the current function module; When the current function module passes the verification, the output of the current function module is added to the available variable state set, and the next function module is then verified. When the current function module fails verification, the first function module or function dependency edge that fails verification in the candidate function chain is determined, and the corresponding verification failure type and associated fields are recorded. Starting from the function module or function dependency edge that fails verification, the candidate function dependency graph and the contract binding relationship are traversed in reverse to remove conditions that have been met or are unrelated to verification failure, and the minimum set of unmet conditions is obtained. The minimum set of unsatisfied conditions includes at least one of the following: missing input, false preconditions, execution order conflict, incompatible input and output, and conflicting requirements constraints.
7. The method according to claim 6, characterized in that, The step of updating and repairing the candidate function chain based on the evidence anchor points corresponding to the minimum unsatisfied condition set, and re-verifying the updated and repaired candidate function chain before execution, and outputting the verified executable function chain, includes: When the minimum unsatisfied condition set corresponds to missing requirement data and / or ambiguity in requirement content, directional clarification information is generated based on the corresponding evidence anchor point, and the heterogeneous requirement constraint graph and the contract binding relationship are updated based on the received supplementary requirement information. When the minimum unsatisfied condition set corresponds to function incompatibility, execution order conflict and / or function contract conflict, within the local scope consisting of the function module that failed verification and its associated function modules, function module replacement, data conversion function insertion, function call order adjustment and / or redundant function deletion are performed. Based on the scope of function chain modification, the number of additional function calls, and the elimination of unmet conditions, the repair cost corresponding to each local repair result is determined, and the local repair results whose repair costs meet the preset conditions are used to re-perform the pre-execution verification. Output the function call order, function parameter binding relationship and function contract version corresponding to the re-verified executable function chain, and establish a traceability record between the original requirement location, evidence anchor point, requirement node, function field or contract terms and the verification result.
8. A heterogeneous demand-driven intelligent agent functional chain construction and contract verification system, characterized in that, include: The construction module is used to construct a heterogeneous demand constraint graph based on the acquired multi-source demand information, and to establish evidence anchor points between the demand nodes in the heterogeneous demand constraint graph and the original demand locations. The matching module is used to match and orchestrate the function modules in the preset function library based on the heterogeneous requirement constraint diagram and the pre-registered function contracts, and generate candidate function chains. The function contracts are used to characterize the input and output requirements and execution conditions of the function modules. The verification module is used to propagate the available variable status according to the function call order in the candidate function chain, and to perform pre-execution verification of the candidate function chain based on the input available status before the execution of each function module and the function contract; The output module is used to determine the minimum unmet condition set that caused the verification failure when the candidate function chain fails the pre-execution verification, update and repair the candidate function chain according to the evidence anchor point corresponding to the minimum unmet condition set, re-perform the pre-execution verification of the updated and repaired candidate function chain, and output the executable function chain that passed the verification.
9. An electronic device, characterized in that, include: At least one processor and memory; The memory and processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the heterogeneous demand-driven intelligent agent function chain construction and contract verification method as described in any one of claims 1 to 7 is implemented.
10. A readable storage medium, characterized in that, It contains an execution program, which, when executed, implements the heterogeneous demand-driven intelligent agent function chain construction and contract verification method as described in any one of claims 1 to 7.
