IP Library Granted Patent US 10,331,699
Granted Patent B2
US 10,331,699 · App. 14/994,596 · Granted Jun 25, 2019

Data backup method and apparatus

Inventors: Yunliang Shi (Hangzhou, CN); Huabing Du (Hangzhou, CN)
Assignee: Alibaba Group Holding Limited
G06F16/273G06F16/2358
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,331,699
App. No.
14/994,596
Granted
Jun 25, 2019
Kind
B2
Abstract

A method and an apparatus for data backup are disclosed. The method includes querying a slave for check information, where the check information is data inserted into a master when data written to the master is copied into the slave in a form of a log; obtaining a time at which the check information is inserted into the master and setting the time as a backup completion time point; and deleting data record(s) that is/are earlier than the backup completion time point from mirrored data, the mirrored data being data that is synchronously written to a defined storage space when the data is written to the master. The method for data backup is easy to implement at a low cost, and provides highly secure data backup.

Claims (53)

1. A method implemented by one or more computing devices, the method comprising:

querying a slave for check information, the check information comprising information that is inserted into a master and is copied into the slave when first data written to the master is copied into the slave in a form of a log;

obtaining a time at which the check information is inserted into the master and using the time as a backup completion time point; and

deleting one or more data records that are earlier than the backup completion time point from mirrored data, the mirrored data being second data that is synchronously written to a storage space when the second data is written to the master.

2. The method of claim 1 , further comprising inserting the check information into the master, the inserting comprising:

periodically detecting whether any piece of data is written to the master in a preset period of time;

in response to detecting that a piece of data is written to the master in the preset period of time, detecting whether the check information exists in the master; and

in response to detecting that the check information exists in the master, inserting the check information into the master by replacing stored check information in the master.

3. The method of claim 1 , further comprising:

recording the first data written to the master and the check information into a binary log;

replicating at least one data event recorded in the binary log to a relay log; and

executing one or more data events recorded in the relay log, and updating the slave using respective data and check information recorded in the relay log.

4. The method of claim 3 , wherein obtaining the time at which the check information is inserted into the master comprises reading the time at which the check information is inserted into the master from a data event recorded in the relay log.

5. The method of claim 1 , wherein deleting the one or more data records comprises:

obtaining a time at which the mirrored data is written to the storage space;

comparing the time at which the mirrored data is written to the storage space with the backup completion time point to obtain the one or more data records in the mirrored data that are earlier than the backup completion time point; and

deleting the one or more data records that are earlier than the backup completion time point from the mirrored data.

6. The method of claim 1 , wherein obtaining the time at which the check information is inserted into the master comprises reading the time at which the check information is inserted into the master from the check information.

7. The method of claim 1 , further comprising synchronously writing the second data to the storage space when the second data is written to the master, the synchronously writing comprising one or more of:

synchronously writing the second data to the storage space via a local storage; or

synchronously writing the second data to the storage space via a remote storage.

8. The method of claim 7 , wherein the storage space comprises internal memory and/or a magnetic disk.

9. One or more computer-readable media storing executable instructions that, when executed by one or more processors, cause the one or more processors to perform acts comprising:

querying a slave for check information, the check information comprising information is inserted into a master and is copied into the slave when data written to the master is copied into the slave in a form of a log;

obtaining a time at which the check information is inserted into the master and using the time as a backup completion time point; and

detecting whether any data is written to the master later than the backup completion time point.

10. The one or more computer-readable media of claim 9 , the acts further comprising treating a piece of data as differential data between the master and the slave in response to determining that the piece of data is written to the master later than the backup completion time point.

11. The one or more computer-readable media of claim 9 , the acts further comprising indicating that no differential data exists between the master and the slave in response to determining that no data is written to the master later than the backup completion time point.

12. The one or more computer-readable media of claim 9 , wherein detecting whether any data is written to the master later than the backup completion time point is performed on a periodic basis.

13. The one or more computer-readable media of claim 9 , the acts further comprising deleting one or more data records that are earlier than the backup completion time point from mirrored data, the mirrored data being the data that is synchronously written to a storage space when the data is written to the master.

14. The one or more computer-readable media of claim 9 , wherein obtaining the time at which the check information is inserted into the master comprises reading the time at which the check information is inserted into the master from the check information.

15. The one or more computer-readable media of claim 9 , the acts further comprising:

recording the data written to the master and the check information into a binary log;

replicating at least one data event recorded in the binary log to a relay log; and

executing one or more data events recorded in the relay log, and updating the slave using respective data and check information recorded in the relay log.

16. The one or more computer-readable media of claim 15 , wherein obtaining the time at which the check information is inserted into the master comprises reading the time at which the check information is inserted into the master from a data event recorded in the relay log.

17. An apparatus comprising:

one or more processors;

memory;

a check information query unit stored in the memory and executable by the one or more processors to query a slave for check information, the check information comprising information that is inserted into a master and is copied into the slave when first data written to the master is copied into the slave in a form of a log;

a backup completion time point acquisition unit stored in the memory and executable by the one or more processors to obtain a time at which the check information is inserted into the master, and set the time as a backup completion time point; and

a data record deletion unit stored in the memory and executable by the one or more processors to delete one or more data records in mirrored data that are earlier than the backup completion time point, the mirrored data being second data that is synchronously written to a storage space when the second data is written to the master.

18. The apparatus of claim 17 , further comprising:

a data writing detection unit configured to periodically detect whether any piece of data is written to the master in a preset period of time; and

a check information detection unit configured to detect whether the check information exists in the master after the data writing detection unit detects that a piece of data is written to the master in the preset period of time, and upon detecting that the check information exists in the master, insert the check information into the master by replacing stored check information in the master.

19. The apparatus of claim 17 , further comprising:

a data write unit configured to record the first data written to the master and the check information into a binary log;

a data replication unit configured to replicate at least one data event recorded in the binary log to a relay log; and

a data update unit configured to execute one or more data events recorded in the relay log, and update the slave using respective data and check information recorded in the relay log.

20. The apparatus of claim 17 , wherein the data record deletion unit comprises:

a data writing time acquisition subunit configured to obtain a time at which the mirrored data is written to the storage space;

a data comparison subunit configured to compare the time at which the mirrored data is written to the storage space with the backup completion time point to obtain the one or more data records that are earlier than the backup completion time point in the mirrored data; and

a data deletion subunit configured to delete the one or more data records that are earlier than the backup completion time point from the mirrored data.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 054064/0610 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053650/0816 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 10, 2016
From: SHI, YUNLIANG; DU, HUABING
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 038061/0104 →
Priority Claims (1)
CN 2015 1 0019142 · Jan 14, 2015 · national
Continuity (1)
Related Publication 20160203201A1 · Jul 14, 2016