CN106326466A - Method and device for data exchange between heterogeneous tables - Google Patents
Method and device for data exchange between heterogeneous tables Download PDFInfo
- Publication number
- CN106326466A CN106326466A CN201610777711.9A CN201610777711A CN106326466A CN 106326466 A CN106326466 A CN 106326466A CN 201610777711 A CN201610777711 A CN 201610777711A CN 106326466 A CN106326466 A CN 106326466A
- Authority
- CN
- China
- Prior art keywords
- data
- table objects
- storage
- filled
- destination node
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Abstract
The invention provides a method and device for data exchange between heterogeneous tables. The method includes the steps that table information of a target node is acquired; a table object is established in a cache according to the table information; the table object is filled with stored data; the filled table object is sent to the target node. Transparent data exchange between heterogeneous tables on different nodes of a cluster database can be achieved, and the application range of the function of data redistribution between the nodes of the cluster database can be greatly broadened. Use is easy, manual intervention is not needed, and instantaneity and high efficiency are achieved.
Description
Technical field
The invention belongs to distributed data base technique field, especially relate to method for interchanging data and dress between a kind of heterogeneous sheets
Put.
Background technology
Data redistribute between each node of Cluster Database, are a kind of functions that Cluster Database is conventional, and usual one
Number is according to there being identical copy on different nodes, or has different fragment datas on different nodes.These are secondary
The database table of basis or burst is completely the same in terms of structure, data type.Along with Cluster Database uses scale not
Disconnected expansion, the continuous extension of application scenarios, fast resampling has been not limited between isomorphism form, data between isomery form
Switching requirement also gets more and more.Isomery form, shows that the quantity of grid column is inconsistent, or the data type of row is inconsistent
Deng, obviously cannot directly carry out data exchange between isomery form.Prior art typically uses the instrument of individually exploitation, to different
Structure form carries out adaptation, reaches to exchange the purpose of data, and the shortcoming of this technology is to need manual intervention, and configuration complexity uses
Loaded down with trivial details, it is impossible to meet the requirement of data exchange the most easily immediately of a new generation's Cluster Database.
Summary of the invention
Embodiments provide method for interchanging data and device between a kind of heterogeneous sheets, different to solve Cluster Database
The problem that cannot exchange data on node between heterogeneous sheets.
First aspect, embodiments provides method for interchanging data between a kind of heterogeneous sheets, including:
Obtain the form data of destination node;
Table objects is set up at caching according to described form data;
The data of storage are filled in described table objects;
Send the table objects after filling to destination node.
Further, described the data of storage are filled in described table objects, including:
If the data of storage are inconsistent with described table objects data type, the data of storage are carried out type dress
Change.
Further, described the data of storage are filled in described table objects, including:
If there is no the column data in described table objects, then in described row, fill into default value.
Further, described method uses SQL syntax to realize.
Second aspect, the embodiment of the present invention additionally provides DEU data exchange unit between a kind of heterogeneous sheets, including:
Acquiring unit, for obtaining the form data of destination node;
Set up unit, for setting up table objects according to described form data at caching;
Fill unit, for the data of storage being filled in described table objects;
Transmitting element, the table objects after sending filling is to destination node.
Further, described filling unit is used for:
If the data of storage are inconsistent with described table objects data type, the data of storage are carried out type dress
Change.
Further, described filling unit is used for: if there is no the column data in described table objects, then to described
Row fill into default value.
The embodiment of the present invention is by obtaining the form data of destination node;Form is set up at caching according to described form data
Object;The data of storage are filled in described table objects;Send the table objects after filling to destination node.Realize cluster
The data transparency exchange of heterogeneous sheets compartment on data base's difference node, strengthens Cluster Database internodal data greatly and again divides
The scope of application of cloth function.Use simple, it is not necessary to manual intervention, the most efficiently.
Accompanying drawing explanation
In order to be illustrated more clearly that the technical scheme of the embodiment of the present invention, below will be in embodiment or description of the prior art
The required accompanying drawing used is briefly described, it should be apparent that, the accompanying drawing in describing below is only some realities of the present invention
Execute example, for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to attached according to these
Figure obtains other accompanying drawing.
Fig. 1 is the schematic flow sheet of method for interchanging data between the heterogeneous sheets that the embodiment of the present invention one provides;
Fig. 2 is the schematic flow sheet of method for interchanging data between the heterogeneous sheets that the embodiment of the present invention two provides;
Fig. 3 is the schematic flow sheet of method for interchanging data between the heterogeneous sheets that the embodiment of the present invention three provides;
Fig. 4 is the structural representation of DEU data exchange unit between the heterogeneous sheets that the embodiment of the present invention four provides.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Describe, it is clear that described embodiment is a part of embodiment of the present invention rather than whole embodiments wholely.Based on this
Embodiment in bright, the every other enforcement that those of ordinary skill in the art are obtained under not making creative work premise
Example, broadly falls into the scope of protection of the invention.
Embodiment one
The flow chart of method for interchanging data between the heterogeneous sheets that Fig. 1 provides for the embodiment of the present invention one, the present embodiment is applicable
The situation of data exchange between heterogeneous sheets, the method can be performed by data exchange between heterogeneous sheets, and this device can be by software/hard
Part mode realizes, and can be integrated in the node of distributed data base system.
See Fig. 1, method for interchanging data between described heterogeneous sheets, including:
S110, obtains the form data of destination node.
First source end node obtains destination end form data, these information include tableau format, character set, data type,
The attributes such as default value.
S120, sets up table objects according to described form data at caching.
In source end node according to the form data obtained, in the caching of source end node, set up table objects, this form pair
As having identical form data.Exemplary, the table objects of foundation has same row and column, and each form has
The data type identical with destination node form.
The data of storage are filled in described table objects by S130.
The data of storage are filled in aforementioned table object by source end node.To produce corresponding form.
S140, sends the table objects after filling to destination node.
Sending table objects to destination node, destination node is after receiving table objects, due to table objects and mesh
The form data of the form in mark node is completely the same, can regard as the data exchange in two identical tables, and destination node can
To complete the exchange of corresponding data.
The present embodiment is by obtaining the form data of destination node;Form pair is set up at caching according to described form data
As;The data of storage are filled in described table objects;Send the table objects after filling to destination node.Realize cluster number
According to the data transparency exchange of heterogeneous sheets compartment on the difference node of storehouse, strengthen the redistribution of Cluster Database internodal data greatly
The scope of application of function.Use simple, it is not necessary to manual intervention, the most efficiently.
In a preferred implementation of the present embodiment, said method can be realized by SQL syntax.SQL can divide
It is two parts: data manipulation language (DML) and DDL (DDL).SQL (SQL) is performed for
The grammer of inquiry.But sql like language also comprises for updating, insert and the grammer of deletion record.Inquiry and renewal instruction are constituted
The DML part of SQL.DDL (DDL) part of SQL can create or Delete Table.Can also index of definition
(key), it is stipulated that the link between table, and apply the constraint between table.Can be realized between above-mentioned different node by SQL syntax
Data exchange.
Embodiment two
Fig. 2 is the schematic flow sheet of method for interchanging data between the heterogeneous sheets that the embodiment of the present invention two provides, and the present invention implements
Example is based on above-described embodiment, further, the data of storage is filled into described in described table objects, specifically optimizes
For: if the data of storage are inconsistent with described table objects data type, the data of storage carried out type dress and changes.
See Fig. 2, method for interchanging data between described heterogeneous sheets, including:
S210, obtains the form data of destination node.
S220, sets up table objects according to described form data at caching.
The data of storage are filled in described table objects by S230 by described, if the data of storage and described form
When object data type is inconsistent, the data of storage is carried out type dress and changes.
Exemplary, if the data type of storage is integer type int, and table objects data type is character type
Char, then be converted to character type by integer type.
S240, sends the table objects after filling to destination node.
The present embodiment, by the data of storage being filled into described in described table objects, is specifically optimized for: if deposited
When the data of storage are inconsistent with described table objects data type, the data of storage carried out type dress and changes.Can be by inhomogeneity
The data of type are allowed to consistent through conversion, it is possible to achieve the exchange of different types of data.
Embodiment three
Fig. 3 is the schematic flow sheet of method for interchanging data between the heterogeneous sheets that the embodiment of the present invention three provides, and the present invention implements
Example is based on above-described embodiment, further, the data of storage is filled into described in described table objects, specifically optimizes
For: if there is no the column data in described table objects, then in described row, fill into default value.
See Fig. 3, method for interchanging data between described heterogeneous sheets, including:
S310, obtains the form data of destination node.
S320, sets up table objects according to described form data at caching.
The data of storage are filled in described table objects, if there is no in described table objects by S330 by described
Column data, then in described row, fill into default value.
If a certain being listed in the table that source end node is corresponding in table objects does not exists, then the row of this in table objects
Inserting default value, exemplary, default value can be 0, so that there is not blank column in table objects.
S340, sends the table objects after filling to destination node.
The present embodiment, by the data of storage being filled into described in described table objects, is specifically optimized for: if not
There is the column data in described table objects, then in described row, fill into default value.So that table objects does not exist sky
Bai Lie.
Embodiment four
Fig. 4 is the structural representation of DEU data exchange unit between the heterogeneous sheets that the embodiment of the present invention four provides, as shown in Figure 4,
Described device includes:
Acquiring unit 410, for obtaining the form data of destination node;
Set up unit 420, for setting up table objects according to described form data at caching;
Fill unit 430, for the data of storage being filled in described table objects;
Transmitting element 440, the table objects after sending filling is to destination node.
DEU data exchange unit between the heterogeneous sheets that the present embodiment provides, by obtaining the form data of destination node;According to institute
State form data and set up table objects at caching;The data of storage are filled in described table objects;Send the table after filling
Lattice object is to destination node.Realize the data transparency exchange of heterogeneous sheets compartment on Cluster Database difference node, strengthen greatly
The scope of application of Cluster Database internodal data redistribution function.Use simple, it is not necessary to manual intervention, the most efficiently.
Further, described filling unit is used for:
If the data of storage are inconsistent with described table objects data type, the data of storage are carried out type dress
Change.
Further, described filling unit is used for:
If there is no the column data in described table objects, then in described row, fill into default value.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each method embodiment can be led to
The hardware crossing programmed instruction relevant completes.Aforesaid program can be stored in a computer read/write memory medium.This journey
Sequence upon execution, performs to include the step of above-mentioned each method embodiment;And aforesaid storage medium includes: ROM, RAM, magnetic disc or
The various media that can store program code such as person's CD.
Last it is noted that various embodiments above is only in order to illustrate technical scheme, it is not intended to limit;To the greatest extent
The present invention has been described in detail by pipe with reference to foregoing embodiments, it will be understood by those within the art that: it depends on
So the technical scheme described in foregoing embodiments can be modified, or the most some or all of technical characteristic is entered
Row equivalent;And these amendments or replacement, do not make the essence of appropriate technical solution depart from various embodiments of the present invention technology
The scope of scheme.
Claims (7)
1. method for interchanging data between a heterogeneous sheets, it is characterised in that including:
Obtain the form data of destination node;
Table objects is set up at caching according to described form data;
The data of storage are filled in described table objects;
Send the table objects after filling to destination node.
Method the most according to claim 1, it is characterised in that described the data of storage are filled into described table objects
In, including:
If the data of storage are inconsistent with described table objects data type, the data of storage carried out type dress and changes.
Method the most according to claim 1, it is characterised in that described the data of storage are filled into described table objects
In, including:
If there is no the column data in described table objects, then in described row, fill into default value.
Method the most according to claim 1, it is characterised in that described method uses SQL syntax to realize.
5. DEU data exchange unit between a heterogeneous sheets, it is characterised in that including:
Acquiring unit, for obtaining the form data of destination node;
Set up unit, for setting up table objects according to described form data at caching;
Fill unit, for the data of storage being filled in described table objects;
Transmitting element, the table objects after sending filling is to destination node.
Device the most according to claim 5, it is characterised in that described filling unit is used for:
If the data of storage are inconsistent with described table objects data type, the data of storage carried out type dress and changes.
Device the most according to claim 5, it is characterised in that described filling unit is used for:
If there is no the column data in described table objects, then in described row, fill into default value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610777711.9A CN106326466A (en) | 2016-08-31 | 2016-08-31 | Method and device for data exchange between heterogeneous tables |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610777711.9A CN106326466A (en) | 2016-08-31 | 2016-08-31 | Method and device for data exchange between heterogeneous tables |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106326466A true CN106326466A (en) | 2017-01-11 |
Family
ID=57788473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610777711.9A Pending CN106326466A (en) | 2016-08-31 | 2016-08-31 | Method and device for data exchange between heterogeneous tables |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106326466A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102915377A (en) * | 2012-11-14 | 2013-02-06 | 深圳市宏电技术股份有限公司 | Method and system for converting or synchronizing databases |
CN103440273A (en) * | 2013-08-06 | 2013-12-11 | 北京航空航天大学 | Data cross-platform migration method and device |
CN103530327A (en) * | 2013-09-25 | 2014-01-22 | 清华大学深圳研究生院 | Method for migrating data from non-relational database to relational database |
CN104111834A (en) * | 2014-07-07 | 2014-10-22 | 北京京东尚科信息技术有限公司 | Method and device for exchanging data between heterogeneous databases |
CN104462269A (en) * | 2014-11-24 | 2015-03-25 | 中国联合网络通信集团有限公司 | Isomerous database data exchange method and system |
CN105205117A (en) * | 2015-09-09 | 2015-12-30 | 郑州悉知信息科技股份有限公司 | Data table migrating method and device |
-
2016
- 2016-08-31 CN CN201610777711.9A patent/CN106326466A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102915377A (en) * | 2012-11-14 | 2013-02-06 | 深圳市宏电技术股份有限公司 | Method and system for converting or synchronizing databases |
CN103440273A (en) * | 2013-08-06 | 2013-12-11 | 北京航空航天大学 | Data cross-platform migration method and device |
CN103530327A (en) * | 2013-09-25 | 2014-01-22 | 清华大学深圳研究生院 | Method for migrating data from non-relational database to relational database |
CN104111834A (en) * | 2014-07-07 | 2014-10-22 | 北京京东尚科信息技术有限公司 | Method and device for exchanging data between heterogeneous databases |
CN104462269A (en) * | 2014-11-24 | 2015-03-25 | 中国联合网络通信集团有限公司 | Isomerous database data exchange method and system |
CN105205117A (en) * | 2015-09-09 | 2015-12-30 | 郑州悉知信息科技股份有限公司 | Data table migrating method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108052321B (en) | Method for automatically generating intelligent contract of block chain based on configuration information | |
CN104866608B (en) | Enquiring and optimizing method based on join index in a kind of data warehouse | |
CN105608088B (en) | A kind of database based on configuration file automatically creates and data dynamic recording method | |
JP4604041B2 (en) | An extension to the SQL language to modify set-valued and scalar-valued columns with a single statement | |
CN104182484B (en) | A kind of method and apparatus for realizing HBase data and the mapping of Java field object | |
CN103605726A (en) | Method and system for accessing small files, control node and storage node | |
CN103049251B (en) | A kind of data base persistence layer device and database operation method | |
CN102567932A (en) | Method, device and system for managing comprehensive resources | |
CN104572809B (en) | A kind of distributed relational database spread method | |
CN103020262A (en) | Data storage method, system and data storage equipment | |
US20150261798A1 (en) | Maintaining and using a cache of child-to-parent mappings in a content-addressable storage system | |
CN102799679A (en) | Hadoop-based massive spatial data indexing updating system and method | |
CN107977446A (en) | A kind of memory grid data load method based on data partition | |
CN110955655A (en) | Dynamic CMDB database model storage method and system | |
CN107193943A (en) | A kind of method and apparatus of RDBMS online datas migration | |
CN103186628A (en) | Method for mapping between common information model and relational database | |
CN104573083B (en) | A kind of cache map services automatic update method | |
CN104461929A (en) | Distributed type data caching method based on interceptor | |
CN105630630A (en) | Data hot backup method and system | |
CN101996199A (en) | System and method for realizing GIS (Geographic Information System) engine based on embedded environment | |
de Souza Baptista et al. | NoSQL geographic databases: an overview | |
CN109033193A (en) | A kind of database structure and its method of data synchronization | |
CN116756253B (en) | Data storage and query methods, devices, equipment and media of relational database | |
CN105260266A (en) | Snapshot volume writing method and dependent snapshot system | |
CN107832443A (en) | A kind of processing method, device and the medium of JSON document data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170111 |