Storage controller, data processing chip, and data processing method
First Claim
Patent Images
1. A first storage controller, comprising:
- a processor; and
a non-transitory memory;
wherein the first storage controller is comprised in a storage system, the storage system comprises at least one storage device, a first storage device of the at least one storage device comprises the first storage controller and a first storage medium, each storage device of the at least one storage device comprised in the storage system comprises a storage controller and a storage medium, and each storage device of the at least one storage device comprised in the storage system is configured to connect with any other storage device comprised in the storage system;
wherein the processor is configured to execute a program in the non-transitory memory to;
receive to-be-written data;
divide the to-be-written data into K to-be-coded data chunks, wherein each data chunk of the K to-be-coded data chunks comprises R data code blocks, (R+1) is a prime number, and (R+1)>
K;
generate a first check chunk and a second check chunk according to a check matrix and the K to-be-coded data chunks, wherein each of the first check chunk and the second check chunk respectively comprises R check code blocks;
create a chunk group, wherein the chunk group comprises the K to-be-coded data chunks, the first check chunk, and the second check chunk; and
store each data chunk in the chunk group into the first storage medium, and store each check chunk in the chunk group into a second storage medium;
wherein the check matrix comprises 2*R rows and (K+2)*R columns, each column of the check matrix corresponds to one code block, each row of the check matrix corresponds to one exclusive OR equation the (K*R+1)th column to the ((K+1)*R)th column of the check matrix form a chunk column set of the first check chunk, and the ((K+1)*R+1)th column to the ((K+2)*R)th column of the check matrix form a chunk column set of the second check chunk;
wherein the check matrix is a standard check matrix H, or the check matrix is obtained after N exchange operations are performed on the standard check matrix H, wherein N≥
1, and the N exchange operations are each an exchange of any two chunk column sets;
wherein, for each value of i and each value of j, coordinates in the standard check matrix H corresponding to the following first relations are set to be 1;
when i<
j,
H[i+1][j*R+(R−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
j+i)mod R];
or
when i>
j,
H[i+1][j*R+(R−
1−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
1−
j+i)mod R]; and
wherein 2*R≥
i≥
1, (K+2)*R≥
j≥
1, and coordinates in the in the standard check matrix H that do not correspond to the first relations are set to be o.
1 Assignment
0 Petitions
Accused Products
Abstract
This application discloses a storage controller. When running, the storage controller encodes, according to a check matrix, K to-be-coded data chunks obtained from a client, to generate two check chunks. In this way, if any chunk is damaged subsequently, the damaged chunk may be recovered by using the check matrix and an undamaged chunk.
20 Citations
20 Claims
-
1. A first storage controller, comprising:
-
a processor; and a non-transitory memory; wherein the first storage controller is comprised in a storage system, the storage system comprises at least one storage device, a first storage device of the at least one storage device comprises the first storage controller and a first storage medium, each storage device of the at least one storage device comprised in the storage system comprises a storage controller and a storage medium, and each storage device of the at least one storage device comprised in the storage system is configured to connect with any other storage device comprised in the storage system; wherein the processor is configured to execute a program in the non-transitory memory to; receive to-be-written data; divide the to-be-written data into K to-be-coded data chunks, wherein each data chunk of the K to-be-coded data chunks comprises R data code blocks, (R+1) is a prime number, and (R+1)>
K;generate a first check chunk and a second check chunk according to a check matrix and the K to-be-coded data chunks, wherein each of the first check chunk and the second check chunk respectively comprises R check code blocks; create a chunk group, wherein the chunk group comprises the K to-be-coded data chunks, the first check chunk, and the second check chunk; and store each data chunk in the chunk group into the first storage medium, and store each check chunk in the chunk group into a second storage medium; wherein the check matrix comprises 2*R rows and (K+2)*R columns, each column of the check matrix corresponds to one code block, each row of the check matrix corresponds to one exclusive OR equation the (K*R+1)th column to the ((K+1)*R)th column of the check matrix form a chunk column set of the first check chunk, and the ((K+1)*R+1)th column to the ((K+2)*R)th column of the check matrix form a chunk column set of the second check chunk; wherein the check matrix is a standard check matrix H, or the check matrix is obtained after N exchange operations are performed on the standard check matrix H, wherein N≥
1, and the N exchange operations are each an exchange of any two chunk column sets;wherein, for each value of i and each value of j, coordinates in the standard check matrix H corresponding to the following first relations are set to be 1;
when i<
j,
H[i+1][j*R+(R−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
j+i)mod R];
or
when i>
j,
H[i+1][j*R+(R−
1−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
1−
j+i)mod R]; andwherein 2*R≥
i≥
1, (K+2)*R≥
j≥
1, and coordinates in the in the standard check matrix H that do not correspond to the first relations are set to be o. - View Dependent Claims (2, 3, 4, 10)
-
-
5. A data processing chip, comprising:
-
a circuit; and an interface, configured to perform read and write operations; wherein the data processing chip is comprised in a storage system, the storage system comprises at least one storage device, a first storage device of the at least one storage device comprises a first storage controller and a first storage medium, the first storage controller comprises the data processing chip, and each storage device of the at least one storage device comprised in the storage system comprises a storage controller and a storage medium; wherein the circuit is configured to; receive to-be-written data; divide the to-be-written data into K to-be-coded data chunks, wherein each data chunk of the K to-be-coded data chunks comprises R data code blocks, (R+1) is a prime number, and (R+1)>
K;generate a first check chunk and a second check chunk based on a check matrix and the K to-be-coded data chunks, wherein each of the first check chunk and the second check chunk respectively comprises R check code blocks; create a chunk group, wherein the chunk group comprises the K data chunks, the first check chunk, and the second check chunk; and store each data chunk in the chunk group into the first storage medium, and store each check chunk into a second storage medium; wherein the check matrix comprises 2*R rows and (K+2)*R columns, each column of the check matrix corresponds to one code block, and each row of the check matrix corresponds to one exclusive OR equation, and wherein the (K*R+1)th column to the ((K+1)*R)th column of the check matrix form a chunk column set of the first check chunk, and the ((K+1)*R+1)th column to the ((K+2)*R)th column of the check matrix form a chunk column set of the second check chunk; wherein the check matrix is a standard check matrix H, or the check matrix is obtained after N exchange operations are performed on the standard check matrix H, wherein N≥
1, and each of the N exchange operations is an exchange of any two chunk column sets;wherein, for each value of i and each value of j, coordinates in the standard check matrix H corresponding to the following first relations are set to be 1;
when i<
j,
H[i+1][j*R+(R−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
j+i)mod R];
or
when i>
j,
H[i+1][j*R+(R−
1−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
1−
j+i)mod R]; andwherein 2*R≥
i≥
1, (K+2)*R≥
j≥
1, and coordinates in the in the standard check matrix H that do not correspond to the first relations are set to be o. - View Dependent Claims (6, 7, 8, 9)
-
-
11. A method comprising:
-
receiving, by a first storage controller, to-be-written data, wherein the first storage controller is comprised in a storage system, the storage system comprises at least one storage device, a first storage device of the at least one storage device comprises the first storage controller and a first storage medium, each storage device of the at least one storage device comprised in the storage system comprises a storage controller and a storage medium, and each storage device of the at least one storage device comprised in the storage system is configured to connect with any other storage device comprised in the storage system; dividing, by the first storage controller, the to-be-written data into K to-be-coded data chunks wherein each data chunk of the K to-be-coded data chunks comprises R data code blocks, (R+1) is a prime number, and (R+1)>
K;generating, by the first storage controller, a first check chunk and a second check chunk according to a check matrix and the K to-be-coded data chunks, wherein each of the first check chunk and the second check chunk respectively comprises R check code blocks; creating, by the first storage controller, a chunk group, wherein the chunk group comprises the K to-be-coded data chunks, the first check chunk, and the second check chunk; and storing, by the first storage controller, each data chunk in the chunk group into the first storage medium, and storing, by the first storage controller, each check chunk in the chunk group into a second storage medium; wherein the check matrix comprises 2*R rows and (K+2)*R columns, each column of the check matrix corresponds to one code block, and each row of the check matrix corresponds to one exclusive OR equation, and wherein the (K*R+1)th column to the ((K+1)*R)th column of the check matrix form a chunk column set of the first check chunk, and the ((K+1)*R+1)th column to the ((K+2)*R)th column of the check matrix form a chunk column set of the second check chunk; wherein the check matrix is a standard check matrix H, or the check matrix is obtained after N exchange operations are performed on a standard check matrix H, wherein N≥
1, and each of the N exchange operations is an exchange of any two chunk column sets;wherein, for each value of i and each value of j, coordinates in the standard check matrix H corresponding to the following first relations are set to be 1;
when i<
j,
H[i+1][j*R+(R−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
j+i)mod R];
or
when i>
j,
H[i+1][j*R+(R−
1−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
1−
j+i)mod R]; andwherein 2*R≥
i≥
1, (K+2)*R≥
j≥
1, and coordinates in the in the standard check matrix H that do not correspond to the first relations are set to be o. - View Dependent Claims (12, 13, 14, 15)
-
-
16. A non-transitory computer-readable storage medium comprising instructions which, when executed by a first computer, cause the computer to:
-
receive to-be-written data; divide the to-be-written data into K to-be-coded data chunks, wherein each data chunk of the K to-be-coded data chunks comprises R data code blocks, (R+1) is a prime number, and (R+1)>
K;generate a first check chunk and a second check chunk according to a check matrix and the K to-be-coded data chunks, wherein each of the first check chunk and the second check chunk comprises R check code blocks; create a chunk group, wherein the chunk group comprises the K to-be-coded data chunks, the first check chunk, and the second check chunk; and store each data chunk in the chunk group into a first storage medium, and store each check chunk in the chunk group into a second storage medium; wherein the first computer is comprised in a storage system, the storage system comprises at least one computer including the first computer, each computer comprises a storage controller and a storage medium, the first computer comprises a first storage controller and the first storage medium, and each computer comprised in the storage system is configured to connect with any other computer comprised in the storage system; wherein the check matrix comprises 2*R rows and (K+2)*R columns, each column of the check matrix corresponds to one code block, and each row of the check matrix corresponds to one exclusive OR equation, and wherein the (K*R+1)th column to the ((K+1)*R)th column of the check matrix form a chunk column set of the first check chunk, and the ((K+1)*R+1)th column to the ((K+2)*R)th column of the check matrix form a chunk column set of the second check chunk; and the check matrix is a standard check matrix H, or the check matrix is obtained after N exchange operations are performed on a standard check matrix H, wherein N≥
1, and each of the N exchange operations is an exchange of any two chunk column sets; andwherein, for each value of i and each value of j, coordinates in the standard check matrix H corresponding to the following first relations are set to be 1;
when i<
j,
H[i+1][j*R+(R−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
j+i)mod R];
or
when i>
j,
H[i+1][j*R+(R−
1−
j+i)mod R+1], and
H[R+i+1][(j+1)*R−
(R−
1−
j+i)mod R]; andwherein 2*R≥
i≥
1, (K+2)*R≥
j≥
1, and coordinates in the in the standard check matrix H that do not correspond to the first relations are set to be o. - View Dependent Claims (17, 18, 19, 20)
-
Specification