Method for encoding mds array codes for triple or quadruple redundancy
By generating encoded data packets p, q, r and p′, q′, r′, s′, p″, q″, r″, s″, the limitations of the classic MDS array code in selecting the number of original data nodes k are solved, and wider applicability is achieved.
Patent Information
- Application Number
- CN202310302871.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-03-23
AI Technical Summary
Existing classic MDS array codes, such as EVENODD and RDP codes, have limitations in selecting the number of original data nodes k, which restricts their applicability.
A novel MDS array code encoding method is adopted. Encoded data packets p, q, r and p′, q′, r′, s′, p″, q″, r″, s″ are generated. Encoding operations are performed using binary coding coefficient matrices Ψj and Ψ′j. A suitable prime number L is selected to satisfy specific conditions. Encoded data packets are generated by combining XOR and cyclic shift operations.
While maintaining similar coding complexity, the range of choices for the number of original data nodes k is expanded, making the MDS array code more applicable and with a wider range of applications.
Smart Images

Figure CN116366073B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of data coding, and relates to a coding method of array code, and more particularly to a data coding method based on three redundancies and two kinds of four-redundancy MDS array codes. BACKGROUND
[0002] Under the guidance of the constantly developing information technology, the current big data development presents four characteristics: the total amount of information data is large, diverse, changeable and high-speed growth, especially with the rapid development of network technology, the total amount of data generated in various fields can reach ZB level. With the gradual expansion of the scale of the storage system, ensuring the data reliability is one of the main problems to be solved.
[0003] To prevent data loss caused by various hardware failures in the storage system, the storage management software used in the production environment uses some kind of data redundancy technology to protect the data. Data redundancy technology usually includes two kinds of multi-mirroring and erasure code technology. Multi-mirroring replicates data multiple times and distributes multiple copies on different nodes of the storage system. Only when all the storage nodes storing data copies fail at the same time will data loss occur, sacrificing storage efficiency to ensure data reliability. For example, Google's GFS and its open source version HDFS store three copies of each data, that is, any two nodes in the system fail at the same time and will not cause data loss. The basic idea of erasure code technology is to divide a piece of original data into k blocks, and calculate r blocks of redundant data based on the k blocks of original data. When any r blocks of data are wrong, the storage system can recover the k blocks of original data through the reconstruction algorithm, and the erasure code redundancy protection technology solves the problem that the traditional redundancy protection technology is not suitable for distributed storage systems. Erasure code technology mainly includes RS type erasure code and array erasure code. RS type erasure code involves complex finite field operations, resulting in high encoding and decoding calculation complexity. The encoding and decoding process of array erasure code only needs to use XOR and cyclic shift operations, and its operation complexity is much smaller than that of RS code.
[0004] The existing some classic MDS array codes (such as EVENODD code and RDP code) have the problem that the selection of the number k of original data nodes has limitations, thereby greatly reducing the practicability. SUMMARY
[0005] The purpose of the present application is to solve the technical problem that the classic MDS array code (such as EVENODD code and RDP code) has limitations in the selection of the number k of original data nodes while maintaining the similar encoding complexity of the classic MDS array code (such as EVENODD code and RDP code), and the present application provides a MDS array code coding method for three redundancies or four redundancies.
[0006] To achieve the above objectives, the present invention specifically adopts the following technical solution:
[0007] A method for encoding MDS array codes with triple or quadruple redundancy includes the following steps:
[0008] Step S1: Obtain k raw data packets and label each of the k raw data packets as m. j , 1≤j≤k, each data packet is represented by an M*(L-1) matrix;
[0009] Where M represents the number of rows in the data packet matrix, and (L-1) represents the number of columns in the data packet matrix;
[0010] Step S2: Obtain each of the original data packets m j The corresponding binary coding coefficient matrix Ψ j or Ψ j ′,Ψ j and Ψ′ j All are L*L matrices, and their representation is as follows:
[0011]
[0012]
[0013] Among them, I L Let C represent an L*L identity matrix. L Represents an L*L cyclic shift matrix This means shifting the L*L identity matrix column-wise to the right by j+1 positions.
[0014] Step S3: For each raw data packet m j Perform encoding operations; if for each raw data packet m j Perform triple-redundant MDS array code encoding operation, and execute step S4; if for each original data packet m j Perform the first type of quad-redundant MDS array code encoding operation, and execute step S5; if for each original data packet m j Perform the second type of quad-redundant MDS array code encoding operation, and execute step S6;
[0015] Step S4: Efficiently generate encoded data packets p, q, and r as defined below:
[0016]
[0017] Where G is composed of (L-1)*(L-1) identity matrix I L-1 The (L-1)*1 all-zero column vector is obtained by concatenating the columns, i.e., G = [I L-1 0 (L-1)*1] ; T represents a transpose operation on a matrix; G T represents the transpose of matrix G;
[0018] Step S5: efficiently generating the encoded data packets p', q', r' and s' defined as follows:
[0019]
[0020]
[0021] wherein H is obtained by juxtaposing the (L-l) * (L-l) unit matrix I L-1 and the 1 * (L-l) all-one row vector in rows, i.e. H = [I L-1 1 (L-1)*1 ] T ;
[0022] Step S6: efficiently generating the encoded data packets p", q", r" and s" defined as follows:
[0023]
[0024]
[0025] Preferably, in the step S3, the prime numbers L corresponding to the three encoding operations need to satisfy the following conditions respectively:
[0026] If the original data packet m j is subjected to the three-redundancy MDS array code encoding operation, the prime number L needs to satisfy one of the following conditions:
[0027] (1) 7 < L < 200, and L ≠ 31, 73, 127;
[0028] (2) any prime number L > 7, m L is even or L ≡ ±1 mod 8;
[0029] If the original data packet m j is subjected to the first four-redundancy MDS array code encoding operation, the prime number L needs to satisfy one of the following conditions:
[0030] (1) 7 < L < 200, and L ≠ 31, 73, 89, 127;
[0031] (2) any prime number L > 7, m L is even or L ≡ ±1 mod 8;
[0032] If the original data packet m j is subjected to the second four-redundancy MDS array code encoding operation, the prime number L needs to satisfy one of the following conditions:
[0033] (1) 7 < L < 200, and L≠ 17, 23, 31, 73, 89, 127, 151;
[0034] (2) L > 7 and m L = L - 1, or L > 23 and L≡±1 mod 8;
[0035] wherein m L is the order of L modulo 2.
[0036] Preferably, in the step S4, the method for efficiently generating the p, q and r three encoded data packets comprises the following steps:
[0037] Step S401: from j = 1, sequentially perform bitwise XOR on m j from j = 1 to (L - 2) to obtain p1, that is, first m1+m2, and then add the result to m3, and so on until m L-2 is added to obtain p1; similarly, from j = L - 1, sequentially perform bitwise XOR on m j from j = (L - 1) to k to obtain p2.
[0038] Step S402: the method for obtaining the encoded data packet p is p = p1 + p2.
[0039] Step S403: add a column of all 0 vectors to the right of m j and p2 to obtain m' j and p'2, that is, m' j = m j G, and p'2 = p2G.
[0040] Step 404: the method for obtaining the encoded data packet q is:
[0041] from j = 1, sequentially perform column right circular shift on m' j by j + 1 bits to obtain matrix x j , that is, obtain obtain q1 = p1 + x.
[0042] perform column right circular shift on p'2 by 1 bit to obtain z, that is, z = p'2C L G T ; from j = L - 1, sequentially perform column right circular shift on m' j by mod(j - L + 3, L) bits to obtain matrix y j , that is, obtain Get q2 = z + y;
[0043] Get q = q1 + q2;
[0044] Step 405: The method for obtaining the encoded data packet r is as follows:
[0045] Starting from j=1, proceed sequentially with j from 1 to (L-2) for m′. j Loop right by column mod(2(j+1), L) positions, then delete the last column of the resulting M*L matrix to obtain matrix x. j ,Right now Get Get r1 = p1 + x;
[0046] Rotate p′2 two columns to the right, then delete the last column of the resulting M*L matrix to obtain z. Starting from j = L-1, proceed sequentially with m′ according to the order of j from (L-1) to k. j Loop right by column mod(2(j-L+3), L) positions, then delete the last column of the resulting M*L matrix to obtain matrix y. j ,Right now Get Get r2 = z + y;
[0047] Get r = r1 + r2.
[0048] Preferably, in step S5, the method for efficiently generating four encoded data packets p′, q′, r′, and s′ includes the following steps:
[0049] Step S501: Starting from j=1, sequentially process m according to the order of j=1 to (L-2). j Perform a bitwise XOR operation to obtain p1; similarly, starting from j = L-1, perform XOR operations on m in the order of j = (L-1) to k. j Perform a bitwise XOR operation to obtain p2; add a column of all zeros to the right of p1 and p2 respectively, i.e., p1 = p1G, p2 = p2G;
[0050] Step S502: In m j Add a column of all zeros to the right of m' to get m' j , i.e. m′ j =m j G;
[0051] Step S503: The method for obtaining q3 is as follows:
[0052] Starting from j=1, proceed sequentially with j from 1 to (L-2) for m′. j Circulate column by column j+1 positions to the right to obtain an M*L matrix x j ,Right now Get q1 = p1 + x is obtained;
[0053] p2 is circularly shifted right by one column to obtain the matrix y of M*L, i.e. L ; from j = L-1, m' is sequentially processed in the order of j from (L-1) to k j , which is circularly shifted right by mod(j-L+3, L) columns to obtain the matrix q1 = p1 + x is obtained; q2 = y + z is obtained;
[0054] q3 = q1 + q2 is obtained;
[0055] In step S504, the method for obtaining r3 is as follows:
[0056] from j = 1, m' is sequentially processed in the order of j from 1 to (L-2) j , which is circularly shifted right by mod(2(j+1), L) columns to obtain the matrix x of M*L, i.e. j q1 = p1 + x is obtained; q2 = y + z is obtained; r1 = p1 + x is obtained;
[0057] p2 is circularly shifted right by two columns to obtain the matrix y of M*L, i.e. from j = L-1, m' is sequentially processed in the order of j from (L-1) to k j , which is circularly shifted right by mod(2(j-L+3), L) columns to obtain the matrix q1 = p1 + x is obtained; q2 = y + z is obtained;
[0058] r3 = r1 + r2 is obtained;
[0059] In step S505, the method for obtaining s3 is as follows:
[0060] from j = 1, m' is sequentially processed in the order of j from 1 to (L-2) j , which is circularly shifted right by mod(3(j+1), L) columns to obtain the matrix x of M*L, i.e. j q1 = p1 + x is obtained; q2 = y + z is obtained; s1 = p1 + q1 + r1 + x is obtained;
[0061] p2, q2, r2 are circularly shifted right by three columns, two columns and one column respectively to obtain the matrices y, m, n of M*L, i.e. n = r2C L ; from j = L-1, m' is sequentially processed in the order of j from (L-1) to k j , which is circularly shifted right by mod(3(j-L+3), L) columns to obtain the matrix obtaining obtaining s2 = y + m + n + z;
[0062] obtaining s3 = s1 + s2;
[0063] Step S506: obtaining the encoded data packets p', q', r', s' by the following method:
[0064] updating each element value of the (L-1)th column M-dimensional vector of q3 to the value of the element XORed with the element of the corresponding row of the last column M-dimensional vector, and deleting the last column M-dimensional vector of the matrix, to obtain a matrix g of M*(L-1), i.e. g = q3H; obtaining p' = p + g;
[0065] deleting the last column of q3, r3, s3, respectively, to obtain matrices f, h, t of M*(L-1), i.e. f = q3G T , h = r3G T , t = s3G T ; obtaining q' = f + h, r' = f + t, s' = f.
[0066] Preferably, in the step S6, the method for efficiently generating the four encoded data packets p", q", r", and s" includes the following steps:
[0067] Step S601: performing XOR operation on m j in sequence from j = 1 to (L-3) to obtain p1; similarly, performing XOR operation on m j in sequence from j = (L-2) to k to obtain p2;
[0068] Step S602: obtaining the encoded data packet p" by the following method: p" = p1 + p2;
[0069] Step S603: adding a column of all-0 vectors to the right of m j to obtain m' j , i.e. m' j = m j G; adding a column of all-0 vectors to the right of p2 to obtain p'2, i.e. p'2 = p2G;
[0070] Step 604: obtaining the encoded data packet q" by the following method:
[0071] performing column-wise right circular shift of m' j by j+2 positions from j = 1 to (L-3), and then deleting the last column of the obtained M*L matrix to obtain a matrix x j , i.e. obtaining q1 = p1 + x is obtained;
[0072] p'2 is circularly shifted right by one column, and the last column of the obtained M*L matrix is deleted to obtain z, i.e. L G T ; m' is sequentially processed in the order of j from (L-2) to k starting from j = L-2 j is circularly shifted right by mod(j-L+4, L) columns in the column direction, and the last column of the obtained M*L matrix is deleted to obtain matrix y j , i.e. q1 = p1 + x is obtained; q2 = z + y is obtained;
[0073] q" = q1 + q2 is obtained;
[0074] Step 605: The method for obtaining the encoded data packet r" is:
[0075] m' is sequentially processed in the order of j from 1 to (L-3) starting from j = 1 j is circularly shifted right by mod(2(j+2), L) columns in the column direction, and the last column of the obtained M*L matrix is deleted to obtain matrix x j , i.e. q1 = p1 + x is obtained; r1 = p1 + x is obtained;
[0076] p'2 is circularly shifted right by 2 columns in the column direction, and the last column of the obtained M*L matrix is deleted to obtain z, i.e. m' is sequentially processed in the order of j from (L-2) to k starting from j = L-2 j is circularly shifted right by mod(2(j-L+4), L) columns in the column direction, and the last column of the obtained M*L matrix is deleted to obtain matrix y j , i.e. q1 = p1 + x is obtained; r2 = z + y is obtained;
[0077] r" = r1 + r2 is obtained;
[0078] Step 606: The method for obtaining the encoded data packet s" is:
[0079] m' is sequentially processed in the order of j from 1 to (L-3) starting from j = 1 j is circularly shifted right by mod(3(j+2), L) columns in the column direction, and the last column of the obtained M*L matrix is deleted to obtain matrix x j , i.e. q1 = p1 + x is obtained; s1 = p1 + q1 + r1 + x is obtained;
[0080] Add a column of all 0s to the right of q2 and r2 to get q'2 and r'2, i.e., q'2 = q2G, r'2 = r2G;
[0081] Rotate p'2, q'2, r'2 right by 3, 2 and 1 positions respectively, and delete the last column of the resulting M*L matrix to get z, t, w, i.e. w = r'2C L G T ; from j = L-2, in order of j from (L-2) to k, m' j Rotate right by mod(3(j-L+4), L) positions, and delete the last column of the resulting M*L matrix to get matrix y j , i.e. Get Get s2 = z + t + w + y;
[0082] Get s" = s1 + s2.
[0083] The beneficial effects of the present application are as follows:
[0084] The technical solution of the present application can realize three-redundant or four-redundant MDS array code encoding. As shown in Figure 2 , while maintaining the same encoding complexity as the classic MDS array code (such as EVENODD code, RDP code), the selectable range of the number of original data nodes k is nearly twice that of the EVENODD code and RDP code. Therefore, compared with the classic MDS array code, it has stronger usability and wider application range. BRIEF DESCRIPTION OF DRAWINGS
[0085] Figure 1 is a flowchart of the present application;
[0086] Figure 2 is a comparison diagram of the selection range of the number of original data nodes k and the number of required XOR operations per bit of data of the classic MDS array code EVENODD code, RDP code and the three array codes proposed in this paper;
[0087] Figure 3 is a data structure diagram of Example 1;
[0088] Figure 4 is a data structure diagram of Example 2;
[0089] Figure 5 is a data structure diagram of Example 3; DETAILED DESCRIPTION
[0090] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will be combined with the accompanying drawings for the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations.
[0091] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0092] Embodiment 1
[0093] As Figure 1 shown in FIG. 3, the present embodiment provides an encoding method for a three-redundant MDS array code, and specifically, the data involved in the method are all vector data, and the method comprises the following steps.
[0094] Step S1: selecting L as 11, obtaining k = 2*L-4 = 18 original data packets, and marking the 18 original data packets as m j , 1≤j≤18, each data packet is represented by an M*(L-1) matrix, wherein M represents the number of rows of the data packet matrix, and (L-1) represents the number of columns of the data packet matrix.
[0095] Step S2: obtaining a binary encoding coefficient matrix Ψ j corresponding to each original data packet m j The binary encoding coefficient matrix Ψ j is an L*L matrix, and the specific representation form is as follows:
[0096]
[0097]
[0098]
[0099]
[0100]
[0101] Wherein, C 11 represents a cyclic shift matrix
[0102] Step S3: obtaining a binary encoding coefficient matrix Ψ jThe three-redundancy MDS array code encoding operation is performed, and step S4 is executed.
[0103] Step S4: efficiently generating the encoding data packets p, q and r defined as follows:
[0104]
[0105] wherein G is obtained by juxtaposing column-wise a 10*10 unit matrix I 10 and a 10*1 all-zero column vector, i.e. G=[I 10 0 10*1 ];
[0106] In step S4 of the embodiment, the method for efficiently generating the three encoding data packets p, q and r includes the following steps:
[0107] Step S401: obtaining p1=m1+m2+m3+m4+m5+m6+m7+m8+m9; obtaining p2=m 10 +m 11 +m 12 +m 13 +m 14 +m 15 +m 16 +m 17 +m 18 ; and the method for obtaining the encoding data packet p is p=p1+p2.
[0108] Step S402: adding a column of all-zero vectors to the right of m j and p2 respectively to obtain m′ j and p′2, i.e. m′ j =m j G, p′2=p2G.
[0109] Step 403: the method for obtaining the encoding data packet q is:
[0110] Circulating column-wise the m′1 to m′9 to the right by the corresponding number of bits and deleting the last column to obtain the corresponding x j , 1≤j≤9, and the specific expression is Obtaining Obtaining q1=p1+x1.
[0111] Circulating column-wise p′2 to the right by 1 bit, and then deleting the last column of the obtained M*L matrix to obtain z, i.e. z=p′2C 11 G T ; circulating column-wise the m′ 10 to m′ 18 to the right by the corresponding number of bits and deleting the last column to obtain the corresponding x j10≤j≤18, specifically represented as Get Get q2 = z + x2;
[0112] Get q = q1 + q2;
[0113] Step 404: The method for obtaining the encoded data packet r is as follows:
[0114] Loop through the columns from m′1 to m′9 to the right, corresponding to the digits, and delete the last column to obtain the corresponding y. j , 1≤j≤9, specifically represented as Get Get r1 = p1 + y1;
[0115] Rotate p′2 two columns to the right, then delete the last column of the resulting M*L matrix to obtain z. m′ 10 to m′ 18 Loop through the corresponding digits to the right column by column and delete the last column to get the corresponding y. j 10≤j≤18, specifically represented as Get Get r2 = z + y2;
[0116] Get r = r1 + r2.
[0117] Based on the previous calculation of p, Figure 3 The inter-packet XOR results p1 and p2 of the original data packet corresponding to the black circular node have been obtained when generating the encoded data packet p and can be used directly. That is, the intermediate data generated when calculating p by this method can be used to calculate q and r, reducing the XOR operation and thus reducing the complexity.
[0118] Example 2
[0119] like Figure 1 As shown in Figure 4, this embodiment provides an encoding method for quad-redundant MDS array codes. It is particularly noteworthy that the data involved in this method are all vector data. The method includes the following steps:
[0120] Step S1: Select L as 11, obtain k = 2 * L - 4 = 18 raw data packets, and label the 18 raw data packets as m. j , 1≤j≤18, each data packet is represented by an M*(L-1) matrix, where M represents the number of rows in the data packet matrix and (L-1) represents the number of columns in the data packet matrix.
[0121] Step S2: obtaining each original data packet m j The corresponding binary coding coefficient matrix Ψ j , binary coding coefficient matrix Ψ j is an L*L matrix, and the specific expression is as follows:
[0122]
[0123]
[0124]
[0125]
[0126]
[0127] Step S3: performing the first four-redundancy MDS array code encoding operation on each original data packet m j , and executing step S5.
[0128] Step S5: efficiently generating the coded data packets p', q', r' and s' defined as follows:
[0129]
[0130]
[0131] wherein H is obtained by juxtaposing a 10*10 unit matrix I 10 and a 1*10 all-1 row vector in rows, i.e. H = [I 10 1 10*1 ] T .
[0132] In step S5 of the embodiment, the method for efficiently generating the four coded data packets p', q', r' and s' includes the following steps:
[0133] Step S501: obtaining p1 = m1+m2+m3+m4+m5+m6+m7+m8+m9; obtaining p2 = m 10 +m 11 +m 12 +m 13 +m 14 +m 15 +m 16 +m 17 +m 18 ; obtaining p the method for obtaining p is p = p1+p2; adding a column of all-0 vectors to the right side of p1 and p2 respectively, i.e. p1 = p1G, p2 = p2G;
[0134] Step S502: In m j Add a column of all zeros to the right of m' to get m' j , i.e. m′ j =m j G;
[0135] Step S503: The method for obtaining q3 is as follows:
[0136] By rotating m′1 to m′9 right column by column, we obtain the corresponding x. j , 1≤j≤9, specifically represented as Get Get q1 = p1 + x1;
[0137] Circling p2 one column to the right, we get an M*L matrix z, i.e., z = p2C 11 ; will m′ 10 to m′ 18 By looping right through the columns, we obtain the corresponding x. j 10≤j≤18, specifically represented as Get Get q2 = z + x2;
[0138] Get q3 = q1 + q2;
[0139] Step S504: The method for obtaining r3 is as follows:
[0140] By rotating m′1 to m′9 right column by column, we obtain the corresponding y. j , 1≤j≤9, specifically represented as Get Get r1 = p1 + y1;
[0141] Circulate p2 two columns to the right to obtain an M*L matrix z, i.e. m′ 10 to m′ 18 By looping right through the columns, we obtain the corresponding y. j 10≤j≤18, specifically represented as Get Get r2 = z + y2;
[0142] Get r3 = r1 + r2;
[0143] Step S505: The method for obtaining s3 is as follows:
[0144] By rotating m′1 to m′9 right column by column, we obtain the corresponding w. j , 1≤j≤9, specifically represented as Get Get s1 = p1 + q1 + r1 + w1;
[0145] Rotate p2, q2, and r2 column-wise to the right by 3, 2, and 1 positions respectively to obtain an M*L matrix y, m, n. n = r2C 11 ; will m′ 10 to m′ 18 By looping right through the columns, we obtain the corresponding w. j 10≤j≤18, specifically represented as Get Get s2 = y + m + n + w2;
[0146] Get s3 = s1 + s2;
[0147] Step S506: The method for obtaining the encoded data packets p′, q′, r′, and s′ is as follows:
[0148] Update each element value of the first 10 columns of the M-dimensional vector q3 to the value of the bitwise XOR of the element with the element of the corresponding row of the last column of the M-dimensional vector, and delete the last column of the M-dimensional vector of the matrix to obtain an M*(L-1) matrix g, i.e. g = q3H; obtain p′ = p + g;
[0149] Deleting the last column of q3, r3, and s3 yields M*(L-1) matrices f, h, and t, respectively, i.e., f = q3G. T h = r3G T , t = s3G T ; Obtain q′=f+h, r′=f+t, s′=f.
[0150] Example 3
[0151] like Figure 1 As shown in Figure 5, this embodiment provides another encoding method for quad-redundant MDS array codes. It is worth noting that the data involved in this method are all vector data. The method includes the following steps:
[0152] Step S1: Select L=11, obtain k=2*L-6=16 raw data packets, and label the 16 raw data packets as m. j , 1≤j≤16, each data packet is represented by an M*(L-1) matrix, where M represents the number of rows in the data packet matrix and (L-1) represents the number of columns in the data packet matrix.
[0153] Step S2: obtaining each original data packet m j The corresponding binary coding coefficient matrix Ψ' j The binary coding coefficient matrix Ψ' j is an L*L matrix, and the specific expression is as follows:
[0154]
[0155]
[0156]
[0157]
[0158] Step S3: performing a second four-redundancy MDS array code encoding operation on each original data packet m j Step S6.
[0159] Step S6: efficiently generating the coded data packets p'', q'', r'', and s'' defined as follows:
[0160]
[0161]
[0162] In step S6 described in the embodiment, the method for efficiently generating four coded data packets includes the following steps:
[0163] Step S601: obtaining p1 = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8; obtaining p2 = m9 + m 10 + m 11 + m 12 + m 13 + m 14 + m 15 + m 16 ; and the method for obtaining the coded data packet p'' is p'' = p1 + p2.
[0164] Step S602: adding a column of all-0 vectors to the right of m j to obtain m' j , i.e., m' j = m j G; adding a column of all-0 vectors to the right of p2 to obtain p'2, i.e., p'2 = p2G.
[0165] Step 603: the method for obtaining the coded data packet q'' is:
[0166] The m'1 to m'8 are right-circulated by column according to the corresponding number of bits and the last column is deleted to obtain the corresponding x j, 1≤j≤8, specifically represented as Get Get q1 = p1 + x1;
[0167] Circling p′2 one column to the right and deleting the last column yields an M*L matrix z, i.e., z = p′2C 11 G T ; from m′9 to m′ 16 Loop through the columns to the right to get the corresponding number of digits and delete the last column to obtain the corresponding x. j 9≤j≤16, specifically represented as Get Get q2 = z + x2;
[0168] Get q″ = q1 + q2;
[0169] Step 604: The method for obtaining the encoded data packet r″ is as follows:
[0170] Loop through m′1 to m′8 column by column, corresponding to the digits, and delete the last column to obtain the corresponding y. j , 1≤j≤8, specifically represented as Get Get r1 = p1 + y1;
[0171] Rotate p′2 two columns to the right, then delete the last column of the resulting M*L matrix to obtain z. From m′9 to m′ 16 Loop through the corresponding digits to the right column by column and delete the last column to get the corresponding y. j 9≤j≤16, specifically represented as Get Get r2 = z + y2;
[0172] Get r″ = r1 + r2;
[0173] Step 605: The method for obtaining the encoded data packet s″ is as follows:
[0174] Loop through m′1 to m′8 column by column, corresponding to the digits, and delete the last column to obtain the corresponding w. j , 1≤j≤8, specifically represented as Get Get s1 = p1 + q1 + r1 + w1;
[0175] Add a column of all 0s to the right of q2 and r2 to get q'2 and r'2, i.e. q'2 = q2G, r'2 = r2G;
[0176] Rotate p'2, q'2, r'2 right by 3, 2 and 1 bit respectively, and delete the last column of the resulting M*L matrix to get z, t, u, i.e. u = r'2C L G T ; rotate m'9 to m'15 right by corresponding number of bits and delete the last column to get corresponding w 16 j , 9≤j≤16, the specific expression is Get Get s2 = z + t + u + w2;
[0177] Get s" = s1 + s2.
[0178] Now some classic MDS array codes (such as EVNEODD code, RDP code) have the selection range of the corresponding original data node number k limited to L, L-1 respectively. The purpose of the above three embodiments is to eliminate this defect of the classic MDS array code, so that it can further expand the selection range of k to 2L-4, 2L-4, 2L-6 respectively while maintaining similar encoding complexity.
Claims
1. A method for three-redundancy or four-redundancy MDS array code encoding, characterized by, Includes the following steps: Step S1: obtaining k original data packets, marking the k original data packets as , respectively, each data packet being represented by an M*(L-1) matrix; Where M represents the number of rows in the data packet matrix, and (L-1) represents the number of columns in the data packet matrix; Step S2: obtaining each original data packet The corresponding binary coding coefficient matrix Both are L*L matrices, and the binary coding coefficient matrix The representation form of or is as follows: wherein denotes an L*L identity matrix, denotes an L*L circulant shift matrix , denotes a right circular shift of the L*L identity matrix by j+1 positions. Step S3: For each raw data packet Perform encoding operations; if for each raw data packet Perform triple-redundant MDS array code encoding operation, and execute step S4; if for each original data packet Perform the first type of quad-redundant MDS array code encoding operation, and execute step S5; if for each original data packet Perform the second type of quad-redundant MDS array code encoding operation, and execute step S6; Step S4: Efficiently generate encoded data packets p, q, and r as defined below: ;q= ; ; wherein G is obtained by juxtaposing column-wise (L-1)*(L-1) unit matrix and (L-1)*1 all-zero column vector, i.e. G=[ ]; denotes a transpose operation on a matrix; denotes the transpose of matrix G; Step S5: Efficiently generating an encoded data packet as defined below , , and ; ; ; ; ; where H is a (L-1) * (L-1) identity matrix and a 1 * (L-1) all-one row vector are concatenated by row, i.e., H = [ ; Step S6: Efficiently generating an encoded data packet as defined below , , and ; ; ; ; 。 2. The method for three or four redundancy MDS array code encoding according to claim 1, wherein, In step S3, the prime numbers L corresponding to the three encoding operations must respectively satisfy the following conditions: If the original data packet For triple-redundant MDS array encoding operations to be performed, the prime number L must satisfy one of the following conditions: ; If the original data packet For the first type of quad-redundant MDS array code encoding operation to be performed, the prime number L must satisfy one of the following conditions: ; If the original data packet For the second type of quad-redundant MDS array code encoding operation to be performed, the prime number L must satisfy one of the following conditions: ; ; 。 3. The encoding method for triple or quadruple redundant MDS array codes according to claim 1, characterized in that, In step S4, the method for efficiently generating the three encoded data packets p, q, and r includes the following steps: Step S401: Starting from j=1, proceed sequentially according to j=1 to (L-2) Perform bitwise XOR, that is, first The results obtained plus And so on until added to ,get Similarly, starting from j = L-1, proceed sequentially according to j = (L-1) to k. Perform a bitwise XOR operation to obtain ; Step S402: The method for obtaining the encoded data packet p is as follows: ; Step S403: In and Add a column of all zeros to the right of each to obtain , ,Right now , Step 404: The method for obtaining the encoded data packet q is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-2). Looping right by j+1 columns, then deleting the last column of the resulting M*L matrix yields the matrix. ,Right now ; obtain ; obtain ; Will By rotating one column to the right, and then deleting the last column of the resulting M*L matrix, we obtain z. Starting from j = L-1, proceed sequentially according to j from (L-1) to k. Loop right by column mod(j-L+3,L) positions, then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now ; obtain ; obtain ; Get ; Step 405: The method for obtaining the encoded data packet r is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-2). Loop right by mod(2(j+1), L) columns, then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now ; obtain ; obtain ; Will Rotate two columns to the right, then delete the last column of the resulting M*L matrix to obtain z. Starting from j = L-1, proceed sequentially according to j from (L-1) to k. Loop right by column mod(2(j-L+3),L), then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now Get ; obtain ; Get .
4. The encoding method for triple or quadruple redundant MDS array codes according to claim 1, characterized in that, In step S5, efficient generation , , and The method for encoding four data packets includes the following steps: Step S501: Starting from j=1, proceed sequentially according to j=1 to (L-2) Perform a bitwise XOR operation to obtain Similarly, starting from j = L-1, proceed sequentially according to j = (L-1) to k. Perform a bitwise XOR operation to obtain ;exist and Add a column of all zeros to the right side, i.e. , ; Step S502: In Add a column of all zeros to the right to get ,Right now ; Step S503: Obtain The method is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-2). Circulate column by column j+1 positions to the right to obtain an M*L matrix. ,Right now Get ; obtain ; Will Circulating one column to the right, we obtain an M*L matrix y, which is... Starting from j = L-1, proceed sequentially according to j from (L-1) to k. By looping right by column mod(j-L+3,L) positions, we obtain an M*L matrix. ; obtain ; obtain ; Get ; Step S504: Obtain The method is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-2). Looping right by column mod(2(j+1), L) positions, we get an M*L matrix. ,Right now Get ; obtain ; Will Circulating two columns to the right, we obtain an M*L matrix y, which is... Starting from j = L-1, proceed sequentially according to j from (L-1) to k. Looping right by column mod(2(j-L+3),L) positions, we get an M*L matrix. ; obtain ; obtain ; Get ; Step S505: Obtain The method is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-2). Looping right by column mod(3(j+1), L) positions, we get an M*L matrix. ,Right now Get ; obtain ; Will , , By looping right by 3, 2, and 1 columns respectively, we obtain an M*L matrix y, m, n, i.e. , , Starting from j = L-1, proceed sequentially according to j from (L-1) to k. Looping right by column mod(3(j-L+3),L) positions, we get an M*L matrix. ; obtain ; obtain ; Get ; Step S506: Obtain the encoded data packet , , , The method is as follows: Each element of the first (L-1) columns of the M-dimensional vector is updated by bitwise XORing the element with the corresponding element of the last column of the M-dimensional vector, and the last column of the M-dimensional vector is deleted, resulting in an M*(L-1) matrix. ,Right now ; obtain ; delete , , The last column yields M*(L-1) matrices f, h, t, respectively. , , ; obtain , , .
5. The encoding method for triple or quadruple redundant MDS array codes according to claim 1, characterized in that, In step S6, efficient generation , , and The method for encoding four data packets includes the following steps: Step S601: Starting from j = 1, sequentially process the values of j from 1 to (L-3). Perform a bitwise XOR operation to obtain Similarly, starting from j = L-2, proceed sequentially according to j = (L-2) to k. Perform a bitwise XOR operation to obtain ; Step S602: Obtain the encoded data packet The method is as follows: ; Step S603: In Add a column of all zeros to the right to get ,Right now ; exist Add a column of all zeros to the right to get ,Right now Step S604: Obtain the encoded data packet The method is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-3). Looping right by j+2 columns, then deleting the last column of the resulting M*L matrix yields the matrix. ,Right now ; obtain ; obtain ; Will By rotating one column to the right, and then deleting the last column of the resulting M*L matrix, we obtain z. Starting from j = L-2, proceed sequentially according to j from (L-2) to k. Loop right by column mod(j-L+4,L) positions, then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now ; obtain ; obtain ; Get ; Step S605: Obtain the encoded data packet The method is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-3). Loop right by column mod(2(j+2), L) positions, then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now ; obtain ; obtain ; Will Rotate two columns to the right, then delete the last column of the resulting M*L matrix to obtain z. Starting from j = L-2, proceed sequentially according to j from (L-2) to k. Loop right by column mod(2(j-L+4),L), then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now Get ; obtain ; Get ; Step S606: Obtain the encoded data packet The method is as follows: Starting from j = 1, proceed sequentially according to j = 1 to (L-3). Loop right by column mod(3(j+2), L) positions, then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now ; obtain ; obtain ; exist and Add a column of all zeros to the right of each to obtain , ,Right now , ; Will , , By looping right by 3, 2, and 1 columns respectively, and then deleting the last column of the resulting M*L matrix, we obtain z, t, and w respectively. , , Starting from j = L-2, proceed sequentially according to j from (L-2) to k. Loop right by column mod(3(j-L+4),L), then delete the last column of the resulting M*L matrix to obtain the matrix. ,Right now Get ; obtain ; Get .
Citation Information
Patent Citations
MDS (Maximum Distance Separable) array code coding for recovering multi-node invalidity and decoding method
CN107086870A
Triple-redundancy MDS array code compiling method for data recovery
CN114625571A