CN114465627B - Data storage method, system, equipment and storage medium - Google Patents

Data storage method, system, equipment and storage medium Download PDF

Info

Publication number
CN114465627B
CN114465627B CN202210371393.1A CN202210371393A CN114465627B CN 114465627 B CN114465627 B CN 114465627B CN 202210371393 A CN202210371393 A CN 202210371393A CN 114465627 B CN114465627 B CN 114465627B
Authority
CN
China
Prior art keywords
matrix
data
coding
galois field
coded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210371393.1A
Other languages
Chinese (zh)
Other versions
CN114465627A (en
Inventor
吴睿振
张旭
陈静静
张永兴
王凛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210371393.1A priority Critical patent/CN114465627B/en
Publication of CN114465627A publication Critical patent/CN114465627A/en
Application granted granted Critical
Publication of CN114465627B publication Critical patent/CN114465627B/en
Priority to PCT/CN2022/115724 priority patent/WO2023197506A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
    • H03M13/03Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
    • H03M13/05Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words using block codes, i.e. a predetermined number of check bits joined to a predetermined number of information bits
    • H03M13/13Linear codes
    • H03M13/15Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes
    • H03M13/151Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes using error location or error correction polynomials
    • H03M13/1515Reed-Solomon codes

Landscapes

  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Algebra (AREA)
  • General Physics & Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Error Detection And Correction (AREA)

Abstract

The application discloses a data storage method, which is applied to the technical field of coding and comprises the following steps: receiving data to be encoded; determining a coding matrix used for RS coding and a used Galois field GF (2 m); replacing each element in the coding matrix with a corresponding matrix to obtain a coding sparse matrix only comprising 1 and 0; and when replacing, the following conditions are satisfied: the four operations of elements a and b in the galois field are equivalent to the four operations of matrices h (a) and h (b) in the galois field; coding the data to be coded through the coding sparse matrix to obtain coded data, so that the coding is completed through an exclusive OR circuit and a selection circuit in a circuit; and combining the coded data and the data to be coded into coded data. By applying the scheme of the application, the data can be encoded, and the hardware implementation is high-speed. The application also discloses a data storage system, equipment and a storage medium, which have corresponding effects.

Description

Data storage method, system, equipment and storage medium
Technical Field
The present invention relates to the field of encoding technologies, and in particular, to a data storage method, system, device, and storage medium.
Background
At present, in the face of the storage requirement of mass data, distributed storage is widely applied. The distributed storage system has a large number of nodes, the reliability of a single node is usually not very high, and the system often has node failure due to software and hardware faults, human errors and other reasons. Therefore, in order to improve the data reliability of the distributed storage system and realize the reconstruction of the original file, a certain amount of data redundancy is additionally stored on the basis of storing the original data, so that the original file can still be decoded and recovered under the condition that partial nodes fail, and the normal operation of the system is guaranteed.
EC (Erasure Code) is a forward error correction technique in the coding theory, can effectively reduce storage overhead on the premise of ensuring the same reliability, and is widely applied to various large storage systems and data centers. The erasure codes are of various types, and RS Code (Reed-Solomon Code) is a common one in actual storage systems. The RS code encodes the k data blocks into r additional check blocks. The manner of obtaining the r parity check blocks by encoding based on the vandermonde matrix or the cauchy matrix is called as RS erasure code encoded by using the vandermonde matrix or the cauchy matrix, and can be expressed as:
Figure 267214DEST_PATH_IMAGE001
formula (1)
Figure 814870DEST_PATH_IMAGE002
Formula (2)
Wherein, formula (1) represents that RS encoding is performed by using a Van der Monte matrix, and formula (2) represents that RS encoding is performed by using a Cauchy matrix. Taking formula (1) as an example, the upper part of the vandermonde matrix represents the unit matrix of k × k, which is associated with the original data D1To DkMultiplication is carried out, and the obtained result is still the original data D1To Dk. The lower part is a coding matrix of r x k and the original data D1To DkMultiplication to obtain P1To Pr is the r encoded data obtained by encoding, or called check data, when D1Until at most r data in Pr are in error or lost, the inverse matrix of the matrix corresponding to the residual data is used to multiply the residual data, so as to obtain the original data D1To Dk. For example when D1By the time Dr is lost, the decoding process can be expressed as equation (3).
Figure 733471DEST_PATH_IMAGE003
Formula (3)
It can be seen that the core of the erasure code is to construct a reversible coding matrix, and the original coded data is recovered by using the coded inverse matrix after coding. Common RS erasure codes use either cauchy or vandermonde matrices, the resulting matrix is fully reversible and the size expansion of the matrix is simple.
However, in an actual design, a numerical size limit is also considered in a computer, for example, k 32-bit integers are used as original data, and when the check data is generated by the above-mentioned cauchy matrix or vanderman matrix, the numerical value of the check data is almost certainly overflowed, and therefore, when RS encoding is performed in the computer, a galois field is set to ensure that the calculation result is in the galois field.
In practical design, the parameter multiplication and addition of matrix operation is very complex in operation for a storage environment with large data volume processing requirements, a special module for galois field operation needs to be designed for hardware under the scene generally, and the data volume increase of the operation is reduced through galois field multiplication and division. Compared with the original van der waals and cauchy computing thought, the special computing module causes extra area and speed loss.
In summary, how to effectively implement redundant storage of data and ensure high efficiency of computation is a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention aims to provide a data storage method, a system, equipment and a storage medium, which are used for effectively realizing redundant storage of data and ensuring the high efficiency of calculation.
In order to solve the technical problems, the invention provides the following technical scheme:
a method of data storage, comprising:
receiving data to be encoded;
determining a coding matrix for RS encoding and a Galois field GF (2) used for said RS encodingm) M is a positive integer;
replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix; wherein the replacement rule satisfies: four arithmetic operations performed by elements a and b in the galois field, equivalent to four arithmetic operations performed by matrices h (a) and h (b), a and b being any elements in the coding matrix, h (a) and h (b) being matrices for replacing a and for replacing b, respectively, the coding sparse matrix comprising only the number 1 and the number 0;
coding the data to be coded through the coding sparse matrix to obtain coded data, so that the process of coding the data to be coded through the coding sparse matrix is completed through an exclusive OR circuit and a selection circuit in a circuit;
and combining the coded data and the data to be coded into coded data.
Preferably, according to a preset replacement rule, each element in the coding matrix is replaced by a corresponding matrix to obtain a coding sparse matrix, including:
determining H2 meeting the replacement rule through computer deduction according to the preset replacement rule;
based on determined H2]Sequentially determining H [3] satisfying the replacement rule]To H2m -1];
And replacing each element in the coding matrix with a corresponding matrix to obtain a coding sparse matrix.
Preferably, the replacement rule specifically includes:
h0 is a matrix of all 0's of m x m;
h1 is an m × m identity matrix;
H[a
Figure 973960DEST_PATH_IMAGE004
b]= H[a]
Figure 659019DEST_PATH_IMAGE005
H[b];
H[a
Figure 135000DEST_PATH_IMAGE006
b]= H[a]
Figure 221904DEST_PATH_IMAGE006
H[b]= H[z];
H[a÷b]= H[a]÷H[b]= H[q];
H[a]
Figure 898873DEST_PATH_IMAGE006
H[b]= H[b]
Figure 930283DEST_PATH_IMAGE006
H[a]
H[a]
Figure 85321DEST_PATH_IMAGE006
H[a]-1= H[1];
wherein, a
Figure 796706DEST_PATH_IMAGE004
b denotes an addition operation of the element a and the element b in the Galois field, a
Figure 503631DEST_PATH_IMAGE006
b represents a multiplication operation of the element a and the element b in the galois field, z represents a calculation result of the multiplication operation, a ÷ b represents a division operation of the element a and the element b in the galois field, and q represents a calculation result of the division operation.
Preferably, the Galois field used for RS encoding is GF (2)8)。
Preferably, the coding matrix for RS coding is a coding matrix of a vandermonde matrix or a coding matrix of a cauchy matrix.
Preferably, the method further comprises the following steps:
receiving data to be decoded;
determining an inverse matrix of the encoding matrix;
replacing each element in the inverse matrix of the coding matrix with a corresponding matrix according to the replacement rule to obtain a decoding sparse matrix; the decoding sparse matrix comprises only a number 1 and a number 0;
and decoding the data to be decoded based on the decoding sparse matrix to obtain decoded data, so that the process of decoding the data to be decoded based on the decoding sparse matrix to obtain the decoded data is completed in a circuit through an exclusive OR circuit and a selection circuit.
A data storage system, comprising:
the receiving module of the data to be coded, is used for receiving the data to be coded;
a coding matrix determination module for determining a coding matrix for RS encoding and the Galois field GF (2) used for said RS encodingm) M is a positive integer;
the equivalent replacement module is used for replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix; wherein the replacement rule satisfies: four arithmetic operations performed by elements a and b in the galois field, equivalent to four arithmetic operations performed by matrices h (a) and h (b), a and b being any elements in the coding matrix, h (a) and h (b) being matrices for replacing a and for replacing b, respectively, the coding sparse matrix comprising only the number 1 and the number 0;
the execution module is used for coding the data to be coded through the coding sparse matrix to obtain coded data, so that the process of coding the data to be coded through the coding sparse matrix is completed through an exclusive OR circuit and a selection circuit in a circuit;
and the coding completion module is used for combining the coded data and the data to be coded into coded data.
Preferably, the replacement rule specifically includes:
h0 is a matrix of all 0's of m x m;
h1 is an m × m identity matrix;
H[a
Figure 897703DEST_PATH_IMAGE004
b]= H[a]
Figure 715487DEST_PATH_IMAGE005
H[b];
H[a
Figure 245825DEST_PATH_IMAGE006
b]= H[a]
Figure 389230DEST_PATH_IMAGE006
H[b]= H[z];
H[a÷b]= H[a]÷H[b]= H[q];
H[a]
Figure 270599DEST_PATH_IMAGE006
H[b]= H[b]
Figure 33018DEST_PATH_IMAGE006
H[a]
H[a]
Figure 73656DEST_PATH_IMAGE006
H[a]-1= H[1];
wherein, a
Figure 732170DEST_PATH_IMAGE004
b denotes an addition operation of the element a and the element b in the Galois field, a
Figure 482258DEST_PATH_IMAGE006
b represents a multiplication operation of the element a and the element b in the galois field, z represents a calculation result of the multiplication operation, a ÷ b represents a division operation of the element a and the element b in the galois field, and q represents a calculation result of the division operation.
A data storage device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the data storage method as claimed in any one of the above.
A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the data storage method according to any one of the preceding claims.
By applying the technical scheme provided by the embodiment of the invention, aiming at the operational characteristics of the Galois field, the coding matrix for RS coding is determined, andgalois field GF (2) used for RS encodingm) And then, replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix, namely mapping the operational relation of the Galois field through the coding sparse matrix so that the Galois field operation can be directly realized through the coding sparse matrix. Therefore, the replacement rule needs to satisfy: the four operations performed by element a and element b in galois are equivalent to the four operations performed by matrix h (a) and matrix h (b) in galois. After the coding sparse matrix is obtained, the coding sparse matrix only comprises a number 1 and a number 0, so that in the process of coding the data to be coded through the coding sparse matrix, the coding process can be completed only through an exclusive OR circuit and a selection circuit in a circuit, a traditional Galois field operation module can be omitted, and the hardware implementation has the advantage of high speed. To sum up, the scheme of the application can be used for coding data, so that the redundant storage of the data is effectively realized, the high efficiency of calculation is ensured, and the hardware implementation has the advantage of high speed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of an embodiment of a data storage method according to the present invention;
FIG. 2 is a functional diagram illustrating a row calculation of an arithmetic circuit according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a data storage system according to the present invention.
Detailed Description
The core of the invention is to provide a data storage method, which can encode data, effectively realize redundant storage of the data, ensure the high efficiency of calculation and have the advantage of high speed in hardware realization.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. 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 invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a data storage method according to the present invention, where the data storage method may include the following steps:
step S101: data to be encoded is received.
In addition, in practical application, 1Byte is usually used as a data unit for data transmission, that is, data transmission in hardware is performed by each Byte, and each Byte is 8 bits.
Step S102: determining a coding matrix for RS encoding and a Galois field GF (2) used for RS encodingm) And m is a positive integer.
The specific type of the coding matrix for RS encoding can be set and adjusted as needed, and in practical applications, the coding matrix can be usually selected as a vandermonde matrix or a cauchy matrix, which is mature and commonly used.
For RS encoding, the Galois field GF (2)m) And as described above, considering that data is transmitted through each Byte in hardware, the power of the galois field GF may be set to 8, i.e., the galois field used for RS encoding of the present application may be GF (2), considering that the transmission of data through each Byte is performed8). Of course, in other embodiments, m may be selected to be other values as desired.
When the Galois field used is GF (2)8) The primitive polynomial used may be of various kinds, for exampleAs the primitive polynomial can be adopted: p (x) = x8+x4+x3+x2+1. At this time, the corresponding data table may be expressed as:
table one: corresponding to the primitive polynomial p (x) = x8+x4+x3+x2+1 data sheet
Generating an element Polynomial representation Binary representation Numerical representation Derivation process
0 0 00000000 0
x0 x0 00000001 1
x1 x1 00000010 2
x2 x2 00000100 4
x3 x3 00001000 8
x4 x4 00010000 16
x5 x5 00100000 32
x6 x6 01000000 64
x7 x7 10000000 128
x8 x4+x3+x2+1 00011101 29 x8=x7*x=x8modP(x)
x9 x5+x4+x3+x 00111010 58 x9=x8*x=x5+x4+x3+x
x10 x6+x5+x4+x2 01110100 116 x10=x9*x=x6+x5+x4+x2
... ... ... ... ...
x255 1 00000001 1
Using Galois fields GF (2)m) In this case, the addition and subtraction in the galois field can be performed by exclusive or. The multiplication and division operations are complicated because mod P (x) is required, and in the conventional hardware implementation, the calculation is usually implemented by table lookup, and the table lookup is divided into a positive table and a negative table.
With the primitive polynomial p (x) = x in the above example8+x4+x3+x2+1 as an example, the positive and negative tables obtained are respectively:
watch correction:
gflg (positive table) = [ 0125250261983223512382710419975410022414521412391292819310524820087611351381014722536153353147142218240181306929181194125106392491852011549120772281141666191139981022214825322615237179161453413654208148206143150219189241210199213156706430661821631957212611010758408425013318661202941551591021121437821222917211524316787711219224714012899131037422223749197254242271651531193818418012417681462173532137465563209911491882072051441351511782202521909724286211171204293158132605783711096516231456721618312316411819623732361271211124610816159824115785170251961341771872046290203899517615616916081112452223512211744215791742132332302311732321162142442341688088175 ];
and (4) reversing the table:
gffilog (anti-table) = [ 124816326412829581162322051351938761524590180117234201143361224489619215739781563774148531062121811192381931593570140510204080160931861052101851112221619519097194153479418810120213715306012024025323121118710721417712725422522316391182113226217175671341734681361326521042081891032061293162124248237199147591182361971515110220413323469218410921816979158336613221428416877154418216485170731465711422821318311523020919199198145631262522292151791232462412552272191717515049981961495511022016587174651302550100200141714285611222422116783166811628917812124224923919515543861726913891836721446112224424524724325123520313911224488176125250233207131275410821617371142 ].
In the above examples of the positive and negative tables, to be in the Galois field GF (2)8) Taking the multiplication 3 × 6 as an example:
GF(3*6)=Gfilog(Gflog(3)+Gflog(6))
=Gfilog(2+198)
=Gfilog(200)
=28
correspondingly, in the Galois field GF (2)8) The division operation performed in (1) is 3 ÷ 6:
GF(3÷6)=Gfilog(Gflog(3)-Gflog(6))
=Gfilog(2-198)
=Gfilog(-196)
=210
step S103: and replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix.
Wherein the replacement rule satisfies: the four arithmetic operations of the element a and the element b in the galois field are equivalent to the four arithmetic operations of the matrix h (a) and the matrix h (b) in the galois field, a and b are both arbitrary elements in the coding matrix, h (a) and h (b) are the matrices for replacing a and for replacing b, respectively, and the coding sparse matrix only includes the number 1 and the number 0.
In the scheme of the application, each element in the coding matrix is replaced by a corresponding matrix, and after the coding sparse matrix is obtained, the coding to be coded is carried out by using the coding sparse matrix, so that the coding sparse matrix needs to be capable of mapping the operational relation of the galois field, and the operation of the galois field can be directly realized by using the coding sparse matrix. That is, the replacement rule needs to satisfy: the four arithmetic operations performed by element a and element b in the galois field are equivalent to the four arithmetic operations performed by matrix h (a) and matrix h (b) in the galois field.
Specifically, the power of 8 is taken as an example, i.e., the galois field GF (2) in the above embodiment8) And the primitive polynomial is P (x) = x8+x4+x3+x2+1 is an example. An 8 x 8 matrix can be constructed to characterize all operations to be performed, and the precondition that the matrix is effective and conforms to the encoding and decoding operations is that the following six relationships exist for any matrix H in the set of 8 x 8 matrices:
1、H[0]=zero(8,8)
2、H[1]=eye(8)
3、H[a+b]=H[a]+H[b]
4、H[a*b]=H[a]*H[b]
5、H[a]*H[b]=H[b]*H[a]
6、H[a]*H[a]-1=H[1]
item 1 indicates that H0 is an 8 × 8 all-0 matrix, item 2 indicates that H1 is an 8 × 8 unit matrix, item 6 indicates that any 8 × 8 matrix is reversible, and items 3 to 6 indicate the operation rules that the addition and multiplication of the matrix need to satisfy.
Further, to realize the four arithmetic operations equivalent to the galois field using the constructed matrix, the galois field GF (2) needs to be considered8) In the four arithmetic relationships, the following 4 constraints need to be further added on the basis of the above six relationships, so that the matrix operation meets the operational requirements of the galois field:
1. h1 =1 and H0 =0, i.e., H1 denotes 1 in a galois operator, because in the galois field, any number multiplied by 1 is itself, and H (0) is 0, because any number multiplied by 0 is 0.
2、H[1
Figure 907423DEST_PATH_IMAGE007
2]= H[3]The result of exclusive-or between 1 and 2 is 3.
3. H [ GF _ MUL (3, 6) ] = H [3] × H [6] = H [28 ]; it is shown that the multiplication operation of the matrix needs to conform to the multiplication relation of the galois field, and here, taking 3 × 6 in the foregoing embodiment as an example, it is to be satisfied that H [3] × H [6] corresponds to 3 × 6 in the galois field, and since 3 × 6=28 in the galois field, H [3] × H [6] = H [ GF _ MUL (3, 6) ] = H [28] needs to be true.
4. H [ GF _ DIV (3, 6) ] = H [3 ]/[ H [6] = H [210 ]. Similarly to multiplication, here, taking 3 ÷ 6 in the galois field as an example, H [3] ÷ H [6] = H [ GF _ DIV (3, 6) ] = H [210] holds.
Thus, in one embodiment of the invention, the six relationships for the matrix hereinabove are defined, taking into account the Galois field GF (2)8) After combining the 4 constraints of the four arithmetic relationships, in this embodiment of the present invention, the replacement rule can be specifically expressed as:
h0 is the matrix of all 0 of m multiplied by m;
h1 is an m × m identity matrix;
H[a
Figure 677933DEST_PATH_IMAGE004
b]= H[a]
Figure 772928DEST_PATH_IMAGE005
H[b];
H[a
Figure 19102DEST_PATH_IMAGE006
b]= H[a]
Figure 857745DEST_PATH_IMAGE006
H[b]= H[z];
H[a÷b]= H[a]÷H[b]= H[q];
H[a]
Figure 482761DEST_PATH_IMAGE006
H[b]= H[b]
Figure 138871DEST_PATH_IMAGE006
H[a]
H[a]
Figure 216548DEST_PATH_IMAGE006
H[a]-1= H[1];
wherein, a
Figure 124461DEST_PATH_IMAGE004
b denotes the addition of the element a and the element b in the Galois field, a
Figure 728618DEST_PATH_IMAGE006
b represents the multiplication operation of the element a and the element b in the Galois field, z represents the calculation result of the multiplication operation, a/b represents the division operation of the element a and the element b in the Galois field, and q represents the calculation result of the division operation.
When determining the matrix corresponding to each element in the coding matrix according to the preset replacement rule, there are various specific determination manners, which can be usually implemented by computer deduction. That is, in an embodiment of the present invention, step S103 may specifically include:
determining H2 meeting the replacement rule through computer deduction according to the preset replacement rule;
based on determined H2]Sequentially determining H [3] satisfying the replacement rule]To H2m -1];
And replacing each element in the coding matrix with a corresponding matrix to obtain a coding sparse matrix.
In such an embodiment, there may be multiple coding sparse matrices, but H2, in view of the resulting satisfactory coding sparse matrix]To H2m -1]After any matrix in the above-mentioned method is determined, the other matrixes can be uniquely determined, so that in this embodiment, H [2] satisfying the replacement rule can be determined first by computer deduction]And then based on the determined H2]Sequentially determining H [3] satisfying the replacement rule]To H2m -1]And the implementation is convenient.
For ease of illustration, the Galois field GF (2) is power 33) For example, the primitive polynomial is set to GF (2)3)=x3+x+1
Then H1]=
Figure 430995DEST_PATH_IMAGE008
,H[0]=
Figure 714077DEST_PATH_IMAGE009
And for example, in one particular case, H2 determined by computer deduction to satisfy the replacement rule]=
Figure 22086DEST_PATH_IMAGE010
. H3 can be obtained by analogy]To H [7 ]]。
As described above, the determined coding matrix for RS encoding may be a coding matrix based on a vandermonde matrix or a coding matrix based on a cauchy matrix, and may be expressed as:
Figure 621695DEST_PATH_IMAGE011
formula (4)
Taking the coding matrix based on the vandermonde matrix in equation (4) as an example, H [1] is determined]And H2]Thus, the desired H3 can be determined]=H[1
Figure 229394DEST_PATH_IMAGE004
2]= H[1]
Figure 671876DEST_PATH_IMAGE004
H[2]=
Figure 390434DEST_PATH_IMAGE012
. Based on addition and multiplication in Galois field, H4 can be obtained in turn]To H [7 ]]Wherein H4 is obtained]=
Figure 110128DEST_PATH_IMAGE013
Whereas the coding matrix based on the vandermonde matrix in equation (4) requires the use of GF (9), and thus can pass through H [9 ]]=H[3]*H[3]=
Figure 13362DEST_PATH_IMAGE014
I.e. determine H [9 ]]=
Figure 818507DEST_PATH_IMAGE015
Therefore, in this example, according to a preset replacement rule, 9 elements in the coding matrix are replaced with corresponding matrices, and the obtained coding sparse matrix is represented as:
Figure 465389DEST_PATH_IMAGE016
the encoding of the data to be encoded by using the encoding sparse matrix can be represented as:
Figure 774011DEST_PATH_IMAGE017
formula (5)
Step S104: and coding the data to be coded by the coding sparse matrix to obtain coded data, so that the process of coding the data to be coded by the coding sparse matrix is completed in the circuit through the exclusive OR circuit and the selection circuit.
Because the encoding sparse matrix only comprises the number 1 and the number 0, when the encoding of the data to be encoded is carried out through the encoding sparse matrix, in the circuit, the process of carrying out the encoding of the data to be encoded through the encoding sparse matrix can be completed through the exclusive-or circuit and the selection circuit.
Taking the calculation of the first row of equation (5) in the above embodiment as an example, the arithmetic circuit can be specifically shown in fig. 2, and it can be seen that d1, d4 and d7 can be selected by the selection circuit and further exclusive-ored by the exclusive-or circuit, and the XOR in fig. 2 represents the exclusive-or circuit required for the calculation of the row.
Step S105: and combining the coded data and the data to be coded into coded data.
As can be seen from the above description, after the encoded data is obtained by encoding, the encoded data and the data to be encoded may be combined into encoded data. Of course, referring to equation (1), the encoding matrix is combined with the identity matrix, so as to directly obtain encoded data including encoded data and data to be encoded. In the scheme of the application, the same holds trueAfter obtaining the coding sparse matrix according to the preset replacement rule, for example, obtaining the coding sparse matrix as in formula (5)
Figure 989091DEST_PATH_IMAGE018
And then combined with an identity matrix so that after multiplication with the data to be encoded, the result is encoded data comprising the encoded data and the data to be encoded.
In an embodiment of the present invention, the method may further include:
receiving data to be decoded;
determining an inverse matrix of the encoding matrix;
replacing each element in the inverse matrix of the coding matrix with a corresponding matrix according to a replacement rule to obtain a decoding sparse matrix; decoding the sparse matrix comprises only a number 1 and a number 0;
and decoding the data to be decoded based on the decoding sparse matrix to obtain the decoded data, so that the process of decoding the data to be decoded based on the decoding sparse matrix is completed in the circuit through the exclusive OR circuit and the selection circuit to obtain the decoded data.
The foregoing is an example of an encoding process, and in this embodiment, a decoding process is described, which is consistent with the encoding process in principle, and when decoding is performed, decoding can be completed in a circuit through an exclusive-or circuit and a selection circuit.
In decoding, an inverse matrix of the encoding matrix needs to be used, and similarly, each element in the inverse matrix of the encoding matrix needs to be replaced by a corresponding matrix to obtain a decoding sparse matrix. Similar to the formula (3) in the above embodiment, after the decoding sparse matrix is combined with the identity matrix and multiplied by the data to be decoded, the obtained result is the original data to be encoded, or is called as the original data obtained after decoding.
Of course, in the above embodiment, the replacement relationship between each element and the corresponding matrix has been determined during encoding, so that during decoding, each element in the inverse matrix of the encoding matrix is replaced by the corresponding matrix directly according to the replacement rule determined during encoding, and thus a decoding sparse matrix can be obtained, and a description thereof will not be repeated.
By applying the technical scheme provided by the embodiment of the invention, aiming at the operational characteristics of the Galois field, the coding matrix for RS coding and the Galois field GF (2) used by the RS coding are determinedm) And then, replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix, namely mapping the operational relation of the Galois field through the coding sparse matrix so that the Galois field operation can be directly realized through the coding sparse matrix. Therefore, the replacement rule needs to satisfy: the four operations performed by element a and element b in galois are equivalent to the four operations performed by matrix h (a) and matrix h (b) in galois. After the coding sparse matrix is obtained, the coding sparse matrix only comprises a number 1 and a number 0, so that in the process of coding the data to be coded through the coding sparse matrix, the coding process can be completed only through an exclusive OR circuit and a selection circuit in a circuit, a traditional Galois field operation module can be omitted, and the hardware implementation has the advantage of high speed. To sum up, the scheme of the application can be used for coding data, so that the redundant storage of the data is effectively realized, the high efficiency of calculation is ensured, and the hardware implementation has the advantage of high speed.
Corresponding to the above method embodiments, the embodiments of the present invention further provide a data storage system, which can be referred to in correspondence with the above.
Referring to fig. 3, a schematic structural diagram of a data storage system in the present invention is shown, including:
a to-be-encoded data receiving module 301, configured to receive to-be-encoded data;
a code matrix determination module 302 for determining a code matrix for RS encoding and a Galois field GF (2) used for RS encodingm) M is a positive integer;
the equivalent replacement module 303 is configured to replace each element in the coding matrix with a corresponding matrix according to a preset replacement rule, so as to obtain a coding sparse matrix; wherein the replacement rule satisfies: the four arithmetic operations of the element a and the element b in the galois field are equivalent to the four arithmetic operations of the matrix h (a) and the matrix h (b) in the galois field, a and b are both arbitrary elements in the coding matrix, h (a) and h (b) are the matrices for replacing a and for replacing b, respectively, the coding sparse matrix only includes the number 1 and the number 0;
the execution module 304 is configured to perform encoding on the data to be encoded through the encoding sparse matrix to obtain encoded data, so that the process of performing encoding on the data to be encoded through the encoding sparse matrix is completed through the xor circuit and the selection circuit in the circuit, and the encoded data and the data to be encoded are combined into encoded data.
In an embodiment of the present invention, the equivalent replacing module 303 is specifically configured to:
determining H2 meeting the replacement rule through computer deduction according to the preset replacement rule;
based on determined H2]Sequentially determining H [3] satisfying the replacement rule]To H2m -1];
And replacing each element in the coding matrix with a corresponding matrix to obtain a coding sparse matrix.
In a specific embodiment of the present invention, the replacement rule specifically includes:
h0 is a matrix of all 0's of m x m;
h1 is an m × m identity matrix;
H[a
Figure 140587DEST_PATH_IMAGE004
b]= H[a]
Figure 466526DEST_PATH_IMAGE005
H[b];
H[a
Figure 895233DEST_PATH_IMAGE006
b]= H[a]
Figure 405849DEST_PATH_IMAGE006
H[b]= H[z];
H[a÷b]= H[a]÷H[b]= H[q];
H[a]
Figure 920007DEST_PATH_IMAGE006
H[b]= H[b]
Figure 908692DEST_PATH_IMAGE006
H[a]
H[a]
Figure 191905DEST_PATH_IMAGE006
H[a]-1= H[1];
wherein, a
Figure 14368DEST_PATH_IMAGE004
b denotes the addition of the element a and the element b in the Galois field, a
Figure 874877DEST_PATH_IMAGE006
b denotes the multiplication of the element a and the element b in the galois field, z denotes the calculation of the multiplication, a ÷ b denotes the division of the element a and the element b in the galois field, and q denotes the calculation of the division.
In one embodiment of the present invention, the Galois field used for RS encoding is GF (2)8)。
In one embodiment of the present invention, the coding matrix used for RS coding is a coding matrix of a vandermonde matrix or a coding matrix of a cauchy matrix.
In an embodiment of the present invention, the decoding module is configured to:
receiving data to be decoded;
determining an inverse matrix of the encoding matrix;
replacing each element in the inverse matrix of the coding matrix with a corresponding matrix according to a replacement rule to obtain a decoding sparse matrix; decoding the sparse matrix comprises only a number 1 and a number 0;
and decoding the data to be decoded based on the decoding sparse matrix to obtain the decoded data, so that the process of decoding the data to be decoded based on the decoding sparse matrix is completed in the circuit through the exclusive OR circuit and the selection circuit to obtain the decoded data.
Corresponding to the above method and system embodiments, the present invention also provides a data storage device and a computer readable storage medium, which can be referred to in correspondence with the above. The computer readable storage medium has a computer program stored thereon, which when executed by a processor implements the steps of the data storage method in any of the above embodiments. A computer-readable storage medium as referred to herein may include 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 data storage device may include:
a memory for storing a computer program;
a processor for executing a computer program to implement the steps of the data storage method as in any of the above embodiments.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (8)

1. A method of storing data, comprising:
receiving data to be encoded;
determining a coding matrix for RS encoding and a Galois field GF (2) used for said RS encodingm) M is a positive integer;
replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix; wherein the replacement rule satisfies: four arithmetic operations performed by elements a and b in the galois field, equivalent to four arithmetic operations performed by matrices h (a) and h (b), a and b being any elements in the coding matrix, h (a) and h (b) being matrices for replacing a and for replacing b, respectively, the coding sparse matrix comprising only the number 1 and the number 0;
coding the data to be coded through the coding sparse matrix to obtain coded data, so that the process of coding the data to be coded through the coding sparse matrix is completed through an exclusive OR circuit and a selection circuit in a circuit;
combining the coded data and the data to be coded into coded data;
the replacement rule specifically includes:
h0 is a matrix of all 0's of m x m;
h1 is an m × m unit matrix;
H[a
Figure 491451DEST_PATH_IMAGE001
b]= H[a]
Figure 2067DEST_PATH_IMAGE002
H[b];
H[a
Figure 516225DEST_PATH_IMAGE003
b]= H[a]
Figure 380276DEST_PATH_IMAGE003
H[b]= H[z];
H[a÷b]= H[a]÷H[b]= H[q];
H[a]
Figure 53703DEST_PATH_IMAGE003
H[b]= H[b]
Figure 345007DEST_PATH_IMAGE003
H[a]
H[a]
Figure 346461DEST_PATH_IMAGE003
H[a]-1= H[1];
wherein, a
Figure 138836DEST_PATH_IMAGE001
b denotes an addition operation of the element a and the element b in the Galois field, a
Figure 542136DEST_PATH_IMAGE003
b represents a multiplication operation of the element a and the element b in the galois field, z represents a calculation result of the multiplication operation, a ÷ b represents a division operation of the element a and the element b in the galois field, and q represents a calculation result of the division operation.
2. The data storage method according to claim 1, wherein replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix, comprises:
determining H2 meeting the replacement rule through computer deduction according to the preset replacement rule;
based on determined H2]Sequentially determining H [3] satisfying the replacement rule]To H2m -1];
And replacing each element in the coding matrix with a corresponding matrix to obtain a coding sparse matrix.
3. The data storage method of claim 1, wherein the Galois field used for the RS encoding is GF (2)8)。
4. The data storage method according to claim 1, wherein the encoding matrix for RS encoding is an encoding matrix of a vandermonde matrix or an encoding matrix of a cauchy matrix.
5. The data storage method of any of claims 1 to 4, further comprising:
receiving data to be decoded;
determining an inverse matrix of the coding matrix;
replacing each element in the inverse matrix of the coding matrix with a corresponding matrix according to the replacement rule to obtain a decoding sparse matrix; the decoding sparse matrix comprises only a number 1 and a number 0;
and decoding the data to be decoded based on the decoding sparse matrix to obtain decoded data, so that the process of decoding the data to be decoded based on the decoding sparse matrix to obtain the decoded data is completed in a circuit through an exclusive OR circuit and a selection circuit.
6. A data storage system, comprising:
the receiving module of the data to be coded, is used for receiving the data to be coded;
a code matrix determination module for determining a code matrix for RS encoding and a Galois field GF (2) used by the RS encodingm) M is a positive integer;
the equivalent replacement module is used for replacing each element in the coding matrix with a corresponding matrix according to a preset replacement rule to obtain a coding sparse matrix; wherein the replacement rule satisfies: four arithmetic operations performed by elements a and b in the galois field, equivalent to four arithmetic operations performed by matrices h (a) and h (b), a and b being any elements in the coding matrix, h (a) and h (b) being matrices for replacing a and for replacing b, respectively, the coding sparse matrix comprising only the number 1 and the number 0;
the execution module is used for coding the data to be coded through the coding sparse matrix to obtain coded data, so that the process of coding the data to be coded through the coding sparse matrix is completed through an exclusive OR circuit and a selection circuit in a circuit;
the encoding completion module is used for combining the encoded data and the data to be encoded into encoded data;
the replacement rule specifically includes:
h0 is the matrix of all 0 of m multiplied by m;
h1 is an m × m identity matrix;
H[a
Figure 394554DEST_PATH_IMAGE001
b]= H[a]
Figure 73185DEST_PATH_IMAGE002
H[b];
H[a
Figure 544617DEST_PATH_IMAGE003
b]= H[a]
Figure 536844DEST_PATH_IMAGE003
H[b]= H[z];
H[a÷b]= H[a]÷H[b]= H[q];
H[a]
Figure 825743DEST_PATH_IMAGE003
H[b]= H[b]
Figure 801789DEST_PATH_IMAGE003
H[a]
H[a]
Figure 545754DEST_PATH_IMAGE003
H[a]-1= H[1];
wherein, a
Figure 48280DEST_PATH_IMAGE001
b denotes an addition operation of the element a and the element b in the Galois field, a
Figure 852288DEST_PATH_IMAGE003
b represents a multiplication operation of the element a and the element b in the galois field, z represents a calculation result of the multiplication operation, a ÷ b represents a division operation of the element a and the element b in the galois field, and q represents a calculation result of the division operation.
7. A data storage device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the data storage method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the data storage method according to any one of claims 1 to 5.
CN202210371393.1A 2022-04-11 2022-04-11 Data storage method, system, equipment and storage medium Active CN114465627B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210371393.1A CN114465627B (en) 2022-04-11 2022-04-11 Data storage method, system, equipment and storage medium
PCT/CN2022/115724 WO2023197506A1 (en) 2022-04-11 2022-08-30 Data storage method, system and device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210371393.1A CN114465627B (en) 2022-04-11 2022-04-11 Data storage method, system, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114465627A CN114465627A (en) 2022-05-10
CN114465627B true CN114465627B (en) 2022-07-08

Family

ID=81417627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210371393.1A Active CN114465627B (en) 2022-04-11 2022-04-11 Data storage method, system, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN114465627B (en)
WO (1) WO2023197506A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114465627B (en) * 2022-04-11 2022-07-08 苏州浪潮智能科技有限公司 Data storage method, system, equipment and storage medium
CN117254823B (en) * 2023-11-20 2024-03-15 苏州联讯仪器股份有限公司 Parallel RS encoding method, device and system and computer storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000124813A (en) * 1998-10-20 2000-04-28 Texas Instr Japan Ltd Device and method for reed solomon encoding and decoding
CN101587433B (en) * 2008-05-22 2011-09-21 中兴通讯股份有限公司 Method and system for implementing Galois Field based on multilevel search table
CN103092816A (en) * 2013-02-05 2013-05-08 苏州威士达信息科技有限公司 Generating device and generating method of constant coefficient matrixes in parallel reed solomon (RS) codes
CN111697976B (en) * 2020-05-28 2023-01-06 苏州浪潮智能科技有限公司 RS erasure correcting quick decoding method and system based on distributed storage
CN113300718B (en) * 2021-05-20 2024-04-09 南京大学 Encoding method, decoding method, encoding device, and decoding device
CN113810062B (en) * 2021-11-17 2022-04-12 南京风兴科技有限公司 GEL coding method and device facing next generation Ethernet
CN114465627B (en) * 2022-04-11 2022-07-08 苏州浪潮智能科技有限公司 Data storage method, system, equipment and storage medium

Also Published As

Publication number Publication date
WO2023197506A1 (en) 2023-10-19
CN114465627A (en) 2022-05-10

Similar Documents

Publication Publication Date Title
CN114465627B (en) Data storage method, system, equipment and storage medium
US8745461B2 (en) Method and apparatus for N+1 packet level mesh protection
US8694872B2 (en) Extended bidirectional hamming code for double-error correction and triple-error detection
US20050188292A1 (en) Method and apparatus for encoding special uncorrectable errors in an error correction code
US20150222292A1 (en) Multi-bit error correction method and apparatus based on a bch code and memory system
CA2493610A1 (en) Multi-dimensional data protection and mirroring method for micro level data
US20200081778A1 (en) Distributed storage system, method and apparatus
US20100299575A1 (en) Method and system for detection and correction of phased-burst errors, erasures, symbol errors, and bit errors in a received symbol string
CN113297001B (en) RAID (redundant array of independent disks) coding and decoding method and coding and decoding circuit
CN107239362B (en) Parallel CRC (Cyclic redundancy check) code calculation method and system
CN114153651B (en) Data encoding method, device, equipment and medium
CN113297000A (en) RAID (redundant array of independent disks) coding circuit and coding method
US20050149834A1 (en) (18, 9) Error correction code for double error correction and triple error detection
CN111682874A (en) Data recovery method, system, equipment and readable storage medium
US7366969B2 (en) System and method for implementing a Reed Solomon multiplication section from exclusive-OR logic
GB2136994A (en) Encoder verifier
US6405339B1 (en) Parallelized programmable encoder/syndrome generator
CN115113816A (en) Erasure code data processing system, method, computer device and medium
KR20190041390A (en) Bose-chaudhuri-hocquenghem (bch) encoding and decoding method tailored for refundant array of inexpensive disks(raid), and apparatus there-of
WO2009018184A1 (en) Syndrome-error mapping method for decoding linear and cyclic codes
CN115037415A (en) Error correction coding method, device and terminal based on CRC
CN113922825A (en) Low delay decoder for error correction codes
US9183076B2 (en) Using carry-less multiplication (CLMUL) to implement erasure code
CN114244376B (en) Data encoding method, system, device and medium
WO2024124709A1 (en) Data coding method, data decoding method, error correction method, memory controller, chip, and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant