Database Statement Parsing via Similarity Table Lookup

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database statement parsing methods are inefficient due to small reuse granularity and user-unfriendly variable replacement mechanisms, particularly in SQL, leading to high performance consumption and limited applicability to other languages.

Innovation Solution

A statement parsing method that performs lexical analysis and uses a statement similarity table to quickly identify and retrieve parsed data for similar database statements, reducing the need for repeated parsing and improving response speed across various database languages.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If conventional SQL parsing methods are used with small reuse granularity, then parsing accuracy is maintained, but database response speed deteriorates and performance consumption increases

Engineering Contradiction:
Improvedatabase response speedVSAvoidparsing efficiency
Core Design Contradiction:
SpeedVSProductivity

Solution Approach 1:

The patent merges multiple similar SQL statements into a single parsed result by introducing a similarity threshold mechanism. Statements that are semantically similar (within the threshold) share the same parse tree, allowing the system to combine parsing efforts across multiple statements rather than parsing each one independently, thereby improving both response speed and parsing efficiency

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent performs preliminary similarity detection and grouping of SQL statements before executing full parsing. By pre-identifying which statements are similar and can share parse results, the system avoids redundant parsing work and prepares optimized execution paths in advance, enhancing overall database response speed

Inventive Principle:
Principle #10Preliminary action

2Productivity

If variable contents are replaced with symbol '?' to reduce statement differences, then parsing speed is improved, but user-friendliness deteriorates and applicability to other languages is limited

Engineering Contradiction:
Improveparsing speedVSAvoiduser-friendliness
Core Design Contradiction:
ProductivityVSEase of operation

Solution Approach 1:

The patent changes the parameter of statement comparison from exact matching to similarity-based matching with adjustable thresholds. This allows the system to maintain high parsing speed by grouping similar statements while preserving the original variable contents and statement structures, making the system user-friendly and applicable to multiple programming languages without requiring syntax modifications

Inventive Principle:
Principle #35Parameter changes

3Productivity

If conventional SQL-specific parsing solutions are used, then SQL parsing performance is improved, but adaptability to other database languages deteriorates

Engineering Contradiction:
ImproveSQL parsing performanceVSAvoidlanguage applicability
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent creates a universal parsing framework that can handle multiple programming languages (SQL, Java, C, etc.) through a common similarity detection and parse tree sharing mechanism. The system extracts language-agnostic features and structures, allowing the same core algorithm to improve parsing performance across different languages without requiring language-specific implementations

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS10896180B2Statement parsing method for database statement
Publication Date: 2021.01.19 CHINA UNIONPAY
  • US10896180B2 patent drawing
  • US10896180B2 patent drawing

AI summary

A statement parsing method for a database statement comprises: conducting lexical analysis on a database statement inputted into a database, to obtain an inputted word sequence; looking up a statement similarity table according to the inputted word sequence to determine whether there is an existing word sequence similar to the inputted word sequence in the statement similarity table; if yes, obtaining the parsed data corresponding to the existing word sequence from the statement similarity table; otherwise, parsing the inputted word sequence to obtain parsed data corresponding thereto, and storing the inputted word sequence and the corresponding parsed data in the statement similarity table; and executing the database statement inputted to the database based on the parsed data corresponding to the existing or inputted word sequence. The method can quickly parse a database statement and is favorable for improving the response speed and the working efficiency of a database.