Supercharge Your Innovation With Domain-Expert AI Agents!

A method of automatically generating sql statements from human natural language for querying data

A natural language and data query technology, applied in the fields of electronic digital data processing, digital data information retrieval, special data processing applications, etc. effect of spending

Active Publication Date: 2022-04-22
成都海天数联科技有限公司
View PDF8 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The purpose of the present invention is to address the above problems and propose a method for automatically generating sql statements in human natural language for querying data. This method does not require personnel to label data and solves the problem of unreusable systems caused by machine learning.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method of automatically generating sql statements from human natural language for querying data
  • A method of automatically generating sql statements from human natural language for querying data

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, the specific implementation manners of the present invention will now be described with reference to the accompanying drawings.

[0024] A method for automatically generating SQL statements from human natural language for querying data, the method comprising the following steps:

[0025] S1: The user inputs a natural sentence of the query data, and performs word segmentation on the natural sentence;

[0026] S2: Remove stop words from the natural sentence after word segmentation, and identify tagged nouns and negative words;

[0027] S3: Carry out regular splicing of nouns, and match with the constructed table name metadata information to obtain the corresponding table name, if it can be obtained, then enter step S4, if not, then enter step S5;

[0028] S4: Perform SQL generation processing on the natural language after word segmentation and removal of sto...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for converting human natural language of query data into sql statement. The user enters a natural sentence, performs word segmentation on the sentence and removes stop words, and then performs automatic table name analysis. If the table name can be obtained, further processing is performed on the natural language after the word segmentation and removal of stop words and the obtained table name, otherwise Feedback prompt information after fuzzy matching; after obtaining the table name, judge whether multi-table association is based on metadata information, and if yes, perform query condition processing according to association rules; otherwise, directly perform single-table query condition processing; The language performs time analysis processing, and performs query field analysis, judgment condition analysis, cascade query analysis, and query aggregation analysis processing according to metadata information; finally, query sql is generated. The present invention does not require personnel to mark data, reduces the input of human resources, reduces the expenditure of labor costs, and solves the problem that the system cannot be reused caused by machine learning.

Description

technical field [0001] The invention relates to the field of natural language processing, in particular to a method for automatically generating SQL statements from human natural language for querying data. Background technique [0002] As the country's economy develops, more and more systems are put into use, generating a large amount of data. When non-professional users want to browse data, the traditional method usually presents the data in the form of charts in advance, and cannot query and browse data freely. The current semantic-to-sql method on the market usually collects a large amount of annotation information through machine learning, and generates SQL statements through long-term learning. This intermediate process requires personnel to label a large amount of data, and when new data or a new system is connected, it is usually marked again and a long period of machine learning is carried out. There are problems such as uncontrollable training time and unreusable ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/2452G06F16/2458
CPCG06F16/24522G06F16/2468
Inventor 刘科
Owner 成都海天数联科技有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More