华东师范大学学报(自然科学版) ›› 2026, Vol. 2026 ›› Issue (5): 196-207.doi: 10.3969/j.issn.1000-5641.2026.05.016

• 数据智能应用 • 上一篇    

SQL4Domain: 面向电力垂类领域的高可靠Text-to-SQL生成与校验框架

张远来1,2, 汪庆宁2, 高明1,*()   

  1. 1. 华东师范大学 数据科学与工程学院, 上海 200062
    2. 泰豪软件股份有限公司, 南昌 330096
  • 收稿日期:2026-07-07 出版日期:2026-09-25 发布日期:2026-09-12
  • 通讯作者: 高明 E-mail:mgao@dase.ecnu.edu.cn
  • 基金资助:
    国家区域创新联合发展基金重点支持项目 (U23A20298)

SQL4Domain: A highly reliable Text-to-SQL generation and verification framework for domain-specific electric power data

Yuanlai ZHANG1,2, Qingning WANG2, Ming GAO1,*()   

  1. 1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China
    2. Tellhow Software Co., Ltd., Nanchang 330096, China
  • Received:2026-07-07 Online:2026-09-25 Published:2026-09-12
  • Contact: Ming GAO E-mail:mgao@dase.ecnu.edu.cn

摘要:

近年来, 随着大语言模型 (Large Language Model, LLM) 的快速发展, Text-to-SQL任务取得了突破性进展. 然而, 在垂类领域 (如金融、医疗、电力等行业) 中, 由于文本问句表达复杂且数据库结构专业性强, Text-to-SQL任务仍然面临重大挑战. 本文提出了一种面向垂类领域的高可靠Text-to-SQL智能解析框架SQL4Domain, 以电力领域为典型应用案例. 该框架首先利用垂类领域知识库对用户问句进行意图识别和关键实体抽取, 随后结合领域知识提示进行SQL (Structured Query Language)生成, 最后通过多策略知识验证提升SQL的准确性和可靠性. 在电力领域数据集上的实验结果表明, SQL4Domain在执行准确率上显著优于现有方法, 相较于主流的DAIL方案整体性能提升了21.65%.

关键词: Text-to-SQL, 垂类大数据, 大语言模型

Abstract:

Owing to the rapid development of large language model (LLM), Text-to-SQL tasks have progressed significantly in recent years. However, applying Text-to-SQL to specialized domains such as finance, healthcare, and power engineering remains challenging owing to complex user queries and highly specialized database schemas. This paper proposes a highly reliable Text-to-SQL parsing framework named SQL4Domain, with the power industry considered as a typical application scenario. The framework first utilizes domain-specific knowledge bases to implement user-query intent recognition and key entity extraction. Subsequently, it generates structured query language (SQL) statements combined with domain knowledge prompts. Finally, it improves the accuracy and reliability of SQL statements via multi-strategic knowledge verification. Experiments on the power-industry dataset reveal that SQL4Domain significantly outperforms existing methods in terms of execution accuracy, with a performance improvement of 21.65% compared with the mainstream DAIL method.

Key words: Text-to-SQL, domain-specific big data, large language models

中图分类号: