KR101097360B1 - Method for applying to format for sql - Google Patents

Method for applying to format for sql Download PDF

Info

Publication number
KR101097360B1
KR101097360B1 KR1020100060110A KR20100060110A KR101097360B1 KR 101097360 B1 KR101097360 B1 KR 101097360B1 KR 1020100060110 A KR1020100060110 A KR 1020100060110A KR 20100060110 A KR20100060110 A KR 20100060110A KR 101097360 B1 KR101097360 B1 KR 101097360B1
Authority
KR
South Korea
Prior art keywords
structured query
query
type
database
structured
Prior art date
Application number
KR1020100060110A
Other languages
Korean (ko)
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 KR1020100060110A priority Critical patent/KR101097360B1/en
Application granted granted Critical
Publication of KR101097360B1 publication Critical patent/KR101097360B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE: A method for applying a structural query in a standardized format is provided to increase readability and minimize an error of the structural query by applying many types of a structural query in the standardized format. CONSTITUTION: A coded first structural query is analyzed into a syntax(S210). The query type of a first structural query is determined(S215). A second structural query which is converted into a regulated format corresponding to the query type of the first structural query is generated(S220). The second structural query is converted corresponding to the database type(S225). The second structural query is transmitted to the database(S245). A result data which is transmitted from the database is displayed(S250).

Description

구조화 질의어를 정형화된 포맷에 적용하기 위한 방법{Method for applying to format for SQL}Method for applying to format for SQL

본 발명은 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법에 관한 것으로, 보다 자세하게는 데이터베이스에 접근하기 위한 구조화 질의어를 코딩함에 있어서, 데이터베이스의 종류에 따라 다른 형태의 구조화 질의어를 사용하고, 데이터베이스의 종류가 동일하여도 사용자에 따라 코딩 구조가 다르기 때문에 이러한 다른 구조 또는 다른 형태의 구조화 질의어를 동일한 포맷에 적용하여 상호간에 가독성을 높이고, 구조화 질의어의 오류를 줄이도록 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법에 관한 것이다.
The present invention relates to a method for applying a structured query to a formal format. More specifically, in coding a structured query for accessing a database, a structured query of a different type is used according to the type of the database, and the type of the database. Since the coding structure is different depending on the user even though the same is the same, apply the structured query to the formal format by applying the structure or the different types of structured query to the same format to increase the readability of each other and reduce the errors of the structured query. It is about a method.

구조화 질의어는 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, the structured query to improve the mutual readability and minimize the errors of the structured query by applying a structured query of various forms to the formalized format The purpose is to provide a method for application.

또한, 본 발명은 구조화 질의어의 형식이 동일하더라도 코딩을 하는 사용자에 따라 발생하는 개인차를 특정 포맷으로 일괄적으로 변경함으로써, 정형화되게 코딩을 할 수 있는 다른 목적이 있다.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단계; 상기 제 1구조화 질의어의 쿼리 유형에 대응하여 정형화된 포맷으로 변환한 제 2구조화 질의어를 생성하는 제 3단계; 상기 데이터베이스의 종류를 판단하여 상기 제 2구조화 질의어를 상기 데이터베이스 종류에 대응하여 변환하는 제 4단계; 상기 제 4단계에서 변환한 상기 제 2구조화 질의어를 상기 데이터베이스로 전송하는 제 5단계; 및 상기 데이터베이스로부터 전송된 결과 데이터를 표출하는 제 6단계를 포함하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법에 의해 달성된다.
An object of the present invention is a first step of analyzing the first structured query language coded from the user; A second step of determining a query type of the analyzed first structured query word; Generating a second structured query word converted into a formatted format corresponding to the query type of the first structured query word; Determining a type of the database and converting the second structured query word corresponding to the database type; A fifth step of transmitting the second structured query word converted in the fourth step to the database; And a sixth step of presenting the result data transmitted from the database.

따라서, 본 발명의 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법은 여러 형태의 구조화 질의어를 정형화된 포맷에 적용함에 따라 상호간의 가독성을 높이고, 구조화 질의어의 오류를 최소화하도록 하는 효과가 있다.Therefore, the method for applying the structured query word of the present invention to the standardized format has an effect of increasing the mutual readability and minimizing the error of the structured query word by applying the structured query word of various types to the standardized 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 word to a standardized format according to an embodiment of the present invention;
2 is a flowchart of a method for applying a structured query to a formatted format 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 for applying a structured query word to a formatted format 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 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 for applying a structured query to a formatted format 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 for applying a structured query word to a formatted format 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 (9)

변환 시스템을 이용한 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법에 있어서,
상기 변환 시스템의 구조화 질의부 분석부는 사용자로부터 코딩된 제 1구조화 질의어를 구분으로 분석하는 제 1단계;
분석한 상기 제 1구조화 질의어의 쿼리 유형을 상기 변환 시스템의 쿼리 유형 판단부를 통해 판단하기 위한 제 2단계;
상기 변환 시스템의 구조화 질의서 생성부를 통해 상기 제 1구조화 질의어의 쿼리 유형에 대응하여 정형화된 포맷으로 변환한 제 2구조화 질의어를 생성하는 제 3단계;
상기 변환 시스템의 구조화 질의어 판단부에 의해 데이터베이스의 종류를 판단하여 상기 제 2구조화 질의어를 상기 데이터베이스 종류에 대응하여 변환하는 제 4단계;
상기 변환 시스템의 제어부는 상기 제 4단계에서 변환한 상기 제 2구조화 질의어를 상기 데이터베이스로 전송하는 제 5단계; 및
상기 변환 시스템의 결과 데이터 추출부는 상기 데이터베이스로부터 전송된 결과 데이터를 표출하는 제 6단계
를 포함하며, 상기 제 1구조화 질의어 또는 상기 결과 데이터에 개인적인 정보가 포함되어 있을 경우, 상기 개인적인 정보를 암호화하는 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.
In the method for applying a structured query using a transform system to a formal format,
A first step of analyzing the structured query unit of the transformation system by dividing the first structured query word coded by the user;
A second step of determining a query type of the analyzed first structured query word through a query type determiner of the conversion system;
A third step of generating a second structured query word converted into a formatted format corresponding to the query type of the first structured query word through the structured query generation unit of the conversion system;
A fourth step of determining the type of database by the structured query determination unit of the conversion system and converting the second structured query word corresponding to the database type;
A fifth step of transmitting, by the control unit of the conversion system, the second structured query word converted in the fourth step to the database; And
A sixth step of outputting the result data transmitted from the database;
And if the first structured query or the result data includes personal information, encrypting the personal information.
제 1항에 있어서,
상기 제 1구조화 질의어가 하나 이상일 경우, 하나 이상의 상기 제 1구조화 질의어를 각각의 상기 제 2구조화 질의어로 생성한 후, 하나 이상의 상기 제 2구조화 질의어를 통합하여 멀티쿼리로 생성하는 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.
The method of claim 1,
When the first structured query is more than one, generating one or more of the first structured query to each of the second structured query, and then integrates one or more of the second structured query to generate a multi-query Method for applying query language to formal format.
제 2항에 있어서,
상기 멀티쿼리 중에서 상기 데이터베이스에서 처리하지 못한 상기 제 2구조화 질의어가 있을 경우, 상기 데이터베이스로부터 에러 데이터를 전송받아 출력하는 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.
The method of claim 2,
And when the second structured query is not processed in the database among the multi-queries, receiving and outputting error data from the database.
제 1항에 있어서,
상기 제 3단계는 상기 쿼리 유형에 따라 상기 제 2구조화 질의어를 생성함에 있어서, 상기 제 1구조화 질의어의 실행 형태를 판단하여 상기 실행 형태를 반영한 상기 제 2구조화 질의어를 생성하는 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.
The method of claim 1,
In the third step, when the second structured query is generated according to the query type, the second structured query is generated by determining the execution form of the first structured query and reflecting the execution form. To apply a standardized format.
제 1항에 있어서,
상기 쿼리 유형은 LIST, PAGE, INSERT, UPDATE 또는 DELETE 중 어느 하나인 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.


The method of claim 1,
And wherein the query type is any one of LIST, PAGE, INSERT, UPDATE, or DELETE.


제 5항에 있어서,
상기 제 4단계는 상기 제 1구조화 질의어의 쿼리 유형이 PAGE, INSERT, UPDATE 또는 DELETE 중 하나일 때, 실행하는 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.
6. The method of claim 5,
And wherein the fourth step is executed when the query type of the first structured query is one of PAGE, INSERT, UPDATE, or DELETE.
제 5항에 있어서,
상기 제 6단계에서 상기 제 1구조화 질의어의 쿼리 유형이 PAGE 또는 LIST일 경우에 상기 결과 데이터를 화면으로 디스플레이하는 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.
6. The method of claim 5,
And in the sixth step, when the query type of the first structured query is PAGE or LIST, displaying the result data on the screen.
제 5항에 있어서,
상기 제 6단계에서 상기 제 1구조화 질의어의 쿼리 유형이 INSERT, UPDATE 또는 DELETE 중 하나일 때, 상기 결과 데이터로 업데이트한 화면을 디스플레이하는 것을 특징으로 하는 구조화 질의어를 정형화된 포맷에 적용하기 위한 방법.
6. The method of claim 5,
And displaying a screen updated with the result data when the query type of the first structured query is one of INSERT, UPDATE, or DELETE in the sixth step.
삭제delete
KR1020100060110A 2010-06-24 2010-06-24 Method for applying to format for sql KR101097360B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100060110A KR101097360B1 (en) 2010-06-24 2010-06-24 Method for applying to format for sql

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100060110A KR101097360B1 (en) 2010-06-24 2010-06-24 Method for applying to format for sql

Publications (1)

Publication Number Publication Date
KR101097360B1 true KR101097360B1 (en) 2011-12-23

Family

ID=45506759

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100060110A KR101097360B1 (en) 2010-06-24 2010-06-24 Method for applying to format for sql

Country Status (1)

Country Link
KR (1) KR101097360B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101260436B1 (en) * 2012-10-24 2013-05-09 주식회사 소프트잼 Automatic procoessing system and method for structured query language, and computer readable recoding medium for performing it
KR20160066236A (en) * 2014-12-02 2016-06-10 주식회사 솔트룩스 Method for producing structured query based on knowledge database and apparatus for the same

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101260436B1 (en) * 2012-10-24 2013-05-09 주식회사 소프트잼 Automatic procoessing system and method for structured query language, and computer readable recoding medium for performing it
KR20160066236A (en) * 2014-12-02 2016-06-10 주식회사 솔트룩스 Method for producing structured query based on knowledge database and apparatus for the same
KR101654717B1 (en) * 2014-12-02 2016-09-06 주식회사 솔트룩스 Method for producing structured query based on knowledge database and apparatus for the same

Similar Documents

Publication Publication Date Title
CN106575166B (en) Method for processing hand input character, splitting and merging data and processing encoding and decoding
US6782505B1 (en) Method and system for generating structured data from semi-structured data sources
US20160124936A1 (en) Grammar compiling methods, semantic parsing methods, devices, computer storage media, and apparatuses
CN111177184A (en) Structured query language conversion method based on natural language and related equipment thereof
US20070242071A1 (en) Character Display System
JP7206687B2 (en) API parameter mapping
KR101119179B1 (en) System for applying to format for sql for accessing database
CN108549628B (en) Sentence-breaking device and method for stream type natural language information
KR100995861B1 (en) Module and method for searching named entity of terms from the named entity database using named entity database and mining rule merged ontology schema
CN105810189A (en) Equipment voice control method, device and system
US20170372695A1 (en) Information providing system
CN110597844B (en) Unified access method for heterogeneous database data and related equipment
CN114281968B (en) Model training and corpus generation method, device, equipment and storage medium
WO2022100067A1 (en) Method and apparatus for querying data in database, electronic device and storage medium
US8990070B2 (en) Computer-based construction of arbitrarily complex formal grammar expressions
KR101097360B1 (en) Method for applying to format for sql
CN105574019B (en) Query parameter processing method and device
CN115345152B (en) Template library updating method, report analyzing method, device, equipment and medium
KR20230015489A (en) Apparatus for managing minutes and method thereof
CN115827676A (en) SQL sub-query execution method, device, terminal equipment and medium
CN113204613B (en) Address generation method, device, equipment and storage medium
CN108614821B (en) Geological data interconnection and mutual-checking system
KR20190096159A (en) Apparatus, device and method for gernerating customised language model
JP5300576B2 (en) SEARCH DEVICE, SEARCH METHOD, AND SEARCH PROGRAM
KR101225333B1 (en) System and method using tree pattern expression for extraction information from syntactically parsed text corpora

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