Data encoding method and related apparatus

By using a parity-check matrix or generator matrix represented by a polynomial ring in a distributed storage system, selecting irreducible polynomials for data unit transformation, and replacing multiplication with XOR operations, the problems of code length limitation and high computational complexity in existing technologies are solved, achieving efficient data encoding and recovery.

WO2025190142A9PCT designated stage Publication Date: 2025-11-06HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/080959
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-12
Filing Date
2025-03-06
Publication Date
2025-11-06

AI Technical Summary

Technical Problem

Existing data redundancy technologies are limited by code length in large-scale distributed storage systems, making it difficult to meet the needs of large-scale encoding and storage, and the high computational complexity leads to low encoding efficiency.

Method used

The parity-check matrix or generator matrix represented by the polynomial ring is transformed into data units on the polynomial ring by selecting an irreducible polynomial as the polynomial corresponding to the polynomial ring. The XOR operation is used to replace the multiplication operation, thereby reducing the computational overhead.

Benefits of technology

It effectively reduces the computational complexity of encoding, improves encoding efficiency, meets the needs of large-scale encoding storage, and enhances the reliability of distributed storage systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025080959_06112025_PF_FP_ABST
    Figure CN2025080959_06112025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application is a data encoding method, comprising: acquiring a target matrix, the target matrix being a check matrix or a generator matrix, the target matrix being a binary matrix which represents a data unit of a finite field 2a on a polynomial ring, and a polynomial corresponding to the polynomial ring being an irreducible polynomial of which the highest degree is not greater than the a; and encoding a data block according to the target matrix to obtain an encoding result, wherein the encoding result is used as a redundant data block of the data block, or the encoding result is a recovery result for a data block of a node where same is located. In the embodiments of the present application, an irreducible polynomial can be selected as a polynomial corresponding to the polynomial ring, such that the data unit of the finite field 2a can be converted to be represented on the corresponding polynomial ring, and then an XOR operation equivalent to a multiplication operation can be performed by means of data based on the polynomial ring representation, thus reducing computational overheads.
Need to check novelty before this filing date? Find Prior Art

Description

Data encoding method and related apparatus This application claims priority from the Chinese patent application No. 202410294634.6 filed on March 12, 2024, and entitled "A data encoding method and related apparatus", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD The present application relates to the technical field of storage, in particular to a data encoding method and device. BACKGROUND At present, when storing massive data, a distributed storage scheme is mainly used. The scheme can perform efficient data reading and calculation on tens of thousands of distributed data storage nodes. Distributed storage not only brings higher data scalability, but also reduces the overhead of data management and maintenance in multiple distributed disk arrays. However, in the current large distributed storage system, the failure of storage nodes is common. In order to prevent data loss, the storage system usually uses data redundancy technology to encode and store the stored data for data protection in the failed node. The current data redundancy technology is limited by code length and is difficult to meet the large-scale encoding storage demand. In addition, in the data encoding and decoding process of the current data redundancy technology, a large number of finite field multiplication and addition operations are required, which increases the calculation complexity of encoding and reduces the data encoding efficiency, resulting in large calculation overhead. SUMMARY The present application provides a data encoding method and device. In the method, a check matrix or a generator matrix is constructed by a polynomial that meets a preset condition, which can reduce the calculation overhead during encoding. In a first aspect, the present application provides a data encoding method, comprising: obtaining a target matrix, the target matrix being a check matrix or a generator matrix, the target matrix being a binary matrix represented by a data unit in a finite field 2 a on a polynomial ring, and the polynomial corresponding to the polynomial ring being an irreducible polynomial with a highest degree not greater than a; encoding a data block according to the target matrix to obtain an encoding result; wherein the encoding result is used as a redundant data block of the data block; or the encoding result is a recovery result of the data block of the node. The check matrix or the generator matrix can be represented by a polynomial ring, wherein the check matrix or the generator matrix can include a plurality of data units, the data unit can be an element in the matrix, the data unit can be a data unit in a finite field 2 a , and the polynomial ring can be a matrix (that is, the target matrix in the present application embodiment), the target matrix being a binary matrix represented by a data unit in a finite field 2 aThe data unit (belonging to the parity-check matrix or generator matrix) is represented as a binary matrix on a polynomial ring (the element is a matrix represented in binary). In existing techniques, the polynomial corresponding to the polynomial ring corresponding to the data unit of the finite field 2a is x. a +x a-1 +…+x 2 +x+1=0 (The chosen polynomial affects the size of the polynomial ring), the highest degree of this polynomial is a, the coefficient of each term is 1, and the degree of each term decreases from a until it becomes 0. In this polynomial (x a +x a-1 +…+x 2 When (x + 1 = 0) is a reducible polynomial, the finite field 2 cannot be converted. a Data units converted to x a +x a-1 +…+x 2 The polynomial ring corresponding to +x+1=0. However, for polynomials of the highest degree a (with a coefficient of 1 for each term) (excluding x... a +x a-1 +…+x 2 The polynomial ∪ + x + 1 = 0 often includes one or more irreducible polynomials. In the embodiments of this application, one irreducible polynomial can be selected as the polynomial corresponding to the polynomial ring, thereby making the finite field 2 a The data units can be transformed to be represented on the corresponding polynomial ring. Then, the XOR operation, which is equivalent to multiplication, can be performed on the data represented on the polynomial ring, thereby reducing the computational overhead. In one possible implementation, for finite field 2 a For a data unit, a polynomial can be selected from one or more irreducible polynomials whose highest degree is no greater than 'a' as the polynomial corresponding to the polynomial ring. For example, the polynomial with the smallest order among one or more irreducible polynomials whose highest degree is no greater than 'a' can be selected. Here, the order is defined as: the polynomial can divide one or more expressions of the form xb+1, and the order of the polynomial is equal to the order of the one or more expressions of the form xb+1. b The smallest value of b in the expression with +1. For example, a polynomial can divide x. 3 +1 and x 4 If we add 1, then the order of the polynomial is 3. In a possible implementation, the target matrix includes a sub-matrix for representing the first data unit, the data block includes a second data unit, the second data unit is represented by a first vector, and the first vector is a binary vector; the encoding of the data block according to the target matrix includes: performing an exclusive or operation on the sub-matrix and the first vector to obtain a second vector, the second vector being a binary vector; and dividing a polynomial with coefficients of binary elements in the second vector by a polynomial corresponding to the polynomial ring and taking a remainder to obtain an operation result equivalent to a product result of the first data unit and the second data unit. In a possible implementation, the check matrix or the generator matrix can include a plurality of data units (that is, elements in the matrix), and the target matrix is obtained by representing each data unit by a polynomial ring. Taking one data unit (a first data unit) in the plurality of data units as an example, the target matrix can include a sub-matrix for representing the first data unit. When the sub-matrix of the first data unit is determined, a binary vector corresponding to the first data unit can be taken as a column of the sub-matrix, and then the column is cyclically shifted to obtain other columns, thereby obtaining the sub-matrix of the first data unit, where the number of rows of the sub-matrix is the order of a polynomial corresponding to the polynomial ring. In a possible implementation, when the sub-matrix of the first data unit is determined, a binary vector corresponding to the first data unit can be taken as a column of the sub-matrix (for example, each element in the binary representation is sequentially filled into the column of the sub-matrix from top to bottom, or each element after being filled is transformed, that is, a "0" element is changed to a "1", and a "1" is changed to a "0"). In a possible implementation, the sub-matrix includes a target column, the target column is obtained by filling the binary representation of the first data unit and transforming binary elements of a part of the target column, the target column includes X rows, and the transformation includes: when an element of a target row in the last M rows of the X rows is 1, an element of a row before the target row in the X rows is transformed based on the polynomial. In a possible implementation, the target column includes X rows, where it can be determined whether each element in the last M rows of the X rows is 1 or 0, and when the element is 1, an element of a row before the element is transformed based on the polynomial, for example, the polynomial is x 4 +x+1=0, before the transformation, the element of the corresponding row is set to 1, the element of the corresponding row of x is set to 1, and the element of the corresponding row of 1 is set to 1. 4 When the first row of the last M rows is 1, the polynomial is x 5+x 2 +x=0, and then x 2 The corresponding row is transformed, and the corresponding row of x is transformed. Wherein, X can be the value of order b. In a possible implementation, the M is the difference between the X and a. In a possible implementation, when the number of "1" elements included in the polynomial ring is less and the number of "0" elements is more, the calculation overhead of subsequent XOR operation is lower, and therefore, when homomorphic transformation is performed on the submatrix, the target can be set as: performing homomorphic transformation and minimizing the number of "1" elements included in the submatrix. Specifically, the target column is obtained by filling the binary representation of the first data unit and performing the transformation on the binary elements of the part to minimize the number of "1" elements included in the submatrix for representing the first data unit. In a possible implementation, after the submatrix of the elements in the finite field is determined, the elements used to constitute the target matrix and the positions of the elements in the target matrix need to be selected from the elements in the finite field. For the target matrix, the number of "1" elements included is less, which reduces the calculation overhead of subsequent XOR operation, and the selection of the elements in the finite field and the positions of the elements in the target matrix needs to meet the optimal compromise between storage overhead and fault tolerance capability (i.e., meeting the maximum distance separable (MDS) property). Specifically, in a possible implementation, the target matrix includes a plurality of submatrices for representing a plurality of data units, and the positions of the plurality of data units and the corresponding submatrices in the target matrix are selected from the finite field 2 a based on the following constraint: minimizing the number of "1" elements included in the target matrix while ensuring that the target matrix has the maximum distance separable (MDS) property. In a second aspect, the present application provides a data encoding apparatus, comprising: An obtaining module is configured to obtain a target matrix, the target matrix being a check matrix or a generator matrix, the target matrix being a binary matrix representing data units in a finite field 2 a on a polynomial ring, and a polynomial corresponding to the polynomial ring being an irreducible polynomial with a highest degree not greater than a. An encoding module is configured to encode a data block according to the target matrix to obtain an encoding result; wherein, The encoding result is used as a redundant data block of the data block; or the encoding result is a recovery result of a data block of a node. In a possible implementation, x a+x a-1 +…+x 2 +x+1=0 is a reducible polynomial, and the polynomial corresponding to the polynomial ring is an irreducible polynomial with the highest degree not greater than the a. In a possible implementation, the data block and the encoding result are stored on different nodes. In a possible implementation, the polynomial corresponding to the polynomial ring is an irreducible polynomial with the highest degree not greater than the a, and the polynomial can divide one or more expressions in the form of x b +1, and the degree of the polynomial is the minimum value of b in the one or more expressions in the form of x b +1. In a possible implementation, the target matrix includes a submatrix for representing a first data unit, the data block includes a second data unit, and the second data unit is represented by a first vector, where the first vector is a binary vector. The processing module is specifically configured to: perform an exclusive OR operation on the submatrix and the first vector to obtain a second vector, where the second vector is a binary vector; divide a polynomial with a binary element in the second vector as a coefficient by a polynomial corresponding to the polynomial ring and take a remainder to obtain an operation result equivalent to a product result of the first data unit and the second data unit. In a possible implementation, the target matrix includes a submatrix for representing a first data unit, and a number of rows of the submatrix is a degree of a polynomial corresponding to the polynomial ring. In a possible implementation, the target column is obtained by performing the transformation on partial binary elements after padding the binary representation of the first data unit, so that the number of elements including 1 in a submatrix for representing the first data unit is minimized, and the transformation includes changing 0 to 1 or changing 1 to 0. In a possible implementation, the submatrix includes a target column, and the target column is obtained by performing a transformation on partial binary elements after padding the binary representation of the first data unit, and the target column includes X rows, and the transformation includes: when an element of a target row in the last M rows of the X rows is 1, an element of a row before the target row in the X rows is correspondingly transformed based on the polynomial. In a possible implementation, the M is a difference between the X and the a. In a possible implementation, the target column is obtained by performing the transformation on partial binary elements after padding the binary representation of the first data unit, so that the number of elements including 1 in a submatrix for representing the first data unit is minimized. In a possible implementation, the target matrix comprises a plurality of sub-matrix groups for representing a plurality of data units, the plurality of data units and the corresponding sub-matrix are selected from the finite field 2 a In the case of guaranteeing that the target matrix has a maximum distance separable (mds) property, the number of elements of 1 included in the target matrix is minimized. In the case of guaranteeing that the target matrix has a maximum distance separable (mds) property, the number of elements of 1 included in the target matrix is minimized. In a third aspect, the present application provides a computing device, comprising a memory and a processor, wherein the processor executes computer instructions stored in the memory, so that the computing device executes the method described in any possible implementation manner of the first aspect. In a fourth aspect, the present application provides a storage system comprising the data processing apparatus as described in any possible implementation manner of the second aspect. In a fifth aspect, the present application provides a computer readable storage medium comprising instructions which, when executed on a computing device, cause the computing device to perform the method described in any possible implementation manner of the first aspect. In a sixth aspect, the present application provides a computer program product comprising program codes which, when executed by a computer device, implement the method described in any possible implementation manner of the first aspect. Since the apparatuses provided by the present application can be used to execute the steps of any possible implementation manner of the first aspect, the technical effects that can be achieved by the apparatuses of the present application can refer to the technical effects achieved by the foregoing method, which will not be described here. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a schematic diagram of an application architecture; FIG. 2 is a schematic diagram of an application architecture; FIG. 3 is a schematic diagram of a data repair process; FIG. 4 is a schematic diagram of a data encoding method; FIGS. 5 to 12 are schematic diagrams of a check matrix; FIG. 13 is a schematic diagram of the structure of an apparatus according to an embodiment of the present application; FIG. 14 is a schematic diagram of the structure of a chip according to an embodiment of the present application; FIG. 15 is a schematic diagram of the structure of a data encoding apparatus according to an embodiment of the present application. DETAILED DESCRIPTION With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts should fall within the scope of the present application. The term "and / or" used herein is merely used to describe an associated relationship with associated objects, and means that three relationships can exist, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The terms "first" and "second" and the like in the description and claims of the embodiments of the present application are used to distinguish different objects, and are not used to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, and are not used to describe a specific order of the target objects. In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or designs. In fact, the word "exemplary" or "for example" is used to present concepts in a particular manner. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems. In the era of big data, data-based applications need to obtain knowledge based on massive data, and then perform effective classification, retrieval, and other operations on the data. For example, artificial intelligence systems represented by deep learning need to use massive data to update parameters and learn features. In order to effectively store and maintain massive data, in the traditional centralized storage scheme, when storing massive data, the data scalability, and the positioning and retrieval ability of key data are low, and the centralized management mechanism of data maintenance in the data center also brings high cost overhead. Therefore, at present, when storing massive data, a distributed storage scheme is mainly used. This scheme can perform efficient data reading and calculation on tens of thousands of distributed data storage nodes. Distributed storage not only brings higher data scalability, but also reduces the overhead of data management and maintenance in multiple distributed disk arrays. However, in the current large distributed storage system, the failure of storage nodes is common. Then in order to prevent the loss of data, the storage system usually adopts data redundancy technology to protect the stored data. At present, the data redundancy technology mainly includes replica storage technology and erasure code storage technology. The replica storage technology mainly replicates the original data multiple times, and stores these data replicas on different nodes of the system. For example, three replica storage technology is to replicate the original data 3 times, and store the 3 data in three nodes of the storage system. Among them, one node is used to store the original data, and two nodes are used to store the replica data. In this way, as long as not all nodes are damaged, the data validity can be guaranteed. However, the storage efficiency of three replica storage technology is only 1 / 3, and the data storage efficiency is low. In the replica storage technology, if the data is replicated n times for storage, the storage efficiency is only 1 / n, not only the system storage overhead is large, but also it cannot meet the storage demand of large-scale storage scheme. The erasure code storage technology can divide the original data into k equal parts of original data blocks, then encode [n, k] erasure code to obtain m parts of redundant data blocks, and finally store n (here n = m + k) parts of data (including original data blocks and redundant data blocks) in n storage nodes of the system. Before introducing the technical scheme of the present application, the following technical terms are first explained and described: The dimension k is used to represent the number of original data blocks after the original data is blocked when the original data is encoded. The redundancy is used to represent the number of redundant data blocks generated when the original data is encoded, or the number of check nodes used to store the redundant data blocks. The code length n is used to represent the number of data blocks in the encoded data generated after the original data is encoded (for example, the number of original data blocks (i.e. the dimension k above) + the number of redundant data blocks (for example, the redundancy above)). And the code length is the same as the number of nodes where the encoded data is stored. Among them, the number of redundant data blocks (or the number of check nodes, or the redundancy) is (n-k). The array dimension m is used to represent the number of data segments (or data packets) contained in each of the k original data blocks. The local degree r is used to represent the number of nodes required to repair the original data when there is a damaged storage node in the distributed storage system used to store the encoded data. Erasure code (EC) is a key technology to realize data reliability in data storage. EC is to obtain a redundant check block by encoding an effective data block. When any data block is damaged, the check block and other data blocks can be read to reconstruct (or decode) the data block, thereby improving the reliability of the data block. The present application provides a data processing method and device based on EC, which can realize encoding or decoding of EC based on a check matrix (or generator matrix) to store data reliably. The present application can be applied to, but is not limited to, the application scenario shown in FIG. 1. The application scenario shown in FIG. 1 includes an application server and a storage node, which can be connected through a communication network. The storage node is provided with a storage controller and one or more memories. The present application does not limit the type of memory, for example, the memory can be a storage server or a storage array or a hard disk or a memory in a storage controller. The hard disk includes a solid state disk (SSD) or a hard disk drive (HDD) or a hybrid hard disk. The application scenario to which the present application is applicable can be various, which is not limited by the present application. For example, the application scenario to which the present application is applicable can include more or fewer application servers or storage nodes than FIG. 1, the storage node can include more or fewer memories than FIG. 1, and the storage node can be a storage node in a centralized storage system or a distributed storage system. The following describes a possible example of the data processing method of the present application taking the application scenario shown in FIG. 1 as an example. Referring to FIG. 2, the storage controller can receive the to-be-written data sent by the application server and encode it based on EC. Taking a K+M ratio of 6+4 as an example (that is, the code length n is 10 and the redundancy is 4), where "6+4" here can be understood as that there are 6 copies of to-be-written data (not including check blocks, that is, redundant data), which need to be stored on 6 memories (or, can be described as storage nodes), and 4 check blocks can be obtained based on the 6 copies of to-be-written data. The storage controller can divide the to-be-written data into 6 data blocks (D1, D2, …, D6), encode the 6 data blocks according to the check matrix, and obtain 4 check blocks (P1, P2, P3, P4). Then, the storage controller can store the 6 data blocks and the 4 check blocks in 10 memories, respectively. The present application can be applied to a distributed storage system, and provides storage system reliability by encoding storage system data with erasure code. The current mainstream approach is to store large files in blocks, and manage them in a disk distributed storage manner. FIG. 2 shows an architecture of a distributed storage system. To cope with disk deletion errors, during data storage in the storage system, the original file is divided into data blocks (D1-D6) to generate original data blocks, and an erasure code encoding scheme is applied to encode the original data blocks to generate redundant data blocks (P1-P4). Finally, the original data blocks (D1-D6) and the redundant data blocks (P1-P4) are written into different storage nodes for storage. When disk damage or node failure occurs, valid original data or redundant check data is read from undamaged disks or valid nodes to perform erasure code decoding, to recover the lost data blocks and write them into the repair disks or repair nodes, thereby maintaining the data reliability of the distributed storage system. Referring to FIG. 3, which is an application architecture of an embodiment of the present application, and different from FIG. 2, FIG. 3 takes 4+2 as an example of K+M ratio. The present application can be applied to a distributed storage system, and provides storage system reliability by encoding storage system data with erasure code. To cope with disk deletion errors, during data storage in the storage system, the original file is divided into data blocks (F1-F4) to generate original data blocks, and an erasure code encoding scheme is applied to encode the original data blocks to generate redundant data blocks (P1, P2). Finally, the original data blocks (F1-F4) and the redundant data blocks (P1, P2) are written into different storage nodes for storage. When disk damage or node failure occurs, valid original data or redundant check data is read from undamaged disks or valid nodes to perform erasure code decoding, to recover the lost data blocks (F1', F2') and write them into the repair disks or repair nodes, thereby maintaining the data reliability of the distributed storage system. In the calculation of the redundant data block based on the original data block (i.e., the data to be written), or the data recovery based on the redundant data block (or the original data block), a multiplication operation between data units (specifically, a multiplication operation between the check matrix or the generator matrix and the original data block or the redundant data block) needs to be performed, and in order to reduce the calculation overhead of the operation and improve the performance of the encoding and decoding, the multiplication operation is often converted into an XOR operation. For example, the multiplication operation can be converted into an XOR operation through the matrix representation of a finite field. This conversion is a dense conversion mode, and the number of XOR operations after the conversion is relatively large, and the performance of the encoding and decoding cannot be significantly improved. In order to improve the performance of the encoding and decoding and reduce the number of XOR operations, the operation on a ring (i.e., a polynomial ring) can be converted. In this case, the finite field elements of the check matrix or the generator matrix (the finite field elements in the embodiments of the present application can also be referred to as data units) need to be converted into a 0-1 matrix on the ring (for example, into a column on the matrix), and other columns on the matrix can be obtained through a cyclic shift, and then a ring matrix used to represent the check matrix or the generator matrix is obtained. Then, an XOR operation is performed between the ring matrix and a binary vector used to represent the original data block or the redundant data block, and a calculation result is obtained. In the prior art, the ring conversion technology converts the elements of the finite field GF(2 m ) into the polynomial ring with the polynomial x m +x m-1 +…+x+1. However, the conversion of the elements on the finite field into the ring matrix does not exist for any finite field. For example, for the finite field GF(2 m ), when the polynomial x m +x m-1 +…+x+1 is irreducible (the polynomial can be considered to be reducible when the polynomial can be decomposed into the product of multiple polynomials), the ring conversion (conversion into the ring corresponding to the polynomial x m +x m +…+x+1) on GF(2 m-1 ) is feasible, and when the polynomial x m +x m-1 +…+x+1 is reducible, the ring conversion (conversion into the ring corresponding to the polynomial x m +x m +…+x+1) on GF(2 m-1 ) is infeasible, for example, GF(256). FIG. 4 exemplarily shows an encoding process based on the erasure code of the storage controller, and the encoding process shown in FIG. 4 can include steps S401-S402. S401, obtaining a target matrix, the target matrix being a check matrix or a generator matrix, and the target matrix being a finite field 2 aThe binary matrix of the data unit is represented on a polynomial ring, and a polynomial corresponding to the polynomial ring is an irreducible polynomial with a highest degree not greater than the a. In a possible implementation, when encoding the data to be written (which can be referred to as an original data block in embodiments of the present application), the data to be written can be obtained, and the data to be written can be encoded to obtain a plurality of redundant data blocks. The data to be written can be divided into a plurality of data blocks, and embodiments of the present application do not limit the division manner of the data to be written. In a possible implementation, when recovering the data of the storage node, the data (which can be an original data block or a redundant data block) on the other nodes (nodes without lost data) can be obtained, and the obtained data can be encoded to obtain the data on the storage node that needs to be recovered. In the above encoding object (original data block or redundant data block), for the convenience of description, embodiments of the present application collectively refer to the data block. In a possible implementation, the data block can be encoded according to the check matrix or the generator matrix. For example, the data block (original data block) can be encoded according to the check matrix or the generator matrix to obtain the redundant data block. Specifically, for the original data block with a code length of n and a dimension of k, the redundant data block can be calculated based on the following relationship in the data encoding process: H x [m, p] T = H x [m1, m2, …, m k , p1, …, p n-k ] T = 0. Wherein m i (1≤i≤k) is a data unit in the original data block, m i = [m i,1 , m i,2 , …, m i,α ] contains α data bits or data symbols; p i (1≤i≤n-k) is a redundant data block generated by encoding, p i = [p i,1 , p i,2 , …, p i,α ] contains α check bits or check symbols. The above encoding process includes multiplication operations between data units (for example, multiplication operations between data units of the original data block and data units of the matrix (check matrix or generator matrix). The check matrix or the generator matrix can be represented by a polynomial ring, wherein the check matrix or the generator matrix can include a plurality of data units, the data unit can be an element in the matrix, and the data unit can be a finite field 2 aThe data unit within the polynomial ring can be a matrix (that is, the target matrix in the embodiments of this application), and the target matrix is ​​the finite field 2. a The data units (belonging to parity-check matrices or generator matrices) are represented as binary matrices on a polynomial ring (the elements of a binary matrix are matrices represented in binary form). In existing techniques, this is specifically addressed for finite fields 2... a The polynomial corresponding to the polynomial ring converted from the data unit is x. a +x a-1 +…+x 2 +x+1=0 (The chosen polynomial affects the size of the polynomial ring), the highest degree of this polynomial is a, the coefficient of each term is 1, and the degree of each term decreases from a until it becomes 0. In this polynomial (x a +x a-1 +…+x 2 When (x + 1 = 0) is a reducible polynomial, the finite field 2 cannot be converted. a Data units converted to x a +x a-1 +…+x 2 The polynomial ring corresponding to +x+1=0. However, for polynomials of the highest degree a (with a coefficient of 1 for each term) (excluding x... a +x a-1 +…+x 2 The polynomial ∪ + x + 1 = 0 often includes one or more irreducible polynomials. In the embodiments of this application, one irreducible polynomial can be selected as the polynomial corresponding to the polynomial ring, thereby making the finite field 2 a The data units can be transformed to be represented on the corresponding polynomial ring. Then, the XOR operation, which is equivalent to multiplication, can be performed on the data represented on the polynomial ring, thereby reducing the computational overhead. Taking the parity check matrix H as an example (the generator matrix is ​​similar to the parity check matrix, and you can refer to the description of the parity check matrix), a schematic diagram of the form of the parity check matrix H is as follows: Among them, h i,j ∈GF(2 α )=GF(2)[x] / (p(x)), which represents a polynomial of degree less than α over GF(2), where p(x) is an irreducible polynomial of degree α over GF(2). A suitable irreducible polynomial p(x) can be chosen to obtain the polynomial ring F2[x] / (x) used to represent the parity check matrix H. ord(p(x)) +1). In one possible implementation, for finite field 2 aThe polynomial can be selected from the irreducible polynomial(s) with the highest degree not greater than a. For example, the polynomial with the smallest degree can be selected from the irreducible polynomial(s) with the highest degree not greater than a, where the degree of the polynomial is defined as the smallest b in one or more expressions of the form xb+1 that can be divided by the polynomial. For example, the polynomial can divide x 3 +1 and x 4 +1, the degree of the polynomial is 3. The degree of the polynomial in the embodiments of the present application can be denoted as ord(p(x)). The selection of the polynomial can affect the structure of the polynomial ring, the determination process, and the ring inverse transformation process (i.e., from the polynomial ring back to the finite field). The following will be introduced respectively: 1. The selection of the polynomial can affect the size of the polynomial ring. In a possible implementation, the check matrix or the generator matrix can include a plurality of data units (i.e., elements in the matrix), where the target matrix is obtained by representing each data unit by a polynomial ring. Taking one data unit (a first data unit) in the plurality of data units as an example, the target matrix can include a submatrix for representing the first data unit. When the submatrix of the first data unit is determined, a binary vector corresponding to the first data unit can be taken as a column of the submatrix, and then the column is cyclically shifted to obtain other columns, thereby obtaining the submatrix of the first data unit, where the number of rows of the submatrix is the degree of the polynomial corresponding to the polynomial ring. For example, the degree of the polynomial ring is 7, and the number of rows of the submatrix is 7. 2. The selection of the polynomial can affect the homomorphism transformation process of the polynomial ring. Still taking the first data unit as an example, in a possible implementation, when the submatrix of the first data unit is determined, a binary vector corresponding to the first data unit can be taken as a column of the submatrix (for example, each element in the binary representation is sequentially filled from top to bottom on the column of the submatrix, or each element after being filled is transformed, i.e., a "0" element is changed to a "1", and a "1" is changed to a "0"). And for the column, a certain transformation (which is a homomorphism transformation, i.e., will not affect the result of subsequent calculation) can be performed, which can be changing the "0" elements in the column to "1", or changing "1" to "0". In one possible implementation, the submatrix includes a target column, which is obtained by transforming a portion of the binary elements after filling the binary representation of the first data unit, wherein the elements of the portion are selected from the last M rows of the target column. The target column comprises X rows, wherein it can be determined whether each element in the last M rows of the X rows is 1 or 0, wherein when an element is 1, the elements of the preceding rows are transformed based on the polynomial, for example, the polynomial is x. 4 +x+1=0, before performing the transformation, we can... 4 If the elements in the corresponding row are set to 1, and the elements in the row corresponding to x are set to 1, and the elements in the row corresponding to 1 are set to 1, then when the first line of the next M rows is 1, the polynomial is x. 5 +x 2 +x = 0, therefore, x 2 The corresponding row will be transformed, and the row corresponding to x will be transformed. In one possible implementation, the fewer the number of "1" elements and the more "0" elements in the polynomial ring, the lower the computational cost of subsequent XOR operations. Therefore, when performing homomorphic transformations on submatrices, the objective can be set as: to minimize the number of "1" elements in the submatrices through homomorphic transformations. Specifically, the target column is obtained by filling the binary representation of the first data unit and then performing the transformation on some of the binary elements to minimize the number of 1s in the submatrix used to represent the first data unit. It should be understood that each submatrix of the data unit included in the target matrix can be obtained by performing a homomorphic transformation with the target as the optimization direction described above, thereby making the target matrix as a whole include fewer "1" elements and more "0" elements. For example, for each element within a finite field, the optimal homomorphic transformation for each element can be determined: Subject to:l0,l1,…,lord(p(x))-1-α∈{0,1}; in, Let represent the image of a finite field element a(x), which is the polynomial ring of the finite field element a(x). wt() represents the weight of the image, which is the number of 1 elements included in the polynomial ring. Min means minimizing. Subject to: l0, l1, ..., lord(p(x))-1-α∈{0,1} means that the first M(ord(p(x))-1-α) rows of the column can be transformed. In this way, the embodiment of the present application corresponds each element to a most simplified homomorphism transformation (finite field to polynomial ring), and the weight of the transformed image is minimum. In addition, after determining the sub-matrix of the elements in the finite field, it is necessary to select the elements for constituting the target matrix from the elements in the finite field and the positions of the sub-matrix corresponding to the elements in the target matrix. For the target matrix, the number of included "1" elements is less, which reduces the calculation power consumption of subsequent XOR operation, and the selection of the elements in the finite field and the positions of the sub-matrix corresponding to the elements in the target matrix needs to meet the optimal compromise of storage overhead and fault tolerance capability (i.e., meet the maximum distance separable (MDS) property). Specifically, in a possible implementation, the target matrix includes a plurality of sub-matrix groups for representing a plurality of data units, and the positions of the plurality of data units and the corresponding sub-matrix in the target matrix are selected from the finite field 2 a based on the following constraints: minimizing the number of "1" elements included in the target matrix while ensuring that the target matrix has the maximum distance separable (MDS) property. For example, taking a check matrix as an example, for a matrix where h′ i,j (x)∈GF(2)[x] / (x ord(p(x)) +1); satisfies: A check matrix H can be constructed: where mod represents modulo. In this way, the sub-matrix corresponding to the element of the finite field is filled to obtain the generator matrix or the check matrix, the matrix satisfies the MDS property, and the weight corresponding to the matrix is minimum, so that the coding and decoding complexity is minimum, and the calculation power consumption is reduced. S402, encoding the data block according to the target matrix to obtain an encoding result; wherein the encoding result is used as a redundant data block of the data block; or the encoding result is a recovery result of the data block of the node. Wherein, when the data block is encoded according to the target matrix, multiplication operation between data units can be performed. Since the target matrix is represented by a polynomial ring, the multiplication operation between data units can be realized by XOR operation between the polynomial ring and the binary vector, and ring inverse transformation. In a possible implementation, the target matrix includes a sub-matrix for representing a first data unit, the data block includes a second data unit, the second data unit is represented by a first vector, the first vector is a binary vector, an exclusive OR operation can be performed on the sub-matrix and the first vector to obtain a second vector, the second vector is a binary vector, and then a polynomial with binary elements in the second vector as coefficients can be divided by and taken modulo a polynomial corresponding to the polynomial ring to obtain an operation result equivalent to a product result of the first data unit and the second data unit. The above division and modulo operation is a process of ring inversion, that is, converting data represented by a ring into a finite field. For example, the second vector obtained by performing the exclusive OR operation on the sub-matrix and the first vector is [00000100], the polynomial with binary elements in the second vector as coefficients is x 6 4 +x+1=0, and the result obtained by dividing the polynomial with binary elements in the second vector as coefficients by and taking modulo the polynomial corresponding to the polynomial ring is

[0110] . Embodiments of the present application propose a high-performance array code encoding and decoding technology based on homomorphic computation. The construction of an array code (i.e., the design of a check matrix) is considered, a 0-1 matrix is obtained through homomorphic transformation, the multiplication in a finite field is converted into an exclusive OR operation in a polynomial ring, and finally the computation result in the finite field is obtained by using ring inversion, thereby reducing the encoding and decoding complexity and achieving the theoretical limit. Next, several specific examples are introduced. For example, a binary code with a dimension k=6 and a code length of 8. For elements of a finite field 2 4 (that is, GF(16)), a polynomial p(x)=x 4 +x+1 is selected. First, homomorphic transformation is selected for each element of the finite field, so that the respective image weight is minimized, and part of the results are shown in Table 1. Table 1 Therefore, the check matrix constructed in the finite field is as follows: The above matrix can be converted into a 0-1 matrix through matrix representation of the finite field, so that the multiplication operation in the encoding and decoding process is converted into an exclusive OR operation, and the check matrix becomes the matrix shown in FIG. 5. However, the matrix here is relatively dense, and the computation complexity is still high. In order to simplify the operation, the above matrix operation process can be divided into two steps, the first step is the check matrix operation in the ring, and the second step is the inversion matrix for converting the ring operation result into the finite field operation result.​ The check matrix for the polynomial ring can be shown in Fig. 6. Therefore, this step of encoding calculation only needs (48-4-9) ÷ 4 = 8.75 times of XOR. When the ring inverse transformation is performed, the inverse transformation matrix is shown in Fig. 7. Since the first redundancy is the identity transformation, the inverse operation is not needed, so this step of calculation only needs (2-1) x (15-4) ÷ 4 = 2.75 times of XOR. Finally, the encoding process only needs 11.5 times of XOR, reaching the theoretical limit, and the encoding process is incremental, that is, one block is calculated after reading one block. Taking a binary code with dimension k = 15 and code length 17 as an example. The elements of the finite field 2 4 (that is, GF(16)) are selected, and the selected polynomial is p(x) = x 4 +x+1. First, the selection of the homomorphic transformation of each finite field element is performed so that the respective image weight is minimized, and part of the results are shown in Table 2: [Regulation 26 Article 25.09.2025] Table 2 [Regulation 26 Article 25.09.2025] Therefore, the check matrix constructed on the finite field is as follows: The above matrix can be converted into a 0-1 matrix through the matrix representation of the finite field, so that the multiplication operation in the encoding and decoding process is converted into the XOR operation, and the check matrix becomes the matrix shown in Fig. 8. However, the matrix here is relatively dense, and the computational complexity is still high. In order to simplify the operation, the above matrix operation process can be divided into two steps, the first step is the check matrix operation on the ring, and the second step is the inverse transformation matrix for converting the ring operation result into the finite field operation result. The check matrix for the polynomial ring can be shown in Fig. 9. Therefore, this step of encoding calculation only needs (120-4-15) ÷ 4 = 25.25 times of XOR. When the ring inverse transformation is performed, the inverse transformation matrix is shown in Fig. 10. Since the first redundancy is the identity transformation, the inverse operation is not needed, so this step of calculation only needs (2-1) x (15-4) ÷ 4 = 2.75 times of XOR. Finally, the encoding process only needs 11.5 times of XOR, reaching the theoretical limit, and the encoding process is incremental, that is, one block is calculated after reading one block. Taking a binary code with dimension k = 20 and code length 23 as an example. The elements of the finite field 28 (that is, GF(256)) are selected, and the selected polynomial is p(x) = x 8 +x 5+x 4 +x 3 +1, first, the selection of homomorphism transformation for each finite field element is performed, so that the respective image weight is minimum, and part of the results are shown in Table 3: [Rule 26, 25.09.2025] Table 3 [Rule 26, 25.09.2025] Therefore, the check matrix constructed on the finite field is as follows: The above matrix can be converted into a 0-1 matrix through the matrix representation of the finite field, so that the multiplication operation in the encoding and decoding process is converted into an exclusive or operation, but the matrix is relatively dense, and the calculation complexity is still high. In order to simplify the operation, the above matrix operation process can be divided into two steps, the first step is the check matrix operation on the ring, and the second step is the inverse transformation matrix for converting the ring operation result into the finite field operation result. For the check matrix calculation on the polynomial ring, the check matrix can be as shown in FIG. 11. Therefore, this step of encoding calculation only needs (528-8-17-17) ÷8=60.75 times of exclusive or. When the ring inverse transformation is performed, the inverse transformation matrix is as shown in FIG. 12. Since the first redundancy is an identity transformation, no inverse operation is needed, so this step of calculation only needs (3-1) × (48-8) ÷8=10 times of exclusive or. Finally, the encoding process only needs 70.75 times of exclusive or, which approaches the theoretical limit, and the encoding process is incremental, that is, one block is calculated at a time. In a possible implementation, the present application provides a data encoding device. The data encoding device comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory and send the signal to the processor, the signal comprising computer instructions stored in the memory; when the processor executes the computer instructions, the processor can implement the data encoding method in any of the above embodiments. The effect of the code generation device of the present embodiment is similar to that of the data encoding method of each of the above embodiments, which will not be repeated here. Next, a device provided by an embodiment of the present application is introduced. As shown in FIG. 13: FIG. 13 is a structural schematic diagram of a data encoding device provided by an embodiment of the present application. As shown in FIG. 13, the device 500 can comprise a processor 501, a transceiver 505, and optionally further comprise a memory 502. The transceiver 505 can be referred to as a transceiving unit, a transceiver, or a transceiving circuit, etc., for realizing a transceiving function. The transceiver 505 can include a receiver and a transmitter. The receiver can be referred to as a receiver or a receiving circuit, etc., for realizing a receiving function; the transmitter can be referred to as a transmitter or a transmitting circuit, etc., for realizing a transmitting function. The memory 502 can store computer programs or software codes or instructions 504, which can also be referred to as firmware. The processor 501 can control the MAC layer and the PHY layer by running the computer programs or software codes or instructions 503 therein, or by invoking the computer programs or software codes or instructions 504 stored in the memory 502, to implement the data encoding method, or the encoding method, or the decoding method provided by the embodiments of the present application. The processor 501 can be a central processing unit (CPU). The memory 502 can be a read-only memory (ROM) or a random access memory (RAM). The processor 501 and the transceiver 505 described in the present application can be implemented on an integrated circuit (IC), an analog IC, a radio frequency integrated circuit (RFIC), a mixed-signal IC, an application specific integrated circuit (ASIC), a printed circuit board (PCB), an electronic device, etc. The apparatus 500 described above can further include an antenna 506. The modules included in the data encoding apparatus 500 are merely exemplary, and the present application does not limit the same. The structure of the data encoding apparatus, the encoding apparatus, and the decoding apparatus can not be limited by FIG. 9. The data encoding apparatus, the encoding apparatus, and the decoding apparatus can be a standalone device or a part of a larger device. For example, the implementation form of the data encoding apparatus can be: (1) a standalone integrated circuit (IC), or a chip, or a chip system or a subsystem; (2) a set of one or more ICs, optionally including a storage component for storing data and instructions; (3) a module that can be embedded in other devices; (4) a vehicle-mounted device, etc.; (5) other, etc. For the implementation form of the data encoding device, the encoding device and the decoding device is a chip or a chip system, refer to the structure schematic diagram of the chip shown in FIG. 14. The chip shown in FIG. 14 includes a processor 601 and an interface 602. The number of the processor 601 can be one or more, and the number of the interface 602 can be multiple. Optionally, the chip or the chip system can include a memory 603. All the related contents of each step involved in the above method embodiments can be cited to the function description of the corresponding function module, which will not be repeated here. Based on the same technical concept, the embodiment of the present application also provides a computer readable storage medium, which stores a computer program, the computer program includes at least one code, the at least one code can be executed by a computer to control the computer to realize the above-mentioned method embodiment. Based on the same technical concept, the embodiment of the present application also provides a computer program, when the computer program is executed, to realize the above-mentioned method embodiment. The program can be stored on a storage medium packaged with the processor, or partially or entirely stored on a storage medium not packaged with the processor. Based on the same technical concept, the embodiment of the present application also provides a chip including a processor. The processor can realize the above-mentioned method embodiment. Referring to FIG. 15, FIG. 15 is a structure schematic diagram of a data encoding device provided by an embodiment of the present application, wherein the device includes: The obtaining module 1501 is configured to obtain a target matrix, the target matrix being a check matrix or a generator matrix, the target matrix being a binary matrix representing a data unit in a finite field 2 a on a polynomial ring, and the polynomial corresponding to the polynomial ring being an irreducible polynomial with the highest degree not greater than a. The description about the obtaining module 1501 can refer to the introduction of step S401 in the above-mentioned embodiments, and the similar parts will not be repeated here. The encoding module 1502 is configured to encode a data block according to the target matrix to obtain an encoding result; wherein, The encoding result is used as a redundant data block of the data block; or the encoding result is a recovery result of the data block of the node. In a possible implementation, x a +x a-1 +…+x 2 +1=0 is a reducible polynomial, and the polynomial corresponding to the polynomial ring is an irreducible polynomial with the highest degree not greater than a. In a possible implementation, the data block and the encoding result are stored in different nodes. In a possible implementation, the polynomial ring corresponds to a polynomial with the minimum order among irreducible polynomials with the maximum degree no greater than the a, where the polynomial can divide one or more expressions in the form of x b +1, and the order of the polynomial is the value of the minimum b in the one or more expressions in the form of x b +1. In a possible implementation, the target matrix includes a submatrix for representing a first data unit, and the data block includes a second data unit, which is represented by a first vector, and the first vector is a binary vector. The processing module is specifically configured to: perform an exclusive OR operation on the submatrix and the first vector to obtain a second vector, and the second vector is a binary vector; divide a polynomial with binary elements in the second vector as coefficients by a polynomial corresponding to the polynomial ring and take the remainder to obtain an operation result equivalent to a product result of the first data unit and the second data unit. In a possible implementation, the target matrix includes a submatrix for representing a first data unit, and the number of rows of the submatrix is the order of a polynomial corresponding to the polynomial ring. In a possible implementation, the target column is obtained by performing the transformation on partial binary elements after padding the binary representation of the first data unit, so that the number of elements including 1 in a submatrix for representing the first data unit is minimized, and the transformation includes changing 0 to 1 or changing 1 to 0. In a possible implementation, the submatrix includes a target column, and the target column is obtained by performing a transformation on partial binary elements after padding the binary representation of the first data unit, and the target column includes X rows, and the transformation includes: when an element of a target row in the M rows after the X rows is 1, an element of a row before the target row in the X rows is transformed based on the polynomial. In a possible implementation, the M is the difference between the X and the a. In a possible implementation, the target column is obtained by performing the transformation on partial binary elements after padding the binary representation of the first data unit, so that the number of elements including 1 in a submatrix for representing the first data unit is minimized. In a possible implementation, the target matrix includes a plurality of submatrices for representing a plurality of data units, and the plurality of data units and the corresponding submatrices are arranged at positions in the target matrix based on a constraint that the number of 1s in each row of the target matrix is less than or equal to the a.a selected from: minimizing the number of elements of 1 included in the target matrix, under the condition that the target matrix has a maximum distance separable (mds) property. The steps of methods or algorithms described in connection with the embodiments disclosed herein can be embodied directly in hardware, in software or in a combination of the two. Software embodied as instructions or code can be stored in a computer-readable medium, which can be any medium that can be read by a computer. A computer-readable medium can include a floppy diskette, flexible disk, hard disk, solid-state drive, magnetic tape, or any other medium that can be used to store and / or carry computer program code or instructions. Software embodied as instructions or code can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc. Any medium that can be used for carrying or storing computer program code or instructions can be referred to as a computer program product. A computer program product can be tangible in nature or intangible in nature (e.g., an electronic signal). Those skilled in the art should clearly understand that the functions described in the above one or more examples can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer readable medium or transmitted as one or more instructions or codes on a computer readable medium. The computer readable medium includes a computer storage medium and a communication medium, wherein the communication medium includes any medium that facilitates the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general or special purpose computer. The embodiments of the present application are described above in connection with the accompanying drawings, but the present application is not limited to the specific embodiments described above, which are merely illustrative, but not restrictive. Those skilled in the art can make many modifications to the embodiments of the present application without departing from the spirit and scope of the present application and the claims, and all such modifications are intended to be within the scope of the present application.

Claims

1. A data encoding method characterized by, The method comprises the following steps: Obtaining a target matrix, the target matrix is a check matrix or a generator matrix, the target matrix is a binary matrix representing a data unit of a finite field 2 a on a polynomial ring, and the polynomial ring corresponds to an irreducible polynomial with a highest degree not greater than the a; According to the target matrix, the data block is encoded to obtain an encoding result; wherein, The encoding result is used as a redundant data block of the data block; or the encoding result is a recovery result of the data block of the node.

2. The method of claim 1, wherein, x a +x a-1 +…+x 2 +x+1=0 is a reducible polynomial, and the polynomial ring corresponds to a polynomial of the highest degree not greater than the a irreducible polynomial.

3. The method according to claim 1 or 2, characterized in that, The data block and the encoding result are stored in different nodes.

4. The method according to any one of claims 1 to 3, characterized in that, The polynomial corresponding to the polynomial ring is a polynomial with the smallest order among the irreducible polynomials with the highest degree not greater than the a, wherein the polynomial can divide one or more expressions in the form of x b +1, and the order of the polynomial is the value of the smallest b in the one or more expressions in the form of x b +1.

5. The method according to any one of claims 1 to 4, characterized in that, The target matrix comprises a sub-matrix for representing a first data unit, and the data block comprises a second data unit, which is represented by a first vector, and the first vector is a binary vector; The encoding according to the target matrix comprises the following steps: The sub-matrix and the first vector are subjected to XOR operation to obtain a second vector, and the second vector is a binary vector; A polynomial with binary elements in the second vector as coefficients is divided by a polynomial corresponding to the polynomial ring and taken as a remainder to obtain an operation result equivalent to a product result of the first data unit and the second data unit.

6. The method according to any one of claims 1 to 5, characterized in that, The target matrix comprises a sub-matrix for representing a first data unit, and the number of rows of the sub-matrix is the order of a polynomial corresponding to the polynomial ring.

7. The method according to any one of claims 1 to 6, characterized in that, The target column is obtained by filling the binary representation of the first data unit and performing the transformation on part of the binary elements to minimize the number of elements including 1 in the sub-matrix for representing the first data unit, and the transformation comprises changing 0 to 1 or changing 1 to 0.

8. The method according to any one of claims 1 to 7, characterized in that, The sub-matrix comprises a target column, which is obtained by filling the binary representation of the first data unit and performing the transformation on part of the binary elements, and the target column comprises X rows, and the transformation comprises: when the element of the target row in the M rows after the X rows is 1, the element of the row before the target row in the X rows is subjected to corresponding transformation based on the polynomial.

9. The method of claim 8, wherein, The M is the difference between the X and a.

10. The method according to claim 8 or 9, characterized in that, The target column is obtained by filling the binary representation of the first data unit and performing the transformation on part of the binary elements to minimize the number of elements including 1 in the sub-matrix for representing the first data unit.

11. The method according to any one of claims 1 to 10, characterized in that, The target matrix comprises a plurality of sub-matrix components for representing a plurality of data units, the plurality of data units and corresponding sub-matrix are selected from the finite field 2 a based on the following constraints: In the case of ensuring that the target matrix has the maximum distance separable (mds) property, the number of elements including 1 in the target matrix is minimized.

12. A data encoding device, comprising: The method comprises the following steps: The acquisition module is used to acquire a target matrix, which is either a parity check matrix or a generator matrix, and the target matrix is ​​a finite field 2 a The data unit is represented by a binary matrix on a polynomial ring, and the polynomial corresponding to the polynomial ring is an irreducible polynomial whose highest degree is not greater than a. The encoding module is configured to encode the data block according to the target matrix to obtain an encoding result; wherein, The encoding result is used as a redundant data block of the data block; or the encoding result is a recovery result of the data block of the node.

13. The apparatus of claim 12, wherein, x a +x a-1 +…+x 2 +x+1=0 is a reducible polynomial, and the polynomial ring corresponds to a polynomial of which the highest degree is not greater than the a is an irreducible polynomial.

14. The apparatus of claim 12 or 13, wherein, The data block and the encoding result are stored in different nodes.

15. The apparatus of any one of claims 12 to 14, wherein, The polynomial corresponding to the polynomial ring is a polynomial with the smallest order among the irreducible polynomials with the highest degree not greater than the a, wherein the polynomial can divide one or more expressions in the form of x b +1, and the order of the polynomial is the value of the smallest b in the one or more expressions in the form of x b +1.

16. The apparatus of any one of claims 12 to 15, wherein, The target matrix comprises a sub-matrix for representing a first data unit, and the data block comprises a second data unit, which is represented by a first vector, and the first vector is a binary vector; The processing module is specifically configured to: The sub-matrix and the first vector are subjected to XOR operation to obtain a second vector, and the second vector is a binary vector; Divide the polynomial with the binary elements in the second vector as coefficients by the polynomial corresponding to the polynomial ring and take the remainder to obtain an operation result equivalent to a multiplication result of the first data unit and the second data unit.

17. The apparatus of any one of claims 12 to 16, wherein, The target matrix includes a sub-matrix for representing the first data unit, and a number of rows of the sub-matrix is a degree of the polynomial corresponding to the polynomial ring.

18. The apparatus of any one of claims 12 to 17, wherein, The target column is obtained by performing the transformation on the binary elements of the padded part of the binary representation of the first data unit to minimize a number of elements including 1 in the sub-matrix for representing the first data unit, and the transformation includes changing 0 to 1 or changing 1 to 0.

19. The apparatus of any of claims 12 to 18, wherein, The sub-matrix includes a target column obtained by performing a transformation on the binary elements of the padded part of the binary representation of the first data unit, and the target column includes X rows, and the transformation includes: when an element of a target row in the M rows after the X rows is 1, performing a corresponding transformation on an element of a row before the target row in the X rows based on the polynomial.

20. The apparatus of claim 19, wherein, The M is a difference between the X and a.

21. The apparatus of claim 19 or 20, wherein, The target column is obtained by performing the transformation on the binary elements of the padded part of the binary representation of the first data unit to minimize a number of elements including 1 in the sub-matrix for representing the first data unit.

22. The apparatus of any one of claims 12 to 21, wherein, The target matrix comprises a plurality of sub-matrix components for representing a plurality of data units, the plurality of data units and corresponding sub-matrix are selected from the finite field 2 a based on the following constraints: Minimize a number of elements including 1 in the target matrix while ensuring that the target matrix has a maximum distance separable (MDS) property.

23. A computing device, comprising: The computing device includes a memory and a processor, and the processor executes computer instructions stored in the memory, so that the computing device performs the method in any one of claims 1 to 11.

24. A storage system, comprising: An apparatus includes any one of claims 12 to 22.

25. A computer-readable storage medium, characterized in that, Instructions that, when executed on a computing device, cause the computing device to perform the method in any one of claims 1 to 11.