KR20050116089A - Fixed-rdbms model based indexing technology for massive xml data searching with different schema - Google Patents

Fixed-rdbms model based indexing technology for massive xml data searching with different schema Download PDF

Info

Publication number
KR20050116089A
KR20050116089A KR1020040041016A KR20040041016A KR20050116089A KR 20050116089 A KR20050116089 A KR 20050116089A KR 1020040041016 A KR1020040041016 A KR 1020040041016A KR 20040041016 A KR20040041016 A KR 20040041016A KR 20050116089 A KR20050116089 A KR 20050116089A
Authority
KR
South Korea
Prior art keywords
xml
parent
information
order
attribute
Prior art date
Application number
KR1020040041016A
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 KR1020040041016A priority Critical patent/KR20050116089A/en
Publication of KR20050116089A publication Critical patent/KR20050116089A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions

Landscapes

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

Abstract

본 발명은 다양한 구조의 대용량 XML 데이터를 효율적으로 관리하고 다양한 질의를 수행할 수 있도록 XML 문서를 고정된 데이터베이스 테이블에 저장하는 시스템이다. 좀 더 상세히 하면, 자바 SAX PARSER를 이용한 XML 문서 파싱(parsing)시 XML 문서의 각 엘리먼트(element)별 깊이정보(element depth), 순서정보(element sequence), 속성정보(element attribute), 이름(element name), 부모정보(parent element), 시작위치(start position), 끝위치(end position)를 추출한 후, 이들 정보를 데이터베이스에 저장하기 위해 각각의 스키마정보와 엘리먼트정보 파일로 생성한다. 이렇게 생성된 text파일은 스키마 table과 엘리먼트 table에 저장되며, 각종 조건의 XML 질의를 처리할 수 있는 DB자료가 된다. 또한, 특정 엘리먼트에 대한 직접적인 접근이 가능하며, 다양한 구조의 XML 문서에 대하여 향상된 검색 성능을 제공할 수 있다.The present invention is a system for storing XML documents in fixed database tables to efficiently manage large amounts of XML data of various structures and to execute various queries. In more detail, when parsing an XML document using Java SAX PARSER, each element of the XML document includes element depth, element sequence, element attribute, and name. After extracting the name, parent element, start position, and end position, each schema information and element information file is generated to store these information in the database. The generated text file is stored in schema table and element table and becomes DB data that can process XML query of various conditions. In addition, direct access to specific elements is possible, and improved search performance can be provided for XML documents of various structures.

Description

상이한 구조의 대용량 XML Data 검색을 위한 고정된 RDBMS 모델 기반의 인덱싱 기법{Fixed-RDBMS Model Based Indexing Technology for Massive XML Data Searching with Different Schema} Fixed-RDBMS Model Based Indexing Technology for Massive XML Data Searching with Different Schema}

본 발명은 다양한 구조의 대용량 XML 데이터를 효율적으로 관리하고 다양한 질의를 수행할 수 있도록 XML 문서를 고정된 데이터베이스 테이블에 저장 관리하는 방법과 이를 수행하도록 프로그램된 소프트웨어에 관한 것이다. 더욱 상세히 설명하면, XML 문서를 파싱한 후, 각각의 엘리먼트 및 속성, 값에 대하여 깊이정보(element depth), 순서정보(element sequence), 속성정보(element attribute), 이름(element name), 부모정보 (parent element), 시작번호(start position), 끝번호(end position)를 추출하는 방법과 이를 text 파일로 생성 후 고정된 2개의 데이터베이스 테이블에 저장하는 방법 및 수행 프로그램에 관한 것이다.The present invention relates to a method for storing and managing an XML document in a fixed database table so as to efficiently manage a large amount of XML data having various structures and to execute various queries, and software programmed to perform the same. In more detail, after parsing an XML document, each element, attribute, and value of each element depth, element sequence, element attribute, element name, and parent information are parsed. (parent element), start position (end position), end position (end position) method of extracting, and how to create a text file and stored in two fixed database table and execution program.

최근 인터넷의 발전과 정보 양의 급증으로 인하여, 인터넷상의 효율적인 정보 교환을 위하여 차세대 웹문서의 표준인 XML(eXtensible Markup Language)에 대한 저장 및 검색에 대한 연구가 활발히 진행되고 있다. 또한, 이들 XML 형식의 데이터를 생성, 변경, 조작하기 위한 여러 표준들과 툴들이 등장하면서 구조가 다른 많은 XML 문서들도 증가되고 있다. 이러한 상황에서, 서로 상이한 구조를 가진 대규모 XML 문서들의 데이터 저장을 최적화하고, 이들로부터 필요한 정보를 쉽고 빠르게 추출하는 것은 매우 중요한 이슈가 되고 있다.Recently, due to the development of the Internet and the rapid increase in the amount of information, research on the storage and retrieval of XML (eXtensible Markup Language), which is the standard of next-generation web documents, is being actively conducted for efficient information exchange on the Internet. In addition, many standards and tools for creating, modifying, and manipulating data in these XML formats are on the rise. In such a situation, optimizing the data storage of large-scale XML documents having different structures and extracting the necessary information from them easily and quickly becomes a very important issue.

XML 문서에 대한 효율적인 경로 검색 지원을 위해 여러 XML 인덱스들이 제안되었다. 이들은 한 개의 대규모 XML 문서나 동일한 구조를 가진 여러 XML 문서들에 대한 효율적인 경로 검색 지원을 목표로 하고 있다. 그러므로 구조가 다른 여러 XML 문서들로부터 원하는 경로를 찾기 위해 이러한 인덱스들을 사용하는 경우, 우리는 각 XML 문서들에 대해 따로 인덱스를 구성하고, 모든 인덱스들을 검사해야 한다. 게다가, 찾는 경로가 조상-자손관계로 표현되는 경우, 구축된 인덱스들의 모든 노드(node)들을 방문해야만 원하는 경로를 찾을 수 있어, 검색 성능이 급격히 떨어지게 된다. 이를 보완하기 위한 인덱스가 제안되기도 하였으나, 루트가 아닌 경로 중간에 조상-자손 관계가 나타나는 경우, 성능이 떨어지는 단점을 가진다.Several XML indexes have been proposed to support efficient path retrieval for XML documents. They aim to support efficient path retrieval for one large XML document or multiple XML documents with the same structure. Therefore, when using these indexes to find the desired path from several XML documents with different structures, we must construct an index for each XML document and inspect all indexes. In addition, when the search path is represented by an ancestor-descendant relationship, all nodes of the constructed indexes must be visited to find the desired path, and thus the search performance is drastically degraded. In order to compensate for this, an index has been proposed. However, when an ancestor-progeny relationship appears in the middle of a path other than the root, performance has a disadvantage.

한편, 구조가 다른 XML 문서들을 함께 검색할 수 있는 통합 인덱스들도 제안되었는데, 이들은 정보 검색 분야에서 RDBMS 기반 역 인덱스에 XML의 구조적 성질을 반영시켜 확장하는 방식을 취하였다. 또한 인덱스내의 모든 노드 정보들을 데이터베이스내의 테이블에 저장하여 안정적으로 관리 될 수 있도록 구성하였으며, 데이터베이스 시스템에서 제공하는 효율적인 질의 처리 지원 기능들을 경로 검색에 이용함으로써 경로 검색을 위한 추가적인 구현을 막고 효율적인 검색을 지원하였다. 하지만, 제안된 인덱스들 중 문서의 수가 증가함에 따라 비교/검색해야 할 인덱스내의 데이터가 증가하게 되어 검색성능이 저하되며, 구조가 다른 문서들이 늘어날수록 성능이 떨어지는 단점을 보인다. 이러한 특징은 대량의 XML 문서들에 대한 경로 검색을 필요로 하는 상황에서, 이들을 적용하게 어렵게 만드는 요인으로 작용한다.On the other hand, unified indexes that can search XML documents with different structures were also proposed. In the field of information retrieval, they were extended by reflecting the structural characteristics of XML in RDBMS-based inverse index. In addition, all node information in the index is stored in a table in the database so that it can be stably managed. By using the efficient query processing functions provided by the database system for path search, it prevents additional implementation for path search and supports efficient search. It was. However, as the number of documents among the proposed indexes increases, the data in the index to be compared / searched increases, so that the search performance is deteriorated. As the number of documents with different structures increases, performance decreases. This feature makes it difficult to apply in situations that require path retrieval for large amounts of XML documents.

개별 XML 문서를 파일의 형태로 특정 폴더에 저장하는 파일시스템 기반의 저장방식을 살펴보면 문서 전체에 대한 추가 작업이 파일단위로 이루어지므로 상대적으로 저장 및 추출 속도가 빠른 반면, XML 문서의 추출 시마다 XML 파싱이 필요하므로 비효율적이며, 파일시스템의 한계로 인한 문서 개수 및 폴더 개수의 제한이 있고, 동시 사용자 접속에 대한 지원 및 접근제어 기능 구현이 불가능하고 XML 처리를 위한 모든 기능들을 별도로 구현할 필요성과 더불어 검색을 위해 추가적인 DBMS 사용이 필요하다. XML 문서를 RDBMS의 BLOB이나 CLOB의 형태로 저장하는 통합RDBMS 기반의 저장방식을 살펴보면 문서의 저장 및 추출 속도가 빠른 반면, 문서의 부분 수정이나 검색에 많은 시간이 소요되고 XML 문서에 대한 처리가 필요할 때마다 문서 전체를 메모리에 불러서 사용해야 하므로 많은 메모리와 시간이 필요하며 XML 처리를 위한 모든 기능들을 별도로 구현해 주어야 한다.Looking at the file system-based storage method that saves individual XML documents in a specific folder in the form of a file, the additional work on the entire document is done in units of files, so it is relatively fast to save and extract, while parsing XML every time an XML document is extracted. This is inefficient because of the need for the document system and the number of folders due to the limitation of the file system, and it is impossible to implement support and access control for simultaneous user access, and to search with the need to implement all functions separately for XML processing. Additional DBMS needs to be used. Looking at the integrated RDBMS-based storage method for storing XML documents in the form of BLOB or CLOB in the RDBMS, while storing and extracting documents is fast, it takes a lot of time to modify or retrieve the documents and requires processing for XML documents. Each time you need to load the entire document into memory, you need a lot of memory and time, and all the functions for XML processing must be implemented separately.

XML 문서를 구성하는 각 요소들의 단위로 분할하여 table의 field에 저장하는 분할 RDBMS 기반의 저장방식을 살펴보면 문서의 부분 수정이나 검색을 빠르게 수행할 수 있는 반면, 문서의 저장시 분할 작업을 수행하고 여러 table을 접근해야 하므로 많은 시간이 소요되고, 문서의 추출시 여러 table에 대한 join 과정을 거치므로 매우 느리며, 문서의 서식이 변경되거나 추가될 때마다 DB table의 설계를 변경하거나 추가해야 하므로 확장이 어렵고, XML 처리를 위한 모든 기능들을 별도로 구현해 주어야 한다.The partitioned RDBMS-based storage method that divides each element of an XML document into units of the table and stores them in a field of the table can be used to perform partial modification or retrieval of the document quickly. It takes a lot of time because you need to access the table, and it is very slow because it takes several tables to join the document extraction, and it is difficult to expand because the design of the DB table needs to be changed or added whenever the document format is changed or added. Therefore, all functions for XML processing must be implemented separately.

따라서, 본 발명은 위에서 언급한 문제점, 즉, 구조가 다른 문서들이 늘어날수록 검색 성능이 떨어지는 단점이나, 파일시스템 기반의 저장방식에서 발생하는 문제점들을 해결하기 위해, XML 문서의 스키마 정보와 엘리먼트 정보를 문서의 복잡성이나 크기에 관계없이 추출할 수 있도록 설계되었으며, 저장되는 데이터베이스 테이블의 속성은 XML 문서 구조의 추가, 변경에 관계없이 고정된 스키마 및 엘리먼트정보만 저장되므로 물리적 저장공간의 최적화 및 테이블 관리의 효율성을 제고한다. 또한, 사용자 질의를 SQL로 수행하는 방식을 제공하므로써 기존의 성숙된 데이터 베이스 기술을 최대로 활용할 수 있으며, 향상된 검색 성능을 제고한다Therefore, in order to solve the above-mentioned problems, that is, the disadvantage of retrieval performance as the number of documents having different structures increases, or the problems arising in the filesystem-based storage method, the schema information and element information of the XML document can be solved. It is designed to be extracted regardless of the complexity or size of the document. The fixed database and element information is stored regardless of the addition or change of XML document structure. Improve efficiency In addition, by providing a method of executing user queries in SQL, it is possible to make the best use of the existing mature database technology and improve the improved search performance.

이하 첨부된 도면에 의해 상세히 설명하면 다음과 같다. 도 1은 XML 문서 저장시스템의 구성도면이다. 도 1을 참조하면, String Data 로 구성된 XML 문서를 읽어 들여서 XML SAX Parser 를 통하여 XML 문서를 파싱(parsing)한다. XML 문서를 파싱한 결과 DOM Tree 구조로 만들어진 데이타를 가지고 각 엘리먼트에 시작번호, 끝번호를 할당한다. 그리고, Tree 구조의 XML에서 각종 정보를 추출한다. 추출된 각 엘리먼트의 깊이정보, 순서정보, 속성정보, 내용 등은 RDBMS 의 고정된 테이블에 저장한다.Hereinafter, described in detail by the accompanying drawings as follows. 1 is a configuration diagram of an XML document storage system. Referring to FIG. 1, an XML document composed of String Data is read and an XML document is parsed through an XML SAX Parser. As a result of parsing the XML document, each element is assigned a start and end number with data created in a DOM tree structure. Then, various kinds of information are extracted from the XML of the tree structure. Depth information, order information, attribute information, and contents of each extracted element are stored in a fixed table of the RDBMS.

도 2는 도3 내지 도7를 설명하기 위한 예제 XML 문서이다FIG. 2 is an example XML document for describing FIGS. 3 to 7.

도 3은 도2의 XML 문서를 파싱후 각 엘리먼트들의 시작번호와 끝번호를 정하는 방법을 나타낸 도면이다. 도 1에서 본 바와 같이 XML 문서를 파싱한 후 DOM Tree 구조로 만들어진다. 여기서 각 엘리먼트에 시작번호와 끝번호를 부여하는 방법은 다음과 같다. 제일 처음 시작되는 books 엘리먼트(root)에 시작번호를 0으로 할당한다. books 엘리먼트의 자식인 title 엘리먼트의 시작번호를 1로 할당한다. title 엘리먼트의 스트링 값인 'Data Model'의 시작번호를 2로, 끝번호를 3으로 할당한다. 스트링 값 'Data Model'의 부모인 title 엘리먼트의 끝번호를 4로 할당한다. books 엘리먼트의 자식이며, title 엘리먼트의 형제인 section 엘리먼트의 시작번호를 5로 할당한다. section 엘리먼트의 자식인 title 엘리먼트의 시작번호를 6으로 할당한다. title 엘리먼트의 스트링 값인 'Syntax For Data Model'의 시작번호를 7로 끝번호를 8로 할당한다. 스트링 값 'Syntax For Data Model' 의 부모인 title 엘리먼트의 끝번호를 9로 할당한다. title 엘리먼트의 부모인 section 엘리먼트의 끝번호를 10으로 할당한다. books 엘리먼트의 자식이며, title과 section 엘리먼트의 세 번째 형제인 section 엘리먼트의 시작번호를 11로 할당한다. section 엘리먼트의 자식인 title 엘리먼트의 시작번호를 12로 할당한다. title 엘리먼트의 스트링 값인 'XML'의 시작번호를 13으로, 끝번호를 14로 할당한다. 스트링 값 'XML'의 부모인 title 엘리먼트의 끝번호를 15로 할당한다. section 엘리먼트의 자식이며 title 엘리먼트의 형제엘리먼트인 section 엘리먼트의 시작번호를 16으로 할당한다. section 엘리먼트의 자식인 title 엘리먼트의 시작번호를 17로 할당한다. title 엘리먼트의 스트링 값인 'Basic Syntax'의 시작번호를 18로, 끝번호를 19로 할당한다. 스트링 값 'Basic Syntax'의 부모인 title 엘리먼트의 끝번호를 20으로 할당한다. title 엘리먼트의 부모인 section 엘리먼트의 끝번호를 21로 할당한다. section 엘리먼트의 자식이며, title과 section 엘리먼트의 세 번째 형제인 section 엘리먼트의 시작번호를 22로 할당한다. section 엘리먼트의 자식인 title 엘리먼트의 시작번호를 23으로 할당한다. title 엘리먼트의 스트링 값인 'XML and Semistructured Data'의 시작번호를 24로, 끝번호를 25로 할당한다. 스트링 값 'XML and Semistructured Data'의 부모인 title 엘리먼트의 끝번호를 26으로 할당한다. title 엘리먼트의 부모인 section 엘리먼트의 끝번호를 27로 할당한다. section 엘리먼트의 부모인 section 엘리먼트의 끝번호를 28로 할당한다. section 엘리먼트의 부모인 books 엘리먼트(root)의 끝번호를 29로 할당한다. FIG. 3 is a diagram illustrating a method of determining start and end numbers of elements after parsing an XML document of FIG. 2. As shown in Figure 1, after parsing an XML document, a DOM Tree structure is created. Here's how to assign start and end numbers to each element. Assign the starting number 0 to the books element (root) that starts first. Assign the start number of the title element, which is a child of the books element, to 1. Assign the start number of the 'Data Model', the string value of the title element, to 2 and the end number to 3. Assign the end number of the title element, which is the parent of the string value 'Data Model', to 4. Assign the starting number of the section element, which is a child of the books element, which is a sibling of the title element, to 5. Assign the start number of the title element, which is a child of the section element, to 6. Assign 'Syntax For Data Model', the string value of the title element, to 7 and to 8. Assign the end number of the title element, which is the parent of the string value 'Syntax For Data Model', to 9. Assign the end number of the section element, which is the parent of the title element, to 10. Assigns 11 the start number of the section element, which is a child of the books element, the third sibling of the title and section elements. Assign the starting number of the title element, which is a child of the section element, to 12. Assign 'XML', the string value of the title element, to 13 and to 14. Assign the end number of the title element, which is the parent of the string value 'XML', to 15. Assign the start number of the section element, which is a child of the section element and which is a sibling element of the title element, to 16. Assign the starting number of the title element, which is a child of the section element, to 17. Assign the starting number of 'Basic Syntax', the string value of the title element, to 18 and the ending number to 19. Assign the end number of the title element that is the parent of the string value 'Basic Syntax' to 20. Assign the end number of the section element, which is the parent of the title element, to 21. It assigns 22 the start number of the section element, which is a child of the section element, the third sibling of the title and section elements. Assign the starting number of the title element, which is a child of the section element, to 23. Assign 'XML and Semistructured Data', the string value of the title element, to 24 and to 25. Assign the end number of the title element, which is the parent of the string value 'XML and Semistructured Data', to 26. Assign the end number of the section element, which is the parent of the title element, to 27. Assign the end number of the section element, which is the parent of the section element, to 28. Assign the end number of the book element (root), which is the parent of the section element, to 29.

도 4는 XML SAX을 실행하여 XML 문서의 스키마 구조정보 추출 및 파일 생성을 표현한 순서도이다. Sax를 실행하면 가장 먼저 (1)을 실행한다. (1)은 현재위치를 1로 레벨(Depthid)를 29999으로 초기화한다. 문서번호는 DB의 최종문서번호에 1 증가시킨값이다. (2)는 각각의 엘리먼트를 순차적으로 읽는다. (3)은 읽은 엘리먼트의 구문을 비교하여 시작('< >'), 종료('</ >')에 따라 각각의 함수를 처리한다. (4)는 엘리먼트가 시작되는 경우로, 현재 레벨(Depthid)를 1 증가시킨다. 엘리먼트시퀀스 해쉬에 현재레벨(Depthid)+현재엘리먼트이름+부모레벨(Depthid)+부모엘리먼트이름이 존재하면 현재레벨(Depthid)의 엘리먼트시퀀스는 변동 없이 다음 단계로 분기하고, 그렇치 않으면 현재레벨(Depthid)의 엘리먼트시퀀스를 1증가 시킨후 현재레벨+현재엘리먼트이름+부모레벨(Depthid)+부모엘리먼트이름으로 엘리먼트시퀀스해쉬에 엘리먼트시퀀스를 추가 저장한다. 스키마 정보 파일에 현재레벨, 엘리먼트시퀀스, 속성시퀀스('0'), 엘리먼트이름, 부모레벨(현재레벨-1), 부모엘리먼트시퀸스(엘리먼트시퀀스해쉬에서 부모레벨+부모엘리먼트이름+조부모레벨+조부모엘리먼트이름을 key로 검색), 부모속성시퀸스('0')를 저장한다. (5)는 엘리먼트의 속성 유무를 체크하여 존재하는 경우 (6)을 실행하고 없으면 다음 엘리먼트를 읽는다(2). (6)은 엘리먼트의 속성시퀸스를 파일 저장하기 위한 것으로 현재레벨(Depthid)을 1 증가시킨다. 속성시퀀스 해쉬에 현재레벨(Depthid)+현재속성이름+부모레벨(Depthid)+부모엘리먼트이름이 존재하면 현재레벨(Depthid)의 속성시퀀스는 변동 없이 다음 단계로 분기하고, 그렇치 않으면 현재레벨(Depthid)의 속성시퀀스를 1증가 시킨후 현재레벨+현재속성이름+부모레벨(Depthid)+부모엘리먼트이름으로 속성시퀀스해쉬에 속성시퀀스를 추가 저장한다. 스키마 정보 파일에 현재레벨, 엘리먼트시퀀스('0'), 속성시퀀스, 엘리먼트이름, 부모레벨(현재레벨-1), 부모엘리먼트시퀸스(엘리먼트시퀀스해쉬에서 부모레벨+부모엘리먼트이름+조부모레벨+조부모엘리먼트이름을 key로 검색), 부모속성시퀸스('0')를 저장한다. 현재레벨을 1 감소 시킨다. (7)은 엘리먼트가 종료되는 경우로, 현재레벨(Depthid)을 1 감소 시킨다. (8)은 XML 문서의 끝을 만난 경우로, XML SAX의 실행을 종료한다.FIG. 4 is a flowchart expressing schema structure information extraction and file generation of an XML document by executing XML SAX. When you run Sax, first run (1). (1) initializes the current position to 1 and the level (Depthid) to 29999. The document number is increased by one to the final document number of the DB. (2) reads each element sequentially. (3) compares the syntax of the elements read and processes each function according to the start ('<>') and end ('</>'). (4) is the start of the element, which increases the current level (Depthid) by one. If the current level (Depthid) + current element name + parent level (Depthid) + parent element name exists in the element sequence hash, the element sequence of the current level (Depthid) branches to the next step without change, otherwise the current level (Depthid) After increasing the element sequence of 1, add the element sequence to the element sequence hash with the current level + current element name + parent level (Depthid) + parent element name. Current level, element sequence, attribute sequence ('0'), element name, parent level (current level-1), parent element sequence (parent level + parent element name + grandparent level + grandparent element in element sequence hash) Retrieve name by key), and store parent property sequence ('0'). (5) checks whether an element is present or not and executes (6) if present, and reads the next element (2). (6) is to store the attribute sequence of an element and increases the current level (Depthid) by one. If the current level (Depthid) + current attribute name + parent level (Depthid) + parent element name exists in the attribute sequence hash, the attribute sequence of the current level (Depthid) branches to the next step without change, otherwise the current level (Depthid) After increasing the attribute sequence of 1, add the attribute sequence to the attribute sequence hash with the current level + current attribute name + parent level (Depthid) + parent element name. Current level, element sequence ('0'), attribute sequence, element name, parent level (current level-1), parent element sequence (parent level + parent element name + grandparent level + grandparent element in element sequence hash) Retrieve name by key), and store parent property sequence ('0'). Decreases the current level by 1. (7) is the end of the element, which decreases the current level (Depthid) by one. (8) is the case where the end of the XML document is met, and the execution of XML SAX is terminated.

도 5는 도 2의 XML 문서를 도 4에서 실행시킨 후, 생성된 스키마구조 정보에 대한 text 파일 내용이다. 각 행에서 열의 구분은 콤마(,)로 구분된다. 첫 번째 열의 정보는 엘리먼트 깊이(Depth id)를, 두 번째 열은 동일 부모 하에 엘리먼트의 형제순서를, 세 번째 열은 동일 엘리먼트 내의 속성순서를, 네 번째 열은 부모엘리먼트 깊이를, 다섯 번째 열은 부모엘리먼트의 형제순서를, 여섯 번째 열은 부모엘리먼트 내의 속성순서를, 일곱 번째 열은 엘리먼트 이름을 나타낸다. 그리고, 각각의 행은 구조가 다른 엘리먼트의 스키마 정보이다.FIG. 5 shows the contents of a text file of the generated schema structure information after executing the XML document of FIG. 2 in FIG. 4. The columns in each row are separated by commas. The information in the first column is the element depth, the second column is the sibling order of the elements under the same parent, the third column is the attribute order within the same element, the fourth column is the parent element depth, and the fifth column is the The sibling order of the parent element, the sixth column shows the attribute order within the parent element, and the seventh column shows the element name. Each row is schema information of an element having a different structure.

도 6은 XML SAX을 실행하여 XML에서 각각의 엘리먼트 경로정보 추출 및 파일 생성을 표현한 순서도이다. Sax를 실행하면 가장 먼저 (1)을 실행한다. (1)은 현재위치를 1로, 레벨(Depthid)를 29999으로 초기화한다. 문서번호는 DB의 최종문서번호에 1 증가시킨 값이다. (2)는 각각의 엘리먼트를 순차적으로 읽는다. (3)은 읽은 엘리먼트의 구문을 비교하여 시작('< >'), 종료('</ >'), 값(characters)에 따라 각각의 함수를 처리한다. (4)는 엘리먼트가 시작되는 경우로, 현재위치를 1 증가시키고 현재레벨(Depthid)를 1 증가시킨다. 레벨해쉬에는 현재레벨(Depthid)과 현재레벨(Depthid)+현재엘리먼트이름을 각각 저장한다. 시작위치해쉬에는 현재레벨(Depthid)+현재엘리먼트이름+부모레벨(Depthid)+부모엘리먼트이름과 시작위치(현재위치)를 각각 저장한다. (5)는 엘리먼트의 속성 유무를 체크하여 존재하는 경우 (6)을 실행하고 없으면 다음 엘리먼트를 읽는다(2). (6)은 엘리먼트의 속성 값을 파일 저장하기 위한 것으로 현재위치를 1 증가하고 현재레벨(Depthid)을 1 증가시킨다. 레벨해쉬에는 현재레벨(Depthid)과 현재레벨(Depthid)+현재속성이름을 저장한다. 시작위치해쉬에는 현재레벨(Depthid)+현재속성이름+부모레벨(Depthid)+부모엘리먼트이름과 시작위치(현재위치)를 저장한다. 종료위치는 현재위치를 1 증가한 값이다. 엘리먼트 정보 파일에 현재문서번호, 현재레벨, 엘리먼트시퀀스('0'), 속성시퀀스(도 4의 속성시퀀스해쉬에서 현재레벨(Depthid)+현재속성이름+부모레벨(Depthid)+부모엘리먼트이름을 key로 검색), 시작위치, 종료위치, 속성값을 저장한다. 현재레벨(Depthid)을 1 감소 시킨다. (7)은 엘리먼트가 종료되는 경우로, 현재위치를 1 증가시킨 후, 종료위치에 현재위치를 저장한다. 엘리먼트 정보 파일에 현재문서번호, 현재레벨, 엘리먼트시퀀스(도 4의 엘리먼트시퀀스해쉬에서 현재레벨(Depthid)+현재엘리먼트이름+부모레벨(Depthid)+부모엘리먼트이름을 key로 검색), 속성시퀀스('0'), 시작위치(시작위치해쉬에서 현재레벨(Depthid)+현재엘리먼트이름+부모레벨(Depthid)+부모엘리먼트이름을 key로 검색), 종료위치, 속성값을 저장한다. 현재레벨(Depthid)을 1 감소 시킨다. (8)은 엘리먼트 값을 만난 경우로, 현재위치를 1 증가시킨 후, 시작위치에 현재위치를 저장한다. 다시, 현재위치를 1 증가시킨 후, 종료위치에 현재위치를 저장한다. 엘리먼트 정보 파일에 현재문서번호, 현재레벨, 엘리먼트시퀀스(도 4의 엘리먼트시퀀스해쉬에서 현재레벨(Depthid)+현재엘리먼트이름+부모레벨(Depthid)+부모엘리먼트이름을 key로 검색), 속성시퀀스('0'), 시작위치, 종료위치, 엘리먼트 값을 저장한다. (9)는 XML 문서의 끝을 만난 경우로, XML SAX의 실행을 종료한다.6 is a flowchart illustrating the extraction of each element path information and file generation in XML by executing XML SAX. When you run Sax, first run (1). (1) initializes the current position to 1 and the level (Depthid) to 29999. The document number is increased by one to the final document number of the DB. (2) reads each element sequentially. (3) compares the syntax of the elements read and processes each function according to the start ('<>'), end ('</>'), and values (characters). (4) is the case where the element starts, and increases the current position by one and increases the current level (Depthid) by one. The level hash stores the current level (Depthid) and the current level (Depthid) + current element name. The start position hash stores the current level (Depthid) + current element name + parent level (Depthid) + parent element name and start position (current position), respectively. (5) checks whether an element is present or not and executes (6) if present, and reads the next element (2). (6) is to save the attribute value of an element. It increases the current position by 1 and increases the current level (Depthid) by 1. The level hash stores the current level (Depthid) and the current level (Depthid) + current property name. The start position hash stores the current level (Depthid) + current attribute name + parent level (Depthid) + parent element name and start position (current position). End position is the current position increased by one. Enter the current document number, current level, element sequence ('0'), and attribute sequence (Depthid + current attribute name + parent level (Depthid) + parent element name in the attribute sequence hash of FIG. 4) in the element information file. Search), start position, end position and attribute value. Decreases the current level by one. (7) is the end of the element. After increasing the current position by 1, the current position is stored at the end position. In the element information file, the current document number, current level, and element sequence (search for the current level (Depthid) + current element name + parent level (Depthid) + parent element name in the element sequence hash of FIG. 4 by key), and attribute sequence (' 0 '), start position (search current level (Depthid) + current element name + parent level (Depthid) + parent element name with key), end position, and attribute value. Decreases the current level by one. (8) is the case of encountering an element value. After increasing the current position by 1, save the current position at the start position. Again, increase the current position by 1 and save the current position at the end position. In the element information file, the current document number, current level, and element sequence (search for the current level (Depthid) + current element name + parent level (Depthid) + parent element name in the element sequence hash of FIG. 4 by key), and attribute sequence (' 0 '), start position, end position, element value are saved. (9) is the case where the end of the XML document is met, and the execution of XML SAX is terminated.

도 7은 도 2의 XML 문서를 도 6에서 실행시킨 후, 생성된 엘리먼트 경로정보에 대한 text 파일 내용이다. 각 행에서 열의 구분은 콤마(,)로 구분된다. 첫 번째 열의 정보는 XML문서 id를, 두 번째 열은 엘리먼트 깊이(Depth id)를, 세 번째 열은 동일 부모 하에 엘리먼트의 형제순서를, 네 번째 열은 동일 엘리먼트 내의 속성순서를, 다섯 번째 열은 엘리먼트의 시작위치를, 여섯 번째 열은 엘리먼트의 종료위치를, 일곱 번째 열은 엘리먼트 내용을 나타낸다. 그리고, 각각의 행은 XML문서 상의 엘리먼트 경로 및 내용 정보이다.FIG. 7 illustrates the text file contents of the generated element path information after executing the XML document of FIG. 2. The columns in each row are separated by commas. The information in the first column is the XML document id, the second column is the element depth, the third column is the sibling order of the elements under the same parent, the fourth column is the attribute order within the same element, and the fifth column is the The start position of the element, the sixth column the end position of the element, and the seventh column the element contents. Each row is an element path and content information on an XML document.

도 8은 도4와 도6에서 각각 생성된 text파일 도5와 도7를 데이터베이스에 저장하는 table구조 도면이다. X table은 XML문서의 스키마 구조정보(도5)를, Y table은 각 엘리먼트의 경로 정보 및 값(도7)을 저장하는 고정화된 테이블 구조이다. 다음은 X table의 구체적인 속성 정보를 설명한다. (단, 동일 부모 하에 깊이정보와 엘리먼트이름이 동일한 경우에는 동일 스키마 구조로 간주하여, 최초 엘리먼트 정보만 Y table에 저장한다.) FIG. 8 is a table structure diagram for storing text files FIGS. 5 and 7 generated in FIGS. 4 and 6 in a database, respectively. X table is a fixed table structure that stores the schema structure information of the XML document (FIG. 5), and Y table stores path information and values (FIG. 7) of each element. The following describes specific attribute information of X table. (However, if the depth information and the element name are the same under the same parent, it is regarded as the same schema structure and only the first element information is stored in the Y table.)

A Field에는 각 엘리먼트의 깊이정보를 저장한다.A field stores depth information of each element.

B Field에는 동일 부모 하에서 형제 엘리먼트간의 순서정보를 저장한다.B field stores order information between sibling elements under the same parent.

C Field에는 각 엘리먼트내 속성들의 순서정보를 저장한다.The C field stores the order information of the attributes in each element.

D Field에는 각 엘리먼트의 이름을 저장한다.D Field stores the name of each element.

E Field에는 각 엘리먼트의 부모엘리먼트의 깊이정보를 저장한다.E Field stores the depth information of each element's parent element.

F Field에는 각 엘리먼트의 부모엘리먼트의 형제엘리먼트 순서정보를 저장한다.The F field stores sibling element order information of the parent element of each element.

G Field에는 각 엘리먼트의 부모엘리먼트내 속성들의 순서정보를 저장한다.G field stores the order information of the attributes in the parent element of each element.

다음은 Y table의 구체적인 속성 정보를 설명한다.The following describes the specific property information of the Y table.

I Field에는 Document ID를 저장한다.I Field stores the Document ID.

J Field에는 각 엘리먼트의 깊이정보를 저장한다.J field stores depth information of each element.

K Field에는 동일 부모 하에서 형제 엘리먼트간의 순서정보를 저장한다.The K field stores the order information between sibling elements under the same parent.

L Field에는 각 엘리먼트내 속성들의 순서정보를 저장한다.The L field stores the order information of the attributes in each element.

M Field에는 각 엘리먼트의 시작번호를 저장한다.The M field stores the start number of each element.

L Field에는 각 엘리먼트의 끝번호를 저장한다.The L field stores the end number of each element.

O Field에는 각 엘리먼트의 내용(characters)을 저장한다.O Field stores the contents of each element.

이상에서 상술한 바와 같이, 본 발명은 다양한 계층구조를 가진 XML 문서들의 데이터 구조정보와 데이터들을 2가지 형식의 고정된 관계형 데이터베이스 테이블에 저장 관리함으로써 대용량의 XML문서를 빠르게 검색할 수 있으며, XML문서의 물리적 기억장소의 효율적 관리와 XML 문서의 추가 및 변경에도 쉽게 대응 할 수 있다. 또한, XML문서의 형식이 변경되는 경우에도 테이블 속성의 논리적 변경이 필요 없는 편리성을 제공하며, 다양한 검색조건을 2개의 테이블만으로 처리할 수 있어 실제 업무 활용도를 높일 수 있게 된다. XML 문서 파싱(parsing)시 생성된 파일 정보는 기존의 성숙된 데이터베이스에 저장이 용이함으로 다양한 RDBMS 시스템에 호환적으로 적용할 수 있다. As described above, in the present invention, data structure information and data of XML documents having various hierarchical structures can be stored and managed in two types of fixed relational database tables to quickly search a large XML document. It can cope with efficient management of physical storage location and addition and change of XML document. In addition, even if the format of the XML document is changed, it provides the convenience that does not require logical change of the table property, and it is possible to process various search conditions with only two tables, thereby increasing the practical use of the work. File information generated when parsing an XML document can be easily stored in an existing mature database and can be applied to various RDBMS systems.

도 1은 XML 문서 저장시스템의 구성도면   1 is a configuration diagram of an XML document storage system

도 2는 예제 XML 문서을 나타낸 도면  2 shows an example XML document.

도 3은 도 2의 XML 문서를 파싱(parsing) 후 엘리먼트들의 시작번호  3 is a start number of elements after parsing the XML document of FIG.

(start position)와 끝번호(end position)를 추출하는 방법을 나타낸 도면 Drawing showing how to extract start position and end position

도 4는 XML SAX을 실행하여 XML에서 문서의 스키마 구조정보 추출 및   Figure 4 extracts schema structure information of a document from XML by executing XML SAX and

파일 생성을 나타낸 순서도Flowchart showing file creation

도 5는 도2의 XML문서를 도4에서 실행한 후 생성된 스키마 정보파일을   5 is a schema information file generated after executing the XML document of FIG.

나타낸 도면 Drawing shown

도 6은 XML SAX을 실행하여 XML에서 각각의 엘리먼트 경로정보 추출 및  6 illustrates the extraction of respective element path information from XML by executing XML SAX;

파일 생성을 나타낸 순서도 Flowchart showing file creation

도 7은 도2의 XML문서를 도6에서 실행한 후 생성된 엘리먼트 정보파일을  FIG. 7 illustrates an element information file generated after executing the XML document of FIG.

나타낸 도면Drawing shown

도 8은 도5와 도7의 text 파일을 데이터베이스에 저장하는 table구조   8 is a table structure for storing the text file of FIGS. 5 and 7 in a database.

도면drawing

Claims (2)

XML 문서를 데이터베이스 테이블에 저장하기 위하여, XML 스키마 정보(element깊이, element순서, element속성순서, element명, 부모element깊이, 부모element순서, 부모element속성순서)와 엘리먼트 정보(문서id, element깊이, element순서, element속성순서, element시작위치, element종료위치, element값)를 text 파일로 생성하는 과정.To store an XML document in a database table, XML schema information (element depth, element order, element attribute order, element name, parent element depth, parent element order, parent element attribute order) and element information (document id, element depth, Process of creating element order, element attribute order, element start position, element end position, element value) into text file. 제1항에서 생성된 text 파일을 관계형 데이터베이스에 저장하기 위하여 각각의 파일 속성과 동일한 스키마 관리 table (element깊이, element순서, element속성순서,element명, 부모element깊이, 부모element순서, 부모element속성순서) 및 엘리먼트 관리 table (문서id, element깊이, element순서, element속성순서, element시작위치, element종료위치, element값)의 생성과정, 그리고 각각의 테이블에 제1항에서 생성된 text 파일을 저장(insert)하는 과정을 특징으로하는 XML 문서의 데이터베이스 저장 관리방법과 이를 수행하도록 프로그램된 소프트웨어.In order to save the text file created in the relational database, the same schema management table as each file attribute (element depth, element order, element attribute order, element name, parent element depth, parent element order, parent element attribute order) ) And the process of creating an element management table (document id, element depth, element order, element attribute order, element start position, element end position, element value), and storing the text file created in claim 1 in each table ( A method for managing database storage of XML documents characterized by a process of inserting and software programmed to perform the same.
KR1020040041016A 2004-06-04 2004-06-04 Fixed-rdbms model based indexing technology for massive xml data searching with different schema KR20050116089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020040041016A KR20050116089A (en) 2004-06-04 2004-06-04 Fixed-rdbms model based indexing technology for massive xml data searching with different schema

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020040041016A KR20050116089A (en) 2004-06-04 2004-06-04 Fixed-rdbms model based indexing technology for massive xml data searching with different schema

Publications (1)

Publication Number Publication Date
KR20050116089A true KR20050116089A (en) 2005-12-09

Family

ID=37289827

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020040041016A KR20050116089A (en) 2004-06-04 2004-06-04 Fixed-rdbms model based indexing technology for massive xml data searching with different schema

Country Status (1)

Country Link
KR (1) KR20050116089A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100899616B1 (en) * 2008-01-25 2009-05-27 주식회사 케이티프리텔 Method and system of management metadata using relational database management system
KR102170738B1 (en) * 2020-04-23 2020-10-27 국방과학연구소 Method, apparatus and system for transmitting and receiving message

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100899616B1 (en) * 2008-01-25 2009-05-27 주식회사 케이티프리텔 Method and system of management metadata using relational database management system
KR102170738B1 (en) * 2020-04-23 2020-10-27 국방과학연구소 Method, apparatus and system for transmitting and receiving message

Similar Documents

Publication Publication Date Title
Cooper et al. A fast index for semistructured data
EP1635272B1 (en) Method for evaluating XML twig queries using index structures and relational query processors.
US8935267B2 (en) Apparatus and method for executing different query language queries on tree structured data using pre-computed indices of selective document paths
US20070174309A1 (en) Mtreeini: intermediate nodes and indexes
WO2007143666A2 (en) Element query method and system
US8543614B2 (en) Packing nodes into records to store XML XQuery data model and other hierarchically structured data
Sacks-Davis et al. Database systems for structured documents
Fiebig et al. Natix: A technology overview
Wu et al. TwigTable: using semantics in XML twig pattern query processing
Bressan et al. Accelerating queries by pruning XML documents
Pal et al. XML support in Microsoft SQL Server 2005
Haw et al. Query optimization techniques for xml databases
KR20050116089A (en) Fixed-rdbms model based indexing technology for massive xml data searching with different schema
KR100612376B1 (en) A index system and method for xml documents using node-range of integration path
KR100678123B1 (en) Method for storing xml data in relational database
Meier Index-driven XQuery processing in the eXist XML database
Wu et al. VERT: A semantic approach for content search and content extraction in XML query processing
Park et al. XML query processing using signature and dtd
Enhong et al. Semi-structured data extraction and schema knowledge mining
Madria et al. Efficient processing of XPath queries using indexes
El Alami et al. Schema and Data Migration of a Relational Database RDB to the Extensible Markup Language XML
Win et al. ENAXS: efficient native XML storage system
KR100555982B1 (en) Information retrieval system for XML documents, its implementation methods, and the storage media containing program sources and the methods thereof
KR20060032463A (en) Method for constructing xml db and system and its method for xquery engine in searching massive xml data with different schema
Thilagam Schema-Aware Indexes For Json Document Collections

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E601 Decision to refuse application