Encoding method and storage system

By encoding and matrix permutation of multiple codewords to be encoded, a hybrid optimal repair code is generated, which solves the problem of large bandwidth for parity bit repair in existing technologies, thereby reducing the amount of data block downloads and improving repair efficiency.

CN120950036BActive Publication Date: 2026-01-27LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511478764.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-01-27
Estimated Expiration
2045-10-16

AI Technical Summary

Technical Problem

In existing technologies, the parity bit repair of MDS codes cannot reduce the amount of data blocks downloaded, resulting in a large repair bandwidth.

Method used

By encoding multiple codewords to be encoded, a maximum distance separable code is generated. The parity bit matrix is ​​then permuted and loaded to form a hybrid optimal repair code. This allows data blocks of system bits and parity bits to repair each other, reducing the amount of data blocks downloaded during the repair process.

Benefits of technology

The reduced repair bandwidth decreased the number of data blocks that needed to be downloaded during the repair process, thus improving the efficiency of data repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950036B_ABST
    Figure CN120950036B_ABST
Patent Text Reader

Abstract

The application discloses an encoding method and a storage system, relates to the technical field of encoding, and comprises the following steps: a plurality of maximum distance separable codes are obtained by encoding a plurality of to-be-encoded code words, so that the check bits of the maximum distance separable codes comprise data blocks of system bits, the failure of a storage node corresponding to the system bits can be repaired by data of a storage node of the check bits, the symmetric elements on both sides of the main diagonal of a permutation matrix are overlapped with each other, the data blocks of the check bits of the maximum distance separable codes are updated, the failure of a storage node corresponding to the check bits can be repaired by data of a storage node corresponding to other check bits, in the repairing process, only part of the data blocks in the k storage nodes need to be downloaded to repair the data of the failed node, the data blocks in the k storage nodes do not need to be downloaded to repair the data of the failed node, the number of the data blocks required for repairing is greatly reduced, and the repairing bandwidth is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of coding technology, and in particular to data regeneration coding. Background Technology

[0002] Distributed storage systems (DSS) ensure high data reliability and availability by storing redundant data across multiple storage nodes. Maximum distance separable codes (MDS codes), such as Reed-Solomon codes (RS codes), are the mainstream technology for achieving this redundancy. A finite field F q An (n,k) MDS code of size q encodes k raw data blocks into n data blocks (k system blocks and r=nk parity blocks) and distributes them to n nodes, allowing for the failure of any r nodes without data loss. When a storage node fails, a repair process needs to be initiated, downloading data from other surviving nodes to repair the data on the failed node. Traditional MDS code repair requires downloading data equivalent to the complete data volume of k nodes, which incurs huge network bandwidth overhead, i.e., excessively high repair bandwidth (RB). Summary of the Invention

[0003] This application provides an encoding method and a storage system to at least solve the problem in related technologies where parity bit repair cannot reduce the download volume of data blocks, resulting in large repair bandwidth.

[0004] This application provides an encoding method, comprising: encoding multiple codewords to be encoded to obtain multiple maximum distance separable codes, wherein two codewords to be encoded correspond to one maximum distance separable code, and the parity bits of the maximum distance separable code include a data block of system bits; forming a parity bit matrix by assembling the data blocks of the parity bits of the multiple maximum distance separable codes; permuting the parity bit matrix to obtain a permutation matrix, and swapping the symmetrical elements on both sides of the main diagonal of the permutation matrix to obtain a swapping matrix; updating the data blocks of the parity bits of the multiple maximum distance separable codes one-to-one using the elements of the swapping matrix, and assembling the multiple updated maximum distance separable codes into a hybrid optimal repair code.

[0005] This application also provides an encoding device, comprising: an encoding module for encoding multiple codewords to be encoded to obtain multiple maximum distance separable codes, wherein two codewords to be encoded correspond to one maximum distance separable code, and the parity bits of the maximum distance separable code include a data block of system bits; a combination module for combining the data blocks of the parity bits of the multiple maximum distance separable codes into a parity bit matrix; a permutation module for permuting the parity bit matrix to obtain a permutation matrix, and combining the symmetrical elements on both sides of the main diagonal of the permutation matrix to obtain a binding matrix; and an update module for updating the data blocks of the parity bits of the multiple maximum distance separable codes one-to-one using the elements of the binding matrix, and combining the multiple updated maximum distance separable codes into a hybrid optimal repair code.

[0006] This application also provides a storage system, including: a plurality of storage nodes; a memory for storing a computer program; and a processor for executing the computer program to implement steps such as any encoding method.

[0007] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements steps as per any encoding method.

[0008] Through this application, the above encoding method obtains multiple maximum distance separable codes by encoding multiple codewords to be encoded. The parity bits of the maximum distance separable codes include data blocks of system bits, ensuring that the failure of the storage node corresponding to the system bit can be repaired through the data of the storage node corresponding to the parity bit. Symmetrical elements on both sides of the main diagonal of the permutation matrix are mutually coupled to update the data blocks of the parity bits of the maximum distance separable codes. This ensures that the storage nodes corresponding to other parity bits store the data blocks of the failed nodes, guaranteeing that the failure of the storage node corresponding to the parity bit can be repaired through the data of the storage nodes corresponding to other parity bits. Finally, the data blocks of each encoded bit of the hybrid optimal repair code can be distributed to the corresponding storage nodes. The repair process only requires downloading a portion of the data blocks from k storage nodes to repair the data of the failed node, without needing to download all the data blocks from k storage nodes. Here, k is the number of system bits, greatly reducing the number of data blocks required for repair, thereby reducing the repair bandwidth. This solves the problem of existing technologies where parity bit repair cannot reduce the amount of data blocks downloaded, resulting in high repair bandwidth. Attached Figure Description

[0009] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a hardware structure block diagram of the encoding method according to an embodiment of this application;

[0011] Figure 2 This is a flowchart of an encoding method according to an embodiment of this application;

[0012] Figure 3 This is a schematic diagram of a (9,6;2) maximum distance divisible code data block according to an embodiment of this application;

[0013] Figure 4 This is a schematic diagram of a (n,k;2) maximum distance separable data block according to an embodiment of this application;

[0014] Figure 5 This is a schematic diagram of a data block of a permutation matrix according to an embodiment of this application;

[0015] Figure 6 This is a schematic diagram of the linear transformation between codewords of a hybrid optimal repair code of three (9,6;2) according to an embodiment of this application;

[0016] Figure 7 This is a schematic diagram of a data block carrying a matrix according to an embodiment of this application;

[0017] Figure 8 This is a structural block diagram of an encoding device according to an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0019] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0020] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] The specific application environment architecture or specific hardware architecture on which the execution of the coding method depends is described here.

[0022] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of the encoding method according to an embodiment of this application. For example... Figure 1 As shown, the server device may include one or more ( Figure 1Only one is shown in the image. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), microprocessor (MCU), or programmable logic device (FPGA), etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0023] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the encoding method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0025] The embodiments of this application provide an encoding method, and the method is described in detail below in conjunction with the execution flow of the encoding method.

[0026] The following explains the technical terms used in this application:

[0027] MDSCode: Maximum Distance Separable Code;

[0028] RB: RepairBandwidth, which refers to the repair bandwidth.

[0029] This embodiment provides an encoding method. Figure 2 This is a flowchart of the encoding method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0030] Step S201: Encode multiple codewords to be encoded to obtain multiple maximum distance separable codes. Two codewords to be encoded correspond to one maximum distance separable code. The parity bits of the maximum distance separable code include the data block of the system bits.

[0031] Specifically, the k original data blocks of the two codewords to be encoded are respectively encoded into n data blocks to obtain a maximum distance separable code, namely (n,k;2) maximum distance separable code, where 2 is the number of packets, which is the number of data blocks distributed to the storage node. The codewords to be encoded can be data from terminal devices (e.g., data from mobile phones, computers, IoT devices), data from business service systems (e.g., data from servers), or data migrated from other storage systems.

[0032] Step S202: Combine the data blocks of multiple parity bits with maximum distance divisibility into a parity bit matrix;

[0033] Specifically, a data block containing one parity bit of a maximum distance divisible code is used as one row of a parity bit matrix, and a data block containing multiple parity bits of a maximum distance divisible code is used as one column of the parity bit matrix, thus forming a parity bit matrix.

[0034] Step S203: Permutate the parity matrix to obtain the permutation matrix, and swap the symmetrical elements on both sides of the main diagonal of the permutation matrix to obtain the swapping matrix;

[0035] Specifically, the parity bit matrix is ​​permuted to cyclically shift the elements within it. Then, the symmetrical elements on both sides of the main diagonal of the permutation matrix are swapped to obtain a swapping matrix. This ensures that the swapped elements are data blocks with the same parity bit, including data blocks with the same system bit, to facilitate data repair of the storage nodes corresponding to the system bit. The permutation matrix is ​​a square matrix; otherwise, it would not have a main diagonal. Therefore, the number of divisible codes at the maximum distance is equal to the number of parity bits, i.e., r = nk.

[0036] Step S204: Update the data blocks of the parity bits of multiple maximum distance divisible codes one-to-one using the elements of the carrying matrix, and combine the multiple updated maximum distance divisible codes into a hybrid optimal repair code.

[0037] Specifically, the elements of the matrix correspond one-to-one with the data blocks of the parity bits of multiple maximum distance separable codes. After the corresponding updates, multiple hybrid optimal repair codes are obtained, which can be combined to form a hybrid optimal repair code, namely (n,k;2r) maximum distance separable code.

[0038] The above encoding method encodes multiple codewords to obtain multiple maximum distance separable codes. The parity bits of the maximum distance separable codes include data blocks of the system bits, ensuring that the failure of the storage node corresponding to the system bit can be repaired through the data of the storage node corresponding to the parity bit. Symmetrical elements on both sides of the main diagonal of the permutation matrix are interleaved to update the data blocks of the parity bits of the maximum distance separable codes. This ensures that the storage nodes corresponding to other parity bits store the data blocks of the failed nodes, guaranteeing that the failure of the storage node corresponding to the parity bit can be repaired through the data of the storage nodes corresponding to other parity bits. Finally, the data blocks of each encoded bit of the hybrid optimal repair code can be distributed to the corresponding storage nodes. The repair process only requires downloading a portion of the data blocks from k storage nodes to repair the data of the failed node, eliminating the need to download all the data blocks from k storage nodes. Here, k is the number of system bits, significantly reducing the number of data blocks required for repair, thereby reducing the repair bandwidth. This solves the problem of existing technologies where parity bit repair cannot reduce the number of data blocks downloaded, resulting in high repair bandwidth.

[0039] As an optional implementation, step S201 above includes:

[0040] Step S2011, encoding step: Encode the two codewords to be encoded to obtain the first codeword and the second codeword;

[0041] Step S2012, update step: the data blocks of the target parity bits of the first codeword and the second codeword remain unchanged, the data block of the system bits of the second codeword is added to the remaining parity bits of the first codeword to obtain the first updated codeword, the data block of the system bits of the first codeword is added to the remaining parity bits of the second codeword to obtain the second updated codeword, and the target parity bit is any parity bit;

[0042] Step S2013: Combine the steps to form a maximum distance separable code by combining the first update codeword and the second update codeword;

[0043] Step S2014: Repeat the encoding step, update step and combination step at least once in sequence to obtain multiple maximum distance separable codes.

[0044] In the above embodiments, each of the two codewords to be encoded includes k data blocks. Encoding the two codewords yields a first codeword and a second codeword, each containing n data blocks. One parity bit data block in the first and second codewords remains unchanged, while the remaining parity bit data block is added to the system bit data block of the other codeword. That is, the system bit data block of the second codeword is added to the remaining parity bits of the first codeword to obtain a first updated codeword. The system bit data block of the first codeword is then added to the remaining parity bits of the second codeword to obtain a second updated codeword. The first and second updated codewords together form a maximum distance separable code, i.e., an (n,k;2) maximum distance separable code. Encoding any two codewords to be encoded yields an (n,k;2) maximum distance separable code, and repeating this process multiple times yields a total of (n,k;2) maximum distance separable codes.

[0045] As an optional implementation, step S2011 above includes:

[0046] Step S20111: Encode a data block of a codeword to be encoded to obtain multiple first system bit data blocks and multiple first parity bit data blocks. Each first system bit data block corresponds one-to-one with a data block of a codeword to be encoded.

[0047] Step S20112: Multiple first system bit data blocks and multiple first parity bit data blocks form a first codeword;

[0048] Step S20113: Encode the data block of another codeword to be encoded to obtain multiple second system bit data blocks and multiple second parity bit data blocks. The second system bit data blocks correspond one-to-one with the data block of another codeword to be encoded.

[0049] In step S20114, multiple second system bit data blocks and multiple second parity bit data blocks form a second codeword.

[0050] In the above embodiments, the codeword to be encoded includes k data blocks. The k data blocks are used as system bit data blocks and then encoded to obtain nk parity bit data blocks. The combination of the k data blocks and the nk parity bit data blocks can obtain the first codeword or the second codeword. The parity bit data blocks are used to verify the correctness of the transmitted data and avoid using data that has errors during the transmission process.

[0051] As an optional implementation, step S2012 above includes:

[0052] Step S20121: The data block of the target parity bit of the first codeword remains unchanged. The data block of the second codeword corresponding to some system bits is added to the remaining parity bits of the first codeword to obtain the first updated codeword.

[0053] In step S20122, the data block of the target parity bit of the second codeword remains unchanged, and the data block of the first codeword corresponding to the remaining system bits is added to the remaining parity bit of the second codeword to obtain the second updated codeword.

[0054] In the above embodiment, the first codeword is The second character is The (n,k;2) maximum distance separable code obtained by encoding is as follows: Figure 3 As shown, λ is a constant, and in the (n,k;2) maximum distance separable code, the parity bit corresponding to storage node 7 is the target parity bit. The data block of the target parity bit remains unchanged, and the data block of the second codeword of the parity bit corresponding to storage node 8 is... By adding the system bit of the first codeword to data block a1, data blocks at storage node 8 can be accessed. Recover data block b4 from storage node 4, and the data block of the second codeword of the parity bit corresponding to storage node 9. By adding data blocks a2 and a3 of the system bits of the first codeword, the data blocks of storage node 9 can be accessed. Data block a2 of storage node 2 is recovered from data block a3 of storage node 3, and data block a2 of storage node 9 is recovered. Data block a2 from storage node 2 can be used to recover data block a3 from storage node 3. As for data blocks a4, a5, and a6, based on the properties of the MDSCode, they can be recovered from the six data blocks of the second codeword. For example, if storage node 1 fails, data block b1 can be recovered from data blocks b2, b3, b4, b5, b6, and a6 from storage nodes 2 to 7. Recovery is therefore necessary; if storage node 1 fails, the first step is to download... The symbol can be recovered based on the properties of MDS. In order to restore the symbols Only an additional download is required. ,because Since the previous step has been completed, a1 can be obtained through linear calculation. Therefore, repairing storage node 1 requires downloading 7 data blocks. Repairing storage node 2 (and storage node 3) requires downloading 8 data blocks. Similarly, the repair process for storage nodes 4, 5, and 6 can be derived. Therefore, on average, repairing a failed node requires downloading 23 / 3 data blocks. Compared to the trivial method of repairing using only MDS properties, which requires 12 data blocks, bandwidth is saved by 36.1%. However, storage nodes 7, 8, and 9 only have trivial repair schemes, and the repair bandwidth is 12 > 7 for each of them.

[0055] As an optional implementation, step S202 above includes:

[0056] Step S2021: The data blocks of the parity bits of each maximum distance divisible code are respectively formed into a data column, and multiple data columns are used as columns of a matrix to form a parity bit matrix. The columns of the parity bit matrix correspond one-to-one with the maximum distance divisible code, and the number of maximum distance divisible codes is equal to the number of parity bits.

[0057] In the above embodiments, such as Figure 4 As shown, select r=nk codewords that are divisible by a maximum distance of (n,k;2) (e.g., 3 codewords that are divisible by a maximum distance of (9,6;2). Here, "codeword" is a concept used as a whole. Figure 3 (The two columns in the code are considered as one codeword) Figure 4 Each column (hereinafter referred to as a column block) corresponds to a codeword of (n,k;2) maximum distance separable codeword, each component corresponds to a binary vector, and the system nodes in each column have an efficient repair scheme similar to (9,6;2) maximum distance separable codeword. For example, the first column is... Figure 3 The code, then For a combination of a1 and b2, for and The combination of r data columns forms a parity bit matrix, where the parity bit data blocks of a codeword with (n,k;2) maximum distance divisible code stored from storage node k+1 to storage node k+r constitute a data column, and the r data columns form the columns of the matrix.

[0058] As an optional implementation, step S203 above includes:

[0059] Step S2031: Calculate the target data of each element of the check bit matrix by subtracting 1 from the sum of the row number and column number of the elements.

[0060] Step S2032: Calculate the remainder when the target data is divided by the number of parity bits of the maximum distance divisible code, and obtain the first index of each element of the parity bit matrix;

[0061] Step S2033: The element in the same column as each element of the parity bit matrix and whose row number is equal to the first sequence number is determined as the permutation element of each element of the parity bit matrix.

[0062] Step S2034: Permutate each element of the parity bit matrix with the corresponding permutation element to obtain the permutation matrix.

[0063] In the above embodiments, the permutation method is not limited to cyclic shifting; it can also be implemented through linear permutation. The parity bit matrix is ​​an r-order square matrix, and linear permutations δ1, δ2, ..., δ3 acting on integers 1, 2, ..., r are applied to the elements of the parity bit matrix. r ,correspond Figure 4The data in nodes k+1, ..., k+r are stored in the permutation matrix obtained after the permutation is as follows: Figure 5 As shown, where, , , 1≤i,j≤r. Taking r=3 as an example, δ1(1)=1+1-1=1, and The same, that is, unchanged, δ1(2)=1+2-1=2, and The same, that is, unchanged, δ1(3)=1+3-1=3, and The same, that is, unchanged, δ2(1)=2+1-1=2, and Same, that is Replace with δ2(2)=2+2-1=3, and Same, that is Replace with δ2(3)=2+3-1-3=1, and Same, that is Replace with δ3(1)=3+1-1=3, and Same, that is Replace with δ3(2)=3+2-1-3=1, and Same, that is Replace with δ3(3)=3+3-1-3=2, and Same, that is Replace with .

[0064] As another optional implementation, step S203 above includes:

[0065] Step S2035: Subtract 1 from the column number of each column of the parity bit matrix to determine the number of cyclic shifts for each column;

[0066] Step S2036: Circularly shift each column of the parity bit matrix upwards according to the corresponding number of cyclic shifts to obtain the permutation matrix.

[0067] In the above embodiments, taking three (9,6;2) maximum distance separable codes as an example, such as... Figure 6 As shown, Figure 6In the sequence 'a', the data blocks stored in nodes 7 to 9 are the elements of the parity bit matrix. The elements in the first column of the parity bit matrix are h... 1, 1h 1,2 h 2,1 h 2,2 h 3,1 h 3,2 The number of cyclic shifts in the first column is 1-1=0, therefore, Figure 6 In the permutation matrix, the data blocks stored in nodes 7 to 9 of the b-th matrix are the elements of the permutation matrix. The elements in the first column of the permutation matrix have the same position and data block as the elements in the first column of the parity matrix. The elements in the second column of the parity matrix are h. 1,3 h 1,4 h 2,3 h 2,4 h 3,3 h 3,4 The second column undergoes a cyclic shift of 2-1=1. After shifting upwards once, the elements of the second column of the permutation matrix are h... 2,3 h 2,4 h 3, 3h 3,4 h 1,3 h 1,4 Similarly, the elements in the third column of the parity check matrix are h 1,5 h 1,6 h 2,5 h 2,6 h 3,5 h 3,6 The third column undergoes 3-1=2 cyclic shifts. After two cyclic shifts upwards, the elements of the third column of the permutation matrix are h. 3,5 h 3,6 h 1, 5h 1,6 h 2,5 h 2,6 The permutation is performed such that elements symmetric along the main diagonal of the permutation matrix are data blocks with the same parity bit. For example, the elements symmetric along the main diagonal h 3,1 h 3,2 and h 3,5 h 3,6 These are all data blocks containing the parity bits corresponding to storage node 9.

[0068] As an optional implementation, step S203 further includes:

[0069] Step S2037: Multiply the symmetric elements of each element of the permutation matrix by a predetermined coefficient to obtain the carrying elements of each element of the permutation matrix;

[0070] Step S2038: Combine each element of the permutation matrix with its corresponding carrying element to form the updated elements of the permutation matrix;

[0071] Step S2039: Replace each element of the permutation matrix with the corresponding updated element to obtain the mounting matrix.

[0072] In the above embodiments, Figure 5 The symmetric elements of the permutation matrix are cross-loaded to obtain the cross-loaded matrix as follows: Figure 7 As shown, , ,therefore and Data can be recovered from before the loading operation. and θ is a predetermined coefficient, a constant, and the elements on the main diagonal remain unchanged. Taking r=3 as an example, ... Figure 6 As shown, Figure 6 The symmetric elements of the permutation matrix of b in the equation are cross-loaded to obtain the cross-loaded matrix, i.e. Figure 6 In the 'c', the elements on the main diagonal remain unchanged, and h... 2,1 h 2,2 Equipped with h 2,3 h 2,4 Get h 2,1 +θh 2, 3h 2,2 +θh 2,4 h 2,3 h 2,4 Equipped with h 2,1 h 2,2 Get h 2,3 +h 2,1 h 2,4 +h 2,2 And so on for the others.

[0073] As an optional implementation, after combining multiple updated maximum distance separable codes into a hybrid optimal repair code, the above method further includes:

[0074] Step S301: Distribute the data blocks of the hybrid optimal repair code to multiple storage nodes for storage. Each storage node stores all data blocks of one system bit or one parity bit of the hybrid optimal repair code.

[0075] In the above embodiment, the hybrid optimal repair code is a (n,k;2r) maximum distance divisible code. The data blocks of each coding bit of the hybrid optimal repair code are distributed to the corresponding storage nodes for storage. That is, one storage node stores one coding bit of data block. The number of data blocks of one coding bit is 2r. Therefore, one storage node stores 2r data blocks, and the number of packets is 2r.

[0076] As an optional implementation, after distributing the data blocks of the hybrid optimal repair code to multiple storage nodes for storage, the above method further includes:

[0077] Step S401: In the event that a storage node corresponding to a system bit fails, download the data blocks of the first update codeword stored by the storage nodes corresponding to other system bits and the target check bit to obtain multiple first data blocks. Perform repair calculations based on the multiple first data blocks to obtain the data block of the first update codeword stored by the failed storage node. Determine the check bit of the data block including the second update codeword stored by the failed storage node as the download check bit. Download the data block of the first update codeword stored by the storage node corresponding to the check bit to obtain a second data block. Calculate the data block of the second update codeword stored by the failed storage node based on the second data block to complete the repair of the failed storage node.

[0078] In the above embodiments, such as Figure 6 As shown in c, when a storage node corresponding to a system bit fails, during the repair process, assuming storage node 1 fails, first download {b2,b3,b4,b5,b6}, {d2,d3,d4,d5,d6}, ​​and {f2,f3,f4,f5,f6}, then download the data h from the check node. 2,2 +θh 2,4 h 2,2 +θh 2,4 and h 2,6 It is obvious that h can be obtained. 2,2 ,h 2,4 and h 2,6 Therefore, all the data needed to repair storage node 1 can be obtained. Each pair of columns can be considered as a block, and each block only needs to download k data blocks from one column. That is, the amount of data downloaded per block (each pair of columns can be considered as a block) is the same as the (9,6;2) maximum distance divisible code. The failure repair process of one of the storage nodes 2 to 6 is similar.

[0079] As an optional implementation, after distributing the data blocks of the hybrid optimal repair code to multiple storage nodes for storage, the above method further includes:

[0080] Step S501: In the case of a storage node corresponding to a parity bit failing, the sequence number of the parity bit corresponding to the failed storage node is determined as the second sequence number, and the maximum distance divisible code corresponding to the second sequence number is determined as the target maximum distance divisible code. The data blocks of the target maximum distance divisible code stored in other storage nodes are downloaded to obtain the data blocks of the system bits and the data blocks of the parity bits. The original data block of the parity bits is obtained by repair calculation based on the data blocks of the system bits. The data block stored in the failed storage node is calculated based on the data blocks of the parity bits and the corresponding original data blocks of the parity bits, thus completing the repair of the failed storage node.

[0081] In the above embodiments, such as Figure 7As shown, let's assume that the storage node x (1≤x≤r) corresponding to the parity bit has failed. Since the data in parity node x is on the main diagonal, it hasn't been cross-referenced with data in any other location. To repair the data... It is necessary to download all the systematic information of the x-th maximum-range separable code, that is, all the systematic information of the target maximum-range separable code. , remove The remaining data are in the form of To repair the above data, simply download the information from the following verification nodes. ,because It has already been downloaded, so for any 1≤i≤r, All of these can be recovered, so based on the information from the downloaded verification nodes, All can be restored. and By performing the appropriate linear combination, the values ​​of the check node x, excluding those removed, can be recovered. All data has been downloaded. At this point, the repair of the storage node x corresponding to the check bit is complete. A total of k+r-1 data blocks have been downloaded. Considering that the number of packets for the hybrid optimal repair code is r times the maximum distance divisible code (n,k;2), and each data block corresponds to two symbols, the number of packets for the hybrid optimal repair code is l=2r. Therefore, RB=2(k+r-1)=2(n-1)= Reaching the cut set boundary, here we help store the number of nodes d=n-1.

[0082] Taking the (9,6;6) hybrid optimal repair code as an example, such as Figure 6 As shown in c, when a storage node corresponding to a check bit fails, during repair, assuming storage node 7 fails, to repair storage node 7, first download {a1,a2,a3,a4,a5,a6} and {b1,b2,b3,b4,b5,b6}. According to the properties of MDSCode, the first two bits of all data of all check nodes before loading can be recovered, i.e., {h 1,1 h 2,1 h 3,1}, {h 1,2 h 2,2 h 3,2 To repair the last two blocks of data (corresponding to the last four bits) on storage node 7, download h. 2,1 +θh 2,3 h 2,2 +θh 2,4 h 3,1 +θh 3,5 h 3,2 +θh 3,6Then, after a simple linear operation, all the data in storage node 7 can be recovered. At this time, the repair bandwidth RB = (n-1)2r / (n-1)-k+1 = 8×2×3 / 3 = 16, which is much less than the repair bandwidth RB = 6×2×3 = 36 of the existing MDSCode recovery node. The failure repair process in storage node 8 or 9 is similar.

[0083] As an optional implementation, step S501 above includes:

[0084] Step S5011: Remove the original data block corresponding to the check bit from the data block to obtain the carrying element;

[0085] Step S5012: Calculate the data block stored in the failed storage node by dividing the carried element by a predetermined coefficient.

[0086] In the above embodiments, the original data block h 2,1 and equipped with element h 2,3 For example, download the data block h containing the checksum. 2,1 +θh 2,3 Remove the original data block h 2,1 Get θh 2,3 ,θh 2,3 Divide by the predetermined coefficient θ to obtain h 2,3 That is, a data block of storage node 7.

[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0088] Embodiments of this application also provide an encoding device. Figure 8 This is a structural block diagram of an encoding device according to an embodiment of this application, such as... Figure 8 As shown, the device includes:

[0089] The encoding module 802 is used to encode multiple codewords to obtain multiple maximum distance separable codes. Two codewords to be encoded correspond to one maximum distance separable code. The parity bits of the maximum distance separable code include the data block of the system bits.

[0090] Specifically, the k original data blocks of the two codewords to be encoded are respectively encoded into n data blocks to obtain a maximum distance separable code, namely (n,k;2) maximum distance separable code, where 2 is the number of packets, which is the number of data blocks distributed to the storage node. The codewords to be encoded can be data from terminal devices (e.g., data from mobile phones, computers, IoT devices), data from business service systems (e.g., data from servers), or data migrated from other storage systems.

[0091] Combination module 804 is used to combine multiple data blocks of parity bits with maximum distance divisible code into a parity bit matrix;

[0092] Specifically, a data block containing one parity bit of a maximum distance divisible code is used as one row of a parity bit matrix, and a data block containing multiple parity bits of a maximum distance divisible code is used as one column of the parity bit matrix, thus forming a parity bit matrix.

[0093] The permutation module 806 is used to permutate the parity bit matrix to obtain a permutation matrix, and to swap the symmetrical elements on both sides of the main diagonal of the permutation matrix to obtain a swapping matrix;

[0094] Specifically, the parity bit matrix is ​​permuted to cyclically shift the elements within it. Then, the symmetrical elements on both sides of the main diagonal of the permutation matrix are swapped to obtain a swapping matrix. This ensures that the swapped elements are data blocks with the same parity bit, including data blocks with the same system bit, to facilitate data repair of the storage nodes corresponding to the system bit. The permutation matrix is ​​a square matrix; otherwise, it would not have a main diagonal. Therefore, the number of divisible codes at the maximum distance is equal to the number of parity bits, i.e., r = nk.

[0095] The update module 808 is used to update the data blocks of the parity bits of multiple maximum distance separable codes one-to-one with the elements of the carrying matrix, and to combine the multiple updated maximum distance separable codes into a hybrid optimal repair code.

[0096] Specifically, the elements of the matrix correspond one-to-one with the data blocks of the parity bits of multiple maximum distance separable codes. After the corresponding updates, multiple hybrid optimal repair codes are obtained, which can be combined to form a hybrid optimal repair code, namely (n,k;2r) maximum distance separable code.

[0097] The encoding module of the aforementioned encoding device encodes multiple codewords to be encoded to obtain multiple maximum distance separable codes. This ensures that the parity bits of the maximum distance separable codes include data blocks of the system bits, guaranteeing that the failure of the storage node corresponding to the system bit can be repaired through the data of the storage node corresponding to the parity bit. The permutation module swaps the symmetrical elements on both sides of the main diagonal of the permutation matrix to update the data blocks of the parity bits of the maximum distance separable codes. This allows the storage nodes corresponding to other parity bits to store the data blocks of the failed nodes, ensuring that the failure of the storage node corresponding to the parity bit can be repaired through the data of the storage nodes corresponding to other parity bits. Finally, the data blocks of each encoded bit of the hybrid optimal repair code can be distributed to the corresponding storage nodes. The repair process only requires downloading a portion of the data blocks from k storage nodes to repair the data of the failed node, eliminating the need to download all the data blocks from k storage nodes. Here, k is the number of system bits, significantly reducing the number of data blocks required for repair, thereby reducing the repair bandwidth. This solves the problem of existing technologies where parity bit repair cannot reduce the amount of data blocks downloaded, resulting in high repair bandwidth.

[0098] As an optional implementation, the above-mentioned encoding module includes:

[0099] The encoding subunit is used to perform the encoding steps, encoding two codewords to be encoded to obtain the first codeword and the second codeword;

[0100] The update subunit is used to perform the update step. The data blocks of the target parity bits of the first codeword and the second codeword remain unchanged. The data block of the system bits of the second codeword is added to the remaining parity bits of the first codeword to obtain the first update codeword. The data block of the system bits of the first codeword is added to the remaining parity bits of the second codeword to obtain the second update codeword. The target parity bit is any parity bit.

[0101] The first combination subunit is used to perform the combination step, combining the first update codeword and the second update codeword into a maximum distance separable codeword;

[0102] Repeating subunits are used to repeat the encoding step, update step, and combination step at least once in sequence to obtain multiple maximum distance separable codes.

[0103] In the above embodiments, each of the two codewords to be encoded includes k data blocks. Encoding the two codewords yields a first codeword and a second codeword, each containing n data blocks. One parity bit data block in the first and second codewords remains unchanged, while the remaining parity bit data block is added to the system bit data block of the other codeword. That is, the system bit data block of the second codeword is added to the remaining parity bits of the first codeword to obtain a first updated codeword. The system bit data block of the first codeword is then added to the remaining parity bits of the second codeword to obtain a second updated codeword. The first and second updated codewords together form a maximum distance separable code, i.e., an (n,k;2) maximum distance separable code. Encoding any two codewords to be encoded yields an (n,k;2) maximum distance separable code, and repeating this process multiple times yields a total of (n,k;2) maximum distance separable codes.

[0104] As an optional implementation, the above-mentioned encoding subunit includes:

[0105] The first encoding submodule is used to encode a data block of a codeword to be encoded, resulting in multiple first system bit data blocks and multiple first parity bit data blocks. Each first system bit data block corresponds one-to-one with a data block of a codeword to be encoded.

[0106] The first combination submodule is used to form a first codeword by multiple first system bit data blocks and multiple first check bit data blocks;

[0107] The second encoding submodule is used to encode the data block of another codeword to be encoded, resulting in multiple second system bit data blocks and multiple second parity bit data blocks. The second system bit data blocks correspond one-to-one with the data block of another codeword to be encoded.

[0108] The second combination submodule is used to form a second codeword by multiple second system bit data blocks and multiple second check bit data blocks.

[0109] In the above embodiments, the codeword to be encoded includes k data blocks. The k data blocks are used as system bit data blocks and then encoded to obtain nk parity bit data blocks. The combination of the k data blocks and the nk parity bit data blocks can obtain the first codeword or the second codeword. The parity bit data blocks are used to verify the correctness of the transmitted data and avoid using data that has errors during the transmission process.

[0110] As an optional implementation, the above-mentioned update subunit includes:

[0111] The first update submodule keeps the data block of the target parity bit of the first codeword unchanged, and adds the data block of the second codeword corresponding to some system bits to the remaining parity bits of the first codeword to obtain the first update codeword;

[0112] The second update submodule keeps the target check bit data block of the second codeword unchanged, and adds the data block of the first codeword corresponding to the remaining system bits to the remaining check bits of the second codeword to obtain the second update codeword.

[0113] In the above embodiment, the first codeword is The second character is The (n,k;2) maximum distance separable code obtained by encoding is as follows: Figure 3 As shown, λ is a constant, and in the (n,k;2) maximum distance separable code, the parity bit corresponding to storage node 7 is the target parity bit. The data block of the target parity bit remains unchanged, and the data block of the second codeword of the parity bit corresponding to storage node 8 is... By adding the system bit of the first codeword to data block a1, data blocks at storage node 8 can be accessed. Recover data block b4 from storage node 4, and the data block of the second codeword of the parity bit corresponding to storage node 9. By adding data blocks a2 and a3 of the system bits of the first codeword, the data blocks of storage node 9 can be accessed. Data block a2 of storage node 2 is recovered from data block a3 of storage node 3, and data block a2 of storage node 9 is recovered. Data block a2 from storage node 2 can be used to recover data block a3 from storage node 3. As for data blocks a4, a5, and a6, based on the properties of the MDSCode, they can be recovered from the six data blocks of the second codeword. For example, if storage node 1 fails, data block b1 can be recovered from data blocks b2, b3, b4, b5, b6, and a6 from storage nodes 2 to 7. Recovery is therefore necessary; if storage node 1 fails, the first step is to download... The symbol can be recovered based on the properties of MDS. In order to restore the symbols Only an additional download is required. ,because Since the previous step has been completed, a1 can be obtained through linear calculation. Therefore, repairing storage node 1 requires downloading 7 data blocks. Repairing storage node 2 (and storage node 3) requires downloading 8 data blocks. Similarly, the repair process for storage nodes 4, 5, and 6 can be derived. Therefore, on average, repairing a failed node requires downloading 23 / 3 data blocks. Compared to the trivial method of repairing using only MDS properties, which requires 12 data blocks, bandwidth is saved by 36.1%. However, storage nodes 7, 8, and 9 only have trivial repair schemes, and the repair bandwidth is 12 > 7 for each of them.

[0114] As an optional implementation, the above-mentioned combined module includes:

[0115] The second combination subunit is used to form a data column by combining the data blocks of the parity bits of each maximum distance divisible code, and to form a parity bit matrix by combining multiple data columns as columns of a matrix. The columns of the parity bit matrix correspond one-to-one with the maximum distance divisible code, and the number of maximum distance divisible codes is equal to the number of parity bits.

[0116] In the above embodiments, such as Figure 4 As shown, select r=nk codewords that are divisible by a maximum distance of (n,k;2) (e.g., 3 codewords that are divisible by a maximum distance of (9,6;2). Here, "codeword" is a concept used as a whole. Figure 3 (The two columns in the code are considered as one codeword) Figure 4 Each column (hereinafter referred to as a column block) corresponds to a codeword of (n,k;2) maximum distance separable codeword, each component corresponds to a binary vector, and the system nodes in each column have an efficient repair scheme similar to (9,6;2) maximum distance separable codeword. For example, the first column is... Figure 3 The code, then For a combination of a1 and b2, for and The combination of r data columns forms a parity bit matrix, where the parity bit data blocks of a codeword with (n,k;2) maximum distance divisible code stored from storage node k+1 to storage node k+r constitute a data column, and the r data columns form the columns of the matrix.

[0117] As an optional implementation, the above-mentioned replacement module includes:

[0118] The first calculation subunit is used to calculate the target data of each element of the check bit matrix by subtracting 1 from the sum of the row number and column number of the elements.

[0119] The second calculation subunit is used to calculate the remainder when the target data is divided by the number of parity bits of the maximum distance divisible code, and to obtain the first index of each element of the parity bit matrix.

[0120] The first determining subunit is used to determine the elements in the same column as each element of the parity bit matrix and whose row number is equal to the first sequence number as the permutation elements of each element of the parity bit matrix.

[0121] The first permutation subunit is used to permutate each element of the parity bit matrix with the corresponding permutation element to obtain the permutation matrix.

[0122] In the above embodiments, the permutation method is not limited to cyclic shifting; it can also be implemented through linear permutation. The parity matrix is ​​an r-order square matrix, and linear permutations δ1, δ2, ..., δr are applied to the elements of the parity matrix respectively, acting on integers 1, 2, ..., r. r ,correspond Figure 4The data in nodes k+1, ..., k+r are stored in the permutation matrix obtained after the permutation is as follows: Figure 5 As shown, where, , , 1≤i,j≤r. Taking r=3 as an example, δ1(1)=1+1-1=1, and The same, that is, unchanged, δ1(2)=1+2-1=2, and The same, that is, unchanged, δ1(3)=1+3-1=3, and The same, that is, unchanged, δ2(1)=2+1-1=2, and Same, that is Replace with δ2(2)=2+2-1=3, and Same, that is Replace with δ2(3)=2+3-1-3=1, and Same, that is Replace with δ3(1)=3+1-1=3, and Same, that is Replace with δ3(2)=3+2-1-3=1, and Same, that is Replace with δ3(3)=3+3-1-3=2, and Same, that is Replace with .

[0123] As another optional implementation, the above-mentioned replacement module includes:

[0124] The second determining subunit is used to determine the number of cyclic shifts for each column by subtracting 1 from the column number of each column of the parity bit matrix;

[0125] The second permutation subunit is used to cyclically shift each column of the parity bit matrix upwards according to the corresponding cyclic shift number to obtain the permutation matrix.

[0126] In the above embodiments, taking three (9,6;2) maximum distance separable codes as an example, such as... Figure 6 As shown, Figure 6In the sequence 'a', the data blocks stored in nodes 7 to 9 are the elements of the parity bit matrix. The elements in the first column of the parity bit matrix are h... 1, 1h 1,2 h 2,1 h 2,2 h 3,1 h 3,2 The number of cyclic shifts in the first column is 1-1=0, therefore, Figure 6 In the permutation matrix, the data blocks stored in nodes 7 to 9 of the b-th matrix are the elements of the permutation matrix. The elements in the first column of the permutation matrix have the same position and data block as the elements in the first column of the parity matrix. The elements in the second column of the parity matrix are h. 1,3 h 1,4 h 2,3 h 2,4 h 3,3 h 3,4 The second column undergoes a cyclic shift of 2-1=1. After shifting upwards once, the elements of the second column of the permutation matrix are h... 2,3 h 2,4 h 3, 3h 3,4 h 1,3 h 1,4 Similarly, the elements in the third column of the parity check matrix are h 1,5 h 1,6 h 2,5 h 2,6 h 3,5 h 3,6 The third column undergoes 3-1=2 cyclic shifts. After two cyclic shifts upwards, the elements of the third column of the permutation matrix are h. 3,5 h 3,6 h 1, 5h 1,6 h 2,5 h 2,6 The permutation is performed such that elements symmetric along the main diagonal of the permutation matrix are data blocks with the same parity bit. For example, the elements symmetric along the main diagonal h 3,1 h 3,2 and h 3,5 h 3,6 These are all data blocks containing the parity bits corresponding to storage node 9.

[0127] As an optional implementation, the above-mentioned replacement module further includes:

[0128] The third calculation subunit is used to multiply the symmetric elements of each element of the permutation matrix by a predetermined coefficient to obtain the carrying elements of each element of the permutation matrix.

[0129] The third combination subunit is used to combine each element of the permutation matrix with the corresponding mounted element to form the updated element of each element of the permutation matrix;

[0130] The replacement sub-unit is used to replace each element of the permutation matrix with the corresponding updated element to obtain the mounting matrix.

[0131] In the above embodiments, Figure 5 The symmetric elements of the permutation matrix are cross-loaded to obtain the cross-loaded matrix as follows: Figure 7 As shown, , ,therefore and Data can be recovered from before the loading operation. and θ is a predetermined coefficient, a constant, and the elements on the main diagonal remain unchanged. Taking r=3 as an example, ... Figure 6 As shown, Figure 6 The symmetric elements of the permutation matrix of b in the equation are cross-loaded to obtain the cross-loaded matrix, i.e. Figure 6 In the 'c', the elements on the main diagonal remain unchanged, and h... 2,1 h 2,2 Equipped with h 2,3 h 2,4 Get h 2,1 +θh 2, 3h 2,2 +θh 2,4 h 2,3 h 2,4 Equipped with h 2,1 h 2,2 Get h 2,3 +h 2,1 h 2,4 +h 2,2 And so on for the others.

[0132] As an optional implementation, the above-described apparatus further includes:

[0133] The storage module is used to distribute the data blocks of the hybrid optimal repair code to multiple storage nodes for storage after combining multiple updated maximum distance separable codes into a hybrid optimal repair code. Each storage node stores all data blocks of a system bit or a parity bit of the hybrid optimal repair code.

[0134] In the above embodiment, the hybrid optimal repair code is a (n,k;2r) maximum distance divisible code. The data blocks of each coding bit of the hybrid optimal repair code are distributed to the corresponding storage nodes for storage. That is, one storage node stores one coding bit of data block. The number of data blocks of one coding bit is 2r. Therefore, one storage node stores 2r data blocks, and the number of packets is 2r.

[0135] As an optional implementation, the above-described apparatus further includes:

[0136] The first repair module is used to, after distributing the data block of the hybrid optimal repair code to multiple storage nodes for storage, download the data block of the first update codeword stored by the storage nodes corresponding to the system bit and the target check bit in the event of failure of the storage node corresponding to the system bit, to obtain multiple first data blocks. Repair calculations are performed based on the multiple first data blocks to obtain the data block of the first update codeword stored by the failed storage node. The check bit of the data block including the second update codeword stored by the failed storage node is determined as the download check bit. The data block of the first update codeword stored by the storage node corresponding to the check bit is downloaded to obtain a second data block. The data block of the second update codeword stored by the failed storage node is calculated based on the second data block to complete the repair of the failed storage node.

[0137] In the above embodiments, such as Figure 6 As shown in c, when a storage node corresponding to a system bit fails, during the repair process, assuming storage node 1 fails, first download {b2,b3,b4,b5,b6}, {d2,d3,d4,d5,d6}, ​​and {f2,f3,f4,f5,f6}, then download the data h from the check node. 2,2 +θh 2,4 h 2,2 +θh 2,4 and h 2,6 It is obvious that h can be obtained. 2,2 ,h 2,4 and h 2,6 Therefore, all the data needed to repair storage node 1 can be obtained. Each pair of columns can be considered as a block, and each block only needs to download k data blocks from one column. That is, the amount of data downloaded per block (each pair of columns can be considered as a block) is the same as the (9,6;2) maximum distance divisible code. The failure repair process of one of the storage nodes 2 to 6 is similar.

[0138] As an optional implementation, the above-described apparatus further includes:

[0139] The second repair module is used to, after distributing the data block of the hybrid optimal repair code to multiple storage nodes for storage, determine the sequence number of the check bit corresponding to the failed storage node as the second sequence number in the event that a storage node corresponding to a check bit fails, determine the maximum distance separable code corresponding to the second sequence number as the target maximum distance separable code, download the data block of the target maximum distance separable code stored on other storage nodes, obtain the data block of the system bit and the data block of the check bit, perform repair calculation based on the data block of the system bit to obtain the original data block of the check bit, calculate the data block stored by the failed storage node based on the data block of the check bit and the corresponding original data block of the check bit, and complete the repair of the failed storage node.

[0140] In the above embodiments, such as Figure 7As shown, let's assume that the storage node x (1≤x≤r) corresponding to the parity bit has failed. Since the data in parity node x is on the main diagonal, it hasn't been cross-referenced with data in any other location. To repair the data... It is necessary to download all the systematic information of the x-th maximum-range separable code, that is, all the systematic information of the target maximum-range separable code. , remove The remaining data are in the form of To repair the above data, simply download the information from the following verification nodes. ,because It has already been downloaded, so for any 1≤i≤r, All of these can be recovered, so based on the information from the downloaded verification nodes, All can be restored. and By performing the appropriate linear combination, the values ​​of the check node x, excluding those removed, can be recovered. All data has been downloaded. At this point, the repair of the storage node x corresponding to the check bit is complete. A total of k+r-1 data blocks have been downloaded. Considering that the number of packets for the hybrid optimal repair code is r times the maximum distance divisible code (n,k;2), and each data block corresponds to two symbols, the number of packets for the hybrid optimal repair code is l=2r. Therefore, RB=2(k+r-1)=2(n-1)= Reaching the cut set boundary, here we help store the number of nodes d=n-1.

[0141] Taking the (9,6;6) hybrid optimal repair code as an example, such as Figure 6 As shown in c, when a storage node corresponding to a check bit fails, during repair, assuming storage node 7 fails, to repair storage node 7, first download {a1,a2,a3,a4,a5,a6} and {b1,b2,b3,b4,b5,b6}. According to the properties of MDSCode, the first two bits of all data of all check nodes before loading can be recovered, i.e., {h 1,1 h 2,1 h 3,1}, {h 1,2 h 2,2 h 3,2 To repair the last two blocks of data (corresponding to the last four bits) on storage node 7, download h. 2,1 +θh 2,3 h 2,2 +θh 2,4 h 3,1 +θh 3,5 h 3,2 +θh 3,6Then, after a simple linear operation, all the data in storage node 7 can be recovered. At this time, the repair bandwidth RB = (n-1)2r / (n-1)-k+1 = 8×2×3 / 3 = 16, which is much less than the repair bandwidth RB = 6×2×3 = 36 of the existing MDSCode recovery node. The failure repair process in storage node 8 or 9 is similar.

[0142] As an optional implementation, the second repair module described above includes:

[0143] Remove sub-units, which are used to remove the original data block corresponding to the parity bit in the data block to obtain the carrying element;

[0144] The fourth calculation subunit is used to calculate the data block stored in the failed storage node by dividing the carried element by a predetermined coefficient.

[0145] In the above embodiments, the original data block h 2,1 and equipped with element h 2,3 For example, download the data block h containing the checksum. 2,1 +θh 2,3 Remove the original data block h 2,1 Get θh 2,3 ,θh 2,3 Divide by the predetermined coefficient θ to obtain h 2,3 That is, a data block of storage node 7.

[0146] For a description of the features in the embodiment corresponding to the encoding device, please refer to the relevant description in the embodiment corresponding to the encoding method, which will not be repeated here.

[0147] Embodiments of this application also provide a storage system including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described encoding method embodiments.

[0148] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described encoding method embodiments when it is run.

[0149] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0150] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described encoding method embodiments.

[0151] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described encoding method embodiments.

[0152] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0153] The encoding method and encoding apparatus provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. An encoding method, characterized in that, include: Multiple codewords to be encoded are encoded to obtain multiple maximum distance divisible codes. Two codewords to be encoded correspond to one maximum distance divisible code. The parity bits of the maximum distance divisible code include a data block of system bits. Each of the data blocks of the parity bits of the maximum distance divisible code is formed into a data column, and multiple data columns are used as columns of a matrix to form a parity bit matrix. The columns of the parity bit matrix correspond one-to-one with the maximum distance divisible code, and the number of the maximum distance divisible code is equal to the number of the parity bits. The target data of each element of the check bit matrix is ​​obtained by subtracting 1 from the sum of the row number and column number of the elements of the check bit matrix. Calculate the remainder when the target data is divided by the number of parity bits of the maximum distance divisible code to obtain the first index of each element of the parity bit matrix; determine the element in the same column as each element of the parity bit matrix and whose row number is equal to the first index as the permutation element of each element of the parity bit matrix. The elements of the check bit matrix are interchanged with the corresponding permutation elements to obtain the permutation matrix; Multiply the symmetric elements of each element of the permutation matrix by a predetermined coefficient to obtain the mounting elements of each element of the permutation matrix; combine each element of the permutation matrix with its corresponding mounting elements to form the updated elements of each element of the permutation matrix. Replace each element of the permutation matrix with the corresponding updated element to obtain the carrying matrix; The data blocks of the parity bits of the multiple maximum distance separable codes are updated one-to-one with the elements of the carrying matrix, and the multiple updated maximum distance separable codes are combined into a hybrid optimal repair code.

2. The encoding method according to claim 1, characterized in that, Encoding multiple codewords to be encoded yields multiple maximally divisible codes, including: The encoding step involves encoding the two codewords to be encoded to obtain a first codeword and a second codeword. The update step involves keeping the target parity bit data blocks of the first codeword and the second codeword unchanged, adding the system bit data block of the second codeword to the remaining parity bits of the first codeword to obtain the first updated codeword, and adding the system bit data block of the first codeword to the remaining parity bits of the second codeword to obtain the second updated codeword. The target parity bit can be any parity bit. The combination step combines the first updated codeword and the second updated codeword into a maximum distance separable code; By repeating the encoding step, the update step, and the combination step at least once in sequence, multiple maximum distance separable codes are obtained.

3. The encoding method according to claim 2, characterized in that, Encoding the two codewords to be encoded to obtain a first codeword and a second codeword includes: Encode a data block of the codeword to be encoded to obtain multiple first system bit data blocks and multiple first parity bit data blocks, wherein each first system bit data block corresponds one-to-one with a data block of the codeword to be encoded. The first codeword is composed of multiple first system bit data blocks and multiple first check bit data blocks; Encode another data block of the codeword to be encoded to obtain multiple second system bit data blocks and multiple second parity bit data blocks, wherein each second system bit data block corresponds one-to-one with the data block of the other codeword to be encoded. The second codeword is composed of multiple second system bit data blocks and multiple second check bit data blocks.

4. The encoding method according to claim 2, characterized in that, The target parity bit data blocks of the first codeword and the second codeword remain unchanged. The system bit data block of the second codeword is added to the remaining parity bits of the first codeword to obtain the first updated codeword. The system bit data block of the first codeword is added to the remaining parity bits of the second codeword to obtain the second updated codeword, including: The data block of the target parity bit of the first codeword remains unchanged, and the data block of the second codeword corresponding to a portion of the system bits is added to the remaining parity bit of the first codeword to obtain the first updated codeword; The data block of the target parity bit of the second codeword remains unchanged, and the data block of the first codeword corresponding to the remaining system bits is added to the remaining parity bits of the second codeword to obtain the second updated codeword.

5. The encoding method according to any one of claims 1 to 4, characterized in that, After combining multiple updated maximum distance separable codes into a hybrid optimal repair code, the method further includes: The data blocks of the hybrid optimal repair code are distributed to multiple storage nodes for storage, and each storage node stores all data blocks of one system bit or one parity bit of the hybrid optimal repair code.

6. The encoding method according to claim 5, characterized in that, After distributing the data blocks of the hybrid optimal repair code to multiple storage nodes for storage, the method further includes: In the event that a storage node corresponding to a system bit fails, data blocks containing the first update codeword stored by the storage nodes corresponding to other system bits and the target check bit are downloaded to obtain multiple first data blocks. Repair calculations are performed based on the multiple first data blocks to obtain the data block containing the first update codeword stored by the failed storage node. The check bit of the data block containing the second update codeword stored by the failed storage node is determined as the download check bit. The data block containing the first update codeword stored by the storage node corresponding to the download check bit is downloaded to obtain a second data block. The data block containing the second update codeword stored by the failed storage node is calculated based on the second data block to complete the repair of the failed storage node.

7. The encoding method according to claim 5, characterized in that, After distributing the data blocks of the hybrid optimal repair code to multiple storage nodes for storage, the method further includes: In the event that a storage node corresponding to a parity bit fails, the sequence number of the parity bit corresponding to the failed storage node is determined as the second sequence number, and the maximum distance divisible code corresponding to the second sequence number is determined as the target maximum distance divisible code. Data blocks of the target maximum distance divisible code stored in other storage nodes are downloaded to obtain the data block of the system bit and the data block of the parity bit. The original data block of the parity bit is obtained by repair calculation based on the data block of the system bit, and the data block stored in the failed storage node is calculated based on the data block of the parity bit and the corresponding original data block of the parity bit, thus completing the repair of the failed storage node.

8. A storage system, characterized in that, include: Multiple storage nodes; Memory, used to store computer programs; A processor for implementing the steps of the encoding method as described in any one of claims 1 to 7 when executing the computer program.

Citation Information

Patent Citations

  • Array code acquisition method, device and system and readable storage medium

    CN118868962A

  • Coding for distributed storage system

    WO2017061891A1