KR101908556B1 - A database update system based on spreadsheet interface by finding out updated records automatically - Google Patents
A database update system based on spreadsheet interface by finding out updated records automatically Download PDFInfo
- Publication number
- KR101908556B1 KR101908556B1 KR1020170000877A KR20170000877A KR101908556B1 KR 101908556 B1 KR101908556 B1 KR 101908556B1 KR 1020170000877 A KR1020170000877 A KR 1020170000877A KR 20170000877 A KR20170000877 A KR 20170000877A KR 101908556 B1 KR101908556 B1 KR 101908556B1
- Authority
- KR
- South Korea
- Prior art keywords
- record
- data
- updated
- data set
- update
- Prior art date
Links
Images
Classifications
-
- G06F17/30345—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G06F17/246—
Abstract
본 발명은 스프레드시트의 워크시트로 가져와서 수정하면, 원본 데이터셋과 대비하여 갱신된 레코드 및 그 필드를 자동으로 추출하고, 추출된 갱신 레코드를 쿼리문으로 작성하여 데이터베이스를 갱신하는, 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 관한 것으로서, 상기 데이터베이스로부터 대상 테이블의 데이터셋을 요청하여 가져오고, 가져온 초기 데이터셋을 저장하는 데이터 요청부; 스프레드시트 인터페이스를 제공하고, 워크시트를 생성하여, 상기 데이터셋의 구조와 레코드 데이터를 상기 워크시트 상에 표시하는 워크시트 표시부; 상기 스프레드시트 인터페이스를 통한 사용자의 입력에 따라 상기 워크시트 상의 레코드셋의 레코드 데이터를 갱신하는 워크시트 갱신부; 상기 초기 데이터셋과 상기 갱신된 데이터셋을 비교하여, 갱신된 레코드를 추출하는 갱신추출부; 상기 추출된 갱신된 레코드에 대하여, 갱신된 레코드의 데이터셋 구조와 레코드 데이터를 정의하는 갱신정의부; 정의된 레코드의 데이터셋 구조를 이용하여 쿼리 템플릿을 생성해두고, 갱신된 레코드 각각에 대하여 상기 쿼리 템플릿의 매핑 변수에 해당 레코드 데이터를 매핑하여 실제 쿼리문을 생성하는 쿼리생성부; 및 생성된 쿼리문을 상기 데이터베이스에 전송하여 상기 대상 테이블을 갱신하는 DB갱신부를 포함하는 구성을 마련한다.
상기와 같은 시스템에 의하여, 사무용으로 많이 사용하는 엑셀 등 스프레드시트를 이용하여 데이터베이스를 갱신함으로써, 사용자는 쿼리문 등 데이터베이스 처리 방법에 대한 지식 없이도 직관적으로 데이터를 갱신하고 데이터베이스를 업데이트할 수 있다.
The present invention is based on a spreadsheet-based system that automatically updates extracted records and their fields in comparison with the original data set, and updates the database by creating extracted update records in a query statement, A system for automatically updating a database, comprising: a data request unit for requesting and fetching a data set of a target table from the database and storing an initial data set; A worksheet display unit that provides a spreadsheet interface, creates a worksheet and displays the structure of the data set and record data on the worksheet; A worksheet update unit for updating record data of a record set on the worksheet according to a user's input through the spreadsheet interface; An update extraction unit for comparing the initial data set with the updated data set to extract an updated record; An update definition unit for defining a data set structure and record data of the updated record for the extracted updated record; A query generating unit for generating a query template by using a data set structure of a defined record and mapping actual record data to a mapping variable of the query template for each updated record to generate an actual query statement; And a DB updating unit for transmitting the generated query statement to the database to update the target table.
With such a system, the user can update the database intuitively without updating the knowledge of the database processing method, such as the query statement, by updating the database using a spreadsheet, such as Excel, which is often used for office use.
Description
본 발명은 데이터베이스의 데이터셋을 엑셀 등 스프레드시트의 워크시트로 가져와서 수정하면, 원본 데이터셋과 대비하여 갱신된 레코드 및 그 필드를 자동으로 추출하고, 추출된 갱신 레코드를 쿼리문으로 작성하여 데이터베이스를 갱신하는, 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 관한 것이다.In the present invention, when a data set of a database is imported into a worksheet of a spreadsheet such as Excel and is modified, the updated records and their fields are automatically extracted in comparison with the original data set, the extracted updated record is created as a query, To a spreadsheet-based database automatic update system.
또한, 본 발명은 수정된 레코드별로 쿼리문을 작성하여 데이터베이스를 갱신하되, 쿼리 템플릿을 사전에 생성하고 갱신된 데이터 값만 대체하여 실제 쿼리문을 생성하는, 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 관한 것이다.The present invention also relates to a spreadsheet-based database automatic update system for creating a query statement for each modified record to update the database, generating a query template in advance, and replacing only the updated data value to generate an actual query statement.
일반적으로, 웹 상에서 데이터베이스를 갱신(update)하기 위해서는, 데이터베이스를 처리하는 웹 프로그램과 이를 지시하기 위한 쿼리문이 필요하다. 즉, 데이터베이스 관리 시스템에서 SQL 수준에 의하여 갱신 연산이 수행된다[특허문헌 1].Generally, in order to update a database on the Web, a web program for processing the database and a query statement for instructing it are needed. That is, the update operation is performed by the SQL level in the database management system [Patent Document 1].
구체적으로, 데이터베이스에 특정 테이블에 기록된 데이터를 입력하거나, 수정 또는 삭제하기 위해서는, JSP(JavaServer Pages), ASP(Active Server Pages), PHP(Hypertext Preprocessor) 등 서버 측 웹 프로그램을 통해 갱신된다. 구체적으로, 상기 서버 측 웹 프로그램은 데이터베이스와 연결하고, 대상 테이블의 데이터를 처리하기 위한 SQL문 등 쿼리문을 작성해야 한다. 작성된 쿼리문을 데이터베이스에 전송하고, 해당 쿼리를 처리하도록 요청하면, 데이터베이스는 수신한 해당 쿼리를 처리함으로써, 데이터베이스 내의 테이블들이 갱신된다.Specifically, in order to input, modify, or delete data recorded in a specific table in the database, it is updated through a server-side web program such as JavaServer Pages (JSP), Active Server Pages (ASP), or Hypertext Preprocessor (PHP). Specifically, the server-side Web program must connect to a database and create a query statement such as an SQL statement for processing data of the target table. If you send the created query statement to the database and request to process the query, the database processes the received query to update the tables in the database.
따라서 상기와 같은 웹 프로그램이 데이터베이스의 쿼리문을 처리하기 위하여, 각각의 테이블 또는 해당 항목별 웹 화면을 구성해야 한다. 또한, 대상 테이블의 개수만큼 입력 화면을 별도로 개발해야 하는 문제점이 있다. 따라서 각각의 쿼리문도 개발자가 직접 작성하여야 하므로, 시간과 공수가 많이 소요되는 문제점이 있다. 또한 만들어진 화면에서도 단건 데이터 또는 소량의 데이터만 핸들링이 가능하고, 대량 데이터 처리에는 불편함과 처리에 많은 시간이 소요된다.Therefore, in order for the web program to process the query of the database, the web screen for each table or item should be configured. In addition, there is a problem that an input screen must be separately developed for the number of target tables. Therefore, each query must be written by the developer himself, so that it takes a lot of time and lots of work. In addition, it is possible to handle only single data or a small amount of data in the created screen, and it is inconvenient for mass data processing and it takes much time to process.
이를 위해, 데이터베이스를 보다 효과적으로 수정하기 위하여, 네트워크 기반에서 원격 데이터베이스를 로컬에서 수정하는 다양한 기술들이 제시되고 있다. 일례로서, 사용자 장치 상에서 다차원 데이터베이스의 일부를 캐싱하고 수정하여, 이를 다차원 데이터베이스에 반영하여, 데이터베이스를 수정하는 기술이 제시되고 있다[특허문헌 2]. 또한, 주기적인 업데이트를 샌드파일 등 특정 파일 포맷을 이용하여 업데이트하는 기술이 제시되고 있다[특허문헌 3]. 또한, 부분 데이터베이스에서 서브셋 데이터베이스의 갱신을 처리하는 기술이 제시되고 있다[특허문헌 4].To this end, various techniques for locally modifying a remote database on a network basis have been proposed to more effectively modify the database. As an example, a technology for modifying a database by caching and modifying a part of a multidimensional database on a user device and reflecting the same on a multidimensional database has been proposed (Patent Document 2). In addition, a technique of updating a periodic update using a specific file format such as a sand file has been proposed (Patent Document 3). Further, a technology for processing update of a subset database in a partial database is proposed (Patent Document 4).
그러나 상기 선행기술들은 모두 데이터베이스의 일부인 또 다른 데이터베이스를 수정하여, 이를 모 데이터베이스에 반영하는 기술이다. 따라서 로컬에서도 데이터베이스를 구성하고 처리해야 하는 문제점이 있다. 즉, 로컬 사용자는 데이터베이스를 다룰 수 있는 지식을 갖추어야 하는 문제점이 있다.However, all of the above prior arts are techniques for modifying another database, which is a part of the database, and reflecting it in the parent database. Therefore, there is a problem in that a database must be configured and processed locally. That is, the local user has to have knowledge to deal with the database.
또한, 대량의 데이터를 데이터베이스에 통합시키기 위한 기술도 제시되고 있다[특허문헌 5]. 즉, 데이터 집합을 변환 데이터로 변환하는 다수의 연속된 작업을 포함하는 처리열을 수행하여, 변환 데이터를 기준으로 데이터베이스를 변경하는 기술이다. 그러나 상기 선행기술은 새로 추가되는 데이터를 특정한 포맷으로 설정한 후에 이들 데이터들을 원래 데이터베이스로 변환하여 저장하는 기술이다. 따라서 일반 사용자가 대량의 데이터를 특정 포맷으로 구성하여야 하고, 이를 직관적으로 처리할 수 없다는 문제점이 있다.In addition, a technique for integrating a large amount of data into a database has been proposed [Patent Document 5]. That is, it is a technique of performing a processing sequence including a plurality of consecutive jobs for converting a data set into converted data, and changing the database based on the converted data. However, the prior art is a technique of converting new data to a specific format and then converting the data into an original database and storing the original data. Therefore, there is a problem that a general user must configure a large amount of data in a specific format and can not process the data intuitively.
본 발명의 목적은 상술한 바와 같은 문제점을 해결하기 위한 것으로, 데이터베이스의 데이터셋을 엑셀 등 스프레드시트의 워크시트로 가져와서 수정하면, 원본 데이터셋과 대비하여 갱신된 레코드 및 그 필드를 자동으로 추출하고, 추출된 갱신 레코드를 쿼리문으로 작성하여 데이터베이스를 갱신하는, 스프레드시트 기반 데이터베이스 자동 갱신 시스템을 제공하는 것이다.An object of the present invention is to solve the above-mentioned problems, and it is an object of the present invention to extract a data set of a database as a worksheet of a spreadsheet such as an Excel, And automatically updates the database by writing the extracted update record into a query statement.
또한, 본 발명의 목적은 수정된 레코드별로 쿼리문을 작성하여 데이터베이스를 갱신하되, 쿼리 템플릿을 사전에 생성하고 갱신된 데이터 값만 대체하여 실제 쿼리문을 생성하는, 스프레드시트 기반 데이터베이스 자동 갱신 시스템을 제공하는 것이다.It is another object of the present invention to provide a spreadsheet-based database automatic update system for creating a query statement for each modified record to update the database, generating a query template in advance and replacing only the updated data value .
상기 목적을 달성하기 위해, 본 발명은 데이터베이스와 네트워크로 연결되는, 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 관한 것으로서, 상기 데이터베이스로부터 대상 테이블의 데이터셋을 요청하여 가져오고, 가져온 초기 데이터셋을 저장하는 데이터 요청부; 스프레드시트 인터페이스를 제공하고, 워크시트를 생성하여, 상기 데이터셋의 구조와 레코드 데이터를 상기 워크시트 상에 표시하는 워크시트 표시부; 상기 스프레드시트 인터페이스를 통한 사용자의 입력에 따라 상기 워크시트 상의 레코드셋의 레코드 데이터를 갱신하는 워크시트 갱신부; 상기 초기 데이터셋과 상기 갱신된 데이터셋을 비교하여, 갱신된 레코드를 추출하는 갱신추출부; 상기 추출된 갱신된 레코드에 대하여, 갱신된 레코드의 데이터셋 구조와 레코드 데이터를 정의하는 갱신정의부; 정의된 레코드의 데이터셋 구조를 이용하여 쿼리 템플릿을 생성해두고, 갱신된 레코드 각각에 대하여 상기 쿼리 템플릿의 매핑 변수에 해당 레코드 데이터를 매핑하여 실제 쿼리문을 생성하는 쿼리생성부; 및 생성된 쿼리문을 상기 데이터베이스에 전송하여 상기 대상 테이블을 갱신하는 DB갱신부를 포함하는 것을 특징으로 한다.In order to accomplish the above object, the present invention provides a spreadsheet-based automatic database update system connected to a database, comprising: requesting and fetching a data set of a target table from the database; Request part; A worksheet display unit that provides a spreadsheet interface, creates a worksheet and displays the structure of the data set and record data on the worksheet; A worksheet update unit for updating record data of a record set on the worksheet according to a user's input through the spreadsheet interface; An update extraction unit for comparing the initial data set with the updated data set to extract an updated record; An update definition unit for defining a data set structure and record data of the updated record for the extracted updated record; A query generating unit for generating a query template by using a data set structure of a defined record and mapping actual record data to a mapping variable of the query template for each updated record to generate an actual query statement; And a DB updating unit for transmitting the created query statement to the database to update the target table.
또한, 본 발명은 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 있어서, 상기 갱신추출부는 상기 초기 데이터셋 및, 상기 갱신된 데이터셋을 각각 키(key) 필드를 이용하여 정렬을 수행하고, 상기 초기 데이터셋과 상기 갱신된 데이터셋의 각각의 레코드들을 순차적으로 대비하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a system for automatically updating a spreadsheet-based database, wherein the update extracting unit performs sorting of the initial data set and the updated data set using a key field, And sequentially comparing each of the records of the updated data set.
또한, 본 발명은 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 있어서, 상기 갱신추출부는, 대비하는 현재 레코드들 간의 키 값을 대비하여, 키 값이 동일하면, 현재 레코드들의 각각 필드값을 대비하여 수정여부를 판단하고, 초기 데이터셋의 현재 레코드가 갱신된 레코드셋의 현재 레코드 보다 앞서면 상기 초기 데이터셋의 현재 레코드가 삭제된 것으로 판단하고, 갱신된 데이터셋의 현재 레코드가 초기 레코드셋의 현재 레코드 보다 앞서면 상기 갱신된 데이터셋의 현재 레코드가 삽입된 것으로 판단하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a system for automatically updating a spreadsheet-based database, wherein the update extractor compares key values between current records to be compared, and if the key values are the same, If the current record of the initial data set is earlier than the current record of the updated record set, then it is determined that the current record of the initial data set has been deleted. If the current record of the updated data set is ahead of the current record of the initial record set, And determines that the current record of the updated data set has been inserted.
또한, 본 발명은 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 있어서, 상기 갱신추출부는 대비하는 현재 레코드들 간의 키 값이 동일하고 어느 하나의 현재 레코드가 마지막 레코드이면, 나머지 레코드들이 있는지 확인하여 남아있는 갱신된 레코드셋의 레코드들은 삽입된 것으로, 남아있는 초기 데이터셋의 레코드들은 삭제된 것으로 판단하고,According to another aspect of the present invention, there is provided a system for automatically updating a spreadsheet-based database, wherein the update extractor checks whether there is any remaining record if the current value of the current records to be compared is the same and the current record is the last record, The records of the recordset are inserted, the records of the initial data set remaining are determined to be deleted,
초기 데이터셋의 현재 레코드가 갱신된 레코드셋의 현재 레코드 보다 앞서고 초기 데이터셋의 현재 레코드가 마지막 레코드이면, 갱신된 데이터셋의 현재 레코드 및, 나머지 레코드들은 삽입된 것으로 판단하고,If the current record of the initial dataset is ahead of the current record of the updated record set and the current record of the initial dataset is the last record, it is determined that the current record and the remaining records of the updated dataset have been inserted,
갱신된 데이터셋의 현재 레코드가 초기 레코드셋의 현재 레코드 보다 앞서고 갱신된 데이터셋의 현재 레코드가 마지막 레코드이면, 초기 데이터셋의 현재 레코드 및, 나머지 레코드들은 삭제된 것으로 판단하는 것을 특징으로 한다.If the current record of the updated dataset is ahead of the current record of the initial record set and the current record of the updated dataset is the last record, it is determined that the current record and the remaining records of the initial dataset have been deleted.
또한, 본 발명은 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 있어서, 상기 쿼리생성부는 상기 갱신된 레코드를 스트림으로 수신하고, 스트림으로 수신된 순서대로, 각 갱신할 레코드의 내용을 쿼리문으로 실시간으로 생성하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a system for automatically updating a spreadsheet-based database, wherein the query generator receives the updated record as a stream and generates contents of each record to be updated in real- .
또한, 본 발명은 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 있어서, 상기 갱신추출부는 레코드셋의 전체 필드 중에서 어느 레코드에서라도 적어도 1회 수정이 있는 필드들을 수정된 필드들의 집합으로 구성하고, 상기 갱신정의부는 수정된 레코드에 대하여 상기 수정된 필드들의 집합 내의 필드에 대응되는 필드값만을 표시하여 수정할 데이터를 생성하고, 상기 쿼리생성부는 수정된 쿼리의 템플릿을 생성할 때 키 필드와, 상기 수정된 필드들의 집합 내의 필드들만으로 구성하여 쿼리 템플릿을 생성하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a system for automatically updating a spreadsheet-based database, wherein the update extractor comprises fields having at least one modification in at least one of all fields of a recordset, And generating the data to be modified by displaying only the field values corresponding to the fields in the set of the modified fields with respect to the record, wherein the query generator generates a key field when generating a template of the modified query, Fields, and generates a query template.
또한, 본 발명은 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 있어서, 상기 쿼리생성부는 삭제 쿼리 템플릿을 키 필드만으로 생성하고, 입력 쿼리 템플릿에는 레코드셋 구조의 전체 필드를 이용하여 생성하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a system for automatically updating a spreadsheet-based database, wherein the query generator generates a delete query template using only a key field and generates an input query template using all fields of a record set structure.
상술한 바와 같이, 본 발명에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 의하면, 사무용으로 많이 사용하는 엑셀 등 스프레드시트를 이용하여 데이터베이스를 갱신함으로써, 사용자는 쿼리문 등 데이터베이스 처리 방법에 대한 지식 없이도 직관적으로 데이터를 갱신하고 데이터베이스를 업데이트할 수 있는 효과가 얻어진다.As described above, according to the spreadsheet-based database automatic update system according to the present invention, by updating the database using a spreadsheet such as Excel, which is often used for office work, the user can intuitively The effect of being able to update the data and update the database is obtained.
또한, 본 발명에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 의하면, 갱신할 쿼리 템플릿을 생성한 후, 각 레코드별 데이터 값만 대체하여 실제 쿼리문을 생성함으로써, 갱신된 데이터를 스트림 형태로 수신하여 실시간으로 쿼리문을 생성할 수 있고, 이를 통해 빠른 시간 내에 쿼리문을 생성하고 처리할 수 있는 효과가 얻어진다.In addition, according to the spreadsheet-based database automatic update system of the present invention, after generating a query template to be updated, the actual query statement is generated by replacing only the data value of each record, thereby receiving updated data in a stream form, The query statement can be generated, and the effect of generating and processing the query statement in a short time can be obtained.
또한, 본 발명에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템에 의하면, 사용자는 손쉽게 빠르게 대량의 데이터를 처리 가능함으로써, 자신이 원하는 데이터 분석 보고서를 작성하고 분석하여, 경영계획, 시뮬레이션, 파일럿개발 시 테스트 가공 등 여러 분야에 활용할 수 있는 효과가 얻어진다.In addition, according to the spreadsheet-based database automatic update system of the present invention, a user can easily process a large amount of data, thereby creating and analyzing a data analysis report desired by him / And the like.
도 1은 본 발명에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템을 실시하기 위한 전체 시스템의 구성에 대한 블록도.
도 2는 본 발명에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템을 실시하기 위한 전체 시스템에 대한 구성도.
도 3은 본 발명의 제1 실시예에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템의 구성에 대한 블록도.
도 4은 본 발명의 제1 실시예에 따른 목적 데이터베이스의 대상 테이블을 선정하는 화면의 일례.
도 5는 본 발명의 제1 실시예에 따른 워크시트 상에 테이블의 스키마를 표시한 화면의 일례.
도 6는 본 발명의 제1 실시예에 따른 워크시트 상에 테이블의 데이터를 표시한 화면의 일례.
도 7은 본 발명의 제1 실시예에 따른 워크시트 상에 테이블의 데이터가 갱신된 상태를 표시한 화면의 일례.
도 8은 본 발명의 제1 실시예에 따라 초기 데이터셋과 갱신된 데이터셋을 비교하여 갱신된 레코드를 추출하는 방법을 설명하는 흐름도.
도 9는 본 발명의 제1 실시예에 따라 XML로 표시된 테이블 정보의 일례.
도 10은 본 발명의 제1 실시예에 따라 갱신할 데이터들을 정의한 플랫 파일의 일례.
도 11은 본 발명의 제1 실시예에 따른 쿼리 템플릿의 일례.
도 12은 본 발명의 제2 실시예에 따른 워크시트 상에 테이블의 데이터가 갱신된 상태를 표시한 화면의 일례.
도 13는 본 발명의 제2 실시예에 따라 XML로 표시된 테이블 정보의 일례.
도 14은 본 발명의 제2 실시예에 따라 갱신할 데이터들을 정의한 플랫 파일의 일례.
도 15는 본 발명의 제2 실시예에 따른 쿼리 템플릿의 일례.
도 16는 본 발명의 제2 실시예에 따라 작성된 실제 쿼리에 대한 예시도.1 is a block diagram of an overall system configuration for implementing a spreadsheet-based database automatic update system in accordance with the present invention;
2 is a block diagram of an overall system for implementing a spreadsheet-based database automatic update system in accordance with the present invention;
3 is a block diagram of a configuration of a spreadsheet-based database automatic update system according to a first embodiment of the present invention;
4 is an example of a screen for selecting a target table of an object database according to the first embodiment of the present invention;
5 is an example of a screen displaying a schema of a table on a worksheet according to the first embodiment of the present invention;
6 is an example of a screen in which data of a table is displayed on a worksheet according to the first embodiment of the present invention;
7 is an example of a screen displaying a state in which data of a table is updated on a worksheet according to the first embodiment of the present invention;
FIG. 8 is a flowchart illustrating a method of comparing an initial data set and an updated data set to extract an updated record according to the first embodiment of the present invention; FIG.
9 is an example of table information shown in XML according to the first embodiment of the present invention.
10 is an example of a flat file that defines data to be updated according to the first embodiment of the present invention.
11 is an example of a query template according to the first embodiment of the present invention.
12 is an example of a screen displaying a state in which data of a table is updated on a worksheet according to the second embodiment of the present invention;
13 is an example of table information displayed in XML according to the second embodiment of the present invention;
14 is an example of a flat file that defines data to be updated according to the second embodiment of the present invention.
15 is an example of a query template according to the second embodiment of the present invention.
Figure 16 is an exemplary view of an actual query created in accordance with a second embodiment of the present invention;
이하, 본 발명의 실시를 위한 구체적인 내용을 도면에 따라서 설명한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail with reference to the drawings.
또한, 본 발명을 설명하는데 있어서 동일 부분은 동일 부호를 붙이고, 그 반복 설명은 생략한다.In the description of the present invention, the same parts are denoted by the same reference numerals, and repetitive description thereof will be omitted.
먼저, 본 발명에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템을을 실시하기 위한 전체 시스템을 도 1을 참조하여 설명한다.First, an overall system for implementing a spreadsheet-based database automatic update system according to the present invention will be described with reference to FIG.
도 1에서 보는 바와 같이, 본 발명을 실시하기 위한 전체 시스템은 사용자 단말(10)에 설치되는 클라이언트(20), 클라이언트(20)와 네트워크로 연결되는 갱신서버(30), 및 데이터를 저장하고 관리하는 데이터베이스(40)로 구성된다. 도 2는 도의 전체 시스템을 그림으로 도시한 구성도이다. 도 2의 기재된 "사용자"가 사용자 단말(10) 내의 구성으로 클라이언트(20)에 의해 구동되는 구성을 표시하고 있다.1, the overall system for implementing the present invention includes a
클라이언트(20)는 사용자 단말(10)에 설치되는 클라이언트용 프로그램 시스템으로서, 웹브라우저를 통해 사용자 인터페이스를 갖는다. 즉, 사용자는 웹브라우저 또는 웹브라우저와 같은 화면의 인터페이스를 통해, 온라인상으로 데이터 갱신 등 처리 작업을 수행한다. 이때, 사용자 단말(10)은 사용자의 명령 등을 입력받아 해당 명령을 수행하고, 처리 결과를 화면 상 또는 웹브라우저 상에 표시한다.The
한편, 사용자 단말(10)은 개인용 컴퓨터(PC), 노트북, 태블릿PC, 패블릿, PDA, 스마트폰 등 컴퓨팅 기능을 가지는 컴퓨터 단말이다. 사용자 단말(10)과 갱신 서버(30)는 네트워크로 연결되어, 사용자 단말(10) 상의 클라이언트(20)는 온라인 상으로 데이터 처리 작업을 수행할 수 있다.Meanwhile, the
또한, 클라이언트(20)는 데이터 요청, 데이터 갱신 등 온라인 상으로 처리하는 작업을 갱신 서버(30)에 요청하고, 그 결과를 서버(30)로부터 가져와서 웹브라우저 상에 표시한다. 또는 처리된 데이터를 갱신 서버(30)로 전송한다. 특히, 클라이언트(20)는 데이터베이스(40)로부터 가져온 데이터를 엑셀(마이크로소프트 사의 스프레드시트 소프트웨어 상표임), 로터스(Lotus 1-2-3, 로터스 소프트웨어 사의 프로그램 상표), 한셀(한글과컴퓨터 사의 프로그램 상표) 등 스프레드시트 프로그램의 인터페이스를 통해 보여주거나 명령/데이터를 입력받는다. 또한, 클라이언트(20)는 스프레드시트 인터페이스를 통해 처리된 데이터의 갱신 결과를 갱신 서버(30)로 전송한다.In addition, the
다음으로, 갱신 서버(30)는 데이터베이스(40)로부터 데이터셋을 가져와서 클라이언트(20)로 전송하거나, 클라이언트(20)로부터 갱신된 데이터셋을 회신하여 데이터베이스(40)를 갱신한다. 특히, 갱신 서버(30)는 클라이언트(20)에서 새로 추가되거나 삭제되거나, 수정된 데이터를 검출하여, 변경된 데이터를 처리하기 위한 데이터베이스 쿼리문을 자동으로 작성한다. 갱신 서버(30)는 작성된 쿼리문을 데이터베이스(40)로 요청하여, 그 결과가 데이터베이스(40)에 반영되도록 요청한다.Next, the
한편, 앞서 설명한 클라이언트(20)와 갱신 서버(30)의 기능은 일례이고, 서버와 클라이언트의 구현 기술에 따라 다양하게 구현될 수 있다. 즉, 클라이언트(20)와 갱신 서버(30)는 하나의 갱신 시스템으로서, 그 기능들이 성능에 따라 서로 분배될 수 있다.Meanwhile, the functions of the
다른 예로서, 클라이언트(20)는 단순히 웹브라우저 기능만 가지고 있고, 모든 기능은 갱신 서버(30)에서 구축될 수 있다. 즉, 갱신 서버(30)는 데이터베이스(40)의 인터페이스 기능, 및, 수정된 데이터에 대한 쿼리문 작성 기능 뿐만 아니라, 스프레드시트 기반의 인터페이스를 통해 데이터를 수정하는 기능을 모두 가질 수 있다.As another example, the
또 다른 예로서, 갱신 서버(30)는 단순히 데이터베이스(40)와의 인터페이스 기능만을 가지고 있고, 클라이언트(20)에서 스프레드시트 기반의 인터페이스를 통해 데이터 수정 기능 뿐만 아니라, 수정된 데이터에 대한 쿼리문 자동 생성 기능까지 구비될 수 있다.As another example, the
또 다른 예로서, 갱신 서버(30) 없이, 클라이언트(20)가 바로 데이터베이스(40)에 접속하여, 앞서 설명한 데이터베이스 접속, 스프레드시트 인터페이스를 통한 데이터 수정 기능, 및, 쿼리문 자동 생성 기능 등을 모두 구비할 수 있다.As another example, without the
다음으로, 데이터베이스(60)는 데이터를 저장하기 위한 통상의 데이터베이스(DB)로서, 데이터를 관리하기 위한 DBMS를 구비하고, 데이터의 저장, 삭제, 검색 등의 작업들을 쿼리를 통해 수행한다. 특히, 데이터베이스(40)는 상용화된 데이터베이스로서, 데이터셋을 처리하기 위한 일반적인 쿼리 기능을 이용하여, 데이터 쿼리 서비스를 수행한다.Next, the
특히, 데이터베이스(40)는 빅데이터를 저장하는 데이터베이스이다. 또한, 바람직하게는, 데이터베이스(40)는 관계형 데이터베이스(RDB)로 구성된다.In particular, the
이하의 설명에서, 데이터셋의 수정, 삭제, 삽입 등 전체 데이터셋을 변경하는 작업을 "갱신"하는 작업으로 표현한다. 즉, 갱신 작업은 수정, 삭제, 삽입을 모두 포함하는 개념으로 사용한다. 즉, 수정은 레코드 중 일부 필드 값을 변경하는 것을 말하고, 갱신은 레코드를 수정, 삭제, 삽입 등 변경하는 작업을 말한다. 의미 차이가 크지 않는 경우에는 "수정" 용어을 "갱신" 용어와 혼용한다.In the following description, the operation of changing the entire data set such as modification, deletion, insertion of the data set is expressed as a task of "updating". In other words, the update operation is used as a concept including modification, deletion, and insertion. That is, modification refers to changing the values of some fields in a record, and updating means modification, deletion, insertion, etc. of a record. In the case where the meaning difference is not large, the term "correction" is used in combination with the term "update".
다음으로, 본 발명의 제1 실시예에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템을 도 3을 참조하여 보다 구체적으로 설명한다. 앞서 설명한 바와 같이, 데이터베이스 자동 갱신 시스템은 사용자 단말(10)의 클라이언트(20)와, 네트워크에 연결된 서버(30)로 구현되는 서버-클라이언트 시스템이다. 그러나 이하에서는 서버(30)에서 구현되는 시스템으로 설명한다.Next, a spreadsheet-based database automatic update system according to a first embodiment of the present invention will be described in more detail with reference to FIG. As described above, the automatic database update system is a server-client system implemented by the
도 3에서 보는 바와 같이, 본 발명의 일실시예에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템(30)은 데이터베이스의 데이터셋을 요청하는 데이터 요청부(31), 요청한 데이터셋을 스프레드시트 인터페이스에 표시하는 워크시트 표시부(32), 워크시트 상에서 데이터셋 중 일부 데이터를 갱신하는 워크시트 갱신부(33), 원본 데이터셋과 갱신된 데이터셋을 비교하여 갱신내용을 자동으로 추출하는 갱신추출부(34), 추출된 갱신 데이터에 대하여 갱신내용을 정의하는 갱신정의부(35), 갱신된 데이터를 갱신하기 위한 쿼리문을 생성하는 쿼리생성부(36), 및, 생성된 쿼리문으로 데이터베이스를 갱신하는 DB갱신부(37)로 구성된다. 또한, 처리하는 데이터를 일시적으로 저장하는 저장부(38)를 더 포함하여 구성된다.3, a spreadsheet-based database
먼저, 데이터 요청부(31)는 데이터베이스(40)에 요청하여 목적 데이터베이스로부터 데이터셋을 가져온다. 데이터셋이란 동일한 필드들로 구성되는 다수의 레코드들로 구성되는 데이터들의 집합을 의미한다. 즉, 하나의 레코드는 다수의 필드값으로 구성되는데, 모든 레코드의 필드(컬럼)는 동일한 필드(또는 컬럼)를 갖는다.First, the
바람직하게는, 데이터셋은 하나의 DB 테이블로부터 가져온 데이터들이다.Preferably, the dataset is data from one DB table.
구체적으로, 데이터 요청부(31)는 데이터베이스(40)에 요청하여, 목적 데이터베이스의 테이블 리스트를 조회하고, 조회된 테이블 리스트를 화면에 표시한다. 사용자는 화면에서 표시된 테이블 리스트 중에서 자신이 원하는 테이블을 선택할 수 있다. 도 4는 테이블 리스트 중에서 가져올 테이블을 선택하는 화면의 일례를 도시하고 있다.Specifically, the
사용자 화면에 표시된 테이블 중 하나가 선택되면, 해당 테이블에 대한 스키마(schema) 정보를 가져온다. 목적 데이터베이스 또는 대상 테이블의 스키마(schema)는 테이블의 데이터가 어떻게 구성되어 있는지에 대한 세부 정보이다. 즉, 스키마(schema)에는 각 데이터 필드의 이름, 표시명, 데이터의 타입(종류), 조건 등을 테이블 데이터의 구조를 나타낸다. 상기와 같이 가져온 데이터들은 하나의 데이터셋을 형성한다.When one of the tables displayed on the user screen is selected, schema information for the corresponding table is retrieved. The schema of the destination database or target table is a detailed description of how the data in the table is organized. That is, the schema indicates the structure of the table data such as the name of each data field, the display name, the type (kind) of the data, and the condition. The data thus obtained forms a data set.
다른 일례로서, 데이터 요청부(31)는 목적 데이터베이스의 테이블 데이터를 쿼리문을 통해 가져올 수 있다. 바람직하게는, 이때의 쿼리문은 하나의 테이블에 대한 쿼리문이고, 반드시 쿼리 결과 내에 해당 테이블의 키(key) 필드가 존재하여야 한다. 이때 다수의 필드들이 키를 형성하는 경우, 해당되는 다수의 필드들이 모두 포함하여야 한다. 쿼리문을 통해 가져온 데이터들은 하나의 데이터셋을 형성한다.As another example, the
즉, 데이터 요청부(31)는 목적 데이터베이스로부터 데이터셋을 가져온다. 앞서 테이블을 선택하는 경우에는 가져오는 데이터셋은 해당 테이블의 모든 데이터이고, 대상 테이블을 쿼리문을 가져온 경우에는 쿼리문에 의한 필터링된 테이블의 일부이다. 이때, 바람직하게는, 자바 DB 연결 드라이버(JDBC) 등을 통해 목적 데이터베이스의 데이터를 가져온다. 앞서 데이터 스키마도 자바 DB 연결 드라이버를 이용하여 가져온다.That is, the
한편, 다른 실시예로서, 데이터 요청부(31)는 목적 데이터베이스의 대상 테이블을 데이터셋으로 가져오고, 가져온 데이터셋(또는 대상 테이블)에 대하여 쿼리를 수행하는 쿼리편집기를 이용하여, 쿼리 결과를 추출할 수 있다. 그리고 추출된 쿼리 결과를 하나의 데이터셋으로 이용하게 할 수 있다. 즉, 이하에서 설명할 워크시트 표시부(32)에서 추출된 쿼리 결과의 데이터셋만을 워크시트 상에 데이터로 표시할 수 있다. 이를 통해, 대상 테이블 전체를 워크시트 상에 표시하지 않고, 사용자가 원하는 필드들만으로 구성된 테이블을 워크시트 상에 표시할 수 있다. 또한, 불필요한 데이터 필드를 표시하지 않음으로써, 사용자의 데이터 편집의 편의성을 제고할 수 있다.In another embodiment, the
앞서와 같이, 목적 데이터베이스로부터 가져온 테이블의 데이터셋 또는, 쿼리문에 의한 가져온 데이터셋, 또는, 테이블을 쿼리문에 의해 필터링한 데이터셋 등은 모두 갱신할 데이터셋이다. 이를 이하에서 초기 데이터셋(제1 데이터셋 또는 원본 데이터셋)이라 부르기로 한다.As described above, the data set of the table obtained from the object database, the data set obtained by the query statement, or the data set filtered by the query statement are all the data sets to be updated. This will be hereinafter referred to as an initial data set (first data set or original data set).
또한, 데이터 요청부(31)는 초기 데이터셋을 저장부(38) 등에 저장해둔다.The
다음으로, 워크시트 표시부(32)는 스프레드시트 인터페이스를 제공하고, 엑셀, 로터스 등 스프레드시트 상에 워크시트(이하 워크시트)를 생성하고, 생성한 워크시트 상에 데이터셋을 표시한다. 특히, 목적 데이터베이스로부터 가져온 데이터셋을 스프레드시트의 워크시트 상에 표시한다. 스프레드시트는 엑셀(마이크로소프트 사의 프로그램 상표), 로터스(Lotus 1-2-3, 로터스 소프트웨어 사의 프로그램 상표), 한셀(한글과컴퓨터 사의 프로그램 상표) 등, 행과 열로 구분된 표 형식으로 표시되는 워크시트로 구성되어, 각 셀에 데이터를 처리하는 스프레드시트 소프트웨어 프로그램이다.Next, the
먼저, 워크시트 표시부(32)는 대상 데이터셋의 스키마(schema) 정보(또는 데이터셋의 구조)를 분석하여 각 필드에 대한 상세 정보를 맞게 워크시트에 작성한다. 이를 위해 워크시트를 새로 생성한다.First, the
그 일례로서, 도 5와 같이, 워크시트의 열에 따라, 각 데이터 필드의 이름, 표시명, 데이터의 타입(종류), 조건, 키 필드 등 테이블 데이터의 세부 구조를 표시한다. 또한, 각 열에 해당하는 데이터의 타입을 해석하여, 각 열의 표시 속성(특히, 숫자에 대한 표시 형식)을 데이터의 타입(형식)에 맞도록 보정한다. 예를 들어, 열(필드)의 이름이 "생일"인데, 해당 필드의 형식이 날짜 형식이면, 해당 열을 모두 날짜 형식으로 설정한다. 또한, 통화 표시이면, 이에 따른 데이터 형식으로 표시한다.As an example, as shown in Fig. 5, a detailed structure of table data such as a name, a display name, a data type (kind), a condition, and a key field of each data field is displayed according to a column of the worksheet. Further, the type of data corresponding to each column is analyzed, and the display attributes (in particular, the display format for numbers) of each column are corrected to match the type of data (format). For example, if the name of a column (field) is "Birthday" and the format of the field is a date format, set all the columns to date format. If the call is displayed, the data format is displayed accordingly.
또한, 워크시트 표시부(32)는 스프레드시트의 워크시트를 생성할 때, 스프레드시트에서 제공하는 워크시트에 연동되는 실행 모듈을 함께 생성시킨다. 실행 모듈은 VBA(Visual Basic for application) 등 스크립트 방식의 프로그램 언어로 작성된 모듈(또는 코드)이다. 실행 모듈은 워크시트 내에서 특정한 이벤트가 발생하면, 각 이벤트에 대응하는 함수가 실행되도록 하는 모듈이다. 따라서 워크시트 갱신부(33)에 의해 워크시트 상에서 사용자가 삭제, 수정, 삽입 등 특정한 작업을 수행하면, 해당 작업 또는 작업 이벤트에 따라 상기 실행모듈 내의 함수가 실행되어, 관련 작업을 수행한다.In addition, the
예를 들어, 실행모듈은 워크시트의 열이나 데이터셋의 스키마가 표시된 행 등을 삭제하거나, 필드명이나 필드 속성 등의 해당 셀의 값을 변경하는 경우에는 이러한 작업을 취소할 것을 경고하거나 복원하도록 할 수 있다.For example, an executable module may warn or restore that it should be canceled if it deletes columns in the worksheet, rows in the schema of the dataset, etc., or changes the values of those cells, such as field names or field attributes can do.
그리고 워크시트 표시부(32)는 갱신할 데이터셋(또는 초기 데이터셋)을 스프레드시트의 워크시트에 표시한다. 도 6에서 보는 바와 같이, 앞서 데이터의 각 필드의 필드명 등 세부 구조가 상기 워크시트 상에 열로 나란히 기재되어 있고, 해당 필드명에 대응되는 열 내의 아래 행에 연속적으로 해당 필드값(또는 테이블 데이터)을 표시한다. 즉, 도 6과 같이, 스프레드시트(또는 워크시트) 상의 데이터는 행과 열에 의해 각 셀에 데이터가 표시되고, 이때, 상단 행 내에 각 열에는 필드명(필드 이름), 표시명, 데이터 타입 등이 기재되고, 그 이하에 레코드들을 각 필드에 맞도록 배열한다.The
즉, 초기 데이터셋은 다수의 레코드로 구성되고, 각 레코드들은 워크시트 상에서 하나의 행에 표시된다. 레코드의 각 열에 해당하는 셀들이 해당 레코드 필드의 필드값들이 표시된다. 특히, 앞서 각 필드의 열에 대한 데이터 형식을 분석하여, 해당 형식으로 모든 열을 설정하였으므로, 해당 레코드의 해당 열은 모두 그 데이터 형식에 맞도록 스프레드시트의 워크시트 상에 표시된다.That is, the initial data set consists of a number of records, each of which is displayed in a row on the worksheet. Cells corresponding to each column of the record show the field values of the corresponding record field. Particularly, since the data types of the columns of each field are analyzed in advance and all the columns are set in the corresponding format, all the columns of the corresponding records are displayed on the worksheet of the spreadsheet according to the data format.
도 6의 예에서, EMPLOYEES 테이블의 경우 EMPLOYEE_ID가 기본 키(Primary key)이므로 이 컬럼(또는 열)은 중복을 허용하지 않는다.In the example of FIG. 6, in the case of the EMPLOYEES table, this column (or column) does not allow duplication since EMPLOYEE_ID is the primary key.
또한, 워크시트 표시부(32)는 하나의 워크시트 상에 표시할 수 있는 레코드의 최대 개수를 사전에 설정한다. 그리고, 해당 최대 개수가 넘어가면, 나머지 레코드들을 새로운 워크시트를 생성하고, 생성된 워크시트에 표시한다. 일례로서, 스프레드시트 화면에서 데이터를 처리하므로 동일 시트(sheet) 내에서는 100만건, 여러 시트(sheet)를 통해 수백만건의 데이터를 정의하고 데이터베이스에 입력할 수 있다.In addition, the
한편, 워크시트 표시부(32)는 엑셀, 로터스 등 상용화된 스프레드시트 프로그램의 주요 기능만을 임베디드하여 사용한다. 즉, 스프레드시트 처리 작업은 스프레드시트의 코어 기능에 의해 수행되고, 전체 인터페이스는 워크시트 표시부(32)에 의해 처리된다. 이하에서 설명할 워크시트 갱신부(33)도 동일하다.On the other hand, the
또한, 워크시트 표시부(32)는 명령을 수행하기 위한 명령 버튼을 워크시트 상에 표시할 수 있다. 바람직하게는, 명령 버튼은 테이블 또는 쿼리 결과를 조회하기 위한 조회 버튼이나, 갱신된 데이터를 서버로 전송하여 데이터베이스를 갱신하기 위한 확인 버튼 등을 포함한다.In addition, the
다음으로, 워크시트 갱신부(33)는 워크시트 상에서 표시된 데이터에 대하여 갱신 작업을 수행한다. 특히, 워크시트 갱신부(33)는 앞서 워크시트 표시부(32)에서 제공하는 스프레드시트 인터페이스 화면을 통해, 사용자의 명령에 따라 데이터 갱신 작업을 수행한다.Next, the
즉, 워크시트 갱신부(33)는 초기 데이터셋을 스프레드시트의 워크시트 상에 표시하고, 사용자에 의한 처리되는 스프레드시트의 워크시트 상의 작업들을 처리한다. 예를 들어, 사용자가 스프레드시트 상에서 특정 셀의 데이터를 수정하거나, 특정 행을 삽입하거나 삭제한다. 이때 통상의 스프레드시트 인터페이스와 같은 형태로 인터페이스를 처리한다.That is, the
또한, 워크시트 갱신부(33)의 각 기능은 워크시트와 연동되는 실행 모듈(VBA 등 스크립트 언어도 작성된 프로그램 모듈)에 의해 구현된다. 즉, 워크시트 상에서 사용자가 수정, 삽입, 삭제 등 특정한 작업을 수행하면, 해당 작업을 하나의 이벤트로 판단하여, 해당 작업 이벤트에 대응되는 실행 모듈의 함수가 실행된다. 이와 같은 기능은 스프레드시트의 코어 기능에서 제공된다. 이하에서, 설명의 편의를 위하여, 수정, 삭제, 삽입(신규 추가) 등에 의해 데이터의 내용이 달라진 것을 모두 "갱신"된 것으로 설명한다.Each function of the
바람직하게는, 워크시트 갱신부(33)는 워크시트의 열, 데이터셋의 스키마가 표시된 행 등이 삭제되거나, 필드명이나 필드 속성 등의 해당 셀의 값을 변경되면, 해당 작업을 취소할 것을 경고하거나 복원한다.Preferably, the
도 7은 도 6의 레코드 데이터 중 일부가 갱신된 상태를 나타내고 있다. 즉, 키가 104의 레코드가 삭제되고, 레코드 105, 106, 108이 각각 변경되고, 변경된 데이터는 봉급(salary)과 전화번호(phone_number)이다. 또한, 레코드 112가 새롭게 추가되었다.FIG. 7 shows a state in which a part of the record data in FIG. 6 is updated. That is, the record of the key 104 is deleted, the
다음으로, 갱신추출부(34)는 초기 데이터셋과 갱신된 데이터셋을 비교하여 갱신내용을 자동으로 추출한다. 갱신추출부(34)는 앞서 데이터 요청부(31)에서 저장해둔 초기 데이터셋을 가져와서, 현재 워크시트 상에 표시된 데이터셋과 대비한다. 이때, 현재 워크시트 상에 표시된 데이터셋을 갱신된 데이터셋이라 부르기로 한다.Next, the
바람직하게는, 갱신추출부(34)는 초기 데이터셋 및, 갱신된 데이터셋을 각각 키(key) 필드를 이용하여 정렬을 수행하고, 초기 데이터셋과 갱신된 데이터셋의 각각의 레코드들을 순차적으로 대비한다.Preferably, the
한편, 갱신추출부(34)가 초기 데이터셋과 갱신된 데이터셋을 비교하여 갱신된 내용을 검출하는 방법이 도 8에 도시되고 있다.On the other hand, FIG. 8 shows a method in which the
도 8에서 보는 바와 같이, 먼저, 갱신추출부(34)는 초기 데이터셋 및 갱신된 데이터셋을 키 필드를 통해 정렬을 수행한다(S11). 그리고 각각 데이터셋의 1번째 레코드를 각각 현재 레코드로 설정한다(S12).As shown in FIG. 8, first, the
그리고 현재 레코드들 간의 키 값들을 대비한다(S13).Then, key values between the current records are prepared (S13).
만약 각 키 값들이 동일하면, 초기 데이터셋 및 갱신된 데이터셋의 현재 레코드들의 각각의 필드값들을 대비하여 수정 여부를 판단한다(S21).If the key values are the same, the field values of the initial data set and the current records of the updated data set are compared with each other to determine whether to modify them (S21).
그리고 어느 하나의 현재 레코드가 마지막 레코드인지를 대비한다(S22). 마지막 데이터가 아니면, 각 현재 레코드들을 다음 레코드들로 설정하고, 앞서 레코드들의 키값을 대비하는 단계(S13)로 다시 반복한다(S23).Then, it is determined whether any current record is the last record (S22). If it is not the last data, each current record is set as the next record, and the process goes back to step S13 to compare the key values of the records in advance (S23).
어느 하나의 현재 레코드가 마지막 레코드이면, 나머지 레코드들이 있는지를 확인한다. 초기 데이터셋과 갱신된 데이터셋이 모두 마지막 레코드이면, 더 이상 진행하지 않고 종료한다. 초기 데이터셋의 현재 레코드가 마지막 레코드이고, 갱신된 레코드들이 남아 있으면, 해당 갱신된 레코드들은 삽입된 것으로 판단한다. 반대로, 갱신된 데이터셋의 현재 레코드가 마지막 레코드이고 초기 데이터셋의 레코드들이 남아 있으면, 해당 초기 레코드들은 삭제된 것으로 판단한다(S24).If any one of the current records is the last record, it is checked whether the remaining records exist. If both the initial dataset and the updated dataset are the last records, the process terminates without further processing. If the current record of the initial data set is the last record, and the updated records remain, the updated records are judged to be inserted. Conversely, if the current record of the updated data set is the last record and the records of the initial data set remain, the initial records are determined to have been deleted (S24).
다음으로, 현재 레코드 키값들을 비교하여 초기 데이터셋의 현재 레코드가 앞서면, 초기 데이터셋의 현재 레코드가 삭제된 것으로 판단한다(S31). 그리고 초기 데이터셋의 현재 레코드가 마지막 레코드인지를 판단한다(S32).Next, if the current record key values are compared with the current record values of the initial data set, it is determined that the current record of the initial data set has been deleted (S31). It is determined whether the current record of the initial data set is the last record (S32).
마지막이 아니면, 초기 데이터셋의 현재 레코드를 초기 데이터셋의 다음 레코드로 설정하고, 앞서 레코드들의 키값을 대비하는 단계(S13)로 다시 반복한다(S33). 그리고 마지막이면, 갱신된 레코드셋의 현재 레코드 및 나머지 레코드들이 삽입된 것으로 판단한다(S34). 그리고 종료한다.If not, the current record of the initial data set is set to the next record of the initial data set, and the step of comparing the key values of the records to the previous step (S13) is repeated (S33). If it is the last, it is determined that the current record and the remaining records of the updated record set are inserted (S34). And it ends.
다음으로, 현재 레코드 키값들을 비교하여 갱신된 데이터셋의 현재 레코드가 앞서면, 갱신된 데이터셋의 현재 레코드가 삽입된 것으로 판단한다(S41). 그리고 갱신된 데이터셋의 현재 레코드가 마지막 레코드인지를 판단한다(S42).Next, if the current record key value is compared with the current record value of the updated data set, it is determined that the current record of the updated data set is inserted (S41). It is determined whether the current record of the updated data set is the last record (S42).
마지막이 아니면, 갱신된 데이터셋의 현재 레코드를 갱신된 데이터셋의 다음 레코드로 설정하고, 앞서 레코드들의 키값을 대비하는 단계(S13)로 다시 반복한다(S43). 그리고 마지막이면, 초기 레코드셋의 현재 레코드 및 나머지 레코드들이 삭제된 것으로 판단한다(S44). 그리고 종료한다.If not, the current record of the updated dataset is set to the next record of the updated dataset, and the process of step S13 is repeated (S43). If it is the last, it is determined that the current record and the remaining records of the initial record set have been deleted (S44). And it ends.
일례로서, 도 6과 도 7의 예를 살펴보면, 도 6은 초기 데이터셋이고, 도 7은 갱신된 데이터셋이다. 도 6과 도 7은 이미 모두 정렬된 데이터셋들이다.As an example, referring to FIGS. 6 and 7, FIG. 6 is an initial data set, and FIG. 7 is an updated data set. Figures 6 and 7 are already sorted data sets.
이때, 키 103까지의 레코드들이 대비된 후, 다음 레코드로 현재 레코드가 설정된다. 이때, 초기 데이터셋은 104 키의 레코드가 현재 레코드이고, 갱신된 데이터셋은 105가 현재 레코드이다. 이 경우, 초기 데이터셋의 현재 레코드의 키 104가 갱신된 레코드셋의 현재 레코드의 키 105보다 앞선다. 따라서 도 8b의 과정에 해당된다. 그래서 키 104의 초기 데이터 셋의 현재 레코드가 삭제된 것으로 판단된다.At this time, after the records up to the key 103 are compared, the current record is set to the next record. At this time, in the initial data set, the record of 104 keys is the current record, and the updated
또한, 키 110까지의 레코드들이 대비된 후, 다음 레코드로 현재 레코드가 설정된다. 이때, 초기 데이터셋은 114 키의 레코드가 현재 레코드이고, 갱신된 데이터셋은 112가 현재 레코드이다. 이 경우, 갱신된 데이터셋의 현재 레코드의 키 112가 초기 레코드셋의 현재 레코드의 키 114다 앞선다. 따라서 도 8c의 과정에 해당된다. 그래서 키 112의 갱신된 데이터 셋의 현재 레코드가 삽입된 것으로 판단된다.Further, after the records up to the key 110 are compared, the current record is set to the next record. At this time, in the initial data set, the record of the 114 key is the current record, and the updated
또한, 도 7의 예에서, 데이터 셀 값 또는 필드값이 변경된 것은 키 105, 106, 108의 레코드들이다. 이들 레코드들은 초기 데이터셋의 레코드들과 봉급(salary) 또는 전화번호(phone_number)의 필드 내의 필드값들이 서로 다르기 때문에, 수정된 것으로 판단된다. 이는 도 8a의 S21 단계에 해당된다. 즉, 이들 레코드들은 수정된 레코드들이다.In the example of FIG. 7, it is the records of the
다음으로, 갱신정의부(35)는 워크시트 또는 워크시트 상에서 갱신된 데이터(또는 레코드)에 대하여 갱신내용을 정의한다. 바람직하게는 XML문서 형태로 정의하고, 데이터는 플랫 파일(flat file)로 구성한다.Next, the
즉, 갱신정의부(35)는 앞서 갱신추출부(34)에 의해 검출된 갱신 레코드에 대하여 각각 갱신 내용을 정해진 정의 규칙에 의하여 정의한다. 이때, 정의할 내용은, 갱신할 데이터 또는 데이터셋의 구조 또는 스키마를 표시하는 테이블 정보와, 갱신할 데이터들이다. 갱신정의부(35)는 갱신된 데이터 또는 갱신된 레코드에 대해서만 갱신 데이터를 기록(또는 정의)한다. 즉, 전혀 갱신되지 않은 데이터는 기록하지 않는다.That is, the
먼저, 갱신정의부(35)는 데이터셋(또는 갱신 데이터 구조)을 사전에 정해진 포맷(또는 정의 규칙)에 의하여 정의한다. 바람직하게는, 데이터셋의 구조(또는 갱신 데이터 구조)을 XML 문서로 표시한다. 데이터셋의 구조를 XML 문서로 표시한 일례가 도 9에 도시되고 있다.First, the
도 9와 같은 테이블 정보 또는 데이터셋의 정보는 다음과 같은 개체 및 그 속성들에 대한 데이터를 포함한다. 바람직하게는, 테이블 정보 또는 데이터셋의 구조에 대한 정보는 테이블 명(사용자 화면에서 테이블 선택 시 자동 지정), DB 연결 코드(DB Connection code, 사용자 화면에서 DB 연결 시 자동 지정), 키 필드의 존재 여부, 데이터 타입, 널(NULL) 값 허용 여부 등의 내용을 포함한다.The table information or the information of the data set as shown in FIG. 9 includes data on the following entity and its attributes. Preferably, the information on the structure of the table information or the data set includes a table name (automatically designated when a table is selected on the user screen), a DB connection code (automatically specified when a DB is connected on the user screen) Data type, whether to allow null values, and so on.
(1) ExecuteInfo : 실행할 데이터베이스 정보(1) ExecuteInfo: Database information to be executed
- ConnectionCode : 서버에 정의된 데이터베이스 코드- ConnectionCode: Database code defined on the server.
(2) DataTable : 갱신할 테이블 정보, 다수의 테이블을 동일한 트랜잭션으로 처리 가능(2) DataTable: table information to be updated, multiple tables can be processed in the same transaction
- Name :테이블명- Name: table name
- Caption : 표시명- Caption: Display name
- TargetTable :갱신할 테이블 명- TargetTable: the name of the table to be updated
(3) Column : 테이블(또는 데이터셋)의 컬럼 정보(3) Column: Column information of the table (or data set)
- Name : 컬럼 명- Name: Column name
- Caption :컬럼 표시 명- Caption: Column display name
- Constraint : key 정보 P : Primary key V : not null N : nullable- Constraint: key information P: Primary key V: not null N: nullable
- DataType :데이터 타입 C:String N:숫자형, D : Data형- DataType: Data type C: String N: Numeric type, D: Data type
- UpdateFlag : Update 쿼리 생성 시 컬럼을 포함할지 여부- UpdateFlag: Whether to include the column when generating the Update query
(4) Rows : 처리할 Data를 정의(4) Rows: Define data to process
- RowIndexCol : 데이터 행 일련번호가 위치할 열- RowIndexCol: the column where the data row serial number will be located
- RowStateCol : 데이터 건별 처리시 해당항을 처리할 구분코드가 위치할 열- RowStateCol: Column to place the separator code to process the corresponding item in data handling
- TextType :처리할 데이터 위치 FILE: 첨부파일로 전송 XML: xml 내부포함- TextType: The location of the data to be processed. FILE: Sent as an attachment. XML: Internal xml
데이터셋의 컬럼 정보 또는 필드 정보는 대상 테이블의 전체 필드 정보를 나타낼 수도 있고, 그 일부를 나타낼 수도 있다. 즉, 앞서 대상 테이블을 쿼리를 통해 일부만 가져오는 경우에는, 테이블의 필드 중 일부에 대해서만 필드 구조를 생성한다.The column information or the field information of the data set may represent the entire field information of the target table or may represent a part thereof. That is, if the target table is partially retrieved through a query, the field structure is generated for only some of the fields of the table.
또한, 갱신정의부(35)는 갱신할 데이터들을 사전에 정해진 포맷으로 기록하여 파일로 생성한다. 바람직하게는, 또한, 갱신정의부(35)는 워크시트 상에서 갱신된 데이터를 플랫 파일(flat file)로 생성한다. 플랫 파일이란 데이터를 일련의 스트링으로 구성되는 통상의 파일을 말한다.In addition, the
도 10은 플랫 파일의 일례를 도시한 것이다. 바람직하게는, 스프레드시트 화면에 정의된 데이터는 서버와 사전에 정의된 컬럼, 행 구분자에 의해 도 9과 같은 형태의 텍스트 파일로 만들어져 서버로 전송된다. 여기서, 일례로서, 컬럼 구분자를 “|”, 행 구분자를 "엔터(또는 줄바꿈)" 기호로 나타낸다.Fig. 10 shows an example of a flat file. Preferably, the data defined in the spreadsheet screen is created as a text file of the form shown in FIG. 9 by the server, the column and the row delimiter defined in advance, and transmitted to the server. Here, as an example, column delimiters are denoted by " | ", and row delimiters are denoted by an "enter (or new line)"
특히, 도 10에서 각 줄의 맨 앞에 해당 레코드(해당 행)가 어떻게 처리할 것인지에 대한 갱신종류를 표시한다. 각 갱신상태 기호는 다음과 같다.In particular, in FIG. 10, the type of update for how the corresponding record (corresponding row) is to be processed is displayed at the beginning of each line. Each update status symbol is as follows.
C :신규입력 U : 데이터수정 D : 데이터 삭제C: New input U: Data modification D: Data deletion
다음으로, 쿼리생성부(36)는 테이블 정보 및, 갱신할 데이터들이 정의된 갱신문서를 수신하여, 갱신된 데이터에 대해서 쿼리문을 생성한다. 이때, 쿼리생성부(36)는 테이터셋의 구조를 이용하여 쿼리 템플릿을 사전에 생성해두고, 갱신할 데이터 각각에 대하여 쿼리 템플릿에 매핑하여 실제 갱신하는 쿼리를 생성한다.Next, the
즉, 쿼리생성부(36)는 테이블 정보를 정의한 갱신문서의 내용을 해석하여, 갱신할 데이터베이스(database), 테이블(table), 컬럼(column) 정보를 추출한다. 그리고 추출된 정보를 이용하여, 입력 쿼리, 업데이트 쿼리(수정 쿼리), 삭제 쿼리에 대한 쿼리 템플릿 등을 생성한다.That is, the
쿼리 템플릿의 예가 도 11에 도시되고 있다. 도 11은 도 8의 데이터셋 구조에 의해 만들어진 쿼리 템플릿이다. 도 11(a)는 입력 쿼리(또는 삽입 쿼리) 템플릿이고, 도 11(b)는 업데이트 쿼리(변경 쿼리 또는 갱신 쿼리)의 템플릿이다. 또한, 도 11(c)는 삭제 쿼리의 쿼리 템플릿을 나타낸다.An example of a query template is shown in Fig. 11 is a query template created by the data set structure of FIG. 11 (a) is an input query (or insert query) template, and Fig. 11 (b) is a template of an update query (change query or update query). 11 (c) shows a query template of the delete query.
쿼리생성부(36)는 입력, 업데이트(수정), 삭제 등 해당 쿼리문의 포맷을 작성하고, 쿼리 명령 포맷에 테이블명과 필드명(컬럼명) 등을 기재하고, 또한, 변수값(또는 컬럼값)에 해당하는 부분에 변수값 대신 매핑 변수를 삽입하여, 쿼리 템플릿을 생성한다. 이때, 매핑 변수는 순서대로 넘버링된다.The
도 11의 예에서, "INSERT INTO <테이블명> (컬럼명, ...) VALUES (컬럼값, ...)" 등이 쿼리문의 포맷이고, EMPLOYEES가 테이블명이고, EMPLOYEE_ID, FIRST_NAME 등이 컬럼명이다. 또한, 특수문자 @를 사용한 @D1, @D2, ..., @DN 등이 매핑 변수이다. 1, 2, ..., N이 넘버링된 숫자를 나타낸다. 매핑 변수는 쿼리문의 포맷에서 컬럼값 또는 변수값에 삽입되는 부분에 기재된다.In the example of Fig. 11, "INSERT INTO <table name> (column name, ...) VALUES (column value, ...)" is a query query format, EMPLOYEES is a table name, EMPLOYEE_ID, FIRST_NAME, People. In addition, @ D1, @ D2, ..., @DN, etc., using the special character @ are mapping variables. 1, 2, ..., N represent numbered numbers. The mapping variable is described in the column or value inserted in the value of the variable in the format of the query statement.
매핑 변수에 넘버링된 숫자는 상기 매핑 변수에 매핑될 갱신 데이터의 순서를 나타낸다. 즉, 갱신 데이터의 n번째 데이터(필드값, 컬럼값)가 n번째로 넘버링된 매핑 변수이다.The number numbered in the mapping variable indicates the order of the update data to be mapped to the mapping variable. That is, the n-th data (field value, column value) of the update data is the n-th numbered mapping variable.
다음으로, 쿼리생성부(36)는 데이터를 각각 레코드 별로 읽어들여, 각 레코드에 대하여 실제 쿼리를 생성한다. 이때, 각 레코드의 갱신종류에 따라 해당 종류의 쿼리 템플릿(예를 들어, 입력 쿼리 템플릿, 업데이트 쿼리 템플릿, 삭제 쿼리 템플릿 등)을 선택하고, 선택된 쿼리 템플릿에서 매핑 변수를 각 레코드 데이터의 해당 컬럼값으로 매핑하여 실제 쿼리문을 생성한다.Next, the
특히, 쿼리생성부(36)는 갱신할 데이터들을 스트림으로 수신할 수 있고, 스트림으로 수신되는 순서로, 각 갱신할 레코드의 내용으로 쿼리문을 실시간으로 생성한다.In particular, the
도 10에서 보는 바와 같이, 갱신 데이터 또는 갱신 데이터 파일은 작업 종류(입력 C, 업데이트 U, 삭제 D 등)와 각 매핑될 데이터(또는 필드값)들이 연속적으로 기재된다. 쿼리생성부(36)는 각 데이터를 레코드별로 읽어들여, 작업 종류가 무엇인지를 판단하여, 쿼리 템플릿을 선택한다. 그리고 이후의 갱신 데이터(또는 필드값)를 선택된 쿼리 템플릿에서 매핑 변수에 대체하여 매핑시킨다. 이와 같은 과정을 통해, 실제 쿼리문이 생성된다.As shown in FIG. 10, the update data or the update data file is continuously described with respect to the operation type (input C, update U, deletion D, etc.) and data (or field values) to be mapped. The
다음으로, DB갱신부(37)는 생성된(작성된) 쿼리문을 데이터베이스(40)에 요청하여, 대상 테이블의 데이터를 갱신하도록 요청한다.Next, the
DB갱신부(37)는 앞서 생성된 실제 쿼리문들을 각 레코드별로 쿼리문을 데이터베이스(40)에 전송하여 갱신 요청할 수 있다. 그러나 개별적으로 각 레코드별로 쿼리문을 데이터베이스(40)에 요청하면, 전체 갱신하는 시간이나 비용이 상당히 많이 소요된다. 이것은 데이터베이스는 한번의 트랜잭션으로 하나의 요청을 처리하는데, 트랜잭션을 수행하기 위한 작업이 많기 때문이다.The
따라서, 바람직하게는, DB갱신부(37)는 다수의 레코드별 실제 쿼리를 배치(batch)로 묶어 일괄 처리한다. 즉, 쿼리문은 한번만 생성하고, 전송 데이터의 처리는 해당 쿼리의 변수에 해당 컬럼값만 매핑하여 배치(Batch)에 추가한 다음 마지막으로 한번만 데이터베이스에 실행(Execution) 요청하게 되므로 빠르게 대량 데이터를 처리할 수 있다.Therefore, preferably, the
다음으로, 본 발명의 제2 실시예에 따른 스프레드시트 기반 데이터베이스 자동 갱신 시스템을 도 12을 참조하여 구체적으로 설명한다. 본 발명의 제2 실시예는 앞서 제1 실시예와 구성이 동일하고, 다만, 갱신된 레코드 중에서 수정된 레코드들의 수정된 필드들을 구하여 수정 템플릿 쿼리를 달리 작성한다.Next, a spreadsheet-based database automatic update system according to a second embodiment of the present invention will be described in detail with reference to FIG. The second embodiment of the present invention is the same as the first embodiment, except that modified fields of modified records are retrieved from the updated records to create a modified template query differently.
먼저, 갱신추출부(34)는 레코드의 일부 셀 값(또는 필드값)만 수정된 경우, 수정된 필드들이 어느 필드인지를 기록한다. 특히, 갱신추출부(34)는 전체 필드 중에서 어느 레코드에서라도 적어도 1번의 수정이 있는 필드들을 모두 체크하여 수집한다. 즉, 수정된 필드들의 집합을 구한다.First, the
도 7의 예에서, 데이터 셀 값 또는 필드값이 변경된 것은 키 105, 106, 108의 레코드 중 봉급(salary)과 전화번호(phone_number)의 필드이다. 따라서 이들 2개의 필드들만 수정된 것으로 수집된다.In the example of FIG. 7, the change of the data cell value or the field value is a field of a salary and a phone number (number) among the records of the
다음으로, 갱신정의부(35)는 수정된 필드들의 집합과, 키 필드만을 합하여, 수정되는 데이터셋의 구조 또는 스키마의 구조를 생성한다. 또는 다른 실시예로서, 앞서 전체 스키마 구조가 도 9에 있기 때문에, 칼럼 이름만 기재해도 된다. 이하에서는 설명의 편의를 위하여, 수정된 데이터셋의 구조를 위한 스키마 구조를 모두 생성하는 것으로 설명한다.Next, the
도 12의 예에서, 키 필드는 "고용자 ID(EMPLOYEE_ID)" 이고, 변경된 필드들은 봉급(salary)과 전화번호(phone_number)이다. 따라서 이들 필드(또는 컬럼)에 대해서만 데이터셋의 구조 또는 스키마의 구조를 생성한다. 상기 예에 따라 작성된 데이터셋 구조의 XML 문서는 도 13과 같다.In the example of Fig. 12, the key field is "EMPLOYEE_ID ", and the changed fields are salary and phone_number. Therefore, only those fields (or columns) are used to create the structure of the dataset or the structure of the schema. The XML document of the data set structure created according to the above example is shown in FIG.
도 13에서 보는 바와 같이, 컬럼 필드는 고용자 ID와, 전화번호, 및 연봉에 대한 필드들만 xml 문서에 대해서만 나타난다. As shown in Figure 13, the column field only shows fields for employee ID, phone number, and salary for xml documents.
또한, 갱신정의부(35)는 수정된 데이터 또는 레코드를 생성할 때, 갱신된 데이터셋의 구조만 표시한다. 즉, 갱신할 데이터들을 사전에 정해진 포맷으로 기록하여 파일로 생성할 때, 수정된 레코드에 대하여, 키 필드와 갱신된 필드에 대응되는 필드값(컬럼값)만 표시하여, 플랫 파일로 구성한다. 그의 예가 도 14에 표시되고 있다.In addition, when generating the modified data or the record, the
도 14에서 보는 바와 같이, 삭제할 데이터는 키 필드의 필드값만 기재한다. 그리고 수정할 데이터 또는 레코드는 앞서 수정하는 필드들에 대한 데이터셋 구조(스키마 구조)의 필드값들만 기록한다. 또한, 입력할 레코드들은 전체 필드들 모두를 기록한다. 즉, 입력할 레코드는 앞서 제1 실시예와 같이, 전체 스키마 구조의 데이터들을 모두 표시한다.As shown in FIG. 14, only the field value of the key field is described in the data to be deleted. The data or record to be modified records only the field values of the data set structure (schema structure) for the fields to be modified in advance. Also, records to be entered record all of the fields. That is, the record to be input displays all data of the entire schema structure as in the first embodiment.
한편, 도 14에서 보는 바와 같이, 수정된 필드는 키 필드인 EMPLOYEE_ID와, 갱신된 필드인 PHONE_NUMBER, SALARY 필드의 데이터 값(컬럼값)만 기록된다. 또한, 수정된 데이터는 고용인 아이디(EMPLOYEE_ID)가 105, 106, 108으로 모두 3개이다. 따라서 3개의 수정된 데이터(또는 갱신 데이터 파일)에 기록된다.On the other hand, as shown in FIG. 14, only the data field (column value) of the field EMPLOYEE_ID, the updated field PHONE_NUMBER, and the value of the SALARY field are recorded in the modified field. In addition, the modified data includes three employee IDs (EMPLOYEE_ID) of 105, 106, and 108, respectively. Therefore, it is recorded in three modified data (or update data file).
다음으로, 쿼리생성부(36)는 갱신할 데이터의 데이터셋 구조를 이용하여, 갱신된 데이터에 대한 쿼리문을 생성한다. 이때, 쿼리생성부(36)는 테이터셋의 구조를 이용하여 쿼리 템플릿을 사전에 생성해두고, 갱신할 데이터 각각에 대하여 쿼리 템플릿에 매핑하여 실제 갱신하는 쿼리를 생성한다.Next, the
특히, 쿼리생성부(36)는 갱신 필드만을 나타낸 테이터셋의 구조를 이용하여 쿼리 템플릿을 생성한다. 도 15는 쿼리 템플릿의 예를 표시하고 있다. 도 15의 (a)에서 보는 바와 같이, 입력 템플릿에서는, 컬럼명으로 전체 스키마 모두가 표시된다. 또한, 도 15의 (b)에서 보는 바와 같이, 수정되는 쿼리의 템플릿에서는, 컬럼명은 EMPLOYEE_ID, PHONE_NUMBER, SALARY로만 표시된다. 즉, 키 필드와 갱신된 필드만으로 구성된다.In particular, the
또한, 쿼리생성부(36)는 데이터를 각각 레코드 별로 읽어들여, 각 레코드에 대하여 실제 쿼리를 생성한다. 이때, 각 레코드의 갱신종류에 따라 해당 종류의 쿼리 템플릿(예를 들어, 입력 쿼리 템플릿, 업데이트 쿼리 템플릿, 삭제 쿼리 템플릿 등)을 선택하고, 선택된 쿼리 템플릿에서 매핑 변수를 각 레코드 데이터의 해당 컬럼값으로 매핑하여 실제 쿼리문을 생성한다.In addition, the
도 16는 도 14의 갱신 데이터(또는 레코드)에 대하여 작성된 실제 쿼리를 나타내고 있다.Fig. 16 shows an actual query created for the update data (or record) in Fig.
다음으로, 본 발명의 효과를 보다 구체적으로 설명한다.Next, the effect of the present invention will be described in more detail.
먼저, 본 발명은 실행 건수에 제약이 없다.First, the number of executions of the present invention is not limited.
사용자가 등록/수정/삭제한 데이터를 업로드 스트림(Upload stream)을 통해 서버로 전송하므로 단건 데이터부터 수백만건의 대량 데이터까지 자유롭게 핸들링이 가능하다. 데이터 정보는 정해진 행, 열 구분자로 분리된 플랫 파일(flat file)로 만들어저 서버로 업로드(upload)되고, 서버에서는 업로드(Upload Stream)에서 데이터를 읽어 정해진 행, 열 구분자에 따라 파싱 후 함께 전송된 xml 정보로부터 미리 생성된 쿼리에 바인딩하여 실행하게 된다.Since the data registered / modified / deleted by the user is transmitted to the server through the upload stream, it is possible to freely handle the single data to millions of large data. The data information is converted into a flat file separated by a predetermined row and column delimiter and uploaded to the server. The server reads the data from the upload stream and parses the data according to the predetermined row and column delimiter And binds it to a pre-generated query from the obtained xml information.
또한, 대량 데이터를 빠르게 처리할 수 있다.Also, mass data can be processed quickly.
갱신 서버에서 데이터를 처리하는 기본 형식은 jdbc dirver를 통해 데이터베이스에 접속한 후 클라이언트(client)로부터 전송된 xml 정보를 파싱(parsing)하여 입력, 수정, 삭제에 해당하는 쿼리문을 생성하고, 함께 클라이언트(Client)로부터 전송된 업로드 스트림(upload stream)으로부터 데이터(data)를 읽어들이면서 미리 생성된 쿼리에 변수를 바인딩 시킨 후 실행하는 방식이다.The basic format for processing data in the update server is to access the database through the jdbc dirver and then parse the xml information sent from the client to generate a query statement corresponding to input, The client reads the data from the upload stream transmitted from the client and binds the variable to the pre-generated query.
이때 연결(connection) 객체 중 PreparedStatement를 사용하여 크기(Fetch size)를 지정하고, 바인딩 된 데이터를 PreparedStatement의 배치 수단(addBatch method)을 사용하여 추가하며, 전체 데이터가 추가 되었을 때 한번 실행하여 데이터를 처리한다. 매 건마다 실행(Execute)하는 방식이 아니고 한번에 실행(Execute)하는 방식이라서 데이터베이스(database)의 부하도 줄이고 속도도 매우 빠른 것이 장점이다.At this time, among the connection objects, PreparedStatement is used to specify the size (Fetch size), and the bound data is added using the PreparedStatement's addBatch method. When the entire data is added, do. The advantage of this method is that it does not execute every time, but executes at once, reducing the load on the database and speeding up the speed.
또한, DB 기능(DB Function)을 사용기능으로 제공한다.In addition, DB function (DB function) is provided as a function.
사용자가 화면에서 처리한 데이터 뿐만 아니라 데이터베이스 기능, 사용자 생성 함수(Function) 등을 처리할 수 있도록 옵션을 제공하여 서버에서 쿼리 생성 시 대상 컬럼 처리를 데이터 바인딩 대신 함수 처리 할 수 있는 기능을 제공한다. It provides the option to process database function, user creation function, etc. as well as data processed by the user, so that the server provides the function to process the target column processing instead of data binding function.
또한, 오라클 시퀀스(Oracle sequence), 사이데이터(sysdate) 등 시간함수, rownum 등의 DB함수 등을 쿼리에 포함하여 사용할 수 있다. You can also include queries such as Oracle functions, time functions such as Oracle sequence, sysdate, and DB functions such as rownum.
이상, 본 발명자에 의해서 이루어진 발명을 실시 예에 따라 구체적으로 설명하였지만, 본 발명은 실시 예에 한정되는 것은 아니고, 그 요지를 이탈하지 않는 범위에서 여러 가지로 변경 가능한 것은 물론이다.The invention made by the present inventors has been described concretely with reference to the embodiments. However, it is needless to say that the present invention is not limited to the embodiments, and that various changes can be made without departing from the gist of the present invention.
10 : 사용자 단말 20 : 클라이언트
30 : 갱신 서버 31 : 데이터 요청부
32 : 워크시트 표시부 33 : 워크시트 갱신부
34 : 갱신추출부 35 : 갱신정의부
36 : 쿼리생성부 37 : DB갱신부
38 : 저장부 40 : 데이터베이스10: user terminal 20: client
30: update server 31: data request unit
32: worksheet display section 33: worksheet update section
34: update extracting unit 35: update definition unit
36: Query generating unit 37: DB updating unit
38: storage unit 40: database
Claims (7)
상기 데이터베이스로부터 대상 테이블의 데이터셋을 요청하여 가져오고, 가져온 초기 데이터셋을 저장하는 데이터 요청부;
스프레드시트 인터페이스를 제공하고, 워크시트를 생성하여, 상기 데이터셋의 구조와 레코드 데이터를 상기 워크시트 상에 표시하는 워크시트 표시부;
상기 스프레드시트 인터페이스를 통한 사용자의 입력에 따라 상기 워크시트 상의 레코드셋의 레코드 데이터를 갱신하는 워크시트 갱신부;
상기 초기 데이터셋과 상기 갱신된 데이터셋을 비교하여, 갱신된 레코드를 추출하는 갱신추출부;
상기 추출된 갱신된 레코드에 대하여, 갱신된 레코드의 데이터셋 구조와 레코드 데이터를 정의하는 갱신정의부;
정의된 레코드의 데이터셋 구조를 이용하여 쿼리 템플릿을 생성해두고, 갱신된 레코드 각각에 대하여 상기 쿼리 템플릿의 매핑 변수에 해당 레코드 데이터를 매핑하여 실제 쿼리문을 생성하는 쿼리생성부; 및
생성된 쿼리문을 상기 데이터베이스에 전송하여 상기 대상 테이블을 갱신하는 DB갱신부를 포함하고,
상기 갱신추출부는 레코드셋의 전체 필드 중에서 어느 레코드에서라도 적어도 1회 수정이 있는 필드들을 수정된 필드들의 집합으로 구성하고,
상기 갱신정의부는 수정된 레코드에 대하여 상기 수정된 필드들의 집합 내의 필드에 대응되는 필드값만을 표시하여 수정할 데이터를 생성하고,
상기 쿼리생성부는 수정된 쿼리의 템플릿을 생성할 때 키 필드와, 상기 수정된 필드들의 집합 내의 필드들만으로 구성하여 쿼리 템플릿을 생성하는 것을 특징으로 하는 스프레드시트 기반 데이터베이스 자동 갱신 시스템.
A spreadsheet-based database auto-renewal system coupled with a database,
A data request unit for requesting and fetching a data set of the target table from the database and storing the fetched initial data set;
A worksheet display unit that provides a spreadsheet interface, creates a worksheet and displays the structure of the data set and record data on the worksheet;
A worksheet update unit for updating record data of a record set on the worksheet according to a user's input through the spreadsheet interface;
An update extraction unit for comparing the initial data set with the updated data set to extract an updated record;
An update definition unit for defining a data set structure and record data of the updated record for the extracted updated record;
A query generating unit for generating a query template by using a data set structure of a defined record and mapping actual record data to a mapping variable of the query template for each updated record to generate an actual query statement; And
And a DB updating unit for transmitting the generated query statement to the database to update the target table,
Wherein the update extractor comprises fields in which at least one modification is made to any record among the entire fields of the recordset as a set of modified fields,
The update definition unit generates data to be modified by displaying only the field values corresponding to the fields in the modified set of fields with respect to the modified record,
Wherein the query generator generates a query template by constructing a key template and a field in a set of the modified fields when generating a modified template of the query.
상기 갱신추출부는 상기 초기 데이터셋 및, 상기 갱신된 데이터셋을 각각 키(key) 필드를 이용하여 정렬을 수행하고, 상기 초기 데이터셋과 상기 갱신된 데이터셋의 각각의 레코드들을 순차적으로 대비하는 것을 특징으로 하는 스프레드시트 기반 데이터베이스 자동 갱신 시스템.
The method according to claim 1,
The update extractor may perform the sorting of the initial data set and the updated data set using a key field and sequentially comparing the initial data set and the updated data set, Features a spreadsheet-based database auto-renewal system.
상기 갱신추출부는, 대비하는 현재 레코드들 간의 키 값을 대비하여, 키 값이 동일하면, 현재 레코드들의 각각 필드값을 대비하여 수정여부를 판단하고, 초기 데이터셋의 현재 레코드가 갱신된 레코드셋의 현재 레코드 보다 앞서면 상기 초기 데이터셋의 현재 레코드가 삭제된 것으로 판단하고, 갱신된 데이터셋의 현재 레코드가 초기 레코드셋의 현재 레코드 보다 앞서면 상기 갱신된 데이터셋의 현재 레코드가 삽입된 것으로 판단하는 것을 특징으로 하는 스프레드시트 기반 데이터베이스 자동 갱신 시스템.
3. The method of claim 2,
The update extractor compares the key values of the current records to be compared and determines whether or not to modify the field values of the current records if the key values are the same, If it is determined that the current record of the initial data set has been deleted before the current record, and the current record of the updated data set is ahead of the current record of the initial record set, it is determined that the current record of the updated data set is inserted A spreadsheet-based database auto-renewal system.
상기 갱신추출부는 대비하는 현재 레코드들 간의 키 값이 동일하고 어느 하나의 현재 레코드가 마지막 레코드이면, 나머지 레코드들이 있는지 확인하여 남아있는 갱신된 레코드셋의 레코드들은 삽입된 것으로, 남아있는 초기 데이터셋의 레코드들은 삭제된 것으로 판단하고,
초기 데이터셋의 현재 레코드가 갱신된 레코드셋의 현재 레코드 보다 앞서고 초기 데이터셋의 현재 레코드가 마지막 레코드이면, 갱신된 데이터셋의 현재 레코드 및, 나머지 레코드들은 삽입된 것으로 판단하고,
갱신된 데이터셋의 현재 레코드가 초기 레코드셋의 현재 레코드 보다 앞서고 갱신된 데이터셋의 현재 레코드가 마지막 레코드이면, 초기 데이터셋의 현재 레코드 및, 나머지 레코드들은 삭제된 것으로 판단하는 것을 특징으로 하는 스프레드시트 기반 데이터베이스 자동 갱신 시스템.
The method of claim 3,
The update extractor determines whether there is any remaining record, if the key value between the current records to be compared is the same, and if any current record is the last record, the records of the updated updated record set are inserted, It is determined that the records have been deleted,
If the current record of the initial dataset is ahead of the current record of the updated record set and the current record of the initial dataset is the last record, it is determined that the current record and the remaining records of the updated dataset have been inserted,
Wherein if the current record of the updated dataset is ahead of the current record of the initial recordset and the current record of the updated dataset is the last record then the current record and the remaining records of the initial dataset are determined to have been deleted. Based database automatic update system.
상기 쿼리생성부는 상기 갱신된 레코드를 스트림으로 수신하고, 스트림으로 수신된 순서대로, 각 갱신할 레코드의 내용을 쿼리문으로 실시간으로 생성하는 것을 특징으로 하는 스프레드시트 기반 데이터베이스 자동 갱신 시스템.
The method according to claim 1,
Wherein the query generator receives the updated record as a stream and generates contents of each record to be updated as a query in real time in the order received in the stream.
상기 쿼리생성부는 삭제 쿼리 템플릿을 키 필드만으로 생성하고, 입력 쿼리 템플릿에는 레코드셋 구조의 전체 필드를 이용하여 생성하는 것을 특징으로 하는 스프레드시트 기반 데이터베이스 자동 갱신 시스템.
The method according to claim 1,
Wherein the query generation unit generates the delete query template using only the key field and generates the deletion query template using the entire field of the record set structure in the input query template.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020170000877A KR101908556B1 (en) | 2017-01-03 | 2017-01-03 | A database update system based on spreadsheet interface by finding out updated records automatically |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020170000877A KR101908556B1 (en) | 2017-01-03 | 2017-01-03 | A database update system based on spreadsheet interface by finding out updated records automatically |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20180080423A KR20180080423A (en) | 2018-07-12 |
KR101908556B1 true KR101908556B1 (en) | 2018-10-17 |
Family
ID=62919849
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020170000877A KR101908556B1 (en) | 2017-01-03 | 2017-01-03 | A database update system based on spreadsheet interface by finding out updated records automatically |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101908556B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102252206B1 (en) * | 2019-12-30 | 2021-05-17 | (주)비아이매트릭스 | A task automation system using object action on the Exel sheet |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102466705B1 (en) * | 2020-06-22 | 2022-11-15 | 주식회사 한글과컴퓨터 | Document editing device that can automatically generate a table corresponding to a specified area in a spreadsheet based on data attribute and operating method thereof |
CN113157672B (en) * | 2021-05-17 | 2024-01-19 | 中国银行股份有限公司 | Batch modification method and device for SQLServer database fields |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050187952A1 (en) | 2004-01-19 | 2005-08-25 | Horst Werner | Database management systems and methods for managing a database |
US20090158251A1 (en) * | 2007-12-18 | 2009-06-18 | Rohan Angrish | Techniques for query and dml over relational tables using spreadsheet applications |
KR101013810B1 (en) * | 2010-01-15 | 2011-02-14 | (주)비아이매트릭스 | An excel-based management system for updating db tables and the method thereof |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1040145A (en) * | 1996-07-18 | 1998-02-13 | Hitachi Software Eng Co Ltd | Method for comparing record |
US8234293B2 (en) * | 2005-09-08 | 2012-07-31 | Microsoft Corporation | Autocompleting with queries to a database |
US8069129B2 (en) * | 2007-04-10 | 2011-11-29 | Ab Initio Technology Llc | Editing and compiling business rules |
US8918380B2 (en) * | 2009-07-09 | 2014-12-23 | Norsync Technology As | Methods, systems and devices for performing incremental updates of partial databases |
KR101368068B1 (en) * | 2012-03-29 | 2014-02-27 | 주식회사 엘지씨엔에스 | Method of constructing database, server performing the same and storage media storing the same |
-
2017
- 2017-01-03 KR KR1020170000877A patent/KR101908556B1/en active IP Right Grant
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050187952A1 (en) | 2004-01-19 | 2005-08-25 | Horst Werner | Database management systems and methods for managing a database |
US20090158251A1 (en) * | 2007-12-18 | 2009-06-18 | Rohan Angrish | Techniques for query and dml over relational tables using spreadsheet applications |
KR101013810B1 (en) * | 2010-01-15 | 2011-02-14 | (주)비아이매트릭스 | An excel-based management system for updating db tables and the method thereof |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102252206B1 (en) * | 2019-12-30 | 2021-05-17 | (주)비아이매트릭스 | A task automation system using object action on the Exel sheet |
Also Published As
Publication number | Publication date |
---|---|
KR20180080423A (en) | 2018-07-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101769857B1 (en) | An update system for the database by using spreadsheet interface | |
KR101899055B1 (en) | A database update method based on spreadsheet interface by making queries optimized for updated records | |
CN105378721B (en) | Knowledge capture and discovery system | |
US8694532B2 (en) | Method and system for query transformation for managing information from multiple datasets | |
US8959122B2 (en) | Data processing device | |
KR101769853B1 (en) | A batch update system based on spreadsheet interface for the database by using query templates | |
US20080033977A1 (en) | Script generating system and method | |
US20050114763A1 (en) | Apparatus, method, and program for retrieving structured documents | |
US8478760B2 (en) | Techniques of efficient query over text, image, audio, video and other domain specific data in XML using XML table index with integration of text index and other domain specific indexes | |
EP1585036A2 (en) | Management of parameterized database queries | |
KR101013810B1 (en) | An excel-based management system for updating db tables and the method thereof | |
US10042889B2 (en) | Pseudo columns for data retrieval | |
US7668888B2 (en) | Converting object structures for search engines | |
CA2627270A1 (en) | System and method for displaying data on a thin client | |
KR20080027251A (en) | Dynamic method for generating xml documents from a database | |
KR102034679B1 (en) | A data input/output system using grid interface | |
US20060129609A1 (en) | Database synchronization using change log | |
KR101908556B1 (en) | A database update system based on spreadsheet interface by finding out updated records automatically | |
US10657687B2 (en) | Dynamic chaining of data visualizations | |
US20060218174A1 (en) | Method for coordinating schema and data access objects | |
US11693822B2 (en) | Worker thread processing | |
JP2003281149A (en) | Method of setting access right and system of structured document management | |
Fehily | SQL | |
US10331715B2 (en) | Metadata enrichment with a keyword definition editor | |
KR100984976B1 (en) | The integrating and searching method of alien 2-dimension table |
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 |