Disclosure of Invention
In view of the above, an object of the present invention is to provide a RAID encoding circuit and an encoding method, which can implement RAID6 quickly and with a relatively low area on the premise of implementing RAID 5. The specific scheme is as follows:
in a first aspect, the present application discloses a RAID encoding circuit, comprising:
the system comprises a first parameter module, a second parameter module and a third parameter module, wherein the first parameter module is used for acquiring a first check parameter corresponding to a current target data strip of data to be coded in a current RAID mode, and determining data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1;
and the first coding module is used for carrying out coding operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code, and storing the new first check code to the first check code storage position until the final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded.
Optionally, the method further includes:
the data stripe dividing module is used for dividing the data to be coded into a preset number of data stripes;
the Galois field conversion module is used for converting each data stripe into Galois field data to obtain the target data stripe corresponding to each data stripe;
correspondingly, the first encoding module is configured to perform an exclusive or operation on the current first check code read from the first check code storage location and the data after the current first parameter operation to obtain a new first check code, and store the new first check code to the first check code storage location.
Optionally, the method further includes:
the second parameter module is used for acquiring a second check parameter corresponding to a current target data stripe of data to be coded in the RAID6 mode, and determining data after second parameter operation by using the second check parameter and the current target data stripe; the second check parameter corresponding to RAID6 is a coding parameter corresponding to a second check code determined based on the Van der Mongolian RS coding relation;
and the second coding module is used for carrying out coding operation on the current second check code read from the second check code storage position and the data after the current second parameter operation to obtain a new second check code and storing the new second check code to the second check code storage position.
Optionally, the first parameter module is further configured to obtain a second check parameter corresponding to a current target data stripe of data to be encoded under RAID6, and determine data after second parameter operation by using the second check parameter and the current target data stripe; the second check parameter corresponding to RAID6 is a coding parameter corresponding to a second check code determined based on the Van der Mongolian RS coding relation;
correspondingly, the first encoding module is further configured to perform encoding operation on the current second parity read from the second parity storage location and the data after the current second parameter operation to obtain a new second parity, and store the new second parity to the second parity storage location.
Optionally, the method further includes:
the data caching module is used for storing the target data strip of the data to be coded into a cache;
and the data reading module is used for reading the target data stripe from the cache and simultaneously respectively transmitting the target data stripe to a data storage position corresponding to the target data stripe and the first parameter module.
Optionally, the first parameter module is specifically configured to:
based on the formula
Determining a first check parameter corresponding to a current target data stripe of data to be coded in an RAID6 mode;
wherein alpha is
pA code coefficient value, alpha, corresponding to the first check code determined based on the Van der Monte RS coding relation
qA code coefficient value, alpha, corresponding to the second check code determined based on the Van der Monte RS code relation
xFor the encoding coefficient value corresponding to the current target data strip determined based on the vandermonde RS encoding relationship,
representing an exclusive or operation.
Optionally, the second parameter module is specifically configured to:
based on the formula
Determining to-be-encoded in RAID6 modeA second check parameter corresponding to a current target data stripe of the data;
wherein alpha is
pA code coefficient value, alpha, corresponding to the first check code determined based on the Van der Monte RS coding relation
qA code coefficient value, alpha, corresponding to the second check code determined based on the Van der Monte RS code relation
xFor the encoding coefficient value corresponding to the current target data strip determined based on the vandermonde RS encoding relationship,
representing an exclusive or operation.
In a second aspect, the present application discloses a RAID encoding method, including:
acquiring a first check parameter corresponding to a current target data strip of data to be coded in a current RAID mode, and determining data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1;
and carrying out coding operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code, and storing the new first check code to the first check code storage position until the final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded.
Optionally, the method further includes:
dividing the data to be coded into a preset number of data stripes;
and converting each data stripe into Galois field data to obtain a target data stripe corresponding to each data stripe.
Optionally, the performing encoding operation on the current first check code read from the first check code storage location and the data after the current first parameter operation to obtain a new first check code includes:
and performing XOR operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code.
It can be seen that the present application discloses a RAID encoding circuit, including: the system comprises a first parameter module, a second parameter module and a third parameter module, wherein the first parameter module is used for acquiring a first check parameter corresponding to a current target data strip of data to be coded in a current RAID mode, and determining data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1; and the first coding module is used for carrying out coding operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code, and storing the new first check code to the first check code storage position until the final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded. Therefore, the code conversion from RAID5 to RAID6 can be realized only by the first parameter module, and RAID6 can be realized quickly and in a lower area on the premise of realizing RAID 5.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, an embodiment of the present application discloses a RAID encoding circuit, including:
the first parameter module 11 is configured to obtain a first check parameter corresponding to a current target data stripe of data to be encoded in a current RAID mode, and determine data after first parameter operation by using the first check parameter and the current target data stripe; the first check parameter in the RAID6 mode is an encoding parameter corresponding to the first check code determined based on the vandermonde RS encoding relationship, and the first check parameter in the RAID5 mode is 1.
In a specific implementation manner, multiplication is performed by using the first check parameter and the current target data strip, so as to obtain data after the first parameter operation.
The first encoding module 12 is configured to perform encoding operation on the current first check code read from the first check code storage location and the data after the current first parameter operation to obtain a new first check code, and store the new first check code to the first check code storage location until a final first check code corresponding to the data to be encoded is determined based on the last target data strip of the data to be encoded.
In a specific embodiment, the circuit further comprises:
and the data stripe segmentation module is used for segmenting the data to be encoded into a preset number of data stripes.
The preset number is the number of data strips of the RAID.
And the Galois field conversion module is used for converting each data stripe into Galois field data to obtain the target data stripe corresponding to each data stripe.
Correspondingly, the first encoding module is configured to perform an exclusive or operation on the current first check code read from the first check code storage location and the data after the current first parameter operation to obtain a new first check code, and store the new first check code to the first check code storage location.
That is, the embodiment of the present application may perform encoding operation based on the data stripes of the galois field, so that the encoding efficiency may be improved.
It should be noted that, RAID5 only has one parity stripe (i.e., a first check code), and when encoding is performed, if data to be encoded is divided into n data stripes, the relationship between the data stripes and the first check code is expressed as:
wherein d is
0,d
1...d
nRepresenting a data strip, p a first check code,
representing an exclusive or operation.
When RAID6 is realized, two check stripes, namely a first check code and a second check code, need to be supported simultaneously. In the present application, an RS (Reed-Solomon Code, Reed Solomon Code) Code is used to encode a first check Code and a second check Code, the RS Code has multiple implementation manners such as vandermonde and cauchy, and in consideration of characteristics of RAID6 and simplicity requirements of operation, the implementation manner of vandermonde is used in the embodiment of the present application, and if data to be encoded is divided into n data stripes, a relationship among the data stripes, the first check Code, and the second check Code is expressed as follows:
wherein d is
0,d
1...d
nRepresenting a data stripe, p representing a first check code, q representing a second check code,
indicating an exclusive or operation and alpha an vandermonde parameter.
For convenience of operation and storage, the present embodiment encodes and stores the finite field by galois field processing. In addition, since the transmission of data in a circuit is generally based on byte, the galois field used in the embodiment of the present application is a finite field 0X11D of 8 bits, that is:
P(X)=x8+x4+x3+x2+1;
under the Galois field of finite field 0X11D, the definition for data can be represented as shown in Table one:
watch 1
Generating an element
|
Polynomial representation
|
Binary representation
|
Numerical representation
|
Derivation process
|
0
|
0
|
0000 0000
|
0
|
|
x^0
|
x^0
|
0000 0001
|
1
|
|
x^1
|
x^1
|
0000 0010
|
2
|
|
x^2
|
x^2
|
0000 0100
|
4
|
|
x^3
|
x^3
|
0000 1000
|
8
|
|
x^4
|
x^4
|
0001 0000
|
16
|
|
x^5
|
x^5
|
0010 0000
|
32
|
|
x^6
|
x^6
|
0100 0000
|
64
|
|
x^7
|
x^7
|
1000 0000
|
128
|
|
x^8
|
x^4+x^3+x^2+1
|
0001 1101
|
29
|
x^7*x=x^8mod P(x)
|
x^9
|
x^5+x^4+x^3+x
|
0011 1010
|
58
|
x^8*x=x^5+x^4+x^3+x
|
x^10
|
x^6+x^5+x^4+x^2
|
0111 0100
|
116
|
x^9*x=x^6+x^5+x^4+x^2
|
…
|
…
|
…
|
…
|
…
|
x^255
|
1
|
0000 0001
|
1
|
|
For example, when the exponent of the generated element is 10, it is represented as binary 01110100 by galois field primitive polynomial p (x) conversion described above. By this conversion, all data is converted into 8-bit binary numbers, and four arithmetic operations based on the 8-bit binary numbers are performed. Based on the situation of the galois field, it is known that both traditional RAIDs 5 and 6 can implement the ordinary data four-way operation through the galois field, but the coding of RAID6 based on the van der waals RS code proposed in the application needs to consider the corresponding exponential relationship, and when the four-way operation, especially multiplication, is involved, it needs to consider whether the data still conforms to the van der waals relationship after overflowing. To verify the applicability, the following calculation derivation is performed:
suppose there are two data stripes d0And d1Multiplication operation is needed, expansion is carried out according to 8-bit Galois field, and conversion is carried out by using RS code based on Van der Monte, and then:
since it is the multiplication that is most prone to overflow problems, do d0And d1The multiplication of (a) may result in:
d0*d1=A7B7α14
+(A7B6+A6B7)α13
+...+
+A0B0α0
a of the above formula7B7,(A7B6+A6B7) Up to A0B0By parameter P14,P13,...,P0Then the above formula can be expressed as:
d0*d1=P14α14+P13α13+...+P2α2+P1α1+P0α0
based on table-query overflow term alpha14,α13,...,α8Of 8-bit binary representation, e.g. alpha8Expressed as α at 298=α4+α3+α2+α0Then, the above formula is substituted again, and then:
d0*d1=C7α7+C6α6+...+C2α2+C1α1+C0α0;
wherein, C0,C1...C6,C7After splitting operation is performed through the first lookup table, P (X) is used8+x4+x3+x2+1 for α7,α6,...,α0The new parameters of (2). It can be known that the perfect adaptation of the vandermonde-based RS code requirement can complete four operations of RAID6, that is, the vandermonde-based RS code proposed in the present application can be used for encoding and decoding of RAID6, thereby implementing the operations of RAID 6.
In a specific embodiment, the RAID encoding circuit further comprises:
the second parameter module is used for acquiring a second check parameter corresponding to a current target data stripe of data to be coded in the RAID6 mode, and determining data after second parameter operation by using the second check parameter and the current target data stripe; the second check parameter corresponding to RAID6 is a coding parameter corresponding to a second check code determined based on the Van der Mongolian RS coding relation;
and the second coding module is used for carrying out coding operation on the current second check code read from the second check code storage position and the data after the current second parameter operation to obtain a new second check code and storing the new second check code to the second check code storage position.
In another specific implementation, the first parameter module is further configured to obtain a second check parameter corresponding to a current target data stripe of data to be encoded under RAID6, and determine data after second parameter operation by using the second check parameter and the current target data stripe; the second check parameter corresponding to RAID6 is a coding parameter corresponding to a second check code determined based on the Van der Mongolian RS coding relation;
correspondingly, the first encoding module is further configured to perform encoding operation on the current second parity read from the second parity storage location and the data after the current second parameter operation to obtain a new second parity, and store the new second parity to the second parity storage location.
That is, in a specific embodiment, the first check code and the second check code may be determined serially by using the same parameter module and the encoding module, so as to reduce the circuit area. In order to increase the encoding speed, the first check code and the second check code can be respectively determined by different parameter modules and encoding modules in parallel.
In another specific embodiment, the RAID encoding circuit further includes:
and the data caching module is used for storing the target data strip of the data to be coded into a cache.
In a specific embodiment, the buffering mode may be buffer or FIFO (First Input First Output).
And the data reading module is used for reading the target data stripe from the cache and simultaneously respectively transmitting the target data stripe to a data storage position corresponding to the target data stripe and the first parameter module.
For example, referring to fig. 2, fig. 2 is a schematic diagram of a specific RAID encoding circuit encoding disclosed in the present application.
1. The data to be coded enters an RAID coding circuit, the RAID coding circuit firstly divides the data to be coded into a preset number of data strips, then each data strip is converted into Galois field data to obtain a target data strip corresponding to each data strip, the target data strip is temporarily stored in a buffer or FIFO mode, when a data reading module is idle, the data reading module respectively and simultaneously sends the target data strip to a data storage position corresponding to the current data strip and a first parameter module and a second parameter module, the first parameter module obtains a first check parameter corresponding to the current target data strip of the data to be coded in the current RAID mode, multiplication operation is carried out by utilizing the first check parameter and the current target data strip to obtain data after first parameter operation, the data after the first parameter operation is transmitted to the first coding module, the second parameter module obtains a second check parameter corresponding to the current target data strip of the data to be coded in the current RAID mode, and performing multiplication operation by using the second check parameter and the current target data strip to obtain data after second parameter operation, and transmitting the data after second parameter operation to the second coding module. For example, the current target data stripe is d0Transmitting data to d0The corresponding storage position, the first parameter module and the second parameter module. At the same time, the currently stored data is read from the storage positions of the first check code p and the second check code q, that is, the current first check code and the current second check code are transmitted to the first coding module and the second coding module.
2. And after the data after the first parameter operation and the data after the second parameter operation are respectively subjected to exclusive OR operation with the data stored in the current first check code read from the first check code storage position and the current second check code read from the second check code storage position in the first coding module and the second coding module, generating a new first check code and a new second check code, and then updating the data in the first check code storage position and the second check code storage position.
And the initial values of the first check code storage position and the second check code storage position are both 0, so that the check code determined by using the last target data strip of the data to be coded is the final check code corresponding to the data to be coded, and the coding of the data to be coded is completed.
It should be noted that the first check parameter in the RAID5 mode is 1, and the encoding can be completed by the first parameter module and the first encoding module, so as to obtain the corresponding first check code.
In a specific embodiment, the first parameter module is specifically configured to:
based on the formula
Determining a first check parameter corresponding to a current target data stripe of data to be coded in an RAID6 mode;
wherein alpha is
pA code coefficient value, alpha, corresponding to the first check code determined based on the Van der Monte RS coding relation
qA code coefficient value, alpha, corresponding to the second check code determined based on the Van der Monte RS code relation
xFor the encoding coefficient value corresponding to the current target data strip determined based on the vandermonde RS encoding relationship,
representing an exclusive or operation.
The second parameter module is specifically configured to:
based on the formula
Determining a second check parameter corresponding to a current target data stripe of data to be coded in the RAID6 mode;
wherein alpha is
pA code coefficient value, alpha, corresponding to the first check code determined based on the Van der Monte RS coding relation
qA code coefficient value, alpha, corresponding to the second check code determined based on the Van der Monte RS code relation
xFor the encoding coefficient value corresponding to the current target data strip determined based on the vandermonde RS encoding relationship,
representing an exclusive or operation.
The implementation process of the RAID encoding circuit provided in the present application is described below:
note that RAID5 is implemented as:
when encoding of RAID5 needs to be implemented, the operation mode is as shown in fig. 3, and fig. 3 is a schematic diagram of encoding of a RAID5 encoding circuit disclosed in the embodiment of the present application. 1. The data to be coded enters a RAID5 coding circuit, the RAID coding circuit firstly divides the data to be coded into a preset number of data strips, and temporarily stores the data strips to the data storage position and the coding module corresponding to the current data strip respectively and simultaneously when waiting for the data reading module to be idle in a buffer or FIFO mode and the like. At the same time, the now stored data is read from the location where the check code p is stored into the encoding module. 2. And after the data strip and the current check code read from the position for storing the check code p are subjected to XOR operation by the encoding module, the generated new check code is written into the position for storing the check code p, and the data at the position is updated.
The multiplexing of hardware circuits is realized, the minimum area is reached, and the maximum multiplexing optimization is realized, so that the same method needs to be set for encoding when RAID6 is used.
The RAID6 relationship may be expressed as:
the formula (1) can simply expand the second parity stripe q by the expression of RAID 5. Therefore, when the coding of formula (1) of RAID6 is realized, the RAID5 module is applied. Two encoding modules can be used for parallel operation, or just one encoding module can be used as in RAID5, and the values of p and q are calculated in two beats and then updated respectively. Because the formula (1) of the RS RAID6 coding is very similar to RAID5, q can be considered to be updated in the same way as p, so that the calculation and the update of p and q can be realized in parallel or in series by using the same circuit. For example, referring to fig. 4, fig. 4 is a schematic diagram of coding of a RAID6 coding circuit disclosed in an embodiment of the present application, which is used for implementing coding of formula (1) for implementing RAID 6. 1. The data to be coded enters a RAID6 coding circuit, the RAID6 coding circuit firstly divides the data to be coded into a preset number of data strips, and temporarily stores the data strips to the data storage position corresponding to the current data strip and two different coding modules at the same time when waiting for the data reading module to be idle in a buffer or FIFO mode and the like. At the same time, the data stored now are read from the positions where the check codes p and q are stored and sent to the two encoding modules respectively. 2. And after the data strip and the current check code p read from the position for storing the check code p are subjected to XOR operation in the corresponding coding module, the generated new check code is written into the position for storing the check code p, and the data at the position is updated. And after the data strip and the current check code q read from the position for storing the check code q are subjected to XOR operation in the corresponding coding module, the generated new check code is written into the position for storing the check code q, and the data at the position is updated.
Formula (2) of RS RAID6 is greatly different from RAID5, and different parameters and corresponding multiplications are added due to the xor operation compared with RAID 5. In order to set the same way to perform coding and implement circuit multiplexing, a parameter module is added in the embodiment, and the parameter module multiplies the data stripe by a parameter before performing exclusive-or operation, and the parameter can simultaneously satisfy the formulas (1) and (2) of RAID 6. So that formula (2) can complete the calculation update of p and q through additional multiplication operation and exclusive or operation based on the updated data stripe.
Let any stored data be dxThe corresponding check codes are p and q. The updated storage data is dx', their corresponding check codes are p ' and q '. And x is the number corresponding to the data stripe.
As can be seen from the encoding relationship of formula (1) in RAID6, the following relationship is satisfied:
let d
x-d
xIf Δ, the above formula can be updated as follows:
let the parameters of RS RAID6 corresponding to p and q be alpha respectivelyp,αqThen multiply the above formula by alpha respectivelyp,αqThe following relationships can be obtained:
and, based on alphap,αqThe corresponding RS RAID6 encoding relationship may be obtained:
(5) in the formula alphaxRefers to the coding coefficient corresponding to the stored data Δ.
Taking q' as an example, the following equations (3) and (5) are added, where the addition refers to the addition in the galois field, and the xor operation is performed:
the same principle (3) and (4) are added to obtain the relation formula of p'.
As defined above, in the above equation, p and q are check codes originally stored, and Δ is an increment of corresponding data to be stored, which may represent a change in data or a new data. Alpha is alphap,αqAnd alphaxExpressed as described above are the corresponding encoding coefficients, α in equation (2) of RAID6p,αqAre each alphan+1,αn+2,αxCoefficient values, e.g. alpha, for respective stripe data0All the parameters are definite parameters irrelevant to specific values of data and can be directly operated.
In a specific embodiment, the data stripes of the data to be encoded can be regarded as Δ, αxAnd the coding coefficient value corresponding to the current target data strip determined based on the Van der Monte RS coding relation.
Due to the fact that
And
to determine the parameters, through the above operation conversion, it can be known that the data update of p and q of RS RAID6 can be realized by adding the parameter calculation and then using the circuit in fig. 4. The circuit of fig. 2 can be obtained by adding the parameter module.
It can be seen that the RAID encoding circuit disclosed in the embodiment of the present application includes: the system comprises a first parameter module, a second parameter module and a third parameter module, wherein the first parameter module is used for acquiring a first check parameter corresponding to a current target data strip of data to be coded in a current RAID mode, and determining data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1; and the first coding module is used for carrying out coding operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code, and storing the new first check code to the first check code storage position until the final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded. Therefore, the code conversion from RAID5 to RAID6 can be realized only by the first parameter module, and RAID6 can be realized quickly and in a lower area on the premise of realizing RAID 5.
Referring to fig. 5, an embodiment of the present application discloses a RAID encoding method, including:
step S11: acquiring a first check parameter corresponding to a current target data strip of data to be coded in a current RAID mode, and determining data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1;
step S12: and carrying out coding operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code, and storing the new first check code to the first check code storage position until the final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded.
In a specific embodiment, the data to be encoded may be divided into a preset number of data stripes; and converting each data stripe into Galois field data to obtain a target data stripe corresponding to each data stripe.
Correspondingly, the encoding operation is performed on the current first check code read from the first check code storage location and the data after the current first parameter operation to obtain a new first check code, including:
and performing XOR operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code.
In a particular embodiment, the following may be used:
acquiring a first check parameter corresponding to a current target data strip of data to be coded in a current RAID mode through a first parameter module, and determining data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1;
and performing coding operation on the current first check code read from the first check code storage position and the current data after the first parameter operation through a first coding module to obtain a new first check code, and storing the new first check code to the first check code storage position until a final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded.
Acquiring a second check parameter corresponding to a current target data stripe of data to be encoded in the RAID6 mode through a second parameter module, and determining data after second parameter operation by using the second check parameter and the current target data stripe; the second check parameter corresponding to RAID6 is a coding parameter corresponding to a second check code determined based on the Van der Mongolian RS coding relation;
and the second coding module is used for coding the current second check code read from the second check code storage position and the data after the current second parameter operation to obtain a new second check code, and storing the new second check code to the second check code storage position.
In another specific embodiment, the method can be used
Acquiring a first check parameter corresponding to a current target data strip of data to be coded in a current RAID mode through a first parameter module, and determining data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1;
and performing coding operation on the current first check code read from the first check code storage position and the current data after the first parameter operation through a first coding module to obtain a new first check code, and storing the new first check code to the first check code storage position until a final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded.
Acquiring a second check parameter corresponding to a current target data stripe of data to be encoded under RAID6 through a first parameter module, and determining data after second parameter operation by using the second check parameter and the current target data stripe; the second check parameter corresponding to RAID6 is a coding parameter corresponding to a second check code determined based on the Van der Mongolian RS coding relation;
correspondingly, the first coding module is used for coding the current second check code read from the second check code storage position and the data after the current second parameter operation to obtain a new second check code, and the new second check code is stored to the second check code storage position.
In a specific embodiment, the target data stripe of the data to be encoded may be stored in a cache; and reading the target data stripe from the cache, and simultaneously respectively transmitting the target data stripe to a data storage position corresponding to the target data stripe and the first parameter module.
And, in particular embodiments, may be based on a formula
Determining a first check parameter corresponding to a current target data stripe of data to be coded in an RAID6 mode;
wherein alpha is
pA code coefficient value, alpha, corresponding to the first check code determined based on the Van der Monte RS coding relation
qA code coefficient value, alpha, corresponding to the second check code determined based on the Van der Monte RS code relation
xFor the encoding coefficient value corresponding to the current target data strip determined based on the vandermonde RS encoding relationship,
representing an exclusive or operation.
Based on the formula
Determining a second check parameter corresponding to a current target data stripe of data to be coded in the RAID6 mode;
wherein alpha is
pFor determining based on Van der Monte RS coding relationshipsCorresponding to the first check code, a
qA code coefficient value, alpha, corresponding to the second check code determined based on the Van der Monte RS code relation
xFor the encoding coefficient value corresponding to the current target data strip determined based on the vandermonde RS encoding relationship,
representing an exclusive or operation.
Therefore, the method and the device for determining the data to be encoded in the RAID mode obtain a first check parameter corresponding to a current target data strip of the data to be encoded in the current RAID mode, and determine data after first parameter operation by using the first check parameter and the current target data strip; the first verification parameter in the RAID6 mode is a coding parameter corresponding to a first verification code determined based on a Van der Menu RS coding relation, and the first verification parameter in the RAID5 mode is 1; and carrying out coding operation on the current first check code read from the first check code storage position and the data after the current first parameter operation to obtain a new first check code, and storing the new first check code to the first check code storage position until the final first check code corresponding to the data to be coded is determined based on the last target data strip of the data to be coded. Therefore, the code conversion from RAID5 to RAID6 can be realized only by replacing the first check code parameter, and RAID6 can be realized quickly and in a lower area on the premise of realizing RAID 5.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. For the method disclosed by the embodiment, the method corresponds to the circuit disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the circuit part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The RAID encoding circuit and the encoding method provided by the present application are introduced in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.