Intelligent Questioning Methods, Systems, and Media Based on the Collaboration of Graph Search and Large Language Models

By constructing a table association graph and using a breadth-first search algorithm, combined with a large language model to generate multi-table join SQL queries, and validating the derived calculation scripts in a sandbox environment, the accuracy and efficiency issues in complex multi-table join scenarios are solved, realizing an efficient intelligent query method.

CN123115226APending Publication Date: 2026-11-17SHINVA MEDICAL INSTR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611636426.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-22
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing intelligent query technology lacks correctness guarantees in complex multi-table join scenarios, has low join accuracy, struggles to support complex derived logic expressions, and has low reasoning efficiency, making it difficult to meet the timeliness requirements of high-frequency queries.

Method used

By constructing a table association graph based on database foreign key relationships, a breadth-first search algorithm is used to find the shortest association path. This is combined with a large language model to generate multi-table association SQL queries. The correctness of the derived calculation scripts is then verified in a sandbox environment, separating data retrieval from complex calculations and reducing the model input burden.

Benefits of technology

It improves the accuracy and interpretability of SQL joins, reduces the model input size, enhances system scalability and response efficiency, and meets the timeliness requirements of high-frequency queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115226A_ABST
    Figure CN123115226A_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent query method, system, and medium based on graph search and large language model collaboration, belonging to the field of intelligent database query technology. The method includes: receiving a natural language query request and determining a set of target fields; constructing a table association graph based on database foreign key relationships, performing a breadth-first search to find the shortest association path covering all tables containing the target fields, automatically assembling multi-table join SQL query statements and executing them to obtain a basic data result set; using a large language model to determine whether derivative calculations are needed on top of the basic data; if so, generating a data processing script based on sample data, verifying the script's correctness in a sandbox environment, and applying it to the full dataset after successful verification to obtain the final result; and returning the final result to the user. This invention separates intent understanding, data acquisition, and derivative calculations into different modules for collaborative processing, improving query accuracy and derivative calculation support capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an intelligent query method, system, and medium based on graph search and large language model collaboration, belonging to the field of intelligent database query technology. Background Technology

[0002] As enterprises deepen their digital transformation, various business systems (such as Manufacturing Execution Systems and Customer Relationship Management Systems) accumulate massive amounts of structured data, which are typically distributed across dozens or even hundreds of interconnected database tables. Business personnel need to frequently perform cross-table queries for operational analysis, cost accounting, and business auditing. In engineering practice (such as building query capabilities for pharmaceutical MES), it has been found that most daily queries involve fixed business metrics and dimension fields, and these fields usually have clear association paths in the query logic.

[0003] Existing intelligent data query technology solutions mainly fall into four categories: (1) Template and rule-based query solutions: responding to questions through predefined query templates has high accuracy but extremely limited coverage and cannot cope with personalized query scenarios without predefined templates; (2) Traditional model-driven Text-to-SQL solution: It uses machine learning models to convert natural language into SQL. It has better generalization ability than template solution, but it is highly dependent on training data and its performance degrades significantly when migrating across database architectures. (3) Text-to-SQL solution based on large language model: It directly outputs SQL by utilizing the understanding and generation capabilities of large model, which achieves a breakthrough in flexibility. However, it is very easy to encounter errors in the association path or logical deviations when dealing with complex multi-table associations. Moreover, the generation process lacks verifiability and is difficult to meet the accuracy requirements of production-level data. (4) Improved schemes for using graph structures to assist table-based reasoning, for example: The existing patent application publication number (CN121117006A) discloses a method and apparatus for generating SQL based on a large model and ER graph: parsing the user query to obtain a set of candidate tables, querying the association paths and intermediate tables between the candidate tables based on the ER graph, and inputting the intermediate table information, the set of candidate tables and the query statement into a large language model for output SQL.

[0004] The existing patent application publication number (CN121722785A) discloses an NL2SQL method based on foreign key completion and knowledge graph: extracting candidate foreign keys from database metadata and data content, constructing a schema knowledge graph through a three-layer funnel verification of physical layer uniqueness, lexical layer matching, and semantic layer large model arbitration; determining the seed table set based on the query, calculating the connection path on the graph to complete the intermediate tables and expand them into sub-graphs, inputting them into a large language model to generate multiple candidate SQLs, and selecting the final SQL by voting based on the consistency of the results after execution. If no majority is formed or all executions fail, the path search scope is expanded and backtracking is iterated.

[0005] The above solutions still have significant shortcomings in both SQL generation and derivative computation: Regarding SQL generation, the graph structure is only used to assist in candidate table retrieval, field filtering, and association path finding. The final SQL is still probabilistically generated by the large language model—requiring multiple rounds of calls to the large model to complete candidate table parsing, field extraction, and SQL generation, lacking deterministic guarantees for the correctness of the association logic. Multiple candidate SQLs need to be generated and consistency voting performed; if no majority is formed or all fail, the path search needs to be expanded and iterated backtracked. Multiple model inferences and database executions result in high end-to-end latency and resource overhead, making it difficult to meet the timeliness requirements of high-frequency query scenarios. Regarding derivative computation, the above solutions focus on the conversion of natural language to a single SQL statement, lacking a mechanism for processing derivative logic above the query results: for derivative computations (multi-step operations, custom aggregations, iterative statistics, etc.) that cannot be directly expressed by a single SQL statement, they can only rely on the large model to express them in complex SQL forms such as nested subqueries and window functions, resulting in a high probability of errors. The system lacks unified and flexible support for derivative analysis.

[0006] In summary, the core challenge of intelligent data querying for complex enterprise data systems lies in balancing high query accuracy, system flexibility, and the ability to support derived analysis needs in scenarios with highly complex data structures and dense relationships. Summary of the Invention

[0007] To address the shortcomings of existing intelligent query solutions, such as low accuracy of SQL joins under complex table structures, lack of correctness and traceability in the generation process, difficulty in expressing complex derived logic, redundant and wasteful schema information and context windows, as well as low inference efficiency and high response latency, this paper provides an intelligent query method, system, and medium based on graph search and large language model collaboration that can improve the accuracy and interpretability of multi-table join queries and flexibly support derived computation.

[0008] To achieve the above objectives, the present invention provides the following technical solution: This invention provides an intelligent question-answering method based on graph search and large language model collaboration, comprising the following steps: The system receives a user's natural language query request, performs intent understanding and field semantic matching on the natural language query request using a large language model, and determines the set of target fields associated with the natural language query request from a pre-configured list of query fields. Each query field in the pre-configured list of query fields is configured with field metadata, which includes at least a field identifier, field name, field description, source table, source column, and data type.

[0009] Based on the source tables and source columns of each target field and its configured limiting condition fields in the target field set, a table association graph is constructed based on the foreign key relationships in the database. Taking the source table of the first query field in the target field set as the starting node, a graph search algorithm is executed in the table association graph to search for the shortest association path covering the tables containing all target fields and their configured limiting condition fields in the target field set. Based on the shortest association path and the source columns of each target field and its configured limiting condition fields, a multi-table association SQL query statement is automatically assembled and generated, submitted to the database for execution, and a basic data result set is obtained.

[0010] The large language model determines whether the natural language query request needs to be derived from the basic data result set based on the basic data result set. If so, the large language model generates a data processing script based on sample data from the basic data result set, verifies the correctness of the data processing script using the sample data in a sandbox environment, and applies the data processing script to the full set of basic data for execution after successful verification to obtain the final processing result. If not, the basic data result set is used as the final processing result.

[0011] The final processing result is returned to the user.

[0012] Furthermore, the table association graph is an undirected graph with database tables as nodes and foreign key relationships as edges. When constructing the table association graph, table structure and foreign key constraint information are extracted from the database system tables. Each node records the table name, column name list, data type and primary key information of the corresponding table, and each edge records the foreign key association conditions and association type between two nodes.

[0013] Furthermore, the graph search algorithm is a breadth-first search (BFS) algorithm, which includes the following steps: Step A: Using the starting node as the search starting point, enqueue the initial search path that includes the starting node.

[0014] Step B: Retrieve the current search path from the queue and determine whether the set of tables covered by the current search path contains all the target fields and their configured limiting condition fields in the target field set; if so, use the current search path as the shortest association path.

[0015] Step C: If the current search path does not cover all target tables, then traverse all neighbor nodes of each node in the current search path in the table association graph. For each neighbor node not covered by the current search path, determine whether the new table set formed after expanding the neighbor node to the current search path is already in the global visited set. If not, add the new table set to the global visited set and expand to generate a new search path and enqueue it.

[0016] Step D: Repeat steps B through C until the queue is empty or the shortest association path covering all target tables is found.

[0017] Furthermore, the global visited set uses the set of tables covered by the search path as its elements. Search paths that cover the same set of tables in different access orders are considered to be in the same state and are recorded only once, so as to prune duplicate search paths and reduce the search scale.

[0018] Furthermore, when automatically assembling and generating the multi-table join SQL query statement, for each target field, it is first determined whether a custom query statement is configured in the field metadata of the target field; if a custom query statement is configured, the custom query statement is used first as the query logic for the field, rather than assembling the SQL through the shortest join path; if no custom query statement is configured, the multi-table join (JOIN) statement is concatenated according to the traversal order of each node in the shortest join path, the join conditions are filled into the ON clause, the SELECT clause contains all columns corresponding to the target fields, and the WHERE clause contains the user-specified limiting conditions, finally generating a complete multi-table join SQL query statement.

[0019] Furthermore, the sample data in the basic data result set is a portion of the records in the basic data result set, and the number of sample data is less than the total number of records in the basic data result set, so as to avoid exceeding the context window of the large language model; the data processing script is generated by the large language model based on the sample data, the field metadata of the target field, and the derived calculation requirements of the query request.

[0020] Furthermore, verifying the correctness of the data processing script using the sample data in the sandbox environment includes the following steps: Step a: Input the sample data into the data processing script for execution and obtain the verification output results.

[0021] Step b: The large language model is used to determine the correctness of the verification output.

[0022] Step c: When the verification output result is determined to be incorrect, the large language model automatically corrects the data processing script based on the verification feedback, and repeats steps a to b until the data processing script passes verification.

[0023] Furthermore, the method also includes a step of caching the shortest association path: for query requests containing the same set of target fields, the cached association path is directly invoked, skipping the step of re-executing the graph search.

[0024] This invention also provides an intelligent question-and-answer system based on graph search and large language model collaboration, comprising: The large language model interaction module is used to receive users' natural language query requests, perform intent understanding and field semantic matching on the query requests, determine the associated target field set from the pre-configured query field list, and determine whether derivative calculations are needed based on the basic data result set after obtaining the basic data result set, and organize the final processing results to be returned to the user.

[0025] The field configuration module is used to pre-configure business query fields and their field metadata. The field metadata includes at least field identifier, field name, field description, source table, source column, data type and optional field constraints. It also provides a field list for semantic matching to the large language model interaction module and field metadata to guide SQL concatenation to the SQL assembly module.

[0026] The SQL assembly module is used to construct a table relationship graph based on the foreign key relationships in the database. It receives the target field set from the large language model interaction module, executes a graph search algorithm in the table relationship graph to search for the shortest relationship path covering all target fields and their configured limiting condition fields in the tables, and automatically assembles and generates multi-table relationship SQL query statements based on the shortest relationship path. It then submits the query to the database for execution to obtain the basic data result set. When the number of records in the basic data result set exceeds a preset threshold, only a portion of the records are extracted and returned to the large language model interaction module.

[0027] The script calculation module is used to generate a data processing script based on the sample data of the basic data result set when the large language model determines that derivative calculations are required. The script is then used to verify the correctness of the data processing script in a sandbox environment. After verification, the script is applied to the full set of basic data for execution, and the final processing result is output to the large language model interaction module.

[0028] The data storage module is used to store raw business data and table structure information, provide table structure and foreign key constraint information to the SQL assembly module, and execute SQL query statements to return data.

[0029] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the intelligent query method based on graph search and large language model collaboration as described above.

[0030] Compared with existing technologies, the intelligent question-answering method, system, and medium based on graph search and large language model collaboration of the present invention exhibit the following beneficial effects in terms of technical performance and practical application: First, the accuracy of SQL associations is significantly improved. The SQL assembly method of this invention is based on a real database foreign key relationship graph and a deterministic graph search algorithm (such as BFS). BFS search guarantees finding the shortest association path, avoiding the problem of large language models selecting incorrect association paths due to misunderstandings. The generated SQL association conditions originate from actual foreign key constraints, rather than textual reasoning from the model, thus ensuring the correctness of the association logic. The accuracy of SQL generation shifts from relying on model capabilities to relying on the correctness of the graph search, fundamentally guaranteeing accuracy.

[0031] Secondly, the system is highly interpretable and traceable. The relationship path of each SQL statement can be traced back to a specific path in the table relationship graph. When query results do not meet expectations, the BFS search path and field configuration can be checked to pinpoint the root cause of the problem. Compared to SQL generated in a black-box manner by a large language model, the solution of this invention provides a clear chain of logical relationships, improving the system's reliability and maintainability.

[0032] Third, enhanced capabilities for handling complex data. This invention separates data retrieval from complex computation: the SQL assembly layer is only responsible for accurately acquiring basic data, while the script computation layer handles derived logic and complex processing. This separation avoids writing lengthy and complex computational logic in SQL, fully leveraging the advantages of large language models in programming. Simultaneously, through context engineering optimization (extracting sample data to assist in generation), it ensures both the model's ability to understand the data and solves the contextual constraints encountered during large-scale data processing.

[0033] Fourth, it reduces the burden on model input and supports larger-scale databases. This invention abstracts the database structure through a pre-configured field layer. Large language models only need to understand the field names and business descriptions during intent understanding and field matching, without needing to grasp the complete table structure information. The size of the pre-configured field list is much smaller than the original schema description text, significantly reducing context usage. When the number of database tables expands from dozens to hundreds, the model input size does not increase linearly with the number of tables, but remains at the level of the number of pre-configured fields. System scalability is significantly improved, while the accuracy of the model's understanding of query intent is guaranteed due to the simplified input.

[0034] Fifth, determinism and caching lead to high response efficiency. The SQL assembly layer of this invention employs a deterministic graph search algorithm, where the same set of query fields will always return the same association path. This determinism allows the searched association paths to be cached and reused, avoiding redundant calculations for the same or similar queries. End-to-end response time is significantly reduced and becomes predictable, meeting the timeliness requirements of high-frequency query scenarios. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the overall architecture of the intelligent question-and-answer system based on graph search and large language model collaboration provided in an embodiment of the present invention. Figure 2 A timing diagram illustrating the execution process of the intelligent question-and-answer system provided in an embodiment of the present invention; Figure 3 The flowchart shows the overall process of the intelligent question-answering method based on graph search and large language model collaboration provided in the embodiments of the present invention. Figure 4 A flowchart of the breadth-first search table association path search method provided in an embodiment of the present invention; Figure 5 A flowchart of a script calculation layer processing method provided in an embodiment of the present invention. Detailed Implementation

[0036] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0037] Example 1: like Figure 3 As shown, this embodiment provides an intelligent question-answering method based on the collaboration of graph search and large language model. The method includes the following steps: Step S101: Receive the user's natural language query request and perform intent understanding and field matching.

[0038] Users input natural language queries through the query interface, and the large language model interaction layer receives the request. The large language model requests a pre-configured list of query fields (including field names and descriptions) from the field configuration layer, performs semantic matching on the user's query, and determines the set of relevant fields involved in the user's query as the target field set.

[0039] The pre-configured list of query fields is predefined by the field configuration layer. Each query field is configured with field metadata, which includes at least the following information: (1) Field identifier: The unique ID of the field, used for internal system reference.

[0040] (2) Field name: A name that is readable by the business, such as "sales revenue" or "production cost".

[0041] (3) Field description: A text description used by the large language model to understand the business meaning of the field.

[0042] (4) Source table: The name of the data table where this field is located.

[0043] (5) Source column: The database column name corresponding to this field.

[0044] (6) Data type: The data type of the field, such as integer, floating point, string, date, etc.

[0045] (7) Field limiting conditions (optional): Conditional expressions used to limit the specific meaning of the field, such as determining the value by joining other tables. After configuration, the filter condition clause can be automatically filled in when generating SQL.

[0046] (8) Custom query statement (optional): For certain special fields, users are allowed to configure the query statement fragment for that field individually.

[0047] Step S102: Construct a table association graph based on foreign key relationships.

[0048] During the initialization phase or on-demand updates, the system extracts table structure and foreign key constraint information from the database system tables to construct a table relationship graph. Specifically: (1) Each node represents a database table. The node attributes include table name, column name list, data type, and primary key information.

[0049] (2) Each edge represents a foreign key relationship between two tables. The edge attributes include the association condition and the association type (one-to-one, one-to-many, many-to-one).

[0050] (3) This graph is an undirected graph that supports bidirectional traversal, meaning that you can reach other related tables from any table through foreign key relationships.

[0051] Step S103: Execute the graph search algorithm to search for the shortest association path in the table that covers all target fields and their configured constraint fields.

[0052] Once the large language model interaction layer determines the set of target fields that the user needs to query, the SQL assembly module performs the following steps: (1) Collect target fields and conditions: Obtain all query fields and corresponding limiting conditions required by the user, and extract the target table where each field and condition is located.

[0053] (2) Determine the starting node: Use the source table and source column of the first query field in the user request as the starting node for breadth-first search.

[0054] (3) Perform a breadth-first search: In the table association graph, start from the starting node and perform a breadth-first search, traversing adjacent nodes layer by layer to find the shortest association path that covers the tables containing all target fields and limiting condition fields. For details on the specific execution process of the breadth-first search, please refer to Method Example 3.

[0055] Step S104: Automatically assemble and generate multi-table join SQL query statements based on the shortest join path, and submit them to the database for execution.

[0056] When assembling query logic, the system first checks whether each target field has a custom query statement configured. If so, the user-configured statement fragment is used first, rather than assembled through a breadth-first search, to support more flexible business logic.

[0057] For target fields without configured custom query statements, the system constructs multi-table join statements sequentially based on the association paths obtained through breadth-first search, filling in foreign key association conditions in the join condition clauses. The query column clause includes all columns corresponding to the target field, and the filter condition clause includes the constraints configured for the field, ultimately generating a complete multi-table join query SQL statement. The generated SQL statement is then submitted to the data storage layer for execution to obtain the basic data result set.

[0058] Since the basic data result set may contain a large number of records, in order to avoid exceeding the context window of the large language model, the system only extracts sample data (such as the first few dozen records) from the result set and returns it to the interaction layer of the large language model for subsequent analysis and decision-making.

[0059] Step S105: The large language model determines whether derivative calculations are needed.

[0060] The large language model interaction layer determines whether user needs are met based on extracted basic data. Specifically, the large language model analyzes the semantics of user requests to determine whether derivative calculations (such as calculating profits based on costs and sales) or complex processing (such as multi-step aggregation, conditional filtering, and ranking statistics) are needed on top of the basic data.

[0061] For simple queries, that is, queries that only need to directly obtain basic field data and do not require additional derived calculations, the basic data result set is directly used as the final processing result, and the process proceeds to step S107.

[0062] For requests involving derived computations or complex processing, proceed to step S106.

[0063] Step S106: The script calculation layer generates and executes a data processing script.

[0064] When a query requires derived calculations or complex processing on top of the basic data, the script calculation layer executes the following steps: (1) Context engineering optimization: In order to prevent the amount of basic data from exceeding the context window of the large language model, the system extracts only the metadata definition of relevant fields and sample data (such as the first few dozen records) from the basic data before generating the script, as a context reference for the model. This allows the model to fully understand the data structure and distribution characteristics, while avoiding the performance bottleneck caused by the full amount of data.

[0065] (2) Script generation: Based on the above sample data and user needs, the large language model uses its programming ability to write data processing scripts (such as Python scripts). These scripts are used to perform secondary processing on the basic data, such as derivative calculations, complex aggregations, sorting and filtering.

[0066] (3) Script verification: The large language model runs the data processing script in the sandbox environment using sample data to verify the logical correctness. Specifically, the sample data is input into the data processing script for execution, and the verification output results are obtained; the large language model judges the correctness of the verification output results; when the verification output results are judged to be incorrect, the large language model automatically corrects the data processing script based on the verification feedback, and repeats the verification process until the data processing script passes the verification.

[0067] (4) Full execution: After the script is verified to be correct, the system will apply the final script to the full amount of basic data to obtain the final processing result.

[0068] Step S107: Return the final processing result.

[0069] The final processing result is returned to the large language model interaction layer, which then returns the final result to the user in the form of natural language or charts.

[0070] Example 2: Based on Example 1, this example details the method for constructing the table association graph.

[0071] During the initialization phase, the system extracts table structure information and foreign key constraint information from database system tables (such as the system directory or information schema of a relational database). Specifically: (1) Extract the table name, column name list, data type, and primary key information of all data tables, and create a corresponding graph node for each table. The node attributes include table name, column name list, data type, and primary key information.

[0072] (2) Extract all foreign key constraint information. For each foreign key relationship, create an undirected edge between the two corresponding table nodes. The edge attributes include the association condition (i.e., the correspondence between the foreign key column and the reference column) and the association type (one-to-one, one-to-many, many-to-one).

[0073] (3) Thus, an undirected graph is constructed with database tables as nodes and foreign key relationships as edges. This undirected graph supports bidirectional traversal, that is, starting from any table, other related tables can be reached through foreign key relationships.

[0074] The table relationship graph can be built all at once during system initialization, or it can be updated as needed according to changes in the database structure.

[0075] Example 3: Based on Example 1, such as Figure 4 As shown in the figure, this embodiment details the specific execution flow of the breadth-first search table associated path search method.

[0076] The input information includes: a table relationship graph, a starting table, and a set of target tables. The table relationship graph uses database tables as nodes and foreign key relationships as edges; the starting table is the source table of the first queried field in the user's query; and the set of target tables is the collection of tables containing all target fields and limiting condition fields.

[0077] Search paths are represented by ordered table sequences, with each element in the path recording three parts of information: the current table node, the predecessor table node (i.e., which table leads to the current table), and the foreign key association conditions between the current table node and its predecessor table node.

[0078] The search process is as follows: Step 1: Initialization Phase. Create a first-in, first-out (FIFO) queue and a globally visited set. Add the initial search path containing only the starting table to the queue, and add the single-element set of the starting table to the globally visited set.

[0079] The second step is to retrieve the head path of the queue. The head path of the queue is retrieved, and the set of tables formed by all table nodes along that path is compared with the target set of tables.

[0080] Step 3: Coverage check. If the current table set already contains all tables in the target table set, then the current search path is the shortest association path that covers all target tables. The search ends successfully, and the path is output.

[0081] Step 4: Path Expansion. If the table set does not yet cover all target tables, the search path is expanded. Traverse all neighboring nodes of each table node in the table association graph within the search path, performing the following checks and operations for each neighboring node: (1) If the neighbor node is already included in the table set of the current search path, it means that expanding the neighbor node will form a loop, and the neighbor node will be skipped.

[0082] (2) If the neighbor node is not in the table set of the current search path, then merge the table set of the current search path with the neighbor node to obtain a new table set. Determine whether the new table set is already in the globally visited set.

[0083] (3) If the new set of tables is already in the global visited set, it means that another search path with a different access order has covered the same set of tables, which is the state of being explored. Skip the neighbor node and do not expand again.

[0084] (4) If the new table set is not in the global visited set, add the new table set to the global visited set, extend the neighbor node to the end of the current search path, record the foreign key association conditions between the neighbor node and its predecessor node, and generate a new search path to add to the end of the queue.

[0085] Step 5: Repeat steps 2 through 4 until the queue is empty or a shortest association path covering all target tables is found. If the queue is empty and a path covering all target tables has not been found, the search fails and an empty result is output.

[0086] In the above search method, the globally visited set is deduplicated using "the set of tables covered by the search path" as the element. Because the set is unordered, multiple search paths covering the same set of tables but accessed in different orders are considered the same search state and recorded only once. This pruning mechanism effectively avoids duplicate searches caused by different access orders, significantly reducing the search space and improving search efficiency.

[0087] Taking a pharmaceutical manufacturing execution system as an example, suppose a user query involves three tables: the production order table, the material receiving and receiving table, and the quality inspection table. The system starts with the production order table as the starting node and expands the search layer by layer outward in the table association graph. If the production order table is directly connected to the material receiving and receiving table, and the material receiving and receiving table is directly connected to the quality inspection table, then the breadth-first search finds the material receiving and receiving table, which is the neighbor of the production order table, in the first layer of expansion, and the quality inspection table, which is the neighbor of the material receiving and receiving table, in the second layer of expansion. At this point, the search path has covered all three target tables, and the search terminates, resulting in the shortest association path: production order table — material receiving and receiving table — quality inspection table.

[0088] Example 4: This embodiment details a method for automatically assembling multi-table join SQL query statements based on the shortest join path.

[0089] After obtaining the shortest join path covering all target tables, the SQL assembly module performs the following concatenation operation: (1) Priority judgment: For each target field, first determine whether a custom query statement is configured in the field metadata of the target field. If a custom query statement is configured, then the custom query statement is used as the query logic for the field and is not involved in the SQL assembly based on the shortest association path.

[0090] (2) Multi-table join concatenation: For target fields without configured custom query statements, multi-table join clauses are generated sequentially according to the traversal order of each table node in the shortest association path. For two adjacent table nodes, the foreign key association conditions between the table nodes are filled into the join condition clause. For example, if the shortest association path is "Production Order Table - Material Receiving Table - Quality Inspection Table", and the Production Order Table and Material Receiving Table are associated through order number, and the Material Receiving Table and Quality Inspection Table are associated through material number, then the generated multi-table join statement sequentially connects the Production Order Table and Material Receiving Table (association condition is order number), and then connects the Material Receiving Table and Quality Inspection Table (association condition is material number).

[0091] (3) Assembly of query column clauses: The query column clauses contain the source columns corresponding to all target fields. For each target field, its source table and source column are filled into the query column clause.

[0092] (4) Assembly of filter condition clauses: For target fields with configured field constraints, the constraints are automatically filled into the filter condition clauses.

[0093] (5) SQL statement generation: Combine the above clauses to generate a complete multi-table join SQL query statement and submit it to the database for execution.

[0094] Example 5: like Figure 5As shown in this embodiment, the processing mechanism of the script calculation layer is described in detail when the query request involves derived calculations or complex processing.

[0095] When the large language model determines that a user query requires derived calculations (such as calculating profit based on cost and sales) or complex processing (such as multi-step aggregation, conditional filtering, and ranking statistics) on top of the basic data, the following steps are executed: Step S501: Context engineering optimization.

[0096] To prevent the amount of base data from exceeding the context window of the large language model, the system extracts only the metadata definitions of relevant fields and sample data from the base data before generating the script, serving as a context reference for the model. The sample data consists of a subset of records from the base data result set, such as the first few dozen records, and the number of sample data entries is less than the total number of records in the base data result set. This strategy allows the model to fully understand the data structure and distribution characteristics while avoiding performance bottlenecks caused by using the full dataset.

[0097] Step S502: Script generation.

[0098] Based on the aforementioned sample data, the target field's metadata, and user requirements, the large language model utilizes its programming capabilities to write data processing scripts. These scripts can be written in programming languages ​​that support data processing, such as Python, to perform secondary processing on the basic data, including derived calculations, complex aggregations, sorting, and filtering, in order to address query requirements not directly defined in the pre-configured fields.

[0099] Step S503: Script verification and automatic correction.

[0100] The large language model runs the data processing script in a sandbox environment using sample data to verify the logical correctness. Specifically: (1) Input the sample data into the data processing script and execute it to obtain the verification output results.

[0101] (2) The large language model is used to judge the correctness of the verification output results and to determine whether the script has completed the derivation calculation or complex processing according to the expected logic.

[0102] (3) When the verification output result is determined to be incorrect, the large language model automatically corrects the data processing script based on the verification feedback (such as the specific reasons why the output result does not match the expectation) and repeats the above verification steps until the data processing script passes the verification.

[0103] Step S504: Execute the full process.

[0104] After the script is verified to be correct, the system applies the final script to all the basic data to obtain the final processing result.

[0105] Step S505: Result returned.

[0106] The script execution result is returned to the large language model interaction layer, which then organizes the final response and returns it to the user.

[0107] Because the SQL assembly layer uses a deterministic breadth-first search algorithm, the search results for the same set of query fields will always yield the same association paths. Based on this deterministic characteristic, the system caches and stores the search results for association paths.

[0108] Specifically, the system establishes a cache of related paths, using the target field set as the key and the searched related paths as the value. When a new query request is received, it first checks whether the target field set of the query request has already been matched in the cache. If matched, the cached related paths are directly invoked, skipping the step of re-executing the graph search, thereby significantly reducing response time. If not matched, a graph search is performed to obtain new related paths, which are then stored in the cache for later reuse.

[0109] In actual testing, the search time when the associated path hits the cache is about 3 milliseconds, while the search time when the cache is not hit is about 45 milliseconds. Cache reuse significantly improves the response efficiency in high-frequency query scenarios.

[0110] Example 6: This embodiment illustrates the application process of the technical solution of the present invention in the context of a real-world business scenario of a pharmaceutical manufacturing execution system (MES).

[0111] The database used in this scenario is the MES production database of a pharmaceutical company, containing 64 business tables, approximately 1600 fields, and 23 foreign key relationships, covering business modules such as production orders, batch records, material receipt and dispatch, cost accounting, sales outbound delivery, and quality inspection. The system pre-configures 143 query fields at the field configuration layer, covering commonly used indicators and dimensions of the aforementioned business modules. The large language model uses a 27-parameter open-source large language model (quantized deployment).

[0112] Scenario 1: Basic data query.

[0113] A user asked, "How much sales revenue and cost do I need for a specific batch of products?" The system processing procedure is as follows: (1) The large language model interaction layer receives the request, performs intent understanding and field semantic matching, and matches the two query fields "sales amount" and "cost" from the 143 pre-configured query fields, which are respectively from the sales table (such as the sales outbound table) and the cost table (such as the cost accounting table).

[0114] (2) The SQL assembly layer takes the source table of the first field (sales amount) as the starting node and searches for the shortest association path covering the sales table and the cost table in the table association graph using a breadth-first search algorithm. If there is a direct foreign key relationship between the sales table and the cost table, the shortest association path only needs one jump to cover the two target tables; if there is no direct relationship between the two, an intermediate table (such as the production order table) is required for association.

[0115] (3) The SQL assembly layer automatically assembles and generates multi-table join SQL query statements based on the shortest join path, submits them to the database for execution, and obtains the basic data result set. Sample data is extracted and returned to the large language model interaction layer.

[0116] (4) The large language model determines that the query only needs to directly obtain the basic field data and does not require derivative calculations. The basic data result set is returned to the user as the final processing result.

[0117] Scenario 2: Derivative calculation query.

[0118] A user asked, "Calculate the profit margin of a certain batch of products." The system processing procedure is as follows: (1) The large language model interaction layer matches the two query fields "sales amount" and "cost", and the SQL assembly layer obtains the basic data result set of the two fields.

[0119] (2) The large language model judgment needs to be derived from the basic data (profit = sales revenue - cost, profit margin = profit / sales revenue).

[0120] (3) Optimize the execution context of the script calculation layer by extracting sample data of field metadata definitions and basic data (such as the first few dozen records) as the model context.

[0121] (4) The large language model generates a Python script based on the sample data, which is used to calculate profit and profit margin.

[0122] (5) The large language model runs the script in a sandbox environment using sample data to verify the correctness of the logic. For example, the sales and costs in the sample data are substituted into the script to check whether the output profit and profit margin meet expectations. If the verification fails, the script is automatically corrected and re-verified based on the verification feedback.

[0123] (6) After the script is verified, the script is applied to the full set of basic data to calculate the profit and profit margin of the batch of products and return it to the user.

[0124] Experimental verification data: To verify the practicality and effectiveness of the technical solution of this invention, the system was tested in the business database environment of a pharmaceutical manufacturing execution system. The test database is the production database of a pharmaceutical company's MES, containing 64 business tables, approximately 1600 fields, and 23 foreign key relationships. 143 query fields were pre-configured. The large language model adopted was a 27B parameter open-source large language model (quantized deployment). A total of 120 typical business queries were compiled, including 90 basic data queries (30 single-table queries, 25 two-table joins, 20 three-table joins, and 15 four- to five-table joins) and 30 derived calculation queries (covering scenarios such as arithmetic derivation, multi-step aggregation, complex sorting and filtering, and statistical indicators).

[0125] The accuracy test results for multi-table joins are shown in Table 1 below: Table 1. Accuracy Test Results of Basic Data Query

[0126] In all 60 multi-table join queries, the SQL join paths assembled by the breadth-first search algorithm were completely consistent with the expected join paths verified by humans, achieving a 100% join logic accuracy. The 7 end-to-end query errors all originated from the field semantic matching stage: 5 of these were due to the model confusing semantically similar fields (such as "sales amount" and "actual sales amount"), and 2 were due to user filter conditions being associated with incorrect query fields, unrelated to the SQL assembly process. As the number of tables involved in the query increased, the end-to-end accuracy showed a downward trend, mainly because multi-table queries involve more fields and distinguishing semantically similar fields is more difficult. However, the overall accuracy remained at a high level, verifying the reliability of graph search-based SQL assembly in complex multi-table scenarios.

[0127] The test results for derivative computing support capabilities are shown in Table 2 below: Table 2 Results of Derivative Computing Support Capability Test

[0128] All 30 queries mentioned above involve derived calculation logic that cannot be directly expressed by single-field SQL statements (such as calculating profit based on sales and costs, calculating monthly growth rate, and ranking statistics for batches). Test results show that the data processing scripts generated by the large language model based on sample data have a first-pass rate of 80.0%. For the 6 tasks that failed on the first attempt, the system automatically adjusted the scripts based on the verification output in the sandbox environment and re-executed them. Four of these re-executed scripts obtained correct results, resulting in a final success rate of 93.3%. The scripts for the remaining 2 tasks could run normally, but they had logical defects that could not be exposed by the sample data: one task involved multi-month month-on-month calculations, but the sample data only covered 2 months. The script's handling of the boundary where there was no comparative benchmark data in the first period was inconsistent with the expected scope, leading to deviations in the full execution results; the other task had null value fields in the full data that did not appear in the sample, and the script's handling of null values ​​was inconsistent with the expected scope, resulting in inaccurate calculation results. This type of defect indicates that the effectiveness of sample validation depends on the representativeness of the sample data to the full dataset. It can be further reduced by replacing it with a more representative sampling strategy such as stratified sampling, and is unrelated to the correctness of SQL assembly and basic data acquisition.

[0129] Response efficiency data: The average time for field semantic matching is approximately 1.3 seconds; the average time for SQL assembly (breadth-first search path search and SQL concatenation) is approximately 45 milliseconds, with approximately 3 milliseconds for cache hits on related paths; the average time for SQL execution is approximately 0.4 seconds; and the average end-to-end response time for basic queries is approximately 2.5 seconds. For derived computation queries, the large language model needs to generate data processing scripts based on sample data and perform sandbox validation. Tasks that fail validation require multiple rounds of model inference to complete self-correction, with this step averaging approximately 32 seconds; the average time for full script execution is approximately 2.5 seconds; and the average end-to-end response time for derived computation queries is approximately 38 seconds. Because the SQL assembly stage is a deterministic graph search process, search results for the same set of fields can be cached and reused, resulting in stable and predictable response times for basic queries, meeting the timeliness requirements of high-frequency query scenarios.

[0130] In summary, the test results show that the present invention achieves an end-to-end query accuracy of 92.2% in scenarios involving complex multi-table joins, with all SQL join paths guaranteed to be correct by graph search. For derivative computation scenarios that are difficult to cover with a single SQL statement, a final completion rate of 93.3% is achieved through the script computation layer. The SQL assembly stage features millisecond-level response and can be cached and reused. These data verify the effectiveness of the technical solution of the present invention from three aspects: multi-table join accuracy, derivative computation support capability, and response efficiency.

[0131] Example 7: like Figure 1As shown, this embodiment provides an intelligent query system based on graph search and large language model collaboration. The system adopts a five-layer architecture, which from top to bottom are: large language model interaction layer, field configuration layer, SQL assembly layer, script calculation layer and data storage layer.

[0132] The large language model interaction layer engages in natural language dialogue with the user, understands the query intent, matches relevant fields from a pre-configured field list, and processes and generates responses after obtaining basic data. This layer receives the user's natural language input, outputs field matching results to the field configuration layer, receives basic data returned by the SQL assembly layer, and returns the final result to the user.

[0133] The field configuration layer pre-configures business query fields and their metadata, defining the business meaning, data source table, corresponding column, and optional field constraints for each field, establishing a mapping relationship between user queries and database columns. This layer provides a list of fields for semantic matching to the large language model interaction layer, and also provides field metadata to the SQL assembly layer to guide SQL concatenation.

[0134] The SQL assembly layer constructs a table relationship graph based on database foreign key relationships. It receives the field set from the large language model interaction layer, automatically finds the relationship paths between tables using a breadth-first search algorithm, and concatenates them to generate SQL queries involving multiple tables, ensuring accurate retrieval of basic data. This layer receives metadata from the field configuration layer, obtains foreign key relationship information from the data storage layer, executes the SQL query, and returns basic data to the large language model interaction layer. When the result set contains a large number of records, only a portion is extracted and returned to avoid exceeding the context window of the large language model.

[0135] The script computation layer utilizes the programming capabilities of the large language model to write data processing scripts. These scripts perform secondary processing on the basic data obtained from the SQL assembly layer, including derived calculations, complex aggregations, sorting, and filtering, to address query requirements not directly defined in pre-configured fields. This layer receives the basic data from the large language model interaction layer and outputs the processed final results back to the large language model interaction layer.

[0136] The data storage layer stores raw business data and table structure information. This layer provides table structure and foreign key constraint information to the SQL assembly layer, and executes SQL queries to return data.

[0137] like Figure 2 As shown, the interaction timing relationship between the above layers is as follows: (1) Users input natural language query questions through the query interface, and the large language model interaction layer receives the request.

[0138] (2) The large language model interaction layer requests the field configuration layer to query the field list, performs intent understanding and field semantic matching, and determines the target field set.

[0139] (3) The large language model interaction layer passes the set of matching target fields to the SQL assembly layer.

[0140] (4) The SQL assembly layer calls the breadth-first search algorithm to search for the shortest association path in the table association graph, automatically assembles and generates SQL query statements, and submits them to the data storage layer for execution.

[0141] (5) The data storage layer executes SQL queries and returns the basic data result set. The SQL assembly layer extracts sample data (e.g., the first few dozen records) and returns it to the large language model interaction layer.

[0142] (6) The large language model interaction layer determines whether the user's needs are met based on the sample data. For simple queries, it directly organizes natural language responses; for requests involving derivative calculations or complex processing, it passes the sample data and user requirements to the script calculation layer.

[0143] (7) The script calculation layer generates a data processing script based on the sample data, verifies the correctness of the script in the sandbox, and applies the script to the full set of basic data after verification, and returns the processed result to the large language model interaction layer.

[0144] (8) The large language model interaction layer returns the final result to the user in the form of natural language or charts.

[0145] Example 8: This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the intelligent query method based on graph search and large language model collaboration described in any one of the above-described embodiments one to six.

[0146] Specifically, the computer-readable storage medium can be any medium capable of storing computer programs, such as read-only memory (ROM), random access memory (RAM), disk, optical disk, USB flash drive, or portable hard drive. When the computer program is executed by the processor, the processor performs all the steps in the above-described intelligent query method, including: receiving the user's natural language query request and performing intent understanding and field matching; constructing a table association graph based on foreign key relationships and performing a breadth-first search to find the shortest association path; automatically assembling and generating multi-table join SQL query statements based on the shortest association path and submitting them to the database for execution to obtain the basic data result set; determining whether derivative calculations are needed and calling the script calculation layer for processing; and returning the final processing result to the user.

[0147] When the computer program runs on the processor, it can also perform the following functions: cache the searched associated paths, and directly call the cached associated paths for query requests containing the same set of target fields, skipping the step of re-executing the graph search.

[0148] It should be noted that those skilled in the art should understand that, without departing from the concept of the present invention, the technical solution of the present invention can be modified and improved in several ways, and these modifications and improvements all fall within the protection scope of the present invention. Specifically, the following alternative solutions can be adopted, but are not limited to: (1) The breadth-first search algorithm used in the SQL assembly layer can be replaced by other graph search or path discovery algorithms, such as depth-first search algorithm, A* search algorithm, Dijkstra's shortest path algorithm, etc., which can also achieve the discovery of table association paths.

[0149] (2) The construction method of the table relationship diagram can be replaced by: manually configuring the table relationship, automatically extracting from the object relationship mapping framework configuration, or automatically discovering the implicit relationship between tables through data analysis tools.

[0150] (3) The strategy of using the global visited set for pruning in the SQL auto-assembly algorithm can be replaced by other pruning strategies such as path length threshold pruning, association priority pruning, and table popularity score pruning.

[0151] (4) When there are multiple association paths of equal length, the system’s strategy for selecting the optimal path can be replaced by other decision-making strategies such as selecting based on the query frequency of the table, selecting based on the association type (prioritizing one-to-one association), and selecting based on preset weights.

[0152] (5) Field matching can be completed by a large language model based on semantics, or it can be replaced by keyword matching, vector similarity search, rule engine or other natural language processing techniques.

[0153] (6) The programming language used in the script computing layer is not limited to Python, but can be replaced by any language that supports data processing capabilities, such as JavaScript, R, SQL scripts, etc.

[0154] (7) The strategy for extracting sample data in context engineering can be replaced by other data sampling strategies such as random sampling, stratified sampling, and sampling based on data distribution.

[0155] (8) The data storage layer connects to a relational database, or it can be replaced with a data warehouse, data lake, non-relational database (NoSQL) or hybrid data storage architecture.

[0156] (9) The sandbox environment of the script computation layer can be replaced by a containerized execution environment, a Jupyter Notebook environment or other secure code execution environment.

[0157] (10) The system returns results in a manner that can be replaced by natural language text, charts, structured data formats, voice broadcasts or other visualizations.

[0158] (11) The five-layer architecture can be merged or split according to actual needs. For example, the field configuration layer can be merged with the SQL assembly layer, or the script calculation layer can be split into a script generation sub-layer and a script execution sub-layer.

[0159] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An intelligent question counting method based on the collaboration of graph search and large language model, characterized in that, Includes the following steps: The system receives a user's natural language query request, performs intent understanding and field semantic matching on the natural language query request using a large language model, and determines a set of target fields associated with the natural language query request from a pre-configured list of query fields; wherein, each query field in the pre-configured list of query fields is configured with field metadata, and the field metadata includes at least a field identifier, field name, field description, source table, source column, and data type; Based on the source tables and source columns of each target field and its configured limiting condition fields in the target field set, a table association graph is constructed based on the foreign key relationships in the database. Taking the source table of the first query field in the target field set as the starting node, a graph search algorithm is executed in the table association graph to search for the shortest association path covering the tables containing all target fields and their configured limiting condition fields in the target field set. Based on the shortest association path and the source columns of each target field and its configured limiting condition fields, a multi-table association SQL query statement is automatically assembled and generated, submitted to the database for execution, and a basic data result set is obtained. The large language model determines whether the natural language query request requires derived calculations based on the basic data result set. If so, the large language model generates a data processing script based on sample data from the basic data result set. The correctness of the data processing script is verified using the sample data in a sandbox environment. After successful verification, the data processing script is applied to the full set of basic data for execution to obtain the final processing result. If not, the basic data result set is used as the final processing result. The final processing result is returned to the user.

2. The intelligent question counting method based on graph search and large language model collaboration according to claim 1, characterized in that, The table association graph is an undirected graph with database tables as nodes and foreign key relationships as edges. When constructing the table association graph, table structure and foreign key constraint information are extracted from the database system tables. Each node records the table name, column name list, data type and primary key information of the corresponding table, and each edge records the foreign key association conditions and association type between two nodes.

3. The intelligent question counting method based on graph search and large language model collaboration according to claim 1, characterized in that, The graph search algorithm is a breadth-first search (BFS) algorithm, which includes: Step A: Using the starting node as the search starting point, enqueue the initial search path that includes the starting node; Step B: Retrieve the current search path from the queue and determine whether the set of tables covered by the current search path contains all the target fields and their configured limiting condition fields in the target field set; if so, use the current search path as the shortest association path. Step C: If the current search path does not cover all target tables, then traverse all neighbor nodes of each node in the current search path in the table association graph. For each neighbor node not covered by the current search path, determine whether the new table set formed after expanding the neighbor node to the current search path is already in the global visited set. If not, add the new table set to the global visited set and expand to generate a new search path and enqueue it. Step D: Repeat steps B through C until the queue is empty or the shortest association path covering all target tables is found.

4. The intelligent question counting method based on graph search and large language model collaboration according to claim 3, characterized in that, The global visited set is composed of the set of tables covered by the search path. Search paths that cover the same set of tables in different access orders are considered to be in the same state and are recorded only once, so as to prune duplicate search paths and reduce the search scale.

5. The intelligent question counting method based on graph search and large language model collaboration according to claim 1, characterized in that, When automatically assembling and generating the multi-table join SQL query statement, for each target field, it is first determined whether a custom query statement is configured in the field metadata of the target field; if a custom query statement is configured, the custom query statement is used first as the query logic for that field, rather than assembling the SQL through the shortest join path; if no custom query statement is configured, the multi-table join JOIN statement is concatenated according to the traversal order of each node in the shortest join path, the join conditions are filled into the ON clause, the SELECT clause contains all columns corresponding to the target fields, and the WHERE clause contains the filter conditions specified by the user, finally generating a complete multi-table join SQL query statement.

6. The intelligent question counting method based on graph search and large language model collaboration according to claim 1, characterized in that, The sample data in the basic data result set is a portion of the records in the basic data result set. The number of sample data is less than the total number of records in the basic data result set to avoid exceeding the context window of the large language model. The data processing script is generated by the large language model based on the sample data, the field metadata of the target field, and the derived calculation requirements of the query request.

7. The intelligent question counting method based on graph search and large language model collaboration according to claim 6, characterized in that, Verifying the correctness of the data processing script using the sample data in the sandbox environment includes: Step a: Input the sample data into the data processing script for execution and obtain the verification output results; Step b: The large language model is used to determine the correctness of the verification output. Step c: When the verification output result is determined to be incorrect, the large language model automatically corrects the data processing script based on the verification feedback, and repeats steps a to b until the data processing script passes verification.

8. The intelligent question counting method based on graph search and large language model collaboration according to claim 1, characterized in that, The method further includes a step of caching the shortest association path: for query requests containing the same set of target fields, the cached association path is directly invoked, skipping the step of re-executing the graph search.

9. An intelligent question counting system based on graph search and large language model collaboration, applied to the intelligent question counting method based on graph search and large language model collaboration as described in any one of claims 1-8, characterized in that, include: The large language model interaction module is used to receive users' natural language query requests, perform intent understanding and field semantic matching on the query requests, determine the associated target field set from the pre-configured query field list, and determine whether derivative calculations are needed based on the basic data result set after obtaining the basic data result set, and organize the final processing results to be returned to the user. The field configuration module is used to pre-configure business query fields and their field metadata. The field metadata includes at least field identifier, field name, field description, source table, source column, data type and optional field constraints. It also provides a field list for semantic matching to the large language model interaction module and field metadata to guide SQL concatenation to the SQL assembly module. The SQL assembly module is used to construct a table association graph based on the foreign key relationship of the database. It receives the target field set passed by the large language model interaction module, executes a graph search algorithm in the table association graph to search for the shortest association path covering all target fields in the target field set and the tables containing the configured limiting condition fields, and automatically assembles and generates multi-table association SQL query statements based on the shortest association path, submits them to the database for execution to obtain the basic data result set. When the number of records in the basic data result set exceeds a preset threshold, only a portion of the records are extracted and returned to the large language model interaction module. The script calculation module is used to generate a data processing script based on the sample data of the basic data result set when the large language model determines that derivative calculations are required. The script is then used to verify the correctness of the data processing script in a sandbox environment. After verification, the script is applied to the full set of basic data for execution, and the final processing result is output to the large language model interaction module. The data storage module is used to store raw business data and table structure information, provide table structure and foreign key constraint information to the SQL assembly module, and execute SQL query statements to return data.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the intelligent question-answering method based on graph search and large language model collaboration as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • SQL generation method and device based on large model and ER atlas

    CN121117006A

  • NL2SQL method based on foreign key completion and knowledge graph

    CN121722785A