Natural Language Query Processing with Child Table Selection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing NL2SQL process faces low speed and low accuracy due to the large quantity of fields and scale in to-be-queried data tables, affecting the efficiency and accuracy of converting natural language query statements into SQL query statements, especially in multi-table queries.

Innovation Solution

A method that narrows the range of fields by obtaining a child table with a smaller quantity of fields from the to-be-queried data table as an input for the NL2SQL model, using a child table recall model to identify candidate data tables and allowing user interaction or ranking based on correlation to determine the target data table.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If all to-be-queried data tables with large quantity of fields are used as input for NL2SQL model, then comprehensive query capability is maintained, but conversion speed and accuracy deteriorate due to large data scale

Engineering Contradiction:
Improvequery accuracyVSAvoidconversion speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the large to-be-queried data table into multiple child tables based on parent-child table relationships. The NL2SQL model processes only the relevant child tables instead of the entire large data table, reducing input complexity while maintaining query accuracy through targeted segmentation of data subsets.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts and identifies the specific child table most relevant to the natural language query from the to-be-queried data table. By taking out only the necessary child table subset that contains the required fields for the query, the system reduces input data scale while preserving the fields needed for accurate SQL generation.

Inventive Principle:
Principle #2Taking out (Extraction)

2Productivity

If the range of fields in to-be-queried data table is reduced by using child tables, then conversion efficiency improves, but query comprehensiveness may deteriorate

Engineering Contradiction:
Improveconversion efficiencyVSAvoidquery comprehensiveness
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent dynamically selects which child table to use as input for the NL2SQL model based on the specific natural language query being processed. The system adapts the input data range to match the query requirements, ensuring that the most relevant child table is selected for each query while maintaining conversion efficiency.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent incorporates a feedback mechanism where the system evaluates the relevance of child tables to the natural language query and adjusts the input selection accordingly. This feedback loop ensures that the selected child table contains the necessary fields for comprehensive query processing while maintaining efficient conversion speed.

Inventive Principle:
Principle #23Feedback

Data Source

PatentEP4682737A1Natural language query statement processing method and device
Publication Date: 2026.01.21 HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
  • EP4682737A1 patent drawingFigure 1
  • EP4682737A1 patent drawingFigure 2
  • EP4682737A1 patent drawingFigure 3

AI summary

Embodiments of this application relate to the field of artificial intelligence, and provide a natural language query statement processing method and apparatus. The method includes: obtaining a natural language query statement, where the natural language query statement is used to query a to-be-queried data table for data; inputting the natural language query statement and the to-be-queried data table into a child table recall model, to obtain at least one candidate data table; determining a target data table from the at least one candidate data table; and inputting the natural language query statement and the target data table into a natural language to structured query statement model, to obtain a structured query statement. In the foregoing method, a child table with a smaller quantity of fields is obtained, based on the natural language query statement, from the to-be-queried data table as an input of an NL2SQL model, so that a range of fields that need to be retrieved when the natural language query statement is converted into an SQL statement is narrowed, efficiency and accuracy of converting the natural language query statement into the SQL statement are improved, and efficiency and accuracy of querying for data based on a natural language are further improved.