Unlock instant, AI-driven research and patent intelligence for your innovation.

Method for automatically generating SQL statements based on dimension model

A dimensional model and dimension technology, applied in the field of automatic generation of SQL statements based on dimensional models, can solve the problems of difficult maintenance and optimization, and the generation of SQL query statements is not efficient and accurate, so as to achieve easy maintenance and optimization, improve generation efficiency and accuracy, reduce The effect of coding workload

Inactive Publication Date: 2020-12-18
SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF4 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The technical problem to be solved by the present invention is to provide a method for automatically generating SQL statements based on a dimensional model to solve the problems that the generation of a large number of complex SQL query statements is not efficient and accurate and difficult to maintain and optimize in complex OLAP scenarios

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
  • Method for automatically generating SQL statements based on dimension model
  • Method for automatically generating SQL statements based on dimension model
  • Method for automatically generating SQL statements based on dimension model

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] In order to efficiently and accurately generate complex SQL query statements in OLAP and make data analysis easier, the present invention discloses a method for automatically generating SQL statements for analytical queries based on a dimensional model. The implementation steps are as follows

[0024] 1. Build a dimensional model:

[0025] Define a dimensional model according to the estimated query scenario and the relationship between tables, corresponding to the target data table of the database.

[0026] 2. Construct the SQL syntax tree:

[0027] Build a data model and add mapping annotations. According to the dimension model, analyze and determine the select and from information in the SQL query, and generate the data model of each scene; add mapping annotations to the data model according to the table name, table field attributes, query parameters, aggregation conditions, sorting conditions, and function calculations.

[0028] According to the SQL syntax rules, c...

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 relates to the technical field of big data processing, discloses a method for automatically generating SQL (Structured Query Language) statements based on a dimension model, and is usedfor solving the problems that the generation of a large number of complex SQL query statements is not efficient and accurate enough and is not easy to maintain and optimize in an OLAP (On-Line Analysis Protocol) complex scene. The method comprises the steps of constructing a dimension model according to a pre-query scene and a database table relationship; constructing a data model according to thedimension model, adding a mapping label, and generating an SQL syntax tree in combination with an SQL syntax rule; under the dimension sets, according to a preset query scene, configuring a query condition of each dimension set, querying a master-slave relationship and a priority sequence, and generating a dimension query configuration file; traversing the SQL syntax tree based on a traversal device, filling the data model with the dimension query configuration file to generate SQL sentences, and generating SQL query sentences from the SQL syntax tree according to the master-slave relationship and the priority sequence between the SQL sentences. The invention is suitable for SQL statement generation in an OLAP scene.

Description

technical field [0001] The invention relates to the technical field of big data processing, in particular to a method for automatically generating SQL statements based on a dimension model. Background technique [0002] With the rapid development of Internet technology, the number of users and businesses of enterprise products is increasing. In the case of multiple users and high concurrency, enterprise decision makers need to collect, manage and analyze massive amounts of information more efficiently and accurately. [0003] On-line analytical processing system (Online analytical processing, referred to as OLAP) is a general method to solve the above problems. It supports the analysis and operation of a large amount of complex data and automatically generates specific reports in real time. Humans can efficiently analyze data and make decisions without assistance. The core of OLAP data analysis is data. In order to analyze data more easily, users need to define dimensional ...

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
IPC IPC(8): G06F16/242G06F16/28
CPCG06F16/2433G06F16/283
Inventor 黄禹菲
Owner SICHUAN CHANGHONG ELECTRIC CO LTD