A text-to-SQL generation method based on retrieval enhancement and verification, a computer-readable storage medium and a product
By employing a three-stage architecture based on SIG-based information gain filtering and a two-stage validator to correct errors, the problem of noise information introduction and semantic errors in existing Text-to-SQL systems is solved, achieving efficient and accurate SQL generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DC TECHNICAL CENTER OF STATE GRID CORP OF CHINA
- Filing Date
- 2026-03-09
- Publication Date
- 2026-07-17
AI Technical Summary
In existing Text-to-SQL systems, retrieval enhancement methods cannot assess the actual value of retrieved information, leading to the introduction of noise. Furthermore, SQL post-processing relies on database execution feedback, resulting in inefficiency and an inability to correct semantic errors.
A three-stage architecture of retrieval-generation-validation is adopted. Useful information is filtered from the database based on SIG to generate initial SQL. The initial SQL is then completed and corrected by a two-stage validator. The LLM model is trained using a fine-tuning dataset of positive and negative samples to correct errors.
It achieves accurate identification and filtering of database schema information that does not contribute to or interfere with the generation, avoids feedback during iterative database execution, improves the efficiency and accuracy of SQL generation, and reduces time latency and computational resource consumption.
Smart Images

Figure CN122412437A_ABST
Abstract
Citation Information
Patent Citations
Method and system for automatically generating SQL (Structured Query Language) in power field based on retrieval enhancement generation
CN119201984A
RAG enhanced Text-to-SQL query method and system for large-scale database environment
CN120492494A