[go: up one dir, main page]

CN1211746C - Process of data exchange between a flush type system and external data base - Google Patents

Process of data exchange between a flush type system and external data base Download PDF

Info

Publication number
CN1211746C
CN1211746C CN 02121567 CN02121567A CN1211746C CN 1211746 C CN1211746 C CN 1211746C CN 02121567 CN02121567 CN 02121567 CN 02121567 A CN02121567 A CN 02121567A CN 1211746 C CN1211746 C CN 1211746C
Authority
CN
China
Prior art keywords
data
external data
external
database
embedded
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.)
Expired - Lifetime
Application number
CN 02121567
Other languages
Chinese (zh)
Other versions
CN1464435A (en
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN 02121567 priority Critical patent/CN1211746C/en
Publication of CN1464435A publication Critical patent/CN1464435A/en
Application granted granted Critical
Publication of CN1211746C publication Critical patent/CN1211746C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The present invention discloses a method for exchanging data between embedded systems and external databases. The present invention is characterized in that an external data exchange module is arranged in an embedded system, and data exchange between the embedded system and an external database is realized by the method that the external data exchange module and the external database are communicated. When the embedded system requires the data of the external database, the external data exchange module transmits a data request to the external database and designates required data. The external database encloses the data into extensible markup language in an XML format to be transmitted to the external data exchange module; the external data exchange module receives the data and analyzes the data, and the content of the data is fetched; the external data exchange module saves the fetched data to an embedded database. When the external data exchange module receives the data request of the external database, the data is enclosed into extensible markup language in an XML format to be transmitted to the external database.

Description

Embedded system and external data base carry out the method for exchanges data
Technical field
The present invention relates to a kind of method for interchanging data of embedded system, particularly a kind of embedded system and external data base carry out the method for exchanges data.
Background technology
At present, embedded system has obtained in fields such as information appliance, mobile computing device, the network equipment, Industry Control, emulation, Medical Instruments using widely, and, make that the exchanges data problem of embedded system is very crucial gradually to digitizing and web development.For this reason, embedded system has been introduced embedded database.Embedded database can satisfy the requirement of embedded system to the data exchange, and it and embedded OS organically combine, for the application developer provides effective data management means.The introducing of embedded database makes that embedded product can be unblocked when the data of other electronic equipment of visit (as PC, database server, communication facilities etc.), simultaneously, because its independence for platform can freely be transplanted between embedded platform.
The exchanges data problem of embedded system comprises two aspects, i.e. internal exchange of data and external data exchange.The characteristics of embedded database are distributed, comprise database in the embedded product and the database in the server.Internal exchange of data refers to the exchanges data of database format same in the same system (being under the same storage mode), in CLIENT, specifically can show as the exchange of client, server two ends data of database; The external data exchange then refers to the exchanges data of different pieces of information library format (being under the different storage modes), the just exchanges data between embedded system and the external data base.Internal exchange of data is because the storage format of data is identical, so implement not difficultly, and the external data exchange is because the difference of data on storage format directly brought the complicacy of external data exchange and the difficulty that realizes.
For example will realize the exchanges data between certain embedded database A (db1) and certain large database B (db2), at first needing derives the data among the db1, and converts thereof into the form that db2 can discern, the data importing db2 after will changing then.Finish this and cross the data storage method that the range request developer must know two databases, and often time-consuming, the effort of the conversion between storage mode causes the most of the time of exchanges data all to be wasted on the translation data form.
Present existing embedded database, as the Ultralite database, with SQL Server, Oracle, when large databases such as DB2 carry out exchanges data, employing be oneself the definition communication protocol.Its implementation, referring to Fig. 1 a, at SQL Server 110, Oracle 120, on the machine 150 at DB2 130 places such as large database such as grade an adapter 111 is installed respectively, 121,131 (Adaptor), adapter is responsible for the exchanges data between Ultralite database 140 and the large database, play the effect of intermediary's platform, that is to say and pass through adapter, the storage format that the data-switching of embedded database is become storage format that large database can discern or becomes embedded database to discern the data-switching of large database, carry out exchanges data then, thereby realize the exchanges data of embedded database and outside large database.Wherein, because the difference of the large database that will exchange, each adapter 111,121,131 also has nothing in common with each other.This method needs is carried out the large database of exchanges data and interfere, and for different large databases, the adapter of being done also has nothing in common with each other, and has so just increased developer's workload, has increased cost simultaneously.
The XML technology of rising in recent years (eXtensible Markup Language, extending mark language) is a kind of received text form that Web goes up the expression structured message, can be under windows platform, all convert the data of the different pieces of information library format of needs exchanges to the XML form, by the function served as bridge of XML, the shortcut that facilitates for the information interchange between the various Heterogeneous systemss.Yet, even if select for use XML, because existing database only relates to one-side data importing or derivation to the support of XML as intermediary; Importing, deriving in the convergence process of these two links, still existing form-factors needs to consider.
At present, the application mode of XML in the Web system, referring to Fig. 1 b, Fig. 1 b is the synoptic diagram of prior art XML in the Web system.Wherein, the WEB server and client side connects by Internet with XML.Client from WEB server data-generating process is:
Client browser sends the request of data of the ID parameter that comprises XML to the WEB server; WEB returns to client browser with desired data with the XML form; Client browser utilizes and embeds data source object (Data Source Object in the webpage, DSO), the value of DATASRC attribute is appointed as the name of document object, here be exactly the ID parameter of XML, and just can connect the general identifier that the value of the attribute of SATAFLD is appointed as the XML element to the data content of XML element and html element element, in browser, show the XML data that the WEB server sends.
Utilize the built-in XML function of browser, the XML document that it will be analyzed is represented with DOM.Shell script can visit the data content of XML element by this model, and with Data Dynamic be inserted in the user interface.
Equally, the data of user's input in the page can be submitted to the WEB server with the packing of XML form by list handles.
The WEB server end has been realized combining of XML and database in the said process.Common combination has following three kinds:
1, the basic purpose of design of database is in order to store and the processing XML document.Its basic unit of storage is an XML document, carries out the storage of database by the standard that XML is relevant.
2, manage the storage of XML data by increasing a mapping layer, its master data storage cell is the XML data.Data at first will be complementary with a clear and definite form, satisfactory could being mapped in the database according to the rule that pre-defines.
3, according to specific requirement and application, promptly can use mode 1, also can carry out combining of XML and database with mode 2.
Database has only obtained good application at windows platform to the support of XML, and for embedded system, because the processing power of embedded product itself is lower, can not be directly and external data base carry out exchanges data, more can't realize the external data database data directly is shown to the user by the XML mode, that is to say at embedded database aspect the support of XML, to remain a blank.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of embedded system and external data base to carry out the method for exchanges data, with XML is bridge, external data base is not being carried out under the situation of any interference fully, finish exchanges data, make the embedded database user can be easily carry out uploading and downloading of data, realize the seamless communication between cross-platform, Heterogeneous systems with the large database of outside.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
A kind of embedded system and external data base carry out the method for exchanges data, and described embedded system comprises: embedded product and server; Described server comprises embedded database, it is characterized in that, it comprises following step:
1) an external data Switching Module is set in the server of embedded system;
When 2) data that are checked through the embedded product request when server were not at the embedded database that it comprises, the external data Switching Module in the server sent request of data to external data base, and specifies needed data;
3) external data base in the server sends to the external data Switching Module according to request of data with the needed data that are packaged into extending mark language XML form;
4) after the external data Switching Module in the server receives data, data are resolved, analysis result is preserved in internal memory with the version of tree;
Travel through the tree in the described internal memory, from this tree, data content is extracted;
5) the external data Switching Module in the server is saved in embedded database with the data that extract with the form of embedded database;
When 6) the external data Switching Module is received the request of data of external data base, needed data encapsulation is become extending mark language XML form, send to external data base.
Wherein, step 2) can send request by http protocol to external data base for the external data Switching Module, specify the data that need by the database manipulation order; Step 6) external data Switching Module can send the data that are packaged into extending mark language XML form by http protocol to external data base.
Step 4) can also comprise following step:
A, receive data after, judge earlier to resolve whether leave over data segment last time, if having, with the data of this reception with leave over data segment and couple together, find out element starting point wherein, begin parsing;
If B resolved and do not leave over data segment last time, then begin to resolve from this element starting point that receives data;
C, according to the XML syntax rule, parse element and attribute thereof, and this analysis result be saved in the internal memory.
Wherein leave over data segment, can be when receiving incomplete XML character string, this incomplete XML character string is noted formation.
Step 6) external data Switching Module can become extending mark language XML form with needed data encapsulation according to the syntax rule of XML.
By such scheme as can be seen, key of the present invention is: use an external data Switching Module in embedded system, with XML is bridge, the integrated importing of data, derive two functions, communicate by external data Switching Module and external data base, realize the exchanges data between embedded system and the external data base.
Therefore, embedded system provided by the present invention and external data base carry out the method for exchanges data, with XML is bridge, external data base is not being carried out under the situation of any interference fully, finish exchanges data, make the embedded database user can be easily carry out uploading and downloading of data, realize the seamless communication between cross-platform, Heterogeneous systems with the large database of outside, reduce developer's workload, reduced cost.Method of the present invention is integrated in the data exchange process of data between Heterogeneous systems in the external data Switching Module, and data-switching is completely enclosed within the system, and the convenience of not only bringing the user to use has strengthened the function of system especially.
Description of drawings
Fig. 1 a is existing embedded database Ultralite database, and with SQL Server, Oracle, the DB2 large database carries out the implementation synoptic diagram of exchanges data.
Fig. 1 b is the synoptic diagram of prior art XML in the Web system.
Fig. 2 is the embedded system of a preferred embodiment of the present invention and the synoptic diagram that external data base carries out exchanges data.
Fig. 3 is a middle data parsing process flow diagram flow chart embodiment illustrated in fig. 2.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, by the following examples, and with reference to accompanying drawing, the present invention is described in more detail.
The invention process needs two basic premises: at first, carry out the external data base (hereinafter to be referred as to party database) of exchanges data with embedded database and must support XML, comprising that support is browsed for the user institute's deposit data in the database and supported with the XML form on Web Server (page server) deposits the data in the complete XML file in the storehouse in the respective table.Secondly,, therefore to realize with XML being the exchanges data of bridge, a Web Server that can discern XML also must be arranged because XML is based on Web's.
Referring to Fig. 2, the embedded system of a preferred embodiment of the present invention and external data base carry out the synoptic diagram of exchanges data.An embedded system 200 that has comprised server 201 and n embedded product 202, wherein server 201 is supported the Web function, and introduced embedded database as publicly-owned database 204, and added an external data Switching Module 203 that is used for the external data exchange.External data Switching Module 203 is as a submodule of the whole platform data exchange of embedded database, and when embedded product 202 ends, when just client need be carried out exchanges data, server 201 was delivered in its request.The server audit log, if the new data of user's request has been arranged in its publicly-owned database 204 (present embodiment is exactly an embedded database), it directly returns to the user with data, this process is an internal exchange of data; Otherwise, for example, desired data externally among database 210 SQLServer (if external data base is large databases such as Oracle, DB2, the inventive method also can realize, as long as these large databases had both been supported institute's deposit data in the database is browsed on Web Server for the user with the XML form, support again the data in the complete XML file are deposited in the storehouse in the respective table, the inventive method just can realize), then finished the data exchange operation of real same external data base 210 by the external data Switching Module 203 in the server 201, its detailed process is:
At first, external data Switching Module 203 sends request by http protocol to 210 SQL Server end, simultaneously, specifies the data that need by SQL statement; Receive the data that are packaged into extending mark language XML form that 210 SQL Server end transmits then; Then, data are resolved, extracted, data are kept in the respective table of publicly-owned database with the embedded data library format the most at last.
Wherein, the most complicated is exactly to receiving the resolving of data.Because receive the difference of data volume, and the difference of send buffer definition size, occur send buffer probably and can not once receive all XML data conditions, at this moment, just some the incomplete XML character strings that receive.Therefore, in resolving, adopted retroactive method to handle the situation of blocking character string.
According to the syntax rule of XML, element must with "<" beginning, for the value element is arranged, it expresses situation may be<customer〉ALKLI</customer 〉, customer is a masurium, and ALKLI is an element value, last</customer〉end of expression element; For empty element, it expresses situation and can be<book isbn=" 762-8734 " title=" moon " author=" Bruce "/, wherein isbn, title, author are the attribute of element book.
In resolving, when running into an element beginning label "<" (this paper E for clarity, SIllustrate) time, will get off this location records, search backward then up to finding the end mark that is complementary with it, has the value element to be " ", empty element is "/" (for clarity, this paper uses E EIllustrate) till (here, should be noted that distinguish the difference that value element and empty element are arranged).If search end of string "/0 " (this paper S for clarity, 0Illustrate) also do not find E E, illustrate that the data that this time receive are incomplete.At this moment, from E STo S 0Between character record get off that (for clarity, this paper illustrates with T, T=S 0--E S), be connected reference position (this paper E for clarity, that receives data next time MIllustrate), resolving then.Like this, just, the starting point that has guaranteed each parsing is all from E SBeginning.When receiving data parsing next time, the data segment T that reviews last time and carry over, thus guaranteed the integrality of data.
Analysis result is preserved in internal memory with the form of DOM Document Object Model DOM.DOM is the model of expression XML document content, and it provides a kind of visit and has handled the method for XML document.The linear model of DOM model, tree shape model and three kinds of model the present invention of object model can adopt.Present embodiment has adopted the most frequently used form with tree to preserve in internal memory.Element/property of every parsing (according to concrete needs, will resolve in detail element property sometimes) is just added a node in the tree, and element itself is a set membership with element property.After a complete XML data segment parsing finishes, can form a multiway tree in the internal memory.
The detailed process of resolving is referring to Fig. 3, embodiment illustrated in fig. 2 in the data parsing process flow diagram flow chart.When receiving data segment E MThe time, first execution in step 301 judges whether left over data segment T last time; If have, then execution in step 302, and T and E are linked in sequence M, then by data sequential search data, execution in step 303 judges whether the data that search are the beginning E of element SIf the data segment that does not carry over, then direct execution in step 303 judges whether the data that search are the beginning E of element SIf do not search E S, then execution in step 304, think wrong, finish to resolve, and the external data Switching Module can require data again.If search E S, then continuing search, execution in step 305 judges whether the data that search are the end E of element EIf do not search E E, then execution in step 306, and data segment T, T=S left in record 0--E S, continue to receive data then.If search E E, then execution in step 307, resolve E SAnd E EBetween data; Execution in step 308 again, and the result who resolves is added tree node.Like this, just can obtain the data that need by traveling through whole tree, and its form with embedded database is preserved in the publicly-owned database.Also just realized the exchanges data of SQL Server data to embedded database.
After exchanges data was finished, server according to user's request, returned new data to the user again.
Referring to Fig. 2, when external data base 210 SQL Server held the data that need in the embedded system 200, the external data Switching Module 203 in the embedded system 200 received the request of data from 210 SQLServer; Syntax rule according to XML becomes extending mark language XML form with the data encapsulation in the needed publicly-owned database 204 earlier; Then, packaged data are sent to 210 SQL Server by http protocol.This process is simple relatively, as long as the data encapsulation in the publicly-owned database 204 is become standard x ML form and send to 210 SQL Server end, the parsing and the storage work of data is finished by 210 SQL Server.
The present invention utilizes the function served as bridge of XML, when making embedded system and external data base carry out exchanges data, just can carry out exchanges data need not to understand under the situation of the other side's storage organization effective and rapidly, shorten the construction cycle greatly, reduce development difficulty, improved code reusability.
For embedded user, care be the efficient of system and stable, need not fully to understand as for the process of data processing.Method of the present invention is integrated in the data exchange process of data between Heterogeneous systems in the external data Switching Module, and data-switching is completely enclosed within the system, and that brings is not only convenience in user's use, the enhancing of systemic-function especially.

Claims (5)

1, a kind of embedded system and external data base carry out the method for exchanges data, and described embedded system comprises: embedded product and server; Described server comprises embedded database, it is characterized in that, comprises following step:
1) an external data Switching Module is set in the server of embedded system;
When 2) data that are checked through the embedded product request when server were not at the embedded database that it comprises, the external data Switching Module in the server sent request of data to external data base, and specifies needed data;
3) external data base is according to request of data, and the needed data that are packaged into extending mark language XML form are sent to external data Switching Module in the server;
4) after the external data Switching Module in the server receives data, data are resolved, analysis result is preserved in internal memory with the version of tree;
Travel through the tree in the described internal memory, from this tree, data content is extracted;
5) the external data Switching Module in the server is saved in embedded database with the data that extract with the form of embedded database;
When 6) the external data Switching Module in the server is received the request of data of external data base, needed data encapsulation is become extending mark language XML form, send to external data base.
2, embedded system as claimed in claim 1 and external data base carry out the method for exchanges data, it is characterized in that:, specify the data that need by the database manipulation order step 2 of this method) for the external data Switching Module sends request by http protocol to external data base; The step 6) external data Switching Module of this method is to send the data that are packaged into extending mark language XML form to external data base by http protocol.
3, embedded system as claimed in claim 1 and external data base carry out the method for exchanges data, it is characterized in that: the step 4) of this method comprises following step:
A, receive data after, judge earlier to resolve whether leave over data segment last time, if having, with the data of this reception with leave over data segment and couple together, find out element starting point wherein, begin parsing;
If B resolved and do not leave over data segment last time, then begin to resolve from this element starting point that receives data;
C, according to the XML syntax rule, parse element and attribute thereof, and this analysis result be saved in the internal memory.
4, embedded system as claimed in claim 1 and external data base carry out the method for exchanges data, it is characterized in that: the step 6) external data Switching Module of this method becomes extending mark language XML form according to the syntax rule of XML with needed data encapsulation.
5, embedded system as claimed in claim 3 and external data base carry out the method for exchanges data, it is characterized in that: the described data segment of leaving over is when receiving incomplete XML character string, and this incomplete XML character string is noted formation.
CN 02121567 2002-06-26 2002-06-26 Process of data exchange between a flush type system and external data base Expired - Lifetime CN1211746C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 02121567 CN1211746C (en) 2002-06-26 2002-06-26 Process of data exchange between a flush type system and external data base

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 02121567 CN1211746C (en) 2002-06-26 2002-06-26 Process of data exchange between a flush type system and external data base

Publications (2)

Publication Number Publication Date
CN1464435A CN1464435A (en) 2003-12-31
CN1211746C true CN1211746C (en) 2005-07-20

Family

ID=29743014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 02121567 Expired - Lifetime CN1211746C (en) 2002-06-26 2002-06-26 Process of data exchange between a flush type system and external data base

Country Status (1)

Country Link
CN (1) CN1211746C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541993A (en) * 2010-11-03 2012-07-04 微软公司 Spreadsheet model for distributed computations

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100531105C (en) * 2004-09-01 2009-08-19 鸿富锦精密工业(深圳)有限公司 Trans system data exchange structure and method
CN101478730B (en) * 2007-11-12 2011-05-18 华为技术有限公司 Data exchange method, system and device
CN101685450B (en) * 2008-09-27 2011-08-24 比亚迪股份有限公司 A Method of Realizing Database Function in Embedded Operating System
WO2011066846A1 (en) * 2009-12-04 2011-06-09 Abb Research Ltd. System and method for data integration of engineering tools
CN102073693A (en) * 2010-12-28 2011-05-25 广州杰赛科技股份有限公司 XML-based data communication method and system
CN102521318A (en) * 2011-12-02 2012-06-27 华侨大学 General data exchange device based on extensible markup language (XML)
CN106067893A (en) * 2016-09-14 2016-11-02 中山大学 A kind of data interactive method based on Web

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541993A (en) * 2010-11-03 2012-07-04 微软公司 Spreadsheet model for distributed computations
CN102541993B (en) * 2010-11-03 2018-01-30 微软技术许可有限责任公司 Spreadsheet model for Distributed Calculation
US9952893B2 (en) 2010-11-03 2018-04-24 Microsoft Technology Licensing, Llc Spreadsheet model for distributed computations

Also Published As

Publication number Publication date
CN1464435A (en) 2003-12-31

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
US6996571B2 (en) XML storage solution and data interchange file format structure
US7386567B2 (en) Techniques for changing XML content in a relational database
US7024413B2 (en) Method of externalizing legacy database in ASN.1-formatted data into XML format
US6941511B1 (en) High-performance extensible document transformation
US7346598B2 (en) Schemaless dataflow within an XML storage solution
US7979455B2 (en) RDF store database design for faster triplet access
US7818352B2 (en) Converting SPARQL queries to SQL queries
US6934712B2 (en) Tagging XML query results over relational DBMSs
US6012067A (en) Method and apparatus for storing and manipulating objects in a plurality of relational data managers on the web
US8983931B2 (en) Index-based evaluation of path-based queries
US20060282482A1 (en) Method and system for model-based replication of data
CN103425726A (en) Processing queries in a computer network using business intelligence tools
CN101609415A (en) Universal service calling system and method based on middleware
CN1211746C (en) Process of data exchange between a flush type system and external data base
WO2000065486A2 (en) A method of mapping semantic context to enable interoperability among disparate sources
EP2041679A1 (en) Semantic aware processing of xml documents
Lee et al. A design and implementation of XML-Based mediation framework (XMF) for integration of internet information resources
Chang et al. Supporting unified interface to wrapper generator in Integrated Information Retrieval
Morishima et al. A data modeling and query processing scheme for integration of structured document repositories and relational databases
Chang et al. Prototyping an integrated information gathering system on CORBA
Ahmed Resource capability discovery and description management system for bioinformatics data and service integration-an experiment with gene regulatory networks
Neiman A proposed change to the SOAP-based XML standard for the improved delivery of web services
US20040199682A1 (en) Generic architecture for data exchange and data processing
Zhao et al. XSet: A high performance XML search engine

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CX01 Expiry of patent term
CX01 Expiry of patent term

Granted publication date: 20050720