Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

2452 results about "SQL" patented technology

SQL (/ˌɛsˌkjuːˈɛl/ S-Q-L, /ˈsiːkwəl/ "sequel"; Structured Query Language) is a domain-specific language used in programming and designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS). It is particularly useful in handling structured data, i.e. data incorporating relations among entities and variables.

NL2SQL optimization method and device based on large model, equipment and medium

The invention discloses an NL2SQL optimization method and device based on a large model, equipment and a medium, and relates to the technical field of artificial intelligence, the method comprises the following steps: constructing a target metadata knowledge base, and obtaining an initial natural language query request; determining each target entity corresponding to the initial natural language query request, and determining missing target SQL elements in the initial natural language query request based on each target entity; generating a first cue word based on the initial natural language query request, the target SQL element and the target metadata knowledge base, and complementing the target SQL element based on the first cue word by utilizing the target large model to obtain a target natural language query request; and generating a plurality of candidate SQL statements corresponding to the target natural language query request by using the target large model, verifying each candidate SQL statement, and determining a target SQL statement from each candidate SQL statement based on a verification result. According to the method, the accuracy of the NL2SQL can be improved by utilizing a large model.
Owner:SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

Automated Prompt Augmentation And Engineering Using ML Automation In SQL Query Engine

A database system generates a prompt for an LLM or other machine learning (ML) model to narrow the search space to highly relevant information about a database. A distinct instance of a classifier, a clustering algorithm, or a topic modeling model can be trained based on information from ML automation within the database system, respectively for each column or table in the database. Model instances can then be used during generative LLM inferencing to identify relevant sources of data to answer the user's question. Thus, the prompt generation combines ML automation and other ML models or an LLM for topic modeling and schema description.
Owner:ORACLE INT CORP

SQL intelligent generation method and system for business query

The invention provides an intelligent SQL generation method and system for business query, and belongs to the technical field of artificial intelligence. Related data of query statements are acquired, and a corresponding query intention knowledge graph is constructed by semantic clustering; the method comprises the following steps: analyzing a historical SQL statement structure, extracting a natural language template and an SQL template, and expanding through a large language model to generate a feed-shot example set; and constructing a composite cue word template by combining task setting guidance, a feed-shot example and CoT chain thinking reasoning guidance. An intention completion module is arranged in a large language model, a natural language query statement of a user is combined with a composite cue word template context, a structured query statement is generated through entity recognition, semantic completion, parameter filling and fuzzy intention training, and the structured query statement is converted into a standard SQL statement through a knowledge graph and a template. According to the method, the use threshold of business personnel is remarkably reduced, and efficient conversion from natural language questions to SQL statements is realized.
Owner:国网福建省电力有限公司营销服务中心 +1

Test analysis and report generation method and system based on large model retrieval enhancement

The invention relates to the technical field of automatic report generation, and provides a test analysis and report generation method and system based on large model retrieval enhancement, and the method comprises the steps: firstly carrying out the semantic task decomposition of user query, and meanwhile, achieving the multi-dimensional information extraction through the butt joint of a knowledge vector library and a structured image-text knowledge system established by a private knowledge base module. And three strategies of RAG, Self-RAG and Graph-RAG are combined to enhance the generation capability of the large model so as to accurately obtain background knowledge. And constructing a standard SQL statement according to a structured query requirement, and performing data filling according to template prompt by an output result fusion module in combination with a query background and an SQL execution result to form a test report. By optimizing a retrieval enhancement generation method, professional knowledge supplement related to query is realized, and the reasoning ability of a large model in a professional scene is effectively enhanced, so that the accuracy and the intelligent level of data analysis are improved.
Owner:CHINA ELECTRONIS TECH INSTR CO LTD

Method for generating SQL (structured query language) from natural language based on bidirectional mapping and semantic analysis

The invention provides a method for generating an SQL (Structured Query Language) by a natural language based on bidirectional mapping and semantic parsing, which relates to the technical field of database query and comprises the following steps of: extracting natural language query elements and packaging the natural language query elements into structured data, and establishing a mapping relationship from a query field to a service attribute and a physical data table by adopting a bidirectional Hash index technology; and automatically identifying multi-table association keys, performing semantic extension and compliance verification, generating an abstract syntax tree, performing processing according to user permission, and finally converting the abstract syntax tree into an SQL statement conforming to a target database syntax specification. According to the method, the accuracy and the efficiency of converting the natural language into the SQL are improved, and the flexibility and the safety of the system are enhanced.
Owner:北京科杰科技有限公司

SQL (Structured Query Language) statement generation method and system based on large language model

The invention provides an SQL (Structured Query Language) statement generation method and system based on a large language model. Target database metadata are collected, a structured dictionary is constructed, cue words adaptive to the large language model are generated in combination with a user query strategy, and accurate SQL generation is realized through a closed-loop execution optimization mechanism after model reasoning and SQL analysis. Through a large language model intelligent analysis technology, a multi-source heterogeneous database metadata dynamic adaptation technology and a closed-loop optimization mechanism for SQL statement generation, execution and feedback, the efficient and accurate SQL statement automatic generation function is achieved through the characteristics of cross-database grammar automatic adaptation, complex service requirement accurate analysis, intelligent error correction and the like. The system not only improves the working efficiency of developers, but also reduces the resource occupation and operation and maintenance cost of the system, and improves the accuracy and safety of data query and processing.
Owner:SHANXIN SOFTWARE CO LTD

Database operation and maintenance decision-making method and device based on large language model and medium

The invention relates to the technical field of database operation and maintenance, in particular to a database operation and maintenance decision-making method and device based on a large language model.The method comprises the steps that real-time operation indexes and historical log data of a database are collected, and multi-dimensional time sequence features are extracted; and analyzing the characteristics by using a large language model, judging whether a performance bottleneck or an abnormal risk exists or not, and determining the relevance between the performance bottleneck or the abnormal risk and a database performance problem. If the risk exists, acquiring a system load sudden change trend and a resource request rate, quantifying a system pressure degree, and inputting a performance optimization model to generate an adaptive tuning strategy; calculating statement complexity through an SQL audit log, and selecting an index adjustment strategy in combination with an index optimization model; evaluating the influence of the tuning strategy and the index strategy on the throughput, the response delay and the resource utilization rate, and determining a target high-performance strategy; according to the scheme, accurate optimization and efficient operation and maintenance of database performance are realized through intelligent analysis and dynamic adjustment and optimization.
Owner:HANGZHOU RUNLAI TECH SERVICE CO LTD

Intelligent data query method based on natural language

The invention provides an intelligent data query method based on a natural language, and relates to the technical field of intelligent data processing and natural language interaction.The intelligent data query method comprises the steps that firstly, enterprise original data is subjected to standard treatment, and a standardized theme database and a data directory and index definition document are constructed; key semantics are extracted based on unstructured knowledge, and a domain knowledge vector library is fused and constructed by combining document text fragments and vector representation of a mapping relation between historical questions of a user and an SQL (Structured Query Language). And after receiving a natural language question of a user, calling a large language model to identify a task type, and distinguishing knowledge questions and answers, data query and complex analysis. Executing corresponding operations according to different types: directly retrieving a vector library by knowledge questions and answers to generate answers; extracting keywords in data query and generating a query request in combination with context; and in the complex analysis, predefined workflow is judged and executed or intelligent agent processing is called, and query or analysis requirements are output.
Owner:INSPUR GENERSOFT CO LTD

Multi-table joint natural language query SQL generation method

The invention discloses a multi-table combined natural language query SQL (structured query language) generation method, which comprises the following steps of: 1, constructing a database meta-knowledge graph, and establishing a triple storage comprising a table structure, a primary and foreign key relationship and business description for each data table; 2, receiving a natural language query request, and calculating the topic relevancy between query semantics and each database table through a pre-trained topic matching model; 3, dynamically constructing a view, and logically associating the database tables of which the theme relevancy exceeds a threshold value to form a temporary view; 4, generating a context enhancement prompt, and combining the temporary view structure, the field semantic description of the view and the view content sample to form a structured prompt; 5, inputting the natural language query and the structured prompt into the large language model to generate candidate SQL statements; and step 6, executing verification and iterative optimization on the candidate SQL statements, verifying logic correctness through SQL execution plan analysis and result sampling, and triggering and prompting a reconstruction mechanism when detection is abnormal.
Owner:THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP

Data analysis system and method based on artificial intelligence

According to the artificial intelligence-based data analysis system and method provided by the invention, a set of novel data analysis system architecture is designed, and key technical components such as natural language processing, a large language model, database query optimization, multi-modal visualization and a semantic knowledge graph are fused; data transmission between modules is realized through unified intermediate data objects such as a structured query intention, an analytic tree and a structured query language template object, and asynchronous collaboration is realized through event driving and a message queue mechanism, so that a non-professional user can input an analysis request through a natural language; semantic analysis, structured query language query statement generation, data query and result visualization presentation are automatically completed, the method can be widely applied to data analysis scenes in the industries of government affairs, traffic, finance, education and the like, the data use efficiency is improved, the technical threshold is reduced, and the digital decision-making ability is enhanced.
Owner:WUHAN DEEPIN DIGITAL TECHNOLOGY CO LTD

Automatic NL2SQL data set construction method and system based on large language model

The invention discloses an automatic NL2SQL data set construction method and system based on a large language model. The method comprises the steps that service-oriented SQL query data collection is carried out; the method comprises the following steps of: collecting SQL query statements related to business through a channel, and cleaning and standardizing an obtained SQL sample by adopting a data preprocessing technology; generating NL2SQL data based on a large language model; a mapping pair between the natural language and the SQL is generated by using a large language model, corresponding natural language description is generated through reverse derivation according to a specific business problem and a table connection mode, and the conversion process from the SQL to the natural language is realized; optimizing the quality of the NL2SQL data set; and dynamically updating a data set for private deployment. According to the method, an automatic SQL sample generation mechanism and a multi-dimensional quality control process are introduced, so that manual intervention is remarkably reduced, and the diversity and accuracy of a data set are improved.
Owner:STATE GRID JIANGSU ELECTRIC POWER CO LIANYUNGANG POWER SUPPLY CO +1

Enterprise number asking system and method based on combination of large language model and NL2SQL

The invention relates to the technical field of natural language processing, in particular to an enterprise number asking system and method based on combination of a large language model and an NL2SQL, and the method comprises the following steps: filling a prompt project template with a natural language query request and a structured metadata context, and generating a standard prompt; the standard prompt is input into the large language model, deep semantic analysis is carried out, and an SQL query draft is generated; self-evaluation is carried out on the questions, and when the questions are recognized, clarified questions are generated and returned to the user; receiving feedback of a user, and iteratively optimizing the SQL query draft based on the feedback; performing grammar verification and security verification on the final SQL query draft to generate an executable SQL statement; sending the executable SQL statement to a target enterprise database for execution; and the information is visually displayed to a user. The problem that the SQL generated in the prior art deviates from the real intention of a user and cannot meet the requirements of enterprise-level applications for accuracy and reliability can be solved.
Owner:CHONGQING ZHONGRAN DIGITAL TECH CO LTD

ChatBI dynamic data query and visualization system and method

The invention relates to the technical field of artificial intelligence, in particular to a ChatBI dynamic data query and visualization system and method.The ChatBI dynamic data query and visualization system comprises a natural language interaction and intention analysis module, a metadata knowledge graph module, a dynamic SQL generation and optimization module, an intelligent visualization recommendation module and a multi-source data connection and real-time calculation module; the method has the beneficial effects that by fusing natural language interaction, intelligent query generation and self-adaptive visualization technologies, the core pain points of high technical threshold, large response delay, complex visualization configuration and the like of a traditional BI tool are thoroughly solved.
Owner:INSPUR SMART SUPPLY CHAIN TECH (SHANDONG) CO LTD

Query statement conversion method and device based on large model, equipment and medium

The invention discloses a query statement conversion method and device based on a large model, equipment and a medium, and relates to the field of computer science, and the method comprises the steps: obtaining a natural language query statement sent by a user side, comparing the natural language query statement with a high-frequency problem in a target knowledge base, and obtaining a query statement conversion result; whether a high-frequency problem with the similarity with the natural language query statement exceeding a preset similarity threshold value exists in the target knowledge base or not is judged; if the high-frequency problem that the similarity with the natural language query statement exceeds a preset similarity threshold does not exist, determining a target database table corresponding to the natural language query statement based on the target knowledge graph, and extracting a creation statement corresponding to the target database table, so as to determine target information corresponding to the target database table according to the creation statement; and analyzing the target information by using a preset large model to generate an SQL statement corresponding to the natural language query statement. According to the method and the device, the natural language query statement can be efficiently and accurately converted into the structured SQL statement.
Owner:SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

Data platform metadata automatic generation method based on large model

The invention relates to the technical field of metadata generation, and discloses a data platform metadata automatic generation method based on a large model, which comprises the following steps of: firstly, performing unified standardization and preliminary grammatical analysis on an original SQL (Structured Query Language) code to obtain a structured intermediate representation; on the basis, preliminary blood relationship analysis based on rules is carried out, and simple column references are quickly identified and processed. For complex expressions which are difficult to accurately analyze by a traditional method, code snippets and context information of the complex expressions are accurately extracted and submitted to a large language model for deep semantic understanding and complex blood relationship analysis. And finally, integrating the complex consanguinity analyzed by the large model with the initial consanguinity list to form a comprehensive and accurate field-level consanguinity, and further generating complete data platform metadata. In this way, the defect that a traditional analysis tool understands complex semantics is effectively overcome, and the accuracy and integrity of metadata generation are remarkably improved.
Owner:ZHEJIANG NON-LINEAR DIGITAL TECH CO LTD

Context-aware SQL generation method based on table field semantic enhancement

The invention relates to the technical field of semantic processing, in particular to a context-aware SQL (structured query language) generation method based on table field semantic enhancement, which comprises the following steps of: acquiring financial management and investment combination data of a user and mode information of a background database, constructing a mixed semantic index database, receiving natural language query input by the user, and generating a query result. Performing intention judgment on the query by utilizing the lightweight intention classification model, and if the intention is judged to be matched, calling a parameterized SQL template bound with the query intention and filling parameters to generate a final SQL query; if it is judged that the query intention is an exploration type intention, executing a two-stage SQL generation process, including generating an SQL skeleton according to the query intention, performing target type field recall based on the SQL skeleton, and filling the recalled field into the SQL skeleton to generate a final SQL query; and monitoring the execution performance of the final SQL query, and updating the query popularity metadata and the calculation cost metadata. According to the method, the SQL generation efficiency is improved through intelligent shunting and self-optimization.
Owner:ZHEJIANG FULIN TECH CO LTD

Data query method and system for converting natural language into database query language

The invention provides a data query method and system for converting a natural language into a database query language, and the method comprises the steps: analyzing the natural language input of a user through a multi-modal understanding agent on the basis of constructing a dynamic knowledge graph based on metadata, combining a historical session with a business term table, eliminating ambiguity, and generating a standardized Query, a retrieval routing agent selects a query strategy according to Query complexity, simple query directly matches a cache template, complex query traverses a knowledge graph, and related tables, fields and service constraints are returned; then, an expert committee agent generates an SQL (Structured Query Language) by adopting multi-stage collaboration, executes plan pre-evaluation, and selects a version with the highest comprehensive score; the test agent simulates and executes the SQL in the isolation environment, and verifies the grammar legality and the field permission; and finally, executing the detected SQL, and processing a result. According to the method, the accuracy of converting the natural language into the SQL (NL2SQL) in a complex database scene can be effectively improved.
Owner:HI-THINK YONDERVISION (BEIJING) TECH CO LTD

NL2SQL method and system based on reinforcement learning

The invention relates to the technical field of artificial intelligence and databases, in particular to an NL2SQL method and system based on reinforcement learning, and the method comprises the following steps: natural language input preprocessing, semantic analysis and abstract representation construction, mode linking and candidate set determination, SQL generation, query execution and feedback optimization, and multi-round interaction processing. The method has the beneficial effects that complex scenes such as nested sub-query, multi-table JOIN and aggregation function combination are supported, and the SQL generation accuracy is improved by more than 30% compared with that of a traditional method (test data is from a spider data set); a mode link mechanism based on reinforcement learning can quickly adapt to a new database mode, and in a cross-domain test (such as switching from an e-commerce database to a medical database), the accuracy rate decrease amplitude is less than 15%.
Owner:SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

SQL (Structured Query Language) statement structure verification system based on large model and knowledge graph fusion enhancement

The invention discloses an SQL statement structure verification system based on large model and knowledge graph fusion enhancement. The SQL statement structure verification system comprises a knowledge graph construction module, an input design module, a verifier design module and an output design module. According to the method, a knowledge graph is introduced as a structured semantic support, and a closed-loop enhancement processing flow of SQL statements from generation, verification to optimization is realized in combination with a structure perception cue word design, a rule verification mechanism and a Function Call feedback interface; the defects that an existing Text2SQL method is insufficient in structural understanding, lack of semantic reasoning, weak in generalization ability, dependent on computing power and the like are overcome. According to the method, triple guarantee of semantic perception, rule driving and model assistance is realized, the accuracy, robustness and interpretability of SQL generation are remarkably improved, and the cognitive load and operation risk of non-professional users in database interaction are effectively reduced.
Owner:GUIZHOU NORMAL UNIVERSITY

Automatic SQL tuning method and system combining large language model and database optimizer, computer equipment and storage medium

The invention discloses an automatic SQL tuning method and system combined with a large language model and a database optimizer, computer equipment and a storage medium, and the method comprises the steps: generating a query fingerprint according to an SQL query statement input by a user, detecting whether there is an optimization result matched with the query fingerprint in a cache, and only when there is no optimization result, executing the step 1; if yes, the SQL query statements input by the user and the optimization instruction are input into the large language model, and a plurality of candidate SQL query statements are generated; performing semantic equivalence verification on the candidate SQL query statements and an SQL query statement input by a user, and screening out semantic equivalence candidate SQL query statements; submitting the screened candidate SQL query statements to a database optimizer, and obtaining an execution plan and cost information of each candidate SQL query statement; calculating an evaluation score of each candidate SQL query statement, and selecting the candidate SQL query statement with the highest evaluation score as an optimization result; and writing the optimization result and the related execution data into a cache, and returning the optimization result and the related execution data to the user.
Owner:JIANGSU DAMENG DATABASE CO LTD

Large model-based unidirectional isolation network intelligent data analysis method and device, and medium

The invention provides a one-way isolation network intelligent data analysis method and device based on a large model and a medium, and belongs to the technical field of data processing and network security. Matching an accessible node area list according to a preset organization structure level; the system receives and analyzes the instruction to determine a query intention and an associated data range; the system converts a natural language query instruction into a cross-node SQL statement through a large model module, and verifies the legality of the SQL statement based on user permission; and the system unidirectionally transmits the encrypted SQL instruction to a target node area through a hardware optical shutter, triggers the node area to execute local statistical operation and returns a structured result. Dynamic data pulling in a one-way network environment is achieved through a hardware optical shutter and data pump technology, natural language query is converted into SQL in real time in combination with distributed query optimized by a large model, and the problems that data statistics is lagged and user operation intervention is needed in a traditional isolation network are solved.
Owner:INSPUR ZHUOSHU BIG DATA IND DEV CO LTD

Method and system for converting natural language to SQL based on RAG enhancement

The invention discloses a natural language-to-SQL (Structured Query Language) method and system based on RAG (Random Access Gateway) enhancement, and the method comprises the steps: constructing a query intention graph through dependency syntax analysis, recognizing and complementing semantic missing components, and forming complete semantic representation; vector representation is carried out on the business term segments by adopting vectorization coding, accurate definitions of business terms are obtained from a factory structured knowledge base, and an enhanced context set is formed through expansion retrieval in a low-confidence region; an SQL template mapping network is established based on historical query records, a mapping relation matrix is generated through field candidate matching, mapping conflict positions are identified, and multiple SQL candidate sequences are generated; grammar verification is carried out on the candidate sequence to identify grammar errors, semantic consistency verification is carried out to calculate the intention alignment degree, and an optimal SQL statement is selected through a deviation correction factor; and performing formatting processing and statistical abstract on an execution result, and providing data query capability for scenes such as factory quality management and equipment maintenance.
Owner:WUXI XINSOFT INTELLIGENT CONTROL SYST CO LTD

NL2SQL method and system based on large language model and retrieval enhancement

The invention discloses a self-adaptive NL2SQL method and system based on a large language model and retrieval enhancement. The method comprises four key steps of mode linking, example enhancement and SQL generation, multi-path thinking chain fusion reasoning and multi-round self-correction. The system comprises the following modules: a knowledge base management module, an input analysis and preprocessing module, a mode link module, an example enhancement module, an SQL (Structured Query Language) generation module, an SQL fusion and optimization module, an SQL execution and feedback module, a multi-round self-correction module, a Prompt construction and context management module, a system interface module and a content generation module. The method has the advantages that multiple large models are supported, a data source is quickly accessed, a user-defined prompt structure is configured, good engineering maintainability and scene adaptability are achieved, and SQL generation accuracy, performability and universality are improved.
Owner:GUIZHOU NORMAL UNIVERSITY

Semantic-based migration and consistency verification method, system and equipment and medium

The invention provides a semantic-based migration and consistency verification method, system and device and a medium, and relates to the technical field of databases. The method comprises the following steps: performing metadata topology scanning analysis by obtaining metadata, including generating an abstract syntax tree and constructing a semantic graph; according to a metadata topology scanning analysis result, performing data mapping and conversion, including loading a YAML rule and generating corresponding type mapping and constraint conversion; data migration is carried out through primary key fragmentation parallel migration, batch writing optimization and real-time double-writing verification; through structure-data-business three-layer verification, simulation business SQL comparison and automatic difference repair, the integrity of migrated data and business compliance are ensured, the semantic gap problem in heterogeneous database migration is solved, high-precision and high-efficiency database migration is realized, the migration efficiency is improved, and the data migration efficiency is improved. The method is suitable for scenes with strict requirements on data consistency and migration efficiency, such as financial, government affair and enterprise-level data centers.
Owner:CHINA YANGTZE POWER

Low-sample NL2SQL intelligent generation method and device

The invention relates to the technical field of artificial intelligence, and particularly provides a low-sample NL2SQL intelligent generation method and device, and the method comprises the following steps: S1, enabling a dynamic sample extension module to solve a training data sparse problem in a small sample scene through an intention clarification and data enhancement technology; s2, the clause dependency chain type generation framework converts natural language query into structured query language (SQL) statements with clear structures through semantic analysis, clause generation and dependency modeling; s3, the multi-agent cooperation platform performs iterative optimization through intention recognition, SQL generation and code execution; s4, enabling an automatic evaluation and iteration mechanism to pass a standardized test and continuous optimization; and S5, carrying out field adaptation and security enhancement. Compared with the prior art, the complex query processing capacity can be improved, and the stability and safety of the system are guaranteed through automatic evaluation and a safety mechanism.
Owner:SHANDONG INSPUR CLOUD GOVERNMENT INFORMATION TECHNOLOGY CO LTD

Generating structured query language using machine learning

Methods, systems, and apparatus, including computer programs encoded on computer-storage media, for generating structured query language using machine learning. In some implementations, a system provides an interface configured to receive input comprising data processing criteria expressed in natural language text. The system receives natural language input through the interface, where the natural language input specifies one or more criteria for retrieving or generating data from a data set. The system obtains a structured query language (SQL) statement generated by an artificial intelligence or machine learning (AI / ML) model based on the natural language input, and the system provides the SQL statement through the interface.
Owner:STRATEGY INC

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

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.
Owner:CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD

Method and system for generating Text2SQL (Structured Query Language) driven by large language model

The invention provides a Text2SQL generation method and system driven by a large language model, and the method comprises the steps: recognizing key entities and relationships in a natural language question through the large language model, and carrying out the construction to obtain a query graph; constructing a hierarchical graph representation model based on the database mode of the target database; searching candidate sub-image sets which have the same structure as the query graph and are in semantic association with the query graph from the constructed graph representation model; and constructing a structured Prompt template based on the candidate sub-image set and the user question, generating an initial SQL statement, and outputting a final query result after grammar and semantic detection correction. According to the method, a traditional database is converted into the graph knowledge base, so that the SQL generation accuracy and performance are improved; guiding the large model to generate an SQL (Structured Query Language) meeting business requirements through knowledge graph storage and retrieval table and column information; and the accuracy of the SQL is continuously optimized by utilizing a self-adaptive feedback mechanism, so that the method is particularly suitable for a large-scale complex query scene, and self-improvement and customization of the model are realized.
Owner:SOUTH CENTRAL UNIVERSITY FOR NATIONALITIES

Method, device and equipment for generating SQL (Structured Query Language) statement based on natural language and storage medium

According to the method and device for generating the SQL statement based on the natural language, the equipment and the storage medium provided by the invention, the query instruction input by the user is received, and the query instruction is the natural language; performing semantic analysis on the query instruction; performing semantic vector coding on the query instruction, and performing similarity retrieval in a preset vector database to obtain semantic enhancement information related to the query instruction; filling a preset structured prompt template with the semantic analysis result and the semantic enhancement information to obtain prompt input information; and inputting the prompt input information into a large language model to generate an SQL statement. According to the method, semantic analysis and vector coding are performed on the natural language instruction of the user, and semantic enhancement is performed in combination with the preset vector database, so that the generation process has context semantic support, and the integrating degree of the generation result and the intention of the user is effectively improved.
Owner:GUANGZHOU SYC TECH CO LTD

Divide-and-conquer prompt for LLM-based text-to-SQL conversion

Systems and methods for processing search queries are provided. A method, according to one implementation, includes a step of receiving a query from a user interface, the query including one or more questions or commands pertaining to datasets stored in a relational database. The method also includes a step of generating a prompt having instructions related to how a Large Language Model (LLM) is to handle a complex query having one or more cascading dependencies. Also, the method includes a step of providing the prompt, datasets, and query to an LLM with instructions to convert the query into Structure Query Language (SQL) code.
Owner:ZSCALER INC