IP Library Granted Patent US 9,483,194
Granted Patent B2
US 9,483,194 · App. 14/568,502 · Granted Nov 1, 2016

File processing method and apparatus, and storage device

Inventors: Han Kong (Chengdu, CN); Jing Wang (Chengdu, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06F3/0619G06F3/064G06F3/0625G06F3/0643G06F3/0689Y02B60/1246
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 9,483,194
App. No.
14/568,502
Granted
Nov 1, 2016
Kind
B2
Abstract

A file processing method and a storage device for storing a file in a redundant array of independent disks (RAID) are disclosed. In this method, the storage device divides received F files into multiple data blocks, and obtains a first matrix with T rows according to the multiple data blocks. Data blocks belonging to one file are located in one row of the first matrix. The storage device then writes a stripe, which consists of data blocks in each column in the first matrix and a check block that is obtained by computing according to the data blocks in the column, into the RAID. By using the file processing method, the storage device can write one file into one disk of the RAID while ensuring security of file storage, thereby achieving a better energy saving effect when the file is read.

Claims (57)

1. A file processing method performed by a storage device for storing a file in a redundant array of independent disks (RAID), comprising:

receiving F files that are to be stored in the RAID, wherein the RAID is formed by T disks, and T is no less than 3, F is no less than T−1;

dividing each of the F files into one or more data blocks;

obtaining a first matrix with T rows and multiple columns according to data blocks of the F files, wherein all data blocks of each of the F files are contained in one and only one row of the first matrix such that all the data blocks of said each file do not appear in different rows of the matrix, each column of the first matrix comprises a plurality data blocks and a check block computed from the data blocks in said each column, and no two data blocks of said each column belong to a same file; and

writing stripes into the T disks that form the RAID, wherein each of the stripes is based on a corresponding column of the first matrix and comprises the data blocks and check block in the corresponding column.

2. The file processing method according to claim 1 , wherein the RAID comprises an independent check disk, and the step of obtaining the first matrix comprises:

constructing a second matrix with D rows according to the data blocks of the F files, wherein all data blocks of each of F files are contained in one and only one row of the second matrix such that all the data blocks of the each file do not appear in different rows, and wherein the D is quantity number of data disks in the RAID;

determining, according to a position of the independent check disk in the RAID, a position for inserting a check block in the second matrix;

performing check computation on the data blocks in each column of the second matrix according to a check algorithm of the RAID, to obtain a check block of the data blocks in each column; and

obtaining the first matrix with T rows by inserting, into each column of the second matrix according to the determined position of the check block, the check block that is obtained by computing the data blocks in the column.

3. The file processing method according to claim 1 , wherein the RAID does not comprise an independent check disk, and the obtaining the first matrix comprises:

constructing a second matrix with D rows according to the data blocks of the F files, wherein all data blocks of each of F files are contained in one and only one row of the second matrix such that all the data blocks of the each file do not appear in different rows, and wherein the D is equal to T;

determining a position A[x, y] for inserting a check block in each column of the second matrix, wherein the second matrix has N columns, wherein x and y are both integers, wherein a value of x increases progressively from 0 to D−1, and wherein a value of y increases progressively from 0 to N−1;

obtaining the first matrix, wherein data blocks from the 0 th column to the (y−1) th column in the x th row of the first matrix respectively reference to data blocks from the 0 th column to the (y−1) th column in the x th row of the second matrix, and data blocks from the (y+1) th column to the N th column in the x th row of the first matrix respectively reference to data blocks from the y th column to the (N−1) th column in the x th row of the second matrix;

performing a check computation on the data blocks in a y th column of the first matrix according to a check algorithm of the RAID to obtain a check block of the data blocks in the y th column of the first matrix; and

inserting the check block of the data blocks in the y th column into the position A[x, y] in the y th column of the first matrix.

4. The file processing method according to claim 1 , wherein the writing stripes into the T disks that form the RAID comprises:

writing a stripe comprising the data blocks and check block in the y th column of the first matrix into the T disks that form the RAID when the stripe, which comprises the data blocks and the check block in the y th column of the first matrix is fully occupied, wherein the y th column is one of the columns in the first matrix.

5. The file processing method according to claim 1 , wherein the writing stripes into the T disks that form the RAID comprises:

filling a position without data blocks in the y th column with 0s when a stripe, which comprises the data blocks and the check block in the y th column of the first matrix is not fully occupied, and

the stripe, which comprises the data blocks and the check block in the y th column after filling with 0s, into disks that form the RAID, wherein the y th column is one of the columns in the first matrix.

6. A file processing method for storing a file in a redundant array of independent disks (RAID), comprising:

receiving F files that are to be stored in the RAID, F is no less than 2;

dividing each of the F files into one or more data blocks;

obtaining an array according to data blocks of the F files, wherein two data blocks that belong to one file are arranged in the array with D−1 data blocks of a different file therebetween, and a value of D is the quantity of data disks in the RAID, F is no less than D; and

writing stripes into disks that form the RAID, wherein each of the stripes comprises a sequence of D data blocks of the array and P check blocks which are obtained by computing the D data blocks, the sequence of D data blocks in each of the stripes respectively belong to different files of the F files, a value of P is the quantity of independent check disks in the RAID.

7. A storage device, comprising:

a redundant array of independent disks (RAID), configured to store a file, the RAID is formed by T disks, and T is no less than 3; and

a communication interface, configured to communicate with a host and the RAID; and

a processor, configured to:

receive F files that are to be stored in the RAID, F is no less than T−1;

divide each of the F files into one or more data blocks;

obtain a first matrix with T rows and multiple columns according to the data blocks of the F files, wherein all data blocks of each of the F files are contained in one and only one row of the first matrix such that all the data blocks of said each file do not appear in different rows of the first matrix, each column of the first matrix comprises multiple data blocks and a check block computed from the data blocks in said each column, and no two data blocks of said each column belong to a same file; and

write stripes into the T disks that form the RAID, wherein each of the stripes is formed based on a corresponding column of the first matrix and comprises the data blocks and check block of the corresponding column.

8. The storage device according to claim 7 , wherein when the RAID comprises an independent check disk, the operation of obtaining by the processor comprises:

constructing a second matrix with D rows according to the data blocks of the F files, wherein all data blocks of each of F files are contained in one and only one row of the second matrix such that all the data blocks of the each file do not appear in different rows, and wherein the D is the quantity of data disks in the RAID;

determining, according to a position of the independent check disk in the RAID, a position for inserting a check block in the second matrix;

performing check computation on the data blocks in each column of the second matrix according to a check algorithm of the RAID, to obtain a check block of the data blocks in each column; and

obtaining the first matrix with T rows by inserting, into each column of the second matrix according to the determined position of the check block, the check block that is obtained by computing the data blocks of the column.

9. The storage device according to claim 7 , wherein when the RAID does not comprise an independent check disk, the operation of obtaining by the processor comprises:

constructing a second matrix with D rows according to the data blocks of the F files, wherein all data blocks of each of F files are contained in one and only one row of the second matrix such that all the data blocks of the each file do not appear in different rows, and wherein the D is equal to T;

determining a position A[x, y] for inserting a check block in each column of the second matrix, wherein the second matrix has N columns, wherein x and y are both integers, wherein a value of x increases progressively from 0 to D−1, and wherein a value of y increases progressively from 0 to N−1;

obtaining the first matrix, wherein data blocks from the 0 th column to the (y−1) th column in the x th row of the first matrix respectively reference to data blocks from the 0 th column to the (y−1) th column in the x th row of the second matrix, and data blocks from the (y+1) th column to the N th column in the x th row of the first matrix respectively reference to data blocks from the y th column to the (N−1) th column in the x th row of the second matrix;

performing a check computation on the data blocks in a y th column of the first matrix according to a check algorithm of the RAID, to obtain a check block of the data blocks in the y th column of the first matrix; and

inserting the check block of the data blocks in the y th column into the position A[x, y] in the y th column of the first matrix.

10. The storage device according to claim 7 , wherein the operation of writing by the processor comprises:

writing a stripe comprising the data blocks and check block in the y th column of the first matrix into the T disks that form the RAID when the stripe, which comprises the data blocks and the check block in the y th column of the first matrix is fully occupied, wherein the y th column is one of the columns in the first matrix.

11. The storage device according to claim 7 , wherein the operation of writing by the processor comprises:

filling a position without data blocks in the y th column with 0s when a stripe, which comprises the data blocks and the check block in the y th column of the first matrix is not fully occupied, and

writing the stripe, which comprises the data blocks and the check block in the y th column after filling with 0s, into disks that form the RAID, wherein the y th column is one of the columns in the first matrix.

12. A storage device comprising:

a redundant array of independent disks (RAID), configured to store a file; and

a controller, configured to

receive F files that are to be stored in the RAID, F is no less than 2;

divide each of the F files into one or more data blocks;

obtaining an array according to data blocks of the F files, wherein two data blocks that belong to one file are arranged in the array with D−1 data blocks of a different file therebetween, and a value of the D is the quantity of data disks in the RAID, F is no less than D; and

write stripes into disks that form the RAID, wherein each of the stripes comprises a sequence of D data blocks of the array and P check blocks which are obtained by computing the D data blocks, the sequence of D data blocks in each of the stripes respectively belong to different files of the F files, a value of the P is the quantity of independent check disks in the RAID.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 10, 2022
From: HUAWEI TECHNOLOGIES CO., LTD.
To: XFUSION DIGITAL TECHNOLOGIES CO., LTD.
Reel/Frame 058682/0312 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 12, 2014
From: KONG, HAN; WANG, JING
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 034492/0796 →
Continuity (2)
Continuation PCTCN2013081182 · Aug 9, 2013
Related Publication 20150100729A1 · Apr 9, 2015