基于通用关系模式的XML数据存储模型研究

上传人:jiups****uk12 文档编号:40349417 上传时间:2018-05-25 格式:PDF 页数:78 大小:731.03KB
返回 下载 相关 举报
基于通用关系模式的XML数据存储模型研究_第1页
第1页 / 共78页
基于通用关系模式的XML数据存储模型研究_第2页
第2页 / 共78页
基于通用关系模式的XML数据存储模型研究_第3页
第3页 / 共78页
基于通用关系模式的XML数据存储模型研究_第4页
第4页 / 共78页
基于通用关系模式的XML数据存储模型研究_第5页
第5页 / 共78页
点击查看更多>>
资源描述

《基于通用关系模式的XML数据存储模型研究》由会员分享,可在线阅读,更多相关《基于通用关系模式的XML数据存储模型研究(78页珍藏版)》请在金锄头文库上搜索。

1、上海交通大学硕士学位论文基于通用关系模式的XML数据存储模型研究姓名:周平平申请学位级别:硕士专业:软件工程指导教师:姚天昉;包自更20090501基于通用关系模式的 XML 数据存储模型研究 I 基于通用关系模式的 XML 数据存储模型研究基于通用关系模式的 XML 数据存储模型研究 摘 要 随着 Web 应用之间的 XML 数据交换数量的不断增长, 如何在数据库中可靠和有效地存储 XML 文档以及 XML 和数据库之间的数据交换技术将变得越来越重要。关系数据库具有成熟的索引、存储、查询技术,将 XML 数据存储到关系数据库中将极具意义。但是,XML 数据复杂的层次结构和关系数据库扁平的表达

2、结构之间的不匹配,使得在存储过程中出现了很多复杂的问题。 从上述应用背景出发, 本文分析了目前国内外 XML 数据存储相关技术及其优缺点,研究了相关的理论和技术。其中特别对于层次结构的两种存储方式进行了对比分析。其中邻接列表模型(Adjacency List Model)数据存储方式很直观,但是由于其在处理层次关系中通常要“递归”调用,所以效率较低;另外一种嵌套集合模型(Nested Sets Model)为每个结点分配了两个整数坐标,通过比较这些坐标比较就能够得出结点的层次关系,它不再把层次结点看成点与线了,而是实际是用一个个嵌套容器来表述数据,当然嵌套容器的边界就是两个整数坐标, 所以本文

3、基于嵌套集合模型提出了一种基于模型映射的通用的关系存储模型,在该模型下能够将所有的 XML 文档结构无损地存储到一种通用的关系模型中,该模型被称为通用的 XML 关系型存储模型(General XML Relational Model)简称(GXRM) 。 XML 获得广泛应用的关键是 XML 数据资源的查询与检索,查询处理的关键技术是转换规则的建立,即如何将查询 XML 的路径表达式通过某一种规则转换成基于关系数据库的 SQL 查询语言。在本文中介绍了基于 GXRM 模型的抽取查询模式以及选择模查询模式的查询转换方案,其中选择模式选取 Xpath 表达式来描述。抽取查询模式方案中将 XML

4、的结点符号分为若干类型,然后对于每个结点构造出其应有的类型的符号,最后再将结点合并即为所有的需要重构的文档内容。对于选择模查询模式首先利用Xpath 图将 Xpath 表达式解析成有结构的形式,从而使其能够更好地被识别。然后,再基于 Xpath 图给出查询转换规则算法,进而生成查询代码。 最后,本文介绍了基于该模型以及查询算法的通用 XML 关系存储模型中间件设计方案,其功能模块包含文档解析器、XML 转换器、查询解析器、SQL 生成器、XML 文档生成器。 通过实验并且分析了在各个查询场景下实验数据的正确性以及性能情况后表基于通用关系模式的 XML 数据存储模型研究 II 明,该中间件能够使

5、 XML 数据在关系模式中有效存储,并且能正确反映测试结果,在处理常用 Xpath 轴关系(父亲/儿子关系、祖先/后代关系)以及常用谓词操作(属性谓词、位置谓词、结点值谓词)中可以满足查询性能要求。 关键词 XML 数据库,关系模型,模型映射,嵌套集合模型,Xpath 基于通用关系模式的 XML 数据存储模型研究 III THE RESEARCH ON STORING XML DATA BASED ON GENERAL RELATIONAL MODEL ABSTRACT With the unceasingly increase of XML data exchanging amount am

6、ong web applications, how to store XML documents and exchange data reliably and efficiently between XML and database is becoming more and more important. It is very meaningful to store the XML document into relational database because of index、storage and query of relational database are well-develo

7、ped. 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 disadvantage

8、s of related technology and software tool of XML document storage abroad and domestic at present, studies the related theory and technology. Especially the paper focuses on doing a comparative analysis within two kinds of hierarchical storage structure, The adjacency list model seems easily understo

9、od. The model is considered as poor performance beacause it usually apply the recursive operation to handle the hierarchical structure. The other one which is called nested sets model allocates two integer coordinates for the each XML node. We can get the hierarchical relationship by means of compar

10、ing these coordinates. The model do not regard the hierarchical structure as ponit and line any more, but to represent the XML data through the nested container whose boundary are these coordinates. For the above reason this paper addresses a general relational schema based on the nested sets model

11、called General XML Relational Model, in which can store the XML data integrallty. Quering and searching on XML data is the basis of XMLs being widely applied. The key 基于通用关系模式的 XML 数据存储模型研究 IV technology of quering is the foundation of transformation rule. In other words the technology is how to con

12、vert the XML path expression to SQL language in RDBMS based on some rules. The paper presents the transformation solutons of extract query mode and select query mode, and we select the Xpath expression to describe the select query mode solution. The extract query mode divide the XML node symbol into

13、 several types, and then construct the corresponding symbol for each node to be extracted. The above nodes are integrated to the XML document finally. In the select query mode the Xpath expression will be parsed to XpathGraph so that it can be identified easily. We can get the transformation algorit

14、hm based on the XpathGraph, and then generate the SQL code. Finally, the paper introduces the system design solution of middleware based on the General XML Relational Model and algorithm mentioned above to handle quering and storage. The function of the middleware includes XML Parser, XML Translator

15、, Query Parse, SQL Generator, and XML Generator. After analyzing the validity and performance of the system in various scenes, we can draw the conclusion that the middleware can implements efficient storage for XML document in the relational schema, and can get the correct result in the correctness

16、testing. Also the middleware can satisfy the quering request when handling the common Xpath axis processing(parent/son axis, ancestor/descendant axis) and predict processing(attribute predict, node predict, position predict). Keywords XML Database, Relational Model, Model Mapping, Nested Sets Model, Xpath 基于通用关系模式的 XML 数据存储模型研究 上海交通大学上海交通大学 学位论文原创性声明学位论文原创性声明 本人郑重声明:所呈交的学位论文,是本人在导师的指导下,独立进行研究工作所取得的成果。除文中已经注明引用的内容外,本论文不包含任何其他个人或集体已经发表或撰写过的作品成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。本人完全意识到本声明的法律结果由本

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 学术论文 > 毕业论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号