IP Library Granted Patent US 8,370,591
Granted Patent B2
US 8,370,591 · App. 12/540,962 · Granted Feb 5, 2013

Method and apparatus for automatic snapshot

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 8,370,591
App. No.
12/540,962
Granted
Feb 5, 2013
Kind
B2
Abstract

A method for automatic snapshot includes obtaining the amount of data written into a source Logical Unit Number (LUN) and performing increment accumulation; and taking a snapshot when a value of the increment accumulation exceeds the upper limit value. An apparatus for automatic snapshot is disclosed. In one embodiment of the invention, snapshots are taken according to the size of a data variable, only two characterizing parameters, an upper limit value and an increment value need to be added, and the determination logic is clear and concise. Thus, system efficiency or resource overload is not affected, the pertinence is strengthened, the resource usage is increased, and the adaptability is strengthened. Furthermore, stored data may be automatically protected with snapshot, and data safety and reliability are greatly improved.

Claims (56)

1. A method for automatic snapshot, comprising:

resetting an increment accumulation variable which indicates a total amount of data written to a source Logical Unit Number (LUN), to zero;

after resetting the increment accumulation variable to zero, determining whether there is an operation of writing to the source LUN;

obtaining an amount of data which is written to the source LUN in the operation if the operation of writing to the source LUN is determined, wherein the amount of the data is a value indicating the number of bytes of the data which is written to the source LUN in the operation;

accumulating the number of bytes of the data which is written to the source LUN in the operation for the increment accumulation variable;

obtaining the total amount of data written to the source LUN;

determining whether the total amount of data written to the source LUN exceeds a preset upper limit value;

taking a snapshot upon determining that the total amount of data written to the source LUN exceeds the preset upper limit value, and reset the increment accumulation variable to zero again; and

determining whether there is another operation of writing to the source LUN on determining that the total amount of data written to the source LUN does not exceed the preset upper limit value.

2. The method for automatic snapshot according to claim 1 , further comprising:

presetting the upper limit value of data written to the source LUN.

3. The method for automatic snapshot according to claim 1 , before obtaining the amount of data which is written to the source LUN in the operation, further comprising:

generating a mapping table for storing locations where actual snapshot data is stored, wherein a pointer of the mapping table points to the source LUN.

4. The method for automatic snapshot according to claim 3 , wherein taking the snapshot comprises:

copying all data blocks involved in the writing operation to the source LUN to a resource LUN;

modifying the pointer involved in the writing operation to the source LUN to point to first addresses of corresponding data blocks stored in the resource LUN; and

writing all the data involved in the writing operation to the source LUN into locations corresponding to the source LUN.

5. The method for automatic snapshot according to claim 4 , after taking the snapshot, further comprising:

reading data from the source LUN and the resource LUN according to pointer information in the mapping table when the snapshot is read.

6. An apparatus for automatic snapshot, comprising a processor coupled to a memory and configured to:

preset an upper limit value of data written to a source Logical Unit Number (LUN);

reset an increment accumulation variable which indicates a total amount of data written to the source LUN, to zero;

after resetting the increment accumulation variable to zero, determine whether there is an operation of writing to the source LUN;

obtain an amount of data which is written to the source LUN if the operation of writing to the source LUN is determined, wherein the amount of the data is a value indicating the number of bytes of the data which is written to the source LUN in the operation;

accumulate the number of bytes of the data which is written to the source LUN in the operation for the increment accumulation variable;

obtain the total amount of data written to the source LUN;

determine whether the total amount of data exceeds the preset upper limit value;

take a snapshot upon determining that the total amount of data written to the source LUN exceeds the preset upper limit value, and reset the increment accumulation variable to zero again; and

determine whether there is another operation of writing to the source LUN on determining that the total amount of data written to the source LUN does not exceed the preset upper limit value.

7. The apparatus for automatic snapshot according to claim 6 , wherein the processor is further configured to:

generate a mapping table for storing locations where actual snapshot data is stored, wherein a pointer of the mapping table points to the source LUN.

8. The apparatus for automatic snapshot according to claim 7 , wherein the processor is configured to:

copy all data blocks involved in the writing operation to the source LUN to a resource LUN;

modify the pointer involved in the writing operation to the source LUN to point to first addresses of corresponding data blocks stored in the resource LUN; and

write all the data involved in the writing operation to the source LUN into locations corresponding to the source LUN.

9. The apparatus for automatic snapshot according to claim 8 , wherein the processor is configured to:

read data from the source LUN and the resource LUN according to pointer information in the mapping table when the snapshot is read.

10. A non-transitory computer-readable storage medium comprising instructions that, when executed, cause a processor to implement:

resetting an increment accumulation variable which indicates a total amount of data written to a source Logical Unit Number (LUN), to zero;

after resetting the increment accumulation variable to zero, determining whether there is an operation of writing to the source LUN;

obtaining an amount of data which is written to the source LUN in the operation if the operation of writing to the source LUN is determined, wherein the amount of the data is a value indicating the number of bytes of the data which is written to the source LUN in the operation;

accumulating the number of bytes of the data which is written to the source LUN in the operation for the increment accumulation variable;

obtaining the total amount of data written to the source LUN;

determining whether the total amount of data written to the source LUN exceeds a preset upper limit value;

taking a snapshot upon determining that the total amount of data written to the source LUN exceeds the preset upper limit value, and reset the increment accumulation variable to zero again; and

determining whether there is another operation of writing to the source LUN on determining that the total amount of data written to the source LUN does not exceed the preset upper limit value.

11. The non-transitory computer-readable storage medium according to claim 10 , further comprising instructions that, when executed, cause the processor to implement:

presetting the upper limit value of data written to the source LUN.

12. The non-transitory computer-readable storage medium according to claim 10 , further comprising instructions that, when executed, cause the processor to implement:

generating a mapping table for storing locations where actual snapshot data is stored, wherein a pointer of the mapping table points to the source LUN.

13. The non-transitory computer-readable storage medium according to claim 12 , wherein taking the snapshot comprises:

copying all data blocks involved in the writing operation to the source LUN to a resource LUN;

modifying the pointer involved in the writing operation to the source LUN to point to first addresses of corresponding data blocks stored in the resource LUN; and

writing all the data involved in the writing operation to the source LUN into locations corresponding to the source LUN.

14. The non-transitory computer-readable storage medium according to claim 13 , further comprising instructions that, when executed, cause the processor to implement:

reading data from the source LUN and the resource LUN according to pointer information in the mapping table when the snapshot is read.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 26, 2022
From: HUAWEI TECHNOLOGIES CO., LTD.
To: CHENGDU HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 060917/0931 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 16, 2015
From: HUAWEI DIGITAL TECHNOLOGIES (CHENG DU) CO., LIMITED.
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 035847/0289 →
CHANGE OF NAME Recorded Dec 8, 2014
From: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES CO., LIMITED
To: HUAWEI DIGITAL TECHNOLOGIES (CHENG DU) CO. LIMITED.
Reel/Frame 034537/0210 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 14, 2009
From: TAN, ZUJING; ZHANG, PENG; GENG, WEIHUA; ZHANG, GUOBIAN
To: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES CO., LTD.
Reel/Frame 023101/0670 →