US2014324773A1PendingUtilityA1

Data synchronization method and system and data access apparatus

Assignee: HUAWEI TECH CO LTDPriority: Mar 9, 2012Filed: Jul 9, 2014Published: Oct 30, 2014
Est. expiryMar 9, 2032(~5.5 yrs left)· nominal 20-yr term from priority
Inventors:Fuhai Ding
G06F 16/275G06F 17/30174G06F 16/27G06F 16/178G06F 16/273
48
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

The present invention relates to data synchronization and discloses a method and a system for data synchronization and a relevant device. The method includes: in a process of database-level synchronization between a first database and a second database, sending a request for creating a transaction to the first database; when the first database executes the transaction, acquiring a sequence number from the first database, and sending the operation command required for executing the transaction and the sequence number corresponding to the transaction to a temporary storage queue for storage; acquiring a switching sequence number from the second database when a database-level synchronization link between the first database and the second database is disconnected; determining a sequence number that is stored in the temporary storage queue and follows the switching sequence number, and sending the operation command required to the second database.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
         1 . A method for data synchronization, comprising:
 in a process of database-level synchronization between a first database and a second database, sending, by a data access apparatus, to the first database, a request for creating a transaction, wherein the request comprises an operation command required for executing the transaction;   when the first database executes the transaction, acquiring, by the data access apparatus, a sequence number from the first database, and sending the operation command required for executing the transaction and the sequence number corresponding to the transaction to a temporary storage queue for storage, wherein the sequence number is assigned by the first database to the transaction;   acquiring, by the data access apparatus, a switching sequence number from the second database when a database-level synchronization link between the first database and the second database is disconnected, wherein the switching sequence number is a sequence number corresponding to a last transaction synchronized from the first database; and   determining, by the data access apparatus, a sequence number that is stored in the temporary storage queue and follows the switching sequence number, and sending an operation command required for executing a transaction corresponding to the determined sequence number to the second database, so as to implement application-level data synchronization.   
     
     
         2 . The method according to  claim 1 , wherein the method further comprises: establishing an application-level synchronization link between the data access apparatus and the temporary storage queue, the first database, and the second database; and
 the acquiring, by the data access apparatus, a sequence number from the first database, and sending the operation command required for executing the transaction and the sequence number corresponding to the transaction to a temporary storage queue for storage specifically comprises:   through the application-level synchronization link, acquiring, by the data access apparatus, the sequence number from the first database, and sending the operation command required for executing the transaction and the sequence number corresponding to the transaction to the temporary storage queue for storage.   
     
     
         3 . The method according to  claim 1 , wherein the acquiring, by the data access apparatus, a switching sequence number from the second database when a database-level synchronization link between the first database and the second database is disconnected specifically comprises:
 when the database-level synchronization link between the first database and the second database is disconnected, acquiring, by the data access apparatus, the switching sequence number from the second database when detecting that the first database is writable.   
     
     
         4 . The method according to  claim 1 , wherein the implementing application-level data synchronization specially comprises:
 receiving, by the second database, the operation command required for executing the transaction corresponding to the sequence number following the switching sequence number, and executing, according to a sequence of the sequence number, the operation command required for executing the transaction corresponding to the sequence number following the switching sequence number one by one.   
     
     
         5 . The method according to  claim 1 , wherein the sending, by the data access apparatus, to the first database, the request for creating the transaction, wherein the request comprises the operation command required for executing the transaction, comprises:
 receiving, by the data access apparatus, a modification request sent by a third-party device, wherein the modification request comprises the operation command required for executing the transaction; and   sending, by the data access apparatus, the request for creating the transaction to the first database, wherein the request comprises the operation command required for executing the transaction.   
     
     
         6 . The method according to  claim 5 , wherein the acquiring, by the data access apparatus, the sequence number from the first database when the first database executes the transaction specifically comprises:
 when the first database executes the transaction, sending, by the data access apparatus, a request for querying a sequence number to the first database; and   receiving, by the data access apparatus, the sequence number that is corresponding to the transaction and sent by the first database.   
     
     
         7 . The method according to  claim 6 , wherein the sending, by the data access apparatus, the operation command required for executing the transaction and the sequence number corresponding to the transaction to the temporary storage queue for storage specifically comprises:
 receiving, by the data access apparatus, an operation result sent by the first database, wherein the operation result is an operation result obtained by the first database by executing the operation command;   submitting a request of the transaction to the first database to end the transaction; and   sending the operation command required for executing the transaction and the sequence number corresponding to the transaction to the temporary storage queue for storage.   
     
     
         8 . A data access apparatus, comprising:
 a first interacting module, configured to, in a process of database-level synchronization between a first database and a second database, send a request for creating a transaction to the first database, wherein the request comprises an operation command required for executing the transaction;   a storing module, configured to acquire a sequence number from the first database when the first database executes the transaction, and send the operation command required for executing the transaction and the sequence number corresponding to the transaction to a temporary storage queue for storage, wherein the sequence number is assigned by the first database to the transaction;   an acquiring module, configured to acquire a switching sequence number from the second database when a database-level synchronization link between the first database and the second database is disconnected, wherein the switching sequence number is a sequence number corresponding to a last transaction synchronized from the first database; and   a second interacting module, configured to determine a sequence number that is stored in the temporary storage queue and follows the switching sequence number, and send the operation command required for executing the transaction corresponding to the determined sequence number to the second database, so as to implement application-level data synchronization.   
     
     
         9 . The data access apparatus according to  claim 8 , wherein the acquiring module specifically comprises:
 a detecting unit, configured to, when the database-level synchronization link between the first database and the second database is disconnected, detect whether the first database is writable; and   an acquiring unit, configured to acquire the switching sequence number from the second database when the detecting unit detects that the first database is writable.   
     
     
         10 . The data access apparatus according to  claim 8 , wherein the first interacting module specifically comprises:
 a receiving unit, configured to receive a modification request sent by a third-party device, wherein the modification request comprises the operation command required for executing a transaction; and   a sending unit, configured to send the request for creating the transaction to the first database, wherein the request comprises the operation command required for executing the transaction.   
     
     
         11 . The data access apparatus according to  claim 8 , wherein the storing module specifically comprises: a querying unit, configured to, when the first database executes the transaction, send a request for querying a sequence number to the first database, and receive a sequence number that is corresponding to the transaction and sent by the first database;
 a submitting unit, configured to receive an operation result that is sent by the first database, wherein the operation result is an operation result obtained by the first database by executing the operation command, and submit a request of the transaction to the first database to end the transaction; and   a storing unit, configured to send the operation command required for executing the transaction and the sequence number corresponding to the transaction to the temporary storage queue for storage.   
     
     
         12 . A system for data synchronization, comprising:
 a first database, configured to, in a process of database-level synchronization between the first database and a second database, receive a request for creating a transaction from a data access apparatus, wherein the request comprises an operation command required for executing the transaction, execute the transaction, and assign a sequence number to the transaction;   the data access apparatus, configured to, in the process of database-level synchronization between the first database and the second database, send the request for creating the transaction to the first database; when the first database executes the transaction, acquire the sequence number from the first database, and send the operation command required for executing the transaction and the sequence number corresponding to the transaction to a temporary storage queue for storage; acquire a switching sequence number from the second database when a database-level synchronization link between the first database and the second database is disconnected, wherein the switching sequence number is a sequence number corresponding to a last transaction synchronized from the first database; determine a sequence number that is stored in the temporary storage queue and follows the switching sequence number, and send the operation command required for executing the transaction corresponding to the determined sequence number to the second database, so as to implement application-level data synchronization; and   the second database, configured to establish the database-level synchronization link with the first database, perform database-level data synchronization with the first database, and when the database-level synchronization link established with the first database is disconnected, receive the operation command required for executing the transaction corresponding to the determined sequence number from the data access apparatus, so as to implement the application-level data synchronization.   
     
     
         13 . The system according to  claim 12 , wherein the system further comprises: the temporary storage queue, configured to store the operation command required for executing the transaction and the sequence number corresponding to the transaction, which are sent by the data access apparatus.

Join the waitlist — get patent alerts

Track US2014324773A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.