# US 11,907,076 B2 · Data snapshot method and apparatus, computer device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,907,076 B2
- Document ID: US11907076B2
- Status: Granted
- Kind: B2
- Application number: 18/013,522
- Filed: 2021-02-24
- Published: 2023-11-30
- Granted: 2024-02-20
- Earliest claimed: 2020-07-21
- Assignees: Inspur Suzhou Intelligent Technology Co., Ltd.
- Applicants: Inspur Suzhou Intelligent Technology Co., Ltd.
- Inventors: Bin Hou
- Web page: https://patentgrep.com/patent/US11907076B2

## CPC

- G06F 11/1451: {by selection of backup contents}
- G06F 3/061: {Improving I/O performance}
- G06F 3/0619: {in relation to data integrity, e.g. data losses, bit errors}
- G06F 3/065: {Replication mechanisms}
- G06F 3/067: {Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]}
- G06F 11/1448: {Management of the data involved in backup or backup restore}
- G06F 11/1458: {Management of the backup or restore process}
- G06F 2201/84: Using snapshots, i.e. a logical point-in-time copy of the data
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure relates to a data snapshot method and apparatus, a computer device and a storage medium. The method includes: acquiring the capacity of to-be-written data after snapshot, and comparing the capacity of the to-be-written data with a preset capacity; when the capacity of the to-be-written data is greater than or equal to the preset capacity, writing the to-be-written data into a snapshot volume in a Redirect On Write manner; when the capacity of the to-be-written data is less than the preset capacity, writing the to-be-written data into a solid state drive in a Redirect On Write manner; and when a background write-back thread detects that there is data writing into the solid state drive, writing corresponding data in a source volume into the snapshot volume in a Copy On Write manner, and writing the to-be-written data in the solid state drive into the source volume.

## Claims

### Claim 1

A data snapshot method, the method comprising:
acquiring the capacity of to-be-written data after snapshot, and comparing the capacity of the to-be-written data with a preset capacity;
when the capacity of the to-be-written data is greater than or equal to the preset capacity, writing the to-be-written data into a snapshot volume in a Redirect On Write manner;
when the capacity of the to-be-written data is less than the preset capacity, writing the to-be-written data into a solid state drive in a Redirect On Write manner; and
when a background write-back thread detects that there is data writing into the solid state drive, writing corresponding data in a source volume into the snapshot volume in a Copy On Write manner, and writing the to-be-written data in the solid state drive into the source volume.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the method further comprises:
when the to-be-written data in the solid state drive has been written into the source volume, releasing data space written in the solid state drive.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the step of when the capacity of the to-be-written data is greater than or equal to the preset capacity, writing the to-be-written data into a snapshot volume in a Redirect On Write manner comprises:
acquiring the to-be-written data;
writing the to-be-written data into a snapshot volume; and
updating index information of newly written data in the snapshot volume.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the step of when the capacity of the to-be-written data is less than the preset capacity, writing the to-be-written data into a solid state drive in a Redirect On Write manner comprises:
acquiring the to-be-written data;
writing the to-be-written data into a solid state drive; and
updating index information of newly written data in the solid state drive.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the step of when a background write-back thread detects that there is data writing into the solid state drive, writing corresponding data in a source volume into the snapshot volume in a Copy On Write manner, and writing the to-be-written data in the solid state drive into the source volume comprises:
acquiring corresponding data of the to-be-written data in a source volume;
writing the corresponding data of the to-be-written data into the snapshot volume, and updating index information of the snapshot volume;
acquiring newly written data in the solid state drive; and
replacing the corresponding data of the to-be-written data in the source volume with the newly written data in the solid state drive, and updating index information of the source volume.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the preset capacity is 128 KB.

### Claim 7 (depends on 1)

The method according to claims 1, wherein the source volume and the snapshot volume are both Hard Disk Drives.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the to-be-written data refers to corresponding data that, after snapshot, when a snapshot software monitors and tracks changes in original data, a writing operation is performed on.

### Claim 9 (depends on 8)

The method according to claim 8, wherein the capacity of the to-be-written data is the size of data corresponding to the writing operation.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the snapshot volume refers to a snapshot data storage space, and the source volume refers to an original data storage space.

### Claim 11 (depends on 3)

The method according to claim 3, wherein when the to-be-written data is written into a snapshot volume, data to be modified in the source volume keeps unchanged.

### Claim 12 (depends on 5)

The method according to claim 5, wherein the step of replacing the corresponding data of the to-be-written data in the source volume with the newly written data in the solid state drive comprises:
copying the newly written data in the solid state drive to location of the to-be-written data in the source volume to cover the to-be-written data.

### Claim 13 (depends on 5)

The system according to claim 5, wherein after updating index information of the source volume, the method further comprises:
storing the index information of the source volume.

### Claim 14

A computer device, comprising:
at least one processor; and
a memory, wherein the memory stores a computer program which can be run on the at least one processor, and the computer program, when being executed by the at least one processor, causes the at least one processor to:
acquiring the capacity of to-be-written data after snapshot, and comparing the capacity of the to-be-written data with a preset capacity;
under the condition that the capacity of the to-be-written data is greater than or equal to the preset capacity, writing the to-be-written data into a snapshot volume in a Redirect On Write manner;
under the condition that the capacity of the to-be-written data is less than the preset capacity, writing the to-be-written data into a solid state drive in a Redirect On Write manner; and
under the condition that a background write-back thread detects that there is data writing into the solid state drive, writing corresponding data in a source volume into the snapshot volume in a Copy On Write manner, and writing the to-be-written data in the solid state drive into the source volume.

### Claim 15 (depends on 14)

The computer device according to claim 14, wherein the computer program, when being executed by the at least one processor, causes the at least one processor to:
under the condition that the to-be-written data in the solid state drive has been written into the source volume, releasing data space written in the solid state drive.

### Claim 16 (depends on 14)

The computer device according to claim 14, wherein the computer program, when being executed by the at least one processor, causes the at least one processor to:
acquiring the to-be-written data;
writing the to-be-written data into a snapshot volume; and
updating index information of newly written data in the snapshot volume.

### Claim 17 (depends on 14)

The computer device according to claim 14, wherein the computer program, when being executed by the at least one processor, causes the at least one processor to:
acquiring the to-be-written data;
writing the to-be-written data into a solid state drive; and
updating index information of newly written data in the solid state drive.

### Claim 18 (depends on 14)

The computer device according to claim 14, wherein the computer program, when being executed by the at least one processor, causes the at least one processor to:
acquiring corresponding data of the to-be-written data in a source volume;
writing the corresponding data of the to-be-written data into the snapshot volume, and updating index information of the snapshot volume;
acquiring newly written data in the solid state drive; and
replacing the corresponding data of the to-be-written data in the source volume with the newly written data in the solid state drive, and updating index information of the source volume.

### Claim 19 (depends on 18)

The computer device according to claim 18, wherein the computer program, when being executed by the at least one processor, causes the at least one processor to:
copying the newly written data in the solid state drive to location of the to-be-written data in the source volume to cover the to-be-written data.

### Claim 20

A non-transitory computer-readable storage medium, wherein a computer program stored on the computer-readable storage medium, and when the computer program is executed by at least one processor, the computer program following operations are implemented:
acquiring the capacity of to-be-written data after snapshot, and comparing the capacity of the to-be-written data with a preset capacity;
under the condition that the capacity of the to-be-written data is greater than or equal to the preset capacity, writing the to-be-written data into a snapshot volume in a Redirect On Write manner;
under the condition that the capacity of the to-be-written data is less than the preset capacity, writing the to-be-written data into a solid state drive in a Redirect On Write manner; and
under the condition that a background write-back thread detects that there is data writing into the solid state drive, writing corresponding data in a source volume into the snapshot volume in a Copy On Write manner, and writing the to-be-written data in the solid state drive into the source volume.
