Water-saving intelligent agent interactive control method and system based on knowledge-enhanced reasoning
By constructing a water-saving demand intention graph and an enhanced reasoning model, the problems of contextual semantic loss and logical breakage in voice interaction in intelligent water-saving services were solved, thereby improving the accuracy and efficiency of water-saving responses.
Patent Information
- Application Number
- CN202610090784.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2046-01-23
AI Technical Summary
In existing intelligent water-saving services, voice interaction technology cannot effectively connect the semantics of previous tasks when handling complex multi-turn dialogues, resulting in fragmented demand parsing, lack of contextual support in responses, low computational efficiency, difficulty in generating adaptive strategies, and inaccurate water-saving responses and inconsistent logic.
The knowledge-enhanced reasoning-based water-saving intelligent agent interactive control method constructs a water-saving demand intention graph, performs reverse matching and enhanced reasoning model to calculate demand-policy adaptation benefits, generates accurate water-saving response schemes, and provides feedback through the intelligent agent terminal.
It improves the accuracy and scenario adaptability of water-saving strategy recommendations, solves the problems of contextual semantic loss and logical breakage, optimizes system response efficiency, and achieves response accuracy and logical coherence in complex interaction scenarios.
Smart Images

Figure CN121561068B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent water-saving question answering, and particularly relates to a water-saving intelligent agent interactive control method and system based on knowledge-enhanced reasoning. Background Technology
[0002] In the field of intelligent water-saving services, "Water Saving Elf," an intelligent agent developed based on the domestically developed large language model DeepSeek, integrates artificial intelligence and big data analysis technologies. Through human-computer dialogue, it provides users with services such as unit water usage inquiry, intelligent data analysis, water-saving suggestion push, and policy consultation. However, existing voice interaction technologies have significant shortcomings in handling complex multi-turn dialogues in the field of water saving: the water-saving needs involved in continuous user questions have hierarchical relationships and semantic connections, while traditional intelligent agents only respond independently based on the current statement and cannot effectively connect the semantics of previous tasks, resulting in fragmented demand parsing and a lack of contextual coherence in the response; some solutions attempt to splice historical dialogues to form long text inputs, but suffer from low processing efficiency and high computational overhead, and are prone to semantic deviation. At the same time, they lack a structured semantic decomposition mechanism, cannot sort out the logical dependencies between demand elements, and have no dynamic reasoning ability, making it difficult to generate adaptive strategies for uncovered scenarios. Ultimately, this results in inaccurate water-saving response solutions and inconsistent logic, failing to meet the precise service requirements of complex water-saving needs. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention proposes a water-saving intelligent agent interactive control method and system based on knowledge-enhanced reasoning. The method first receives user dialogue voice, extracts core demands, and constructs a water-saving demand intention graph. Then, based on the hierarchical relationship of the intention graph, it performs reverse matching in an initialized water-saving strategy feature tree to obtain a candidate tree node set. Subsequently, it calculates the demand-strategy adaptation benefits of candidate nodes using a preset enhanced reasoning model. If all benefits meet the criteria, a water-saving response plan is directly output. If any nodes do not meet the criteria, a suitable plan is generated based on the model and attached to the parent node of the corresponding candidate node. Finally, an intelligent agent response command is generated based on the response plan, and the intelligent agent terminal provides feedback through voice broadcast or information display, achieving accurate matching between water-saving demands and response strategies, and improving the adaptability and efficiency of intelligent interaction.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] A knowledge-enhanced reasoning-based interactive control method for water-saving intelligent agents includes:
[0006] Based on the user's voice input, obtain a water-saving demand intention map;
[0007] According to the hierarchical relationship of the water-saving demand intention layer, a reverse matching operation is performed in the initialized water-saving strategy feature tree to obtain the candidate tree node set;
[0008] Based on the candidate tree node set, the demand-strategy adaptation benefit of the candidate tree node set is calculated through a preset enhanced inference model. When all demand-strategy adaptation benefits meet the preset demand-strategy adaptation benefit threshold, a water-saving response scheme is output. If the demand-strategy adaptation benefit of at least one candidate tree node does not meet the demand-strategy adaptation benefit threshold, a water-saving response scheme that meets the conditions is generated based on the candidate tree node and the enhanced inference model, and attached to the parent node of the candidate tree node.
[0009] The intelligent agent generates response instructions based on the water-saving response scheme, and executes the response instructions through the intelligent agent terminal to perform voice broadcasting or information display.
[0010] Specifically, the water-saving demand intention map is obtained by combining the water-saving demand text in the dialogue speech with a semantic decomposition algorithm, and includes at least one indivisible water-saving demand feature to represent the membership and hierarchical relationship between different water-saving demand features; the water-saving strategy feature tree is constructed by combining the water-saving demand features and water-saving strategies through a tree algorithm; the water-saving response scheme is constructed by combining the water-saving strategy corresponding to each indivisible water-saving demand feature in the water-saving demand intention map with the corresponding output hierarchical relationship; the enhanced inference model includes a strategy evaluation layer and a strategy generation layer, wherein the strategy evaluation layer is used to evaluate the adaptation benefit between the demand and the water-saving strategy in each candidate tree node; the strategy generation layer is used to generate the water-saving strategy corresponding to the first indivisible water-saving demand feature by combining the candidate tree nodes in the candidate tree node set that do not meet the demand-strategy adaptation benefit threshold with the corresponding first indivisible water-saving demand feature and a preset deep text inference algorithm.
[0011] Specifically, obtaining the water-saving demand intention map includes:
[0012] Based on the user's input dialogue speech and combined with a pre-trained multilingual text extraction model, speech semantic ambiguity elimination processing is performed to obtain semantic fragments of water conservation requirements.
[0013] Based on the semantic fragments of water conservation needs combined with a preset semantic decomposition template, a sub-needs-query index intention sequence is obtained; the sub-needs-query index intention sequence is constructed by including the sub-needs intention path and the query guidance path under each sub-needs.
[0014] Specifically, obtaining the water-saving demand intention map also includes:
[0015] Each water demand semantic fragment is used as the root node. Each sub-demand in the sub-demand-query index intention sequence is used to build a branch node. Each leaf node is built with the directed acyclic query dependency path under each sub-demand.
[0016] Analyze the implementation sequence and correlation support of the semantic sub-fragments corresponding to all sub-requirements, and construct the implementation path of the sub-requirements;
[0017] Simultaneously, index logic analysis is performed on the query index sequence under each sub-requirement to determine the starting query index, the ending query index, and the index implementation logic description and association strength corresponding to the query index sequence.
[0018] Specifically, obtaining the water-saving demand intention map also includes:
[0019] Based on the starting query index, the ending query index, and the index implementation corresponding to the query index sequence, the logical description and association strength are constructed to build the directed acyclic query dependency path corresponding to each sub-requirement.
[0020] Based on the directed acyclic query dependency path corresponding to each sub-requirement, combined with the implementation logic order relationship in the sub-requirement association implementation path and the decomposition rules in the semantic decomposition path, a cross-path association connection is constructed between the directed acyclic query dependency paths corresponding to adjacent sub-requirements.
[0021] Based on the cross-path association between adjacent sub-requirements and the directed acyclic query dependency path corresponding to each sub-requirement, the full path of the query index and the corresponding index logical relationship are constructed to obtain the water-saving demand intention graph.
[0022] Specifically, the semantic decomposition template includes:
[0023] Based on the semantic fragments of water conservation demand combined with entity extraction algorithms, single demand word fragments and the relationships between demand word fragments are obtained; wherein a single demand word fragment corresponds to at most one query index, and the query index contains at least one index condition;
[0024] Based on the target text information of a single demand term fragment and the corresponding query index, each query index type is determined; the query index types include direct query index and analytical query index; the direct query index is used to directly query the single type of data at the target location under the index conditions corresponding to the current query index; the analytical query index is used to call the configured local analysis model and combine historical monitoring data to analyze and predict the single type of result data corresponding to the query conditions according to the query conditions in the current analytical query index.
[0025] Specifically, the semantic decomposition template further includes:
[0026] Based on the single demand word fragment, combined with the preset text clustering rules and clustering algorithm, the demand word fragments are clustered and combined to obtain the sub-demand sequence and the directed acyclic query dependency path corresponding to each sub-demand.
[0027] The text clustering rules include a first clustering rule and a second clustering rule; the first clustering rule is that there is no index cycle in the query index sequence corresponding to each sub-requirement; the second clustering rule is that there is a dependency relationship between the target text information corresponding to the last query index of the previous directed acyclic query dependency path and the initial query index of the next directed acyclic query dependency path.
[0028] Specifically, the output water-saving response scheme includes:
[0029] Starting from the last query index in the water conservation demand intention graph and combining it with the water conservation strategy feature tree, an initial candidate tree node is determined;
[0030] Starting from the initial candidate tree node, the query index is determined and matched with the candidate tree node in the water-saving strategy feature tree according to the reverse order of the index logical relationship. At the same time, the strategy evaluation layer is called to evaluate the membership relationship between the water-saving strategy information corresponding to each candidate tree node and the corresponding sub-requirement. When the membership score between the candidate tree node and the sub-requirement targeted by the corresponding query index is greater than the evaluation score threshold, the current candidate tree node is determined to be a valid candidate tree node. The process of determining the query index includes: when the current query index is determined to be a direct query index and the adjacent next query index is an analysis query index, the local analysis model configured under the candidate tree node corresponding to the analysis query index is synchronously responded to perform single-type result data analysis and prediction based on the index condition features corresponding to the analysis query index, and the single-type result data of the analysis and prediction is cached under the corresponding candidate tree node.
[0031] Specifically, the output water-saving response scheme includes:
[0032] When the membership score between the candidate tree node and the sub-requirement targeted by the corresponding query index is less than or equal to the evaluation score threshold, the current candidate tree node is determined to be an invalid candidate tree node.
[0033] When the current candidate tree node is determined to be an invalid candidate tree node, the first water-saving strategy corresponding to the current sub-requirement and index conditions is generated based on the index conditions corresponding to the current query index and the semantic fragments corresponding to the sub-requirement, combined with the strategy generation layer. The strategy evaluation layer is called simultaneously to evaluate and determine the membership relationship. When the membership score corresponding to the first water-saving strategy is greater than the evaluation score threshold, the first water-saving strategy is used to construct a new tree node and output it as a valid candidate tree node. At the same time, the new tree node is attached to the parent node corresponding to the invalid candidate tree node.
[0034] Traverse the water-saving strategy feature tree until the last query index in the full path of the query index is completed, and sort and combine the valid candidate tree nodes that have completed the query according to the index logical relationship to construct a water-saving response scheme.
[0035] Based on the membership score and membership weight of each valid candidate tree node in the current water-saving response scheme, the demand-strategy adaptation benefit of the current water-saving response scheme is obtained through a weighted average algorithm.
[0036] When the benefit of the demand-strategy adaptation is greater than the preset demand-strategy adaptation benefit threshold, the water-saving response scheme is output; otherwise, the above process of matching and evaluating the water-saving demand intention graph with the effective candidate tree node is repeated until the preset demand-strategy adaptation benefit threshold is met.
[0037] The water-saving intelligent agent interactive control system based on knowledge-enhanced reasoning includes: a demand extraction unit, a matching unit, an evaluation unit, and an execution unit;
[0038] The demand extraction unit is used to obtain a water-saving demand intention map based on the user's input voice dialogue.
[0039] The matching unit is used to perform a reverse matching operation in the initialized water-saving strategy feature tree according to the hierarchical relationship of the water-saving demand intention layer to obtain a candidate tree node set;
[0040] The evaluation unit calculates the demand-strategy adaptation benefit of the candidate tree node set based on the candidate tree node set using a preset enhanced inference model. When all demand-strategy adaptation benefits meet the preset demand-strategy adaptation benefit threshold, a water-saving response scheme is output. If at least one candidate tree node's demand-strategy adaptation benefit does not meet the demand-strategy adaptation benefit threshold, a water-saving response scheme that meets the conditions is generated based on the candidate tree node and the enhanced inference model, and then attached to the parent node of the candidate tree node.
[0041] The execution unit is used to generate response instructions for the intelligent agent according to the water-saving response scheme, and execute the response instructions through the intelligent agent terminal to perform voice broadcasting or information display.
[0042] Compared with the prior art, the beneficial effects of the present invention are:
[0043] This invention addresses the shortcomings of existing technologies by constructing a water-saving demand intention graph to achieve complete parsing and structured representation of the semantics of multi-turn user dialogues, effectively solving the problems of contextual semantic loss and logical breaks in traditional voice interaction. Based on a reverse-order matching mechanism and an enhanced inference model for demand-policy adaptation evaluation, the accuracy and scenario adaptability of water-saving strategy recommendations are significantly improved. By dynamically generating and attaching new policy nodes to the feature tree, the system possesses continuous evolution capabilities, overcoming the limitations of a static policy library. The full-path design of the query index and the establishment of directed acyclic dependencies ensure the semantic coherence of multi-turn dialogues and optimize system response efficiency through local analysis models and caching mechanisms. The final generated water-saving response scheme undergoes multi-layer evaluation and weight optimization to ensure optimal comprehensive adaptation benefits, achieving simultaneous improvement in the accuracy, logical coherence, and service efficiency of the water-saving agent in complex interaction scenarios. Attached Figure Description
[0044] Figure 1 This is a flowchart of the water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning of the present invention;
[0045] Figure 2 This is a logical architecture diagram of the water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning of the present invention;
[0046] Figure 3 This is a block diagram of the water-saving intelligent agent interactive control system based on knowledge-enhanced reasoning of the present invention. Detailed Implementation
[0047] Example
[0048] Please see Figure 1 and Figure 2 The present invention provides an embodiment of a water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning, comprising the following steps:
[0049] S1. Obtain a water-saving demand intention map based on the user's input dialogue voice. It should be further explained that in this embodiment, the water-saving demand intention map is obtained by combining the water-saving demand text in the dialogue voice with a semantic decomposition algorithm. It includes at least one indivisible water-saving demand feature, which is used to characterize the membership and hierarchical relationship between different water-saving demand features.
[0050] S2. According to the hierarchical relationship of the water-saving demand intention layer, perform a reverse matching operation in the initialized water-saving strategy feature tree to obtain a candidate tree node set; it should be further noted that in this embodiment, the water-saving strategy feature tree is constructed by combining the water-saving demand features and water-saving strategies through a tree algorithm, specifically including:
[0051] S201. Based on the collection and organization of core data in the field of water conservation, obtain the foundation of structured data, including the collection of water conservation demand characteristics, indivisible water conservation demand characteristics, water conservation strategies and query index types, and standardize the collected data, assign a unique identifier to each indivisible water conservation demand characteristic, label the core adaptation parameters for each water conservation strategy, and associate the data processing method with the query index type.
[0052] S202. Based on the hierarchical structure of the tree algorithm, a five-level node system is established, specifically including: defining the root node as the total water-saving service node, the first-level node as the water-saving demand feature category node, the second-level node as the indivisible water-saving demand feature node, the third-level node as the query index type node, and the leaf node as the water-saving strategy node, and clarifying the association rules between the nodes at each level.
[0053] S203. Using the K-means clustering algorithm, water-saving demand features are clustered by functional attributes, generating four primary nodes: water usage data query, water-saving strategy recommendation, policy and standard consultation, and living assistance services. These nodes are then attached to the root node via a parent-child node association function. Further explanation is needed: In this embodiment, during the construction of primary nodes, a cosine similarity algorithm is first used to calculate the functional attribute similarity of water-saving demand features. By analyzing the degree of correlation between each feature in the functional dimension, and then prioritizing the four clustered nodes (water usage data query, water-saving strategy recommendation, policy and standard consultation, and living assistance services) according to functional importance and usage frequency based on the actual needs of water-saving service scenarios, the parent-child node association function establishes the hierarchical relationship between the root node and the primary nodes, clarifying the hierarchical structure and inheritance relationship between nodes at each level, forming a complete top-level architecture for the water-saving strategy feature tree. In this embodiment, the parent-child node association function achieves hierarchical linking by assigning a unique identifier to each node and setting the identifier of its parent node in the child node. Specific technical measures include defining a data structure containing child node identifiers, parent node identifiers, type, and attribute fields; writing association logic based on recursive or iterative algorithms; mounting child nodes layer by layer according to the parent node identifier; and finally using a tree-like or graph-like data storage structure to solidify the complete topological relationship of the water-saving strategy feature tree. The core technical purpose of this function is to establish and maintain the inheritance and dependency structure between nodes, thereby supporting the system to perform efficient data retrieval, strategy matching, and service invocation based on this hierarchical relationship.
[0054] S204. Second-level node mounting based on semantic similarity calculation: For each first-level node, extract the corresponding indivisible water-saving demand features, eliminate duplicate features using a semantic similarity algorithm, and filter according to the principles of semantic independence and single function. The filtered features are then mounted as second-level nodes to the corresponding first-level nodes through a child node mounting function. It should be further explained that in this embodiment, during the second-level node mounting process, the Euclidean distance algorithm is first used to quantitatively calculate the semantic similarity of the indivisible water-saving demand features. By setting a similarity threshold, semantically duplicated features are accurately identified and eliminated. Then, based on historical interaction data analysis of the actual usage frequency of each demand feature, the second-level nodes are arranged in descending order to ensure that high-frequency demands are matched first. Finally, a node relationship mapping table is used to completely record the subordinate relationship identifier between each second-level node and its corresponding first-level node, establishing a clear hierarchical association index to provide a complete path basis for subsequent query matching.
[0055] S205. The three-level node association based on matching the required implementation method is as follows: For each second-level node, a corresponding query index type is matched. A type association function is used to uniquely associate the query index type with the corresponding second-level node as a third-level node, and attribute tags are added to the third-level node. It should be further explained that in this embodiment, during the three-level node association process, firstly, based on the specific implementation method of each indivisible water-saving requirement feature, the corresponding query index type is precisely matched, strictly adhering to the association rule that "one requirement feature corresponds to only one query index type." Next, the specific address information of the data source is fully labeled for the direct query index node, including the database table location, API interface path, and necessary read parameter configurations. Simultaneously, the unique identifier of the associated local analysis model is detailed for the analysis query index node, and the input data format requirements and output result specifications of the model are clearly recorded to ensure that each query index node has complete and executable parameter configurations. It should be further explained that the local analysis model in this embodiment is constructed by those skilled in the art using existing support vector machines or random forest algorithms based on the analysis needs of historical query index data.
[0056] S206. For each third-level node, candidate water-saving strategies are collected. The adaptation benefit of each candidate water-saving strategy and the corresponding second-level node is calculated through the strategy evaluation layer of the enhanced inference model. Strategies with adaptation benefits greater than the preset requirement-strategy adaptation benefit threshold are selected as leaf nodes and attached to the corresponding third-level nodes. Strategy execution parameters are added to each leaf node. It should be further noted that in the leaf node matching process of this embodiment, all candidate water-saving strategies are first sorted in descending order according to the historical adaptation benefit values calculated by the enhanced inference model to ensure that high-yield strategies are matched first. Then, complete execution elements are configured for each leaf node, including detailed operation steps, required computing resources and data dependencies, and handling mechanisms for abnormal situations. Finally, through standardized interface encapsulation, the water-saving strategy corresponding to each leaf node can be directly called and executed by the system, forming a complete strategy implementation closed loop.
[0057] S207. Tree structure verification based on graph traversal algorithm: Specifically, a depth-first search algorithm is used to traverse the tree structure for acyclic verification, verifying the validity of node associations. Node sorting is optimized based on node access frequency statistics, and the final water-saving strategy feature tree is generated through a structure solidification function. It should be further explained that in this embodiment, during the tree structure verification process, firstly, a depth-first search algorithm is used to traverse the entire tree structure. When a cyclic path is detected, the system identifies and deletes conflicting nodes whose adaptation benefits are lower than the preset demand-strategy adaptation benefit threshold, thereby ensuring that all paths from the root node to the leaf node are directed acyclic paths. Secondly, a node relationship verification mechanism is used to strictly check whether the subordinate relationship between each parent node and child node conforms to the business logic of the water-saving domain, ensuring the rationality of the hierarchical structure. Finally, while maintaining the integrity of the existing tree structure, standardized node extension interfaces are reserved to provide dynamic mounting support for subsequently added water-saving demand features and strategies, ensuring that the feature tree has the ability to continuously evolve. In this embodiment, the structure solidification function refers to the technical process of converting a verified and optimized tree structure into a persistent storage format and locking its topological relationships. This function uses serialization technology to encode the attribute data, parent-child relationships, and global sorting status of all nodes in the current tree structure into immutable data files or database records in a specific format. Its core construction method includes defining a unified serialization protocol, designing storage structure mapping relationships, and implementing deserialization and reconstruction logic. The purpose of this function is to generate the final version of the water-saving strategy feature tree instance, ensuring that the system can load and utilize this structure in a stable and reliable manner during runtime for efficient strategy matching and service calls.
[0058] S3. Based on the candidate tree node set, calculate the demand-strategy adaptation benefit of the candidate tree node set through a preset enhanced inference model. When all demand-strategy adaptation benefits meet the preset demand-strategy adaptation benefit threshold, output a water-saving response scheme. If at least one candidate tree node's demand-strategy adaptation benefit does not meet the demand-strategy adaptation benefit threshold, generate a water-saving response scheme that meets the conditions based on the candidate tree node and the enhanced inference model, and attach it to the parent node of the candidate tree node. The water-saving response scheme is constructed by combining the water-saving strategy corresponding to each indivisible water-saving demand feature of the water-saving demand intention graph with the corresponding output hierarchical relationship. The enhanced inference model includes a strategy evaluation layer and a strategy generation layer. The strategy evaluation layer is used to evaluate the adaptation benefit between demand and water-saving strategy in each candidate tree node. The strategy generation layer is used to generate a water-saving strategy corresponding to the first indivisible water-saving demand feature based on the candidate tree node in the candidate tree node set that does not meet the demand-strategy adaptation benefit threshold and the corresponding first indivisible water-saving demand feature, combined with a preset deep text inference algorithm. The deep text reasoning algorithm in this embodiment is constructed from a pre-trained Chinese BERT model;
[0059] S4. Generate response instructions for the intelligent agent based on the water-saving response scheme, and execute the response instructions through the intelligent agent terminal to perform voice broadcasting or information display.
[0060] It should be further explained that the acquisition of the water-saving demand intention diagram in this embodiment includes:
[0061] S101. Based on the user-input dialogue speech and a pre-trained multilingual text extraction model, perform speech semantic ambiguity elimination processing to obtain semantic fragments of water conservation requirements; the multilingual text extraction model in this embodiment is preferably the FastText multilingual classifier;
[0062] S102. Based on the semantic fragments of water-saving needs combined with a preset semantic decomposition template, a sub-needle-query index intention sequence is obtained; the sub-needle-query index intention sequence includes sub-needle intention paths and query guidance paths under each sub-needle; it should be further noted that the semantic decomposition template in this embodiment includes:
[0063] S1021. Based on the semantic fragments of water conservation demand combined with the entity extraction algorithm, obtain single demand word fragments and the association relationships between demand word fragments; wherein a single demand word fragment corresponds to at most one query index, and the query index contains at least one index condition;
[0064] S1022. Based on the target text information of a single demand word fragment and the corresponding query index, determine each query index type; the query index type includes a direct query index and an analytical query index; the direct query index is used to directly query the single type data of the target position under the index conditions corresponding to the current query index; the analytical query index is used to call the configured local analysis model and combine historical monitoring data to analyze and predict the single type result data corresponding to the query conditions according to the query conditions in the current analytical query index.
[0065] S1023. Based on the single demand word fragment, combined with the preset text clustering rules and clustering algorithm, demand word fragments are clustered and combined to obtain sub-demand sequences and directed acyclic query dependency paths corresponding to each sub-demand.
[0066] The text clustering rules include a first clustering rule and a second clustering rule; the first clustering rule is that there is no index cycle in the query index sequence corresponding to each sub-requirement; the second clustering rule is that there is a dependency relationship between the target text information corresponding to the last query index of the previous directed acyclic query dependency path and the initial query index of the next directed acyclic query dependency path.
[0067] Specifically, this embodiment achieves accurate conversion from natural language requirements to executable query instructions through a three-layer progressive processing architecture. For example, in the requirement parsing stage, a sequence labeling model built with BiLSTM-CRF is used for entity extraction. Complex requirements such as "analyze the water efficiency of park greening irrigation and propose a renovation plan" are decomposed into four indivisible atomic semantic units: the facility object "park greening irrigation," the evaluation indicator "water efficiency," the operation instruction "analysis," and the target requirement "renovation plan." Each semantic unit strictly adheres to the single-access principle, binding a unique and independent query index. The index conditions are linked to the core attributes of the semantic unit. Precise matching is achieved, where facility objects correspond to the index condition "facility type = park greening irrigation," and evaluation indicators correspond to "evaluation parameters = water use efficiency." This atomic splitting and precise index binding effectively eliminates semantic ambiguity, where "water use efficiency" might refer to multiple scenarios such as industrial water use or domestic water use, ensuring the uniqueness of the understanding of the requirements. In the index classification stage, a multi-feature classifier integrating part-of-speech features, semantic role features, and verb type features is constructed. The classification rules are clear: if a requirement fragment contains direct data acquisition verbs such as "query," "get," or "extract," it is automatically classified as a direct query index, and data is retrieved from the water consumption monitoring database through a pre-configured database connector. Structured data is directly extracted from the data. If a demand fragment contains analytical reasoning verbs such as "analysis," "prediction," or "evaluation," it is marked as an analytical query index, triggering the water efficiency assessment model to load historical monitoring data and perform regression analysis. In the path construction stage, an improved hierarchical clustering algorithm with semantic similarity weights is adopted, combined with dual rule constraints to optimize the query path: First, the query index sequence within each sub-demand is detected through topological sorting, forcibly eliminating index combinations that may form circular dependencies to ensure the acyclicity of the query logic; then, through dependency graph analysis, only the linear dependency relationship between the first and last indexes of adjacent sub-demands is retained, i.e., the "monthly usage" output of the preceding sub-demand. The "water quantity statistics result" is used as the sole input parameter and directly passed to the "water use efficiency assessment model" of subsequent sub-requirements, avoiding redundant interference from multiple source parameters. This sophisticated processing flow is adaptable to multiple application scenarios: In agricultural water-saving scenarios, it can quickly analyze the "greenhouse drip irrigation system optimization" requirement, directly querying real-time soil moisture monitoring data on the one hand, and calling the crop water requirement model to predict the optimal irrigation scheme on the other hand; In industrial water-saving scenarios, it can accurately distinguish between two types of requirements: "direct query of cooling tower water replenishment" and "recycling rate analysis query", matching the corresponding indexes and processing logic respectively, and finally forming a decision support system that combines real-time data support and scientific model analysis.
[0068] This embodiment relies on the topological orderliness and dependency propagation minimization control of directed acyclic graphs (DAGs) in graph theory: The first clustering rule prohibits index cycles, essentially forcing the query index sequence of sub-requirements to conform to the DAG structure. In particular, since graphs containing cycles cannot be topologically sorted, query execution can fall into an infinite loop of "querying A first requires B, querying B first requires A". The topological orderliness of the DAG ensures that queries are executed sequentially in a linear order, fundamentally guaranteeing the feasibility of implementing the requirements. The second clustering rule limits the dependency between adjacent sub-requirements to only the first and last indexes. At the underlying level, it controls the granularity of dependency propagation to avoid logical coupling caused by multiple index cross-dependencies. For example, the association of middle indexes in the preceding path with multiple indexes in the following path can lead to ambiguity in the execution order. At the same time, it reduces the computational complexity of dependency verification and improves the parsing efficiency of query paths. Finally, through these two rules, scattered fragments of single requirement terms are transformed into a sequence of sub-requirements and DAG query paths that conform to topological logic and have clear dependencies. This not only solves the parsing chaos caused by the fragmentation of user water-saving requirements, but also provides a rigorous logical foundation for subsequent strategy matching and execution.
[0069] S103. Take each water demand semantic fragment as the root node, construct branch nodes with each sub-demand in the sub-demand-query index intention sequence, and construct leaf nodes under each branch node with the directed acyclic query dependency path under each sub-demand.
[0070] S104. Analyze the implementation sequence logic and correlation support of all semantic sub-fragments corresponding to sub-requirements to construct the sub-requirement correlation implementation path. It should be further explained that this embodiment extracts grammatical relationships such as verb-object, causal, and temporal relationships between semantic sub-fragments of sub-requirements using a dependency parsing algorithm, and extracts temporal relationships using pre-trained BERT to determine the logical order of sub-requirement implementation. Simultaneously, Word2Vec or Sentence-BERT is used to calculate the cosine similarity between semantic sub-fragments, and mutual information and point mutual information are combined to obtain the correlation strength between sub-requirements. TF-IDF weighting is used to calculate the domain relevance weight of semantic sub-fragments to comprehensively evaluate the correlation support between sub-requirements. Finally, based on a directed graph model, the logical sequence is used as the direction of the edges, and the correlation support is used as the weight of the edges to construct the sub-requirement correlation implementation path.
[0071] S105. Simultaneously, perform index logic analysis on the query index sequence under each sub-requirement to determine the starting and ending query indexes, as well as the corresponding index implementation logic description and association strength of the query index sequence. This process uses sequence labeling algorithms to identify the semantic boundaries of the query index sequence to anchor the starting / ending indexes, uses dependency parsing and topological sorting to sort out the inheritance logic between indexes and transform it into a natural language implementation description, and uses semantic similarity calculation and mutual information to quantify the dependency association strength between indexes. The core purpose of this process is to define a clear start and end range for the query index sequence under the sub-requirement, clearly present the sequential execution logic of the indexes, and quantify the degree of association between indexes. This provides accurate node positioning, traceable logical basis, and quantified association weights for the subsequent construction of directed acyclic query dependency paths, ultimately ensuring the orderliness, logical coherence, and reliability of the query sequence execution.
[0072] S106. Based on the starting query index, the ending query index, and the index implementation corresponding to the query index sequence, construct the directed acyclic query dependency path corresponding to each sub-requirement, and define the logical description and association strength.
[0073] S107. Based on the directed acyclic query dependency path corresponding to each sub-requirement, combined with the implementation logic order relationship in the sub-requirement association implementation path and the decomposition rules in the semantic decomposition path, construct cross-path association connection between the directed acyclic query dependency paths corresponding to adjacent sub-requirements.
[0074] S108. Based on the cross-path association between adjacent sub-requirements, and combined with the directed acyclic query dependency path corresponding to each sub-requirement, construct the full path of the query index and the corresponding index logical relationship to obtain the water-saving demand intention graph.
[0075] This process accurately extracts semantic fragments of water-saving requirements through a multilingual text extraction model combined with ambiguity resolution, eliminating semantic ambiguity in voice interaction. Secondly, it uses entity extraction algorithms to atomically decompose semantic fragments into single requirement word fragments and binds them to unique query indexes, achieving precise decoupling of semantics and query, avoiding interference from ambiguity. Through text clustering rules and algorithms, it constructs sub-requirement sequences and query dependency paths conforming to a DAG structure, preventing execution dead loops caused by index cycles, while limiting dependency granularity to reduce logical coupling, ensuring the feasibility and efficiency of query execution. Finally, through dependency parsing, temporal relation extraction, and semantic similarity calculation, it clarifies the implementation order and association strength of sub-requirements, constructing... An orderly path for the association of sub-requirements is established; then, through index logic analysis, the start and end indexes are anchored, the execution logic is sorted out, and the association strength is quantified, providing a precise basis for path construction; finally, by connecting and integrating the sub-requirement paths across paths, a complete intention graph is formed, realizing the complete transformation of users' water-saving requirements from fragmented semantics to structured, logical, and executable. This not only improves the accuracy and comprehensiveness of requirement parsing, but also provides a logically rigorous and hierarchically clear requirement framework for the subsequent matching of water-saving strategy feature trees, greatly reducing the complexity of strategy matching, improving the accuracy and execution efficiency of the agent's response, and effectively solving the problems of semantic ambiguity, logical confusion, and inefficient execution in traditional requirement parsing.
[0076] It should be further explained that the enhanced inference model in this embodiment is constructed based on the adaptation evaluation and dynamic generation of requirements between the indivisible water-saving demand features in the water-saving demand intention graph and the water-saving strategies in the water-saving strategy feature tree, and adopts a two-layer architecture of strategy evaluation layer and strategy generation layer; the construction process and mathematical relationship derivation of the enhanced inference model in this embodiment are as follows:
[0077] 1. The construction and mathematical derivation process of the strategy evaluation layer includes:
[0078] 1.1 A strategy evaluation layer is constructed using a dual-tower bidirectional encoder representation model architecture based on shared weights. Specifically, two pre-trained Chinese bidirectional encoder representation models with identical structures and shared parameters are used as the backbone network for feature extraction. The bidirectional encoder representation model encoder is a deep bidirectional language representation model built based on the Transformer architecture. This embodiment adopts a dual-tower topology with dual-branch encoders and shared weights. Specifically, two pre-trained Chinese bidirectional encoder representation models (BERT) with completely identical structures serve as the left and right branches. All parameters of the Transformer layers, attention layers, and feedforward neural network layers of the two encoders are shared throughout, with only the input data branch being independent. Each BERT encoder is built based on the Transformer architecture and contains 12 Transformer encoder modules (each layer consists of a multi-head self-attention mechanism sublayer, a feedforward neural network sublayer, layer normalization, and residual connections). The input layer is configured with a WordPiece word segmenter (vocabulary size of 21128) and includes basic components such as position encoding and segment encoding. In the feature extraction stage, the first encoder segments... The first encoder branch receives the water-saving strategy description text corresponding to the candidate tree node. After word segmentation and embedding, it is converted into a word vector sequence. Then, the text context semantics are mined through the self-attention mechanism of the multi-layer Transformer structure, and the output water-saving strategy deep semantic feature vector sequence with the same length as the number of words in the input text is output. The second encoder branch processes the sub-demand semantic text corresponding to the current query index with the exact same parameters and calculation process, and outputs the sub-demand deep semantic feature vector sequence. Since the dual encoders share all weight parameters, it ensures that the feature extraction of the two types of text follows the same semantic encoding rules, which solves the comparison bias problem caused by the inconsistency of feature space under the non-shared weight architecture. The dual-branch encoder + weight-sharing dual-tower topology of this embodiment is completely consistent with the core design of the SiameseBERT algorithm.
[0079] 1.2 Input the water-saving strategy description text corresponding to the candidate tree node into the first bidirectional encoder representation model encoder. Perform semantic mining on the text through the multi-layer Transformer structure of the encoder to obtain the deep semantic feature vector sequence of the water-saving strategy. Input the sub-demand semantic text corresponding to the current query index into the second bidirectional encoder representation model encoder. Through the same semantic mining process, obtain the sub-demand deep semantic feature vector sequence.
[0080] 1.3 Based on the mean pooling algorithm, the global average calculation is performed on the deep semantic feature vector sequence of water-saving strategy and the deep semantic feature vector sequence of sub-demand respectively. Each variable-length feature vector sequence is aggregated into a fixed-dimensional sentence embedding vector, and the sentence embedding vector of water-saving strategy and sub-demand respectively are obtained, so that the two types of text features have a unified dimensional basis for comparison.
[0081] 1.4 Based on the cosine similarity algorithm, calculate the cosine value of the angle between the embedding vector of the water-saving strategy sentence and the embedding vector of the sub-demand sentence. Use this algorithm to quantify the directional consistency of the two types of vectors. Use the calculation result as a preliminary quantitative indicator of the semantic correlation between the indivisible water-saving demand features and the water-saving strategy to obtain the basic correlation metric.
[0082] 1.5 Based on a multilayer perceptron, nonlinear feature transformations are performed on the embedding vectors of water-saving strategy sentences and sub-demand sentences to enhance the vectors' ability to represent domain semantics. At the same time, the type encoding vector reflecting the category of water-saving strategy and the priority numerical feature reflecting the importance of sub-demands are concatenated and fused with the transformed two types of vectors to generate a comprehensive feature vector with stronger domain discrimination ability and semantic relevance.
[0083] 1.6 Based on the fully connected layer, the fused comprehensive feature vector is linearly mapped to achieve the adaptation and transformation of feature dimensions; then, the mapping result is normalized by the sigmoid activation function to constrain the output value to the range of 0 to 1. The normalized value is the final membership score, which is used to characterize the degree of adaptation between the current water-saving strategy and the current sub-demand.
[0084] 1.7 Based on the labeled water-saving strategy-demand text pairing dataset, the complete strategy evaluation layer network is fine-tuned end-to-end using a contrastive learning loss function. By minimizing the loss value of strategy-demand text pairs with high fit and maximizing the loss value of text pairs with low fit, the model parameters are optimized so that the model can stably output a membership score consistent with the actual fit, and finally obtain a strategy evaluation layer with accurate semantic association discrimination ability.
[0085] 2. The construction and invocation derivation process of the strategy generation layer includes:
[0086] 2.1. A strategy generation layer is constructed based on a pre-trained large-scale generative language model. Specifically, a generative Transformer model pre-trained on massive amounts of Chinese text is adopted. This model has powerful semantic understanding and text generation capabilities, providing a foundation for the dynamic generation of water-saving strategies for uncovered scenarios.
[0087] 2.2 When a candidate tree node is determined to be an invalid candidate tree node, the query index condition features corresponding to the invalid candidate tree node, the semantic text features of its sub-requirement, and the instruction prompt text indicating the generation of a new water-saving strategy are concatenated together as an input sequence and fed into the generative Transformer model.
[0088] 2.3 Based on the query index condition features corresponding to the invalid candidate tree nodes and the semantic text of the first indivisible water-saving demand features, a model input prompt sequence is constructed. The construction rule of the input prompt sequence is as follows: the predefined water-saving strategy generation instruction text, the semantic text of the first indivisible water-saving demand features, and the query index condition features are sequentially concatenated to form a structured natural language text to ensure that the model accurately captures the core demand and constraints.
[0089] 2.4 The generative Transformer model, based on its internal multi-layer self-attention mechanism and feedforward neural network, encodes and semantically understands the input prompt sequence, captures the core demands of the first indivisible water-saving demand feature and the specific constraints of the query index condition feature, and provides a semantic basis for strategy generation.
[0090] 2.5 The generative Transformer model generates new text sequences word by word in an autoregressive manner based on semantic understanding of the input context. This generation process is achieved by calculating the probability distribution of the next word in the model vocabulary and selecting the word with the highest probability according to a preset sampling strategy, until a complete paragraph text that conforms to the water conservation field standard is generated.
[0091] 2.6 The complete text paragraph output by the generative Transformer model is obtained as a brand new text description of a water-saving strategy that meets the query index conditions and the first indivisible water-saving demand features, thus completing the dynamic creation of the new water-saving strategy and filling the coverage gap of the original strategy in the water-saving strategy feature tree.
[0092] 3. Enhance the joint derivation closed loop of the inference model and the reverse matching mechanism:
[0093] 3.1 In the reverse matching process, based on the term frequency-inverse document frequency statistical algorithm combined with the sentence-level bidirectional encoder representation model, the core features of the last query index in the water-saving demand intention graph, such as the index conditions, target text information, and query index type, as well as the core features of each leaf node in the water-saving strategy feature tree, such as the water-saving strategy adaptation parameters, applicable demand scenarios, execution targets, and core adaptation conditions, are transformed into numerical query index feature vectors and water-saving strategy feature vectors. The sentence-level bidirectional encoder representation model in this embodiment is an existing sentence embedding model improved based on the pre-trained bidirectional encoder representation model (BERT). Its construction relies on the Transformer architecture. Through pre-training on massive amounts of general text and water-saving domain text, it has the ability to capture the overall semantics of sentences. In implementation, the key feature words filtered by the term frequency-inverse document frequency statistical algorithm are used to form structured text. After inputting into the model, the text is semantically encoded through the multi-layer self-attention mechanism and feedforward neural network inside the model, and the output is a fixed-dimensional numerical feature vector, which finally completes the numerical representation of the query index and water-saving strategy features.
[0094] 3.2 Based on the cosine similarity algorithm, calculate the semantic correlation score between the query index feature vector and the water-saving strategy feature vector corresponding to each leaf node; set a correlation screening threshold, retain leaf nodes with correlation scores higher than the threshold, and determine the initial candidate tree node set composed of the leaf node and its associated upper-level nodes by backtracking the path of the leaf node to the third-level nodes, second-level nodes and other upper-level nodes in the water-saving strategy feature tree.
[0095] 3.3 Call the constructed strategy evaluation layer and, following the calculation process in steps 1.2 to 1.6, calculate the membership score of the water-saving strategy and the corresponding sub-demand for each node in the initial candidate tree node set. Compare each membership score with the preset evaluation score threshold. If the membership score is greater than the evaluation score threshold, the node is determined to be a valid candidate tree node. If the membership score is less than or equal to the evaluation score threshold, the node is determined to be an invalid candidate tree node.
[0096] 3.4 For nodes identified as invalid candidate tree nodes, the strategy generation layer is immediately triggered. Following steps 2.2 to 2.6, a new water-saving strategy text is generated based on the query index condition features and sub-requirement semantic text features corresponding to the invalid node. Subsequently, the strategy evaluation layer is called again to calculate the membership score of the new water-saving strategy according to the calculation process in steps 1.2 to 1.6. If the membership score of the new water-saving strategy is greater than the evaluation score threshold, a new tree node is created with the new water-saving strategy as the core, and this new node is used as a valid candidate tree node and attached to the parent node of the original invalid candidate tree node in the water-saving strategy feature tree, thereby realizing the online expansion of the water-saving strategy library.
[0097] 3.5. Traverse the water-saving strategy feature tree until the last query index in the full query index path is completed. After collecting all valid candidate tree nodes, based on the weighted average algorithm, take the membership score of each valid candidate tree node as the basic variable, multiply it by the preset membership weight of the valid candidate tree node, and then sum all the product results to obtain the overall demand-strategy adaptation benefit value that represents the overall adaptation level of the entire water-saving response scheme. This calculation process directly reflects the contribution weight relationship of the adaptation degree of each valid node to the overall scheme.
[0098] 3.6 Finally, the calculated overall demand-strategy adaptation benefit value is compared with the preset system-level demand-strategy adaptation benefit threshold. If the overall demand-strategy adaptation benefit value is greater than the preset demand-strategy adaptation benefit threshold, the currently generated water-saving response scheme is deemed qualified and output. If the overall demand-strategy adaptation benefit value is not greater than the preset demand-strategy adaptation benefit threshold, the system automatically returns to step 3.1 and restarts a new round of reverse matching, adaptation evaluation, and strategy generation process until a water-saving response scheme that meets the preset demand-strategy adaptation benefit threshold requirement is output.
[0099] The reverse matching mechanism in this implementation starts with the last query index in the water-saving demand intention graph. First, it filters core feature words using a term frequency-inverse document frequency statistical algorithm. Then, combined with a sentence-level bidirectional encoder representation model improved based on the pre-trained bidirectional encoder representation model (BERT), it transforms the core features such as the query index conditions and target text information, along with the core features such as the water-saving strategy adaptation parameters and applicable demand scenarios of each leaf node in the water-saving strategy feature tree, into numerical feature vectors. Next, it calculates the semantic relevance score using a cosine similarity algorithm, filtering out leaf nodes above a threshold and backtracking to their parent nodes to form an initial candidate tree node set. Subsequently, it calls the strategy evaluation layer of the enhanced inference model. Based on a shared-weight dual-tower bidirectional encoder representation model architecture, it performs feature extraction, mean pooling aggregation, preliminary cosine similarity quantization, multi-layer perceptron feature fusion, fully connected layer mapping, and sigmoid activation function normalization, outputting a membership score to determine valid / invalid candidate tree nodes. For invalid nodes, it triggers the strategy generation layer. A pre-trained generative Transformer model dynamically generates new water-saving strategies by combining query index conditions with semantic text of sub-requirements. After evaluation and meeting the criteria, these strategies are mounted to the corresponding parent node to achieve online expansion of the strategy library. Finally, all valid candidate tree nodes are collected, and the overall demand-strategy adaptation benefit value is calculated based on a weighted average algorithm. If the preset threshold is not reached, the matching process is restarted to form a complete closed loop. This mechanism accurately locks the core strategy direction by tracing back in reverse order, avoiding the redundant loss of full tree traversal. The strategy evaluation layer of the enhanced inference model achieves accurate quantitative adaptation of water-saving strategies to indivisible water-saving demand features through deep semantic mining, multi-feature fusion, and comparative learning fine-tuning. The strategy generation layer fills the scene coverage gap of the static strategy library. The two work together to improve the accuracy of water-saving strategy recommendations through multi-layer semantic verification and quantitative evaluation, and strengthen scene adaptability through dynamic expansion of the strategy library and cyclic optimization closed loop. This enables the water-saving intelligent agent interaction control method to accurately respond to various water-saving needs and adapt to complex application scenarios.
[0100] It should be further explained that the water-saving response scheme output in this embodiment includes:
[0101] Starting from the last query index in the water-saving demand intention graph and combining it with the water-saving strategy feature tree, an initial candidate tree node is determined.
[0102] It should be further explained that the core motivation for determining the initial candidate tree nodes in this embodiment is to quickly lock highly relevant strategy nodes based on the ultimate goal of water conservation demand, avoiding the efficiency loss caused by full tree traversal. The specific logical steps and technical means include: First, extracting the core features of the last query index in the water conservation demand intention graph, including index conditions, target text information, query index type, etc., and generating the feature vector of the query index by combining the TF-IDF algorithm with Sentence-BERT to accurately represent its demand target and data attributes; then, using the leaf nodes of the water conservation strategy feature tree as matching objects, and using the cosine similarity algorithm... The semantic correlation between the query index feature vector and the policy feature vector of each leaf node is calculated. At the same time, the reliability of the matching is verified twice by a pre-trained domain matching model (such as BERT fine-tuned based on water-saving domain corpus). Finally, leaf nodes with correlation higher than the preset threshold are selected, and their corresponding third-level nodes and second-level nodes in the water-saving policy feature tree are traced. The leaf node and its parent related node are jointly determined as the initial candidate tree node. This not only anchors the core policy direction through the final goal of the requirement, but also ensures the accuracy of the initial candidate nodes by relying on feature vector matching and node tracing. This lays an efficient and accurate foundation for subsequent reverse matching and adaptation benefit evaluation. In this embodiment, the policy feature vectors of each leaf node are generated using the TF-IDF algorithm combined with Sentence-BERT based on the core information of the leaf nodes of the water-saving policy feature tree. This core information includes policy adaptation parameters, applicable demand scenarios, execution goals, core adaptation conditions, etc., which can accurately quantify the semantic attributes, adaptation requirements, and core features of the corresponding water-saving policy. It is mainly used to calculate the cosine similarity with the feature vector extracted from the last query index of the water-saving demand intention graph. At the same time, it is combined with a pre-trained domain matching model to verify the matching reliability, thereby quantifying the semantic correlation between the two. Then, leaf nodes with a correlation higher than a preset threshold are selected. Then, the corresponding third-level nodes and second-level nodes of the leaf node in the water-saving policy feature tree are traced back. The leaf node and its parent related nodes are jointly determined as the initial candidate tree nodes. In this way, the core policy direction is anchored based on the final demand goal, avoiding the efficiency loss caused by full tree traversal, ensuring the accuracy of the initial candidate nodes, and laying an efficient and accurate foundation for subsequent reverse matching and adaptation benefit evaluation.
[0103] Starting from the initial candidate tree node, the query index is determined and matched with the candidate tree node in the water-saving strategy feature tree according to the reverse order of the index logical relationship. At the same time, the strategy evaluation layer is called to evaluate the membership relationship between the water-saving strategy information corresponding to each candidate tree node and the corresponding sub-requirement. When the membership score between the candidate tree node and the sub-requirement targeted by the corresponding query index is greater than the evaluation score threshold, the current candidate tree node is determined to be a valid candidate tree node. The process of determining the query index includes: when the current query index is determined to be a direct query index and the adjacent next query index is an analysis query index, the local analysis model configured under the candidate tree node corresponding to the analysis query index is synchronously responded to perform single-type result data analysis and prediction based on the index condition features corresponding to the analysis query index, and the analyzed and predicted single-type result data is cached under the corresponding candidate tree node. The evaluation score threshold in this embodiment is set by those skilled in the art.
[0104] The core motivation behind this embodiment, which matches according to the reverse order of the index logic, is to trace the supporting path backwards from the user's ultimate goal, avoiding the redundancy of forward traversal of the strategy feature tree and improving matching efficiency and accuracy. Its principle relies on the reverse derivation characteristics of the index logic and the hierarchical dependency relationship of the strategy feature tree. Starting from the candidate tree node, it verifies layer by layer along the reverse chain of the index logic. Combining the node hierarchy association of the feature tree (leaf node to parent node), it matches the corresponding query index type and conditions. For the type differences between direct queries and analytical queries, it triggers the local model operation corresponding to the analytical query and caches the results, providing data support for the preceding index matching. Simultaneously, it uses the strategy evaluation layer to quantify the membership association between nodes and sub-requirements, filtering valid nodes with thresholds. This ensures both the consistency of the matching logic and the requirement execution path, and filters irrelevant nodes through reverse verification, ensuring the validity and adaptability of candidate nodes.
[0105] When the membership score between the candidate tree node and the sub-requirement targeted by the corresponding query index is less than or equal to the evaluation score threshold, the current candidate tree node is determined to be an invalid candidate tree node.
[0106] When a current candidate tree node is determined to be an invalid candidate tree node, a first water-saving strategy corresponding to the current sub-requirement and index conditions is generated based on the index conditions corresponding to the current query index and the semantic fragments corresponding to the sub-requirement, combined with the strategy generation layer. Simultaneously, the strategy evaluation layer is invoked to evaluate the membership relationship. When the membership score corresponding to the first water-saving strategy is greater than the evaluation score threshold, a new tree node is constructed using the first water-saving strategy and output as a valid candidate tree node. Simultaneously, the new tree node is attached to the parent node corresponding to the invalid candidate tree node. It should be further noted that the core motivation for attaching the newly generated tree node to the parent node corresponding to the invalid candidate tree node in this embodiment is to maintain the complete topological structure and logical coherence of the water-saving strategy feature tree. This operation forms a closed loop with the aforementioned strategy generation and evaluation process: after the system creates a new water-saving strategy through the strategy generation layer and verifies its effectiveness through the evaluation layer, it attaches it as an independent node to the parent node of the original invalid node. This retains the reference value of the original invalid node as a historical decision path and expands the strategy coverage by adding a new branch. This design ensures that the feature tree maintains its directed acyclic property during dynamic optimization, while maintaining the semantic inheritance relationship between strategies through the association between parent and child nodes. This provides structured support for the rapid matching of similar needs in the future, thereby enabling the continuous evolution and self-improvement of the strategy library.
[0107] Traverse the water-saving strategy feature tree until the last query index in the full path of the query index is completed, and sort and combine the valid candidate tree nodes that have completed the query according to the index logical relationship to construct a water-saving response scheme.
[0108] Based on the membership score and membership weight of each valid candidate tree node in the current water-saving response scheme, the demand-strategy adaptation benefit of the current water-saving response scheme is obtained through a weighted average algorithm.
[0109] When the benefit of the demand-strategy adaptation is greater than the preset demand-strategy adaptation benefit threshold, the water-saving response scheme is output; otherwise, the above process of matching and evaluating the water-saving demand intention graph with the effective candidate tree node is repeated until the preset demand-strategy adaptation benefit threshold is met.
[0110] This embodiment starts with the final query index for water conservation needs and reverses the matching process to identify initial candidate nodes. It utilizes feature vector matching and node tracing techniques to avoid a full traversal of the strategy feature tree, significantly reducing matching computation overhead and improving strategy positioning efficiency. During the reverse traversal along the index logic, it triggers local model calculations based on differences in query index types and caches the results. This ensures consistency between the matching logic and the requirement execution path. Simultaneously, the strategy evaluation layer quantifies the membership relationship between candidate nodes and sub-requirements, using thresholds to filter valid nodes and irrelevant nodes to improve matching accuracy. For invalid candidate nodes, the strategy generation layer dynamically adjusts the matching based on index conditions and sub-requirement semantics. The system generates and adapts strategies and attaches them to the corresponding parent nodes, compensating for the coverage limitations of the original strategy library and enhancing the flexibility of the solution to adapt to complex and novel requirements. After traversal, the effective nodes are logically sorted and combined according to the index. The comprehensive adaptation benefit is calculated by weighted average algorithm based on membership score and weight. The solution quality is strictly controlled by threshold verification. If the standard is not met, the matching and evaluation process is repeated to ensure that the solution is highly consistent with the user's water-saving needs. Ultimately, the system achieves efficient generation, accurate adaptation, flexible expansion, and quality control of water-saving response solutions, effectively solving the problems of low efficiency, narrow coverage, and insufficient adaptability in traditional strategy matching, and significantly improving the reliability of the agent's response and user experience.
[0111] Example
[0112] Please see Figure 3 Another embodiment of the present invention provides: a water-saving intelligent agent interactive control system based on knowledge-enhanced reasoning, comprising: a demand extraction unit, a matching unit, an evaluation unit, and an execution unit;
[0113] The demand extraction unit is used to obtain a water-saving demand intention map based on the user's input voice dialogue.
[0114] The matching unit is used to perform a reverse matching operation in the initialized water-saving strategy feature tree according to the hierarchical relationship of the water-saving demand intention layer to obtain a candidate tree node set;
[0115] The evaluation unit calculates the demand-strategy adaptation benefit of the candidate tree node set based on the candidate tree node set using a preset enhanced inference model. When all demand-strategy adaptation benefits meet the preset demand-strategy adaptation benefit threshold, a water-saving response scheme is output. If at least one candidate tree node does not meet the demand-strategy adaptation benefit threshold, a water-saving response scheme that meets the conditions is generated based on the candidate tree node and the enhanced inference model, and then attached to the parent node of the candidate tree node.
[0116] The execution unit is used to generate response instructions for the intelligent agent according to the water-saving response scheme, and execute the response instructions through the intelligent agent terminal to perform voice broadcasting or information display.
[0117] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the present invention. All of these variations are within the protection scope of the present invention.
[0118] If the technical solution disclosed herein involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution disclosed herein involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
Claims
1. A water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning, characterized in that, include: Based on the user's voice input, obtain a water-saving demand intention map; According to the hierarchical relationship of the water-saving demand intention layer, a reverse matching operation is performed in the initialized water-saving strategy feature tree to obtain the candidate tree node set; Based on the candidate tree node set, the demand-policy adaptation benefit of the candidate tree node set is calculated through a preset enhanced inference model, which includes a policy evaluation layer and a policy generation layer. When all demand-strategy adaptation benefits meet the preset demand-strategy adaptation benefit threshold, a water-saving response plan is output. If at least one candidate tree node's demand-strategy adaptation benefit does not meet the threshold, a water-saving strategy that meets the conditions is generated based on the candidate tree node and the enhanced inference model, and attached to the parent node of the candidate tree node, including: Starting from the last query index in the water-saving demand intention graph and combining it with the water-saving strategy feature tree, an initial candidate tree node is determined. Starting from the initial candidate tree node, the query index is determined and matched with the candidate tree node in the water-saving strategy feature tree according to the reverse order of the index logical relationship. At the same time, the strategy evaluation layer is called to evaluate the membership relationship between the water-saving strategy information corresponding to each candidate tree node and the corresponding sub-demand. When the membership score between the candidate tree node and the sub-demand it faces is greater than the evaluation score threshold, the current candidate tree node is determined to be a valid candidate tree node. The process of determining the query index includes: when the current query index is determined to be a direct query index and the adjacent next query index is an analysis query index, the local analysis model configured under the candidate tree node corresponding to the analysis query index is synchronously responded to perform single-type result data analysis and prediction based on the index condition features corresponding to the analysis query index, and the analyzed and predicted single-type result data is cached under the corresponding candidate tree node. When the membership score between the candidate tree node and the sub-requirement targeted by the corresponding query index is less than or equal to the evaluation score threshold, the current candidate tree node is determined to be an invalid candidate tree node. When the current candidate tree node is determined to be an invalid candidate tree node, the first water-saving strategy corresponding to the current sub-requirement and index conditions is generated based on the index conditions corresponding to the current query index and the semantic fragments corresponding to the sub-requirement, combined with the strategy generation layer. The strategy evaluation layer is called simultaneously to evaluate and determine the membership relationship. When the membership score corresponding to the first water-saving strategy is greater than the evaluation score threshold, the first water-saving strategy is used to construct a new tree node and output it as a valid candidate tree node. At the same time, the new tree node is attached to the parent node corresponding to the invalid candidate tree node. Traverse the water-saving strategy feature tree until the last query index in the full query path is completed, and sort and combine the valid candidate tree nodes that have completed the query according to the index logical relationship to construct a water-saving response scheme. Based on the membership score and membership weight of each valid candidate tree node in the current water-saving response scheme, the demand-strategy adaptation benefit of the current water-saving response scheme is obtained through a weighted average algorithm. When the benefit of the demand-strategy adaptation is greater than the preset demand-strategy adaptation benefit threshold, the water-saving response scheme is output; otherwise, the above process of matching and evaluating the water-saving demand intention graph with the effective candidate tree node is repeated until the preset demand-strategy adaptation benefit threshold is met. The intelligent agent generates response instructions based on the water-saving response scheme, and executes the response instructions through the intelligent agent terminal to perform voice broadcasting or information display.
2. The water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning as described in claim 1, characterized in that, The water-saving demand intention map is obtained by combining the water-saving demand text in the dialogue speech with a semantic decomposition algorithm, and includes at least one indivisible water-saving demand feature to represent the membership and hierarchical relationship between different water-saving demand features; the water-saving strategy feature tree is constructed by combining the water-saving demand features and water-saving strategies through a tree algorithm; the water-saving response scheme is constructed by combining the water-saving strategy corresponding to each indivisible water-saving demand feature in the water-saving demand intention map with the corresponding output hierarchical relationship; the strategy evaluation layer is used to evaluate the adaptation benefit between the demand and the water-saving strategy in each candidate tree node; the strategy generation layer is used to generate the water-saving strategy corresponding to the first indivisible water-saving demand feature by combining the candidate tree nodes in the candidate tree node set that do not meet the demand-strategy adaptation benefit threshold with the corresponding first indivisible water-saving demand feature and a preset deep text reasoning algorithm.
3. The water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning as described in claim 2, characterized in that, The acquisition of the water conservation demand intention map includes: Based on the user's input dialogue speech and combined with a pre-trained multilingual text extraction model, speech semantic ambiguity elimination processing is performed to obtain semantic fragments of water conservation requirements. Based on the semantic fragments of water conservation needs combined with a preset semantic decomposition template, a sub-needs-query index intention sequence is obtained; the sub-needs-query index intention sequence is constructed from the sub-needs intention path and the query guidance path under each sub-needs, including; based on the semantic fragments of water conservation needs combined with an entity extraction algorithm, a single demand word fragment and the relationship between demand word fragments are obtained; wherein a single demand word fragment corresponds to at most one query index, and the query index contains at least one index condition; Based on the target text information of a single demand term fragment and the corresponding query index, each query index type is determined; the query index types include direct query index and analytical query index; the direct query index is used to directly query the single type of data at the target location under the index conditions corresponding to the current query index; the analytical query index is used to call the configured local analysis model and combine historical monitoring data to analyze and predict the single type of result data corresponding to the query conditions according to the query conditions in the current analytical query index. Based on the single demand word fragment, combined with the preset text clustering rules and clustering algorithm, the demand word fragments are clustered and combined to obtain the sub-demand sequence and the directed acyclic query dependency path corresponding to each sub-demand. The text clustering rules include a first clustering rule and a second clustering rule; the first clustering rule is that there is no index cycle in the query index sequence corresponding to each sub-requirement; the second clustering rule is that there is a dependency relationship between the target text information corresponding to the last query index of the previous directed acyclic query dependency path and the initial query index of the next directed acyclic query dependency path.
4. The water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning as described in claim 3, characterized in that, The acquisition of the water-saving demand intention map also includes: Each water demand semantic fragment is used as the root node. Each sub-demand in the sub-demand-query index intention sequence is used to build a branch node. Each leaf node is built with the directed acyclic query dependency path under each sub-demand. Analyze the implementation sequence and correlation support of the semantic sub-fragments corresponding to all sub-requirements, and construct the implementation path of the sub-requirements; Simultaneously, index logic analysis is performed on the query index sequence under each sub-requirement to determine the starting query index, the ending query index, the index implementation logic description corresponding to the query index sequence, and the strength of the association between indexes.
5. The water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning as described in claim 4, characterized in that, The acquisition of the water-saving demand intention map also includes: Based on the starting query index, the ending query index, and the index implementation corresponding to the query index sequence, the logical description and association strength are constructed to build the directed acyclic query dependency path corresponding to each sub-requirement. Based on the directed acyclic query dependency path corresponding to each sub-requirement, combined with the implementation logic order relationship in the sub-requirement association implementation path and the decomposition rules in the semantic decomposition path, a cross-path association connection is constructed between the directed acyclic query dependency paths corresponding to adjacent sub-requirements. Based on the cross-path association between adjacent sub-requirements and the directed acyclic query dependency path corresponding to each sub-requirement, the full path of the query index and the corresponding index logical relationship are constructed to obtain the water-saving demand intention graph.
6. A water-saving intelligent agent interactive control system based on knowledge-enhanced reasoning, used to implement the water-saving intelligent agent interactive control method based on knowledge-enhanced reasoning as described in any one of claims 1-5, characterized in that, include: Demand extraction unit, matching unit, evaluation unit, and execution unit; The demand extraction unit is used to obtain a water-saving demand intention map based on the user's input voice dialogue. The matching unit is used to perform a reverse matching operation in the initialized water-saving strategy feature tree according to the hierarchical relationship of the water-saving demand intention layer to obtain a candidate tree node set; The evaluation unit calculates the demand-strategy adaptation benefit of the candidate tree node set based on the candidate tree node set using a preset enhanced inference model. When all demand-strategy adaptation benefits meet the preset demand-strategy adaptation benefit threshold, a water-saving response scheme is output. If at least one candidate tree node does not meet the demand-strategy adaptation benefit threshold, a water-saving strategy that meets the conditions is generated based on the candidate tree node and the enhanced inference model, and then attached to the parent node of the candidate tree node. The execution unit is used to generate response instructions for the intelligent agent according to the water-saving response scheme, and execute the response instructions through the intelligent agent terminal to perform voice broadcasting or information display.