IP Library Granted Patent US 9,417,806
Granted Patent B2
US 9,417,806 · App. 14/704,514 · Granted Aug 16, 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/0689
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,417,806
App. No.
14/704,514
Granted
Aug 16, 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. 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 (31)

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

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

dividing the F files into data blocks;

obtaining a first matrix with T rows according to the divided data blocks, wherein all data blocks belonging to one file are located in one row in the first matrix, and wherein a column of the first matrix comprises data blocks in the column and a check block that is obtained by computing the data blocks in the column; and

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

2. The file processing method according to claim 1 , wherein, when the RAID comprises an independent check disk, obtaining the first matrix with T rows according to the divided data blocks comprises:

arranging the divided data blocks into a second matrix with D rows, wherein all data blocks belonging to one file are located in one row of the second matrix, and wherein D is a 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 a 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 the check block that is obtained by computing the data blocks in the column into each column of the second matrix according to the determined position of the check block.

3. The file processing method according to claim 1 , wherein writing the stripes into the T disks that form the RAID comprises writing a stripe comprising the data blocks and the 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.

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

filling a position without data blocks in a y th column of the first matrix 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 comprising the data blocks and the check block in the y th column of the first matrix after filling with 0s into disks that form the RAID.

5. A storage device comprising:

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

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, wherein F is no less than 2;

divide the F files into data blocks;

obtain a first matrix with T rows according to the divided data blocks, wherein all data blocks belonging to one file are located in one row in the first matrix, and wherein a column of the first matrix comprises data blocks in the column and a check block that is obtained by computing the data blocks in the column; and

write stripes into the T disks that form the RAID, wherein each of the stripes comprises data blocks and the check block in one column of the first matrix.

6. The storage device according to claim 5 , wherein, when the RAID comprises an independent check disk, the processor being configured to obtain comprises the processor being configured to:

arrange the divided data blocks into a second matrix with D rows, wherein all data blocks belonging to one file are located in one row of the second matrix, and wherein D is a quantity of data disks in the RAID;

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

perform a 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

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

7. The storage device according to claim 5 , wherein the processor being configured to write comprises the processor being configured to write a stripe comprising the data blocks and the 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.

8. The storage device according to claim 5 , wherein the processor being configured to write comprises the processor being configured to:

fill a position without data blocks in a y th column of the first matrix 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

write the stripe comprising the data blocks and the check block in the y th column of the first matrix after filling with 0s into disks that form the RAID.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 10, 2022
From: HUAWEI TECHNOLOGIES CO., LTD.
To: XFUSION DIGITAL TECHNOLOGIES CO., LTD.
Reel/Frame 058682/0312 →
Continuity (3)
Continuation 14568502 · Dec 12, 2014
Continuation PCTCN2013081182 · Aug 9, 2013
Related Publication 20150234614A1 · Aug 20, 2015