A double-encoder table screening and SQL generation method based on knowledge graph enhancement

By employing a dual encoder method based on knowledge graph enhancement, the problems of terminology ambiguity and synonym mapping in database table column filtering are resolved, achieving high-precision table column filtering and SQL generation, and ensuring the accuracy of query intent.

CN122152864APending Publication Date: 2026-06-05ZHEJIANG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIV OF TECH
Filing Date
2026-02-03
Publication Date
2026-06-05

Smart Images

  • Figure CN122152864A_ABST
    Figure CN122152864A_ABST
Patent Text Reader

Abstract

The application relates to a double-encoder table screening and SQL generation method based on knowledge graph enhancement. The method comprises the following steps: extracting table mode information from a target database; pre-processing and entity recognition are performed on a natural language question input by a user, and synonymous words and entity association information are supplemented by means of a knowledge graph to generate a semantic-enhanced question; a Bi-Encoder model is used to encode the semantic-enhanced question into a question semantic vector, and Top-N candidate tables are retrieved from a table-level semantic vector library; a table-column combination unit is batch-spliced and input into a model; a Cross-Encoder model containing a graph-text fusion gate layer is used to calculate table-level matching scores and column-level matching scores; Top-M core tables are screened out, a plurality of core columns are screened out from the core tables based on the column-level matching scores, and the core columns are aggregated into a target table column set; a preset template is filled based on the semantic-enhanced question, mode information and sample data of the target table column set to construct a structured Prompt, and the structured Prompt is input into a preset large language model to generate an SQL statement.
Need to check novelty before this filing date? Find Prior Art