ChatDB中NL2SQL的语法树约束解码优化方法及系统
By optimizing the syntax tree constraint decoding method of NL2SQL in ChatDB, and utilizing a fuzzy column name mapper and dynamic pruning strategy, the problem of decreased SQL generation accuracy caused by high recall rate in existing technologies is solved, and high-precision conversion is achieved in complex query scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG FULIN TECH CO LTD
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-17
AI Technical Summary
Existing technologies introduce a large amount of semantic noise when converting natural language into structured query language (SQL) in order to ensure high recall. This leads to a significant decrease in the accuracy of SQL generation in complex query scenarios. In particular, when dealing with queries containing complex logic such as nesting, the number of candidate field combinations explodes, resulting in the generation of illusory SQL with logical errors.
We adopt the syntax tree constraint decoding optimization method of NL2SQL in ChatDB, generate an initial candidate field set through a fuzzy column name mapper, and combine semantic confidence score and dynamic pruning threshold with a real-time pruning strategy to ensure high recall while improving generation accuracy.
While maintaining a high recall rate, it significantly improves the accuracy of complex SQL generation, avoids the generation of phantom SQL, ensures that the decoding process can continue under any circumstances, and enhances the system's fault tolerance and stability.
Smart Images

Figure CN122019580B_ABST