Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A table-level bidirectional synchronization realization method and system based on trigger

A two-way synchronization and realization method technology, applied in the direction of structured data retrieval, database distribution/replication, etc., can solve data modification conflicts, cycle synchronization conflicts, synchronization failures and other problems, and achieve the effect of solving data conflicts

Inactive Publication Date: 2019-01-25
WUHAN DAMENG DATABASE
View PDF6 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] The first is the problem of cyclic synchronization conflicts. The data changes triggered by the synchronization system cannot be distinguished from the data changes triggered by ordinary users. The data synchronized from base table A to base table B will be re-synchronized to base table A as changed data. , the data synchronized from base table B to base table A will be re-synchronized to base table B as changed data, resulting in an endless loop of data synchronization; when there are three or more base tables, if every two base tables Two-way synchronization of data is required between tables, and an infinite loop of data synchronization will be formed between every two base tables, which will have a wider impact
The second is the problem of data modification conflicts, that is, base table A and base table B modify the same field of the record with the same primary key at the same time. At this time, if the two-way synchronization from base table A to base table B and from base table B to base table A is executed at the same time , the records of the modified base table A and base table B only exchange positions, and the data on both sides are not consistent
The third is the problem of data insertion conflicts, that is, base table A and base table B insert data with the same primary key. At this time, the two-way synchronization database will report a violation of unique constraint error, resulting in synchronization failure.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A table-level bidirectional synchronization realization method and system based on trigger
  • A table-level bidirectional synchronization realization method and system based on trigger
  • A table-level bidirectional synchronization realization method and system based on trigger

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0056] The present invention provides a trigger-based table-level two-way synchronization implementation method. Here, the base table A and the base table B are still used to represent the two base tables participating in the two-way synchronization, which are used to store source data A and source data B respectively. Such as figure 1 As shown, the method specifically includes the following steps:

[0057] Step 1, capturing source data changes in the current base table; wherein, the source data changes are triggered by a synchronization system and / or a common user. In the embodiment of the present invention, triggers are still used to capture source data changes: trigger A is used to capture source data changes in base table A, and trigger B is used to capture source data changes in base table B. For the source data A in the base table A, the data change may be from the operation of ordinary users, such as the data modification of the source data A by the above-mentioned use...

Embodiment 2

[0067] In one synchronization operation, two one-way synchronization processes need to be performed sequentially to complete two-way data synchronization. The execution processes of the two one-way synchronizations are the same. Based on the above-mentioned embodiment 1, the embodiment of the present invention uses the The one-way data synchronization from the base table A to the base table B is taken as an example, and the execution of the step 32 is introduced in detail.

[0068]At the same time, when source data changes occur in both the base table A and the base table B, there may be conflicts of changed data in the two base tables, and the conflicts of changed data include data modification conflicts and data insertion conflicts. Wherein, the data modification conflict is specifically: the same field of the record with the same primary key is modified in the base table A and the base table B at the same time, if the base table A to the base table B and the base table B to ...

Embodiment 3

[0077] The two-way synchronization of table-level data is mainly divided into an initialization process and a data synchronization process. The initialization process only needs to be performed once, while the data synchronization is performed periodically. The foregoing embodiment 1 and embodiment 2 have introduced the data synchronization process, on this basis, the embodiment of the present invention specifically introduces the initialization process before the data synchronization.

[0078] During two-way synchronization, both databases participating in two-way synchronization need to be initialized, and the steps and methods are the same. For each database, refer to Figure 4 , the initialization process specifically includes the following steps:

[0079] Step 01, create a dedicated user for the synchronization system on the database, and grant corresponding permissions; wherein, the dedicated user corresponds to a dedicated user ID.

[0080] For ordinary users, such as ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to the technical field of data synchronization, in particular to a table-level bidirectional synchronization realization method and system based on a trigger. The method comprises the following steps: source data changes in a current base table are captured; the source data changes are triggered by a synchronization system and / or a common user; source data changes triggered by a dedicated user are filtered out the source data changes triggered by a non-dedicated user is written into a corresponding CDC table; The synchronization system reads records in the CDC table and synchronizes another base table participating in bidirectional synchronization according to the recorded data. The table-level bidirectional synchronization is realized, a special user is created for the synchronization system, corresponding to the special user ID, which is different from the ordinary user, so that the trigger can filter the record according to the user of the current triggering operation, thereby preventing the data change triggered by the synchronization system from being written into the CDC table, thus solving the problem of the cycle triggering of the bidirectional synchronization.

Description

【Technical field】 [0001] The invention relates to the technical field of data synchronization, in particular to a trigger-based table-level bidirectional synchronization implementation method and system. 【Background technique】 [0002] With the deepening of data exchange and data sharing applications, users are no longer satisfied with one-way data integration or synchronization, and the flow of data between different departments or between upper and lower levels is increasingly showing two-way characteristics. For example, in data center applications, it is generally necessary to synchronize data from various departments to the central library. However, with the development of departmental applications, a department may also need to obtain data from other departments from the center while providing data to the center. Departmental applications and analytics, which lead to the need for bi-directional synchronization. [0003] Table-level two-way data synchronization is gene...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/27
Inventor 梅纲付铨陈丽
Owner WUHAN DAMENG DATABASE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products