Heterogeneous data analysis method and device based on multi-agent proxy and storage medium

By using a multi-agent agent collaboration framework to process heterogeneous data, this technology solves the problem of low efficiency in processing structured and unstructured data in existing technologies, and achieves efficient and low-cost end-to-end automated analysis.

CN121598952APending Publication Date: 2026-03-03TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511649973.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently and uniformly process structured and unstructured data. Automated analysis is costly and inefficient, and existing agent systems lack multi-agent collaboration mechanisms, leading to unstable result quality.

Method used

A multi-agent agent collaboration framework is adopted, which clearly divides the work of agents such as data analysis, data planning, and data manipulation. Combined with a validator, the initial semantic plan is evaluated and optimized to generate a tree-structured semantic plan and perform optimization processing.

Benefits of technology

It achieves end-to-end automation from natural language queries to analysis results, reduces execution costs, improves the accuracy and efficiency of analysis, and reduces the cost of calling large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121598952A_ABST
    Figure CN121598952A_ABST
Patent Text Reader

Abstract

The invention discloses a heterogeneous data analysis method and device based on multi-agent proxy and a storage medium. The method is executed through a multi-agent agent collaboration framework, and comprises the following steps: analyzing agent agents by using data, obtaining natural language query and constructing a semantic directory; generating a plan sketch by using a data planning agent agent; generating a tree-shaped initial semantic plan comprising a relational operator and a semantic operator by using a data manipulation agent proxy; evaluating the initial semantic plan by using a verifier; based on the evaluation result, optimizing the initial semantic plan so as to reduce the execution cost on the premise of meeting a preset quality constraint, thereby generating an optimized semantic plan; and finally, executing the optimized semantic plan. The invention further relates to feedback learning achieved through the intelligent memory manager and physical implementation modes selected through a quality perception optimization strategy. According to the scheme, efficient, low-cost and high-precision automatic analysis of heterogeneous data can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of artificial intelligence and big data analysis technology, and in particular to a heterogeneous data analysis method, device and storage medium based on multi-agent agents. Background Technology

[0002] In the big data environment, the demand for data analysis is growing rapidly. A significant challenge lies in how to efficiently handle heterogeneous data sources, that is, simultaneously processing structured data such as relational databases and unstructured data such as text, images, or web page content. Existing data analysis technologies face many limitations in addressing this challenge.

[0003] Traditional data analytics systems primarily rely on domain experts manually writing code or scripts to manage complex workflows. This approach is not only time-consuming and costly but also prone to errors. For example, in large enterprise data warehouses, data sources often coexist, making it difficult for existing systems to handle them uniformly, resulting in low analytical efficiency. For semantic tasks such as sentiment analysis or text classification, this knowledge-intensive coding method has poor maintainability, and when data sources change, recoding is required, increasing system maintenance costs.

[0004] To improve automation, some technologies attempt to extend the SQL language or adopt natural language-to-SQL conversion methods. However, these methods primarily target structured data and cannot effectively handle schema-less or semi-structured unstructured data. For example, when the data source involves web pages or logs, natural language-to-SQL workflows suffer from high query failure rates because they cannot derive valid schemas. Furthermore, these methods ignore the complex combinations of semantic operators, and the large search space makes plan generation infeasible.

[0005] With the development of artificial intelligence technology, while agent technology and Large Language Models (LLMs) have begun to be applied to data analysis, new problems have also arisen. On the one hand, existing agent systems can perform code generation or information retrieval, but lack a dedicated multi-agent collaboration mechanism for data analysis, leading to unstable result quality. For example, a single agent processing heterogeneous data in a production environment with insufficient metadata may easily miss relevant datasets. On the other hand, while Large Language Models are powerful, their invocation costs are high, and their accuracy is context-dependent. Existing methods have failed to effectively optimize execution plans, such as lacking cost estimation for operation operators, resulting in increased latency, wasted resources, and soaring costs.

[0006] Therefore, existing technologies cannot simultaneously meet the demands of heterogeneous data analysis in terms of autonomy, efficiency, cost, and accuracy. There is an urgent need for a technological solution that can achieve end-to-end automated processing from natural language queries to cost-effective analytical results through intelligent collaboration and fine-grained optimization. Summary of the Invention

[0007] This application provides a heterogeneous data analysis scheme based on multi-agent agents, which can solve the technical problems of existing technologies that rely on manual coding when processing heterogeneous data, have difficulty in uniformly processing structured and unstructured data, and have high costs and low efficiency in automated analysis.

[0008] According to one embodiment of this application, a heterogeneous data analysis method based on multi-agent agents is proposed, which is executed through a multi-agent agent cooperation framework. The method includes: By using data profiling intelligent agents, natural language queries for heterogeneous data sources are obtained, and the heterogeneous data sources are scanned to construct a semantic catalog; The intelligent agent is planned using data, and the query task is decomposed and a plan draft is generated based on the natural language query and the semantic directory; Using data to manipulate intelligent agents, an initial semantic plan is generated based on the plan sketch. The semantic plan adopts a tree structure and includes at least one relational operation operator for processing structured data and at least one semantic operation operator for processing unstructured data. The syntactic integrity and semantic consistency of the initial semantic plan are evaluated using a validator. Based on the evaluation results, the initial semantic plan is optimized to reduce the execution cost while meeting preset quality constraints, thereby generating an optimized semantic plan. Execute the optimized semantic plan and output the analysis results.

[0009] In some implementations, the data profiling agent agent constructs the semantic catalog, including: For the structured data in the heterogeneous data source, extract its metadata and schema information; For unstructured data in the heterogeneous data source, hierarchical segmentation is performed based on semantic boundaries to obtain multi-granularity fragments at the sentence level, paragraph level, or topic block level. An embedding vector is generated for the multi-granularity fragment, and a vector index is established based on the embedding vector; The semantic catalog is constructed by combining the metadata and schema information of structured data with the vector index of unstructured data.

[0010] In some implementations, the validator uses a discriminative language model and a majority voting mechanism to determine the evaluation result; Furthermore, when the evaluation result is unsuccessful, the verifier stores the generated error report and correction suggestions in the intelligent memory manager and provides feedback to iteratively correct the initial semantic plan.

[0011] In some implementations, the intelligent memory manager is also used for: Collect error information during the parsing, verification, and execution process, and store it in short-term memory; The large language model is used to semantically summarize and generalize the erroneous information accumulated in the short-term memory in order to identify common patterns and generate long-term memory. The long-term memory is stored indexed by task embedding and routed by the intelligent memory manager to the data profiling agent or the data planning agent based on the error type to guide subsequent plan generation.

[0012] In some implementations, the semantic operation operator includes at least one of the following: Semantic filtering is used to filter data based on semantic conditions; Semantic grouping is used to classify data based on semantic similarity or category; Semantic extraction is used to extract structured information from unstructured data; The semantic operation operators are implemented through a large language model or an embedding model.

[0013] In some implementations, the step of optimizing the initial semantic plan includes: Rule-based equivalence rewriting is applied to adjust the execution order of the relational operators and the semantic operators.

[0014] In some implementations, the step of optimizing the initial semantic plan includes: Perform connection order optimization based on dynamic programming.

[0015] In some implementations, dynamic programming-based connection order optimization includes: Progressive sampling is performed on multiple semantic predicates to obtain the branch selection rate; And, the connection selection rate is estimated by the product of the branch selection rates; The connection selection rate is used as the basis for cost estimation in the dynamic programming to determine the connection order.

[0016] In some implementations, the step of optimizing the initial semantic plan includes: Provide at least two physical implementation methods for the at least one semantic operation operator, wherein the physical implementation methods include large language model invocation, small language model invocation, or vector index-based embedding retrieval; Under the premise of satisfying the preset quality constraints, the physical implementation method is selected for the at least one semantic operation operator in order to minimize the execution cost of the semantic plan.

[0017] In some implementations, the execution cost is determined in the following manner: The input / output token size is estimated based on the average text length, prompt length, and expected output length, wherein the input / output token size is estimated based on fitting historical task data; The call frequency is obtained by combining the semantic plan cardinality estimation based on importance sampling, wherein the cardinality is estimated through sampling; For all operation operators, the execution cost is obtained by summing the product of the call frequency, the input / output token size, and the corresponding token fee.

[0018] In some implementations, selecting the physical implementation for the semantic operation operator includes: A top-down greedy degradation strategy is adopted for selection. Initially, a baseline physical implementation is assigned to all semantic operation operators. The semantic operation operator that achieves the maximum cost reduction when the quality degradation does not exceed a preset threshold is selected for degradation until the minimum cost solution under the global quality threshold is reached.

[0019] In some implementations, the step of executing the optimized semantic plan includes: For the relational operation operator, it interoperates with the underlying engine through a self-describing data access service, wherein the underlying engine includes at least one of a relational database, a distributed computing engine, and a data frame engine. The semantic operation operator is executed according to the physical implementation method selected in the optimization step.

[0020] In some implementations, the physical implementation of the semantic operation operator includes a cascaded execution method, which includes: Similarity retrieval is performed using the vector indexes in the semantic catalog to conduct a coarse screening; The candidate results from the initial coarse screening are further refined using a small language model; The results of the fine-tuning are then validated using a large language model.

[0021] According to one embodiment of this application, an electronic device is provided, the device including a memory and a processor, the memory being used to store computer instructions executable on the processor, and the processor being used to implement the method as described in any of the preceding claims when executing the computer instructions.

[0022] According to one embodiment of this application, a computer-readable storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method as described in any of the preceding claims.

[0023] This application provides a heterogeneous data analysis scheme based on multi-agent agents. By introducing a multi-agent agent collaboration framework, it achieves end-to-end automation from natural language queries to analysis results. This application utilizes a clear division of labor among agents for data profiling, data planning, and data manipulation, and combines this with a validator's evaluation of the initial semantic plan to ensure the accuracy of the analysis logic. Furthermore, by optimizing the semantic plan before execution, the execution cost can be significantly reduced while meeting preset quality constraints, effectively solving the problem of high costs associated with calling large models in existing technologies. The method provided in this application utilizes the relationships and semantic operation operators contained in the semantic catalog and tree-like plan to autonomously and efficiently process heterogeneous data containing both structured and unstructured data, exhibiting significant advantages in accuracy, cost, and efficiency compared to traditional technologies.

[0024] Other features and advantages of the technical solution proposed in this application are described below. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.

[0026] Figure 1 This is a flowchart of a heterogeneous data analysis method based on multi-agent agents provided according to an embodiment of this application; Figure 2 This is an architecture diagram of a heterogeneous data analysis system based on multi-agent agents provided according to an embodiment of this application; Figure 3 This is a flowchart of data profiling and semantic catalog construction according to an exemplary embodiment of this application; Figure 4 This is a schematic diagram of multi-agent cooperation and memory routing according to an exemplary embodiment of this application; Figure 5 This is a flowchart illustrating a semantic query optimization process according to an exemplary embodiment of this application; Figure 6 This is a schematic diagram of an actuator cascading and semantic operator implementation according to an exemplary embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device shown in at least one embodiment of this application. Detailed Implementation

[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0028] The intelligent agent, or agent agent, in this application's embodiments refers to a computational entity configured to perform specific tasks. The intelligent agent utilizes the capabilities of large language models or other models to autonomously or semi-autonomously perceive the environment, perform reasoning and planning, and execute actions. A multi-agent agent collaboration framework refers to a system architecture that supports communication, coordination, and division of labor among multiple such intelligent agents. This framework manages the interaction between agents, the decomposition and allocation of tasks, and the sharing and feedback of information, enabling multiple agents to work collaboratively to complete complex data analysis tasks that are difficult for a single agent to handle.

[0029] The proposed solution applies the multi-agent agent collaboration framework to the automated analysis of heterogeneous data. This solution automates the entire process from receiving user natural language queries to outputting the final analysis results through the collaborative work of a group of clearly defined agents. This application integrates relational operation operators for processing structured data and semantic operation operators for processing unstructured data by generating a tree-structured semantic plan. Specifically, this application introduces independent verification, optimization, and feedback mechanisms. The verifier ensures the logical correctness of the plan; the optimizer optimizes the plan based on cost and quality models before execution to achieve low cost and high efficiency; and the intelligent memory manager collects and generalizes errors during execution, forming a feedback loop that enables the framework to continuously learn and improve the accuracy of subsequent tasks.

[0030] Figure 1 This is a flowchart of a heterogeneous data analysis method based on multi-agent agents according to an embodiment of this application. As shown in the figure, the method includes the following steps S101 to S106.

[0031] Step S101: Use the data profiling agent to obtain natural language queries for heterogeneous data sources, and scan the heterogeneous data sources to construct a semantic catalog.

[0032] Heterogeneous data sources refer to sources accessible to the system that contain multiple data types. These include structured data such as tabular data stored in relational databases, as well as unstructured data such as text and logs stored on file servers or web pages. Natural language queries are analytical requests submitted by users in everyday language, such as "analyze movie reviews with positive sentiment and group them statistically." Upon receiving a query, the data profiling agent is activated, scanning all accessible data sources. The purpose of this scanning is to build a comprehensive semantic catalog, serving as the data foundation for all subsequent planning and decision-making by the agents.

[0033] In some implementations, the data profiling agent constructs the semantic catalog, including: extracting metadata and pattern information from structured data in the heterogeneous data source; hierarchically segmenting unstructured data in the heterogeneous data source based on semantic boundaries to obtain multi-granularity fragments at the sentence, paragraph, or topic block level; generating embedding vectors for the multi-granularity fragments and establishing vector indexes based on the embedding vectors; and combining the metadata and pattern information of the structured data with the vector indexes of the unstructured data to construct the semantic catalog.

[0034] See also Figure 3 When processing structured data (such as SQL database tables), the data profiling agent extracts its schema, column names, data types, and sample data. When structured data lacks an explicit schema, it can also invoke a large language model for schema inference. When processing unstructured data (such as long texts), a hierarchical segmentation method can be used, for example, dividing the document into multi-granularity segments such as sentences, paragraphs, or topic blocks based on syntactic or semantic boundaries. Subsequently, the system calls an embedding model to convert these text segments into high-dimensional vector representations, i.e., embedding vectors, and uses techniques such as Approximate Nearest Neighbor (ANN) to build a vector index for subsequent semantic retrieval. This semantic directory can also include implicit structured information extracted from unstructured text (such as tables described in the text).

[0035] The semantic catalog built in this way enables the system to understand the structure and semantic meaning of the available data, laying the foundation for subsequent steps.

[0036] Step S102: Utilize data to plan the intelligent agent agent, decompose the query task and generate a plan draft based on the natural language query and the semantic directory.

[0037] The data planning agent is responsible for the overall design. It receives the user's natural language query and the semantic catalog constructed in step S101. Based on this information, the data planning agent first understands the user's core intent and filters the datasets most relevant to the current query task from the semantic catalog. Simultaneously, it can intentionally exclude irrelevant datasets to avoid providing too much irrelevant information to the large language model in subsequent steps, which could lead to errors or increased costs. Subsequently, the data planning agent decomposes the complex query task into a series of subtasks and designs a high-level plan sketch. This sketch defines the main logic and steps of the data analysis and forms the basis for generating the final executable plan.

[0038] Step S103: Using data manipulation agent, an initial semantic plan is generated based on the plan sketch. The semantic plan adopts a tree structure and includes at least one relation operation operator for processing structured data and at least one semantic operation operator for processing unstructured data.

[0039] The data manipulation agent receives a draft plan from the planning agent and refines it into a concrete, executable initial semantic plan. Logically, this semantic plan is a tree structure, with leaf nodes representing data sources (such as scan operators), intermediate nodes representing various operation operators, and the root node being the final output. The plan integrates two types of operators: traditional relational operation operators, such as Scan, Filter, Join, and Aggregate, for processing structured data; and semantic operation operators for processing unstructured data or performing semantic tasks. In some implementations, the semantic plan itself can be a structured format, such as JSON, to clearly describe the types of operators, their parameters, and the hierarchical and data flow relationships between them. During execution, operators can be implemented as classes, such as those in Python. Each operator class defines a standard data retrieval method (such as get_next()), which calls the method of the upstream operator to retrieve and process data layer by layer, thus enabling the data flow to be passed through the plan tree.

[0040] In some implementations, the semantic operation operator includes at least one of the following: semantic filtering, used to filter data based on semantic conditions; semantic grouping, used to classify data based on semantic similarity or category; and semantic extraction, used to extract structured information from unstructured data. The semantic operation operator can be implemented using a large language model or an embedding model.

[0041] Specifically, semantic filtering can be used to filter text that meets specific semantic conditions, such as "identifying all comments with positive sentiment"; semantic grouping can be used to classify text by topic; and semantic extraction is used to extract structured key-value pairs from unstructured text, such as extracting "price" and "features" from a product description. The implementation of these semantic operators is flexible; they can be accomplished either by calling a Large Language Model (LLM) through complex prompts, or by utilizing the embedding vectors and indexes constructed in step S101 through efficient vector retrieval. This semantic operator enables this application to handle semantic tasks that are difficult to cover using traditional SQL within a unified planning framework.

[0042] Step S104: Using a validator, evaluate the syntactic integrity and semantic consistency of the initial semantic plan.

[0043] Because large language models may produce errors when generating complex logic—for example, the generated JSON plan might be incorrectly formatted, or the plan's logic might fail to truly resolve the user's query—this application introduces a verification step before executing the plan. The verifier is responsible for double-checking the initial semantic plan generated in step S103. First, a syntactic integrity assessment is performed, such as checking if the JSON format is correct and if all required parameters are filled in. Second, a semantic consistency assessment is performed, determining whether the plan's execution logic can correctly and completely answer the user's original query.

[0044] In some implementations, the validator uses a discriminative language model and a majority voting mechanism to determine the evaluation result; and when the evaluation result is unsuccessful, the validator stores the generated error report and correction suggestions in a smart memory manager and provides feedback to iteratively correct the initial semantic plan.

[0045] Specifically, to improve the reliability of validation, the validator can launch multiple instances in parallel (i.e., cross-validation agents) to evaluate the same plan and use a majority voting mechanism to decide whether the plan passes. A discriminative language model can be implemented by providing a carefully designed specific prompt to a general-purpose large language model. This prompt guides the model to judge the logical completeness of the plan as "yes" or "no." If the plan fails validation, the validator can generate a detailed error report and correction suggestions. This information is not discarded but stored in an intelligent memory manager to guide the planning agent in generating a corrected plan in the next iteration, thus forming a feedback loop.

[0046] In some implementations, the intelligent memory manager is also used to: collect error information during the parsing, verification, and execution process, and store it in short-term memory; use a large language model to perform semantic induction and generalization on the error information accumulated in the short-term memory to identify common patterns and generate long-term memory; the long-term memory is stored with task embedding as the index, and the intelligent memory manager routes the error to the data profiling agent or the data planning agent according to the error type to guide subsequent plan generation.

[0047] Intelligent memory managers help enable the system to learn autonomously and continuously optimize its memory. For example... Figure 4 As shown, all anomalies and errors (such as data errors, semantic errors, and syntax errors) generated during verification, parsing, or execution can be captured and stored in short-term memory. When short-term memory accumulates to a certain level, a dedicated summarization task can be triggered. This task calls a large language model to summarize and generalize these error messages, extracting rules or patterns with common value and storing them in long-term memory. For example, the system might discover that "the format of a certain type of data source is consistently incorrect." In implementation, these generalized long-term memories can be stored in a vector database so that relevant historical experiences can be quickly found through vector retrieval when processing new tasks in the future. In addition, the memory manager also routes error messages. For example, data source-related errors are fed back to the data profiling agent, while logical planning errors are fed back to the data planning agent, thereby achieving precise correction for specific agents.

[0048] Step S105: Based on the evaluation results, optimize the initial semantic plan to reduce the execution cost while meeting preset quality constraints, thereby generating an optimized semantic plan.

[0049] The plan verified in step S104 is logically correct, but its execution cost may be high, especially when the plan contains multiple calls to semantic operation operators of expensive large language models. Therefore, this application utilizes a separate optimizer module to optimize the plan for both cost and efficiency. The optimization objective is to minimize the total execution cost, which may include computational cost and time latency, without sacrificing the quality of the analysis results, or in other words, reducing the quality of the analysis results within an acceptable range.

[0050] Multiple embodiments of this application provide various optimizations. In some embodiments, the step of optimizing the initial semantic plan further includes: applying rule-based equivalence rewriting to adjust the execution order of the relational operation operators and the semantic operation operators. For example... Figure 5As shown, it applies a series of equivalent transformation rules that do not affect the final result for optimization. For example, low-cost relational filtering operations (such as the WHERE clause in SQL) are moved before high-cost semantic operations (such as LLM calls) to significantly reduce the amount of data that needs to be processed by semantic operators. Other rules may include: deferring semantic extraction operations that are not dependent on by subsequent operators to the root of the plan, or postponing the semantic extraction of join keys to a position near the point of use.

[0051] In some embodiments, the step of optimizing the initial semantic plan further includes performing join order optimization based on dynamic programming. Because different join orders can lead to orders-of-magnitude differences in execution costs, dynamic programming optimization according to this embodiment can significantly improve the efficiency of processing queries involving multi-table joins or data source joins.

[0052] In some implementations, the dynamic programming-based optimization of the connection order further includes: progressively sampling multiple semantic predicates to obtain branch selection rates; estimating the connection selection rate by multiplying the branch selection rates; and using the connection selection rate as the basis for cost estimation of the dynamic programming to determine the connection order.

[0053] Traditional dynamic programming optimizers for databases rely on statistical information (such as histograms) in tables to estimate join costs. However, this approach is difficult to apply to semantic join predicates involving large language model calls, such as determining whether two text columns are related. According to this embodiment, the system samples and estimates the selectivity of semantic joins by extracting a small number of data samples and actually executing the semantic predicates. This estimates the proportion of data that will be joined by the semantic join, allowing the system to quantify the selectivity of semantic joins and use this join selectivity as the basis for cost estimation in dynamic programming to determine the join order. This enables the classic dynamic programming algorithm to be effectively applied to complex plans that include novel semantic operators, thereby finding the cost-optimal join order.

[0054] In some implementations, the step of optimizing the initial semantic plan further includes: providing at least two physical implementations for the at least one semantic operation operator, wherein the physical implementations include calling a large language model, calling a small language model, or embedding retrieval based on vector indexing; and selecting the physical implementation for the at least one semantic operation operator, under the premise of satisfying the preset quality constraints, to minimize the execution cost of the semantic plan. The same logical semantic operator (such as "semantic filtering") can have multiple physical implementations; for example, calling the highest-level large model (highest quality, highest cost), calling a small model (medium quality, lower cost), or using vector retrieval (lowest quality, lowest cost). The optimizer is used to select an implementation for each semantic operator in the plan to achieve the optimal global cost-effectiveness.

[0055] To make optimal choices, the optimizer can use a cost model to determine the execution cost. In some implementations, the execution cost can be determined by: estimating the input / output token size based on the average text length, prompt length, and expected output length, wherein the input / output token size is estimated based on fitting historical task data; obtaining the call frequency by combining a semantic plan cardinality estimate based on importance sampling, wherein the cardinality is estimated through sampling; and for all operation operators, summing the product of the call frequency, the input / output token size, and the corresponding token cost to obtain the execution cost.

[0056] In some examples, the cost function used as the basis for optimization decisions is as follows: , in, Cardinality The cardinality represents the number of rows of data that the operator needs to process. InputToken , OutputToken These represent the input token size and the output token size, respectively. Fee in and Fee out The cost per unit of input / output tokens. Cardinality It can be estimated through sampling. InputToken , OutputToken The cost of calling LLM (i.e., the cost of calling LLM) can be estimated by a function fitted based on historical task data, which can take into account factors such as text length and prompt word length.

[0057] In some implementations, selecting the physical implementation for a semantic operation operator includes: employing a top-down greedy degradation strategy, wherein initially a baseline physical implementation is assigned to all semantic operation operators, and the semantic operation operator that achieves the maximum cost reduction while maintaining a quality degradation of no more than a preset threshold is iteratively downgraded until the minimum cost solution under the global quality threshold is reached. Figure 5 As shown, the greedy strategy starts with a baseline physical implementation, which is typically the one offering the highest quality, such as using the strongest large model. The optimizer then iteratively searches for downgrade opportunities, attempting to reduce the implementation of an operator to a cheaper method, such as from a small model to vector retrieval, and evaluates the cost savings and quality loss resulting from this downgrade. The system prioritizes the downgrade with the highest cost-effectiveness (i.e., minimum quality loss and maximum cost savings) and repeats this process until the total quality reduction reaches a user-preset global threshold, thus achieving the optimal balance between quality and cost.

[0058] Step S106: Execute the optimized semantic plan and output the analysis results.

[0059] The actuator receives the optimized physical plan generated in step S105 and can process the data using a bottom-up cascaded execution engine.

[0060] In some implementations, executing the optimized semantic plan further includes: interoperating with the underlying engine via a self-describing data access service for the relational operation operator, wherein the underlying engine includes at least one of a relational database, a distributed computing engine, and a data frame engine; and executing the semantic operation operator according to the physical implementation method selected in the optimization steps.

[0061] like Figure 6 As shown, when the executor encounters relational operators (such as SQL filtering and aggregation), it can push these operations down to the most efficient underlying engine for execution through a unified data access service. This could involve executing SQL directly in the relational database, calling a distributed computing engine like Spark, or using a DataFrame engine like Pandas. When encountering semantic operators, the executor can execute them according to the physical implementation selected by the optimizer in step S105. This mapping from logical operators to physical operators can be implemented using a predefined semantic operator library, which provides multiple callable physical implementations for each logical semantic operator.

[0062] In some implementations, the semantic operation operator is physically implemented as a cascaded execution method, which includes: first, performing a similarity search using vector indexes in the semantic catalog to perform a coarse screening; then, using a small language model to perform a fine screening of the candidate results from the coarse screening; and finally, using a large language model to perform a final verification of the results from the fine screening. This implementation provides an efficient example of a physical implementation method. Figure 6 As shown, the cascaded execution method avoids using expensive large models for all data. Instead, it uses a funnel-shaped cascaded verification to filter out the vast majority of irrelevant data with low-cost vector retrieval, then uses a medium-cost small model for fine screening, and finally calls the large model for final confirmation only for a very small number of highly relevant results, thus achieving extremely high accuracy at extremely low cost.

[0063] To make the purpose, technical solution, and advantages of this application clearer, the following will be combined with Figures 2 to 6 The technical solution of this application is illustrated in detail through a complete end-to-end example.

[0064] First, refer to Figure 2 The system architecture diagram shown is illustrated. The entire system includes a planner as the core coordinator, and parallel optimizers, validators, and executors. The planner internally comprises data profiling agents, data planning agents, and data manipulation agents. Basic components include a large language model, a vector database, and an intelligent memory manager.

[0065] When the system receives a natural language query from a user, such as: "Please analyze the description of 'high risk' in the financial product brochure and, in conjunction with the customer transaction database (structured data), find the list of customers who purchased these products and their total transaction amounts," the financial product brochure is an unstructured document, while the customer transaction database is structured data.

[0066] Step 1 (corresponding to) Figure 1 Step S101) is data access and semantic directory construction, the detailed process of which is as follows: Figure 3 As shown. When a query is received, the data profiling agent in the planner is activated. It first accesses heterogeneous data sources: on the one hand, it connects to the customer transaction database (e.g., Figure 2 It extracts schema information, such as customer ID, product ID, and transaction amount, from a MySQL server; on the other hand, it connects to a document server storing financial product manuals (e.g., Figure 2(The text refers to a TXT server). For unstructured text like the latter, the data profiling agent uses a hierarchical segmentation method to break down the manual into paragraphs. Then, it calls an embedding model to generate embedding vectors for each paragraph and stores these vectors in a vector database to build a searchable vector index. Finally, it integrates the pattern information from the structured database and the vector indexes from the unstructured manual to generate a data profiling summary and build a semantic catalog, which is then provided to the planning agent.

[0067] Next, we enter the plan generation phase (corresponding to...) Figure 1 Steps S102 and S103), the collaboration process is as follows: Figure 4 As shown, after receiving the query and semantic catalog, the data planning agent breaks it down into "1. Filter out 'high-risk' products from the manual" and "2. Query the customers who purchased these products in the transaction database and summarize the amounts". It can design a high-level plan sketch. Subsequently, the data manipulation agent takes over the sketch and populates it into a detailed, JSON-formatted initial semantic plan. This plan tree might (logically) be as follows: First, perform a semantic filter (SemanticFilter, condition 'high-risk') on the manual (TXTScan), then join the results (high-risk product IDs) with the customer transaction database (Scan), and finally aggregate the join results by customer ID (Aggregate, calculate the total amount).

[0068] Before the plan is executed, it must be verified (corresponding to...). Figure 1 Step S104), the process is as follows: Figure 4 The middle section is shown. The JSON plan is fed into the validator. The validator first performs a syntax check, such as whether the JSON format is complete. Then, the validator performs semantic validation using a discriminative language model, which can be achieved by providing specific hints to a general large model and employing a majority voting mechanism. Suppose that the plan generated by the data manipulation agent omits the final "aggregation" step, causing the validation to fail, the validator can generate an error report and correction suggestions, such as "The plan does not contain an aggregation operation." This error report is stored in the short-term memory of the intelligent memory manager and routed back to the data planning agent, allowing it to correct the plan in the next iteration.

[0069] Once the plan passes validation, it is passed to the optimizer for optimization (corresponding to...). Figure 1 Step S105), the detailed process is as follows: Figure 5 As shown, this optimization process consists of two key parts.

[0070] Part One, such as Figure 5As shown in the left branch, the optimizer rewrites and optimizes the logical structure of the plan. First, rule-based equivalence rewriting is applied. For example, if the original query also contains a relational filter on the customer transaction database, such as "transaction date later than 2024", Rule 1, relational filter push-forward (predicate push-down), ensures that this low-cost SQL filter is completed before performing high-cost "semantic joins" (such as joins between the manual and the database). Similarly, Rule 2, delaying high-cost operators, and Rule 3, adjusting the semantic extraction position, are also used to adjust the plan to ensure that high-cost semantic operations (such as calling large language models) process as little data as possible.

[0071] After rule rewriting, the optimizer enters the join order selection phase. To determine the optimal join order between the financial product brochures and customer transaction data in this example, the optimizer needs to estimate the selectivity of the semantic predicate (i.e., "high risk"). For this, asymptotic sampling can be used to estimate selectivity by sampling a small amount of data to estimate what percentage of products would be classified as "high risk." This estimated selectivity rate is then fed into a dynamic programming algorithm as part of the cost estimation to find the globally optimal join order.

[0072] Part Two, such as Figure 5 As shown in the right-hand branch, the optimizer selects a specific physical implementation for the planned operators.

[0073] This step can be driven by a quality-aware cost model. For the "semantic filtering ('high-risk')" operator in this example, the system can have several physical implementations, such as calling an expensive implementation of a large model, calling an inexpensive implementation of a small model, or using a vector retrieval implementation. The optimizer needs to make a choice among these.

[0074] like Figure 5 As shown, the system models this problem as a multiple knapsack problem and employs a greedy degradation strategy to solve it. The decision-making basis of this strategy is the cost function, for example, the cost function shown above: .

[0075] The specific implementation of the greedy strategy is as follows: Figure 5 The loop is illustrated below. Initially, a high-quality baseline implementation is assigned to all operators. Then, the optimizer iteratively checks whether an operator can be downgraded, for example, from a large model to a small model, and selects the downgrade option that yields the maximum cost reduction while the total quality degradation does not exceed a preset threshold. This process is repeated continuously, as shown below. Figure 5 The "No" branch continues until the total mass loss reaches the threshold, i.e. Figure 5 In the "yes" branch, the system obtains the cost-optimal solution that meets the user's quality requirements.

[0076] Ultimately, this structure was optimized ( Figure 5 (left side) and implementation optimization ( Figure 5 The physical plan (on the right) is generated and passed to the executor for execution (corresponding to...). Figure 1 Step S106).

[0077] Execution process as follows Figure 6 As shown, the executor employs a bottom-up cascading execution engine. When executing relational operators (such as scanning a transaction database), it can invoke the underlying engine (such as a MySQL server) via a self-describing data access service (MCP). When executing semantic operators, it can execute according to the physical method chosen by the optimizer. For example, if the optimizer chooses the most efficient cascading execution method, the executor can first use vector indexes for coarse filtering, such as quickly finding all paragraphs mentioning "risk," then call a smaller model for fine filtering, such as determining whether something is "high-risk," and finally call a larger model for final verification only for a few entries that are difficult to determine.

[0078] During this process, if any execution errors occur (such as database connection timeouts), these error messages will be captured by the intelligent memory manager and stored in short-term memory. Subsequently, the large model will generalize these errors to form long-term memory, such as "the database is unstable at night," and store them in the vector database for the data analysis agent and data planning agent to retrieve and refer to when planning future tasks, thereby enabling the system to continuously learn and improve itself.

[0079] Figure 7 An electronic device provided in at least one embodiment of this application includes a memory and a processor. The memory is used to store computer instructions that can be executed on the processor. The processor is used to implement the heterogeneous data analysis method based on multi-agent agents as described in any embodiment or implementation of this application when executing the computer instructions.

[0080] At least one embodiment of this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the heterogeneous data analysis method based on multi-agent agents as described in any embodiment or implementation of this application.

[0081] In summary, this application discloses a heterogeneous data analysis scheme based on multi-agent agents. This scheme decouples the steps of data profiling, planning and generation, verification, optimization, and execution through a collaborative framework, and delegates these steps to specialized data profiling agents, data planning agents, data manipulation agents, verifiers, and executors for collaborative processing. Specifically, by introducing semantic operation operators, this application can integrate structured and unstructured data within a unified tree-like plan. Furthermore, this application utilizes an independent, quality-aware optimizer to perform fine-grained cost optimization of the semantic plan before execution, while leveraging a feedback loop formed by an intelligent memory manager to achieve continuous learning and self-improvement of the system. This application provides a complete, end-to-end automated, cost-effective, and self-learning heterogeneous data analysis solution.

[0082] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented 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.

[0083] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the data processing device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0084] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0085] The embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.

[0086] The processing and logic flow described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logic flow can also be executed by dedicated logic circuitry—such as FPGAs (Field-Programmable Gate Arrays) or ASICs (Application-Specific Integrated Circuits), and the device can also be implemented as dedicated logic circuitry.

[0087] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.

[0088] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.

[0089] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.

[0090] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

[0091] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.

[0092] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.

Claims

1. A heterogeneous data analysis method based on multi-agent agents, characterized in that, The method, executed through a multi-agent agent collaboration framework, includes: By using data profiling intelligent agents, natural language queries for heterogeneous data sources are obtained, and the heterogeneous data sources are scanned to construct a semantic catalog; The intelligent agent is planned using data, and the query task is decomposed and a plan draft is generated based on the natural language query and the semantic directory; Using data to manipulate intelligent agents, an initial semantic plan is generated based on the plan sketch. The semantic plan adopts a tree structure and includes at least one relational operation operator for processing structured data and at least one semantic operation operator for processing unstructured data. The syntactic integrity and semantic consistency of the initial semantic plan are evaluated using a validator. Based on the evaluation results, the initial semantic plan is optimized to reduce the execution cost while meeting preset quality constraints, thereby generating an optimized semantic plan. Execute the optimized semantic plan and output the analysis results.

2. The method according to claim 1, characterized in that, The data profiling agent agent constructs the semantic catalog, including: For the structured data in the heterogeneous data source, extract its metadata and schema information; For unstructured data in the heterogeneous data source, hierarchical segmentation is performed based on semantic boundaries to obtain multi-granularity fragments at the sentence level, paragraph level, or topic block level. An embedding vector is generated for the multi-granularity fragment, and a vector index is established based on the embedding vector; The semantic catalog is constructed by combining the metadata and schema information of structured data with the vector index of unstructured data.

3. The method according to claim 1, characterized in that, The verifier uses a discriminative language model and a majority voting mechanism to determine the evaluation result; Furthermore, when the evaluation result is unsuccessful, the verifier stores the generated error report and correction suggestions in the intelligent memory manager and provides feedback to iteratively correct the initial semantic plan.

4. The method according to claim 3, characterized in that, The intelligent memory manager is also used for: Collect error information during the parsing, verification, and execution process, and store it in short-term memory; The large language model is used to semantically summarize and generalize the erroneous information accumulated in the short-term memory in order to identify common patterns and generate long-term memory. The long-term memory is stored indexed by task embedding and routed by the intelligent memory manager to the data profiling agent or the data planning agent based on the error type to guide subsequent plan generation.

5. The method according to claim 1, characterized in that, The semantic operation operator includes at least one of the following: Semantic filtering is used to filter data based on semantic conditions; Semantic grouping is used to classify data based on semantic similarity or category; Semantic extraction is used to extract structured information from unstructured data; The semantic operation operators are implemented through a large language model or an embedding model.

6. The method according to claim 1, characterized in that, The step of optimizing the initial semantic plan includes: Rule-based equivalence rewriting is applied to adjust the execution order of the relational operators and the semantic operators.

7. The method according to claim 1, characterized in that, The step of optimizing the initial semantic plan includes: Perform connection order optimization based on dynamic programming.

8. The method according to claim 7, characterized in that, Optimizing the connection order based on dynamic programming includes: Progressive sampling is performed on multiple semantic predicates to obtain the branch selection rate; And, the connection selection rate is estimated by the product of the branch selection rates; The connection selection rate is used as the basis for cost estimation in the dynamic programming to determine the connection order.

9. The method according to claim 1, characterized in that, The step of optimizing the initial semantic plan includes: Provide at least two physical implementation methods for the at least one semantic operation operator, wherein the physical implementation methods include large language model invocation, small language model invocation, or vector index-based embedding retrieval; Under the premise of satisfying the preset quality constraints, the physical implementation method is selected for the at least one semantic operation operator in order to minimize the execution cost of the semantic plan.

10. The method according to claim 9, characterized in that, The execution cost is determined in the following manner: The input / output token size is estimated based on the average text length, prompt length, and expected output length, wherein the input / output token size is estimated based on fitting historical task data; The call frequency is obtained by combining the semantic plan cardinality estimation based on importance sampling, wherein the cardinality is estimated through sampling; For all operation operators, the execution cost is obtained by summing the product of the call frequency, the input / output token size, and the corresponding token fee.

11. The method according to claim 9 or 10, characterized in that, Selecting the physical implementation method for semantic operation operators includes: A top-down greedy degradation strategy is adopted for selection. Initially, a baseline physical implementation is assigned to all semantic operation operators. The semantic operation operator that achieves the maximum cost reduction when the quality degradation does not exceed a preset threshold is selected for degradation until the minimum cost solution under the global quality threshold is reached.

12. The method according to claim 1, characterized in that, The steps of executing the optimized semantic plan include: For the relational operation operator, it interoperates with the underlying engine through a self-describing data access service, wherein the underlying engine includes at least one of a relational database, a distributed computing engine, and a data frame engine. The semantic operation operator is executed according to the physical implementation method selected in the optimization step.

13. The method according to claim 12, characterized in that, The physical implementation of the semantic operation operator includes a cascaded execution method, which includes: Similarity retrieval is performed using the vector indexes in the semantic catalog to conduct a coarse screening; The candidate results from the initial coarse screening are further refined using a small language model; The results of the fine-tuning are then validated using a large language model.

14. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store computer instructions executable on the processor, and the processor being used to implement the method of any one of claims 1 to 13 when executing the computer instructions.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method according to any one of claims 1 to 13.