CN106682002A - Database synchronization method and system, source data and target data synchronization device - Google Patents

Database synchronization method and system, source data and target data synchronization device Download PDF

Info

Publication number
CN106682002A
CN106682002A CN201510750681.8A CN201510750681A CN106682002A CN 106682002 A CN106682002 A CN 106682002A CN 201510750681 A CN201510750681 A CN 201510750681A CN 106682002 A CN106682002 A CN 106682002A
Authority
CN
China
Prior art keywords
source
unique index
data
synchronization message
target
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
CN201510750681.8A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510750681.8A priority Critical patent/CN106682002A/en
Priority to PCT/CN2016/104537 priority patent/WO2017076321A1/en
Publication of CN106682002A publication Critical patent/CN106682002A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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

Abstract

The invention provides a synchronization device for source data and target data and a database synchronization method and system. Through monitoring source tables in source database, the source unique index of the source data in the source table based on the operation of the data manipulation language is added to the intermediate table corresponding to the source table; after satisfying the synchronization conditions, relevant source data to be synchronized in the source table is searched based on the source unique index recorded in the intermediate table and a synchronization message carrying the source unique index is sent to a target in the target library corresponding to the source table; searching and synchronization are carried out in the target table according to the synchronization message. The synchronization process does not need to be done in archive mode, which guarantees the performance of database and saves disk space.

Description

Database synchronization method and system, source data and target data sychronisation
Technical field
The present invention relates to database field, more particularly to a kind of database synchronization method and system, source data and Target data sychronisation.
Background technology
Have various methods for realizing that oracle database is synchronous at present, including dataguard, stream, The mature technologies such as goldengate are realized.
In the simultaneous techniques of data above storehouse, belong to be completed under oracle archive modes, based on excavation Oracle archive logs or redo daily records complete data syn-chronization.And oracle opens archive mode to data Library disk space there are certain requirements, and need configuration regularly to clear up mechanism cleaning filing.And, above skill Art is applied to the synchronization of large-scale many data volumes, for the database synchronization of some special scenes, may not have Condition realizes data syn-chronization using above-mentioned technology, and after filing is opened, database performance can be received with disk space To restriction, especially this problem of the big database of data volume is more serious.
The content of the invention
The invention provides a kind of database synchronization method and system, source data and target data sychronisation, Solve in prior art that factor data bank is synchronously completed under archive mode and caused database performance is not good, The limited problem of disk space.
To solve above-mentioned technical problem, the invention provides a kind of database synchronization method, comprises the steps:
Source table in source database is monitored;
When there is the operation based on DML in certain a part of source data in monitoring the source table, The corresponding source unique index of this part source data is added in middle table corresponding with the source table;
After the first synchronous condition meets, the source unique index in the middle table is true in the source table Source data to be synchronized is made, and correspondence object table is sent including at least the source data to be synchronized in object library The synchronization message of corresponding source unique index.
Further, the source table one middle table of unique correspondence;The first synchronous condition bag Include:Reach the accumulative quantity of default time and/or the middle table and reach default threshold value.
Further, the source unique index includes the corresponding Major key of source data in the source table.
Further, it is described that source data to be synchronized, and the correspondence object table in object library are determined in the table of source Sending the synchronization message of the source unique index including at least the source data to be synchronized includes:
Judge that the source unique index whether there is in the source table;
If it is not, then only including the source unique index in the synchronization message;
If so, the corresponding source data of the source unique index is then extracted as data to be synchronized, and add described In synchronization message.
Further, before the source table in source database is monitored, also include:
Judge the data magnitude of the source table whether less than default order of magnitude threshold value;
If so, then after the second synchronous condition satisfaction, by the current institute's active data of the source table and corresponding Source unique index is sent to the object table and synchronizes matching.
Further, the simultaneously match includes:Matching is carried out based on merge sentences synchronous.
In order to solve above-mentioned technical problem, present invention also offers a kind of database synchronization method, including it is as follows Step:
Receive the synchronization message of source table in source database, the synchronization message is at least including being based on The corresponding source unique index of source data to be synchronized of the operation of DML;
The source unique index is extracted from the synchronization message;
The unique rope of corresponding target is searched in the corresponding object table of object library according to the source unique index Draw, and operation is synchronized according to lookup result and the synchronization message.
Further, it is described operation is synchronized according to lookup result and synchronization message to include:
There is target unique index corresponding with the source unique index in lookup result is the object table, And when only including the source unique index in the synchronization message, the target in the deletion object table is only One index and corresponding target data;
There is target unique index corresponding with the source unique index in lookup result is the object table, And when including the source unique index and corresponding source data to be synchronized in the synchronization message, then treated with described Synchronous source data updates target data corresponding with target unique index in the object table;
There is no the unique rope of target corresponding with the source unique index in lookup result is the object table When drawing, and the source unique index and corresponding source data to be synchronized are included in the synchronization message, then by institute State source unique index and corresponding source data to be synchronized is inserted in the object table.
In order to solve above-mentioned technical problem, present invention also offers a kind of database synchronization method, including it is as follows Step:
The data of the source table in source database are monitored;
When there is the operation based on DML in certain a part of source data in monitoring the source table, The corresponding source unique index of this part source data is added in middle table corresponding with the source table;
After the first synchronous condition meets, the source unique index in the middle table is true in the source table Source data to be synchronized is made, and correspondence object table is sent including at least the source data to be synchronized in object library The synchronization message of corresponding source unique index;
The source unique index is extracted from the synchronization message;
Corresponding target unique index is searched in the object table according to the source unique index, and according to looking into Result and the synchronization message is looked for synchronize operation.
In order to solve above-mentioned technical problem, present invention also offers a kind of source data sychronisation, including triggering Module, message module, the first sending module;
The trigger module is used to be monitored the source table of the source database, in the source table is monitored Certain a part of source data when there is the operation based on DML, by this corresponding source of part source data Unique index is added in middle table corresponding with the source table;
The source unique index that the message module is used in the middle table is determined in the source table and treated Synchronous source data, and generate synchronization message;The synchronization message is at least including the source of the source data to be synchronized Unique index;
First sending module is used to for the synchronization message to be sent to corresponding object table in object library.
Further, also including judge module, the second sending module;
Whether the judge module is used to judge the data magnitude of the source table less than default order of magnitude threshold value;
Second sending module is used for when the judge module judges the data magnitude of the source table less than default The order of magnitude threshold value when, after the second synchronous condition is met, by the current institute active data correspondence of the source table Source unique index be sent to the object table.
In order to solve above-mentioned technical problem, present invention also offers a kind of target data sychronisation, including connecing Receive module, extraction module, synchronization module;
The receiver module is used to receive the synchronization message of the source table in source database;The synchronization message Including the corresponding source unique index of source data occurred in the source table based on the operation of DML;
The extraction module is used to extract the source unique index from the synchronization message;
The synchronization module is used to that corresponding target to be searched in the object table only according to the source unique index One index, and operation is synchronized according to lookup result and the synchronization message.
Further, the synchronization module includes inquiry submodule, deletes submodule, inserts submodule, more New submodule;
The target that the inquiry submodule is used to inquire about in the corresponding object table of the source unique index is unique Index;
The deletion submodule is corresponding with the source unique index for existing in the object table is inquired Target unique index, and when only including the source unique index in the synchronization message, delete the object table In the target unique index and corresponding target data;
The renewal submodule is corresponding with the source unique index for existing in the object table is inquired Comprising the source unique index and corresponding source data to be synchronized in target unique index, and the synchronization message When, then update target data corresponding with target unique index in the object table with the source data to be synchronized;
The insertion submodule is corresponding with the source unique index for not existing in the object table is inquired Target unique index, and comprising the source unique index and corresponding source number to be synchronized in the synchronization message According to when, then the source unique index and corresponding source data to be synchronized are inserted in the object table.
In order to solve above-mentioned technical problem, present invention also offers a kind of database synchronous system, including source number According to sychronisation and target data sychronisation;The source data sychronisation includes trigger module, message mould Block, the first sending module;The target data sychronisation includes receiver module, extraction module, synchronous mould Block;
The trigger module is used to be monitored the source table of the source database, in the source table is monitored Certain a part of source data when there is the operation based on DML, by this corresponding source of part source data Unique index is added in middle table corresponding with the source table;
The source unique index that the message module is used in the middle table is determined in the source table and treated Synchronous source data, and generate synchronization message;The synchronization message is at least including the source of the source data to be synchronized Unique index;
First sending module is used to for the synchronization message to be sent to corresponding object table in object library;
The receiver module is used to receive the synchronization message from the source table;
The extraction module is used to extract the source unique index from the synchronization message;
The synchronization module is used to that corresponding target to be searched in the object table only according to the source unique index One index, and operation is synchronized according to lookup result.
Beneficial effect
The invention provides source data, target data sychronisation and database synchronization method and system, pass through , will there is the source data based on the operation of DML in the table of source in the monitoring to the source table in source database Source unique index be added in middle table corresponding with source table, after synchronous condition is met, according to centre The source unique index recorded in table searches the source data to be synchronized of correlation in the table of source, and to corresponding with source table Object table in object library sends the synchronization message with active unique index, further according to the synchronization message in target Make a look up in table and synchronous;The present invention is directly based on data manipulation language using generation in middle table record source table The source unique index of the source data of the operation of speech, without log recording is adopted, is not used in being completed under archive mode, The performance of database is ensure that, disk space has been saved.
Description of the drawings
Fig. 1 is database synchronization method flow chart in the embodiment of the present invention one;
Fig. 2 is database synchronization method flow chart in the embodiment of the present invention two;
Fig. 3 is database synchronization method flow chart in the embodiment of the present invention three;
Fig. 4 is source data sychronisation schematic diagram in the embodiment of the present invention four;
Fig. 5 is target data sychronisation schematic diagram in the embodiment of the present invention five;
Fig. 6 is database synchronous system schematic diagram in the embodiment of the present invention six.
Specific embodiment
Inventive conception is that, detect the action of source table in source database, will occur to be based on data manipulation language The source unique index of the source data of the operation of speech is added in middle table corresponding with source table, further according to middle table Search in the source unique index of middle record object table respectively in source table and object library, without opening mould is filed Formula, effectively reduces the waste of disk space.
Embodiment one
A kind of database synchronization method is present embodiments provided, as shown in figure 1, refer to Fig. 1:
S101, the source table in source database is monitored;
S102, certain a part of source data in source table is monitored occur to be based on DML (Data Manipulation Language, DML) operation when, by the addition of this part source data corresponding source unique index To in middle table corresponding with source table;
S103, the first synchronous condition meet after, the source unique index in middle table determines in the table of source Go out source data to be synchronized, and correspondence object table sends corresponding including at least source data to be synchronized in object library The synchronization message of source unique index.
Wherein, when there is DML operations in certain a part of source data detected in the table of source in step S102, this Part source data there occurs change, including this part source of delete (deletion) on the basis of original data Data, insert (insertion) this part source data, or update (renewal) this part source data;This After three kinds of DML operations are monitored to, the corresponding source unique index of this part source data can be added to and this In the corresponding middle table of source table.Middle table pre-builds that a middle table can be unique correspondence one Individual source table, at this moment only records the source unique index of the source data in a source table in a middle table, source is unique Index is preferably the Major key of source table, directly reduces defining as source unique index using the Major key of source table Journey, reduces cost and saving time;Can also be that a middle table can be with the source number of the multiple source tables of corresponding record According to source unique index, be accomplished by further adding each source table on the unique index of source in this case Mark.
In step s 103, the source unique index for being determined according to step S102, the source unique index to source table Make a look up, and synchronization message is generated according to the result searched;This search procedure is included in middle table Source unique index is compared one by one with the source unique index of source table, and the result of comparison has the following two kinds:Source table In there is no source unique index, then illustrate the source data there occurs delete operate, synchronization message now is only Only comprising source unique index without corresponding source data;There is source unique index in the table of source, then illustrate The corresponding source data of source unique index exists in the table of source, illustrate the source data there occurs insert operate or Person update is operated, and now, the source data is extracted as data to be synchronized, and is added to synchronous disappearing In breath, i.e., source unique index and corresponding source data to be synchronized are contained in synchronization message.It is such to search Journey can allow middle table only to add source unique index, save disk space.
The first above-mentioned synchronous condition represents that the object table being sent to synchronization message in object library needs what is met Opportunity, this opportunity can be the timing mechanism of default interval time, that is, reach the default time and be carried out Synchronization message is sent into object table;Can also be on the premise of the synchronization of multiple tables is carried out, if in source table Middle table corresponding with source table is generated when generation DML is operated, then the accumulative quantity of middle table reaches default threshold Value can also be as the opportunity that synchronization message is sent to object table, depending on total amount of the threshold value according to source table; The combination of the synchronous condition of above two first is can also be, i.e., any one is performed synchronization in both satisfactions Message is sent to object table.The burden that can so avoid real-time synchronization from causing to database, it is also possible to make number According to the synchronous timely enough of storehouse.
Further, before the source table in source database is monitored, also including the data for judging source table Whether magnitude is less than default order of magnitude threshold value.If now the data magnitude of source table is less than default order of magnitude threshold Value, then can be after the second synchronous condition meets, by the current institute's active data of source table and the unique rope in corresponding source Object table is given in initiation, synchronizes matching.On the premise of source table data magnitude is less than threshold value, this is adopted The time that the mode of kind is consumed is less, and source table is not affected;Default order of magnitude threshold value is according to database Depending on performance.The simultaneously match process is preferably based on the simultaneously match process of merge sentences, specifically includes: The source unique index of the current all data of source table is sent into object table, by source unique index and the mesh of object table Mark unique index is matched, if the match is successful, using corresponding target in source data update object table Data;If matching is unsuccessful, using source table data insert object table;Finally, search and delete There is target unique index in object table and there is no the number of targets of corresponding source unique index in the table of source According to.Further, the second synchronous condition set and performed at interval of a period of time to reach the default time The current institute's active data of source table and corresponding source unique index are sent into object table;Interval time now can Depending on according to the frequency of DML operations in the table of source, it is not necessary to be set as fixed value.
Embodiment two
A kind of database synchronization method is present embodiments provided, as shown in Fig. 2 refer to Fig. 2:
The synchronization message of the source table of S201, reception in source database, synchronization message at least includes base In the corresponding source unique index of the source data to be synchronized of the operation of DML;
Wherein, the synchronization message is consistent with the synchronization message in embodiment one, repeats no more here.
S202, extract from synchronization message source unique index;
S203, the unique rope of corresponding target is searched in the corresponding object table of object library according to source unique index Draw, and operation is synchronized according to lookup result and synchronization message.
In step S202, source unique index is extracted from synchronization message and is referred in the synchronization message for receiving In included at least and the corresponding source unique index of source data to be synchronized that there occurs that DML is operated, by the source only One index is extracted and compared with the target unique index of object table, i.e., in step S203 according to source only One index searches corresponding target unique index in object table.The result of lookup has following two:Object table It is middle to there is target unique index corresponding with source unique index;Do not exist in object table corresponding with source unique index Target unique index.And synchronization message has two kinds:Containing only active unique index;Containing active unique index and Corresponding source data to be synchronized.There is target corresponding with source unique index only in lookup result is object table One index, and synchronization message is when comprising only unique index, it can be deduced that source data there occurs that delete is operated, The now target unique index and corresponding target data in delete object tables;When lookup result is object table It is middle to there is target unique index corresponding with source unique index, and synchronization message containing active unique index and correspondence Source data to be synchronized when, it can be deduced that source data there occurs update operate, now use source data to be synchronized Target data corresponding with target unique index in update object tables;Do not deposit in lookup result is object table In target unique index corresponding with source unique index, and containing active unique index and corresponding in synchronization message During source data to be synchronized, it can be deduced that source data there occurs that insert is operated, now by source unique index and right In the source data insert object table to be synchronized answered.Further, target unique index is preferably object table Major key.
Embodiment three
A kind of database synchronization method is present embodiments provided, as shown in figure 3, refer to Fig. 3:
S301, the data to the source table in source database are monitored;
S302, when there is the operation based on DML in a part of source data of certain in monitoring source table, The corresponding source unique index of this part source data is added in middle table corresponding with source table;
S303, the first synchronous condition meet after, the source unique index in middle table determines in the table of source Go out source data to be synchronized, and correspondence object table sends corresponding including at least source data to be synchronized in object library The synchronization message of source unique index;
S304, extract from synchronization message source unique index;
S305, corresponding target unique index is searched in object table according to source unique index, and according to lookup As a result operation is synchronized with synchronization message.
Example IV
A kind of source data sychronisation is present embodiments provided, as shown in figure 4, refer to Fig. 4:
Source data sychronisation includes trigger module 401, message module 402, the first sending module 403;
Trigger module 401 is used to be monitored the source table in source database;It is a certain in source table is detected When partial data occurs DML operations, the corresponding source unique index of this part source data is added to and source table pair In the middle table answered.Trigger module 401 is generally positioned in the table of source, and whether real-time monitoring source table there occurs DML Operation, the trigger module 401 is preferably trigger, once there occurs that DML operations will be triggered.
Message module 402 be used for source data to be synchronized is determined in the table of source according to the source unique index of middle table, And generate synchronization message.Wherein, the synchronization message is consistent with the synchronization message in embodiment one, here no longer Repeat.
First sending module 403 is used to for synchronization message to be sent to corresponding object table in object library.
Additionally, also including the sending module 405 of judge module 404 and second;Judge module 404 is used in triggering Before module is monitored to the source table of source database, judge the data magnitude of source table whether less than default number Magnitude threshold value;Second sending module is used for when judge module judges that the data magnitude of source table is less than default quantity During level threshold value, after the second synchronous condition is met, by the current unique rope in the corresponding source of institute's active data of source table Object table is given in initiation.
Embodiment five
A kind of target data sychronisation is present embodiments provided, as shown in figure 5, refer to Fig. 5:
Target data sychronisation includes receiver module 501, extraction module 502, synchronization module 503;
Receiver module 501 is used to receive the synchronization message of the source table from source database;The synchronization message and reality The synchronization message applied in example one is consistent, repeats no more here.
Extraction module 502 is used to extract source unique index from synchronization message;
Synchronization module 503 is used to that corresponding target unique index to be searched in object table according to source unique index, And operation is synchronized according to lookup result and synchronization message.
Further, synchronization module includes inquiry submodule 5031, deletes submodule 5032, updates submodule 5033, insert submodule 5034;The mesh that inquiry submodule is used in the corresponding object table of query source unique index Mark unique index, lookup result is consistent with the lookup result in embodiment two, repeats no more here;Delete son Module 5032 is used for there is target unique index corresponding with source unique index in lookup result is object table, And when only including source unique index in synchronization message, target unique index in delete object tables and corresponding Target data;Update submodule 5033 to be used to work as lookup result is that presence is corresponding with source unique index in object table Target unique index, and comprising source unique index and during corresponding source data to be synchronized in synchronization message, use Target data corresponding with target unique index in source data update object table to be synchronized;Insertion submodule 5034 are used for there is no target unique index corresponding with source unique index in lookup result is object table, and Comprising source unique index and during corresponding source data to be synchronized in synchronization message, by source unique index and corresponding In source data insert object table to be synchronized.
Embodiment six
A kind of database synchronous system is present embodiments provided, as shown in fig. 6, refer to Fig. 6:
Data synchronous system includes source data sychronisation 40 and target data sychronisation 50;Wherein source data Sychronisation 40 includes trigger module 401, message module 402, the first sending module 403;Target data is same Step device 50 includes receiver module 501, extraction module 502, synchronization module 503.
Trigger module 401 is used to be monitored the source table in source database;It is a certain in source table is detected When partial data occurs DML operations, the corresponding source unique index of this part source data is added to and source table pair In the middle table answered.Trigger module 401 is generally positioned in the table of source, and whether real-time monitoring source table there occurs DML Operation, the trigger module 401 is preferably trigger, once there occurs that DML operations will be triggered.
Message module 402 be used for source data to be synchronized is determined in the table of source according to the source unique index of middle table, And generate synchronization message.Wherein, the synchronization message is consistent with the synchronization message in embodiment one, here no longer Repeat.
First sending module 403 is used to for synchronization message to be sent to corresponding object table in object library.
Receiver module 501 is used to receive the synchronization message of the source table from source database;
Extraction module 502 is used to extract source unique index from synchronization message;
Synchronization module 503 is used to that corresponding target unique index to be searched in object table according to source unique index, And operation is synchronized according to lookup result and synchronization message.
Above content is to combine specific embodiment further description made for the present invention, it is impossible to recognized Being embodied as of the fixed present invention is confined to these explanations.For the ordinary skill of the technical field of the invention For personnel, without departing from the inventive concept of the premise, some simple deduction or replace can also be made, Protection scope of the present invention should be all considered as belonging to.

Claims (14)

1. a kind of database synchronization method, it is characterised in that comprise the steps:
Source table in source database is monitored;
When there is the operation based on DML in certain a part of source data in monitoring the source table, The corresponding source unique index of this part source data is added in middle table corresponding with the source table;
After the first synchronous condition meets, the source unique index in the middle table is true in the source table Source data to be synchronized is made, and correspondence object table is sent including at least the source data to be synchronized in object library The synchronization message of corresponding source unique index.
2. database synchronization method as claimed in claim 1, it is characterised in that a source table is only One one middle table of correspondence;First synchronous condition includes:Reach the default time and/or it is described in Between the accumulative quantity of table reach default threshold value.
3. database synchronization method as claimed in claim 1, it is characterised in that the source unique index Including the corresponding Major key of source data in the source table.
4. the database synchronization method as described in any one of claims 1 to 3, it is characterised in that described Source data to be synchronized is determined in the table of source, and the transmission of correspondence object table is treated including at least described in object library The synchronization message of the source unique index of synchronous source data includes:
Judge that the source unique index whether there is in the source table;
If it is not, then only including the source unique index in the synchronization message;
If so, the corresponding source data of the source unique index is then extracted as data to be synchronized, and add described In synchronization message.
5. the database synchronization method as described in any one of claims 1 to 3, it is characterised in that in institute State before being monitored to the source table in source database, also include:
Judge the data magnitude of the source table whether less than default order of magnitude threshold value;
If so, then after the second synchronous condition satisfaction, by the current institute's active data of the source table and corresponding Source unique index is sent to the object table and synchronizes matching.
6. database synchronization method as claimed in claim 5, it is characterised in that the simultaneously match bag Include:Matching is carried out based on merge sentences synchronous.
7. a kind of database synchronization method, it is characterised in that comprise the steps:
Receive the synchronization message of source table in source database, the synchronization message is at least including being based on The corresponding source unique index of source data to be synchronized of the operation of DML;
The source unique index is extracted from the synchronization message;
The unique rope of corresponding target is searched in the corresponding object table of object library according to the source unique index Draw, and operation is synchronized according to lookup result and the synchronization message.
8. database synchronization method as claimed in claim 7, it is characterised in that described according to searching knot Fruit and synchronization message synchronize operation to be included:
There is target unique index corresponding with the source unique index in lookup result is the object table, And when only including the source unique index in the synchronization message, the target in the deletion object table is only One index and corresponding target data;
There is target unique index corresponding with the source unique index in lookup result is the object table, And when including the source unique index and corresponding source data to be synchronized in the synchronization message, then treated with described Synchronous source data updates target data corresponding with target unique index in the object table;
There is no the unique rope of target corresponding with the source unique index in lookup result is the object table When drawing, and the source unique index and corresponding source data to be synchronized are included in the synchronization message, then by institute State source unique index and corresponding source data to be synchronized is inserted in the object table.
9. a kind of database synchronization method, it is characterised in that comprise the steps:
The data of the source table in source database are monitored;
When there is the operation based on DML in certain a part of source data in monitoring the source table, The corresponding source unique index of this part source data is added in middle table corresponding with the source table;
After the first synchronous condition meets, the source unique index in the middle table is true in the source table Source data to be synchronized is made, and correspondence object table is sent including at least the source data to be synchronized in object library The synchronization message of corresponding source unique index;
The source unique index is extracted from the synchronization message;
Corresponding target unique index is searched in the object table according to the source unique index, and according to looking into Result and the synchronization message is looked for synchronize operation.
10. a kind of source data sychronisation, it is characterised in that including trigger module, message module, first Sending module;
The trigger module is used to be monitored the source table of the source database, in the source table is monitored Certain a part of source data when there is the operation based on DML, by this corresponding source of part source data Unique index is added in middle table corresponding with the source table;
The source unique index that the message module is used in the middle table is determined in the source table and treated Synchronous source data, and generate synchronization message;The synchronization message is at least including the source of the source data to be synchronized Unique index;
First sending module is used to for the synchronization message to be sent to corresponding object table in object library.
11. source data sychronisations as claimed in claim 10, it is characterised in that also including judging mould Block, the second sending module;
The judge module was used for before the trigger module is monitored to the source table of the source database, Judge the data magnitude of the source table whether less than default order of magnitude threshold value;
Second sending module is used for when the judge module judges the data magnitude of the source table less than default The order of magnitude threshold value when, after the second synchronous condition is met, by the current institute active data correspondence of the source table Source unique index be sent to the object table.
12. a kind of target data sychronisations, it is characterised in that including receiver module, extraction module, together Step module;
The receiver module is used to receive the synchronization message of the source table in source database;The synchronization message Including the corresponding source unique index of source data occurred in the source table based on the operation of DML;
The extraction module is used to extract the source unique index from the synchronization message;
The synchronization module is used to that corresponding target to be searched in the object table only according to the source unique index One index, and operation is synchronized according to lookup result and the synchronization message.
13. target data sychronisations as claimed in claim 12, it is characterised in that the synchronous mould Block includes inquiry submodule, deletes submodule, inserts submodule, updates submodule;
The target that the inquiry submodule is used to inquire about in the corresponding object table of the source unique index is unique Index;
The deletion submodule is corresponding with the source unique index for existing in the object table is inquired Target unique index, and when only including the source unique index in the synchronization message, delete the object table In the target unique index and corresponding target data;
The renewal submodule is corresponding with the source unique index for existing in the object table is inquired Comprising the source unique index and corresponding source data to be synchronized in target unique index, and the synchronization message When, then update target data corresponding with target unique index in the object table with the source data to be synchronized;
The insertion submodule is corresponding with the source unique index for not existing in the object table is inquired Target unique index, and comprising the source unique index and corresponding source number to be synchronized in the synchronization message According to when, then the source unique index and corresponding source data to be synchronized are inserted in the object table.
14. a kind of database synchronous systems, it is characterised in that including source data sychronisation and target data Sychronisation;The source data sychronisation includes trigger module, message module, the first sending module;Institute Target data sychronisation is stated including receiver module, extraction module, synchronization module;
The trigger module is used to be monitored the source table of the source database, in the source table is monitored Certain a part of source data when there is the operation based on DML, by this corresponding source of part source data Unique index is added in middle table corresponding with the source table;
The source unique index that the message module is used in the middle table is determined in the source table and treated Synchronous source data, and generate synchronization message;The synchronization message is at least including the source of the source data to be synchronized Unique index;
First sending module is used to for the synchronization message to be sent to corresponding object table in object library;
The receiver module is used to receive the synchronization message from the source table;
The extraction module is used to extract the source unique index from the synchronization message;
The synchronization module is used to that corresponding target to be searched in the object table only according to the source unique index One index, and operation is synchronized according to lookup result.
CN201510750681.8A 2015-11-05 2015-11-05 Database synchronization method and system, source data and target data synchronization device Pending CN106682002A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510750681.8A CN106682002A (en) 2015-11-05 2015-11-05 Database synchronization method and system, source data and target data synchronization device
PCT/CN2016/104537 WO2017076321A1 (en) 2015-11-05 2016-11-04 Database synchronization method and system, source data and target data synchronization device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510750681.8A CN106682002A (en) 2015-11-05 2015-11-05 Database synchronization method and system, source data and target data synchronization device

Publications (1)

Publication Number Publication Date
CN106682002A true CN106682002A (en) 2017-05-17

Family

ID=58661739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510750681.8A Pending CN106682002A (en) 2015-11-05 2015-11-05 Database synchronization method and system, source data and target data synchronization device

Country Status (2)

Country Link
CN (1) CN106682002A (en)
WO (1) WO2017076321A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203642A (en) * 2017-06-19 2017-09-26 山东浪潮通软信息科技有限公司 A kind of method of data synchronization and device
CN107403012A (en) * 2017-08-01 2017-11-28 山东浪潮通软信息科技有限公司 A kind of method for interchanging data and device
CN107590207A (en) * 2017-08-24 2018-01-16 阿里巴巴集团控股有限公司 Method of data synchronization and device, electronic equipment
CN107885804A (en) * 2017-11-02 2018-04-06 平安科技(深圳)有限公司 Database synchronization method, application server and computer-readable recording medium
CN108804561A (en) * 2018-05-22 2018-11-13 北京科东电力控制系统有限责任公司 Method of data synchronization and device
CN109189864A (en) * 2018-08-09 2019-01-11 联动优势电子商务有限公司 A kind of the determination method, apparatus and equipment of data synchronizing relay
CN109271351A (en) * 2018-11-12 2019-01-25 珠海格力电器股份有限公司 A kind of database synchronization method and system
CN109388644A (en) * 2017-08-09 2019-02-26 北京国双科技有限公司 A kind of data-updating method and device
CN109684407A (en) * 2018-11-23 2019-04-26 武汉达梦数据库有限公司 A kind of method of data synchronization of DML operation
CN109857809A (en) * 2019-01-31 2019-06-07 浙江小泰科技有限公司 A kind of raw data base data are synchronized to the synchronous method and system of target database
CN110162569A (en) * 2019-04-15 2019-08-23 平安普惠企业管理有限公司 Data processing method, device and computer equipment based on GG synchronized process
CN111324624A (en) * 2018-12-17 2020-06-23 中兴通讯股份有限公司 Method, equipment and storage medium for compatibility of merge into function of database component
CN112463786A (en) * 2020-12-10 2021-03-09 上海携宁计算机科技股份有限公司 Data synchronization method, system, server and storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959545A (en) * 2018-07-02 2018-12-07 山东汇贸电子口岸有限公司 A kind of Oracle data processing method
CN112988804A (en) * 2019-12-12 2021-06-18 陕西西部资信股份有限公司 Data transmission method and system
CN112000649B (en) * 2020-07-07 2023-06-27 武汉达梦数据库股份有限公司 Method and device for synchronizing incremental data based on map reduce
CN112182104A (en) * 2020-09-25 2021-01-05 中国建设银行股份有限公司 Data synchronization method, device, equipment and storage medium
CN113495890A (en) * 2021-07-08 2021-10-12 上海二三四五网络科技有限公司 Automatic comparison system, method and equipment for batch heterogeneous data sources
CN113538107A (en) * 2021-07-27 2021-10-22 畅销家(深圳)科技有限公司 Order information synchronization method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794724A (en) * 2005-10-27 2006-06-28 华为技术有限公司 Method of realizing data synchronization on SyncML layer
CN101662760A (en) * 2009-07-31 2010-03-03 中兴通讯股份有限公司 Method and system for backing up terminal data
CN101923566A (en) * 2010-06-24 2010-12-22 浙江协同数据系统有限公司 Data increment extraction method based on trigger
CN103455557A (en) * 2013-08-08 2013-12-18 上海新炬网络技术有限公司 Log based structured data synchronization method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8019863B2 (en) * 2008-03-28 2011-09-13 Ianywhere Solutions, Inc. Synchronizing events between mobile devices and servers
CN102982171A (en) * 2012-12-17 2013-03-20 山东神思电子技术股份有限公司 Database synchronization method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794724A (en) * 2005-10-27 2006-06-28 华为技术有限公司 Method of realizing data synchronization on SyncML layer
CN101662760A (en) * 2009-07-31 2010-03-03 中兴通讯股份有限公司 Method and system for backing up terminal data
CN101923566A (en) * 2010-06-24 2010-12-22 浙江协同数据系统有限公司 Data increment extraction method based on trigger
CN103455557A (en) * 2013-08-08 2013-12-18 上海新炬网络技术有限公司 Log based structured data synchronization method

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203642A (en) * 2017-06-19 2017-09-26 山东浪潮通软信息科技有限公司 A kind of method of data synchronization and device
CN107403012A (en) * 2017-08-01 2017-11-28 山东浪潮通软信息科技有限公司 A kind of method for interchanging data and device
CN109388644A (en) * 2017-08-09 2019-02-26 北京国双科技有限公司 A kind of data-updating method and device
CN109388644B (en) * 2017-08-09 2021-10-15 北京国双科技有限公司 Data updating method and device
CN107590207A (en) * 2017-08-24 2018-01-16 阿里巴巴集团控股有限公司 Method of data synchronization and device, electronic equipment
CN107885804A (en) * 2017-11-02 2018-04-06 平安科技(深圳)有限公司 Database synchronization method, application server and computer-readable recording medium
WO2019085471A1 (en) * 2017-11-02 2019-05-09 平安科技(深圳)有限公司 Database synchronization method, application server, and computer readable storage medium
CN108804561A (en) * 2018-05-22 2018-11-13 北京科东电力控制系统有限责任公司 Method of data synchronization and device
CN108804561B (en) * 2018-05-22 2021-10-15 北京科东电力控制系统有限责任公司 Data synchronization method and device
CN109189864B (en) * 2018-08-09 2021-03-16 联动优势电子商务有限公司 Method, device and equipment for determining data synchronization delay
CN109189864A (en) * 2018-08-09 2019-01-11 联动优势电子商务有限公司 A kind of the determination method, apparatus and equipment of data synchronizing relay
CN109271351A (en) * 2018-11-12 2019-01-25 珠海格力电器股份有限公司 A kind of database synchronization method and system
CN109684407A (en) * 2018-11-23 2019-04-26 武汉达梦数据库有限公司 A kind of method of data synchronization of DML operation
WO2020125537A1 (en) * 2018-12-17 2020-06-25 中兴通讯股份有限公司 Database component merge into function compatibility method, device and storage medium
CN111324624A (en) * 2018-12-17 2020-06-23 中兴通讯股份有限公司 Method, equipment and storage medium for compatibility of merge into function of database component
CN109857809A (en) * 2019-01-31 2019-06-07 浙江小泰科技有限公司 A kind of raw data base data are synchronized to the synchronous method and system of target database
CN110162569A (en) * 2019-04-15 2019-08-23 平安普惠企业管理有限公司 Data processing method, device and computer equipment based on GG synchronized process
CN112463786A (en) * 2020-12-10 2021-03-09 上海携宁计算机科技股份有限公司 Data synchronization method, system, server and storage medium
CN112463786B (en) * 2020-12-10 2021-08-13 上海携宁计算机科技股份有限公司 Data synchronization method, system, server and storage medium

Also Published As

Publication number Publication date
WO2017076321A1 (en) 2017-05-11

Similar Documents

Publication Publication Date Title
CN106682002A (en) Database synchronization method and system, source data and target data synchronization device
CN104301360B (en) A kind of method of logdata record, log server and system
CN103699580B (en) Database synchronization method and device
CN102393922B (en) Fuzzy Petri inference method of intelligent alarm expert system of transformer substation
CN1992632B (en) Communication network warning method and warning system
WO2003107127A3 (en) System and method for personalized information retrieval based on user expertise
CN104463508B (en) Synergistic method and device between a kind of multiple Workflow systems
CN103618733B (en) A kind of data filtering system and method for being applied to mobile Internet
CN108052551A (en) A kind of method for a large amount of time series datas of storage realized on REDIS
KR102038529B1 (en) System for processing real-time data modification of in-memory database
CN110213207A (en) A kind of network security defence method and equipment based on log analysis
CN106055723A (en) Database data synchronization device, system and method
CN110471938A (en) A method of Stream Processing and real-time retrieval towards magnanimity track data
CN106934057A (en) A kind of data cached update method of paging and device
CN104301990B (en) A kind of method and device of data syn-chronization
CN108880980A (en) Data analysis system based on Wechat group information
CN109033192A (en) A kind of video monitoring intelligent data acquisition processing method
CN103701653B (en) The processing method of a kind of interface hot plug configuration data and network configuration server
CN106203916A (en) A kind of distributed pickup code generating method
CN105721256B (en) A kind of Audit data De-weight method of distributed deployment audit platform
CN107506408A (en) To the method and system of magnanimity event distribution formula association matching
US20110196856A1 (en) Processing a data stream
CN110515895B (en) Method and system for carrying out associated storage on data files in big data storage system
CN109635584A (en) A kind of data link privacy calculation method based on block chain
CN106484694A (en) Full-text search method based on distributed data base and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170517

RJ01 Rejection of invention patent application after publication