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

Multilayer analysis method of structured query statement, computer equipment and storage medium

A technology of structured query and statement, applied in the field of information processing, can solve the problems of inability to realize data query, inconsistent SQL statement in database, etc.

Pending Publication Date: 2022-07-15
BEIJING YOYO TIANYU SYST TECH
View PDF0 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] It can be seen that when the database is configured with multiple databases that adapt to the syntax of different SQL statements, the user cannot perform operations such as data query from the above-mentioned databases that adapt to the syntax of different SQL statements through a single query statement, and the SQL statements of the database are not uniform.

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
  • Multilayer analysis method of structured query statement, computer equipment and storage medium
  • Multilayer analysis method of structured query statement, computer equipment and storage medium
  • Multilayer analysis method of structured query statement, computer equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0032] figure 2 This is a flowchart of the multi-layer parsing method for structured query statements provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of querying data in a logical database including multiple data sources, and the method can be performed by using The computer equipment can be used for database management. The computer equipment can be a server or a personal computer. The method specifically includes the following steps:

[0033] Step 110: Extract the operation table name according to the SQL statement.

[0034] The user edits the SQL statement according to the syntax of the SQL statement as required. The user can send a query request through the client to the server running the multi-layer parsing method for the structured query statement provided by the embodiment of the present invention, and the request carries the SQL statement edited by the user. After receiving the SQL statement, the server extracts the oper...

Embodiment 2

[0054] image 3 A flowchart of a method for multi-layer parsing of structured query statements provided in Embodiment 2 of the present invention, as a further description of the foregoing embodiments, includes:

[0055] Step 210: Extract the operation type according to the SQL statement.

[0056] The SQL statement can be identified, and the SQL statement extraction operation type can be identified by character matching. Exemplarily, starting from the starting string except the comment in the SQL statement, read the SQL statement in sequence, and match the read string with the preset operation type string. If the match is successful, the operation type represented by the matched operation type string is used as the operation type of the SQL statement.

[0057] Step 220: Determine whether the operation type matches the preset type.

[0058] The preset type may be an operation type included in a data manipulation language (Data Manipulation Language, DML). In the SQL statemen...

Embodiment 3

[0072] Figure 4 This is a flowchart of a method for multi-layer parsing of structured query statements provided in Embodiment 3 of the present invention. As a further description of the foregoing embodiments, this embodiment of the present invention adds a field parsing process on the basis of the foregoing embodiments, using It is used to extract the accessed table field information from the SQL statement, and perform table field permission verification. The method includes:

[0073] Step 310: Extract the operation table name according to the SQL statement.

[0074] Step 320: Read the preconfigured field permission variable.

[0075] The field permission variable is used as an environment variable when the logical database is running. It is a global variable, and the field permission variable can be dynamically configured.

[0076] The value of the field permission variable can be the first value or the second value. The first value may be "TRUE" and the second value may...

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 multi-layer analysis method of a structured query statement, computer equipment and a storage medium. The method comprises the following steps: extracting an operation table name according to an SQL statement; judging whether the query is cross-library query or not according to the name of the operation table; if the query is non-cross-library query, performing grammar conversion on the SQL statement according to the query grammar of the target data source to obtain a target SQL statement adaptive to the target data source; and if the query is cross-database query, sending the SQL statement to a query engine of the logic database. When cross-database query occurs, the SQL statement is sent to the query engine of the logic database for query, so that cross-database joint query can be performed on different data sources adapted to different SQL grammar. If the query is not cross-database query, the SQL statement can be automatically converted into the target SQL statement matched with the target data source, and unified query of the heterogeneous data storage system in which one SQL statement is matched with multiple different SQL grammar is realized.

Description

technical field [0001] Embodiments of the present invention relate to information processing technologies, and in particular, to a multi-layer parsing method, computer equipment and storage medium for structured query sentences. Background technique [0002] A database is a computer software system that stores and manages data according to a data structure. With the development of databases, the types of databases continue to increase, and there are differences in Structured Query Language (SQL) statements adapted to different types of databases. For convenience of description, the SQL statement is hereinafter referred to as an SQL statement. [0003] When the server is configured with multiple databases of different types, the client needs to use the SQL statement adapted to each database to initiate a query to the server, and the server forwards the query statement to the search engine of the corresponding database and responds with the SQL statement. [0004] It can be ...

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 Applications(China)
IPC IPC(8): G06F16/242G06F16/245G06F16/22
CPCG06F16/2433G06F16/245G06F16/2282
Inventor 姚宏宇朱朝强
Owner BEIJING YOYO TIANYU SYST TECH