SQL statement generation method and device, electronic equipment and storage medium
By obtaining and constructing historical query data and table structure data, similarity matching and splicing are performed to form target propt, the problem of difficulty in injecting new business scenario knowledge in NL2SQL technology is solved, and the accuracy and efficiency of SQL statement generation is improved.
Patent Information
- Application Number
- CN202410983189.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-12
AI Technical Summary
The existing NL2SQL technology is difficult to flexibly inject new business scenario knowledge, relying on high-quality annotation data sets to consume a lot of resources and time, and it is difficult to fully cover all possible query scenarios, reducing query quality and efficiency.
By obtaining historical query data and vectorized table structure data, a historical query problem pair is constructed, and the current user query problem matches the current user query problem pair with the historical query problem pair is obtained, and the target historical query problem pair and the target table structure data are spliced into the target propt , enter a big model to generate SQL statements.
It improves the accuracy and efficiency of SQL statement generation, reduces the search space and calculation amount of the model when generating SQL statements, and improves the ability to convert natural language to SQL statements.
