一种基于关系数据库的XML文档存储和查询的方法硕士毕业论文.doc
《一种基于关系数据库的XML文档存储和查询的方法硕士毕业论文.doc》由会员分享,可在线阅读,更多相关《一种基于关系数据库的XML文档存储和查询的方法硕士毕业论文.doc(16页珍藏版)》请在三一办公上搜索。
1、一种基于关系数据库的XML文档存储和查询的方法A RDB-Based Approach to Storage and Query of XML Document ContentsChapter 1 Introduction 11.1 Research situation at home and abroad 11.2 The main work in the thesis 31.3 Structure of the thesis 4Chapter 2 Background of XML 52.1 Origin and characteristic of XML52.2 Types of XML
2、 document 62.2.1 XML document 62.2.2 DTD document 72.2.3 XML Schema 72.3 Query language of XML 82.3.1 Basic syntax of XPath 82.3.2 Calculation of the path expression 102.4 Heterogeneity between XML and RDB 11Chapter 3 Storage transformation based on path 133.1 Storage structure based on path 133.1.1
3、 Value Table 133.1.2 No_Value_Table 153.2 Storage mapping algorithm 16Chapter 4 Mechanism of query processing 184.1 Transformation rules of linear path expression 184.1.1 Simple path including parents-child only 194.1.2 Simple path including ancestor-descendant 194.2 Processing of non-linear path ex
4、pression 22Chapter 5 Further optimization of storage and query 255.1 Schema of storage optimization 255.2 Schema of storage optimization 26Chapter 6 Design and implement of the system 286.1 Whole design framework of the system 286.2 Function of the system modules 286.2.1 XML-parser 286.2.2 Storage p
5、rocessor 306.2.3 Query processor 316.3 Experiment result and analysis of the system performance 31Conclusion 34Reference 36Acknowledgment 40摘 要XML已成为Web上数据表示、集成和交换的标准,它的格式简单、自我描述能力强,实现了内容、结构和表现三者的分离,更适合于数据表示和交换。近年来,XML在各个领域得到了广泛的使用,Web上已经涌现了大量的XML数据。为了有效地加工、分析和处理XML数据,国内外学者已经提出了各种XML的查询语言和存储管理技术。由于关
6、系数据库是目前最成熟的一种数据管理技术,在存储和管理XML数据的各种方式中,基于关系数据库的XML数据存储和处理技术显然是一种可行而有效的方式,并在学术界受到了广泛的关注。然而,由于数据模型的差异,利用关系数据库存储和查询XML数据给传统数据库技术带来了许多新的挑战。本文对XML数据的关系存储、路径表达式的查询处理等方面进行了深入的研究和探讨,发现了目前已有的XML数据的关系存储方法中的不足之处。提出了一种新的利用关系数据库存储和查询XML数据的方法,这种方法将XML文档树中有文本值的节点和文本值的节点分别存储在两个关系表中,它不关心文档DTD的模式信息,也不需要建立任何索引结构。针对这种存储
7、方法的特点,本文提出将XPath路径表达式的核心子集转换成SQL语句的转换规则和算法。具体来说,本文的主要工作如下:(1)提出了一种新的XML数据的关系存储方法。这种方法完整无损地记录了XML文档中的各节点信息、边信息和值信息,即在关系表中存储XML文档中所有有值元素/属性的路径,以及各元素的id、Parentid、Level等信息,加快了查询处理的速度。(2)针对我们的存储结构,提出了新的基于表连接的查询转换规则和算法。这种查询算法可以将不同形式的路径表达式转化为SQL查询语句来处理。 (3)对以上的存储和查询方法提出进一步的优化方案。当XML文档层次较多时,引入一个路径关系表来减少对相同路
8、径的存储冗余;当查询路径表达式为线性结构时,采用串匹配的方法来减少表连接次数,从而减少连接操作和I/O数量。(4)论文提出的存储转换方法和查询处理方法已在原型系统中实现,并利用实际的XML 文档对系统进行性能测试,实验证明,本文所提出的方法是可行而有效的。关键词:XML;关系数据库;关系存储;路径表达式;表连接中图分类号:TP311AbstractXML has already become the standards of the expression, integration and exchange of the data on web. It has simple form and s
9、trong self-describing ability. Beside, it realizes the separation of the content, structure and expression, so that it is more adapt to data expression and exchange. During recent years, XML is widely used in various fields, and its data has abundantly appeared on web. In order to effectively analyz
10、e and process these XML data, research fellow posed various techniques of inquiring language and memorizing of XML. As now, relational database is the most mature data-managing technique, XML data-processing which is based on relation, is obviously a feasible and prospective way among all ways of me
11、morizing and managing XML data, so it attracts extensive attention in the academia. However, as the data models are different, the process of XML data, by making used of the relational database, challenges traditional database technique.This paper does a thorough research on the relational storage b
12、ased on path, and the querying process of the path expression of XML data, and find out that there are some disadvantages in the existing mappings from XML to the relational database. This paper proposed a new approach to storage and query XML document using relational databases, this approach can r
13、espectively store the XML data in different relational table according to whether the node of the document tree has text value or not. This approach is insensitive to the DTD model, and not necessary to design any index structures. Aim at this storage approach, this paper proposed specific transform
14、ational rules and algorithm, which is transform the core subset of path expression in XPath into SQL. The main contributions of this paper are summarized as follows:(1)A new kind of relational storage approach based on path for XML document is put forward. It can completely record the information of
15、 each node, side, and value of the XML document, in other words, the path information of all the attributes and elements that have text values, and the information such as id, parented, and level of each element, so accelerate the query and process.(2)For the relational storage approach based on pat
16、h for XML document, this paper proposed a new query transformational rules and algorithm based on table join. It can transform different forms of path expression to SQL query sentences to be processed.(3)Further optimizing scheme is provided for the storage and query approaches mentioned above. The
17、Path_Table is introduced to reduce storage redundancy of the same paths when the number of XML document levels is large; The method of string match is adopted to reduce the times of table join, and reduce the amount of join and I/O operations consequently.(4)The storage and query approaches brought
18、forward in this paper have been implemented in a prototype system. The performance test of such approaches is carried out using practical XML documents. It is proved that the storage and query approaches brought forward in this paper are feasible and effective.Keywords: XML; relational database; rel
19、ational storage; path expression; table join第一章 引 言随着互联网的发展,XML(Extensible Markup Language)已经成为一种网上通用的数据存储与信息交换的一种标准格式fdfdfd,2,3。XML由于自身的规范性、灵活性、可扩展性和强大的语言表达能力,被普遍应用于诸多领域,如数字图书馆、电子商务等。近年来,Web上已经出现了海量的XML数据,因此,如何有效地存储和管理XML数据成为一个很有研究价值的重要课题。由此,研究和设计一个XML有效的存储和查询系统显得格外紧迫和重要。1.1 国内外研究现状.在制定了XML的规范后,第一个
20、要解决的问题就是如何存储XML数据,这是因为对XML 数据的查询、检索、更新等处理都是建立在一定的存储模式基础上的,因此它的存储方式极大地影响了查询处理的效率。但XML文档数据是一种半结构化数据,利用现有的技术无法有效地存储和管理它,因此XML数据的存储就成了XML领域一个非常重要的研究方向。由于XML文档是作为文本来编辑的,故可以把XML文档作为一个普通的文本文件直接存储在文件系统中,此方法最明显的优点就是实现简单并且不需要专门的数据库系统或者存储管理器。但每次访问XML文档时都需要先进行解析,极大地影响了访问效率。而且查询时,整个被查询的XML文档必须常驻内存,因此只适合于XML文档内容少
21、、数量小的场合,它的局限性是显而易见的。为此,国内外学术界提出了许多不同的XML文档的存储策略4,5。目前管理XML数据有三种主要的方法,分别是原生XML数据库、面向对象数据库和关系数据库。研究者们采用原生XML数据库(Native-XML)来存储XML文档6,7,8,这种数据库的是完全用来存储和操作XML数据的数据库,存储数据时不需要进行XML和数据库的映射转换。Native-XML维持原有XML文档的数据结构和相关的元数据,而不关心数据的底层存储结构(关系数据库或是面向对象数据库)。但目前它是一种全新的数据库,技术还不够成熟,传统数据库中原有数据也不能轻易地移植到新系统中。这样人们就自然地
22、想到利用成熟的数据库技术来管理XML文档,如面向对象数据库和关系数据库。面向对象数据库9,10的数据模型与XML非常相似,它们都是层次树,都用的父子关系来描述数据之间的关系,都支持用户子定义复杂的数据类型,因此把XML映射到面向对象数据库中去是很容易的事,而且也可以利用对象查询语言(OQL)实现对XML数据的结构化查询,因此用面向对象数据库存储XML数据具有较高的存储和查询效率。但是它对于没有DTD或Schema的XML文档,无法定义映射规则。虽然文献11STORED系统可以采用数据挖掘技术来抽取XML文档的部分模式,但对于不符合模式的数据必须单独处理,而且对于模式经常变化的XML文档,该方法
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 一种基于关系数据库的XML文档存储和查询的方法 硕士毕业论文 一种 基于 关系 数据库 XML 文档 存储 查询 方法 硕士 毕业论文

链接地址:https://www.31ppt.com/p-2395235.html