Database query method and apparatus, electronic device, and non-volatile storage medium

By constructing a knowledge graph in database queries and combining it with a large language model, the problem of poor SQL statement accuracy caused by numerous database field information and complex relationships is solved, achieving more efficient and accurate SQL generation.

WO2026056792A1PCT designated stage Publication Date: 2026-03-19CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2026-03-19

AI Technical Summary

Technical Problem

In existing technologies, due to the large number of database fields and their complex relationships, the accuracy of SQL statements generated using large language models is poor, making it difficult to effectively understand the user's query intent and generate accurate structured query language statements.

Method used

By constructing a knowledge graph to represent the logical structure and relationships of the database, and combining it with a large language model, the knowledge graph provides rich contextual information and relationships to generate SQL statements.

Benefits of technology

It improves the accuracy and reliability of SQL statements generated by large language models, enhances the efficiency and accuracy of database queries, and provides a better query experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025119588_19032026_PF_FP_ABST
    Figure CN2025119588_19032026_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a database query method and apparatus, an electronic device, and a non-volatile storage medium. The method comprises: determining a knowledge graph corresponding to a database to be queried, wherein the knowledge graph is used for representing a logical structure and an association relationship of data in said database; determining similarity scores between user question text and graph nodes in the knowledge graph, and determining a target node from among the graph nodes of the knowledge graph on the basis of the similarity scores, wherein the similarity scores are used for representing the degree of association between the graph nodes and the user question text; and on the basis of the target node, generating database schema information corresponding to said database, and using a large language model to generate, on the basis of the database schema information, a structured query language statement corresponding to the user question text.
Need to check novelty before this filing date? Find Prior Art

Description

Database query method and device, electronic equipment and nonvolatile storage medium

[0001] Related applications

[0002] The present application claims priority to the Chinese patent application No. 202411280879X, filed on September 12, 2024, and entitled "Database query method and device, electronic equipment and nonvolatile storage medium", the contents of which are hereby incorporated by reference in its entirety. TECHNICAL FIELD

[0003] The present application relates to the field of artificial intelligence, in particular to a database query method and device, electronic equipment and nonvolatile storage medium. BACKGROUND

[0004] Generative large language models are a powerful and popular technical means in the field of natural language processing today. Based on massive data, deep attention networks based on Transformer, and reinforcement learning based on human feedback, generative large language models can learn rich potential semantics, thereby understanding natural language and generating corresponding answers.

[0005] At present, large language models have been widely applied to the field of converting natural language text into database queries. In related technologies, the current mainstream technical method usually inputs the schema information (including table creation statements and primary and foreign keys) in the database as context information into the large model, establishes the association between the large model and the database knowledge, and then uses the small sample learning method to guide the large model to generate SQL (Structured Query Language) statements. However, since the field information in the database is usually quite numerous, and the relationship between fields and fields, as well as the relationship between fields and values is complex, there is a problem of poor accuracy of SQL statements generated by using the large language model.

[0006] In view of the above problems, no effective solution has been proposed so far. SUMMARY

[0007] According to an aspect of the embodiments of the present application, a database query method is provided, comprising: determining a knowledge graph corresponding to a to-be-queried database, wherein the knowledge graph is used to represent the logical structure and the association relationship of the data in the to-be-queried database; determining a similarity score between a user question text and each graph node in the knowledge graph, and determining a target node in each graph node in the knowledge graph according to the similarity score, wherein the similarity score is used to represent the degree of association between the graph node and the user question text; generating database schema information corresponding to the to-be-queried database according to the target node, and generating a structured query language statement corresponding to the user question text according to the database schema information by using a large language model, wherein the structured query language statement is used to query data in the to-be-queried database.

[0008] Optionally, the determining of the knowledge graph corresponding to the to-be-queried database comprises: generating the knowledge graph corresponding to the to-be-queried database by traversing the data tables in the to-be-queried database, wherein the knowledge graph is composed of a plurality of graph nodes and edges between the graph nodes, each graph node corresponds to an entity, and the entity includes a table entity and a column entity, the attributes of the table entity include a table name and a table description, the attributes of the column entity include a column name, a column description, a data type, an example value, and a value meaning, and each edge is used to represent the association relationship between the two graphs connected by the edge, and the association relationship includes a table relationship, a containing relationship between a table and a column, and a foreign key relationship.

[0009] Optionally, after the knowledge graph corresponding to the to-be-queried database is determined, the method further comprises: obtaining a sample data set corresponding to the to-be-queried database, wherein the sample data set includes a plurality of historical structured query language statements and natural language question texts corresponding to the historical structured query language statements; determining target binary tuples and target triplets according to the sample data set by using a large language model, wherein the target binary tuples are used to represent the corresponding relationship between a standard field in the historical structured query language statement and description information in the natural language question text, each standard field corresponds to a column entity, and the target triplets are used to represent the dependency relationship between two standard fields; and adding the information corresponding to the target binary tuples and the target triplets to the knowledge graph.

[0010] Optionally, the obtaining of the sample data set corresponding to the to-be-queried database comprises: obtaining a structured query language statement for data query in historical interaction data of the to-be-queried database to obtain a historical structured query language statement, wherein the data query includes a multi-table query; generating a natural language question text corresponding to the historical structured query language statement by using a large language model, and verifying and correcting the natural language question text generated by the large language model; and constructing a sample data set according to the historical structured query language statement and the corrected natural language question text.

[0011] Optionally, determining the target node from the knowledge graph according to the similarity score comprises: converting the user question text into a first vector representation and converting the graph node into a second vector representation by using a target model, wherein the second vector representation is determined by the attributes corresponding to the graph node, the target model is trained according to a plurality of training sample pairs, and the training sample pair is determined by a standard field extracted from a sample data set and a graph node corresponding to the standard field in the knowledge graph; determining the similarity score between the first vector representation and the second vector representation, and determining the graph node with a similarity score greater than a preset similarity threshold as the target node.

[0012] Optionally, the large language model is used to generate the structured query language statement corresponding to the user question text according to the database schema information, which comprises: reconstructing the database schema information corresponding to the to-be-queried database according to the structure information and the corresponding dependency relationship of the target node in the knowledge graph, wherein the database schema information is used to limit the range of the structured query language statement generation; using the large language model to determine the knowledge according to the reconstructed database schema information, the user question text, and the instruction information, wherein the knowledge is used to represent the association relationship between the user question text and the database schema information, and the instruction information is used to indicate the task to be completed by the large language model; using the large language model to generate the structured query language statement corresponding to the user question text according to the reconstructed database schema information, the knowledge, and the user question text.

[0013] Optionally, the method further comprises: determining a target historical user query text with a semantic similarity greater than a preset threshold between the user question text in the historical user query text of the to-be-queried database; obtaining the decoding process data of the structured query language statement corresponding to the target historical user query text; using the large language model to generate the structured query language statement corresponding to the user question text according to the reconstructed database schema information, the knowledge, the user question text, the target historical user query text, and the decoding process data.

[0014] According to another aspect of the embodiments of the present application, a database query device is also provided, comprising: a knowledge graph construction module configured to determine a knowledge graph corresponding to a database to be queried, wherein the knowledge graph is configured to represent a logical structure and a correlation of data in the database to be queried; a knowledge selection module configured to determine a similarity score between a user question text and each graph node in the knowledge graph, and determine a target node in each graph node in the knowledge graph according to the similarity score, wherein the similarity score is configured to represent a correlation degree between the graph node and the user question text; and a large model decision module configured to generate database schema information corresponding to the database to be queried according to the target node, and generate a structured query language statement corresponding to the user question text according to the database schema information by using a large language model, wherein the structured query language statement is configured to query data in the database to be queried.

[0015] According to still another aspect of the embodiments of the present application, an electronic device is also provided, comprising: a memory and a processor, wherein the processor is configured to run a program stored in the memory, and the program is configured to perform the database query method when running.

[0016] According to still another aspect of the embodiments of the present application, a non-volatile storage medium is also provided, comprising a stored computer program, wherein a device in which the non-volatile storage medium is located performs the database query method by running the computer program.

[0017] According to still another aspect of the embodiments of the present application, a computer program product is also provided, comprising a computer program, wherein the computer program is configured to perform the steps of the database query method when executed by a processor.

[0018] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings illustrated herein are used to provide further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their description serve to explain the present application. They do not limit the present application in any form. In the drawings:

[0020] FIG. 1 is a hardware structure block diagram of a computer terminal (or an electronic device) for implementing a database query method according to an embodiment of the present application;

[0021] FIG. 2 is a schematic diagram of a method flow of a database query according to an embodiment of the present application;

[0022] FIG. 3 is a schematic diagram of a method flow of a database query optimization based on an extensible knowledge graph enhancement according to an embodiment of the present application;

[0023] FIG. 4 is a schematic diagram of a knowledge graph construction process according to an embodiment of the present application;

[0024] FIG. 5 is a schematic diagram of a field retrieval model structure according to an embodiment of the present application;

[0025] FIG. 6 is a schematic diagram of a knowledge generation and large model decision execution process according to an embodiment of the present application;

[0026] FIG. 7 is a schematic diagram of a database query device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] In order to facilitate those skilled in the art to better understand the embodiments of the present application, some technical terms or nouns involved in the embodiments of the present application are explained as follows:

[0030] NLP (Natural Language Processing): is a subfield of artificial intelligence (AI) field, which is committed to enabling computers to understand, process and generate human language.

[0031] LLM(Large Language Model, Large Language Model): commonly known as large model, large language model, is an artificial intelligence model that aims to understand and generate human language. It is usually trained on a large amount of text data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, etc., containing billions of parameters.

[0032] Pipeline( Pipeline): a commonly used technical method for organizing multiple tasks in a certain order to form a processing flow. Each task receives input data in turn and generates output results, and then passes the output to the next task as its input.

[0033] Knowledge Graph( Knowledge Graph): a technical method in the field of artificial intelligence, used to represent the semantic network structure of the relationship between entities. It is a semantic chart containing a large number of entities (such as people, places, things, etc.) and their relationships. The goal of the knowledge graph is to capture and organize structured information about the world, so that computers can better understand language and reason. It is commonly used in natural language understanding, question answering systems, information retrieval and other applications, which can help computers better understand semantics and extract and organize knowledge from text.

[0034] TEXT-to-SQL( Natural Language Text to Structured Query Language): a technology in the field of natural language processing, used to convert natural language questions or instructions into structured query language (SQL). The goal of this technology is to enable computers to understand human natural language descriptions of database query requirements and convert them into SQL query statements that can be directly executed on the database. Usually, it needs to combine language models, syntax analysis, semantic parsing and knowledge of database schema. The application fields of TEXT-to-SQL technology include automatic question answering systems, intelligent improvement of database query interface and semantic search, etc.

[0035] Schema( Schema): in the field of databases, schema is a logical concept used to organize objects in a database. Objects in schema usually include tables, indexes, data types, sequences, stored procedures, primary keys and foreign keys, etc.

[0036] In related technologies, the current mainstream technical method usually inputs the schema information (including table creation statements and primary and foreign keys) in the database as context information into the large model, establishes the association between the large model and the database knowledge, and then uses small sample learning to guide the large model to generate SQL statements. However, because the field information in the database is usually quite extensive, and the relationship between fields and fields, as well as the relationship between fields and values is complex, there is a problem of poor accuracy of SQL statements generated by large language models.

[0037] To solve the above problems, the related solutions are provided in the embodiments of the present application. By constructing the knowledge graph of the database, the information such as tables, fields, primary and foreign key relationships in the database can be represented in the form of a graph, making these information more intuitive and easy to understand. The knowledge graph not only can show the relationship between fields, but also can capture the association between fields and specific values, thereby providing more rich and accurate context information for large models. In specific applications, the knowledge graph is combined with the large model. First, the database schema information is preprocessed through the knowledge graph to extract key structured information. Then, these information is provided as additional input to the large model to help it better understand the structure of the database and the relationship between fields. In the process of generating SQL, the large model can use the information in the knowledge graph for reasoning and verification, thereby improving the accuracy and reliability of the generated SQL.

[0038] In addition, the knowledge graph can also be used to enhance the learning process of the large model. By adding more semantic information and rules in the knowledge graph, the large model can be guided to better understand the intent of natural language queries and generate more user-demand SQL queries. This combination not only can improve the performance of the large model, but also can make it more efficient and accurate in handling complex database queries.

[0039] The knowledge graph can provide important assistance in the process of converting natural language text into database queries. By combining the knowledge graph with the large model, the combination of graph recall technology can effectively solve the problem of too many field information and complex relationships, improve the accuracy and reliability of SQL generation, and provide users with a better query experience. The scheme of the present application will be described in detail below.

[0040] According to the embodiments of the present application, a method for database query is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0041] The method embodiments provided by the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. FIG. 1 shows a hardware structure block diagram of a computer terminal (or an electronic device) for implementing a database query method. As shown in FIG. 1, the computer terminal 10 (or the electronic device) can include one or more processors 102 (the processor 102 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that the structure shown in FIG. 1 is only schematic, and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can include more or fewer components than those shown in FIG. 1, or have a different configuration from that shown in FIG. 1.

[0042] It should be noted that the one or more processors 102 and / or other data processing circuits described above can be referred to as "data processing circuits" herein. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any other combination. In addition, the data processing circuit can be a single independent processing module, or all or part of any one of the other elements combined into the computer terminal 10 (or the electronic device). As referred to in the embodiments of the present application, the data processing circuit serves as a processor control (for example, selection of a variable resistance terminal path connected to an interface).

[0043] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the database query method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above-mentioned database query method. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory such as one or more magnetic storage devices, flash memories or other non-volatile solid state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0044] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the computer terminal 10. In an example, the transmission device 106 includes a network interface controller (NIC) that can connect to other network devices through a base station to communicate with the Internet. In an example, the transmission device 106 can be a radio frequency (RF) module that is configured to communicate with the Internet wirelessly.

[0045] The display can be a liquid crystal display (LCD) that is touch screen, for example, which can enable a user to interact with a user interface of the computer terminal 10 (or electronic device).

[0046] In the above operating environment, the embodiment of the present application provides a database query method. FIG. 2 is a schematic diagram of a method flow of a database query according to an embodiment of the present application. As shown in FIG. 2, the method includes the following steps:

[0047] In step S202, a knowledge graph corresponding to the database to be queried is determined, wherein the knowledge graph is used to represent the logical structure and the association relationship of the data in the database to be queried.

[0048] In step S204, a similarity score between the user question text and each graph node in the knowledge graph is determined, and a target node is determined among the graph nodes in the knowledge graph according to the similarity score, wherein the similarity score is used to represent the degree of association between the graph node and the user question text.

[0049] In step S206, database schema information corresponding to the database to be queried is generated according to the target node, and a structured query language statement corresponding to the user question text is generated according to the database schema information by using a large language model, wherein the structured query language statement is used to query data in the database to be queried.

[0050] Through the above steps, the stored data content in the database and the defined database schema structured representation are represented as a knowledge graph, the association between the data is automatically established, then the large model technology is used, the hidden domain knowledge is automatically mined and updated according to the interactive history of the system, and is updated to the knowledge graph, thereby constructing the association between the user natural language query and the database knowledge, finally the knowledge in the knowledge graph is input to the large language model in the form of context, the purpose of converting the natural language proposed by the user into a general database query statement is achieved, and the technical problem of poor accuracy of generating a database query statement by using a large language model due to a large number of field information and complex relationships in the database is solved.

[0051] The database query method in steps S202-S206 of the embodiment of the present application is further described below.

[0052] The embodiment of the present application combines knowledge graph and large model technology to construct a general text-to-SQL knowledge understanding optimization method, converts the schema information in the database into a knowledge graph, and redefines a general database schema that is well adapted to the input of a large model. The method can be applied to any relational database and has strong scalability. Through graph retrieval and dense retrieval technology, the method can obtain highly relevant fields and tables from the knowledge graph, thereby filtering irrelevant information that interferes with SQL generation, greatly reducing the length of the context input to the large model, effectively saving resources, and improving the accuracy and reliability of SQL generation. FIG. 3 is a schematic diagram of a method flow of a database query optimization method based on an extensible knowledge graph enhancement according to an embodiment of the present application. As shown in FIG. 3, first, the knowledge graph is constructed and completed in combination with the database schema. Second, a dense retrieval model is used to select knowledge. Finally, a large model is used to generate knowledge and SQL. The details are described below.

[0053] First, the knowledge graph is constructed, that is, the knowledge graph corresponding to the database to be queried is determined. In this embodiment, the data source for constructing the knowledge graph is the original schema and stored data details of the database. By constructing the knowledge graph, the associativity between different knowledge in the database can be established, which is helpful for subsequent reconstruction and utilization of the knowledge. The specific steps are as follows.

[0054] In some embodiments of the present application, determining the knowledge graph corresponding to the database to be queried includes the following steps: generating the knowledge graph corresponding to the database to be queried by traversing the data tables in the database to be queried, wherein the knowledge graph is composed of multiple graph nodes and edges between the graph nodes, each graph node corresponds to an entity, and the entity includes a table entity and a column entity. The attributes of the table entity include table name and table description. The attributes of the column entity include column name, column description, data type, example value, and value meaning. Each edge is used to represent the association relationship between the two graphs connected by the edge. The association relationship includes the inter-table relationship, the inclusion relationship between the table and the column, and the foreign key relationship.

[0055] Specifically, the knowledge graph can be constructed based on the table structure and column information. In the embodiments of the present application, the constructed knowledge graph mainly consists of two key entity types, namely table entity (Table) and column entity (Column). The former has "table name" (Table Name) and "table description" (Table Description) as table entity attributes, and the latter has "column name" (Column Name), "column description" (Column Description), "data type" (Data Type), "example value" (Example Value) and "value explanation / value meaning" (Value Explanation) as column entity attributes.

[0056] In addition, the association relationship between entities includes but is not limited to the inter-table relationship, the containing relationship between table and column, and the foreign key relationship. The metadata (i.e., the above-mentioned entity types and relationship categories) can be extracted by using different operations of the database to obtain structured database information to construct the knowledge graph.

[0057] Meanwhile, in order to effectively store and query the constructed knowledge graph, in the embodiments of the present application, the graph database technology (for example, Neo4j can be used as an implementation tool of the graph database) can be used to convert the extracted metadata into nodes and edges of the graph database, wherein the table entity and the column entity are stored as nodes respectively, and the attributes of the nodes correspond to the attributes of the table and the column; the inter-table relationship, the containing relationship between table and column, and the foreign key relationship are stored as edges, and the types and attributes of the edges are used to reflect the specific content of the relationship. The graph database can naturally represent entities and their relationships, and has high efficiency in processing complex queries, and can facilitate the storage, updating and querying operations of the graph data.

[0058] The embodiments of the present application structure the representation of table knowledge, field knowledge and dependency relationship in the database by constructing the knowledge graph. In the subsequent scheme, the key knowledge obtained from the knowledge base according to the user question can be reorganized into a general database mode to assist SQL generation.

[0059] In actual landing scenarios, due to different scenarios, the database constructed by humans does not always provide all the content describing the database mode information, which may result in a very sparse knowledge graph constructed by the above steps, and some functional dependencies (such as formula calculation, numerical dependency, etc.) between fields cannot be provided. However, when people interact with the database, the association between the user question and the SQL usually needs to associate these dependencies with high quality. In view of this, the dynamic completion of the database can also be completed by using a large model to assist humans in the embodiments of the present application, and the specific steps are as follows.

[0060] In some embodiments of the present application, after determining the knowledge graph corresponding to the database to be queried, the method further comprises the following steps: obtaining a sample data set corresponding to the database to be queried, wherein the sample data set comprises a plurality of historical structured query language statements and natural language question texts corresponding to the historical structured query language statements; using a large language model to determine target binary tuples and target triplets based on the sample data set, wherein the target binary tuples are used to represent the corresponding relationship between the standard fields in the historical structured query language statements and the description information in the natural language question texts, each standard field corresponds to a column entity, and the target triplets are used to represent the dependency relationship between two standard fields; adding information corresponding to the target binary tuples and the target triplets to the knowledge graph.

[0061] Specifically, the construction process of the above sample data set is introduced, and the specific steps are as follows.

[0062] In some embodiments of the present application, obtaining the sample data set corresponding to the database to be queried comprises the following steps: obtaining a structured query language statement for data query in historical interaction data of the database to be queried to obtain a historical structured query language statement, wherein the data query comprises a multi-table query; using a large language model to generate a natural language question text corresponding to the historical structured query language statement, and verifying and correcting the natural language question text generated by the large language model; constructing a sample data set based on the historical structured query language statement and the corrected natural language question text.

[0063] Specifically, 10,000 SQL statements (i.e., the above historical structured query language statements) related to multi-table queries and responsible queries can be screened from the historical interaction data of the database to be queried by a rule function, then the historical SQL statements and database schema information are input as context into a large language model (such as GPT4), and the large language model is guided to output the possible user natural language questions (i.e., the above natural language question texts) corresponding to the historical SQL statements, wherein the output of the large language model will correspond to the input historical SQL statements one by one, and then the output pre-labeled data (i.e., the natural language question texts corresponding to the historical structured query language statements) can be manually checked by professional database operators, and the natural language expressions are modified again, and finally the modified natural language texts and SQL statements are used as initial information (i.e., the above sample data set) for supplementing the knowledge graph.

[0064] After obtaining the sample dataset, a large language model can be used to determine the target binary tuple and the target triple based on the sample dataset. Specifically, the simulated user question (i.e., the natural language question text described above), the historical SQL statement, and the original database schema are input into the large model to extract the attribute description of the field: the standard field in the historical SQL statement is matched with the natural language question text to form a binary tuple attribute = {column name, desc}, where desc represents the description information about the column name corresponding field extracted from the natural language question text; and the large model can also extract a triple relationship = {column name1, dependency, column name2}, which defines the specific dependency definition between two fields with dependency relationship. The column name and relationship will be updated to the knowledge graph and the large model as completed information. Through knowledge graph completion, more field dependency relationships are established, enriching the attribute information of the fields, which helps subsequent semantic matching using the retrieval model and provides more comprehensive knowledge.

[0065] The embodiments of the present application use the paradigm of combining knowledge graph and large model to reconstruct the isolated data content and structural information in the database into graph storage form, which can effectively mine the dependency relationships in the pattern. Using large model technology, the completion of the knowledge graph can be automatically completed according to the system interaction history, which can automatically adapt to the changes of the database pattern, reduce the need for manual intervention, and through the self-learning ability of the large model, the system can continuously optimize and update the knowledge graph, maintaining efficient support for the latest data and pattern.

[0066] The process of constructing and completing the knowledge graph described above is illustrated below.

[0067] As shown in FIG. 4, the database structure and its data details involved in the embodiments of the present application are all stored in files ending with “.sqlite”. First, a program is used to traverse all databases and their subordinate table names in the library file, and then the field names and their related attribute values involved are extracted using the corresponding standard database operation statements of SQLite to form a candidate set. Finally, Neo4j is used to convert it into a knowledge graph structure.

[0068] After the knowledge graph is constructed and completed, the knowledge based on the general knowledge base can be conveniently managed and maintained, but the database information closely related to the user question is not distinguished, and therefore, in the embodiments of the present application, a new general database mode can be recalled from a large number of knowledge graph nodes closely related to the user question text through a dense retrieval model, that is, a target node is determined in each graph node of the knowledge graph, and the specific steps are as follows.

[0069] In some embodiments of the present application, the target node is determined in each graph node of the knowledge graph according to the similarity score, which includes the following steps: converting the user question text into a first vector representation and converting the graph node into a second vector representation by using a target model, wherein the second vector representation is determined by the attributes corresponding to the graph node, and the target model is obtained by training according to a plurality of training sample pairs, and the training sample pair is determined by a standard field extracted from a sample data set and a graph node corresponding to the standard field in the knowledge graph; determining the similarity score between the first vector representation and the second vector representation, and determining the graph node with a similarity score greater than a preset similarity threshold as the target node.

[0070] Specifically, first, the construction of knowledge retrieval training data is performed: 10,000 user questions and sql statement question and answer pairs collected in the early stage (i.e., data in the above-mentioned sample data set) can be used as initial data, the tables and field names involved in the historical SQL statements (i.e., the above-mentioned standard fields) are extracted through a rule function, and then the corresponding node n (containing node information and attribute values: field name, field description, value example, value explanation, associated information, etc.) is queried from the database or the knowledge graph, and then the user question q is respectively combined with the extracted multiple nodes to form multiple training sample pairs {(q, n1), (q, n2)...} for training.

[0071] Then, the construction of the knowledge retrieval model (i.e., the above-mentioned target model) can be performed, and specifically, a pre-trained language model (BERT) can be selected as a bottom semantic encoder to represent the user question text and the graph node, and then a post-interaction method MaxSim based on maximum similarity is used to calculate the similarity score between the user question q and the graph node c, and the association degree between the table and the node is determined through the similarity score. The specific calculation formula is as follows: q Normalize(CNN(BERT Q (q)) O c Normalize(CNN(BERT C (c))

[0072] wherein O q and O cis the vector representation coded by the dual tower model, corresponding to the first vector representation and the second vector representation respectively, score represents the score of the similarity between the user question text and the current graph node, and by setting a similarity threshold, the target node can be screened.

[0073] After that, the new database schema information can be redefined based on the screened knowledge graph node (i.e., the target node) and provided as a context to the large model for SQL generation.

[0074] The embodiments of the present application adopt dense retrieval technology, which can efficiently find fields and tables related to user queries on a large-scale complex knowledge graph. By calculating the similarity in the vector space, irrelevant information can be quickly filtered out, thereby improving the accuracy and efficiency of SQL generation.

[0075] The process of the above knowledge selection will be illustrated below.

[0076] As shown in FIG. 5, in the embodiments of the present application, the dual tower model can be used to retrieve the most relevant fields from the knowledge graph according to the current question, and then the graph tool is used to determine the table to which the current field belongs. The knowledge retriever is trained based on ColBERT. First, according to all field names in the database table, the entity linking in the knowledge graph is performed, and the corresponding representation of the entity is converted into: {n = n name ||ndescription||c example ||cexplanation},Finally, the user query and the knowledge representation of the field entity are input into the field retriever to calculate the similarity. By setting a score threshold μ, the field entity with a similarity score greater than μ with the user query will be retained as the disambiguated entity, otherwise it will be discarded.

[0077] After the target node with high relevance to the user question text is screened from the knowledge graph, the large model decision can be made. When making the large model decision, the relevant fields, tables and dependency relationships can be retrieved from the knowledge graph first, a new database schema is constructed, and knowledge association is generated. These information are input into the large model as a context, and the thought chain mode is adopted to automatically split the SQL generation process into multiple sub-questions. These sub-questions are from shallow to deep, and gradually generate the final SQL, i.e., according to the target node, the database schema information of the database to be queried is generated, and according to the database schema information, the large language model is used to generate the structured query language statement corresponding to the user question text. The specific steps are as follows.

[0078] In some embodiments of the present application, the large language model is used to generate a structured query language statement corresponding to the user question text according to the database schema information, which includes the following steps: reconstructing the database schema information corresponding to the database to be queried according to the structural information of the target node and the corresponding dependency relationship in the knowledge graph, wherein the database schema information is used to limit the range of structured query language statement generation; using the large language model to determine the knowledge according to the reconstructed database schema information, the user question text, and the instruction information, wherein the knowledge is used to represent the association between the user question text and the database schema information, and the instruction information is used to indicate the task to be completed by the large language model; using the large language model to generate a structured query language statement corresponding to the user question text according to the reconstructed database schema information, the knowledge, and the user question text.

[0079] In some embodiments of the present application, the method further comprises: determining a target historical user query text in the historical user query text of the database to be queried, which has a semantic similarity greater than a preset threshold with the user question text; obtaining decoding process data of a structured query language statement corresponding to the target historical user query text; using the large language model to generate a structured query language statement corresponding to the user question text according to the reconstructed database schema information, the knowledge, the user question text, the target historical user query text, and the decoding process data.

[0080] Specifically, a knowledge generation prompt can be designed to guide the large model to output knowledge description between the current user question and the new database schema, etc. In the present embodiment, the prompt decided by the large model consists of five parts, including: instruction information, database schema information, knowledge, small sample (i.e. decoding process data of the structured query language statement corresponding to the target historical user query text), and user query (i.e. the user question text).

[0081] Among them, the instruction information is used to clearly indicate the task to be completed by the large model and the matters needing attention; the database schema information part selects high-value tables and fields through the knowledge graph and represents them in a structured form, which is used to limit the range of SQL generation; the knowledge part is used to associate the user query (user question text) with the database (database schema information) and provide interpretation of the fields to help the large model understand the meaning of the fields; the small sample part selects multiple historical user queries and their SQL decoding processes similar in semantics to the current user query through a small sample screening module, i.e. determines a target historical user query text in the historical user query text of the database to be queried, which has a semantic similarity greater than a preset threshold with the user question text, and obtains decoding process data of a structured query language statement corresponding to the target historical user query text; the user query (user question text) part is used to clearly indicate the current query problem of the user.

[0082] The large model module in the embodiments of the present application is flexible and universal, and does not limit the construction form and model structure of the large model. If there is corresponding machine resource, the training sample can be formed by constructing the input prompt and correct SQL output of the large model to fine-tune the model, or the user's prompt can be directly input to generate by the online service of the large model or using the form of open source large model inference. Through the database schema, knowledge and small sample learning, the large model divides the user query into multiple sub-questions, and generates the SQL of the complete question in the last sub-step.

[0083] The process of knowledge generation and large model decision-making described above will be illustrated below.

[0084] Taking the user question "Please provide the school name that meets the following conditions: K-12 stage free meal eligibility exceeds 0.1, and the number of examinees with scores exceeding 1500" as an example. As shown in FIG. 6, in the embodiments, the fields recalled in the knowledge graph and their related tables and dependency relationships in the graph can be first reorganized into a "schema reconstructed based on the knowledge graph" through knowledge selection; then, the user's question and the reconstructed schema are input as input information, and the instruction information is spliced as prompt words to input the large model.

[0085] The large model understands and executes the above instruction information, and outputs the knowledge associated with the user's question and the schema to obtain the generated knowledge clues. Finally, the reconstructed schema, knowledge, user question and other information are taken as context together, and the large model is prompted: "Please understand the knowledge of the data according to the provided information, and divide the user's question into multiple sub-questions, solve the sub-questions one by one, and finally generate SQL". Finally, through the output of the large model, the SQL query "SELECT T2.`School Name`FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds=T2.CDSCode WHERE CAST(T2.`Free Meal Count(K-12)`AS REAL) / T2.`Enrollment(K-12)`>0.1 AND T1.NumGE1500>0" is obtained.

[0086] In addition, after generating the SQL statement corresponding to the user question text, the generated SQL statement and the corresponding user question text can be stored as historical information, and the correctness of the SQL can be checked by the database professional. Assuming that the SQL matches the user question and is executed correctly, it is stored in the historical dependency library. Then, <question, SQL> pairs are traversed from the historical dependency library at regular intervals to extract knowledge using the large model, so as to update the knowledge graph.

[0087] The application proposes an SQL data extraction optimization scheme combining knowledge graph, dense retrieval and large model technology. In view of the problem that data knowledge acquisition is difficult in the intelligent data extraction scene of a database, and it is difficult to provide effective knowledge understanding for a large model, thereby leading to inaccurate SQL generation, a plug-in intelligent data extraction SQL generation solution is provided, which is easy to operate, and is actually put into the intelligent data extraction production scene.

[0088] By constructing a knowledge graph based on a database, the structural information and value information of the database are taken as edges, nodes and attribute values in the knowledge graph, and the relationships between various knowledge are established through the graph structure, and the knowledge is easy to maintain and select. By constructing the knowledge graph, the characteristics of the table data can be learned for different business scenarios, the model can understand the table information, and the useful information can be mined from the historical dialogues in the database to further improve the adaptability of the business scenario.

[0089] Based on the dense retrieval technology, the fields and user questions in the knowledge graph are represented as high-latitude vectors, the similarity between the vectors can retrieve the tables and fields highly related to the user questions from the semantic space, the recall and disambiguation of the graph knowledge can be quickly realized, the table field information possibly involved can be extracted from the knowledge graph before SQL generation, and the potential knowledge content can be retrieved through the association relationship between different nodes in the graph, the field and table content related to the user question can be effectively obtained, and then the interference of the redundant fields on the subsequent model decision is greatly reduced, and the accuracy of SQL generation is improved.

[0090] By combining the powerful semantic understanding ability of the large model, the association between the data mode and the user question can be automatically extracted according to the database interaction history, the completeness of the knowledge graph is greatly enriched, and more knowledge sources can be provided for SQL generation. Based on the generation mode of the large model, the SQL generation can be intelligently completed according to the input of the user. Due to the prompt information of the large model, the background knowledge can be integrated into the learning and generation process of the model, and the information loss caused by indirect knowledge transmission is reduced. The generative process can dynamically and intelligently generate the query statement according to the input of the user.

[0091] In addition, the scheme of the application is established on the general database data extraction process, and whether the knowledge expansion module needs to be added can be selected flexibly according to different application scenarios and databases, and the expansibility is high.

[0092] According to the embodiments of the application, an embodiment of a database query device is also provided. FIG. 7 is a structural schematic diagram of a database query device according to an embodiment of the application. As shown in FIG. 7, the device comprises:

[0093] The knowledge graph construction module 70 is configured to determine a knowledge graph corresponding to the database to be queried, wherein the knowledge graph is used to represent a logical structure and a correlation of data in the database to be queried.

[0094] The knowledge selection module 72 is configured to determine a similarity score between the user question text and each graph node in the knowledge graph, and determine a target node in the graph nodes in the knowledge graph according to the similarity score, wherein the similarity score is used to represent a correlation between the graph node and the user question text.

[0095] The large model decision module 74 is configured to generate database schema information corresponding to the database to be queried according to the target node, and generate a structured query language statement corresponding to the user question text according to the database schema information by using a large language model, wherein the structured query language statement is used to query data in the database to be queried.

[0096] Optionally, the determining of the knowledge graph corresponding to the database to be queried comprises: generating the knowledge graph corresponding to the database to be queried by traversing data tables in the database to be queried, wherein the knowledge graph is composed of a plurality of graph nodes and edges between the graph nodes, each graph node corresponds to an entity, and the entity comprises a table entity and a column entity, the attributes of the table entity comprise a table name and a table description, the attributes of the column entity comprise a column name, a column description, a data type, an example value and a value meaning, each edge is used to represent a correlation between two graph nodes connected by the edge, and the correlation comprises a table correlation, a containing relationship between a table and a column, and a foreign key relationship.

[0097] Optionally, after the knowledge graph corresponding to the database to be queried is determined, the knowledge graph construction module 70 is further configured to: obtain a sample data set corresponding to the database to be queried, wherein the sample data set comprises a plurality of historical structured query language statements and natural language question texts corresponding to the historical structured query language statements; determine target binary tuples and target triplets according to the sample data set by using a large language model, wherein the target binary tuples are used to represent a corresponding relationship between a standard field in the historical structured query language statement and description information in the natural language question text, each standard field corresponds to a column entity, and the target triplets are used to represent a dependency relationship between two standard fields; and add information corresponding to the target binary tuples and the target triplets to the knowledge graph.

[0098] Optionally, the obtaining the sample data set corresponding to the database to be queried comprises: obtaining a structured query language statement used for data query in historical interaction data of the database to be queried to obtain a historical structured query language statement, wherein the data query comprises a multi-table query; generating a natural language question text corresponding to the historical structured query language statement by using a large language model, and verifying and correcting the natural language question text generated by the large language model; and constructing the sample data set according to the historical structured query language statement and the corrected natural language question text.

[0099] Optionally, the determining the target node from the graph nodes of the knowledge graph according to the similarity score comprises: converting the user question text into a first vector representation and converting the graph nodes into second vector representations by using a target model, wherein the second vector representations are determined by attributes corresponding to the graph nodes, and the target model is trained according to a plurality of training sample pairs, and the training sample pairs are determined by a standard field extracted from the sample data set and a graph node corresponding to the standard field in the knowledge graph; determining a similarity score between the first vector representation and the second vector representation, and determining a graph node with a similarity score greater than a preset similarity threshold as the target node.

[0100] Optionally, the generating the structured query language statement corresponding to the user question text by using the large language model according to the database schema information comprises: reconstructing the database schema information corresponding to the database to be queried according to the structure information and the corresponding dependency relationship of the target node in the knowledge graph, wherein the database schema information is used to limit the range of the structured query language statement generation; determining knowledge by using the large language model according to the reconstructed database schema information, the user question text, and instruction information, wherein the knowledge is used to represent the association relationship between the user question text and the database schema information, and the instruction information is used to indicate the task to be completed by the large language model; and generating the structured query language statement corresponding to the user question text by using the large language model according to the reconstructed database schema information, the knowledge, and the user question text.

[0101] Optionally, the large model decision module 74 is further configured to: determine a target historical user query text in the historical user query text of the database to be queried, wherein a semantic similarity between the target historical user query text and the user question text is greater than a preset threshold; obtain decoding process data of a structured query language statement corresponding to the target historical user query text; and generate the structured query language statement corresponding to the user question text by using the large language model according to the reconstructed database schema information, the knowledge, the user question text, the target historical user query text, and the decoding process data.

[0102] It should be noted that each module in the above database query apparatus can be a program module (for example, a program instruction set for implementing a certain specific function) or a hardware module. For the latter, it can be in the form of, but not limited to, a processor or a processor that implements the functions of the above modules.

[0103] It should be noted that the database query apparatus provided in the embodiment can be used to execute the database query method shown in FIG. 2, and therefore the related explanations and descriptions of the above database query method also apply to the embodiments of the present application, which will not be repeated here.

[0104] The embodiments of the present application also provide a non-volatile storage medium, which includes a stored computer program. The device in which the non-volatile storage medium is located executes the following database query method by running the computer program: determining a knowledge graph corresponding to a to-be-queried database, wherein the knowledge graph is used to represent the logical structure and the association relationship of the data in the to-be-queried database; determining a similarity score between a user question text and each graph node in the knowledge graph, and determining a target node among the graph nodes in the knowledge graph according to the similarity score, wherein the similarity score is used to represent the degree of association between the graph node and the user question text; generating database schema information corresponding to the to-be-queried database according to the target node, and generating a structured query language statement corresponding to the user question text according to the database schema information by using a large language model, wherein the structured query language statement is used to query data in the to-be-queried database.

[0105] The embodiments of the present application also provide a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the database query method described in the embodiments of the present application are implemented: determining a knowledge graph corresponding to a to-be-queried database, wherein the knowledge graph is used to represent the logical structure and the association relationship of the data in the to-be-queried database; determining a similarity score between a user question text and each graph node in the knowledge graph, and determining a target node among the graph nodes in the knowledge graph according to the similarity score, wherein the similarity score is used to represent the degree of association between the graph node and the user question text; generating database schema information corresponding to the to-be-queried database according to the target node, and generating a structured query language statement corresponding to the user question text according to the database schema information by using a large language model, wherein the structured query language statement is used to query data in the to-be-queried database.

[0106] The above sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0107] In the above-described embodiments of the present application, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0108] In several embodiments provided in the present application, it should be understood that the disclosed technical contents can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division mode, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.

[0109] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0110] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software functional unit.

[0111] The integrated unit, if realized in the form of software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that makes a contribution or the whole or part of the technical solutions can be embodied in the form of software product, which is stored in a storage medium and includes a plurality of instructions for making a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and various program code storage media.

[0112] Any combination of the technical features in the above-described embodiments can be made, and for the sake of brevity, not all possible combinations are described, however, it is to be understood that the application embraces all such possible combinations.

[0113] The above-described embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the application. It should be pointed out that for ordinary skilled persons in the art, some modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the patent protection scope of the present application should be subject to the appended claims.

Claims

1. A database query method, comprising: determining a knowledge graph corresponding to a database to be queried, wherein the knowledge graph is used to represent the logical structure and the association relationship of the data in the database to be queried; determining a similarity score between a user question text and each graph node in the knowledge graph, and determining a target node among the graph nodes in the knowledge graph according to the similarity score, wherein the similarity score represents the degree of association between the graph node and the user question text; generating database schema information corresponding to the database to be queried according to the target node, and generating a structured query language statement corresponding to the user question text according to the database schema information by using a large language model, wherein the structured query language statement is used to query data in the database to be queried.

2. The database query method of claim 1, wherein determining a knowledge graph corresponding to a database to be queried comprises: generating the knowledge graph corresponding to the database to be queried by traversing the data tables in the database to be queried, wherein the knowledge graph is composed of a plurality of graph nodes and edges between the graph nodes, each graph node corresponds to an entity, and the entity includes table entities and column entities, the attributes of the table entities include table names and table descriptions, and the attributes of the column entities include column names, column descriptions, data types, example values, and value meanings, each edge represents the association relationship between two graph nodes connected by the edge, and the association relationship includes table relationship, inclusion relationship between table and column, and foreign key relationship.

3. The database query method of claim 2, wherein after determining the knowledge graph corresponding to the database to be queried, the method further comprises: obtaining a sample data set corresponding to the database to be queried, wherein the sample data set includes a plurality of historical structured query language statements and natural language question texts corresponding to the historical structured query language statements; determining target binary tuples and target triplets according to the sample data set by using a large language model, wherein the target binary tuples represent the corresponding relationship between standard fields in the historical structured query language statements and description information in the natural language question texts, each standard field corresponds to a column entity, and the target triplets represent the dependency relationship between two standard fields; adding information corresponding to the target binary tuples and the target triplets to the knowledge graph.

4. The database query method of claim 3, wherein obtaining a sample data set corresponding to the database to be queried comprises: obtaining a structured query language statement for data query in historical interaction data of the database to be queried to obtain the historical structured query language statement, wherein the data query includes multi-table query; generating the natural language question text corresponding to the historical structured query language statement by using a large language model, and verifying and correcting the natural language question text generated by the large language model. construct the sample dataset according to the historical structured query language sentence and the revised natural language question text.

5. The database query method of claim 4, wherein determining a target node among the graph nodes of the knowledge graph according to the similarity score comprises: converting the user question text into a first vector representation and converting the graph nodes into second vector representations using a target model, wherein the second vector representations are determined by attributes corresponding to the graph nodes, and the target model is trained according to a plurality of training sample pairs, the training sample pairs being determined by the standard fields extracted from the sample dataset and the graph nodes of the knowledge graph corresponding to the standard fields; determining the similarity score between the first vector representation and the second vector representation, and determining the graph node with a similarity score greater than a preset similarity threshold as the target node.

6. The database query method of claim 1, wherein generating a structured query language sentence corresponding to the user question text according to the database schema information using a large language model comprises: reconstructing the database schema information corresponding to the database to be queried according to the structural information and corresponding dependency relationships of the target node in the knowledge graph, wherein the database schema information is used to limit the range of structured query language sentence generation; determining knowledge according to the reconstructed database schema information, the user question text, and instruction information using a large language model, wherein the knowledge is used to represent the association between the user question text and the database schema information, and the instruction information is used to indicate the task to be completed by the large language model; generating the structured query language sentence corresponding to the user question text according to the reconstructed database schema information, the knowledge, and the user question text using a large language model.

7. The database query method of claim 6, wherein the method further comprises: determining a target historical user query text with a semantic similarity greater than a preset threshold between the user question text in the historical user query text of the database to be queried; obtaining decoding process data of the structured query language sentence corresponding to the target historical user query text; generating the structured query language sentence corresponding to the user question text according to the reconstructed database schema information, the knowledge, the user question text, the target historical user query text, and the decoding process data using a large language model.

8. A database query apparatus, comprising: a knowledge graph construction module configured to determine a knowledge graph corresponding to a database to be queried, wherein the knowledge graph is used to represent the logical structure and association of data in the database to be queried. The knowledge selection module is configured to determine a similarity score between the user question text and each graph node in the knowledge graph, and determine a target node from the graph nodes in the knowledge graph according to the similarity score, wherein the similarity score represents a degree of association between the graph node and the user question text. The large model decision module is configured to generate database schema information corresponding to the to-be-queried database according to the target node, and generate a structured query language statement corresponding to the user question text according to the database schema information by using a large language model, wherein the structured query language statement is used to query data in the to-be-queried database.

9. An electronic device comprising: The memory and the processor are configured to run a program stored in the memory, and the program is configured to implement the database query method in any one of claims 1 to 7 when running.

10. A non-transitory storage medium including a stored computer program, wherein, The device in which the non-volatile storage medium is located is configured to implement the database query method in any one of claims 1 to 7 by running the computer program.

11. A computer program product comprising a computer program, wherein the computer program is configured to implement the steps of the database query method in any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • Database metadata relational knowledge graph generation method

    CN115203337A

  • Graph query method and system based on local knowledge base and natural language large model

    CN117009492A

  • Intelligent question and answer implementation method and system based on large model and semantic map

    CN117271724A

  • Question answering system based on large language model and knowledge graph, construction method of question answering system and intelligent data governance platform

    CN117609470A

  • Auxiliary decision-making system based on combination of large model and event knowledge graph

    CN118069860A

Cited By

  • Data processing method and device and storage medium

    CN116911683A

  • Task interaction method and related device, electronic equipment and storage medium

    CN121902994A

  • Method and system for integrating retrieval enhancement generation capability

    CN122045226A

  • Structured query language generation method and system based on multi-dimensional complexity evaluation

    CN122064703A

  • Intelligent network connection vehicle traffic accident knowledge base construction system, method and equipment

    CN122087173A