Knowledge base and large model based query method

By constructing a knowledge base and a large language model, and utilizing terminology matching and example guidance, a target pseudo-schema is generated and a query view is encapsulated. This solves the problems of domain knowledge gaps and complex logical calculations in database systems in real enterprise environments, and achieves efficient and accurate natural language to SQL query conversion.

CN121188083BActive Publication Date: 2026-04-10JIUYOU TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIUYOU TECH (SHENZHEN) CO LTD
Filing Date
2025-11-21
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing database systems face challenges in real-world enterprise environments, including a lack of domain knowledge, weak schema generalization capabilities, and difficulties in complex logical calculations, resulting in low accuracy and efficiency in converting natural language to SQL.

Method used

By constructing a knowledge base and a large language model (LLM), using a keyword dictionary and a dynamic example library for precise term matching, generating target pseudo-schemas, filtering the minimum set of tables and encapsulating them into query views, and optimizing SQL generation for the list in conjunction with reference examples, we achieve efficient and accurate conversion of natural language into executable query statements.

Benefits of technology

It improves the efficiency and accuracy of converting natural language to SQL queries, reduces the error rate, and ensures the consistency of query results and the accuracy of enterprise data interpretation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121188083B_ABST
    Figure CN121188083B_ABST
Patent Text Reader

Abstract

The application discloses a query method based on a knowledge base and a large model, and the method comprises the following steps: constructing a knowledge base of a database; obtaining target language information containing a user question input by a user; generating a target pseudo mode corresponding to the target language information based on the knowledge base; screening out a minimum table set associated with an answer to the user question from the knowledge base based on the target pseudo mode; encapsulating multi-table connection logic in the minimum table set into a query view; retrieving a reference example pair list of an indication question and a query sentence mapping relationship most similar to the user question from the knowledge base based on the query view and the target language information, wherein each example pair in the reference example pair list represents a mapping relationship between a question and a query sentence; generating a target query sentence corresponding to the target language information based on the user question, the target pseudo mode, the query view and the reference example pair list, and retrieving in the database based on the target query sentence to obtain a query result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of database, in particular to a query method based on a knowledge base and a large model. BACKGROUND

[0002] In modern database systems, traditional Text-to-SQL models (such as some template-based or sequence-to-sequence models) perform well on general and public datasets (such as Spider), but in real enterprise environments, they often encounter the following challenges: (1) lack of domain knowledge, the model does not understand business terms. For example, the user asks "show high-value customers last month", the model needs to know that "high-value customers" may correspond to WHERE customer_type = 'VIP' in the database, and how to express "last month" with SQL date functions; (2) weak pattern generalization ability, when database tables and column names are obscure (such as tbl_001, col_f12) or constantly changing, the model performance will drop sharply; (3) complex logic and calculation, for queries that require multi-step reasoning or complex calculations, pure end-to-end models are prone to errors. The prior art is challenged by the ambiguity of terms, complex multi-table joins, and difficulty in decomposing complex problem logic in natural language to SQL in real databases. SUMMARY

[0003] In order to solve the existing technical problems, the embodiments of the present application provide a query method based on a knowledge base and a large model, which can realize efficient and accurate conversion of natural language to executable query statements through the whole process design of term accurate matching, example guided screening, join view simplification, and SQL generation optimization.

[0004] In a first aspect, a query method based on a knowledge base and a large model is provided, comprising: constructing a knowledge base of a database; obtaining target language information input by a user, the target language information containing a user question; generating a target pseudo schema corresponding to the target language information based on the knowledge base; screening a minimum table set associated with answering the user question from the knowledge base based on the target pseudo schema; encapsulating multi-table join logic in the minimum table set into a query view; retrieving a reference example pair list of an indication question and a query statement mapping relationship from the knowledge base based on the query view and the target language information, wherein each example pair in the reference example pair list represents a mapping relationship between a question and a query statement; generating a target query statement corresponding to the target language information based on the user question, the target pseudo schema, the query view, and the reference example pair list, and retrieving in the database based on the target query statement to obtain a query result.

[0005] The application constructs a knowledge base of a database; obtains target language information containing a user question input by a user; generates a target pseudo pattern corresponding to the target language information based on the knowledge base; screens out a minimum table set associated with answering the user question from the knowledge base based on the target pseudo pattern; encapsulates multi-table connection logic in the minimum table set into a query view; retrieves a reference example pair list of an indication question and query statement mapping relationship from the knowledge base based on the query view and the target language information, wherein each example pair in the reference example pair list represents a mapping relationship between a question and a query statement; generates a target query statement corresponding to the target language information based on the user question, the target pseudo pattern, the query view and the reference example pair list, and retrieves in the database based on the target query statement to obtain a query result. Through the whole process design of term accurate matching, example guided screening, connection view simplification and SQL generation optimization, efficient and accurate conversion from natural language to executable query statement is realized. BRIEF DESCRIPTION OF DRAWINGS

[0006] Figure 1 An application environment diagram of a query method based on a knowledge base and a large model in an embodiment;

[0007] Figure 2 A flowchart of a query method based on a knowledge base and a large model in an embodiment;

[0008] Figure 3 A schematic diagram of a query device based on a knowledge base and a large model in an embodiment;

[0009] Figure 4 A schematic diagram of a terminal device in an embodiment. DETAILED DESCRIPTION

[0010] The technical solutions of the present application will be further described in detail below in combination with the accompanying drawings and specific embodiments.

[0011] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terminology used in the description of the present application herein only for the purpose of describing specific embodiments and is not intended to limit the protection scope of the present application. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0012] In the following description, the expression "some embodiments" describes a subset of all possible embodiments, but it should be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0013] Referring to Figure 1 In an embodiment, the knowledge base and large model based query method and the application environment diagram of the knowledge base and large model based query method include a plurality of terminal devices 100 and a computing device 200, wherein the terminal device 100 can be in communication connection with the computing device 200, the knowledge base and large model based query method provided by the embodiment of the present application can be applied to the computing device 200, and the computing device 200 is configured with a database and a knowledge base established based on the database. The computing device 200 obtains target language information containing a user question acquired by the terminal device 100, generates a target query statement corresponding to the target language information based on the knowledge base, and queries a corresponding query result according to the target query statement. The terminal device 100 can receive target language information input based on a user interface.

[0014] Referring to Figure 2 The flowchart of the knowledge base and large model based query method provided by an embodiment of the present application. The knowledge base and large model based query method is applied to a computing device, and the knowledge base and large model based query method includes the following steps:

[0015] S10, constructing a knowledge base of a database.

[0016] In the embodiment, the knowledge base includes a keyword dictionary and a dynamic example library, wherein the keyword dictionary represents a mapping corresponding relationship established between natural language and metadata information of the database. The keyword dictionary includes table mapping, column mapping, value mapping, etc. The schema (all table names, column names) and data values of the target database are indexed, and a keyword dictionary including table mapping, column mapping and value mapping is established through LLM generation and artificial construction. The keyword dictionary includes official names, business terms, synonyms and the association of key data values with their locations.

[0017] The dynamic example library includes a large number of example pairs. Each example pair includes a natural language question and a query statement corresponding to the natural language question. The dynamic example library is a huge question-SQL set created for the database. It stores thousands of questions that users may ask and their corresponding correct SQL answers. For example, the user question is "What product sold the most last month?", and the corresponding SQL is "Query the first record of the product table sorted in descending order of sales_amount". Through the dynamic example library, the large model should generate the corresponding style SQL to answer such colloquial questions, the purpose is to provide a learning data set, when a new user question comes in, the system will quickly search for the most similar historical question in terms of semantics in this knowledge base. Then, the found question-SQL pair is used as an example to form a context and is displayed to the large model.

[0018] S11, acquire target language information containing user question input by user.

[0019] In the embodiment, the target language information represents the colloquial language expression input by the user.

[0020] S12, generate a target pseudo schema corresponding to the target language information based on the knowledge base.

[0021] In the embodiment, the user's vague target natural language information is accurately mapped to specific elements (tables, columns, values) of the database, and a structured pseudo schema matching the database is generated, providing high-quality guidance for subsequent steps.

[0022] S13, based on the target pseudo schema, filter out the smallest table set associated with answering the user's question in the knowledge base.

[0023] In the embodiment, from all tables in the database, the smallest table set necessary to answer the question and connectable to each other is accurately filtered out, excluding irrelevant tables. The smallest table set represents the smallest set of all necessary tables to answer the user's question.

[0024] S14, encapsulate the multi-table connection logic in the smallest table set into a query view.

[0025] In the embodiment, the query view includes the optimal path connecting all tables in the smallest table set. The connection logic of multiple tables in the smallest table set can be encapsulated through the query view, and the semantic mapping can be simplified through the query view. The query view converts obscure original column names (such as p.business_unit) into intuitive business column names (such as department). The large language model LLM now only needs to understand the business term department, which can be directly used, without knowing which table and column it corresponds to. Through the query view, the task difficulty of LLM can be reduced. Previously, LLM needed to complete a high-difficulty task, which required understanding the user's question -> mapping business terms to physical table columns -> reasoning the multi-table connection path -> generating complex SQL. Now, the task has been simplified to a low-difficulty task: it can understand the user's question, map business terms to view columns, provide context information to view columns, and generate simple single-table query SQL.

[0026] S15, based on the query view and the target language information, retrieve a reference example pair list of the mapping relationship between the indication question and the query statement from the knowledge base, where each example pair in the reference example pair list represents the mapping relationship between the question and the query statement.

[0027] In the present embodiment, the semantic similarity between the user question and each example pair stored in the knowledge base can be calculated, and based on the semantic similarity, the top pre-set number of example pairs are filtered out from large to small as the reference example pair list. Each example pair in the list shows how a natural language question of a specific type should be mapped to a SQL query, so the reference example pair list can provide a standard reference answer for the LLM.

[0028] S16, based on the user question, the target pseudo pattern, the query view and the reference example pair list, generating a target query statement corresponding to the target language information, and based on the target query statement, retrieving in the database to obtain a query result.

[0029] In the present embodiment, the user question provides the original demand intention, the target pseudo pattern ensures to avoid known systematic error patterns, the query view encapsulates the correct data model and business logic, and the reference example pair list provides verified mapping templates. This four-fold verification mechanism ensures that the generated SQL is correct in syntax, accurate in semantics and reasonable in business logic, greatly reducing the probability of generating incorrect SQL. The query view converts complex multi-table connection problems into simple single-table query problems, the reference example pair provides specific pattern references, avoids LLM from starting from scratch, and the target pseudo pattern precludes common error paths. This design reduces the cognitive complexity of LLM from understanding the entire database schema and generating complex connections to selecting appropriate columns in the simplified view and applying simple filters, substantially simplifying the problem domain. The query view provides standardized business terminology to technical implementation mapping reference examples, the reference example pair ensures that similar questions generate consistent query patterns, and the target pseudo pattern prevents deviation from established business rules, which ensures that the same business requirements proposed by different users at different times can obtain consistent query results, maintaining the consistency of enterprise data interpretation.

[0030] In the above embodiments, a knowledge base of a database is constructed; target language information containing a user question is obtained through user input; based on the knowledge base, a target pseudo pattern corresponding to the target language information is generated; based on the target pseudo pattern, a minimum table set associated with answering the user question is screened out in the knowledge base; multi-table connection logic in the minimum table set is encapsulated into a query view; based on the query view and the target language information, a reference example pair list of an indicative question and query statement mapping relationship that is most similar to the user question is retrieved from the knowledge base, wherein each example pair in the reference example pair list represents a mapping relationship between a question and a query statement; based on the user question, the target pseudo pattern, the query view and the reference example pair list, a target query statement corresponding to the target language information is generated, and based on the target query statement, a query result is retrieved in the database. Through the whole process design of term accurate matching, example guided screening, connection view simplification and SQL generation optimization, efficient and accurate conversion from natural language to executable query statement is realized.

[0031] In some embodiments, the constructing a knowledge base of a database comprises:

[0032] Indexing the schema information of the database to obtain metadata information, and generating a keyword dictionary containing table mapping, column mapping and value mapping through a large language model based on the metadata information;

[0033] Obtaining real data samples and randomly selecting tables and columns from the database, generating a database definition language based on the selected tables and columns, generating natural language questions and query statements corresponding to the natural language questions using the large language model based on the database definition language and the real data samples, and labeling the natural language questions and the query statements corresponding to the natural language questions as an example pair. Each natural language question and each natural language question corresponding query statement is labeled to obtain a dynamic example library.

[0034] In the present embodiment, the real data sample represents real data obtained in an actual scenario. Through an automated process, a large number of high-quality example pairs are repeatedly generated by calling an LLM to synthesize a dynamic example library. Tables and columns are randomly selected, a simplified DDL is generated, and the LLM is prompted to generate natural language questions based on the DDL and real data samples, and then corresponding SQL queries are generated. Finally, the questions are rewritten from database terminology to a language more in line with user habits, and high-quality example pairs can be additionally labeled manually. All generated question-SQL pairs are stored in a dynamic example library, and are vectorized using an embedded model, so that subsequent quick retrieval can be performed through semantic similarity.

[0035] In the above embodiments, the knowledge base includes a keyword dictionary and a dynamic example library, the keyword dictionary can provide a mapping correspondence established between natural language and metadata information identified by the database, and the dynamic example library provides specific problem-query statement reference examples, avoiding LLM from starting reasoning from zero, thereby facilitating efficient and accurate natural language to executable query statement conversion.

[0036] In some embodiments, the generating, based on the knowledge base, of the target pseudo schema corresponding to the target language information comprises:

[0037] receiving the target language information through the large language model, and extracting keywords in the target language information;

[0038] matching the keywords with a keyword dictionary of the database to generate a matching result;

[0039] receiving the target language information and the matching result through the large language model, and generating an initial query statement;

[0040] parsing the initial query statement into an abstract syntax tree, extracting inter-table relationships, column meanings, and filtering conditions, and generating the target pseudo schema based on the inter-table relationships, column meanings, and filtering conditions.

[0041] In the present embodiment, the user inputs target natural language, which includes user question Q_N, which is received and processed by LLM, and the core information in the user question is extracted as keywords (K) by using keyword extraction technology. For example, the question "query BUCatalina department has published maintenance recommendations" extracts the keywords: K = {"BU Catalina", "maintenance recommendations", "has published"}. The keyword set K (including entity, attribute, state, and other information) is obtained. LLM matches the keywords K with the tables, columns, and specific values of the database to generate a matching result (K_M). The dictionary includes three types of mappings: table mapping (such as "maintenance recommendations"→Recommendation table), column mapping (such as "has published"→Recommendation.situation column), and value mapping (such as "BU Catalina"→Installation.business_unit = "CATALINA"). Finally, the matching result K_M (format: {keyword: (table name, column name, corresponding value)}) is obtained.

[0042] LLM receives the user question and the matching result, for example, prompts the user to explicitly "construct SQL structure based on real database elements, do not allow to fabricate tables / columns", and generates an initial query statement, for example:

[0043] SELECT r.id

[0044] FROM Recommendation r

[0045] JOIN Installation p ON r.installation_name = p.name

[0046] WHERE p.business_unit = "CATALINA"

[0047] AND r.situation = "Released"

[0048] AND r.creation_date>= '2023-01-01';

[0049] The initial statement is parsed into an Abstract Syntax Tree (AST), and the inter-table relationships, column meanings, and filtering conditions are extracted to generate a natural language and realistic matching target pseudo-schema S_grounded.

[0050] For example:

[0051] S_grounded = {

[0052] Table Set: {

[0053] "Recommendation Table": (Real Table Name: Recommendation, Core Columns: id(ID), situation(Publishing Status), creation_date(Creation Time), installation_name(Associated Facility Name)),

[0054] "Installation Table": (Real Table Name: Installation, Core Columns: name(Facility Name), business_unit(Owner Department))

[0055] },

[0056] Inter-table Relationship: "Recommendation Table is associated with Installation Table through the 'installation_name' column of the Recommendation Table and the 'name' column of the Installation Table",

[0057] Filtering Conditions: "Installation Table.business_unit='CATALINA', Recommendation Table.situation='Released', Recommendation Table.creation_date>=2023-01-01"

[0058] } to obtain the target pseudo-schema S_grounded.

[0059] In the embodiment, the inter-table relationship refers to a logical connection between different database tables through an associated field, and corresponds to the core logic of the JOIN clause in the initial query statement. It is necessary to specify which two tables are associated through which field. For example, JOIN Installation p ON r.installation_name = p.name.

[0060] The column meaning refers to the correspondence between the columns of each table in the target pseudo schema and the natural language semantics thereof. It is necessary to specify the business meaning represented by a column in a table, and to solve the difference between the column name of the database and the natural language cognition of the user.

[0061] The filtering condition refers to a logical condition for limiting the range of query results in the target pseudo schema, and corresponds to the entire filtering logic of the WHERE clause in the initial query statement. It is necessary to convert the field-operator-value combination in SQL into a natural language description to ensure that the logic is clear, the condition is complete, and there is no syntax ambiguity. For example, WHERE p.business_unit = "CATALINA"→“Installation table. Affiliated department = 'CATALINA'”.

[0062] In the above embodiment, the semantic keywords are extracted, the deep language understanding capability of the LLM is used to identify the core business concept and operation intention in the user question, rather than simple string matching; through technical term mapping, the extracted business keywords are accurately matched with the pre-defined keyword dictionary to establish a bridge from business language to technical implementation, effectively solving the ambiguity problem of synonyms, polysemous words and business terms, ensuring that the concept expressed by each user can be accurately mapped to a specific entity in the database. Before generating a complete SQL, the correctness of the keyword mapping is verified, an initial SQL is generated as an inspectable intermediate result, which is convenient for problem positioning and debugging, and through AST analysis, it is ensured that the generated SQL is reasonable in structure, which is convenient for efficiently and accurately converting the fuzzy natural language intention into clear data operation logic.

[0063] In some embodiments, the filtering, based on the target pseudo schema, of a minimum table set associated with answering the user question from the knowledge base comprises:

[0064] After splicing the user question and the target pseudo schema, the spliced result is taken as a retrieval input to obtain a preliminary candidate table set;

[0065] An external key relationship diagram of the database is obtained;

[0066] Based on the foreign key relationship graph, connectivity of tables in the preliminary candidate table set is confirmed, and redundant tables are removed based on a screening condition to obtain a minimum table set, wherein the screening condition comprises at least one of the following: semantic similarity between a keyword indicated by the target pseudo pattern and a table or column in the preliminary candidate table set, and user historical query preference.

[0067] In the embodiment, the user question and the target pseudo pattern are spliced as retrieval input, and an embedding model is input to retrieve a preliminary candidate table set S candidate. Based on a foreign key relationship graph of a database, connectivity of tables in the preliminary candidate table set is verified, and redundant tables are removed based on semantic similarity between a keyword and a table / column and user historical query preference to obtain a minimum table set S.

[0068] Optionally, the foreign key relationship graph represents an association relationship between each table in the database and a table through an external key, the foreign key relationship graph comprises nodes and edges, wherein one of the nodes represents a table in the database, two ends of the edge are connected to a master table and a slave table, and an attribute of the edge represents an associated field pair between the master table and the slave table.

[0069] In the embodiment, the foreign key relationship graph is a structured graph data model for intuitively presenting an association relationship between tables in a target database through a foreign key. The core components include: nodes (Node): corresponding to each table in the database; edges (Edge): corresponding to the foreign key association between tables, two ends of the edge are connected to a master table (containing a primary key table) and a slave table (containing a foreign key table), and the attribute of the edge will mark the associated field pair (i.e. the foreign key field of the slave table and the primary key / unique key field of the master table). The association rule in the logic of the edge is implicitly in the logic of the edge, that is, the value of the foreign key field must match the existing value of the corresponding field of the master table to ensure the consistency of the data between the tables. The foreign key relationship graph can quickly determine whether there is a direct / indirect association path between any two tables, which provides a basis for subsequent verification of table connectivity.

[0070] Optionally, the obtaining of the foreign key relationship graph of the database comprises:

[0071] Extracting metadata information of the database, wherein the metadata information comprises at least one of the following: table structure information, foreign key constraint information, and key attributes of foreign key records.

[0072] Based on the extracted metadata information, each node and each edge are generated, and indirect association relationships between the nodes are processed to obtain the foreign key relationship graph.

[0073] In this embodiment, in the construction manner of the foreign key relationship diagram, the first step is to extract database metadata. The key information related to the foreign key in the target database is extracted through the system query interface or metadata information table provided by the database. The core extraction contents include:

[0074] Table structure information: traverse all tables in the database to obtain the table name, primary key field (Primary Key), and unique key field (Unique Key) of each table.

[0075] Foreign key constraint information: query the foreign key constraint table of the database (such as INFORMATION_SCHEMA.KEY_COLUMN_USAGE of MySQL and pg_constraint of PostgreSQL).

[0076] Extract the key attributes of each foreign key record: table name (table where the foreign key is located); foreign key field (foreign key column used for association); primary table name (target table associated with the foreign key); primary table association field (primary key / unique key column matched by the foreign key); constraint name (optional, used to identify the uniqueness of the foreign key constraint).

[0077] For example, for the association between the “Recommendation table” and the “Installation table” in the document, the metadata extraction can obtain: from table name: Recommendation; foreign key field: installation_name; primary table name: Installation; primary table association field: name.

[0078] The second step is to construct an initial foreign key relationship diagram based on the extracted metadata information (graph structure generation). Based on the extracted metadata, an initial graph structure is constructed according to the node-edge logic. The specific operations include:

[0079] Create nodes: store all table names extracted as independent nodes in the graph structure (if a table has no foreign key association, it still needs to be kept as an independent node to avoid missing potential associated tables).

[0080] Create edges and association attributes: for each foreign key constraint record, establish an edge between the slave table node and the primary table node, and store the slave table foreign key field-primary table association field as the edge attribute (such as edge attribute: (Recommendation.installation_name, Installation.name));

[0081] Indirect association between tables: if there is a chain of foreign key association between more than two tables, then a connection path is established between each pair of tables in the chain in turn, forming an indirect association path. For example, if there is a chain of foreign key association A→B→C (table A is associated with table B by a foreign key, and table B is associated with table C by a foreign key), then edges are established between tables A and B, and between tables B and C, forming an indirect association path, which ensures that the connectivity between the tables can be determined by path traversal.

[0082] In the above embodiments, the foreign key relationship graph clearly shows the association between tables, including master and slave tables and associated fields, providing a basis for generating correct JOIN conditions. Based on the connectivity check of the graph, it can be ensured that the tables selected from the preliminary candidate table set are associated with each other, avoiding the situation of Cartesian product or lack of connection conditions. For some tables in the preliminary candidate table set that are not directly related, these tables can be removed through connectivity check and filtering conditions, reducing the error rate. The use of the foreign key relationship graph makes the table connection relationship clear, reducing the possibility of generating incorrect SQL. This method selects the smallest table set related to the query intent and associated with each other from the database by combining the user question, the target pseudo schema, the foreign key relationship graph, and the filtering conditions. The advantages of this method are to improve the accuracy and efficiency of SQL generation, optimize the query structure by using domain knowledge and historical information, and enhance the overall performance of the system.

[0083] In some embodiments, the encapsulation of the multi-table connection logic in the smallest table set into a query view includes:

[0084] Based on the smallest table set and the foreign key relationship graph, an optimal connection path for connecting all tables in the smallest table set is calculated;

[0085] Based on the optimal connection path, an initial query view containing all connection logic in the optimal connection path is generated;

[0086] Filtering core columns and redundant columns in the smallest table set, retaining the core columns and deleting the redundant columns to obtain a processed smallest table set. Based on the processed smallest table set, natural language annotations are added to the initial query view to obtain the query view. The core columns include at least one of the following: columns belonging to the associated fields of the inter-table relationship, columns belonging to the limited fields corresponding to the filtering conditions, and columns corresponding to the result output fields of the user question. The redundant columns include at least one of the following: columns not involved in the target pseudo schema, and columns involved in the target pseudo schema but without query logic support.

[0087] In this embodiment, the complex multi-table join logic is pre-processed and encapsulated into a single, clear query view, such as a SQL view, to simplify the difficulty of subsequent LLM in generating the final query statement. First, based on the minimum table set S and the foreign key relationship graph, the shortest and optimal path for joining all tables in the minimum table set is calculated using graph algorithms (such as Steiner Tree). The optimal connection path represents the shortest path for joining all tables in the minimum table set. According to the calculated optimal connection path, the large model LLM generates an initial query view V_initial containing all necessary JOIN operations, for example:

[0088] CREATE VIEW V_Initial_Reco_Install AS

[0089] SELECT

[0090] r.id AS Recommendation_id,

[0091] r.situation AS Recommendation_situation,

[0092] r.creation_date AS Recommendation_creation_date,

[0093] r.installation_name AS Recommendation_installation_name,

[0094] p.business_unit AS Installation_business_unit,

[0095] p.name AS Installation_name

[0096] FROM Recommendation r

[0097] JOIN Installation p ON r.installation_name = p.name;

[0098] Then, retain the core columns involved in the target pseudo-schema S_grounded (such as "Recommendation ID" corresponding to Recommendation_id, and "Department" corresponding to Installation_business_unit), and delete redundant columns (such as Recommendation_installation_name). Add natural language annotations (from the pseudo-schema description) to the view columns to aid LLM understanding, resulting in the optimized view V_grounded. For example:

[0099] CREATE VIEW V_Grounded_Reco_Install AS

[0100] SELECT

[0101] r.id AS suggestionID, -- corresponds to the pseudo-schema "maintain suggestion table.suggestionID"

[0102] r.situation AS Release Status, -- corresponds to the pseudo-pattern "Maintenance Suggestion Table.Release Status"

[0103] `r.creation_date AS creation_time`, -- corresponds to the pseudo-schema "maintenance suggestion table.creation_time".

[0104] p.business_unit AS Department -- Corresponds to the pseudo-schema "Facilities.Department"

[0105] FROM Recommendation r

[0106] JOIN Installation p ON r.installation_name = p.name.

[0107] In this embodiment, core columns refer to those columns essential for answering user queries and explicitly mentioned in the target pseudo-schema S_grounded (including table, column semantics, and relational logic). The table set module of the target pseudo-schema S_grounded clearly marks the actual table name and corresponding core column semantics of each table. All columns appearing in this module possess the basic qualifications of core columns. The table relationship and filtering condition module of the target pseudo-schema further clarifies which columns are key supports for the query logic. Columns that satisfy any of the following sub-conditions are the final core columns.

[0108] Sub-condition 1: The column is the associated field of the inter-table relationship (ensuring the multi-table can be connected normally). For example, in S_grounded, "installation_name" in the "maintenance suggestion table" and "name" in the "installation table" are the only fields of the inter-table relationship, which need to be retained to support the JOIN logic.

[0109] Sub-condition 2: The column is the limited field of the filtering condition (ensuring the target result can be filtered out). For example, in S_grounded, the filtering conditions mentioned "business_unit" in the "installation table", "situation" in the "maintenance suggestion table", and "creation_date" in the "maintenance suggestion table" need to be retained to realize the condition filtering.

[0110] Sub-condition 3: The column is the result output field implied by the user query (although it does not appear in the filtering / association, it is the core information that the user needs to obtain). For example, in the document, the user query "query the maintenance suggestions published by the BU Catalina department" implies that the "id" of the "maintenance suggestion" needs to be obtained, which corresponds to "id" in the "maintenance suggestion table" in S_grounded, which needs to be retained as the result output.

[0111] Redundant columns refer to columns that exist in the initial query view V_Initial but are not mentioned in the target pseudo schema S_grounded or are mentioned but have no actual query logic support. The judgment needs to follow the reverse exclusion principle, which is divided into two categories:

[0112] First category of redundant columns: columns that are not mentioned at all in the target pseudo schema S_grounded.

[0113] If the initial view V_Initial contains columns that do not appear in the pseudo schema table set, inter-table relationship, or filtering condition, it is directly determined as a redundant column.

[0114] Second category of redundant columns: columns involved in the target pseudo schema but without query logic support.

[0115] Some columns are mentioned in the pseudo schema (such as existing in the table set), but the subsequent inter-table relationship, filtering condition, and result output do not use the column, i.e., the column has no actual effect on completing the user query, which is determined as a redundant column.

[0116] In the above embodiments, by calculating the optimal connection path, it is ensured that the generated view has the highest efficiency when connecting the table (such as using the shortest path or the least number of connections), avoiding unnecessary connection operations and improving query performance; at the same time, the optimal connection path also means following the foreign key relationship in database design, ensuring the correctness and consistency of the data. Generating an initial query view (including all connection logic) encapsulates complex multi-table connection logic in a view, simplifying subsequent query operations. Users or LLMs only need to focus on the columns in the view, without needing to understand the underlying table connection relationship. Filtering core columns and deleting redundant columns reduces the complexity of the view and avoids exposing unnecessary columns, making the view clearer. This also helps to improve query performance, as it reduces the amount of data that needs to be processed. Adding natural language annotations gives the columns of the view business meaning, making it easier for non-technical users to understand. For LLMs, natural language annotations provide semantic information, which helps the LLM better understand the meaning of each column, allowing it to generate queries more accurately.

[0117] In some embodiments, retrieving, based on the query view and the target language information, a list of reference example pairs most similar to the user question from the knowledge base includes:

[0118] Based on the target pseudo-pattern, the user question is decomposed into a list of sub-questions, obtaining a list of sub-questions;

[0119] The query view and the list of sub-questions are used as query conditions to query the knowledge base for a list of reference example pairs most similar to the user question.

[0120] In this embodiment, for complex questions, retrieve the question-query statement pair most similar to the current question from the pre-built example library, provide high-quality reference examples for LLM, and guide it to generate more accurate SQL logic. Call LLM to analyze the user question, and based on the target pseudo-pattern, decompose the complex question into a list of sub-questions. From the pre-built dynamic example library, retrieve examples similar in semantics to each sub-question to obtain a list of reference example pairs L.

[0121] In some embodiments, generating the target query statement corresponding to the target language information based on the user question, the target pseudo-pattern, the query view, and the list of reference example pairs includes:

[0122] Based on the user question, the target pseudo-pattern, the query view, and the list of reference example pairs, form context information, and based on the context information, use a large language model to generate an initial executable statement corresponding to the target language information;

[0123] Check the error information in the initial executable statement, correct the error information using an iterative correction method, and obtain a target query statement.

[0124] In this embodiment, all information in the pre-sequence stage is integrated to generate a final executable target query statement, and through a multi-layer verification and correction cycle, the grammatical correctness and logical integrity of the final executable target query statement are ensured.

[0125] Optionally, the checking the error information in the initial executable statement and the correcting the error information using the iterative correction method to obtain the target query statement include:

[0126] The SELECT clause in the initial executable statement is parsed, and full-quantity matching is performed between the column name in the query view and the column name to obtain a verified initial executable statement and a column name verification result.

[0127] The database is connected, and the verified initial executable statement is executed to obtain an execution result.

[0128] Based on the column name verification result and the execution result, various error types are obtained, and the error types include at least one of the following: column name existence error, execution error, and empty result.

[0129] The large language model is called to iteratively correct the error types in the initial executable statement until an iterative correction condition is met, and the target query statement is output.

[0130] In this embodiment, the LLM generates an initial executable statement, for example, an initial executable SQL statement. The LLM obtains user questions, target pseudo patterns, query views, and reference example lists, forms context information based on the information, and generates an initial executable statement. After receiving a prompt and integrated information, the LLM outputs an initial executable statement in combination with its semantic understanding and SQL generation capability.

[0131] The SELECT clause in the initial executable statement can be automatically parsed, and full-quantity matching is performed between the column name in the query view V_grounded to determine whether there is an error that the column name does not exist in V_grounded.

[0132] The target database can be connected, the initial executable statement verified by the column name is executed, and the error types are obtained according to the execution results. The error types include: execution error scenario, empty result scenario, and valid result scenario. The execution error scenario includes: if the database returns a syntax error (such as missing parentheses, field name spelling error), a permission error (not in the processing category of the present scheme, the user needs to be prompted to check the permission), the error type and the error log returned by the database are recorded. The empty result scenario includes: if the initial executable statement is executed without syntax error, but the number of returned result rows is 0, the empty result information (such as SQL execution is successful, but 0 result is returned, there may be missing filtering conditions) is recorded. The valid result scenario includes: if the initial executable statement and the returned non-empty result, the initial executable statement is preliminarily determined to be valid, and the final confirmation link is entered.

[0133] For the three scenarios of column name existence error, execution error and empty result, the program automatically constructs a prompt sentence containing error information, prequel information and correction requirements, and calls LLM again for SQL correction. The maximum number of iterations (such as 3 times) of iterative correction is set, and the iteration number is recorded after each correction and verification cycle is completed: if the corrected executable statement passes the column name verification and the execution result verification (non-empty and no error), the iteration is terminated, and the corrected executable statement is taken as the final target query statement; if the corrected executable statement still fails to pass the verification, and the iteration number has not reached the upper limit: repeat the above steps and continue to correct; if the iteration number reaches the upper limit and still does not generate an effective query statement SQL, terminate the process and output a prompt information (such as after 3 iterations, still no effective SQL is generated, it is suggested to check the filtering conditions of the pseudo-mode S_grounded or the relevance of the dynamic example L).

[0134] In the above embodiments, by verifying the column name in full, it is ensured that each column in the SELECT clause exists in the query view, avoiding execution failure due to column name errors (such as spelling errors, non-existent columns). The column name verification result can explicitly indicate the problematic column name, providing specific guidance for subsequent correction. By verifying the column name in advance, unnecessary database execution can be reduced, improving efficiency. By executing the verified statement and obtaining the execution result, in the actual execution process, SQL with correct syntax but semantic errors can be found, such as table join errors, condition errors, etc. The execution result can reflect the actual situation of the query, such as whether to return an empty result (possibly because the condition is too strict) or execution error (such as type mismatch, function error, etc.). Dividing errors into column name existence errors, execution errors, and empty results helps to take different correction strategies for different types of errors. The explicit error type can more accurately guide the large language model to correct, improving the efficiency and accuracy of correction. Through iterative correction, the natural language understanding and generation capabilities of the large language model are utilized to gradually correct the initial executable statement according to the error type and specific error information. This self-correction capability reduces the dependence on human intervention, improving the automation and intelligence level of the system.

[0135] In another aspect of the present application, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the knowledge base and large model-based query method according to any of the embodiments of the present application.

[0136] In the computer program product, the optional implementation form of the program module architecture of the computer program implementing each step of the knowledge base and large model-based query method can be a knowledge base and large model-based query device.

[0137] Please refer to Figure 3An embodiment of the present application provides a query device based on a knowledge base and a large model, comprising: a construction module 31 configured to construct a knowledge base of a database; an acquisition module 32 configured to acquire target language information containing a user question input by a user; a generation module 33 configured to generate a target pseudo pattern corresponding to the target language information based on the knowledge base; a screening module 34 configured to screen out a minimum table set associated with an answer to the user question from the knowledge base based on the target pseudo pattern; the generation module 33 is further configured to encapsulate multi-table connection logic in the minimum table set into a query view; the screening module 34 is further configured to retrieve, from the knowledge base, a reference example pair list of an indication question and a query sentence mapping relationship most similar to the user question based on the query view and the target language information, wherein each example pair in the reference example pair list represents a mapping relationship between a question and a query sentence; the generation module 33 is further configured to generate a target query sentence corresponding to the target language information based on the user question, the target pseudo pattern, the query view and the reference example pair list, and retrieve, based on the target query sentence, a query result from the database.

[0138] Optionally, the construction module 31 is further configured to:

[0139] indexing the schema information of the database to obtain metadata information, and generating a keyword dictionary containing table mapping, column mapping and value mapping based on the metadata information by using a large language model;

[0140] acquiring real data samples and randomly selecting tables and columns from the database, generating a database definition language based on the selected tables and columns, generating a natural language question and a query sentence corresponding to the natural language question based on the database definition language and the real data samples by using the large language model, and labeling the natural language question and the query sentence corresponding to the natural language question as an example pair, and labeling each natural language question and each query sentence corresponding to the natural language question.

[0141] Optionally, the generation module 33 is further configured to:

[0142] receiving the target language information by using the large language model, and extracting keywords in the target language information;

[0143] matching the keywords with the keyword dictionary of the database to generate a matching result;

[0144] receiving the target language information and the matching result by using the large language model, and generating an initial query sentence;

[0145] The initial query statement is parsed into an abstract syntax tree, inter-table relations, column meanings and filtering conditions are extracted, and the target pseudo schema is generated based on the inter-table relations, column meanings and filtering conditions.

[0146] Optionally, the filtering module 34 is further configured to:

[0147] After splicing the user question and the target pseudo schema, the spliced result is taken as a retrieval input to obtain a preliminary candidate table set.

[0148] An external key relation graph of the database is obtained.

[0149] Based on the external key relation graph, the connectivity of the tables in the preliminary candidate table set is confirmed, and redundant tables are removed based on filtering conditions to obtain a minimum table set, wherein the filtering conditions include at least one of the following: a semantic similarity between a keyword indicated by the target pseudo schema and a table or column in the preliminary candidate table set, and a user historical query preference.

[0150] Optionally, the external key relation graph represents an association relation between each table in the database and a table through an external key, and includes nodes and edges, wherein one node represents a table in the database, two ends of the edge are connected to a master table and a slave table, and an attribute of the edge represents an associated field pair between the master table and the slave table.

[0151] Optionally, the filtering module 34 is further configured to:

[0152] Metadata information of the database is extracted, wherein the metadata information includes at least one of the following: table structure information, external key constraint information, and key attributes of external key records.

[0153] Based on the extracted metadata information, each node and each edge are generated, and an indirect association relation between each node is processed to obtain the external key relation graph.

[0154] Optionally, the generating module 33 is further configured to:

[0155] Based on the minimum table set and the external key relation graph, an optimal connection path connecting all the tables in the minimum table set is calculated.

[0156] Based on the optimal connection path, an initial query view including all connection logics in the optimal connection path is generated.

[0157] screening the core columns and the redundant columns in the minimum table set, retaining the core columns and deleting the redundant columns, to obtain a processed minimum table set, and based on the processed minimum table set, adding natural language annotations to the initial query view to obtain the query view, wherein the core columns include at least one of the following: a column belonging to an associated field of the inter-table relationship, a column corresponding to a limited field of the screening condition, and a column corresponding to a result output field of the user question; and the redundant columns include at least one of the following: a column not involved in the target pseudo schema, and a column involved in the target pseudo schema but without query logic support.

[0158] Optionally, the screening module 34 is further configured to:

[0159] based on the target pseudo schema, decompose the user question into a plurality of sub-questions to obtain a sub-question list;

[0160] query, as query conditions, the query view and the sub-question list in the knowledge base to obtain a list of reference example pairs most similar to the user question.

[0161] Optionally, the generating module 33 is further configured to:

[0162] based on the user question, the target pseudo schema, the query view, and the list of reference example pairs, form context information, and based on the context information, generate an initial executable statement corresponding to the target language information by using a large language model;

[0163] check error information in the initial executable statement, and correct the error information by using an iterative correction method to obtain a target query statement.

[0164] Optionally, the generating module 33 is further configured to:

[0165] analyze a SELECT clause in the initial executable statement, and perform full-quantity matching with column names in the query view to obtain a verified initial executable statement and a column name verification result;

[0166] connect the database, and execute the verified initial executable statement to obtain an execution result;

[0167] based on the column name verification result and the execution result, obtain various error types, wherein the error types include at least one of the following: a column name existence error, an execution error, and an empty result;

[0168] call a large language model to iteratively correct the error types in the initial executable statement until an iterative correction condition is met, and output the target query statement.

[0169] Those skilled in the art can understand that,Figure 3 The structure of the knowledge base and large model based query device does not constitute a limitation of the knowledge base and large model based query device, and each module can be implemented by software, hardware and a combination thereof. Each module can be embedded in or independent of the controller in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so that the controller invokes the execution of the corresponding operation of each module. In other embodiments, the knowledge base and large model based query device can include more or fewer modules than illustrated.

[0170] Please refer to Figure 4 In another aspect of the embodiments of the present application, a computer device 200 is provided, which includes a memory 3011 and a processor 3012. The memory 3011 stores a computer program, and the computer program is executed by the processor to make the processor 3012 perform the steps of the knowledge base and large model based query method provided by any of the embodiments of the present application. The terminal device 100 can include a computer device (for example, a desktop computer, a laptop computer, a tablet computer, a handheld computer, a smart speaker, a server, etc.), a mobile phone (for example, a smart phone, a wireless phone, etc.), a wearable device (for example, a pair of smart glasses or a smart watch), or a similar device, a robot device.

[0171] The knowledge base and large model based query device includes but is not limited to an embedded device and a terminal device.

[0172] The processor 3012 is a control center, which connects various data of the entire computer device by various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and / or modules stored in the memory 3011 and calling data stored in the memory 3011. Optionally, the processor 3012 can include one or more processing cores; preferably, the processor 3012 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user pages and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 3012.

[0173] The memory 3011 can be used to store software programs and modules, and the processor 3012 executes various function applications and data processing by running the software programs and modules stored in the memory 3011. The memory 3011 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 3011 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 3011 can also include a memory controller to provide access for the processor 3012 to the memory 3011.

[0174] In another aspect, the embodiments of the present application also provide a storage medium storing a computer program, and the computer program is executed by a processor to make the processor execute the steps of the query method based on a knowledge base and a large model provided by any of the above-mentioned embodiments of the present application.

[0175] Those skilled in the art can understand that all or data flows in the method provided by the above-mentioned embodiments can be completed by instructing related hardware through a computer program, and the program can be stored in a non-volatile computer readable storage medium, and when the program is executed, it can include the flow of each method embodiment as described above. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0176] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. The protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A knowledge base and large model-based query method, characterized by, The method comprises the following steps: constructing a knowledge base of a database; obtaining user input target language information containing a user question; generating a target pseudo schema corresponding to the target language information based on the knowledge base, which comprises receiving the target language information through a large language model, extracting keywords in the target language information; matching the keywords with a keyword dictionary of the database to generate a matching result; receiving the target language information and the matching result through the large language model, and generating an initial query statement; parsing the initial query statement into an abstract syntax tree, extracting inter-table relationships, column meanings and filtering conditions, and generating the target pseudo schema based on the inter-table relationships, column meanings and filtering conditions; based on the target pseudo schema, screening out a minimum table set associated with answering the user question in the knowledge base; packaging multi-table connection logic in the minimum table set into a query view; based on the query view and the target language information, retrieving a reference example pair list of the most similar indicative problem and query statement mapping relationship from the knowledge base, wherein each example pair in the reference example pair list represents the mapping relationship between a problem and a query statement; based on the user question, the target pseudo schema, the query view and the reference example pair list, generating a target query statement corresponding to the target language information, and retrieving in the database based on the target query statement to obtain a query result. 2.The knowledge base and large model based query method of claim 1, wherein, The method of constructing a knowledge base of a database comprises: indexing schema information of the database to obtain metadata information, and generating a keyword dictionary containing table mapping, column mapping and value mapping through a large language model based on the metadata information; obtaining real data samples and randomly selecting tables and columns from the database, generating a database definition language based on the selected tables and columns, generating natural language questions and query statements corresponding to the natural language questions using the large language model based on the database definition language and the real data samples, and labeling the natural language questions and the query statements corresponding to the natural language questions as an example pair. Each natural language question and each query statement corresponding to the natural language question is labeled to obtain a dynamic example library. 3.The knowledge base and large model based query method of claim 1, wherein, The method of screening out a minimum table set associated with answering a user question in the knowledge base based on the target pseudo schema comprises: After splicing the user question and the target pseudo schema, the spliced result is taken as a retrieval input to obtain a preliminary candidate table set; obtaining an external key relationship graph of the database; based on the external key relationship graph, confirming the connectivity of the tables in the preliminary candidate table set, and based on a filtering condition, eliminating redundant tables to obtain a minimum table set, wherein the filtering condition comprises at least one of the following: semantic similarity between keywords indicated by the target pseudo schema and tables or columns in the preliminary candidate table set, user historical query preferences.

4. The knowledge base and large model based query method of claim 3, wherein, The foreign key relationship graph represents the association relationship between tables in the database through foreign keys, and includes nodes and edges, wherein one of the nodes represents a table in the database, two ends of the edge are connected to a master table and a slave table, and the attribute of the edge represents the associated field pair between the master table and the slave table.

5. The knowledge base and large model based query method of claim 4, wherein, The foreign key relationship graph of the database is obtained by: Extracting metadata information of the database, wherein the metadata information includes at least one of the following: table structure information, foreign key constraint information, and key attribute of foreign key record; Based on the extracted metadata information, generate each node and each edge, and process the indirect association relationship between each node to obtain the foreign key relationship graph.

6. The knowledge base and large model based query method of claim 3, wherein, The multi-table connection logic in the minimum table set is encapsulated into a query view, including: Based on the minimum table set and the foreign key relationship graph, calculate the optimal connection path connecting all tables in the minimum table set; Based on the optimal connection path, generate an initial query view including all connection logics in the optimal connection path; Filter the core columns and redundant columns in the minimum table set, retain the core columns and delete the redundant columns to obtain a processed minimum table set, and based on the processed minimum table set, add natural language annotations to the initial query view to obtain the query view, wherein the core columns include at least one of the following: columns belonging to the associated fields of the inter-table relationship, columns corresponding to the limited field pairs of the filtering conditions, and columns corresponding to the result output fields of the user questions, and the redundant columns include at least one of the following: columns not involved in the target pseudo schema, and columns involved in the target pseudo schema but without query logic support.

7. The knowledge base and large model based query method of claim 1, wherein, Based on the query view and the target language information, retrieve a list of reference example pairs most similar to the user question from the knowledge base, including: Based on the target pseudo schema, decompose the user question into a list of sub-questions; Use the query view and the list of sub-questions as query conditions to query the list of reference example pairs most similar to the user question from the knowledge base.

8. The knowledge base and large model based query method of claim 1, wherein, Based on the user question, the target pseudo schema, the query view, and the list of reference example pairs, generate a target query statement corresponding to the target language information, including: Based on the user question, the target pseudo schema, the query view, and the list of reference example pairs, form context information, and based on the context information, use a large language model to generate an initial executable statement corresponding to the target language information; Check the error information in the initial executable statement, and use an iterative correction method to correct the error information to obtain a target query statement. 9.The knowledge base and large model based query method of claim 8, wherein, The checking of the error information in the initial executable statement and the correction of the error information to obtain a target query statement by using an iterative correction method, including: Parse the SELECT clause in the initial executable statement, and perform full matching with the column names in the query view to obtain a verified initial executable statement and a column name verification result; Connect the database, execute the verified initial executable statement, and obtain an execution result; Based on the column name verification result and the execution result, obtain various error types, wherein the error types include at least one of the following: column name existence error, execution error, and empty result; Call a large language model, and iteratively correct the error types in the initial executable statement until an iterative correction condition is met, and output the target query statement.

Citation Information

Patent Citations

  • Method and system for data query

    CN104216894A

  • Knowledge base question and answer method and system under full-process large language model small sample learning

    CN118520086A