Patent ID: 8655836

Claim:
A method for implementing data synchronization between a source database and a target database, comprising: acquiring, by the synchronization device comprising one or more processors, at least one first Logical Change Record (LCR) and a keyword of the first LCR from a source database; determining, by the synchronization device, whether there is a second LCR with a keyword as same as the keyword of the first LCR in the synchronization device itself, and generating, by the synchronization device, a determination result; processing, by the synchronization device, the first LCR to generate a processed LCR according to the determination result, so that the synchronization device stores only one LCR containing the keyword of the first LCR; sending, by the synchronization device, the processed LCR to a target database; wherein the step of processing, by the synchronization device, the first LCR to generate a processed LCR according to the determination result comprises: when the determination result is YES, merging, by the synchronization device, the first LCR and the second LCR to generate the processed LCR, according to an operation type of the first LCR and an operation type of the second LCR; when the determination result is NO, storing, by the synchronization device, the first LCR into the synchronization device as the processed LCR; wherein the step of merging, by the synchronization device, the first LCR and the second LCR to generate the processed LCR comprises: when the operation type of the first LCR is INSERT and the operation type of the second LCR is INSERT or UPDATE, taking, by the synchronization device, the second LCR as the processed LCR; when the operation type of the first LCR is INSERT and the operation type of the second LCR is DELETE, changing, by the synchronization device, the operation type of the second LCR to UPDATE, and covering, by the synchronization device, a corresponding field value of the second LCR with each field value of the first LCR, to generate the processed LCR; when the operation type of the first LCR is UPDATE and the operation type of the second LCR is INSERT or UPDATE, covering, by the synchronization device, a corresponding field value of the second LCR with each field value of the first LCR, to generate the processed LCR; when the operation type of the first LCR is UPDATE or DELETE and the operation type of the second LCR is DELETE, taking, by the synchronization device, the second LCR as the processed LCR; when the operation type of the first LCR is DELETE and the operation type of the second LCR is INSERT, taking, by the synchronization device, the first LCR as the processed LCR; and when the operation type of the first LCR is DELETE and the operation type of the second LCR is UPDATE, changing the type of the second LCR to DELETE and taking the second LCR as the processed LCR by the synchronization device.