Automatic Query Code Generation for Diverse Storage Units

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current data querying methods require manual writing of query codes in specific languages for different storage units, leading to low efficiency due to the need for language learning and code writing for each query, especially when dealing with diverse storage units like Hadoop and Hive.

Innovation Solution

A method and apparatus that automatically describe attribute information of a target field in a language used by a query engine, allowing the engine to obtain corresponding data without manual code writing, utilizing languages like Microsoft (M) Language, R Language, Hive Query Language (HQL), or Structured Query Language (SQL).

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If manual query code writing is used for different storage units, then data can be queried with precise control, but the operation complexity and time consumption increase significantly

Engineering Contradiction:
Improvequery precisionVSAvoidoperation complexity
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The system performs automatic language conversion and query code generation without requiring manual intervention. The conversion module automatically translates user intent into appropriate query languages (SQL, HQL, Pig Latin) based on the target storage unit type, eliminating the need for users to manually learn and write different query languages for different storage systems.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent introduces a conversion module as an intermediary between the user and the query engine. This module acts as a translator that converts user intent into language-specific query codes appropriate for different storage units, thereby simplifying the user's interaction while maintaining precise query capabilities across diverse storage systems.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If manual query code writing is used for diverse storage units, then specific storage unit requirements can be met, but the time consumption and productivity decrease

Engineering Contradiction:
Improvestorage unit adaptabilityVSAvoidquery efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The conversion module is designed to handle multiple storage unit types (relational databases, Hadoop, Hive, etc.) through a single unified interface. It automatically identifies the target storage unit type and selects the appropriate query language and conversion rules, enabling one system to serve multiple storage purposes without requiring separate manual coding for each type.

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

Solution Approach 2:

The system pre-establishes conversion rules and language mappings for different storage unit types. When a query is initiated, the conversion module quickly retrieves and applies the appropriate pre-configured rules for the target storage unit, eliminating the need for real-time analysis and manual code writing, thus significantly improving query efficiency.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If different query languages are used for different storage units, then each storage unit can be queried optimally, but the learning curve and operational difficulty increase

Engineering Contradiction:
Improvequery reliabilityVSAvoidlanguage learning requirement
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The conversion module serves as a language-agnostic intermediary that handles all language-specific complexities. Users interact with a unified interface that automatically translates their intent into the appropriate query language (SQL for relational databases, HQL for Hive, Pig Latin for Hadoop) based on the target storage unit, thereby maintaining query reliability while eliminating the need for users to learn multiple languages.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Productivity

If automatic language conversion is implemented, then query efficiency improves, but the system complexity increases

Engineering Contradiction:
Improvedata querying efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system is segmented into distinct functional modules: a user interface for receiving query intent, a conversion module for language translation, and a query engine for executing queries. The conversion module itself is further segmented into rule sets for different storage unit types. This modular segmentation manages system complexity by organizing functions into independent, manageable components with well-defined interfaces.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS9898508B2Method and device for processing information
Publication Date: 2018.02.20 BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
  • US9898508B2 patent drawing
  • US9898508B2 patent drawing
  • US9898508B2 patent drawing

AI summary

The embodiments of the present invention provide a method for processing information, comprising: obtaining attribute information about a target field; obtaining, according to the attribute information about the target field, attribute information about the target field described in a first language; and sending the attribute information about the target field described in the first language to a query engine using the first language, so that the query engine obtains, according to the attribute information about the target field described in the first language, data corresponding to the target field; and the embodiments of the present invention also provide an apparatus for processing information. According to the technical solutions provided in the embodiments of the present invention, attribute information about a target field being automatically described in a language can be realized, so as to improve the query efficiency of data.