CN105279285B - A kind of synchronization system and method for relevant database and non-relational database - Google Patents

A kind of synchronization system and method for relevant database and non-relational database Download PDF

Info

Publication number
CN105279285B
CN105279285B CN201510817110.1A CN201510817110A CN105279285B CN 105279285 B CN105279285 B CN 105279285B CN 201510817110 A CN201510817110 A CN 201510817110A CN 105279285 B CN105279285 B CN 105279285B
Authority
CN
China
Prior art keywords
module
database
relational database
read
relevant database
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.)
Active
Application number
CN201510817110.1A
Other languages
Chinese (zh)
Other versions
CN105279285A (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.)
DMS Corp.
Original Assignee
Shanghai Feixun Data Communication 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510817110.1A priority Critical patent/CN105279285B/en
Publication of CN105279285A publication Critical patent/CN105279285A/en
Application granted granted Critical
Publication of CN105279285B publication Critical patent/CN105279285B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses the synchronization systems and method of a kind of relevant database and non-relational database, the correspondence of the literary name section in document field and relevant database in the main configuration non-relational database through configuration module, and form configuration relation document;The document name for the configuration relation document that read module is generated according to the configuration module and the time zone provided by timing module read related data from the non-relational database;Timing module records the time that the read module accesses the non-relational database, provides last visit time to this time zone accessed and gives the read module;Conversion module is directed to the command statement of relevant database operation according to the configuration relation document structure tree that the read related data of read module and configuration module store;And the command statement that execution module is generated according to the conversion module is to the relevant database execution of command operations.

Description

A kind of synchronization system and method for relevant database and non-relational database
Technical field
The present invention relates to database management technology fields, more particularly to a kind of relevant database and non-relational data The synchronization system and method in library.
Background technology
With the development of business, system function increases, system architecture becomes to become increasingly complex, to storage and the need of data Asking also becomes increasingly diversity.
At present to the storage of data, it is generally used relevant database, such as oracle, mysql.Relevant database It saves the data in different tables, rather than all data is placed in one big warehouse, which adds speed and carry High flexibility.So, with the development of business, on the one hand using non-relational database to adapt to new business, such as Mongo DB, as the tool for storing and managing data;On the other hand in order to be compatible with old system and relationship type must be used Database.Therefore, how compatible data is become in the storage of non-relational database and relevant database to be badly in need of solving The problem of.
In view of the above-mentioned problems, there are mainly two types of current solutions:Scheme one is modified use to the interface of system Unified database;Scheme two reads data in non-relational database by timing, and production Methods type database is corresponding Sql (Structured Query Language, structured query language) sentence executes in relevant database again, to Operation data.Though above two scheme can realize the data compatibility of above two database, so, scheme one is needed to traditional pass It is that type database is transformed, the data that the needs of scheme two obtain can not reflect the change of data, and to no-timestamps Data can not judge between right and wrong.
Therefore, it is necessary to a kind of new relevant database and non-relational database synchronization scheme be proposed, to avoid existing There are the disadvantages of technology, has become the problem that current industry urgently overcomes in fact.
Invention content
In view of the missing of the above-mentioned prior art, one of present invention purpose is to propose a kind of relevant database and non-relationship The synchronization system and method for type database, it is not necessary that existing database is transformed.
Another object of the present invention be to propose a kind of relevant database and non-relational database synchronization system and Method can accurately reflect data variation.
To reach above-mentioned and other purposes, the present invention proposes that a kind of relevant database is synchronous with non-relational database and is System, including:Configuration module, for configuring the literary name section in document field and relevant database in non-relational database Correspondence, and form configuration relation document;Read module, the document of the configuration relation document stored by the configuration module Name and the time zone provided by timing module read related data from the non-relational database;Timing module, for remembering Record the time that the read module accesses the non-relational database, provide time zone that the last visit time accesses to this to The read module;Conversion module, the configuration relation text stored according to the read related data of read module and configuration module Shelves generate the command statement for relevant database operation;And execution module, the order generated according to the conversion module Sentence is to the relevant database execution of command operations.
Preferably, the system of the present invention further includes detection module, in the command statement for detecting conversion module generation Whether include identical major key, if so, then enabling the conversion module that will further merge comprising the command statement of identical major key.It is described Command statement is, for example, to be inserted into (insert), update (update) or delete (delete) command statement.
Preferably, the timing module of the present invention is timer, the read module can be embedded in or independently of the reading mould Block.
The present invention also proposes a kind of synchronous method of relevant database and non-relational database, including:Step S1:Match The correspondence of the literary name section in the document field and relevant database in non-relational database is set, and is formed configuration Relational document;Step S2:It accesses the non-relational database, while the time of the record access non-relational database, and carries For the last visit time to this access time region;Step S3:Document name and the time zone according to the configuration relation document Related data is read from the non-relational database in domain;Step S4:According to read related data and configuration relation text Shelves generate the command statement for relevant database operation;And step S5:According to the command statement generated to the pass It is that type database carries out command operation.
Preferably, whether can further comprise detecting before above-mentioned steps S5 in generated command statement comprising identical Major key, if so, then further will comprising the command statement of identical major key merge, to be optimized to command statement;If no, Then directly execute step S5.
In conclusion the synchronization scheme of disclosed relevant database and non-relational database, mainly Through the mode of the correspondence of the literary name section in the document field and relevant database in configuration non-relational database, and Record accesses the time of non-relational database every time, to be carried out according to configuration relation document and time zone when subsequent access Related data is extracted, later can by the data conversion of extraction at command statement, so as to according to the command statement to relational data Library carries out command operation, such as the operations such as data are deleted, are inserted into, update.Compared with prior art, the present invention is not necessarily to existing System where relevant database is transformed that relevant database can be realized is synchronous with non-relational database.In addition, this Invention provides timestamp in process operation data, and can pass through the data extracted in non-relational database and provide data movement Situation, such as be inserted into data, delete data, update the data, and then can understand and reflect data movement, and can be according to timestamp Judge the data correctness of extraction.
Description of the drawings
Below by a manner of clearly understandable, preferred embodiment is described with reference to the drawings, to a kind of relevant database with Above-mentioned characteristic, technical characteristic, advantage and its realization method of non-relational database synchronization system and method give furtherly It is bright.
Fig. 1 is a kind of the basic of relevant database and the non-relational database synchronization system first embodiment of the present invention Configuration diagram;
Fig. 2 is a kind of the basic of relevant database and the non-relational database synchronization system second embodiment of the present invention Configuration diagram;
Fig. 3 is that a kind of relevant database of the present invention is illustrated with the key step of non-relational database synchronous method Figure;And
Fig. 4 is that the key step of another relevant database of the invention and non-relational database synchronous method is illustrated Figure.
Drawing reference numeral explanation:
1. relevant database, 2. non-relational databases, 10. configuration modules, 11. read modules, 12. timing modules, 13. conversion module, 14. execution modules, 15. detection modules.
Specific implementation mode
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, control is illustrated below The specific implementation mode of the present invention.It should be evident that drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing, and obtain other embodiments.
To make simplified form, part related to the present invention is only schematically shown in each figure, they are not represented Its practical structures as product.In addition, so that simplified form is easy to understand, there is identical structure or function in some figures Component only symbolically depicts one of those, or has only marked one of those.Herein, "one" is not only indicated " only this ", can also indicate the situation of " more than one ".
That shown in Figure 1 is that disclosed relevant database is implemented with non-relational database synchronization system first The basic framework schematic diagram of example.It is synchronous with non-relational database 2 through the achievable relevant database 1 of the present invention.Such as Fig. 1 Shown, which includes configuration module 10, read module 11, timing module 12, conversion module 13 and execution module 14, below Logical relation and operation principles i.e. between those modules of the present invention are described in detail.
Configuration module 10, for configuring the document field in non-relational database 2 and the literary name in relevant database 1 The correspondence of section, and form configuration relation document.
Read module 11 can be formed by the document name of configuration relation document and by timing module according to the configuration module 10 11 time zones provided read related data from the non-relational database 2.In the present invention, read module 11 is from non- Related data is read in the daily record of relevant database, record there are the various operations to data in the daily record, such as to database In data be inserted into (insert), update (update) or delete the operations such as (delete), while also record has and those operations Corresponding time zone (i.e. timestamp), therefore, read module 11 can be used as index from non-pass according to document name and time zone It is that type database 2 reads related data.
Timing module 12 accesses the time of non-relational database 2 for recording read module 11, when providing last visit Between to this access time zone to read module 11.The timing module 12 is a timer, which can embed In above-mentioned read module 11, i.e., the two design is integral or the timing module 12 is independently of the read module 11, is specifically adopted It need to be depending on implementing design and needing with which kind of mode.
Conversion module 13 is closed according to the configuration that 11 read related data of read module and configuration module 10 are generated It is the command statement that document structure tree is directed to relevant database operation.The command statement generated be, for example, be inserted into, update or Delete command sentence etc., recorded in the daily record in those command statements and above-mentioned non-relational database 2 to data in library Various operations are corresponding.The command statement generated can execute in relevant database 1, and then can be in the relevant database 1 pair of data be inserted into such as data, is updated, operation deletion, so that relevant database 1 and non-relational database 2 data synchronize.
Execution module 14, the command statement generated according to conversion module 13 to the relevant database execution of command operations, And then finish relation type database 1 is synchronous with non-relational number library 2.
That shown in Figure 2 is the basic of relevant database of the present invention and non-relational database synchronization system second embodiment Configuration diagram.As shown in Fig. 2, the revealed scheme of the present embodiment is in addition to including above-mentioned configuration module 10, read module 11, meter When module 12, conversion module 13, further include a detection module 15 outside execution module 14.Detection module 15 is used in conversion module Whether include identical major key (prime key) in the generated command statement of detection, if including phase after 13 generate command statement Same major key then enables conversion module 13 further merge the command statement comprising identical major key, to be carried out to command statement Optimization.The revealed configuration module 10 of the present embodiment, read module 11, timing module 12, conversion module 13, execution module 14 with The revealed respective modules function of first embodiment is identical, then this is repeated no more.
It is executed using the synchronization system of relevant database disclosed in first embodiment of the invention and non-relational database The step schematic diagram of the relevant database of the present invention and the synchronous method of non-relational database is as shown in Figure 3.This method packet Include following steps.
Step S1:Configure the document field pass corresponding with the literary name section in relevant database in non-relational database System, and configuration relation document is formed, then proceed to next step S2.
Step S2:It accesses the non-relational database, while the time of the record access non-relational database, and provides The last visit time to this access time region, then proceeds to step S3.
Step S3:According to the document name of the configuration relation document and the time zone phase is read from the non-relational database Close data;Then step S4 is proceeded to.
Step S4:It is grasped for the relevant database according to read related data and the configuration relation document structure tree The command statement of work;Then next step is proceeded to.
Step S5:Command operation is carried out to the relevant database according to the command statement generated.
Fig. 4 is that the present invention proposes that another relevant database and the step of the synchronous method of non-relational database are illustrated Figure, the difference is that, this method further comprises step S4 ' after above-mentioned steps S4 with the above method:Detection is given birth to At command statement in whether include identical major key, if without further executing above-mentioned steps S5;If so, then further executing Step S4 ":It will merge comprising the command statement of identical major key, continue to execute above-mentioned steps S5 later.It through the invention can be into one Step optimizes the step S4 command statements generated.
It should be noted that above-described embodiment can be freely combined as needed.The above is only the preferred of the present invention Embodiment, it is noted that for those skilled in the art, in the premise for not departing from the principle of the invention Under, several improvements and modifications can also be made, these improvements and modifications also should be regarded as protection scope of the present invention.

Claims (8)

1. the synchronization system of a kind of relevant database and non-relational database, which is characterized in that including:
Configuration module, it is corresponding with the literary name section in relevant database for configuring the document field in non-relational database Relationship, and form configuration relation document;
Read module, the document name of the configuration relation document stored by the configuration module and by timing module provided when Between region from the non-relational database read related data;
Timing module accesses the time of the non-relational database for recording the read module, provides the last visit time extremely This time zone accessed gives the read module;
Conversion module, the configuration relation document structure tree needle generated according to the read related data of read module and configuration module To the command statement of relevant database operation;And
Execution module, the command statement generated according to the conversion module is to the relevant database execution of command operations.
2. the synchronization system of relevant database as described in claim 1 and non-relational database, it is characterised in that:The life It is insertion, update or delete command sentence to enable sentence.
3. the synchronization system of relevant database as described in claim 1 and non-relational database, it is characterised in that:Also wrap Detection module is included, whether includes identical major key in the command statement for detecting conversion module generation, if so, then enabling this turn Changing the mold block will further merge comprising the command statement of identical major key.
4. the synchronization system of relevant database as described in claim 1 and non-relational database, it is characterised in that:The meter When module be timer.
5. the synchronization system of relevant database as claimed in claim 4 and non-relational database, it is characterised in that:This is fixed When device can be embedded in the read module or independently of the read module.
6. the synchronous method of a kind of relevant database and non-relational database, which is characterized in that including:
Step S1:The correspondence of the literary name section in the document field and relevant database in non-relational database is configured, And formed configuration relation document;
Step S2:It accesses the non-relational database, while the time of the record access non-relational database, and last time is provided Access time is to this access time region;
Step S3:According to the document name of the configuration relation document and the time zone dependency number is read from the non-relational database According to;
Step S4:According to read related data and the configuration relation document structure tree for relevant database operation Command statement;And
Step S5:Command operation is carried out to the relevant database according to the command statement generated.
7. the synchronous method of relevant database as claimed in claim 6 and non-relational database, it is characterised in that:Step Whether include identical major key, if so, then further will packet if can further comprise detecting before S5 in generated command statement Command statement containing identical major key merges, if the directly execution step S5 without if.
8. the synchronous method of relevant database as claimed in claim 6 and non-relational database, which is characterized in that the life It is insertion, update or delete command sentence to enable sentence.
CN201510817110.1A 2015-11-23 2015-11-23 A kind of synchronization system and method for relevant database and non-relational database Active CN105279285B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510817110.1A CN105279285B (en) 2015-11-23 2015-11-23 A kind of synchronization system and method for relevant database and non-relational database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510817110.1A CN105279285B (en) 2015-11-23 2015-11-23 A kind of synchronization system and method for relevant database and non-relational database

Publications (2)

Publication Number Publication Date
CN105279285A CN105279285A (en) 2016-01-27
CN105279285B true CN105279285B (en) 2018-07-24

Family

ID=55148299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510817110.1A Active CN105279285B (en) 2015-11-23 2015-11-23 A kind of synchronization system and method for relevant database and non-relational database

Country Status (1)

Country Link
CN (1) CN105279285B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912665B (en) * 2016-04-12 2019-05-03 清华大学 The model conversion and data migration method of a kind of Neo4j to relevant database
CN106095991B (en) * 2016-06-21 2019-07-09 南京大学 A method of automatically generating the code from relevant database to MongoDB database data migration
CN108121718B (en) * 2016-11-28 2021-12-24 北京国双科技有限公司 Data processing method and synchronization equipment
CN108170815B (en) * 2017-12-29 2022-07-05 ***股份有限公司 Data processing method, device and storage medium
CN111046100B (en) * 2019-11-25 2024-03-08 武汉达梦数据库股份有限公司 Method and system for synchronizing relational database to non-relational database
CN113448942B (en) * 2020-03-27 2022-07-22 阿里巴巴集团控股有限公司 Database access method, device, equipment and storage medium
CN114676094B (en) * 2022-05-27 2022-08-26 云上(江西)大数据发展有限公司 Method, system and readable storage medium for full-period management of digitized government projects
CN115203328A (en) * 2022-07-14 2022-10-18 武汉友理节能科技有限公司 Method and system for synchronizing relational database to non-relational database

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1840767A2 (en) * 2006-03-28 2007-10-03 Sun Microsystems, Inc. Systems and methods for a distributed cache
CN102129478A (en) * 2011-04-26 2011-07-20 广州从兴电子开发有限公司 Database synchronization method and system thereof
CN103106200A (en) * 2011-11-09 2013-05-15 上海盛霄云计算技术有限公司 Synchronization system of non-relational type database and double-writing synchronization method
CN104809199A (en) * 2015-04-24 2015-07-29 联动优势科技有限公司 Database synchronization method and device
CN104967658A (en) * 2015-05-08 2015-10-07 成都品果科技有限公司 Data synchronization method on multiple devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1840767A2 (en) * 2006-03-28 2007-10-03 Sun Microsystems, Inc. Systems and methods for a distributed cache
CN102129478A (en) * 2011-04-26 2011-07-20 广州从兴电子开发有限公司 Database synchronization method and system thereof
CN103106200A (en) * 2011-11-09 2013-05-15 上海盛霄云计算技术有限公司 Synchronization system of non-relational type database and double-writing synchronization method
CN104809199A (en) * 2015-04-24 2015-07-29 联动优势科技有限公司 Database synchronization method and device
CN104967658A (en) * 2015-05-08 2015-10-07 成都品果科技有限公司 Data synchronization method on multiple devices

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种通用的多数据库间数据抽取方法及应用;刘如九等;《北京交通大学学报》;20080830;全文 *

Also Published As

Publication number Publication date
CN105279285A (en) 2016-01-27

Similar Documents

Publication Publication Date Title
CN105279285B (en) A kind of synchronization system and method for relevant database and non-relational database
US11429641B2 (en) Copying data changes to a target database
US10180946B2 (en) Consistent execution of partial queries in hybrid DBMS
CN103617176B (en) One kind realizes the autosynchronous method of multi-source heterogeneous data resource
CN103530290B (en) Data migration method and system between database
CN102982085B (en) Data mover system and method
US8886596B2 (en) Method for reorganizing or moving a database table
CN105373541B (en) The processing method and system of the data operation request of database
US8938430B2 (en) Intelligent data archiving
CN105868343B (en) Database migration method and system
CN107122355A (en) Data mover system and method
CN103853718B (en) Fragment data storehouse access method and Database Systems
CN107122360A (en) Data mover system and method
CN110096522B (en) Block chain data processing method, device and equipment supporting relational retrieval
CN105930493A (en) Method and system for data synchronization between different databases
CN109582695A (en) Data general-purpose querying method and inquiry system under a kind of micro services framework
CN105808653A (en) User label system-based data processing method and device
CN105787058A (en) User label system and data pushing system based on same
WO2017074654A1 (en) Techniques for application undo and redo using sql patchsets or changesets
Kvet et al. Uni-temporal modelling extension at the object vs. attribute level
CN101853278A (en) Application method of data storage system
CN115658815A (en) CDC (control data center) -based data synchronization method
JP5960798B2 (en) How to manage the database
CN112612647B (en) Log parallel replay method, device, equipment and storage medium
CN107633056A (en) Data managing method for power information acquisition terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201202

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co., Ltd

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right

Effective date of registration: 20201222

Address after: 230000, 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee after: Bengbu Lichao Information Technology Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co., Ltd

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210312

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: 230000, 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee before: Bengbu Lichao Information Technology Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210901

Address after: 321, floor 3, building 8, Zhongguancun Software Park, No. 8, Dongbeiwang West Road, Haidian District, Beijing 100089

Patentee after: DMS Corp.

Address before: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee before: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right