KR20110139959A - System for applying to format for sql for accessing database - Google Patents

System for applying to format for sql for accessing database Download PDF

Info

Publication number
KR20110139959A
KR20110139959A KR1020100060099A KR20100060099A KR20110139959A KR 20110139959 A KR20110139959 A KR 20110139959A KR 1020100060099 A KR1020100060099 A KR 1020100060099A KR 20100060099 A KR20100060099 A KR 20100060099A KR 20110139959 A KR20110139959 A KR 20110139959A
Authority
KR
South Korea
Prior art keywords
structured query
query
database
type
structured
Prior art date
Application number
KR1020100060099A
Other languages
Korean (ko)
Other versions
KR101119179B1 (en
Inventor
구중완
Original Assignee
(주)미디어포스
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by (주)미디어포스 filed Critical (주)미디어포스
Priority to KR1020100060099A priority Critical patent/KR101119179B1/en
Publication of KR20110139959A publication Critical patent/KR20110139959A/en
Application granted granted Critical
Publication of KR101119179B1 publication Critical patent/KR101119179B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2452Query translation
    • G06F16/24522Translation of natural language queries to structured queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)

Abstract

PURPOSE: A system for applying a format for a SQL for accessing a database is provided to improve the mutual readability and minimize the error of the SQL by applying various types of SQL to a standardized format. CONSTITUTION: An SQL(Structured Query Language) analyzer(110) analyzes a coded first SQL to the syntax. A query type determiner(150) determines a first SQL query type. A SQL generator(120) generates a second SQL which is converted into the standard format by corresponding to the query type of the first SQL. A SQL determiner(160) determines the type of a database and converts the second SQL by corresponding to the type of database. A controller(180) transmits the converted second SQL with a database. A result data extractor(140) displays a result data which is transmitted from the database.

Description

데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템{System for applying to format for SQL for accessing database}System for applying to format for SQL for accessing database

본 발명은 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템에 관한 것으로, 보다 자세하게는 데이터베이스에 접근하기 위한 구조화 질의어를 코딩함에 있어서, 데이터베이스의 종류에 따라 다른 형태의 구조화 질의어를 사용하고, 데이터베이스의 종류가 동일하여도 사용자에 따라 코딩 구조가 다르기 때문에 이러한 다른 구조 또는 다른 형태의 구조화 질의어를 동일한 포맷에 적용하여 상호간에 가독성을 높이고, 구조화 질의어의 오류를 줄이도록 하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템에 관한 것이다.
The present invention relates to a system for applying a structured query for accessing a database to a formalized format. More specifically, in coding a structured query for accessing a database, a structured query using a different form is used according to the type of database. Even though the types of databases are the same, the coding structure is different for each user. Therefore, by applying these different structures or different types of structured query words to the same format, the structure for accessing a database increases readability and reduces errors in structured queries. A system for applying a query word to a formal format.

구조화 질의어는 SQL(Structured Query Language)이라고도 하며, 데이터 정의어(DDL)와 데이터 조작어(DML)를 포함한 데이터베이스용 질의언어(Query Language)의 일종이다. 이는 특정한 데이터베이스 시스템에 한정되어 있지 않아 널리 사용되는 것으로, 오라클(Oracle), MSSQL, MySQL 등이 대표적으로 SQL(구조화 질의어)을 사용하는 데이터베이스이다.Structured query language, also known as SQL (Structured Query Language), is a type of query language for databases, including data definition language (DDL) and data manipulation language (DML). It is widely used because it is not limited to a specific database system, and Oracle, MSSQL, MySQL, etc. are databases that typically use SQL (Structured Query Language).

이러한 구조화 질의어를 사용하는 데이터베이스가 다양하기 때문에 동일한 질의를 하더라도 데이터베이스 마다의 코딩방법도 다르게 적용된다. 또한 동일한 데이터베이스를 이용하여도 코딩하는 사용자가 다를 경우에는 각각 다르게 코딩될 수 있다.Because there are many databases using these structured queries, even if the same query is used, coding methods for each database are applied differently. In addition, even when the same database is used, different users may be coded differently.

따라서 코딩이 다를 경우, 다른 사용자가 코딩을 해석하기에 어려움이 따르고, 오류가 발생하였을 경우 코딩 방법이 다르면 오류를 찾는데 어려움이 있다. 또한, 사용자가 사용하는 데이터베이스의 종류에 해당하는 구조화 질의어가 아닌 다른 데이터베이스의 종류에 해당하는 구조화 질의어로 코딩되어 있을 때에도 해석이나 오류를 찾는데 더 큰 어려움이 존재하는 문제점이 있다.
Therefore, when the coding is different, it is difficult for other users to interpret the coding, and when an error occurs, when the coding method is different, it is difficult to find the error. In addition, even when coded in a structured query corresponding to a type of database other than a structured query corresponding to a type of database used by a user, there is a problem in that interpretation or error is more difficult to find.

상기와 같은 종래 기술의 문제점을 해결하기 위하여 안출된 본 발명은 여러 형태의 구조화 질의어를 정형화된 포맷에 적용함에 따라 상호간의 가독성을 높이고, 구조화 질의어의 오류를 최소화하도록 하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템을 제공함에 그 목적이 있다.The present invention devised to solve the problems of the prior art as described above is a structured query for accessing a database to increase the mutual readability and minimize errors of the structured query by applying a structured query of various forms to a formal format Its purpose is to provide a system for applying to a formal format.

또한, 본 발명은 구조화 질의어의 형식이 동일하더라도 코딩을 하는 사용자에 따라 발생하는 개인차를 특정 포맷으로 일괄적으로 변경함으로써, 정형화되게 코딩을 할 수 있는 다른 목적이 있다.In addition, the present invention has another object that can be uniformly coded by collectively changing the individual differences that occur according to the coding user, even if the structured query language has the same format.

또한, 본 발명은 정형화된 포맷이 저장되어 있기 때문에 빠른 시간안에 결과물을 산출할 수 있는 또 다른 목적이 있다.
In addition, the present invention has another object that can produce a result in a short time because a formatted format is stored.

본 발명의 상기 목적은 사용자로부터 코딩된 제 1구조화 질의어를 구문으로 분석하기 위한 구조화 질의어 분석부; 분석한 상기 제 1구조화 질의어의 쿼리 유형을 판단하기 위한 쿼리 유형 판단부; 상기 쿼리 유형 판단부로부터 판단된 상기 제 1구조화 질의어의 쿼리 유형에 대응하여 정형화된 포맷으로 변환한 제 2구조화 질의어를 생성하기 위한 구조화 질의어 생성부; 상기 데이터베이스의 종류를 판단하여 상기 제 2구조화 질의어를 상기 데이터베이스 종류에 대응하여 변환하기 위한 구조화 질의어 판단부; 상기 구조화 질의어 판단부로부터 변환한 상기 제 2구조화 질의어를 상기 데이터베이스로 전송하기 위한 제어부; 및 상기 데이터베이스로부터 전송된 결과 데이터를 표출하기 위한 결과 데이터 추출부를 포함하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템에 의해 달성된다.
The above object of the present invention is a structured query analysis unit for parsing the first structured query coded from the user; A query type determination unit for determining a query type of the analyzed first structured query word; A structured query generator for generating a second structured query that is converted into a formatted format corresponding to the query type of the first structured query that is determined by the query type determiner; A structured query determination unit for determining the type of the database and converting the second structured query corresponding to the database type; A control unit for transmitting the second structured query word converted from the structured query determination unit to the database; And a structured query language for accessing a database including a result data extracting unit for expressing result data transmitted from the database in a formal format.

따라서, 본 발명의 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템은 여러 형태의 구조화 질의어를 정형화된 포맷에 적용함에 따라 상호간의 가독성을 높이고, 구조화 질의어의 오류를 최소화하도록 하는 효과가 있다.Therefore, the system applying the structured query language to the formalized format for accessing the database of the present invention has an effect of increasing the mutual readability and minimizing the error of the structured query language by applying the various types of structured query language to the formalized format. .

또한, 본 발명은 구조화 질의어의 형식이 동일하더라도 코딩을 하는 사용자에 따라 발생하는 개인차를 특정 포맷으로 일괄적으로 변경함으로써, 정형화되게 코딩을 할 수 있는 다른 효과가 있다.In addition, the present invention has another effect that can be uniformly coded by collectively changing the individual differences generated according to the coding user even in a specific format even if the structured query language has the same format.

또한, 본 발명은 정형화된 포맷이 저장되어 있기 때문에 빠른 시간안에 결과물을 산출할 수 있는 또 다른 효과가 있다.
In addition, the present invention has another effect of producing a result in a short time because a formatted format is stored.

도 1은 본 발명의 실시예에 따른 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템의 구성도,
도 2는 본 발명의 실시예에 따른 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 방법의 흐름도,
도 3은 본 발명의 실시예에 따른 구조화 질의어를 생성하는 방법에 관한 흐름도,
도 4는 본 발명의 실시예에 따른 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 방법의 실시예,
도 5는 본 발명의 실시예에 따른 멀티 쿼리를 생성하는 방법의 흐름도이다.
1 is a block diagram of a system for applying a structured query to a formal format for accessing a database according to an embodiment of the present invention;
2 is a flowchart of a method of applying a structured query to a formal format for accessing a database according to an embodiment of the present invention;
3 is a flowchart of a method of generating a structured query word according to an embodiment of the present invention;
4 is an embodiment of a method of applying a structured query to a formal format for accessing a database according to an embodiment of the present invention;
5 is a flowchart of a method of generating a multi-query according to an embodiment of the present invention.

본 명세서 및 청구범위에 사용된 용어나 단어는 통상적이거나 사전적인 의미로 한정해서 해석되어서는 아니되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념을 적절하게 정의할 수 있다는 원칙에 입각하여 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다.The terms or words used in this specification and claims are not to be construed as being limited to their ordinary or dictionary meanings, and the inventors may appropriately define the concept of terms in order to best describe their invention. It should be interpreted as meaning and concept corresponding to the technical idea of the present invention based on the principle that the present invention.

따라서, 본 명세서에 기재된 실시예와 도면에 도시된 구성은 본 발명의 가장 바람직한 일 실시예에 불과할 뿐이고 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형예들이 있을 수 있음을 이해하여야 한다.Therefore, the embodiments described in the specification and the drawings shown in the drawings are only the most preferred embodiment of the present invention and do not represent all of the technical idea of the present invention, various modifications that can be replaced at the time of the present application It should be understood that there may be equivalents and variations.

이하 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세히 설명하기로 한다. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 실시예에 따른 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템의 구성도이다. 도 1을 참조하면, 구조화 질의어(10)는 변환 시스템(100)에서 정형화된 구조화 질의어로 변환하여 데이터베이스(50)에 전송하고, 데이터베이스(50)는 구조화 질의어(10)에 대응하는 결과 데이터를 추출하여 사용자에게 제공한다.1 is a block diagram of a system for applying a structured query to a formal format for accessing a database according to an embodiment of the present invention. Referring to FIG. 1, the structured query word 10 is converted into a structured query word by the transformation system 100 and transmitted to the database 50, and the database 50 extracts result data corresponding to the structured query word 10. To the user.

구조화 질의어(10)는 사용자에 따라 코딩하는 방식이 각기 다르기 때문에 직접 코딩한 사용자가 아닌 다른 사용자가 구조화 질의어(10)를 수정 또는 삭제를 행하기 위해서는 코딩된 구조화 질의어(10)를 새롭게 분석해야 한다. 따라서 사용자에 의해 각기 다르게 코딩된 구조화 질의어(10)를 변환 시스템(100)으로 정형화된 포맷으로 변환하여 데이터베이스(50)에 전송하여 데이터를 추출한다.Since the structured query 10 is coded differently according to the user, the coded structured query 10 must be newly analyzed in order to modify or delete the structured query 10 by a user other than the user who directly codes the structured query. . Therefore, the structured query word 10 coded differently by the user is converted into a format formatted by the conversion system 100 and transmitted to the database 50 to extract data.

변환 시스템(100)은 구조화 질의어 분석부(110), 구조화 질의어 생성부(120), 암호화부(130), 결과 데이터 추출부(140), 쿼리 유형 판단부(150), 구조화 질의어 판단부(160), 멀티쿼리 생성부(170) 및 제어부(180)를 포함한다.The conversion system 100 includes a structured query analyzer 110, a structured query generator 120, an encryption unit 130, a result data extractor 140, a query type determiner 150, and a structured query determiner 160. ), The multi-query generating unit 170 and the control unit 180.

구조화 질의어 분석부(110)는 사용자에 의해 코딩된 구조화 질의어(10)를 정형화된 포맷으로 변환하기 위해 구조화 질의어를 분석하는 것으로, 특정 구문을 기준으로 분석한다. 즉, 구조화 질의어는 기본적으로 SELECT, FROM, WHERE, DELETE, UPDATE 등의 구문으로 구성되어 있으며, 이를 기준으로 구조화 질의어(10)를 분석하는 것이다.The structured query analyzer 110 analyzes the structured query in order to convert the structured query 10 coded by the user into a standardized format, and analyzes the structured query based on a specific syntax. In other words, the structured query is basically composed of the syntax of SELECT, FROM, WHERE, DELETE, UPDATE, etc., and analyzes the structured query 10 based on this.

구조화 질의어 분석부(110)로부터 분석한 구조화 질의어는 쿼리 유형 판단부(150)를 이용하여 쿼리 유형을 판단한다. 쿼리 유형은 LIST, PAGE, INSERT, UPDATE, DELETE 등으로 분류될 수 있으며, 쿼리 유형을 판단하는 것은 쿼리 유형에 따라 구조화 질의어의 정형화된 포맷 형태가 다르기 때문이다.The structured query analyzed by the structured query analyzer 110 determines a query type by using the query type determiner 150. Query types can be categorized into LIST, PAGE, INSERT, UPDATE, and DELETE, and the type of query is determined because the formalized format of structured queries differs depending on the query type.

쿼리 유형 판단부(150)를 통해 쿼리 유형이 판단되면 분석한 구조화 질의어를 구조화 질의어 생성부(120)를 통해 정형화된 포맷으로 변환한 제 2구조화 질의어로 생성한다. 변환 시스템은 쿼리 유형에 따른 구조화 질의어의 포맷을 저장하고 있다가 쿼리 유형 판단부(150)를 통해 쿼리 유형이 판단되면 변환 시스템(100) 포맷에 적용시켜 사용자로부터 입력받은 특정 구문을 Column(컬럼), Where, From 등으로 적용시켜 제 2구조화 질의어를 생성한다.When the query type is determined by the query type determiner 150, the analyzed structured query is generated by using the structured query generator 120 to convert the structured query into a standardized format. The conversion system stores the format of the structured query word according to the query type, and when the query type is determined by the query type determination unit 150, the conversion system applies the specific syntax received from the user by applying the format to the conversion system 100 column. To construct a second structured query.

변환 시스템(100)으로부터 생성한 제 2구조화 질의어는 구조화 질의어 판단부(160)에 의해 데이터베이스(50)의 종류를 판단하여 제 2구조화 질의어를 종류에 대응하도록 변환한다. 데이터베이스의 종류란 Oracle, MSSQL, MySQL 등으로 데이터베이스 업체에 따라 분류된 것으로, 이러한 데이터베이스(50) 종류에 따라 동일한 구조화 질의어라 하더라도 다르게 코딩되야 하는 경우가 있다. 이는 쿼리 유형이 PAGE, INSERT, UPDATE, DELETE일 때가 대표적이며, 쿼리 유형에 따라 제 2구조화 질의어를 변환하도록 한다.The second structured query generated by the conversion system 100 determines the type of the database 50 by the structured query determination unit 160 and converts the second structured query to correspond to the type. The types of databases are classified according to database companies such as Oracle, MSSQL, MySQL, and the like, and even if the same structured query is required depending on the type of database 50, there are cases where the codes are coded differently. This is typical when the query type is PAGE, INSERT, UPDATE, or DELETE, and allows the second structured query to be converted according to the query type.

데이터베이스(50)에 대응하도록 변환된 제 2구조화 질의어는 제어부(180)에 의해 데이터베이스(50)로 전송되며, 데이터베이스(50)는 제 2구조화 질의어에 해당하는 결과 데이터를 생성하여 변환 시스템(100)으로 전송하며, 결과 데이터 추출부(140)는 결과 데이터를 화면으로 출력하거나 결과 데이터를 적용하여 업데이트할 수도 있다.The second structured query word converted to correspond to the database 50 is transmitted to the database 50 by the controller 180, and the database 50 generates result data corresponding to the second structured query word to convert the system 100. The result data extractor 140 may output the result data to the screen or update the result data by applying the result data.

결과 데이터를 화면으로 출력하는 것은 쿼리 유형이 PAGE나 LIST일 경우에 구조화 질의어가 PAGE를 넘기라는 명령이라면 결과 데이터는 PAGE를 넘긴 화면을 나타내는 것이고, LIST일 경우에도 구조화 질의어 명령에 대응하는 LIST를 보여주는 것이다.If the query type is PAGE or LIST, if the structured query is a command to pass the page, the result data indicates the screen that has passed the page, and even if it is a LIST, it shows the LIST corresponding to the structured query command. will be.

결과 데이터를 적용하여 업데이트하는 것은 쿼리 유형이 INSERT, UPDATE, DELETE일 경우에 데이터를 삽입, 수정, 삭제를 행하는 것이기 때문에 이를 행한 결과 데이터를 적용된 화면에 출력하는 것이다.Updating by applying result data means inserting, modifying, and deleting data when the query type is INSERT, UPDATE, or DELETE. Therefore, the result data is output to the applied screen.

멀티쿼리 생성부(170)는 데이터베이스(50)에 하나 이상의 구조화 질의어를 한번에 실행할 때, 멀티쿼리를 생성하는 것으로, 각각의 구조화 질의어를 구조화 질의어 생성부(120)로 제 2구조화 질의어로 생성한 것을 멀티쿼리로 묶어서 데이터베이스(50)에 전송한다. 이때, 결과 데이터 추출부(140)는 데이터베이스(50)로부터 전송받은 결과 데이터를 출력함에 있어서, 멀티쿼리 중에서 처리를 못한 제 2구조화 질의어가 있다면 에러 데이터를 출력하며, 어떤 제 2구조화 질의어에서 에러가 발생하였는지를 제공한다. 멀티쿼리에서 하나 이상의 구조화 질의어 처리가 완료된다면 그에 대응하는 결과 데이터를 화면에 출력하거나 업데이트하도록 한다.The multi-query generating unit 170 generates a multi-query when executing one or more structured query words in the database 50 at a time. Bundled in a multi-query and sent to the database (50). At this time, the result data extractor 140 outputs error data if there is a second structured query word that has not been processed in the multi-query in outputting the result data received from the database 50, and an error is detected in any second structured query word. Provide if it occurred. If one or more structured query processing is completed in a multiquery, output or update the corresponding result data to the screen.

암호화부(130)는 구조화 질의어(10)에 포함되어 있거나 데이터베이스(50)로부터 추출한 결과 데이터에 개인적인 정보가 포함되어 있을 경우, 이를 암호화한다.The encryption unit 130 encrypts personal information when it is included in the structured query word 10 or when the result data extracted from the database 50 includes personal information.

제어부(180)는 구조화 질의어 분석부(110), 구조화 질의어 생성부(120), 암호화부(130), 결과 데이터 추출부(140), 쿼리 유형 판단부(150), 구조화 질의어 판단부(160) 및 멀티쿼리 생성부(170)을 제어한다.The controller 180 may include the structured query analyzer 110, the structured query generator 120, the encryption unit 130, the result data extractor 140, the query type determiner 150, and the structured query determiner 160. And the multi-query generating unit 170.

도 2는 본 발명의 실시예에 따른 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 방법의 흐름도이다. 도 2를 참조하면, 변환 시스템은 사용자에 의해 코딩된 제 1구조화 질의어를 수신하고(S205), 수신한 제 1구조화 질의어를 분석한다(S210). 2 is a flowchart of a method of applying a structured query to a formal format for accessing a database according to an embodiment of the present invention. Referring to FIG. 2, the transformation system receives a first structured query word coded by a user (S205) and analyzes the received first structured query word (S210).

구조화 질의어를 분석하는 것은 사용자에 의해 코딩된 구조화 질의어는 사용자마다 코딩하는 방법이 다르기 때문에 이를 분석하여 정형화하도록 하는 것으로, 특정 구문을 기준으로 분석한다. 구조화 질의어는 기본적으로 SELECT, FROM, WHERE, DELETE, UPDATE 등의 구문으로 구성되어 있으며, 이를 기준으로 구조화 질의어를 분석하는 것이다.Analyzing a structured query is to structure and structure a structured query, which is coded for each user, so that the structured query is analyzed based on a specific syntax. Structured query is basically composed of SELECT, FROM, WHERE, DELETE, UPDATE, etc., and the structured query is analyzed based on this.

제 1구조화 질의어를 특정 구문으로 분석하면, 제 1구조화 질의어의 쿼리 유형을 판단한다(S215). 쿼리 유형은 LIST, PAGE, INSERT, UPDATE, DELETE 등으로 분류될 수 있으며, 쿼리 유형을 판단하는 것은 쿼리유형에 따라 정형화되는 구조화 질의어의 정형화된 포맷 형태가 다르기 때문이다.When the first structured query is analyzed with a specific syntax, the query type of the first structured query is determined (S215). Query types can be categorized into LIST, PAGE, INSERT, UPDATE, and DELETE, and the type of query is determined because the formal format of the structured query is formalized according to the query type.

제 1구조화 질의어의 쿼리 유형이 판단되면 쿼리 유형에 따른 포맷에 제 1구조화 질의어를 적용하여 제 2구조화 질의어를 생성한다(S220). 쿼리 유형에 따른 포맷은 변환 시스템에 저장되어 있으며, 사용자로부터 입력받은 제 1구조화 질의어의 특정 구문을 Column, Where, From 등으로 적용시켜 제 2구조화 질의어를 생성한다.When the query type of the first structured query is determined, a second structured query is generated by applying the first structured query to a format according to the query type (S220). The format according to the query type is stored in the conversion system and generates a second structured query by applying a specific syntax of the first structured query received from the user to Column, Where, From, and the like.

쿼리 유형에 따라 제 2구조화 질의어가 다르게 생성되며, 제 2구조화 질의어의 실행 형태를 판단한다(S225). 실행 형태에서 대체 문자 방식이라 판단되면(S230) 대체 문자를 실제 값으로 매핑 처리하여(S235) 데이터베이스에서 실행할 수 있도록 한다. 또한, 실행 형태에서 문자열 조합 방식이라 판단되면(S240) 그에 대응하도록 제 2구조화 질의어를 변환하여 데이터베이스로 전송한다.The second structured query is generated differently according to the query type, and an execution form of the second structured query is determined (S225). If it is determined in the execution form that the substitution character method (S230) to map the substitution character to the actual value (S235) to be executed in the database. In addition, if it is determined in the execution form that the string is combined (S240), the second structured query is converted to correspond to the string and transmitted to the database.

데이터베이스는 변환 시스템에서 생성한 제 2구조화 질의어를 통해 결과 데이터를 생성하여(S245) 결과 데이터를 변환 시스템으로 전송한다(S250). The database generates result data through the second structured query word generated by the conversion system (S245) and transmits the result data to the conversion system (S250).

제 2구조화 질의어의 쿼리 유형이 PAGE나 LIST일 경우에 PAGE를 넘기라는 명령이라면 결과 데이터는 PAGE를 넘긴 화면을 나타내는 것이고, LIST일 경우에도 구조화 질의어 명령에 대응하는 LIST를 보여주는 것이다.If the query type of the second structured query is PAGE or LIST, the command to turn the page is to display the screen that has turned the page, and even the LIST shows the LIST corresponding to the structured query command.

또한, 제 2구조화 질의어의 쿼리 유형이 업데이트에 관한 INSERT, UPDATE, DELETE일 경우에 데이터를 삽입, 수정, 삭제를 행하는 것이기 때문에 이를 행한 결과 데이터를 적용된 화면에 출력하는 것이다.In addition, when the query type of the second structured query word is INSERT, UPDATE, or DELETE related to updating, data is inserted, modified, or deleted, and the result data is output to the applied screen.

도 3은 본 발명의 실시예에 따른 구조화 질의어를 생성하는 방법에 관한 흐름도이다. 도 3을 참조하면, 제 1구조화 질의어를 제 2구조화 질의어로 생성하는 것에 관한 것이다.3 is a flowchart illustrating a method of generating a structured query word according to an embodiment of the present invention. Referring to FIG. 3, the present invention relates to generating a first structured query term as a second structured query term.

제 1구조화 질의어의 쿼리 유형을 판단하고(S305), 쿼리 유형은 SELECT(S310), INSERT(S315), UPDATE(S320), DELETE(S325)으로 분류되며, SELECT(S310)는 LIST(S330), PAGE(S335)로 다시 분류된다.Determining the query type of the first structured query (S305), the query type is classified into SELECT (S310), INSERT (S315), UPDATE (S320), DELETE (S325), SELECT (S310) is LIST (S330), PAGE (S335) again.

쿼리 유형이 LIST(S330)일 경우에는 변환 시스템에 저장된 포맷에 적용하여 제 2구조화 질의어를 생성한다(S380).If the query type is LIST (S330), a second structured query is generated by applying to a format stored in the conversion system (S380).

쿼리 유형이 PAGE(S335)일 경우에는 데이터베이스의 종류를 판단하여(S340) 데이터베이스 종류에 대응하여 제 2구조화 질의어를 생성한다(S380). 데이터베이스의 종류란 Oracle, MSSQL, MySQL 등으로 나뉠 수 있으며, 이러한 데이터베이스 종류에 따라 구조화 질의어가 다르게 코딩되야 한다.If the query type is PAGE (S335), the type of database is determined (S340), and a second structured query is generated corresponding to the type of database (S380). Database types can be divided into Oracle, MSSQL, MySQL, etc., and structured queries must be coded differently according to these types of databases.

쿼리 유형이 INSERT(S315), UPDATE(S320), DELETE(S325)일 경우에도 데이터베이스의 종류를 판단하고(S345), 실행 형태를 판단한다(S350). 실행 형태가 대체 문자 형식이어야 할 경우에는(S355) 그에 대응하도록 제 2구조화 질의어를 생성한다(S280).Even when the query type is INSERT (S315), UPDATE (S320), or DELETE (S325), the type of database is determined (S345), and the execution type is determined (S350). If the execution form should be an alternative character form (S355), a second structured query is generated to correspond thereto (S280).

실행 형태가 문자열 조합 방식인 경우에는(S360) 문자열의 타입을 판단하고(S365), 타입이 문자형인지(S370) 숫자형인지(S375) 판단하여 제 2구조화 질의어를 생성한다(S380).When the execution type is a string combination method (S360), the type of the string is determined (S365), and whether the type is a character type (S370) or a numeric type (S375) to generate a second structured query word (S380).

이처럼 제 2구조화 질의어는 쿼리 유형과 실행 형태에 따라 다르게 생성되며, 각각의 조건에 대응되도록 생성한다.As such, the second structured query word is generated differently according to the query type and execution form, and generated to correspond to each condition.

도 4는 본 발명의 실시예에 따른 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 방법의 실시예이다. 도 4를 참조하면, 제 1구조화 질의어를 제 2구조화 질의어로 변환하는 과정이다.4 is an embodiment of a method of applying a structured query to a formal format for accessing a database according to an embodiment of the present invention. Referring to FIG. 4, a process of converting a first structured query into a second structured query is performed.

제 1구조화 질의어를 select(S405), From(S425), Where(S435), Order by(S445)처럼 특정 구문으로 분석하고, 변환 시스템에 저장된 포맷에 맞춰 제 2구조화 질의어를 생성한다.The first structured query is analyzed with a specific syntax such as select (S405), From (S425), Where (S435), and Order by (S445), and a second structured query is generated according to a format stored in the conversion system.

제 1구조화 질의어의 select(405)는 M4Query query = new M4Query(M4Action.LIST,ture)(410)인 제 2구조화 질의어로 변환된다. 제 1구조화 질의어를 특정 구문으로 분석할 때, 제 1구조화 질의어의 쿼리 형태를 판단하고, 제 1구조화 질의어의 쿼리 형태가 LIST임을 파악하여 M4Query query = new M4Query(M4Action.LIST,ture)(410)의 구문이 형성된 것이다.The select 405 of the first structured query is converted to a second structured query that is M4Query query = new M4Query (M4Action.LIST, ture) 410. When the first structured query is analyzed with a specific syntax, the query form of the first structured query is determined, and the query type of the first structured query is LIST, so that M4Query query = new M4Query (M4Action.LIST, ture) 410 The syntax of is formed.

M4Query query = new M4Query(M4Action.LIST,ture)(410) 중에서 M4Query query = new M4Query( ,ture)(410)은 저장되어 있는 구문이고, 'M4Action.LIST'만 제 1구조화 질의어에 따라 변경된다.M4Query query = new M4Query (M4Action.LIST, ture) (410) Among the M4Query query = new M4Query (, ture) (410) is a stored syntax, and only 'M4Action.LIST' is changed according to the first structured query.

idx, description, title, wdate(415)는 query.setColumn("idx"); query.setColumn("description"); query.setColumn("title"); query.setColumn("wdate");(S420)으로 변경되며, 이 중에서 query.setColumn(""); 는 저장되어 있는 구문이다.idx, description, title, wdate (415) is query.setColumn ("idx"); query.setColumn ("description"); query.setColumn ("title"); query.setColumn ("wdate"); changed to (S420), of which query.setColumn (""); Is the stored syntax.

또한, S440에서 query.setWhere(“idx=? And idx > ? or idx=? and title like ‘%?%’”,M4DBType.CUSTOM);은 대체 문자 방식을 이용한 것이고, 이를 매핑하기 위하여 query.setWhere(“idx<“,”1”,M4DBType.NUMBER);를 추가하는 것이며, M4DBType.NUMBER은 문자열의 타입이 숫자형이라는 것을 나타내는 것이다.Also, in S440, query.setWhere (“idx =? And idx>? Or idx =? And title like '%?%'”, M4DBType.CUSTOM); is based on the alternative character method. (“Idx <“, ”1”, M4DBType.NUMBER) ;, where M4DBType.NUMBER indicates that the type of the string is numeric.

이러한 방식으로 제 1구조화 질의어를 정형화된 제 2구조화 질의어로 생성하여 제 2구조화 질의어를 어떤 사용자가 보더라도 내용을 파악하기 쉽고, 수정하기도 쉽다.In this manner, the first structured query word is generated as a structured second structured query word, so that the content is easy to grasp and modify even when a user views the second structured query word.

도 5는 본 발명의 실시예에 따른 멀티쿼리를 생성하는 방법의 흐름도이다. 도 5를 참조하면, 하나 이상의 구조화 질의어를 데이터베이스에 전송하고자 할 때, 멀티쿼리를 생성하여 처리하도록 한다.5 is a flowchart of a method of generating a multiquery according to an embodiment of the present invention. Referring to FIG. 5, when one or more structured query terms are to be transmitted to a database, a multiquery is generated and processed.

제 1-1구조화 질의어(S510)를 분석하여(S520) 제 2-1구조화 질의어를 생성한다(S530). 제 2-1구조화 질의어를 생성하는 부분은 도 2와 같으며, 하나의 제 1구조화 질의어를 제 2구조화 질의어로 변환하는 흐름과 동일하다.The first-1 structured query (S510) is analyzed (S520) to generate the second-1 structured query (S530). A part of generating the 2-1 structured query is shown in FIG. 2, and is the same as that of converting one first structured query into a second structured query.

이렇게 생성된 제 2-1구조화 질의어, 제 2-2구조화 질의어, 제 2-n구조화 질의어를 하나의 멀티쿼리로 생성한다(S540). 이 때, 하나의 멀티쿼리로 생성할 수도 있고, 하나 이상의 멀티쿼리로 분류하여 생성할 수도 있다.The generated 2-1 structured query, the 2-2 structured query, and the 2-n structured query are generated as one multi-query (S540). In this case, one multi-query may be generated or may be generated by classifying one or more multi-queries.

생성된 멀티쿼리를 데이터베이스로 전송하여 실행하고(S550), 실행이 성공하면 데이터베이스는 결과 데이터를 추출하여 변환 시스템에 전송하고, 변환 시스템은 결과 데이터를 출력한다(S560). The generated multi-query is transmitted to the database for execution (S550). If the execution is successful, the database extracts the result data and transmits it to the conversion system, and the conversion system outputs the result data (S560).

그러나, 멀티쿼리를 데이터베이스로 전송하였는데 이 중 하나라도 에러가 발생하였을 경우에는 데이터베이스는 에러 데이터를 생성하여 변환 시스템에 전송한다(S570). 에러 데이터에는 어떠한 부분에서 에러가 발생하였는지 알려주기 때문에 에러가 발생한 부분을 바로 수정할 수 있다.However, if a multi-query is transmitted to the database and any one of the errors occurs, the database generates error data and transmits the error data to the conversion system (S570). The error data tells in which part the error occurred, so that the part where the error occurred can be corrected immediately.

본 발명은 이상에서 살펴본 바와 같이 바람직한 실시예를 들어 도시하고 설명하였으나, 상기한 실시예에 한정되지 아니하며 본 발명의 정신을 벗어나지 않는 범위 내에서 당해 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변경과 수정이 가능할 것이다.
While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is clearly understood that the same is by way of illustration and example only and is not to be taken by way of limitation, Various changes and modifications will be possible.

10 : 구조화 질의어 50 : 데이터베이스
100 : 변환 시스템 110 : 구조화 질의어 분석부
120 : 구조화 질의어 생성부 130 : 암호화부
140 : 결과 데이터 추출부 150 : 쿼리 유형 판단부
160 : 구조화 질의어 판단부 170 : 멀티쿼리 생성부
180 : 제어부
10: structured query 50: database
100: transformation system 110: structured query analysis unit
120: structured query generation unit 130: encryption unit
140: result data extraction unit 150: query type determination unit
160: structured query determination unit 170: multi-query generation unit
180:

Claims (8)

데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템에 있어서,
사용자로부터 코딩된 제 1구조화 질의어를 구문으로 분석하기 위한 구조화 질의어 분석부;
분석한 상기 제 1구조화 질의어의 쿼리 유형을 판단하기 위한 쿼리 유형 판단부;
상기 쿼리 유형 판단부로부터 판단된 상기 제 1구조화 질의어의 쿼리 유형에 대응하여 정형화된 포맷으로 변환한 제 2구조화 질의어를 생성하기 위한 구조화 질의어 생성부;
상기 데이터베이스의 종류를 판단하여 상기 제 2구조화 질의어를 상기 데이터베이스 종류에 대응하여 변환하기 위한 구조화 질의어 판단부;
상기 구조화 질의어 판단부로부터 변환한 상기 제 2구조화 질의어를 상기 데이터베이스로 전송하기 위한 제어부; 및
상기 데이터베이스로부터 전송된 결과 데이터를 표출하기 위한 결과 데이터 추출부
를 포함하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.
In a system that applies a structured query to a formal format to access a database,
A structured query analyzer for parsing the first structured query coded from a user;
A query type determination unit for determining a query type of the analyzed first structured query word;
A structured query generator for generating a second structured query that is converted into a formatted format corresponding to the query type of the first structured query that is determined by the query type determiner;
A structured query determination unit for determining the type of the database and converting the second structured query corresponding to the database type;
A control unit for transmitting the second structured query word converted from the structured query determination unit to the database; And
Result data extraction unit for expressing the result data transmitted from the database
A system for applying a structured query to a formalized format for accessing a database including a.
제 1항에 있어서,
상기 제 1구조화 질의어가 하나 이상일 경우, 하나 이상의 상기 제 1구조화 질의어를 각각의 상기 제 2구조화 질의어로 생성한 후, 하나 이상의 상기 제 2구조화 질의어를 통합하여 멀티쿼리로 생성하기 위한 멀티쿼리 생성부를 더 포함하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.
The method of claim 1,
When the first structured query is one or more, after generating one or more of the first structured query to each of the second structured query, a multi-query generating unit for generating a multi-query by integrating one or more of the second structured query A system that applies a structured query to a formal format to access a containing database.
제 2항에 있어서,
상기 멀티쿼리 생성부로부터 생성된 멀티쿼리 중에서 상기 데이터베이스에서 처리하지 못한 상기 제 2구조화 질의어가 있을 경우, 상기 데이터베이스로부터 에러 데이터를 전송받아 출력하는 것을 특징으로 하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.
The method of claim 2,
If there is the second structured query that is not processed in the database among the multi-queries generated by the multi-query generating unit, the structured query for accessing the database is output by receiving error data from the database. Applied to the system.
제 1항에 있어서,
상기 제 1구조화 질의어 또는 상기 결과 데이터에 개인적인 정보가 포함되어 있을 경우, 상기 개인적인 정보를 암호화하기 위한 암호화부를 더 포함하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.
The method of claim 1,
And when the first structured query word or the result data includes personal information, a structured query word for accessing a database further comprising an encryption unit for encrypting the personal information.
제 1항에 있어서,
상기 쿼리 유형은 LIST, PAGE, INSERT, UPDATE 또는 DELETE 중 어느 하나인 것을 특징으로 하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.
The method of claim 1,
And the query type is one of LIST, PAGE, INSERT, UPDATE or DELETE.
제 5항에 있어서,
상기 구조화 질의어 판단부는 상기 제 1구조화 질의어의 쿼리 유형이 PAGE, INSERT, UPDATE 또는 DELETE 중 하나일 때, 실행하는 것을 특징으로 하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.
6. The method of claim 5,
And the structured query determination unit executes when the query type of the first structured query is one of PAGE, INSERT, UPDATE or DELETE.
제 5항에 있어서,
상기 결과 데이터 추출부는 상기 제 1구조화 질의어의 쿼리 유형이 PAGE 또는 LIST일 경우에 상기 결과 데이터를 화면으로 디스플레이하는 것을 특징으로 하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.

6. The method of claim 5,
And the result data extracting unit displays the result data on the screen when the query type of the first structured query is PAGE or LIST.

제 5항에 있어서,
상기 결과 데이터 추출부는 상기 제 1구조화 질의어의 쿼리 유형이 INSERT, UPDATE 또는 DELETE 중 하나일 때, 상기 결과 데이터로 업데이트한 화면을 디스플레이하는 것을 특징으로 하는 데이터베이스에 접근하기 위한 구조화 질의어를 정형화 포맷에 적용하는 시스템.
6. The method of claim 5,
When the query type of the first structured query is one of INSERT, UPDATE, or DELETE, the result data extractor displays a screen updated with the result data. The structured query for accessing a database is applied to a formalized format. System.
KR1020100060099A 2010-06-24 2010-06-24 System for applying to format for sql for accessing database KR101119179B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100060099A KR101119179B1 (en) 2010-06-24 2010-06-24 System for applying to format for sql for accessing database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100060099A KR101119179B1 (en) 2010-06-24 2010-06-24 System for applying to format for sql for accessing database

Publications (2)

Publication Number Publication Date
KR20110139959A true KR20110139959A (en) 2011-12-30
KR101119179B1 KR101119179B1 (en) 2012-06-12

Family

ID=45505261

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100060099A KR101119179B1 (en) 2010-06-24 2010-06-24 System for applying to format for sql for accessing database

Country Status (1)

Country Link
KR (1) KR101119179B1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013158687A1 (en) * 2012-04-16 2013-10-24 Genesisone, Inc. Method for automated documentation of structured query language including workflow and data dependencies
KR101400214B1 (en) * 2013-01-28 2014-05-28 주식회사 알티베이스 Appratus for providing a hybrid c interface
KR20180094249A (en) * 2017-02-15 2018-08-23 주식회사 이루기술 In real time data-link method and system based on database
KR20210105699A (en) * 2020-02-19 2021-08-27 심상택 Method and system for retrieving statistics and original data in structured language from open source big data system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102113470B1 (en) * 2018-12-24 2020-05-21 포항공과대학교 산학협력단 Method and Apparatus for Determining of Equivalence Between SQL

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020033223A (en) * 2000-10-30 2002-05-06 구자홍 Coordinated manipulation method of structured query language between database management systems
KR20030013656A (en) * 2001-08-08 2003-02-15 한국전자통신연구원 Dynamic query language tuning system and method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013158687A1 (en) * 2012-04-16 2013-10-24 Genesisone, Inc. Method for automated documentation of structured query language including workflow and data dependencies
KR101400214B1 (en) * 2013-01-28 2014-05-28 주식회사 알티베이스 Appratus for providing a hybrid c interface
KR20180094249A (en) * 2017-02-15 2018-08-23 주식회사 이루기술 In real time data-link method and system based on database
KR20210105699A (en) * 2020-02-19 2021-08-27 심상택 Method and system for retrieving statistics and original data in structured language from open source big data system

Also Published As

Publication number Publication date
KR101119179B1 (en) 2012-06-12

Similar Documents

Publication Publication Date Title
CN106575166B (en) Method for processing hand input character, splitting and merging data and processing encoding and decoding
CN111177184A (en) Structured query language conversion method based on natural language and related equipment thereof
KR101119179B1 (en) System for applying to format for sql for accessing database
US20070242071A1 (en) Character Display System
TW202020691A (en) Feature word determination method and device and server
CN108549628B (en) Sentence-breaking device and method for stream type natural language information
CN101788992A (en) Method and system for converting query sentence of database
US20170372695A1 (en) Information providing system
CN114281968B (en) Model training and corpus generation method, device, equipment and storage medium
KR20220034070A (en) Model training method and apparatus, font library establishment method and apparatus, and storage medium
KR101097360B1 (en) Method for applying to format for sql
US20180068059A1 (en) Malicious sequence detection for gene synthesizers
CN115345152B (en) Template library updating method, report analyzing method, device, equipment and medium
CN105574019B (en) Query parameter processing method and device
CN113204613B (en) Address generation method, device, equipment and storage medium
US10235224B2 (en) Validation and parsing performance using subtree caching
CN108614821B (en) Geological data interconnection and mutual-checking system
JP5300576B2 (en) SEARCH DEVICE, SEARCH METHOD, AND SEARCH PROGRAM
CN114238131A (en) Code detection method and device, computer readable medium and electronic equipment
KR101225333B1 (en) System and method using tree pattern expression for extraction information from syntactically parsed text corpora
WO2020263674A1 (en) User interface commands for regular expression generation
JP6589317B2 (en) Rewriting device, processing method and program thereof, and information processing device
CN117494806B (en) Relation extraction method, system and medium based on knowledge graph and large language model
US20210109960A1 (en) Electronic apparatus and controlling method thereof
JP2001109740A (en) Device and method for preparing chinese document

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee