CN103092874A - XML (Extensive Makeup Language) based isomerous data exchange method - Google Patents

XML (Extensive Makeup Language) based isomerous data exchange method Download PDF

Info

Publication number
CN103092874A
CN103092874A CN2011103459947A CN201110345994A CN103092874A CN 103092874 A CN103092874 A CN 103092874A CN 2011103459947 A CN2011103459947 A CN 2011103459947A CN 201110345994 A CN201110345994 A CN 201110345994A CN 103092874 A CN103092874 A CN 103092874A
Authority
CN
China
Prior art keywords
xml
data
database
mapping
data exchange
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN2011103459947A
Other languages
Chinese (zh)
Inventor
杨际荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Original Assignee
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
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 ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD filed Critical ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority to CN2011103459947A priority Critical patent/CN103092874A/en
Publication of CN103092874A publication Critical patent/CN103092874A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an XML (Extensive Makeup Language) based isomerous data exchange method. Due to the extendibility, self-descriptiveness and other characteristics of the XML, a new idea for the exchange of the isomerous data is provided. Based on the XML, the isomerous data exchange method is provided; and specific implantation process of the isomerous data exchange method is provided by combining with an application example.

Description

A kind of isomeric data switching method of XML-based
Technical field
The present invention relates to a kind of isomeric data switching method of XML-based, the XML this paper that is based on has particularly proposed a kind of method that isomeric data exchanges.
Background technology
Database application develops into today, that existing a considerable amount of enterprises and scientific research institution have accumulated is a large amount of, with multi-form storage, data that depend on the different pieces of information base management system, how sharing these data messages, is the problem that the required solution of 1 step development is advanced by enterprise.In addition, due to reasons such as history, the Database Systems on Internet be also much distribute, isomery, the upper bulk information of Internet must could effectively be managed by Database Systems, how reasonably to use these heterogeneous databases, become current problem anxious to be resolved.Heterogeneous database system is the set of a plurality of Database Systems of being correlated with, in order to realize sharing and transparent access of data.The isomerism of heterogeneous database system is mainly reflected in the following aspects: the 1) isomery of Computer Architecture.2) isomery of fundamental operation system.3) isomery of DBMS itself.The heterogeneous database of discussing herein belongs to the 3rd type, and namely (oracle database and SQLServer database) carries out information interchange between two heterogeneous database systems of different DBMS.
XML is " extendible markup language " (eXtensible Markup Language), is the rule of 1 cover definition semantic marker.Being to be organized in by W3C a kind of common language specification formulating in February, 1998, is the simplified subset of SGML, designs for web application specially.XML is as a kind of Markup Language, and its self descriptiveness makes it be highly suitable for exchanges data between different application, and this exchange is not to predesignate 1 group of data structure definition as prerequisite.The great advantage of XML is that data are described and data movement capacity, therefore possesses very strong opening.
For structure and permissible value to XML document define and check that two kinds of ways are arranged: the 1st, use the DTD DTD (Document Type Definition); The 2nd, use XML Schema.The two is 1 part of XML standard.The purposes of DTD is a lot, can be used to define the pattern of content, the scope of restricting data, the data type of limitation attribute etc.But DTD also has 1 a little weak point: DTD itself not meet the XML standard; It does not support name space (Namespace); Extendability is poor; Data type is limited etc.XML Schema is that the Schema document itself meets the XML standard with respect to the obvious benefit of DTD, rather than resembles and use special format DTD.The user can use identical tool for processing XML Schema with the developer, and needn't use special instrument.
Summary of the invention
Based on the problems referred to above, hereby invent a kind of isomeric data switching method of XML-based; This method is according to the mode of the setting up difference of mapping relations, and we can obtain two kinds of data transfer devices: based on the conversion method of template-driven with based on the conversion method of model-driven.
Do not pre-define mapping relations between XML document and other data based on the mapping method of template, but embed the sql command with parameter in XML document.These orders are identified and are carried out by system in transfer process, and the result of execution is replaced to the position at instruction place, thereby generate the target XML document, and process such as entities software such as middlewares with data transmission.Benefit based on the conversion method of template is that the step of changing is fairly simple, as long as provide template, just can generate rapidly corresponding XML document.Weak point is, mapping based on template-driven is a kind of shallow-layer mapping, the data result of carrying out with the embedded SQL of XML integrates as foundation, do not relate to the relation schema that database is rely and existed, it just is converted to XML document with the data of relational database, do not extract relation schema, it has given up all constraint condition of relation schema, and is therefore helpless especially for reverse conversion.
Based on the mapping of model-driven, when data when database is sent to XML document or data are sent to database from XML document, be not only to rely on embedded sql command, but with 1 concrete model realization.Come relation between mapping XML and relation data database data based on the conversion method of model with this data model that pre-defines.Key based on the conversion method of model is to design 1 mapping model flexibly, in order better to support the characteristics of its reverse Mapping, this mapping model must be easy to " understanding ", be easy to handle, can be good at and the various constraints that reach relational database.The theoretical foundation of relational database is relational model, and the foundation of XML document is XML Schema or DTD etc.
Specific implementation method
The isomery of database is mainly the isomery of DBMS, and 1 is the DBMS of Oracle, and 1 is the DBMS of SQL Server, has designed a kind and has utilized XML to realize this two heterogeneous database information exchange methods.The native system specific implementation can be divided into two parts generally, its 1 be data in the client oracle database to the mapping process of XML document, it 2 is mapping process that XML document arrives SQL Server database.
1.SQL table and mutual relationship thereof in the Server database
Two tables are arranged in SQL Server database, and the data in these two tables are the information of our exchange just, and the restriction relation between the information of each table and table is as follows:
Figure BSA00000605874300021
Figure BSA00000605874300031
constraint?PK_student?primary?key(Id))
Figure BSA00000605874300032
constraint?PK_depart?primary?key(class)constraint?fk_RCforeign?key(calss)References?student(calss))
2. pass through ADO.NET is mapped as XML Schema with relational database and utilizes ADO.The NET assembly is mapped as XML Schema with the SQLServer relational database, this XMLSchema just we data-mapping in the oracle database server be XML document will foundation XMLSchema, the below is that the part key code that produces XML Schema in C# (is only listed the code relevant with table 1 here, as for other three tables, roughly the same): 1 new data set DataSet ds=new DataSet (" studentXML ") of // generation; // connection data source OleDbConnection
Conn=newOleDbConnetion (@" server=student; Uid=system; Pwd=manager; Datasource=student ") // generated data adapter (only listing the correlative code student of table) OIeDbDataAdapter da index=new OIeDbDataAdapter (" SELECT*FROMstudent ", conn); // use adapter padding data collection da_index.Fill (ds, " student "); // between adding table and show, data centralization concerns ds.Relations。Add(ds。
Tables[″student″]。Columns[″class″],ds。Tables[″depart″]。
Columns[" class "]); // generation XML file ds.WriteXml(“。。\\。。\\\jhsy。xml″,XmlWriteMode。WriteSchema); After carrying out these codes, 1 standard x ML Schema format file can generate.
3. the mapping from the oracle database to the XML document; Concrete grammar be first with the data retrieval in database, be filled in data window, then realize that with program technic data are to the mapping of XML document.The function of mainly using is exactly FileWrite (), not 1 causing property due to the field name of showing between heterogeneous database, field type, field length, so in program, also will have data in oracle database are carried out conversion to meet in SQL Server database the function of table and Field Definition requirement.In addition, also to meet the master who shows in SQL Server, outer key definition.
4. effective XML document is converted into ADO.The NET data; The XML data file is through after having parsing and the checking of effect property, and lower 1 step will be how it to be mapped in SQL Server database, and the XML data file is not just to be mapped in the storehouse in direct 1 step, and it first passes through C#.The ADO that net provides.NET transforms, and first the data with document are loaded in DataSet (data set), then just from ADO.NET is mapped in database.
ADO。NET does to design in the XML environment, ADO.NET uses XML to carry out remote transmission, so data can not supported ADO.Exchange ADO between the application program of NET and system.NET provides 1 a little powerful functions to read and write XML document, uses ADO.The class of NET relation data is comprised in System.In this 1 NameSpace of Xml.To be loaded into SQL Serve to XML document: in database, should first be converted to ADO to XML document.The DataSet of NET.The below is its main code: DataSet ds_xml=new DataSet (" studentXML "); Ds.ReadXml(“。。\\。。\\。。\\jhsy。xml″,XmlReadMode。ReadSchema); ReadXml () function is to be used for specially the processing XML data file, it has two parameters, and the 1st parameter is the XML data file that will read, and the 2nd parameter is the pattern that reads, we choose the ReadSchema pattern, namely take the schema description language of XML Schema as the XML data file.
5. with ADO.The NET data are loaded in database; Although this moment, the XML data file was converted into the data in data set ds_xml, but can't be directly new database more, because there is no 1 data adapter, unsuccessful from connecing renewal, therefore, newly-built 1 data set ds_server again, this data set contacts by data adapter unit dal and SQL Server database, the data of this data centralization can be directly new database more, then, because the data pattern of ds_server data set and ds_xml data set is identical (being all XMLSchema), thus they can " merge ", C#.Provide the Merger function to be used for merging two data sets with identical data pattern in net, upgraded SQL Server database by dal at last.// connection SQL Server database string C; OleDbConnection OleDbConn=new OleDbConnection (ConnString); // set up 1 new data set DataSet dslserver=new DataSet (" studentXML "); // set up servers' data adapter OIeDbDataAdapter dal=new OIeDbDataAdapter (" SELECT*FROM student ", OleDbConn); // filling servers' data collection dal.Fill (ds_server, " student "); // data set ds_xml is incorporated into ds_server concentrate dsl server.Merge(ds_xml。Tables[" student "]); // update server client database dal.Update (ds_server, " student "); So far, the message exchange between the whole heterogeneous database of XML-based all realizes, from whole implementation procedure, as can be known, XML really can well realize the data-switching between each database, thereby reach the purpose of data sharing and information interchange as the middleware of 1 data exchange.

Claims (2)

1. the isomeric data switching method of an XML-based: the method is mainly based on the conversion method of template-driven with based on the conversion method of model-driven.
2. according to claim 1 the isomeric data switching method of XML-based, the mapping method based on template of the method does not pre-define the mapping relations between XML document and other data, but embeds the sql command with parameter in XML document.Another kind of mapping based on model-driven, when data when database is sent to XML document or data are sent to database from XML document, be not only to rely on embedded sql command, but with 1 concrete model realization.
CN2011103459947A 2011-11-01 2011-11-01 XML (Extensive Makeup Language) based isomerous data exchange method Pending CN103092874A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103459947A CN103092874A (en) 2011-11-01 2011-11-01 XML (Extensive Makeup Language) based isomerous data exchange method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103459947A CN103092874A (en) 2011-11-01 2011-11-01 XML (Extensive Makeup Language) based isomerous data exchange method

Publications (1)

Publication Number Publication Date
CN103092874A true CN103092874A (en) 2013-05-08

Family

ID=48205453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103459947A Pending CN103092874A (en) 2011-11-01 2011-11-01 XML (Extensive Makeup Language) based isomerous data exchange method

Country Status (1)

Country Link
CN (1) CN103092874A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106570095A (en) * 2016-10-31 2017-04-19 凯美瑞德(苏州)信息科技股份有限公司 XML data operation method and device
CN106909673A (en) * 2017-03-01 2017-06-30 国电南瑞科技股份有限公司 A kind of implementation method of the data memory module for following database interface standard

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101067814A (en) * 2007-05-10 2007-11-07 浪潮集团山东通用软件有限公司 Mapping conversion method between data access level Xml format data and relational data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101067814A (en) * 2007-05-10 2007-11-07 浪潮集团山东通用软件有限公司 Mapping conversion method between data access level Xml format data and relational data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郑丽丽等: "基于XML 的异构数据交换的研究", 《电脑与信息技术》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106570095A (en) * 2016-10-31 2017-04-19 凯美瑞德(苏州)信息科技股份有限公司 XML data operation method and device
CN106570095B (en) * 2016-10-31 2020-01-07 凯美瑞德(苏州)信息科技股份有限公司 XML data operation method and equipment
CN106909673A (en) * 2017-03-01 2017-06-30 国电南瑞科技股份有限公司 A kind of implementation method of the data memory module for following database interface standard

Similar Documents

Publication Publication Date Title
US7275087B2 (en) System and method providing API interface between XML and SQL while interacting with a managed object environment
US8954479B2 (en) End-to-end interoperability and workflows from building architecture design to one or more simulations
US8321478B2 (en) System and method of translating a relational database into an XML document and vice versa
CN100458793C (en) Mapping conversion method between data access level Xml format data and relational data
CN102646039A (en) Software interface generating system and method based on extensible markup language (XML) Schema
CN102929664A (en) Conventional data exchange method based on XSD structure
CN103927385A (en) Unifying method and device of data model
US9836503B2 (en) Integrating linked data with relational data
US8762398B2 (en) Method of integrating data of XML document with database on web
CN105205103A (en) Method and device for accessing database
CN105550176A (en) Basic mapping method for relational database and XML
CN103092874A (en) XML (Extensive Makeup Language) based isomerous data exchange method
Mangisengi et al. A framework for supporting interoperability of data warehouse islands using XML
CN103092591A (en) XML (Extensive Makeup Language) and Web Service based data integration middleware method
Brahmia et al. An approach for schema versioning in multi-temporal XML databases
CN103778118A (en) SQL (Structured Query Language)-based method of converting XML (X Exrensible Markup Language) to relational data bases
Amirian et al. Implementation of a geospatial web service using web services technologies and native XML databases
Wu et al. Study on XML-Based Heterogeneous Agriculture Database Sharing Platform
CN106560802A (en) Relational database and WEB data mapping method
Zhu et al. Research on the implementation of multi-source remote sensing image management system based on B/S architecture
Wang et al. Data migration model and algorithm between heterogeneous databases based on web service
Li et al. Research on information transformation based on XMI
Li et al. The research of Oil fields heterogeneous data management technology
CN117971207A (en) Method and device for realizing multi-template export
Juan et al. The research on the XML-based information exchange under heterogeneous Enviornment in HR Oursourcing enterprises

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20130508