Data encoding and decoding method, circuit, equipment, program product and storage medium
By using triple verification technology and intermediate variables and position parameters in parity principle in RAID technology, the problem of RAID performance being limited by high computational volume is solved, and a more efficient data encoding and decoding process is achieved.
Patent Information
- Application Number
- CN202510695163.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-28
AI Technical Summary
In the existing RAID technology, data encoding and decoding methods are computationally expensive, resulting in poor RAID performance.
In an independent disk redundant array using triple verification technology, the data to be generated is determined significantly by using the addition result of known terms in the parity principle of the target strip as an intermediate variable and combining the positional parameters of the unknown terms.
This method significantly reduces the amount of RAID operations and improves the performance of RAID.
Smart Images

Figure CN120216255A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of redundant arrays of independent disks, and in particular to a data encoding and decoding method, circuit, device, program product, and storage medium. Background Art
[0002] RAID (Redundant Arrays of Independent Disks) combines multiple independent disks into a whole to construct a disk group with a huge capacity, and can realize data recovery for failed disks through relevant disk array data encoding and decoding methods, thereby improving data reliability. However, there is a lack of a mature disk array data encoding and decoding method in the related art. The current data encoding and decoding methods have a large amount of calculation, resulting in poor RAID performance.
[0003] Therefore, how to provide a solution to the above technical problems is an issue that those skilled in the art need to solve currently. Summary of the Invention
[0004] The purpose of the present invention is to provide a data encoding and decoding method, circuit, device, program product, and storage medium. In a redundant array of independent disks applying triple parity check technology, three data to be generated in a target stripe can be determined. Then, for any relational expression in the parity check principle of the target stripe, the addition operation result of each known term in the relational expression is used as an intermediate variable. Combining the position parameters of the unknown terms and the intermediate variable in each relational expression according to the parity check principle of the target stripe, each data to be generated is determined. Since the addition operation result of the known terms in each relational expression is used as an intermediate variable for data generation, the amount of calculation can be significantly reduced, thereby improving the RAID performance.
[0005] To solve the above technical problems, the present invention provides a data encoding and decoding method, including: In a redundant array of independent disks applying triple parity check technology, determine three data to be generated in a target stripe. Among them, when encoding the target stripe, the data to be generated includes the data of each parity block in the target stripe, and when decoding the target stripe, the data to be generated includes the data of each failed block in the target stripe; For any relational expression in the parity check principle of the target stripe, use the addition operation result of each known term in the relational expression as an intermediate variable, where the known term is the term involving the data in the difference set, and the difference set is the difference set of the total data set of the target stripe with respect to the data set to be generated, and the data set to be generated includes each data to be generated; Based on the position parameters of the unknown terms and the intermediate variables in each relation according to the parity check principle of the target stripe, determine each data to be generated, where any term in the relation is the product of the data body and its corresponding position parameter, and the unknown term is the term in the relation that contains the data to be generated.
[0006] On the other hand, based on the position parameters of the unknown terms and the intermediate variables in each relation according to the parity check principle of the target stripe, determining each data to be generated includes: Based on the position parameters of the unknown terms and the intermediate variables in each relation according to the parity check principle of the target stripe, determine the first data to be generated through the first correspondence; Based on the position parameters of the unknown terms, the intermediate variable, and the first data to be generated in each relation according to the parity check principle of the target stripe, determine the second data to be generated through the second correspondence; Based on the intermediate variable, the first data to be generated, and the second data to be generated, determine the third data to be generated through the third correspondence.
[0007] On the other hand, in a redundant array of independent disks applying triple parity check technology, determining three data to be generated in the target stripe includes: In a redundant array of independent disks applying triple parity check technology, determine the total number of failed disks; If the total number of failed disks is three, then use the data of the three failed blocks in the target stripe as the data to be generated; If the total number of failed disks is two, then use the slowest-reading non-failed disk in the redundant array of independent disks as a failed disk, and use the data of the three failed blocks in the target stripe as the data to be generated; If the total number of failed disks is one, then use the two slowest-reading non-failed disks in the redundant array of independent disks as failed disks, and use the data of the three failed blocks in the target stripe as the data to be generated.
[0008] On the other hand, for any relation in the parity check principle of the target stripe, taking the addition operation result of each known term in the relation as an intermediate variable includes: Taking the addition operation result of each known term in the first relation in the parity check principle as an intermediate variable through the first summation relation; Taking the addition operation result of each known term in the second relation in the parity check principle as an intermediate variable through the second summation relation; Taking the addition operation result of each known term in the third relation in the parity check principle as an intermediate variable through the third summation relation; The first summation relation includes: ; The second summation relation includes: ; The third summation relation includes: ; wherein, v1 is an intermediate variable determined by the first summation relation, v2 is an intermediate variable determined by the second summation relation, v3 is an intermediate variable determined by the third summation relation, n is the total number of blocks in the target stripe, d i is the data of the block with serial number i in the target stripe, x, y, and z are respectively the serial numbers of the blocks where the three data to be generated are located, and α i is the position parameter of the block with serial number i in the target stripe in the second relation, and β i is the position parameter of the block with serial number i in the target stripe in the third relation.
[0009] On the other hand, the first correspondence includes: ; ; The second correspondence includes: ; ; ; The third correspondence includes: ; wherein, d x , d y and d z are the first to third data to be generated respectively, α x , α y , α z are the position parameters corresponding to the positions x, y, and z in the target stripe in the second relation respectively, β x , β y , β z are the position parameters corresponding to the positions x, y, and z in the target stripe in the third relation respectively, and γ, , are all intermediate parameters.
[0010] On the other hand, the data encoding and decoding method further includes: In a redundant array of independent disks applying dual parity technology, determine two data to be generated in the target stripe.
[0011] On the other hand, in the redundant array of independent disks applying the double parity check technology, determining two data to be generated in the target stripe includes: In the redundant array of independent disks applying the double parity check technology, determining the total number of failed disks; If the total number of failed disks is two, taking the data of two failed blocks in the target stripe as the data to be generated; If the total number of failed disks is one, taking the slowest - reading non - failed disk in the redundant array of independent disks as a failed disk, and taking the data of two failed blocks in the target stripe as the data to be generated.
[0012] On the other hand, the data encoding and decoding method further includes: In the redundant array of independent disks applying the single parity check technology, determining one data to be generated in the target stripe.
[0013] To solve the above - mentioned technical problems, the present invention further provides a data encoding and decoding circuit, including: An intermediate variable determination circuit, which, for any relation in the parity check principle of the target stripe in the redundant array of independent disks applying the triple parity check technology, takes the addition operation result of each known term in the relation as an intermediate variable; A data determination circuit, which determines each data to be generated according to the position parameters of the unknown terms in each relation of the parity check principle of the target stripe and the intermediate variable; Among them, in the redundant array of independent disks applying the triple parity check technology, there are three data to be generated. When encoding the target stripe, the data to be generated includes the data of each parity check block in the target stripe. When decoding the target stripe, the data to be generated includes the data of each failed block in the target stripe. Any term in the relation is the product of the data body and its corresponding position parameter. The known term is the term involving the data in the difference set in the relation, the unknown term is the term containing the data to be generated in the relation, the difference set is the difference set of the total data set of the target stripe with respect to the data set to be generated, and the data set to be generated includes each data to be generated.
[0014] On the other hand, the intermediate variable determination circuit is further used for: In the redundant array of independent disks applying the double parity check technology or the single parity check technology, for any relation in the parity check principle of the target stripe, taking the addition operation result of each known term in the relation as an intermediate variable; The intermediate variable determination circuit includes: A first summation sub - circuit, which sums each known term in the first relation of the parity check principle of the target stripe to obtain an intermediate variable; A second summing sub-circuit for summing each known term in the second relation of the parity check principle of the target stripe to obtain an intermediate variable; A third summing sub-circuit for summing each known term in the third relation of the parity check principle of the target stripe to obtain an intermediate variable; Among them, the parity check principle of the triple check technology includes the first to third relations, the parity check principle of the double check technology includes the first and second relations, and the parity check principle of the single check technology includes the first relation.
[0015] On the other hand, the first summing sub-circuit includes: A first adder for summing each known term in the first relation of the parity check principle of the target stripe to obtain an intermediate variable; The second summing sub-circuit includes: n - 3 first multipliers for determining each known term in the second relation of the parity check principle of the target stripe according to the data body of each known term and its corresponding position parameter in the second relation; A second adder for summing each known term in the second relation to obtain an intermediate variable; The third summing sub-circuit includes: n - 3 second multipliers for determining each known term in the third relation of the parity check principle of the target stripe according to the data body of each known term and its corresponding position parameter in the third relation; A third adder for summing each known term in the third relation to obtain an intermediate variable, where n is the total number of blocks in a single stripe of the redundant array of independent disks.
[0016] On the other hand, the data determination circuit includes: A first determination circuit for determining the first data to be generated based on the elements in the first correspondence; A second determination circuit for determining the second data to be generated based on the elements in the second correspondence; A third determination circuit for determining the third data to be generated based on the elements in the third correspondence; The first correspondence includes: ; ; The second correspondence includes: ; ; ; The third corresponding relationship includes: ; wherein, v1 is an intermediate variable determined by the first summing sub-circuit, v2 is an intermediate variable determined by the second summing sub-circuit, v3 is an intermediate variable determined by the third summing sub-circuit, d x , d y and d z are respectively the first to third data to be generated, and α x , α y , α z are respectively position parameters corresponding to positions x, y, z in the target strip in the second relational expression, and β x , β y , β z are respectively position parameters corresponding to positions x, y, z in the target strip in the third relational expression, and γ, , are all intermediate parameters.
[0017] To solve the above technical problems, the present invention further provides a data encoding and decoding device, including: a memory for storing a computer program; a processor for implementing the steps of the data encoding and decoding method as described above when executing the computer program.
[0018] To solve the above technical problems, the present invention further provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the data encoding and decoding method as described above are implemented.
[0019] To solve the above technical problems, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data encoding and decoding method as described above are implemented.
[0020] Beneficial effects: The present invention provides a data encoding and decoding method. Considering that if all known terms involved in the parity check principle are expanded and operated during the encoding and decoding process of the target stripe, it will be accompanied by a huge amount of computation, and the summation result of the known terms can be used as a known intermediate variable for operation. Therefore, in the present invention, in a redundant array of independent disks applying the triple parity check technology, three data to be generated in the target stripe can be determined. Then, for any relational expression in the parity check principle of the target stripe, the addition operation result of each known term in the relational expression is used as an intermediate variable, and in combination with the position parameters of the unknown terms and the intermediate variable in each relational expression according to the parity check principle of the target stripe, each data to be generated is determined. Since the addition operation result of the known terms in each relational expression is used as an intermediate variable for data generation, the amount of computation can be significantly reduced, thereby improving the RAID performance.
[0021] The present invention also provides a data encoding and decoding circuit, device, program product, and storage medium, which have the same beneficial effects as the above data encoding and decoding method. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for use in the related art and embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0023] Figure 1 It is a schematic flowchart of a data encoding and decoding method provided by the present invention; Figure 2 It is a schematic structural diagram of a first summation sub-circuit provided by the present invention; Figure 3 It is a schematic structural diagram of a second summation sub-circuit provided by the present invention; Figure 4 It is a schematic structural diagram of a third summation sub-circuit provided by the present invention; Figure 5 It is a schematic structural diagram of a first determination circuit provided by the present invention; Figure 6 It is a schematic structural diagram of a second determination circuit provided by the present invention; Figure 7 It is a schematic structural diagram of a third determination circuit provided by the present invention; Figure 8 It is a schematic structural diagram of a data encoding and decoding device provided by the present invention; Figure 9 It is a schematic structural diagram of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] The core of the present invention is to provide a data encoding and decoding method, circuit, device, program product and storage medium, which can determine three data to be generated in a target stripe in an independent disk redundant array applying triple parity check technology. Then, for any relational expression in the parity check principle of the target stripe, the addition operation result of each known term in the relational expression is used as an intermediate variable, and combined with the position parameters of the unknown terms and the intermediate variable in each relational expression according to the parity check principle of the target stripe, each data to be generated is determined. Since the addition operation result of the known terms in each relational expression is used as an intermediate variable for data generation, the amount of computation can be significantly reduced, thereby improving the RAID performance.
[0025] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0026] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a data encoding and decoding method provided by the present invention. The data encoding and decoding method includes: S101: In an independent disk redundant array applying triple parity check technology, determine three data to be generated in a target stripe. Among them, when encoding the target stripe, the data to be generated includes the data of each parity block in the target stripe, and when decoding the target stripe, the data to be generated includes the data of each failed block in the target stripe.
[0027] Specifically, considering that if all known terms involved in the parity check principle are expanded and operated during the encoding and decoding process of the target stripe, it will be accompanied by a huge amount of computation, and the "summation operation of known terms" is involved in the encoding and decoding process, and the summation result of the known terms can be used as a known intermediate variable for operation. Therefore, in the embodiments of the present invention, during the encoding and decoding process of TP-RAID (Triple Parity Redundant Arrays of Independent Disks), the "summation result of known terms" is used as a known intermediate variable to participate in the encoding and decoding operation process, so as to simplify a large number of operation processes. And TP-RAID needs to generate the data of three parity blocks during the stripe encoding process and can support the data recovery of up to three failed blocks during fault recovery. Therefore, in this step, three data to be generated in the target stripe can be first determined in an independent disk redundant array applying triple parity check technology, so as to use them as the data basis for the subsequent steps.
[0028] Among them, when encoding the target stripe, the data to be generated includes the data of each parity block in the target stripe, and when decoding the target stripe, the data to be generated includes the data of each failed block in the target stripe. In this way, the same set of encoding and decoding methods can be used in the encoding and decoding processes, which is beneficial to further reducing the volume of relevant circuits or the amount of programs, thereby further reducing costs.
[0029] S102: For any relation in the parity check principle of the target stripe, take the addition operation result of each known term in the relation as an intermediate variable, where the known term is the term involving the data in the difference set, and the difference set is the difference set of the total data set of the target stripe with respect to the data set to be generated, and the data set to be generated includes each data to be generated.
[0030] Specifically, the encoding and decoding process of the target stripe can actually be understood as a process of solving the data to be generated based on the parity check principle. There are three relations in the parity check principle of TP-RAID, so it is necessary to determine the data of three parity blocks, and at most three failed block data recoveries can be supported during the decoding process. Any relation in the parity check principle is actually an equation of the data in each data block and parity block. Therefore, three relations can solve three data to be generated. During the solving process, three equations about the data to be generated can be listed according to the three relations, so as to realize the simultaneous solution of the three data to be generated. And in the relation, there is an operation on "the term where the data in the non-failed block is located", that is, the operation of the known term in this article. By taking the addition operation result of each known term in the relation as an intermediate variable, the calculation amount in the solving process can be greatly reduced. Therefore, in the embodiments of the present invention, for any relation in the parity check principle of the target stripe, take the addition operation result of each known term in the relation as an intermediate variable and use it as the data basis for the subsequent solving process.
[0031] Among them, the block for storing data is called a data block, the block for storing parity data is called a parity block, and the block that fails is called a failed block.
[0032] S103: Determine each data to be generated according to the position parameters and intermediate variables of the unknown terms in each relation of the parity check principle of the target stripe, where any term in the relation is the product of the data body and its corresponding position parameter, and the unknown term is the term containing the data to be generated in the relation.
[0033] Specifically, after determining the intermediate variables in each relational expression, it is equivalent to reducing the operation factors in the relational expression. Then, the data to be generated can be solved based on the position parameters of the unknown terms in each relational expression and the intermediate variables, which reduces the calculation complexity and is conducive to reducing the circuit area or program volume, thereby reducing costs.
[0034] The present invention provides a data encoding and decoding method. Considering that if all known items involved in the parity check principle are expanded and operated during the encoding and decoding process of the target stripe, a huge amount of calculation will be involved, and the sum of the known items can be used as a known intermediate variable for calculation, the present invention can determine three data to be generated in the target stripe in an independent disk redundant array using a triple check technology, and then for any relationship in the parity check principle of the target stripe, the addition operation result of each known item in the relationship is used as an intermediate variable, and the position parameters of the unknown items in each relationship according to the parity check principle of the target stripe and the intermediate variable are combined to determine each data to be generated. Since the addition operation result of the known items in each relationship is used as an intermediate variable for data generation, the amount of calculation can be significantly reduced, thereby improving the RAID performance.
[0035] On the basis of the above embodiments.
[0036] As an optional embodiment, according to the position parameters of unknown items in each relational expression of the parity check principle of the target stripe and the intermediate variables, determining each data to be generated includes: Based on the position parameters of unknown items in each relational expression of the parity check principle of the target stripe and the intermediate variables, the first data to be generated is determined through the first corresponding relationship; Based on the position parameters of the unknown items in each relational expression of the parity check principle of the target stripe, the intermediate variables and the first data to be generated, the second data to be generated is determined through the second corresponding relationship; Based on the intermediate variable, the first data to be generated and the second data to be generated, the third data to be generated is determined through a third corresponding relationship.
[0037] Specifically, considering that the solution process of three data to be generated based on three relational equations can be regarded as a process of solving multiple relational equations simultaneously, we can first solve the first data to be generated, and then use the first data to be generated as known data to solve the second data to be generated. Finally, the first and second data to be generated can be used as known data to solve the third data to be generated, so that the three data to be generated can be solved efficiently and accurately.
[0038] As an optional embodiment, in a redundant array of independent disks using a triple check technology, determining three to-be-generated data in a target stripe includes: In a redundant array of independent disks (RAID) applying triple parity checking technology, determine the total number of failed disks; If the total number of failed disks is three, use the data of the three failed blocks in the target stripe as the data to be generated; If the total number of failed disks is two, use the slowest-reading non-failed disk in the redundant array of independent disks as a failed disk, and use the data of the three failed blocks in the target stripe as the data to be generated; If the total number of failed disks is one, use the two slowest-reading non-failed disks in the redundant array of independent disks as failed disks, and use the data of the three failed blocks in the target stripe as the data to be generated.
[0039] Specifically, considering that data recovery can be performed when 1 - 3 disks fail in TP-RAID, and to ensure that a single set of encoding / decoding programs or circuits is used when 1 - 3 disks fail, in the embodiments of the present invention, the total number of failed disks can be determined first. If the total number of failed disks is three, the data of the three failed blocks in the target stripe can be used as the data to be generated. If the total number of failed disks is two, the slowest-reading non-failed disk in the redundant array of independent disks is used as a failed disk, and the data of the three failed blocks in the target stripe is used as the data to be generated, thus avoiding reading the data in the data blocks of "the slowest-reading non-failed disk in the redundant array of independent disks", which is beneficial to improving the encoding / decoding efficiency. If the total number of failed disks is one, the two slowest-reading non-failed disks in the redundant array of independent disks are used as failed disks, and the data of the three failed blocks in the target stripe is used as the data to be generated, thus avoiding reading the data in the data blocks of "the two slowest-reading non-failed disks in the redundant array of independent disks", which is beneficial to improving the encoding / decoding efficiency.
[0040] Specifically, when the total number of failed disks is two, solve the data to be generated for the two truly failed blocks, and there is no need to solve the data to be generated for the actually non-failed blocks. Similarly, when the total number of failed disks is one, solve the data to be generated for the one truly failed block, and there is no need to solve the data to be generated for the actually non-failed blocks.
[0041] As an optional embodiment, for any relational expression in the parity checking principle of the target stripe, taking the addition operation result of each known term in the relational expression as an intermediate variable includes: Using the first summation relational expression to take the addition operation result of each known term in the first relational expression in the parity checking principle as an intermediate variable; Using the second summation relational expression to take the addition operation result of each known term in the second relational expression in the parity checking principle as an intermediate variable; Use the addition operation result of each known term in the third relation in the parity check principle as an intermediate variable through the third summation relation; The first summation relation includes: ; The second summation relation includes: ; The third summation relation includes: ; wherein, v1 is the intermediate variable determined by the first summation relation, v2 is the intermediate variable determined by the second summation relation, v3 is the intermediate variable determined by the third summation relation, n is the total number of blocks in the target stripe, d i is the data of the block with serial number i in the target stripe, x, y, z are respectively the serial numbers of the blocks where the three data to be generated are located, α i is the position parameter of the block with serial number i in the target stripe in the second relation, β i is the position parameter of the block with serial number i in the target stripe in the third relation.
[0042] Specifically, considering that in order to efficiently use the addition operation result of each known term in any relation in the parity check principle of the target stripe as an intermediate variable, and in order to be able to efficiently determine the intermediate variable using the same scheme regardless of the encoding or decoding process, in the embodiments of the present invention, three intermediate variables corresponding to the three relations can be determined through three summation relations.
[0043] Specifically, the three relations involved in the parity check principle in TP-RAID can be: ; wherein, the first row is the first relation, the second row is the second relation, the third row is the third relation, {d1,..., d k} are respectively the data in the first to kth data blocks in the target stripe, p1, p2, p3 are respectively the data of the three parity blocks in the target stripe, {α1,..., α k+1 , α k+2 , α k+3} are respectively the position parameters corresponding to the data of the first to k + 3rd blocks in the target stripe in the second relation, {β1,..., β k+1 , β k+2 , β k+3} are respectively the position parameters corresponding to the data of the first to k + 3rd blocks in the target stripe in the third relation, the first to kth blocks in the target stripe are all data blocks, and the (k + 1)th to (k + 3)th blocks are parity blocks.
[0044] Specifically, the position parameter can be flexibly set. For example, it can be set to α i =i, β i =i x , i ∈ {1, …, k + 3}; x ≥ 2 is the set parameter. In addition, the position parameter can also be set to other values that satisfy the verification constraints. Unless otherwise specified, all addition, multiplication, and division operations are performed in the finite field GF(2 m ), and m is the finite field parameter of the TP-RAID configuration.
[0045] As an alternative embodiment, the first correspondence includes: ; ; The second correspondence includes: ; ; ; The third correspondence includes: ; where d x , d y and d z are the first to third data to be generated respectively, α x , α y , α z are the position parameters corresponding to the positions x, y, z in the target stripe in the second relational expression respectively, β x , β y , β z are the position parameters corresponding to the positions x, y, z in the target stripe in the third relational expression respectively, γ, , are all intermediate parameters.
[0046] Specifically, through the first to third correspondences in the above form, the three data to be generated can be calculated efficiently and accurately.
[0047] Of course, in addition to the above specific form, the first to third correspondences can also be other specific forms, which are not limited in the embodiments of the present invention.
[0048] As an alternative embodiment, the data encoding and decoding method further includes: In an independent disk redundant array applying dual verification technology, determining two data to be generated in the target stripe.
[0049] Specifically, considering that the parity check principle of TP-RAID can be used to solve at most three data to be generated, based on this, the above solving method can be used to solve the data to be generated in the RAID of the dual parity check technology, and the same set of encoding and decoding methods or circuits can be used. Therefore, the data encoding and decoding method in the embodiments of the present invention can also determine two data to be generated in the target stripe in an independent disk redundant array applying the dual parity check technology. Thus, for the two data to be generated in the independent disk redundant array applying the dual parity check technology, the method of determining intermediate variables and obtaining the data to be generated is used to achieve efficient solution of the two data to be generated. That is, even if TP-RAID degrades to RAID 6, there is no need to change the corresponding encoding and decoding methods or encoding and decoding circuits, reducing the transformation cost and improving the flexibility of using the RAID card.
[0050] When TP-RAID degrades to RAID 6, the proposed TP-RAID data encoding and decoding method can still be used for the encoding and decoding operations of RAID6. Specifically: First, after degradation, the designed RAID 6 still adopts the parity check principle of TP-RAID and only uses the first relational expression and the second relational expression: ; Denote the total number of blocks in the stripe as n = k + 2. Assume that the data blocks to be solved by the encoding and decoding algorithm are d y and d z (the positions are y and z respectively); the two data to be generated are p1 and p2 during encoding and the blocks where actual errors occur during decoding.
[0051] Then, during encoding or decoding, according to the k data in the difference set {d1,..., d n}-{d y , d z} and the corresponding k position parameters, the first and second summation relational expressions (or the first and second summation sub-circuits) are used to calculate the values of the intermediate variables v1 and v2.
[0052] Next, set the values of the temporary variables d x and α x to 0. According to the values of the intermediate variables v1 and v2, the value of d y is calculated using the second determination circuit. Subsequently, the value of d z is calculated using the third determination circuit. The encoding or decoding operation of RAID 6 is completed.
[0053] As an optional embodiment, in an independent disk redundant array applying the dual parity check technology, determining two data to be generated in the target stripe includes: In a redundant array of independent disks (RAID) applying the double-check technology, determine the total number of failed disks; If the total number of failed disks is two, use the data of two failed blocks in the target stripe as the data to be generated; If the total number of failed disks is one, use the non-failed disk with the lowest read speed in the redundant array of independent disks as the failed disk, and use the data of two failed blocks in the target stripe as the data to be generated.
[0054] Specifically, similarly, in a redundant array of independent disks applying the double-check technology, if the total number of failed disks is one, the non-failed disk with the lowest read speed in the redundant array of independent disks can also be used as the failed disk, and the data of two failed blocks in the target stripe can be used as the data to be generated, thus avoiding reading the data in the "non-failed disk with the lowest read speed in the redundant array of independent disks", which is beneficial to improving the encoding and decoding efficiency.
[0055] As an optional embodiment, the data encoding and decoding method further includes: In a redundant array of independent disks applying the single-check technology, determine one piece of data to be generated in the target stripe.
[0056] Specifically, considering that the parity check principle of TP-RAID can solve at most three pieces of data to be generated, based on this, the above solving method can be used to solve the data to be generated in RAID (RAID 5) applying the single-check technology, and the same set of encoding and decoding methods or circuits can be used. Therefore, the data encoding and decoding method in the embodiments of the present invention can also determine one piece of data to be generated in the target stripe in a redundant array of independent disks applying the single-check technology, so as to efficiently solve one piece of data to be generated by using the method of determining intermediate variables and obtaining the data to be generated. That is, even if TP-RAID degrades to RAID 5, there is no need to change the corresponding encoding and decoding methods or encoding and decoding circuits, which reduces the transformation cost and improves the flexibility of using the RAID card.
[0057] Specifically, when TP-RAID actively degrades to RAID 5, since RAID 5 uses the single parity check method. The data block and the parity block satisfy: ; Therefore, the encoding and decoding algorithm of RAID 5 can be implemented through the exclusive OR addition operation in the finite field.
[0058] Assume the data block to be solved is d z , which is the parity block p1 in encoding and the data block with an error in decoding. According to the difference set {d1,..., d n}-{dz Among the k data blocks in}, the encoding and decoding method uses the first summation sub - circuit to calculate the value of the intermediate variable v1, and at this time v1 is d z . Complete the encoding or decoding operation of RAID 5.
[0059] To solve the above - mentioned technical problems, the present invention also provides a data encoding and decoding circuit, including: An intermediate variable determination circuit, which is used to, in a redundant array of independent disks applying triple - parity - check technology, for any relational expression in the parity - check principle of a target stripe, take the addition operation result of each known term in the relational expression as an intermediate variable; A data determination circuit, which is used to determine each data to be generated according to the position parameters of the unknown terms and the intermediate variable in each relational expression of the parity - check principle of the target stripe; Among them, in a redundant array of independent disks applying triple - parity - check technology, there are three data to be generated. When encoding a target stripe, the data to be generated includes the data of each parity block in the target stripe. When decoding a target stripe, the data to be generated includes the data of each failed block in the target stripe. Any term in the relational expression is the product of the data body and its corresponding position parameter. The known term is the term involving the data in the difference set in the relational expression, the unknown term is the term containing the data to be generated in the relational expression, the difference set is the difference set of the total data set of the target stripe with respect to the data set to be generated, and the data set to be generated includes each data to be generated.
[0060] Specifically, considering that the data encoding and decoding circuit in the form of hardware in the RAID card can uniformly implement the encoding and decoding work for TP - RAID, RAID 6, and RAID 5, thereby improving the encoding and decoding efficiency and reducing the hardware transformation cost. Therefore, the present invention provides a data encoding and decoding circuit in an embodiment. The intermediate variable determination circuit therein is used to, in a redundant array of independent disks applying triple - parity - check technology, for any relational expression in the parity - check principle of a target stripe, take the addition operation result of each known term in the relational expression as an intermediate variable; the data determination circuit can determine each data to be generated according to the position parameters of the unknown terms and the intermediate variable in each relational expression of the parity - check principle of the target stripe.
[0061] As an optional embodiment, the intermediate variable determination circuit is further used for: In a redundant array of independent disks applying double - parity - check technology or single - parity - check technology, for any relational expression in the parity - check principle of a target stripe, take the addition operation result of each known term in the relational expression as an intermediate variable; The intermediate variable determination circuit includes: A first summation sub - circuit, which is used to sum each known term in the first relational expression of the parity - check principle of the target stripe to obtain an intermediate variable; A second summing sub-circuit for summing all known terms in the second relational expression of the parity check principle of the target stripe to obtain an intermediate variable; A third summing sub-circuit for summing all known terms in the third relational expression of the parity check principle of the target stripe to obtain an intermediate variable; Among them, the parity check principle of the triple check technology includes the first to third relational expressions, the parity check principle of the double check technology includes the first and second relational expressions, and the parity check principle of the single check technology includes the first relational expression.
[0062] Specifically, considering that among the three relational expressions included in the parity check principle of the triple check technology, there are relational expressions in the parity check principle of the double check technology or the single check technology. Therefore, using the above data encoding and decoding circuit, theoretically, it is also possible to solve the data to be generated in a redundant array of independent disks applying the double check technology or the single check technology. Therefore, the intermediate variable determination circuit in the embodiments of the present invention can also, in a redundant array of independent disks applying the double check technology or the single check technology, for any relational expression in the parity check principle of the target stripe, use the addition operation result of all known terms in the relational expression as an intermediate variable; and the intermediate variable determination circuit can be composed of three summing sub-circuits corresponding to the three relational expressions respectively, with a simple structure and strong reliability.
[0063] Of course, in addition to this specific form, the intermediate variable determination circuit can also be in other forms, which are not limited in the embodiments of the present invention.
[0064] As an optional embodiment, the first summing sub-circuit includes: A first adder for summing all known terms in the first relational expression of the parity check principle of the target stripe to obtain an intermediate variable; The second summing sub-circuit includes: n - 3 first multipliers for determining all known terms in the second relational expression of the parity check principle of the target stripe according to the data body of each known term and its corresponding position parameter in the second relational expression; A second adder for summing all known terms in the second relational expression to obtain an intermediate variable; The third summing sub-circuit includes: n - 3 second multipliers for determining all known terms in the third relational expression of the parity check principle of the target stripe according to the data body of each known term and its corresponding position parameter in the third relational expression; A third adder, configured to sum up each known term in the third relational expression to obtain an intermediate variable, where n is the total number of blocks in a single stripe of a redundant array of independent disks (RAID).
[0065] Specifically, for better illustration of the embodiments of the present invention, please refer to Figures 2 to 4 , Figure 2 which is a schematic structural diagram of the first summation sub-circuit provided by the present invention, Figure 3 which is a schematic structural diagram of the second summation sub-circuit provided by the present invention, Figure 4 which is a schematic structural diagram of the third summation sub-circuit provided by the present invention.
[0066] Specifically, Figure 2 the adder in Figure 3 includes n - 3 first multipliers and one second adder, Figure 3 Based on the input data in Figure 2 the position parameters corresponding to each input data in the second relational expression are also used, Figure 4 includes n - 3 second multipliers and one third adder, Figure 4 Based on the input data in Figure 2 the position parameters corresponding to each input data in the third relational expression are also used.
[0067] Among them, the specific structures of the above summation sub-circuits have the advantages of strong generality, small volume and low cost.
[0068] Of course, in addition to the above specific forms, the summation sub-circuits can also be in other forms, which are not limited in the embodiments of the present invention.
[0069] As an optional embodiment, the data determination circuit includes: A first determination circuit, configured to determine a first data to be generated based on the elements in the first correspondence; A second determination circuit, configured to determine a second data to be generated based on the elements in the second correspondence; A third determination circuit, configured to determine a third data to be generated based on the elements in the third correspondence; The first correspondence includes: ; ; The second correspondence includes: ; ; ; The third correspondence includes: ; wherein, v1 is an intermediate variable determined by a first summing sub-circuit, v2 is an intermediate variable determined by a second summing sub-circuit, v3 is an intermediate variable determined by a third summing sub-circuit, d x , d y and d z are respectively the first to third data to be generated, α x , α y , α z are respectively position parameters corresponding to positions x, y, z in the target stripe in the second relational expression, β x , β y , β z are respectively position parameters corresponding to positions x, y, z in the target stripe in the third relational expression, γ, , are all intermediate parameters.
[0070] Specifically, for better illustration of the embodiments of the present invention, please refer to Figures 5 to 7 , Figure 5 which is a schematic structural diagram of the first determination circuit provided by the present invention, Figure 6 which is a schematic structural diagram of the second determination circuit provided by the present invention, Figure 7 which is a schematic structural diagram of the third determination circuit provided by the present invention.
[0071] Specifically, the first to third determination circuits in the embodiments of the present invention can respectively execute the operation logics of the first to third corresponding relationships, and have generality in RAID5, RAID 6, and TP-RAID, thereby realizing the flexible switching and use of the RAID card between different RAID levels; wherein, Figure 5 the first determination circuit in Figure 6 can implement the calculation logic of the first corresponding relationship, and is composed of 7 adders, 11 multipliers, and 1 inverse element circuit (for calculating the inverse element of a finite field element), Figure 7 the second determination circuit in
[0072] can implement the calculation logic of the second corresponding relationship, and is composed of 4 adders, 4 multipliers, and 1 inverse element circuit, Figure 8 , Figure 8 which is a schematic structural diagram of a data encoding and decoding device provided by the present invention, and the data encoding and decoding device includes: a memory 81 for storing a computer program; a processor 82 for implementing the steps of the data encoding and decoding method in the foregoing embodiments when executing the computer program.
[0073] For the introduction of the data encoding and decoding device provided in the embodiments of the present invention, please refer to the embodiments of the foregoing data encoding and decoding method, which will not be elaborated herein.
[0074] The present invention also provides a computer program product, including a computer program / instructions, which when executed by a processor, implement the steps of the data encoding and decoding method in the foregoing embodiments.
[0075] For the introduction of the computer program product provided in the embodiments of the present invention, please refer to the embodiments of the foregoing data encoding and decoding method, which will not be elaborated herein.
[0076] Please refer to Figure 9 , Figure 9 , which is a schematic structural diagram of a computer-readable storage medium provided by the present invention. A computer program 92 is stored on the computer-readable storage medium 91, and when the computer program 92 is executed by a processor, it implements the steps of the above data encoding and decoding method.
[0077] For the introduction of the computer-readable storage medium provided in the embodiments of the present invention, please refer to the embodiments of the foregoing data encoding and decoding method, which will not be elaborated herein.
[0078] In this specification, the embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0079] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data encoding and decoding method, characterized in that Including: In a redundant array of independent disks (RAID) applying triple parity checking technology, determine three data to be generated in a target stripe. Among them, when encoding the target stripe, the data to be generated includes the data of each parity block in the target stripe; when decoding the target stripe, the data to be generated includes the data of each failed block in the target stripe; For any relationship in the parity checking principle of the target stripe, take the addition operation result of each known term in the relationship as an intermediate variable, where the known term is the term involving the data in the difference set, and the difference set is the difference set of the total data set of the target stripe with respect to the data set to be generated, and the data set to be generated includes each data to be generated; According to the position parameters of the unknown terms in each relationship of the parity checking principle of the target stripe and the intermediate variable, determine each data to be generated, where any term in the relationship is the product of the data body and its corresponding position parameter, and the unknown term is the term containing the data to be generated in the relationship.
2. The data encoding and decoding method according to claim 1, characterized in that Determining each data to be generated according to the position parameters of the unknown terms in each relationship of the parity checking principle of the target stripe and the intermediate variable includes: Based on the position parameters of the unknown terms in each relationship of the parity checking principle of the target stripe and the intermediate variable, determine the first data to be generated through the first correspondence; Based on the position parameters of the unknown terms, the intermediate variable, and the first data to be generated in each relationship of the parity checking principle of the target stripe, determine the second data to be generated through the second correspondence; Based on the intermediate variable, the first data to be generated, and the second data to be generated, determine the third data to be generated through the third correspondence.
3. The data encoding and decoding method according to claim 2, characterized in that In a redundant array of independent disks (RAID) applying triple parity checking technology, determining three data to be generated in a target stripe includes: In a redundant array of independent disks (RAID) applying triple parity checking technology, determine the total number of failed disks; If the total number of failed disks is three, take the data of the three failed blocks in the target stripe as the data to be generated; If the total number of failed disks is two, take the non-failed disk with the lowest read speed in the redundant array of independent disks as a failed disk, and take the data of the three failed blocks in the target stripe as the data to be generated; If the total number of failed disks is one, take the two non-failed disks with the lowest read speed in the redundant array of independent disks as failed disks, and take the data of the three failed blocks in the target stripe as the data to be generated.
4. The data encoding and decoding method according to claim 2, characterized in that For any relationship in the parity checking principle of the target stripe, taking the addition operation result of each known term in the relationship as an intermediate variable includes: Take the addition operation result of each known term in the first relationship in the parity checking principle as an intermediate variable through the first summation relationship; Take the addition operation result of each known term in the second relationship in the parity checking principle as an intermediate variable through the second summation relationship; Take the addition operation result of each known term in the third relationship in the parity checking principle as an intermediate variable through the third summation relationship; The first summation relationship includes: ; The second summation relationship includes: ; The third summation relationship includes: ; Among them, v1 is an intermediate variable determined by the first summation relation, v2 is an intermediate variable determined by the second summation relation, v3 is an intermediate variable determined by the third summation relation, n is the total number of blocks in the target strip, and d i is the data of the block with serial number i in the target strip, x, y, and z are the serial numbers of the blocks where the three data to be generated are located respectively, and α i is the position parameter of the block with serial number i in the target strip in the second relation, and β i is the position parameter of the block with serial number i in the target strip in the third relation.
5. The data encoding and decoding method according to claim 4, characterized in that, The first correspondence includes: ; ; The second correspondence includes: ; ; ; The third corresponding relationship includes: ; where d x , d y and d z are the first to third data to be generated respectively, α x , α y , α z are the position parameters corresponding to the positions x, y, z in the target strip in the second relational expression respectively, β x , β y , β z are the position parameters corresponding to the positions x, y, z in the target strip in the third relational expression respectively, γ, , are all intermediate parameters.
6. The data encoding and decoding method according to any one of claims 1 to 5, characterized in that The data encoding and decoding method further includes: In a redundant array of independent disks (RAID) applying a dual parity check technology, determining two data to be generated in a target stripe.
7. The data encoding and decoding method according to claim 6, characterized in that The determining, in a redundant array of independent disks (RAID) applying a dual parity check technology, two data to be generated in a target stripe includes: In a redundant array of independent disks (RAID) applying a dual parity check technology, determining the total number of failed disks; If the total number of failed disks is two, using the data of two failed blocks in the target stripe as the data to be generated; If the total number of failed disks is one, using the slowest - reading non - failed disk in the redundant array of independent disks as a failed disk, and using the data of two failed blocks in the target stripe as the data to be generated.
8. The data encoding and decoding method according to claim 6, characterized in that The data encoding and decoding method further includes: In a redundant array of independent disks (RAID) applying a single parity check technology, determining one data to be generated in a target stripe.
9. A data encoding and decoding circuit, characterized in that, Including: An intermediate variable determination circuit, configured to, in a redundant array of independent disks (RAID) applying a triple parity check technology, for any relational expression in the parity check principle of a target stripe, using the addition operation result of each known term in the relational expression as an intermediate variable; A data determination circuit, configured to determine each data to be generated according to the position parameters of the unknown terms in each relational expression of the parity check principle of the target stripe and the intermediate variable; Wherein, in a redundant array of independent disks (RAID) applying a triple parity check technology, the number of data to be generated is three. When encoding a target stripe, the data to be generated includes the data of each parity check block in the target stripe. When decoding a target stripe, the data to be generated includes the data of each failed block in the target stripe. Any term in the relational expression is the product of the data body and its corresponding position parameter. The known term is the term involving the data in the difference set in the relational expression. The unknown term is the term containing the data to be generated in the relational expression. The difference set is the difference set of the total data set of the target stripe with respect to the data set to be generated. The data set to be generated includes each data to be generated.
10. The data encoding and decoding circuit according to claim 9, wherein The intermediate variable determination circuit is further configured to: In a redundant array of independent disks (RAID) applying a dual parity check technology or a single parity check technology, for any relational expression in the parity check principle of a target stripe, using the addition operation result of each known term in the relational expression as an intermediate variable; The intermediate variable determination circuit includes: A first summing sub - circuit, configured to sum each known term in the first relational expression of the parity check principle of the target stripe to obtain an intermediate variable; A second summing sub - circuit, configured to sum each known term in the second relational expression of the parity check principle of the target stripe to obtain an intermediate variable; A third summing sub - circuit, configured to sum each known term in the third relational expression of the parity check principle of the target stripe to obtain an intermediate variable; Wherein, the parity check principle of the triple parity check technology includes the first relational expression to the third relational expression. The parity check principle of the dual parity check technology includes the first relational expression and the second relational expression. The parity check principle of the single parity check technology includes the first relational expression.
11. The data encoding and decoding circuit according to claim 10, wherein The first summing sub - circuit includes: A first adder, configured to sum each known term in the first relational expression of the parity check principle of the target stripe to obtain an intermediate variable; The second summing sub-circuit includes: n - 3 first multipliers, configured to determine each known term in the second relational expression of the parity check principle of the target stripe according to the data body of each known term and its corresponding position parameter in the second relational expression; A second adder, configured to sum up each known term in the second relational expression to obtain an intermediate variable; The third summing sub-circuit includes: n - 3 second multipliers, configured to determine each known term in the third relational expression of the parity check principle of the target stripe according to the data body of each known term and its corresponding position parameter in the third relational expression; A third adder, configured to sum up each known term in the third relational expression to obtain an intermediate variable, where n is the total number of blocks in a single stripe of a redundant array of independent disks.
12. The data encoding and decoding circuit according to claim 11, wherein The data determination circuit includes: A first determination circuit, configured to determine a first data to be generated based on elements in the first correspondence; A second determination circuit, configured to determine a second data to be generated based on elements in the second correspondence; A third determination circuit, configured to determine a third data to be generated based on elements in the third correspondence; The first correspondence includes: ; ; The second correspondence includes: ; ; ; The third correspondence includes: ; Among them, v1 is the intermediate variable determined by the first summing sub-circuit, v2 is the intermediate variable determined by the second summing sub-circuit, v3 is the intermediate variable determined by the third summing sub-circuit, d x , d y and d z are the first to third data to be generated respectively, α x , α y , α z are the position parameters corresponding to the positions x, y, z in the target strip in the second relational expression respectively, β x , β y , β z are the position parameters corresponding to the positions x, y, z in the target strip in the third relational expression respectively, γ, , are all intermediate parameters.
13. A data encoding and decoding device, characterized in that, including: A memory, configured to store a computer program; A processor, configured to implement the steps of the data encoding and decoding method according to any one of claims 1 to 8 when executing the computer program.
14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the steps of the data encoding and decoding method according to any one of claims 1 to 8 are implemented.
15. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the data encoding and decoding method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
RAID encoding and decoding system and method for SSD
CN106775483A
Disk array data recovery method and system, storage medium, and equipment
CN114090345A
Method, system and equipment for degrading redundant array of independent disks
CN114610244A
Decoding method, system and equipment for disk array and medium
CN114756175A
TP-RAID encoding and decoding method, system and equipment and storage medium
CN114895842A