Data analysis system and method based on agent collaboration
By using a data analysis system based on intelligent agent collaboration, the problems of inaccurate semantic understanding and low reliability of SQL generation in the civil aviation settlement field have been solved, enabling efficient and reliable query analysis in complex business scenarios and improving the system's flexibility and practicality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ACCOUNTING CENT OF CHINA AVIATION LTD CO
- Filing Date
- 2025-11-27
- Publication Date
- 2026-04-21
AI Technical Summary
Existing intelligent data analysis systems in the civil aviation settlement field suffer from problems such as inaccurate semantic understanding, low reliability of SQL generation, weak support for multi-round interactions, and lagging knowledge updates, resulting in insufficient stability when processing complex settlement queries.
A data analysis system based on intelligent agent collaboration is adopted, which analyzes query tasks through the collaboration of multiple intelligent agents, including query request understanding, business concept clarification, exploration path generation and query instruction execution. Combined with a state machine decision-making mechanism, dynamic scheduling and information fusion are achieved to build a structured business insight report.
It significantly improves the parsing accuracy of natural language queries, enhances the system's flexibility and usability, ensures that user intent is accurately captured, solves the problems of semantic ambiguity and conceptual ambiguity in technical terms, and improves the reliability and execution efficiency of queries.
Smart Images

Figure CN121901263A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of aviation settlement technology, and in particular to a data analysis system and method based on intelligent agent collaboration. Background Technology
[0002] Against the backdrop of accelerated digitalization in the aviation industry, the civil aviation settlement system has generated massive amounts of professional data, such as revenue data, ticketing settlement records, and intermodal settlement bills. There is a significant technological gap between these data and business analysis needs.
[0003] Traditional intelligent data query systems based on natural language interfaces exhibit systemic limitations when processing settlement business analysis. These limitations are mainly manifested in key technical bottlenecks such as insufficient accuracy in understanding settlement business terminology, low quality of SQL generation for complex settlement logic, lagging updates to settlement rule knowledge, and lack of system robustness.
[0004] One existing technology is a rule-based template-based Text2SQL system. This system maps user-input natural language into SQL statements using predefined rules and templates. For example: The system has built-in templates for common questions, such as "Query sales figures for a certain region" which corresponds to SELECT sales FROM tableWHERE region = ?.
[0005] Keyword matching and syntactic analysis are used to identify query elements, which are then combined with database metadata to populate table names and fields in the template.
[0006] This existing technology suffers from several drawbacks: poor flexibility, only able to handle issues within predefined templates and unable to adapt to new query expressions; high maintenance costs, requiring manual updates to the rule base for business changes, making scalability difficult; shallow semantic understanding, unable to understand synonyms, contextual dependencies, and complex logical combinations; and a lack of self-optimization capabilities, as the system cannot learn from historical interactions and the knowledge base remains static.
[0007] Existing technology two is a Text2SQL system based on an end-to-end deep learning model. This system uses a sequence-to-sequence (Seq2Seq) or Transformer model to directly map natural language input to SQL output. For example: Use BERT or GPT models to encode user questions, then decode them to generate SQL tokens.
[0008] Train the model on a standard dataset (such as Spider) to improve its generalization ability.
[0009] The existing technology relies on a large amount of labeled data: model training requires high-quality <natural language, SQL> paired data, which is costly; black box decision-making: the generation process is unexplainable, and errors are difficult to trace and correct; lack of business logic integration: the model is only based on syntax and table structure, without incorporating business metrics and rules; weak support for multi-turn dialogue: most models are single-interaction and cannot handle context supplementation and confirmation.
[0010] In summary, existing intelligent data analysis in the civil aviation settlement field suffers from shortcomings such as low reliability of SQL generation, bias in semantic understanding, and a lack of effective mining and analysis of massive amounts of data. Summary of the Invention
[0011] This invention provides a data analysis system based on intelligent agent collaboration, applicable to the field of civil aviation data processing, to improve the accuracy of semantic understanding, the reliability of query analysis, execution efficiency and practicality. The system includes: a front-end, a context maintenance module, an intelligent agent scheduling module and a result synthesis module; The front end is used to: receive users' natural language query requests; The context maintenance module is used to: construct query tasks based on the natural language query request and manage the tasks; the task management includes tracking the task status; The agent scheduling module is used to: coordinate multiple agents to collaboratively analyze query tasks based on the task status obtained from the context maintenance module, and obtain the processing result of each agent through a preset state machine decision mechanism; the state machine decision mechanism is: combining the current agent's processing result and the current task status to determine the agent to be scheduled next; the multiple agents include agents for understanding query requests, agents for clarifying business concepts, agents for generating exploration paths, agents for converting exploration paths into query instructions and executing them, and agents for verifying query instructions and the execution results of query instructions; The results synthesis module is used to fuse the processing results of all agents and the natural language query request, and output an analysis report to the front end.
[0012] This invention provides a data analysis method based on intelligent agent collaboration, applicable to the field of civil aviation data processing, to improve the accuracy of semantic understanding, the reliability of query analysis, execution efficiency, and practicality. The method includes: Receive natural language query requests from users; A query task is constructed based on the natural language query request, and task management is performed; the task management includes tracking the task status. Using a pre-defined state machine decision-making mechanism, multiple agents are coordinated to collaboratively analyze and query tasks based on the task status, obtaining the processing result of each agent. The state machine decision-making mechanism is as follows: combining the current agent's processing result and the current task status, the agent to be scheduled next is determined. The multiple agents include an agent for understanding the query request, an agent for clarifying business concepts, an agent for generating exploration paths, an agent for converting exploration paths into query instructions and executing them, and an agent for verifying the query instructions and the execution results of the query instructions. The processing results of all intelligent agents and the natural language query request are fused to generate an analysis report.
[0013] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described data analysis method based on intelligent agent collaboration.
[0014] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned data analysis method based on agent collaboration.
[0015] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the aforementioned data analysis method based on intelligent agent collaboration.
[0016] This invention's agent-based collaborative data analysis system includes a front-end, a context maintenance module, an agent scheduling module, and a result synthesis module, applicable to business analysis in the civil aviation data field. Through agents for understanding query requests and clarifying business concepts, it can accurately understand query requests, effectively solving problems such as semantic ambiguity and conceptual vagueness in professional terminology in the civil aviation settlement field, significantly improving the parsing accuracy of natural language queries, and ensuring that user intent is accurately captured and expressed. Through agents for generating exploration paths, it can complete complex, multi-layered exploratory data analysis without technical background, enhancing the system's flexibility and practicality. Through agents for verifying query commands and their execution results, it effectively avoids common logical errors and performance issues in traditional Text2SQL systems, significantly improving query reliability, execution efficiency, and system robustness. This invention achieves efficient collaboration and state synchronization among multiple agents, ensuring the continuity, consistency, and completeness of task execution, significantly improving the overall system performance, query analysis reliability, execution efficiency, and practicality in complex business scenarios. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 This is a first schematic diagram of a data analysis system based on intelligent agent collaboration in an embodiment of the present invention; Figure 2 This is a second schematic diagram of a data analysis system based on intelligent agent collaboration in an embodiment of the present invention; Figure 3 This is a schematic diagram of the knowledge base layer of the data analysis system based on intelligent agent collaboration in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the implementation of the agent construction layer in the agent-based data analysis system according to an embodiment of the present invention. Figure 5 This is a schematic diagram of the workflow of the query understanding and term disambiguation agent in an embodiment of the present invention; Figure 6 This is a schematic diagram of the workflow of the business concept clarification agent in an embodiment of the present invention; Figure 7 This is a schematic diagram of the workflow of the analysis and planning agent in an embodiment of the present invention; Figure 8 This is a schematic diagram illustrating the workflow of querying, generating, and executing intelligent agents in an embodiment of the present invention; Figure 9 This is a schematic diagram illustrating the workflow of the intelligent agent for result verification and interpretation in this embodiment of the invention; Figure 10 This is a schematic diagram illustrating the workflow of the interactive learning and evolutionary intelligent agent in an embodiment of the present invention; Figure 11 This is a schematic diagram illustrating the principle of the context maintenance module in an embodiment of the present invention; Figure 12 This is a schematic diagram illustrating the principle of the intelligent agent scheduling module in an embodiment of the present invention; Figure 13 This is a schematic diagram of the principle of the result synthesis module in an embodiment of the present invention; Figure 14 This is a schematic diagram of the knowledge write-back mechanism in an embodiment of the present invention. Figure 1 ; Figure 15 This is a schematic diagram of the knowledge write-back mechanism in an embodiment of the present invention. Figure 2 ; Figure 16 This is a specific example diagram of a data analysis system based on intelligent agent collaboration in an embodiment of the present invention; Figure 17 This is a flowchart illustrating the data analysis method based on agent collaboration in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0019] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0020] First, the technical terms involved in the embodiments of the present invention will be explained.
[0021] Text2SQL: A technology that converts natural language queries into structured query language (SQL). In this embodiment of the invention, it refers to the intelligent agent module responsible for generating, validating, and executing SQL.
[0022] LLM: Large Language Model, used for natural language understanding and SQL generation.
[0023] Multi-turn dialogue: A dialogue mechanism that gradually clarifies the user's query needs through multiple interactions.
[0024] Intelligent agent: refers to any independent entity that can perceive the environment, make decisions and take actions to achieve a specific goal.
[0025] Multi-agent collaboration: Multiple agents cooperate to perform tasks in a shared environment.
[0026] Celery is a distributed task queue system written in Python for handling asynchronous and scheduled tasks.
[0027] Pandas is a powerful Python library for data analysis and processing.
[0028] This invention aims to explore the technical challenges and development paths of intelligent data analysis systems in the civil aviation settlement business scenario. Against the backdrop of accelerated digitalization in the aviation industry, civil aviation settlement systems generate massive amounts of professional data, such as revenue data, ticketing settlement records, and intermodal transport settlement bills. A significant technical gap exists between this data and the needs of business analysis. Traditional intelligent data query systems based on natural language interfaces exhibit systemic limitations when processing settlement business analysis, mainly manifested in key technical bottlenecks such as insufficient accuracy in understanding settlement business terminology, low quality of SQL generation for complex settlement logic, lagging updates to settlement rule knowledge, and a lack of system robustness.
[0029] At the technical architecture level, existing intelligent data analysis systems in the civil aviation settlement field suffer from three fundamental deficiencies: First, they lack complete support for exploratory analysis of settlement data, making it impossible to construct a complete analytical path from total revenue analysis down to specific route settlement details. Second, the depth of settlement business knowledge representation and settlement rules is insufficient, leading to fundamental difficulties in semantic parsing of settlement query intent and making it difficult to accurately understand the business logic of professional concepts such as "pending intermodal bills" and "abnormal ticketing settlements." Third, they lack dynamic evolution capabilities and execution reliability assurance mechanisms, making it impossible to continuously learn emerging settlement knowledge and business terms through interactive processes, and also making it difficult to implement effective syntax and logic verification on generated SQL statements. This results in insufficient system stability when dealing with complex settlement queries, seriously affecting its practical value in production environments.
[0030] The embodiments of the present invention aim to solve the following technical problems of existing intelligent data analysis systems in the field of civil aviation settlement: Inaccurate semantic understanding: How to transform users' ambiguous and diverse natural language questions into accurate and structured business queries.
[0031] Low reliability of SQL generation: How to ensure that the generated SQL syntax is correct and the logic conforms to business rules.
[0032] Weak support for multi-turn interactions: How to design systems to support contextual dialogue, supplementary confirmation, and requirement clarification.
[0033] Lagging knowledge updates: How to enable the system to continuously learn during operation and optimize the knowledge base and query logic.
[0034] The system integration is highly complex: how to seamlessly integrate natural language understanding, SQL generation, data querying and report generation.
[0035] Figure 1 This is a first schematic diagram of a data analysis system based on agent collaboration in an embodiment of the present invention, as shown below. Figure 1 As shown, the system 100 includes: a front-end 101, a context maintenance module 102, an agent scheduling module 103, and a result synthesis module 104; Frontend 101 is used to: receive users' natural language query requests; The context maintenance module 102 is used to: construct a query task based on the natural language query request and perform task management; the task management includes tracking the task status; The agent scheduling module 103 is used to: coordinate multiple agents to collaboratively analyze the query task based on the task status obtained from the context maintenance module 102, and obtain the processing result of each agent through a preset state machine decision mechanism; the state machine decision mechanism is: combining the current agent processing result and the current task status to determine the agent to be scheduled next; the multiple agents include agents for understanding query requests, agents for clarifying business concepts, agents for generating exploration paths, agents for converting exploration paths into query instructions and executing them, and agents for verifying query instructions and query instruction execution results; The result synthesis module 104 is used to: fuse the processing results of all agents and the natural language query request, and output an analysis report to the front end.
[0036] like Figure 1 As shown, the key technical point of this invention lies in constructing a multi-agent collaborative data analysis system with dynamic evolution capabilities, oriented towards the field of civil aviation settlement data. Its core lies not in the capabilities of a single agent, but in how to deeply integrate multiple specialized agents, structured knowledge bases, and business processes through systematic architectural design and collaborative mechanisms.
[0037] This invention provides a state machine-based dynamic scheduling mechanism for multiple agents in its agent scheduling module. The agent scheduling module can coordinate multiple agents to collaboratively analyze query tasks through a preset state machine decision-making mechanism. These multiple agents include agents for understanding query requests, agents for clarifying business concepts, agents for generating exploration paths, agents for converting exploration paths into query instructions and executing them, and agents for verifying query instructions and their execution results. The task states include, but are not limited to, one or any combination of the following: Initial state, semantic parsing in progress, concept clarification in progress, analysis and planning in progress, plan execution in progress, result verification in progress, task completion, task failure.
[0038] For example, based on the current state of the query task, we can determine what processing to perform next, thereby activating the corresponding agent. By combining the current query task state with multiple existing agents, we can implement a state machine-based approach (initial state). Analysis in progress Clarification in progress In the planning stage In progress Verification in progress A collaborative control process (completed / failed). This mechanism can dynamically trigger and schedule different agents based on context, achieving orderly, efficient, and reliable task execution, and solving the problem of task decomposition and process control in multi-agent systems.
[0039] Figure 2 This is a second schematic diagram of a data analysis system based on intelligent agent collaboration in an embodiment of the present invention, illustrating a system architecture diagram of an embodiment of the present invention. Figure 2 As shown, this embodiment of the invention proposes an exploratory business analysis solution driven by civil aviation settlement data based on a multi-agent collaborative mechanism. Its overall architecture includes a front-end layer, a back-end layer, a multi-agent collaborative layer, an agent construction layer, and a knowledge base layer. The core lies in the design of the six agents in the agent construction layer and the functional modules of the multi-agent collaborative layer. Combined with... Figure 1 , Figure 2 This invention introduces a data analysis system based on intelligent agent collaboration in an embodiment of the invention.
[0040] (1) Front end.
[0041] Frontend 101 is used at least for: receiving users' natural language query requests.
[0042] Front-end 101 can also realize intelligent report creation, data exploration, question and answer analysis.
[0043] Intelligent report generation: Automatically generates reports based on user needs, or allows users to design, configure, and generate reports independently through a graphical interface, supporting data visualization.
[0044] Data exploration and question-and-answer analysis: Users can ask questions in natural language, and the system will automatically parse and return data-driven business analysis results, enabling business analysis using natural language.
[0045] (2) Backend.
[0046] The backend handles business logic processing and system scheduling, and consists of three modules: Multi-agent platform access: Responsible for communicating with the multi-agent collaboration layer, transmitting user requests and obtaining processing results.
[0047] Conversation Management: Manages user conversation states, supports multi-turn Q&A, and maintains contextual coherence.
[0048] Report generation: Automatically generate structured reports based on query results or user configuration. For example, adjust the data format of reports output by the agent to adapt to the data format required by the front end.
[0049] (3) Multi-agent collaboration layer.
[0050] The multi-agent collaboration layer, serving as the collaborative hub of the intelligent analysis platform, has the core function of establishing standardized interaction protocols to organize heterogeneous agents into an organic whole capable of collaborative problem-solving. It provides the following core capabilities: Context maintenance module: As the state management center of the system, it provides a unified state awareness environment for multi-agent collaboration, ensuring the continuity of task execution and information consistency in dynamic, multi-round analysis sessions.
[0051] Intelligent agent scheduling module: As the core of the system's process execution, it adopts a state machine-based decision-making mechanism to realize the dynamic scheduling and collaborative control of multiple intelligent agents, ensuring that data analysis tasks are executed efficiently according to the preset business logic.
[0052] Results Synthesis Module: It undertakes the function of information fusion, and generates structured reports with business insights by deeply integrating the analytical outputs (processing results) generated by multiple agents.
[0053] (4) Agent construction layer.
[0054] The agent construction layer acts as a bridge between the upper and lower layers of the system, transforming the domain knowledge of the knowledge base layer into problem-solving capabilities. Through the specialized division of labor among multiple agents, it endows the system with three core capabilities: accurate understanding of fuzzy queries, path planning for complex analysis, and reliable verification of execution results. This ensures complete atomic operations throughout the entire process from "understanding user intent" to "delivering business insights." The agent used for query request understanding is referred to as the query understanding and terminology disambiguation agent; the agent used for business concept clarification is referred to as the business concept clarification agent; the agent used for generating exploration paths is referred to as the analysis and planning agent; the agent used for converting exploration paths into query instructions and executing them is referred to as the query generation and execution agent; and the agent used for verifying query instructions and their execution results is referred to as the result verification and interpretation agent. In one embodiment, the multiple agents also include an agent for interactive learning and evolution, referred to as the interactive learning and evolution agent.
[0055] Query understanding and terminology disambiguation agent: used to parse user natural language queries, identify and eliminate semantic ambiguity in professional terms in the civil aviation settlement field, and transform them into semantic representation units that can be accurately calculated within the system, laying an accurate semantic foundation for subsequent processing.
[0056] Business Concept Clarification Agent: Specifically designed to handle complex business concepts involved in queries. Through proactive dialogue and / or knowledge base invocation, it clarifies the business connotation, extension, and association rules of terminology concepts, ensuring that subsequent analysis is based on accurate and unambiguous business semantics.
[0057] Analysis and Planning Agent: Based on precise query semantics, it constructs a complete analysis path from macro data aggregation to micro details, generating a logically rigorous and efficient hierarchical analysis step sequence, providing systematic process support for exploratory data analysis.
[0058] The query generation and execution agent transforms abstract analysis steps into concrete, executable data manipulation commands, ensuring the syntactic correctness of the generated statements and the accuracy of the business logic. It is also responsible for scheduling the execution engine to complete the data retrieval task, ensuring the reliable execution of queries.
[0059] The result verification and interpretation agent performs multi-dimensional verification of data operation commands, including at least data integrity, logical consistency, and business compliance, and transforms numerical results into business insights with settlement semantics, thereby improving the understandability and decision support value of query analysis results.
[0060] Interactive learning and evolutionary intelligent agent: By monitoring the entire interaction process of the system, it identifies new business terms, new query patterns and new rule changes, dynamically updates the domain knowledge base, realizes the system's continuous learning and self-evolution, and enhances its adaptability to changes in the business environment.
[0061] (5) Knowledge base layer.
[0062] The knowledge base layer is the core semantic pillar and logical foundation of this system. By constructing a structured domain knowledge system, it formally encapsulates the complex civil aviation settlement business knowledge, providing accurate and computable knowledge supply for upper-layer intelligent applications. This aims to fundamentally solve basic defects such as ambiguous business semantics, missing analysis paths, and unreliable execution logic, and is a prerequisite for achieving accurate semantic parsing, intelligent analysis planning, and reliable query execution.
[0063] The knowledge base layer includes: The business entity and terminology database serves as the core semantic dictionary in the settlement domain. It is used to: define and store business entities, professional terms, and their semantic relationships in the aviation settlement domain, provide an accurate semantic mapping foundation for query understanding, and ensure the consistency between natural language and system concepts.
[0064] An analysis pattern library is used to: encapsulate typical aviation settlement data analysis patterns; the typical aviation settlement data analysis patterns include reusable analysis workflow templates corresponding to query requests with a query frequency higher than a preset frequency; for example, the analysis pattern library encapsulates predefined paths and reusable logical components for typical analysis scenarios, providing proven framework support for analysis planning and helping to quickly build a complete and efficient exploratory analysis process.
[0065] The rules and validation library is used to store aviation settlement business rules and data validation logic, providing a complete set of constraints for query generation and execution validation, and ensuring the accuracy and reliability of the system when processing complex settlement queries.
[0066] Figure 3This diagram illustrates the knowledge base layer of a data analysis system based on agent collaboration in this invention. The knowledge base layer loads a structured knowledge system for the civil aviation settlement field, aiming to address the problems of insufficient depth of civil aviation business knowledge and difficulties in semantic parsing. Knowledge sources include industry fundamentals, expert business process experience, and data models. Knowledge sources are extracted and vectorized to form a business entity and terminology library (text vectors), an analysis pattern library (text vectors / code templates), and a rule and validation library (text vectors / rule engine). The entire knowledge base is stored in a vectorized manner. Through knowledge retrieval of entities and terms, assembly of analysis path results, and enhancement of constraints and validation with prompt words, combined with RAG retrieval and assembly technology, external knowledge is dynamically integrated to achieve efficient and reliable knowledge services.
[0067] (1) Business entities and terminology database.
[0068] Content: Precisely define and store core concepts, entities, and relationships in the civil aviation settlement field. For example, clearly define pending interline bills (status: "verified but not paid"), abnormal ticket settlements (rules such as: the difference between the ticket price and the actual amount received is greater than 5%), and route settlement cycles, etc.
[0069] Function: To provide a unified business language and understanding standard for all intelligent agents, thereby improving the accuracy of semantic parsing directly from the source.
[0070] (2) Analyze the pattern library.
[0071] Content: Encapsulates typical settlement data analysis patterns. Examples include the "revenue drill-down analysis" pattern (total revenue -> regional revenue -> specific route revenue -> flight details) and the "anomaly detection" pattern (identifying invoices with mismatched amounts). These patterns are essentially reusable analysis workflow templates.
[0072] Function: Directly addresses the "lack of full support for exploratory analysis processes". When a user poses a macro-level question, the system can invoke preset analysis modes and automatically construct a step-by-step drill-down path.
[0073] (3) Rules and validation library.
[0074] Content: Stores settlement business rules, such as the revenue sharing ratio for intermodal transport settlements and special settlement rules for specific routes; stores data quality rules, such as key fields not being null and the value range of amount fields; stores SQL and logic validation rules, such as queries must include certain conditions to avoid full table scans and the validity of multi-table joins.
[0075] Function: To provide a basis for "execution reliability assurance", it is used to perform logical verification and performance optimization on the generated queries to ensure the correctness and efficiency of SQL.
[0076] Figure 4 This is a schematic diagram illustrating the implementation of the agent construction layer in a data analysis system based on agent collaboration, as described in an embodiment of the present invention. Figure 4 As shown, the agent construction layer is responsible for creating a series of highly specialized agents. It demonstrates a unified agent base class, including agent types such as agent_id, agent_type, and llm_backend, a list of callable tools, processing flow, and agent capability list settings. It solves complex problems through agent division of labor, involving a total of six agents.
[0077] (1) Query understanding and terminology disambiguation agent.
[0078] Function: To solve the fundamental difficulties of semantic parsing and accurately capture the core intent and business entities in user queries.
[0079] Specific functions: - Receive raw user input, such as "Help me find the intermodal bills that are pending".
[0080] - Perform entity recognition to accurately extract business terms such as "pending processing" and "intermodal bill".
[0081] - Collaborate with business concept clarification agents to eliminate polysemy (such as whether "settlement" refers to a process or a result) and terminological ambiguity.
[0082] - Output structured query intents, including: analysis target (find), business entity (intermodal bill), and filter criteria (status = pending).
[0083] In one embodiment, the agent for query request understanding, namely the query understanding and term disambiguation agent, is used to: Parse the user's natural language query request to obtain multiple business terms, each with a confidence level; For business terms with a confidence level below a set threshold, an explanation is requested from the agent used for clarifying business concepts. Based on the explanation provided by the agent used for clarifying business concepts, the business terms with a confidence level below the set threshold are corrected. The user query intent is represented in a structured manner based on all business terms; Based on the structured user query intent representation, interact with the agent used to generate the exploration path.
[0084] Figure 5 This is a schematic diagram illustrating the workflow of the query understanding and term disambiguation agent in an embodiment of the present invention, such as... Figure 5As shown, the query understanding and terminology disambiguation agent receives the user's original query, performs natural language understanding and basic semantic parsing, identifies business terms, extracts preliminary business terms, determines whether the confidence level of each business term is greater than a set threshold, and interacts with the business concept clarification agent for business terms less than or equal to the set threshold to request authoritative explanations. Finally, when all terms are greater than the set threshold, a terminology list is output, the user intent is structured, the query intent is standardized, and then the agent interacts with the analysis and planning agent.
[0085] (2) Business concept clarification agent.
[0086] Function: To serve as a "living dictionary" of business terminology, ensuring that the system's understanding of professional concepts is consistent with actual business practices.
[0087] In this embodiment, the intelligent agent used for clarifying business concepts is a business concept clarification intelligent agent, which is used for: Receive the explanation request from the intelligent agent used to understand the query request; The meaning of business terms with a confidence level below a set threshold is determined through proactive dialogue and knowledge base invocation, and then fed back to the intelligent agent used to understand the query request.
[0088] Specifically, the business concept clarification agent has the following functions: - This agent is activated when the query understanding and term disambiguation agent encounters ambiguous terms.
[0089] - Query the business entities and terminology database in the three-tier knowledge base to provide precise business definitions for terms. For example, clarify that "pending intermodal bill" in business terms refers to "a bill that has been verified and is awaiting financial payment, with its status field being AP_PENDING".
[0090] - When necessary, it can ask the user questions in reverse to clarify concepts, such as: "Do you mean 'abnormal settlement' because the amount does not match, or because it exceeds the settlement period?"
[0091] Figure 6 This is a schematic diagram of the workflow of the business concept clarification agent in an embodiment of the present invention, such as... Figure 6 As shown, the intelligent business concept clarification function receives a terminology clarification request, parses the request, queries the knowledge base, performs a deep search of the business entity and terminology database, and if a unique high-confidence definition is found, outputs the standard concept definition. If no unique high-confidence definition is found, it provides interactive clarification to the user, updates the session context, and finally outputs the final clarification result.
[0092] (3) Analyze and plan the intelligent agent.
[0093] Function: To address the lack of complete support for exploratory analysis processes, transforming analytical intentions into step-by-step actionable plans.
[0094] In this embodiment, the agent used to generate the exploration path, namely the analysis and planning agent, is used for: Receive structured user query intent representations; Based on the structured user query intent representation, subtasks are broken down to generate an executable plan that includes multiple steps.
[0095] For example, the analysis and planning agent can achieve the following functions: - Receive structured query intents.
[0096] - Query the "Analysis Pattern Library" in the three-layer knowledge base to match or combine the best analysis path. For example, for the requirement of "drilling down from total revenue to specific route details", the plan is automatically generated as follows: [Step 1: Query total revenue] -> [Step 2: Decompose by region] -> [Step 3: Target specific routes] -> [Step 4: Obtain flight-level details].
[0097] - Output a detailed, step-by-step analysis plan.
[0098] Figure 7 This is a schematic diagram of the workflow of the analysis and planning agent in an embodiment of the present invention, such as... Figure 7 As shown, the analysis and planning agent receives a structured query intent, breaks down the target, analyzes the list of elements, retrieves candidate strategies from the analysis pattern library, evaluates whether the candidate strategies are suitable for the answer, adopts a single best strategy as the core if a single optimal strategy is found, merges multiple pattern fragments if multiple pattern fragments are found, and generates a new strategy path based on a general strategy if no matching pattern is found. Finally, the strategy is transformed into a specific sequence of steps, and the feasibility of the plan is determined. If it is not feasible, the strategy and steps are readjusted until the plan is feasible, and the final analysis plan is output for execution and delivered to the query generation and execution agent.
[0099] (4) Query the generation and execution of intelligent agents.
[0100] Function: Transform each step in the analysis plan into executable, high-quality SQL and obtain the results.
[0101] In this embodiment, the agent used to convert the exploration path into query instructions and execute them, namely the query generation and execution agent, is used for: Obtain the executable plan and generate SQL statements based on the executable plan; The SQL statement is sent to the intelligent agent used to verify the query instruction and the execution result of the query instruction for verification. Once the verification is successful, the SQL statement is executed.
[0102] Specifically, the query generation and execution agent has the following functions: - Generate the corresponding SQL query statement based on the current step in the analysis plan.
[0103] - Before execution, the SQL is sent to the result validation and interpretation agent for pre-audit.
[0104] - Execute approved SQL statements and retrieve the execution results from the database.
[0105] - Return the execution results to the analysis plan and trigger the next step.
[0106] Figure 8 This is a schematic diagram illustrating the workflow of querying, generating, and executing intelligent agents in an embodiment of the present invention, such as... Figure 8 As shown, the query generation and execution agent receives the analysis plan, parses it, determines the current step to be executed, generates or regenerates the SQL, and after local verification, sends the SQL to the result verification agent for deep review. If the deep review passes, the SQL is executed with read-only permissions. If execution is successful, the results are cached or formatted; if execution fails, the error is recorded and the plan is marked as failed, until the analysis plan completes and returns all results. The analysis plan can exist in the form of a directed acyclic graph.
[0107] (5) Results verification and interpretation of the intelligent agent.
[0108] Function: Provides execution reliability assurance, ensuring the correctness and rationality of SQL and results.
[0109] In this embodiment, the intelligent agent used to verify the query command and the query command execution result, namely the result verification and interpretation intelligent agent, is used for: The SQL statements generated by the agent used to convert exploration paths into query instructions and execute them are subjected to syntax validation, logic validation, and security checks. After the SQL statement is executed, the reasonableness of the execution result data is judged, such as the reasonableness of specified indicator values in the execution result data.
[0110] For example, the result verification and interpretation agent has the following functions: - SQL pre-validation: Before executing a query, use rules, constraints and validation libraries to check the SQL syntax, logic (such as whether join conditions are missing), and potential performance issues (such as whether indexes are missing).
[0111] - Post-execution validation: After the query is executed, the distribution, magnitude, and key indicators of the returned data are assessed for reasonableness. For example, if the revenue of a certain route suddenly surges by 100 times, an anomaly alert will be triggered.
[0112] - Provide a preliminary explanation for abnormal situations, such as "The result is abnormal, possibly due to inaccurate association conditions leading to a Cartesian product of the data".
[0113] Figure 9 This is a schematic diagram illustrating the workflow of the intelligent agent for result verification and interpretation in an embodiment of the present invention, such as... Figure 9 As shown, the result verification and interpretation agent receives the SQL to be verified and its context, performs language, logic, and security checks, executes the plan and predicts resources. If a blocking error is found, it immediately rejects the query and returns error details. If no blocking error is found, it executes the SQL to obtain the result, performs statistical analysis and anomaly monitoring, and determines whether the data is reasonable and controllable. If reasonable and controllable, the verification passes and the verification result is returned. If unreasonable and uncontrollable, the result is marked as unreliable, an explanation is returned, and the verification result is returned.
[0114] (6) Interactive learning and evolutionary intelligent agents.
[0115] Function: To enable the system to evolve dynamically.
[0116] In one embodiment, the intelligent agent used for interactive learning and evolution, namely the interactive learning and evolution intelligent agent, is used to: identify new knowledge from the user's natural language query request and generate a knowledge write-back request; The result synthesis module is also used to: receive knowledge write-back requests and store the knowledge write-back requests in the context maintenance module; The agent scheduling module is also used to: when the context maintenance module stores knowledge write-back requests, schedule agents used for interactive learning and evolution to verify the uniqueness and consistency of the knowledge write-back requests, and after the verification is passed, execute knowledge updates for business entities, terminology base, and analysis pattern base.
[0117] Specifically, interactive learning and evolutionary intelligent agents have the following functions: - Monitor the entire interaction process, especially verifying anomalies and failed queries discovered by the agent, as well as proactive feedback from users.
[0118] - When new and effective analysis patterns are discovered, the analysis pattern library is updated.
[0119] - When new business terms are discovered or there are misunderstandings of existing terms, the business entities are driven to learn incrementally from the terminology database.
[0120] - When a new error mode is discovered, the driver rules, constraints and validation libraries add new validation rules.
[0121] Figure 10 This is a schematic diagram illustrating the workflow of the interactive learning and evolutionary intelligent agent in an embodiment of the present invention, such as... Figure 10As shown, the interactive learning and evolutionary agent monitors multi-agent interactions, collects session logs and feedback, classifies and analyzes candidate knowledge, evaluates confidence and value, and incrementally writes it into the knowledge base, including adding new terms and definitions, new business models, and new verification rules.
[0122] refer to Figure 2 The multi-agent collaboration layer employs three modules: context maintenance, agent scheduling, and result synthesis. Through standardized information exchange and state management mechanisms, it achieves end-to-end collaboration from user intent recognition to business insight generation.
[0123] The context maintenance module 102 is the central hub for state awareness and consistency maintenance in this system. During the collaborative solving of complex problems by multiple agents, it is used to share historical work records, aiming to solve the problems of fragmented analysis processes and semantic consistency breaks caused by dispersed task states and asynchronous information updates. Its core objective is to build a unified, persistent, and traceable context environment, providing coherent state support for exploratory analysis.
[0124] In one embodiment, the context maintenance module is used for the following task management: It receives all context operation requests; performs persistent storage, efficient retrieval, and cache management of context data; stores the processing results of each agent; and manages the version of the current query task.
[0125] Figure 11 This is a schematic diagram of the principle of the context maintenance module in an embodiment of the present invention, with reference to... Figure 11 External callers, such as the agent scheduling module 103 and various functional agents, can trigger context updates. The context maintenance module includes the following core components: - Context Magager: As the only external interface of the context maintenance module, it receives all context operation requests and coordinates other components to complete the corresponding tasks.
[0126] - Context Repository: Used for persistent storage, efficient retrieval, and cache management of context objects.
[0127] Version control: Ensures the atomicity and consistency of context updates in a concurrent environment, preventing state overwriting.
[0128] The agent scheduling module 103 is the process engine and collaborative control center of this system. It transforms abstract analysis tasks into concrete, executable agent call sequences, coordinating multiple agents to complete complex analysis tasks in an orderly and efficient manner through a state machine-based decision-making model. Its core objective is to solve the problems of task decomposition, scheduling decisions, and exception handling in multi-agent systems, ensuring the reliability, efficiency, and consistency of the entire analysis process.
[0129] In this embodiment, the intelligent agent scheduling module is also used to: monitor various anomalies during the scheduling process and provide retry, degradation or termination handling strategies.
[0130] Figure 12 This is a schematic diagram illustrating the principle of the agent scheduling module in an embodiment of the present invention, as shown below. Figure 12 As shown, the external caller is the user interface. User queries are transmitted to the agent scheduling module. The core components of the agent scheduling module include the scheduler entry point and the scheduling decision state machine.
[0131] Scheduler entry point: Receives user query requests, initializes the scheduling process, and serves as a unified interface for interaction with external systems.
[0132] Scheduling Decision State Machine: The core of the agent scheduling module, it defines the complete lifecycle states and transition conditions for task execution. Refer to Table 1 for the state definitions and transition triggers.
[0133] Table 1
[0134] Semantic parsing control flow: This function specifically handles the agent scheduling logic during the natural language understanding phase, ensuring that user intent is accurately captured.
[0135] Execution verification control flow: This function specifically handles the agent scheduling logic during the data query and verification phases, ensuring the reliability of the query and the reasonableness of the results.
[0136] Exception handler: Manages various exceptions that occur during the scheduling process and provides handling strategies such as retry, downgrade (reducing priority) or termination.
[0137] The agent scheduling module reads context information and task status from the context maintenance module, determines and activates the agent cluster; multiple agents form an agent cluster.
[0138] The results synthesis module 104 is the final output and value packager of the intelligent analysis pipeline. It is responsible for collecting and refining the work results of all preceding agents, integrating raw data, intermediate conclusions, and business logic into a decision analysis report that can be directly understood and used by business personnel.
[0139] In this embodiment, the result synthesis module is specifically used to: obtain the processing results of each agent from the context maintenance module, extract the complete analysis trajectory and intermediate results, and use a narrative generation algorithm based on a large language model to obtain a structured analysis report.
[0140] The narrative generation algorithm based on a large language model specifically uses a large language model to automatically create coherent and logical stories or structured content through specific rules and processes. Its core lies in using a large language model as a foundation to standardize and optimize the narrative generation process, ultimately achieving efficient and high-quality automatic narrative output. During processing, the core theme and narrative framework of the narrative are first clarified, then guided to organize the content according to timeline and causal relationships. Simultaneously, a feedback mechanism optimizes the language style (e.g., formal, colloquial, suspenseful) to ensure that the generated narrative not only meets the requirements but also possesses natural and fluent human expressive characteristics.
[0141] Figure 13 This is a schematic diagram of the principle of the result synthesis module in an embodiment of the present invention, such as... Figure 13 As shown, after the scheduling request and analysis context, the result synthesis module obtains a structured analysis report through information fusion and narrative generation. Information fusion includes extraction, association, and refinement. Based on this, narrative generation further summarizes the content, provides in-depth analysis, and offers decision-making suggestions, thereby transforming raw information into understandable and actionable intelligent output.
[0142] The following is an example of an interactive process, including: Phase 1 semantic parsing closed loop, Phase 2 analysis and planning, Phase 3 execution and verification, and Phase 4 value synthesis.
[0143] 1. Phase 1 semantic parsing closed loop.
[0144] Users perform natural language queries on the front end, such as "analyze abnormal settlements on high-value routes." The context maintenance module creates a session context, activates the query understanding and terminology disambiguation agent, and performs preliminary deconstruction and entity recognition on the user's original semantics. When semantic ambiguity or conceptual ambiguity is detected in the user's query, the business concept clarification agent is immediately triggered to initiate a collaborative disambiguation mechanism, calling the business concept clarification agent to interpret the ambiguous terms. Finally, the context (term definition) is updated in the context maintenance module. This process, through the context maintenance module, achieves dynamic iteration and state synchronization of term definitions, constructing a continuously optimized semantic unified field, ensuring that the distributed agents operate within a unified semantic understanding framework. This closed-loop design solves the fundamental difficulty of semantic parsing caused by insufficient depth of domain knowledge representation from the source of cognition.
[0145] 2. Phase Two Analysis and Planning.
[0146] After semantic normalization, the agent scheduling module activates the analysis planning agent. This agent queries the domain analysis pattern library, matches the optimal deconstruction strategy, and returns a step-by-step analysis plan. Based on a preset exploratory analysis workflow template, the system generates multi-granularity analysis paths with logical progression, forming a complete exploration chain from macro-indicators to micro-entities. This planning scheme is persistently stored in the context manager, providing structured guidance for subsequent execution phases, thus addressing the shortcomings of traditional systems in supporting exploratory analysis processes.
[0147] 3. Phase Three: Execution and Verification.
[0148] As the core guarantee mechanism for system reliability, this phase adopts a dual-verification architecture. For each step in the analysis plan, the agent scheduling module strictly follows the standardized process of "generation-pre-verification-execution-post-verification": First, the query generation and execution agent is scheduled to produce an initial query plan (returning SQL). Then, the result verification and interpretation agent is forcibly invoked synchronously to pre-execute verify the syntax, logic, and performance of the SQL. The query generation and execution agent is then invoked to execute the SQL, and the query generation and execution agent returns the execution result. After execution, the data rationality verification process for the result is forcibly started again, and the result verification and interpretation agent returns the verification conclusion. The Context (step result) of the context maintenance module is updated synchronously.
[0149] This closed-loop control mechanism based on rules and a validation library systematically improves the execution stability and result reliability in complex query environments through dual security protection of feedforward and feedback.
[0150] 4. Stage Four: Value Synthesis.
[0151] Once the distributed agent completes all analysis tasks, the agent scheduling module activates the result synthesis module (engine). This component uses multi-source information fusion technology to extract the complete analysis trajectory and intermediate results from the context manager. It then employs a narrative generation algorithm based on a large language model to transform discrete data points into logically coherent business insights. The final output is a structured report integrating core findings, attribution analysis, and decision recommendations, automatically equipped with multimodal visualization components. This achieves a value enhancement from data querying to decision support, fully delivering the end-user value of exploratory analysis.
[0152] In this embodiment of the invention, the knowledge write-back mechanism provides two knowledge write-back methods. Figure 14 This is a schematic diagram of the knowledge write-back mechanism in an embodiment of the present invention. Figure 1 This demonstrates the path of interactive learning-driven rewriting to learn new knowledge.
[0153] 1. Identification and Proposal (User) Interactive learning and evolutionary intelligent agents Result Synthesis Module Context maintenance module): - New terminology was used for user interaction with the system.
[0154] - Interactive learning and evolutionary agents monitor dialogues and identify new knowledge, generating [knowledge rewrite proposals].
[0155] - The proposal is submitted to the result synthesis module, which triggers the context maintenance module to store the proposal, and the proposal is stored in the context maintenance module.
[0156] 2. Scheduling and Verification (Context Maintenance Module) Intelligent agent scheduling module Interactive learning and evolutionary intelligent agents): - Events triggered by the context maintenance module are captured by the agent scheduling module.
[0157] - The agent scheduling module schedules interactive learning and evolution. The agent itself verifies the proposal (uniqueness and consistency checks).
[0158] 3. Execute write-back (interactive learning and evolutionary intelligent agent) Knowledge base layer): - After the interactive learning and evolutionary agent verification is passed, a write operation is directly performed on the knowledge base layer to update the "business entity and terminology base" or "analysis pattern base".
[0159] - The confirmation message will be returned via the original path.
[0160] Figure 15 This is a schematic diagram of the knowledge write-back mechanism in an embodiment of the present invention. Figure 2 ,like Figure 15 As shown, the path for executing the verification driver write-back is illustrated, which improves reliability.
[0161] 1. Identification and Proposal (Result Verification and Interpretation by the Intelligent Agent) Result Synthesis Module Context maintenance module): - When analyzing data manipulation commands, the intelligent agent for result verification and interpretation identifies SQL logic errors or optimization points and generates a rule write-back proposal.
[0162] Similarly, the proposal is submitted to the context maintenance module via the results synthesis module.
[0163] 2. Scheduling and Verification (Context Maintenance Module) Intelligent agent scheduling module Interactive learning and evolutionary intelligent agents): - The agent scheduling module also schedules interactive learning and evolution agents to be responsible for verifying this rule proposal (effectiveness and generality).
[0164] 3. Execute write-back (Agent scheduling module) Knowledge base layer): - and Figure 14 The key difference between the paths lies in the execution endpoints of the rule writeback.
[0165] - After the interactive learning and evolutionary agent verification is successful, the results are fed back to the agent scheduling module, which acts as the scheduling center and finally writes the instructions into the "rules and verification library". This emphasizes the authority and centralized control of rule updates.
[0166] - The confirmation message will be returned via the original path.
[0167] That is, the intelligent agent for interactive learning and evolution described in this embodiment of the invention is used to: receive scheduling from the intelligent agent scheduling module, and perform data verification logic on the new aviation settlement business entities, professional terms and their semantic relationships, new aviation settlement data analysis modes, and new aviation settlement business rules and data operation instructions to be written into the knowledge base layer, including verification of consistency, validity, and universality. After the verification is passed, the knowledge is written back to the corresponding database (business entity and terminology database, analysis mode database, rule and verification database).
[0168] Figure 16 This is a specific example diagram of a data analysis system based on agent collaboration in an embodiment of the present invention, as shown below. Figure 16 As shown, the front-end layer uses Vue.js to implement the user interface, supporting intelligent report creation and data exploration Q&A. The back-end uses the Java Spring framework, communicating with the front-end via HTTP and handling multi-agent access, session management, and report generation. The multi-agent collaboration layer is implemented in Python, integrating Redis and MongoDB for context maintenance, and combining Celery and Pandas for data processing. A unified agent invocation protocol coordinates the task scheduling, context maintenance, and result synthesis of multiple agents.
[0169] The intelligent agent construction layer relies on a dynamic multi-tool collaboration and process orchestration framework to build multiple intelligent agents with functions including query understanding, terminology disambiguation, analysis planning, query execution, result interpretation, and interactive learning. It utilizes ChromaDB and LLM to achieve semantic understanding and intelligent interaction. The bottom-level knowledge base layer employs multiple databases such as MongoDB, PostgreSQL, and Neo4j to store business entities, analysis patterns, rules, and validation knowledge, providing structured and graph-based data support for the upper-layer intelligent agents.
[0170] The overall solution, through the organic combination of layered design and technology stack, realizes full-link capabilities from user interaction, business logic processing, multi-agent collaboration to knowledge support, and builds a scalable and highly cohesive intelligent data analysis system.
[0171] The following is an example illustrating the system's collaborative processing flow.
[0172] 1. Scenario and Problem Definition.
[0173] The user submits a natural language query to the system: "Analyze the pending interline bills for region Y last month and drill down to the abnormal ticketing settlement details involving AA Airlines."
[0174] 2. Detailed explanation of the system's collaborative processing flow.
[0175] 2.1 Initial stage: Task reception and context initialization of the multi-agent collaboration layer.
[0176] Action: The user's query request first reaches the multi-agent collaboration layer.
[0177] The core role of the collaboration layer is manifested in: - Context Maintenance Module: Immediately creates a new Session Context, assigns a unique ID to the session, and records metadata such as the original text and timestamp of the initial query. This context will serve as the "shared workspace" and "state logbook" for this task execution.
[0178] - Agent Scheduling Module: Performs an initial evaluation of the query, identifying it as an "analytical task requiring in-depth analysis and planning." Based on pre-defined state machine rules, the scheduling module decides to initiate the first stage of the processing flow—semantic understanding. Therefore, it issues a call instruction to the query understanding and term disambiguation agent in the agent construction layer, associating the session context with it.
[0179] 2.2 Semantic parsing stage: accurate understanding under coordinated scheduling.
[0180] Action 1: The query understanding and terminology disambiguation agent is activated by the scheduling module.
[0181] - Function Execution: The agent performs word segmentation, entity recognition, and semantic role labeling on the query. When it recognizes technical terms such as "pending intermodal bill" or "abnormal ticketing settlement," it consults the business entities and terminology database in the knowledge base layer.
[0182] - Knowledge Base Support: The terminology base provides precise definitions for these concepts. For example, "Pending Interline Bill" maps to the Interline_Bill entity, and its status attribute must be pending; "Abnormal Ticket Settlement" is associated with the Ticket_Settlement entity and linked to a business rule Abnormal_Rule_001 in the rules and validation base (which may be defined as: the settlement amount deviates from the agreed amount by more than 5%, or the ticket status is 'disputed').
[0183] - Interacting with the collaboration layer: The agent will send the parsed structured semantic elements (such as: time range: last month, region: Y region, business entity: Interline_Bill[status=pending], drill-down target: Ticket_Settlement[abnormal=True] AND airline=AA) back to the context maintenance module for updating.
[0184] Action 2: The agent scheduling module detected that the "semantic parsing" state has been completed, but based on the context, the rule of the concept "abnormal ticketing settlement" may have multiple interpretations and needs to be clarified.
[0185] - Scheduling decision: The scheduling module then activates the business concept clarification agent.
[0186] Action 3: Clarify business concepts and involve intelligent agents.
[0187] - Function Execution: The agent reads ambiguous concepts in the context and interacts with the user through a pre-set dialogue strategy. For example, it asks the user: "The system has detected 'abnormal ticket settlement.' Do you specifically mean 'settlement amount deviation exceeds 5%,' or does it also include 'ticket status is disputed'?"
[0188] - Interaction with the collaboration layer: After the user replies "including both", the agent updates this explicit business rule (Abnormal_Rule_001: (variance > 5%) OR (status = 'disputed')) to the context maintenance module. This completely solves the fundamental difficulty of semantic parsing.
[0189] 2.3 Analysis, Planning and Execution Phase: Reliable path generation and query under collaborative control.
[0190] Action 1: After confirming that all concepts have been clarified, the agent scheduling module triggers the analysis and planning of agents.
[0191] - Function Execution: The agent accesses the analysis pattern library in the knowledge base layer based on refined semantic elements in the context. A predefined analysis pattern named "RegionalBillToTicketDrillDown" is matched and instantiated in the pattern library. This pattern provides a standardized exploration path: Step 1: Summarize the total number and amount of pending intermodal bills for region Y last month.
[0192] Step 2: Drill down from these bills to list all ticket settlement records involving AA Airlines.
[0193] Step 3: Apply "abnormal rules" to the above records to filter out abnormal details.
[0194] - Interacting with the collaboration layer: The generated step-by-step analysis plan is saved as a key node in the context maintenance module, providing a complete and traceable path for the entire exploratory analysis.
[0195] Action 2: The agent scheduling module schedules, queries, generates, and executes agents sequentially according to the steps of the analysis plan.
[0196] - Function Execution: The agent translates each step of the analysis plan into an SQL query.
[0197] Before executing the SQL, the agent calls the rules and validation library to validate the generated SQL. The validation library not only checks the syntax correctness but also performs logical verification, such as confirming whether the table join relationships are correct and whether the enumerated value for "region Y" exists. Only after passing the validation does the agent send the query to the data engine for execution.
[0198] - Interacting with the collaboration layer: The execution result (dataset or state) of each step is returned and stored in the context maintenance module to ensure that subsequent steps can be based on the correct mediation result.
[0199] 2.4 Results Synthesis and Learning Phase: Insight Delivery and System Evolution under Collaborative Management.
[0200] Action 1: Once all analysis steps are completed, the agent scheduling module activates the result verification and interpretation agent.
[0201] - Function Execution: The agent retrieves the raw data results from the context and then interfaces with the rule and validation library and the business entity and terminology library for verification and interpretation. For example, it verifies the completeness of the result data (whether there are missing routes) and uses the terminology library to translate the field name ticket_id into "ticket number" and interpret the status code disputed into "disputed status".
[0202] - Interact with the collaboration layer: Generate a preliminary, human-readable explanation with business semantics, such as "A total of 25 abnormal records were found, of which 15 were due to amount discrepancies and 10 were due to being in dispute", and update the context.
[0203] Action 2: The agent scheduling module finally calls the result synthesis module.
[0204] - Function Execution: This module is not an intelligent agent, but rather an integration component within the collaboration layer. It extracts all outputs of this task from the context maintenance module: the original query, parsed semantics, analysis plan, execution results of each step, verification explanations, etc. It integrates this information to generate a final structured analysis report. The report includes an execution summary, a detailed list of anomalies, and knowledge-based business recommendations (such as "It is recommended to prioritize processing 10 disputed bills to avoid settlement delays").
[0205] Action 3 (Continuous): Throughout the entire process, the interactive learning and evolutionary agent is constantly monitored in the background by the agent scheduling module at a low priority.
[0206] - Function Execution: It monitors dialogue and interaction logs. For example, if it detects that a user has used the new term "electronic ticket" multiple times, which is not defined in the terminology database, it will record it as a candidate term to be learned. After judging according to a certain confidence threshold, it will initiate a knowledge update process, requesting administrator approval or formally learning this new term and its context into the business entity and terminology database, thereby realizing the dynamic evolution of the system.
[0207] In summary, the embodiments of the present invention propose the following key technical means.
[0208] (1) Multi-agent dynamic scheduling mechanism based on state machine.
[0209] A state machine-based collaborative control process driven by an agent scheduling module was designed. This mechanism can dynamically trigger and schedule different agents based on context, achieving orderly, efficient, and reliable task execution, and solving the challenges of task decomposition and process control in multi-agent systems.
[0210] (2) Construction and application of a three-layer structured domain knowledge base.
[0211] A three-tiered knowledge system was constructed, consisting of a business entity and terminology database, an analysis pattern database, and a rule and validation database. This knowledge base is not only a static resource storage, but also the core basis for driving intelligent agents to perform semantic understanding, analysis planning, SQL generation, and result verification, fundamentally solving the problems of ambiguous business semantics and missing logical rules.
[0212] (3) Closed-loop collaboration of semantic parsing and business concept clarification by two agents.
[0213] By collaborating with a query understanding and terminology disambiguation agent and a business concept clarification agent, a closed-loop interactive process of "identification-consultation-clarification-confirmation" is formed. This mechanism can proactively identify and resolve terminological ambiguities in natural language, ensuring the system accurately captures professional query intentions.
[0214] (4) SQL reliability assurance closed loop of “generation-pre-verification-execution-post-verification”.
[0215] During the query generation and execution phases, a result verification and interpretation agent is forcibly introduced to perform pre-SQL validation and post-result validation, forming a dual protection mechanism. This closed loop effectively ensures the syntactic correctness of the generated SQL, the rationality of the business logic, and the credibility of the execution results.
[0216] (5) Context maintenance module-driven full-process state management and consistency guarantee.
[0217] The context maintenance module provides a unified "shared working memory" for the entire multi-agent collaborative process, enabling the persistence and version management of session states, intermediate results, and analysis plans, thus ensuring the consistency and traceability of information in multi-round, exploratory analysis tasks.
[0218] (6) Interactive learning and dynamic update mechanism of knowledge base driven by evolutionary intelligent agents.
[0219] The system is designed with a knowledge write-back mechanism that is monitored and triggered by interactive learning and evolutionary intelligent agents. It can automatically identify new terms, new rules and new patterns, and dynamically update the knowledge base after verification, so that the system has the ability to continuously learn and adapt to business, and realize the leap from using the system to system evolution.
[0220] This invention also provides a data analysis method based on agent collaboration, as described in the following embodiments. Since the principle behind this method is similar to that of the agent-based collaborative data analysis system, its implementation can be found in the implementation of the agent-based collaborative data analysis system; details that are repeated will not be elaborated upon.
[0221] Figure 17This is a flowchart illustrating a data analysis method based on agent collaboration in an embodiment of the present invention. This method is applied to a data analysis system based on agent collaboration, such as... Figure 17 As shown, the method includes: Step 1701: Receive the user's natural language query request; Step 1702: Construct a query task based on the natural language query request and perform task management; the task management includes tracking the task status; Step 1703: Using a preset state machine decision-making mechanism, coordinate multiple agents to collaboratively analyze the query task based on the task state, and obtain the processing result of each agent; the state machine decision-making mechanism is as follows: combining the current agent's processing result and the current task state, determine the agent to be scheduled subsequently; the multiple agents include an agent for understanding the query request, an agent for clarifying business concepts, an agent for generating exploration paths, an agent for converting exploration paths into query instructions and executing them, and an agent for verifying the query instructions and the execution results of the query instructions; Step 1704: Perform information fusion on the processing results of all agents and the natural language query request, and output an analysis report.
[0222] In one embodiment, the task state includes one or any combination of the following: Initial state, semantic parsing in progress, concept clarification in progress, analysis and planning in progress, plan execution in progress, result verification in progress, task completion, task failure.
[0223] In one embodiment, the method further includes pre-constructing a knowledge base layer, the knowledge base layer comprising: A business entity and terminology database is used to define and store business entities, technical terms, and their semantic relationships in the field of aviation settlement. An analysis pattern library is used to: encapsulate typical aviation settlement data analysis patterns; the typical aviation settlement data analysis patterns include reusable analysis workflow templates corresponding to query requests with a query frequency higher than a preset frequency; The rules and validation library is used to store aviation settlement business rules and data validation logic.
[0224] In one embodiment, constructing a query task based on the natural language query request and performing task management includes: It receives all context operation requests; performs persistent storage, efficient retrieval, and cache management of context data; stores the processing results of each agent; and manages the version of the current query task.
[0225] In one embodiment, the method further includes: monitoring various anomalies during the scheduling process and providing retry, degradation, or termination handling strategies.
[0226] In one embodiment, the processing results of all agents and the natural language query request are fused to output an analysis report, including: obtaining the processing results of each agent, extracting the complete analysis trajectory and intermediate results, and using a narrative generation algorithm based on a large language model, combined with the natural language query request, to obtain a structured analysis report.
[0227] In one embodiment, the intelligent agent for querying and understanding requests is used to: Parse the user's natural language query request to obtain multiple business terms, each with a confidence level; For business terms with a confidence level below a set threshold, an explanation is requested from the agent used for clarifying business concepts. Based on the explanation provided by the agent used for clarifying business concepts, the business terms with a confidence level below the set threshold are corrected. The user query intent is represented in a structured manner based on all business terms; Based on the structured user query intent representation, interact with the agent used to generate the exploration path.
[0228] In one embodiment, the intelligent agent for clarifying business concepts is used to: Receive the explanation request from the intelligent agent used to understand the query request; The meaning of business terms with a confidence level below a set threshold is determined through proactive dialogue and knowledge base invocation, and then fed back to the intelligent agent used to understand the query request.
[0229] In one embodiment, the agent for generating the exploration path is used to: Receive structured user query intent representations; Based on the structured user query intent representation, subtasks are broken down to generate an executable plan that includes multiple steps.
[0230] In one embodiment, the agent for converting the exploration path into query instructions and executing them is used to: Obtain the executable plan and generate SQL statements based on the executable plan; The SQL statement is sent to the intelligent agent used to verify the query instruction and the execution result of the query instruction for verification. Once the verification is successful, the SQL statement is executed.
[0231] In one embodiment, the intelligent agent used to verify the query instruction and the query instruction execution result is used to: The SQL statements generated by the agent used to convert exploration paths into query instructions and execute them are subjected to syntax validation, logic validation, and security checks. After the SQL statement is executed, the reasonableness of the execution result data is judged.
[0232] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described data analysis method based on intelligent agent collaboration.
[0233] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned data analysis method based on agent collaboration.
[0234] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the aforementioned data analysis method based on intelligent agent collaboration.
[0235] This invention, through the construction of a civil aviation settlement data-driven exploratory business data analysis system based on a multi-agent collaborative mechanism, achieves full-process intelligentization and automation from natural language understanding to business insight generation, and possesses the following significant beneficial effects: 1. Improved precision in semantic understanding.
[0236] By working collaboratively with query understanding and terminology disambiguation agents and business concept clarification agents, and combining structured business entities and terminology databases, the system effectively solves problems such as semantic ambiguity and conceptual ambiguity in professional terms in the civil aviation settlement field, significantly improving the parsing accuracy of natural language queries and ensuring that user intent is accurately captured and expressed.
[0237] 2. The reliability of SQL generation and execution has been significantly improved.
[0238] By introducing a result verification and interpretation agent, the SQL statement is validated in multiple dimensions of syntax, logic and business rules before and after execution. This effectively avoids common problems in traditional Text2SQL systems, such as logical errors and low performance, and greatly improves the reliability of queries, execution efficiency and system robustness.
[0239] 3. Supports multi-round exploratory analysis paths.
[0240] Based on a predefined library of analytical patterns, the analytical planning agent can automatically construct a complete analytical path from macroscopic indicators to microscopic entities, enabling users to complete complex, multi-level exploratory data analysis without technical background, thus enhancing the system's flexibility and practicality.
[0241] 4. Possesses the ability to continuously learn and dynamically evolve.
[0242] Interactive learning and evolutionary agents monitor the system's interaction process, identify new terms, rules, and patterns, and dynamically update the knowledge base, enabling the system to have self-optimization and business adaptability. This effectively solves the problems of lagging knowledge updates and high maintenance costs in traditional systems.
[0243] 5. Multi-agent collaborative mechanism improves overall system performance.
[0244] Through three collaborative modules—context maintenance, agent scheduling, and result synthesis—efficient collaboration and state synchronization among multiple agents are achieved, ensuring the continuity, consistency, and integrity of task execution, and significantly improving the overall system performance and user experience in complex business scenarios.
[0245] 6. Lower the barrier to entry for business personnel and improve decision-making efficiency.
[0246] Through natural language interfaces and the generation of visual reports, business personnel without technical backgrounds can independently complete complex data query and analysis tasks, which greatly reduces the technical threshold of data analysis, shortens the cycle from data to decision, and has significant practical value and promotion prospects.
[0247] 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.
[0248] 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.
[0249] 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.
[0250] 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.
[0251] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data analysis system based on agent collaboration, characterized in that, include: The module consists of a front-end, a context maintenance module, an agent scheduling module, and a result synthesis module. The front end is used to: receive users' natural language query requests; The context maintenance module is used to: construct query tasks based on the natural language query request and manage the tasks; the task management includes tracking the task status; The agent scheduling module is used to: coordinate multiple agents to collaboratively analyze query tasks based on the task status obtained from the context maintenance module, and obtain the processing result of each agent through a preset state machine decision mechanism; the state machine decision mechanism is: combining the current agent's processing result and the current task status to determine the agent to be scheduled next; the multiple agents include agents for understanding query requests, agents for clarifying business concepts, agents for generating exploration paths, agents for converting exploration paths into query instructions and executing them, and agents for verifying query instructions and the execution results of query instructions; The results synthesis module is used to fuse the processing results of all agents and the natural language query request, and output an analysis report to the front end.
2. The system as described in claim 1, characterized in that, The task status includes one or any combination of the following: Initial state, semantic parsing in progress, concept clarification in progress, analysis and planning in progress, plan execution in progress, result verification in progress, task completion, task failure.
3. The system as described in claim 1, characterized in that, The system also includes a knowledge base layer, which comprises: A business entity and terminology database is used to define and store business entities, technical terms, and their semantic relationships in the field of aviation settlement. An analysis pattern library is used to: encapsulate typical aviation settlement data analysis patterns; the typical aviation settlement data analysis patterns include reusable analysis workflow templates corresponding to query requests with a query frequency higher than a preset frequency; The rules and validation library is used to store aviation settlement business rules and data validation logic.
4. The system as described in claim 3, characterized in that, The plurality of intelligent agents also includes intelligent agents for interactive learning and evolution; Intelligent agents used for interactive learning and evolution are used to: identify new knowledge from users' natural language query requests and generate knowledge write-back requests; The result synthesis module is also used to: receive knowledge write-back requests and store the knowledge write-back requests in the context maintenance module; The agent scheduling module is also used to: when the context maintenance module stores knowledge write-back requests, schedule agents used for interactive learning and evolution to verify the uniqueness and consistency of the knowledge write-back requests, and after the verification is passed, execute knowledge updates for business entities, terminology base, and analysis pattern base.
5. The system as described in claim 1, characterized in that, The context maintenance module is used for the following task management: It receives all context operation requests; performs persistent storage, efficient retrieval, and cache management of context data; stores the processing results of each agent; and manages the version of the current query task.
6. The system as described in claim 1, characterized in that, The intelligent agent scheduling module is also used to: monitor various anomalies during the scheduling process and provide retry, degradation or termination handling strategies.
7. The system as described in claim 5, characterized in that, The results synthesis module is specifically used to: obtain the processing results of each agent from the context maintenance module, extract the complete analysis trajectory and intermediate results, and use a narrative generation algorithm based on a large language model to obtain a structured analysis report.
8. The system as described in claim 1, characterized in that, The intelligent agent used for understanding the query request is used to: Parse the user's natural language query request to obtain multiple business terms, each with a confidence level; For business terms with a confidence level below a set threshold, an explanation is requested from the agent used for clarifying business concepts. Based on the explanation provided by the agent used for clarifying business concepts, the business terms with a confidence level below the set threshold are corrected. The user query intent is represented in a structured manner based on all business terms; Based on the structured user query intent representation, interact with the agent used to generate the exploration path.
9. The system as described in claim 8, characterized in that, The intelligent agent used for clarifying business concepts is used for: Receive the explanation request from the intelligent agent used to understand the query request; The meaning of business terms with a confidence level below a set threshold is determined through proactive dialogue and knowledge base invocation, and then fed back to the intelligent agent used to understand the query request.
10. The system as described in claim 8, characterized in that, The agent used to generate the exploration path is used for: Receive structured user query intent representations; Based on the structured user query intent representation, subtasks are broken down to generate an executable plan that includes multiple steps.
11. The system as claimed in claim 10, characterized in that, The intelligent agent used to convert the exploration path into query instructions and execute them is used for: Obtain the executable plan and generate SQL statements based on the executable plan; The SQL statement is sent to the intelligent agent used to verify the query instruction and the execution result of the query instruction for verification. Once the verification is successful, the SQL statement is executed.
12. The system as claimed in claim 11, characterized in that, The intelligent agent used to verify the query command and the query command execution result is used for: The SQL statements generated by the agent used to convert exploration paths into query instructions and execute them are subjected to syntax validation, logic validation, and security checks. After the SQL statement is executed, the reasonableness of the execution result data is judged.
13. A data analysis method based on agent collaboration, characterized in that, include: Receive natural language query requests from users; Query tasks are constructed and managed based on the natural language query requests. The task management includes tracking task status; Using a pre-defined state machine decision-making mechanism, multiple agents are coordinated to collaboratively analyze and query tasks based on the task status, and the processing results of each agent are obtained. The state machine decision-making mechanism is as follows: combining the current agent's processing result and the current task state, the agent to be scheduled next is determined; the multiple agents include an agent for understanding query requests, an agent for clarifying business concepts, an agent for generating exploration paths, an agent for converting exploration paths into query instructions and executing them, and an agent for verifying query instructions and the execution results of query instructions; The processing results of all intelligent agents and the natural language query request are fused to generate an analysis report.
14. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of claim 13.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of claim 13.
16. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of claim 13.
Citation Information
Cited By
Intelligent data processing method based on multi-node dynamic feedback and related device thereof
CN122197904A