节点文献

基于Zhang编码的XML与关系数据库中间件的研究与实现

The Research and Implementation of the Middleware between XML and RDBMS Based on Zhang Encode

【作者】 张博

【导师】 杨喜权;

【作者基本信息】 东北师范大学 , 计算机软件与理论, 2008, 硕士

【摘要】 随着Web应用之间的XML数据交换数量的不断增长,如何在数据库中可靠和有效地存储XML文档以及XML和数据库之间的数据交换技术将变得越来越重要。将XML数据存储到关系数据库中,可以利用关系数据库成熟的索引、存储、查询技术,但是,XML数据复杂的层次结构和关系数据库扁平的表结构之间的不匹配,使得在存储过程中出现很多复杂问题。从上述应用背景出发,本文分析了目前国内外XML数据存储相关技术及其优缺点,研究了相关的理论和技术。首先提出了一种基于区间编码在关系数据库中存储XML文档的方法,该方法是一种模型映射方法,采用统一的关系模式存储XML文档。基于这种存储方法,设计算法实现由XPath查询向SQL查询的转换。转换的过程分为三个步骤:首先由XPath表达式产生XPath查询图;然后,将这个查询图根据定位步分解为若干个子图,通过基于Zhang编码方案的XPath查询轴的计算判别条件得到这些子图所代表的定位步测试结点所对应的元素Zhang编码集合;最后,再根据该计算判别条件由上一步骤得到的Zhang编码集合产生SQL语句。此外,本文还设计了将关系数据发布为XML文档的算法,该算法既可以将存储在关系数据库中的XML文档进行还原,也可以使用户提交的XPath查询后得到的是XML文档片段形式的查询结果。整个系统设计为三个模块,分别是数据存储模块、查询转换模块和数据格式转换模块。在实现方法上,将整个系统分为数据访问层、业务逻辑层和用户界面层。实验表明,采用模型映射方法在关系数据库中存储XML文档,避免了采用结构映射的各种缺陷,发挥了关系数据库中数据管理的优势,实现了XML数据在关系模式中的有效存储。

【Abstract】 With the unceasingly increase of XML data exchanging amount among web applications, how to store XML documents and exchange data reliably and efficiently between XML and database is becoming more and more important. Index、storage and query of relational database can be used if we store XML document into relational database. But many complicated problems appear in the process of storage because of the unmatching between the complicated hierarchical structure of XML document and the flat structure of relational database.Beginning from the background applied above, this paper analyzes the advantages and disadvantages of related technology and instrument of XML document storage abroad and domestic at present, studies the related theory and technology. At first, this paper addresses how to store XML documents into RDBMS by using region encode. This method is one kind of model mapping methods, which stores XML documents using uniform relational schema. Based on this storage method, this paper designs an algorithm which implements the transformation from XPath query to SQL query. The process of transformation can be divided into three steps: First, construct XPath query graph from XPath expression. Secondly, according to the locating steps split query graph into several sub-graphs. By using calculation method of XPath query axis based on Zhang encode method, we can get Zhang encoding sets which are related to testing nodes in locating steps. These nodes are represented by sub-query graphs. Thirdly, by calculation method again we generate SQL according to Zhang encoding which are generated from former step. On the other hand, this paper addresses an algorithm of publishing relational data to XML format. This algorithm not only can convert relational data into XML document which is stored in RDBMS, but also can let user get XML format query result after submit XPath expressions.The whole system is designed into three modules, which are data storage module, query transformation module and data format transformation module. During the implementation, the system is divided into data access layer, business logic layer and user interface layer. Experiments show that storing XML document into RDBMS by using model mapping method can avoid limitations of structure mapping method. This kind of method takes advantage of the power of data management in RDBMS, implements efficient storage of storing XML document in relational schema.

  • 【分类号】TP311.52
  • 【下载频次】73
节点文献中: 

本文链接的文献网络图示:

本文的引文网络