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.

CN122412437APending Publication Date: 2026-07-17DC TECHNICAL CENTER OF STATE GRID CORP OF CHINA +1
View PDF 2 Cites 0 Cited by

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

Technical Problem

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.

Method used

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.

Benefits of technology

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.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122412437A_ABST
    Figure CN122412437A_ABST
Patent Text Reader

Abstract

本发明涉及一种基于检索增强与验证的Text‑to‑SQL生成方法、计算机可读存储介质及产品,属于语义处理技术领域,响应于输入用户问题,通过基于SIG的信息增益从数据库中选择与所述用户问题之间相似度达到预设相似度阈值的有用文档,并使用有用文档作为提示信息输入LLM模型,得到初始SQL语句;将预先构建的包含正负样本的指令微调数据集均输入至LLM模型,以对LLM模型进行微调,在微调过程中,LLM模型基于正、负样本学习错误原因;将初始SQL语句输入微调后的LLM模型进行纠正,得到目标SQL语句,精准识别并过滤掉对生成当前SQL无贡献甚至产生干扰的数据库模式信息,提出的双阶段指令微调验证器,取代了传统依赖数据库执行反馈的迭代修正循环。
Need to check novelty before this filing date? Find Prior Art

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