A TP-RAID encoding and decoding method, system, device and storage medium
The TP-RAID codec method optimizes the verification formulas of RAID5 and RAID6 and adopts parallel computing methods to solve the problem of high computing pressure in the RAID storage system, achieving efficient and high-speed data encoding and decoding, and improving the performance and reliability of the storage system.
Patent Information
- Application Number
- CN202210316461.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-03-29
AI Technical Summary
The existing RAID storage system has high computing pressure during the data verification process, resulting in high computing costs, making it difficult to improve the data reading and writing speed of the storage system while maintaining high performance and high reliability.
The TP-RAID encoding and decoding method is adopted to determine the disk position of the data to be found in RAID mode, generate the encoding parameter information table and predetermined parameters, and calculate the data to be found in parallel using the finite domain calculation method, and combine the verification formulas of RAID5 and RAID6 to optimize the encoding and decoding algorithm to reduce the calculation complexity.
It realizes efficient and high-speed data encoding and decoding in hardware and software environments, reduces computing complexity, reduces dependence on CPU resources, and improves the data reliability and read and write speed of the storage system.
Smart Images

Figure CN114895842B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computers, and particularly relates to a TP-RAID encoding and decoding method, system, device and storage medium. Background Art
[0002] With the rapid development of communication technology and network technology, digital information has grown exponentially, and data storage technology has thus faced huge challenges. The reliability problem of data in the storage system and the energy consumption problem of the storage system have attracted more and more attention. Facing such a huge data scale nowadays, the reliability of data in the storage system is inversely proportional to the number of components in the storage system, that is, the more components in the storage system, the lower the reliability of data in the storage system. According to relevant investigations, in an Internet data center composed of 600 disks, about 30 disks are damaged every month. In large-scale storage systems, the decrease in data reliability caused by disk failures is a quite serious problem, and relevant fault-tolerant technologies have been studied in this regard.
[0003] As early as 1988, the RAID structure proposed by professors such as D.A. Patterson of the University of California, Berkeley became a key technology for improving storage space. RAID (Redundant Arrays of Independent Disks) is a disk array with redundancy capabilities. The disk array is obtained by combining multiple independent disks together to form a disk group with a large capacity. By using RAID storage technology, the storage capacity can be greatly improved, the request processing ability of system input and output can be improved, and the reliability of data can be improved through data distributed storage technology, parallel access means and information redundancy technology.
[0004] After the design concept of RAID was proposed, it was quickly accepted by the industry. As a high-performance and highly reliable storage technology, RAID technology has been extremely widely used in people's production and life. RAID mainly uses data striping, data verification and mirroring technologies to obtain stronger performance, higher reliability, better fault tolerance and stronger scalability. According to different data application requirements, the strategies and architectures of these three technologies can be used or combined. Therefore, according to different strategies and architectures, RAID can be divided into different levels: RAID 0, 1, 5, 6, 10.
[0005] In traditional applications, RAID5 and RAID6 are mostly used as the disk array mode of the storage system. Since RAID5 and RAID6 need to perform data verification, matrix operations are usually used to solve the corresponding verification data. Therefore, huge operations are required when storing data. If the storage capacity (data read / write speed) is to be improved, a higher-specification computing unit must be provided, increasing the operation cost. Summary of the Invention
[0006] To solve the above problems, the present invention proposes a TP-RAID encoding and decoding method, including:
[0007] Determine the disk location of the data to be obtained in the RAID mode;
[0008] Confirm the encoding parameter information table corresponding to the data to be obtained according to the disk location, and calculate a plurality of predetermined parameters according to the encoding parameter information table; and
[0009] Calculate the data to be obtained according to the known disk data, the plurality of predetermined parameters, and the encoding parameter information table under the same stripe as the data to be obtained.
[0010] In some embodiments of the present invention, the method further includes:
[0011] In response to the non-existence of the encoding parameter information table, calculate the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode.
[0012] In some embodiments of the present invention, calculating the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode includes:
[0013] Generate a TP-RAID formula based on the RAID5 verification formula and the RAID6 verification formula using the finite field calculation method, and calculate the encoding parameter information table corresponding to the data to be obtained based on the TP-RAID formula;
[0014] The TP-RAID formula is:
[0015] TP-RAID:
[0016]
[0017] x≥2
[0018] where, d1~d m represent the disk data under the same stripe, p, p1~p3 represent the data to be obtained, and x is an exponential parameter.
[0019] In some embodiments of the present invention, it further includes:
[0020] Generate a temporary parameter list according to the coefficients of the polynomial in the TP-RAID formula, and determine the encoding parameter information table through the mapping of the disk position corresponding to the data to be obtained in the temporary parameter list.
[0021] In some embodiments of the present invention, the method further includes:
[0022] Obtain a plurality of predetermined parameters and an encoding parameter information table corresponding to the data to be obtained according to the disk position of the data to be obtained; and
[0023] Calculate the data to be obtained according to the known disk data, the plurality of predetermined parameters, and the encoding parameter information table under the same strip of the data to be obtained.
[0024] In some embodiments of the present invention, the method further includes:
[0025] Generate encoding and decoding parameters for parallel calculation according to the disk position corresponding to the data to be obtained, the encoding parameter information table, and the predetermined parameters.
[0026] In some embodiments of the present invention, the method further includes:
[0027] Generate encoding and decoding parameters for parallel calculation through the generated multiple encoding and decoding parameters.
[0028] Another aspect of the present invention also proposes a TP-RAID encoding and decoding system, including:
[0029] A preprocessing module configured to determine the disk position, the encoding parameter information table, and a plurality of predetermined parameters of the data to be obtained in the RAID mode;
[0030] An encoding and decoding module configured to calculate the data to be obtained according to the disk position corresponding to the data to be obtained, the encoding parameter information table, the predetermined parameters, and the known disk data in the RAID mode according to the finite field calculation method.
[0031] Another aspect of the present invention also proposes a computer device, including:
[0032] At least one processor; and
[0033] A memory storing computer instructions executable on the processor, and when the instructions are executed by the processor, the steps of the method according to any one of the above embodiments are implemented.
[0034] Another aspect of the present invention also proposes a computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the steps of the method according to any one of the above embodiments are implemented.
[0035] The present invention proposes an encoding and decoding method for TP-RAID. First, the RAID algorithm is used as the basis to establish the basic parameter relationship of the algorithm. Then, according to the different computing characteristics, advantages and disadvantages, and algorithm requirements of hardware and software, different algorithm implementation methods are designed for hardware and software, which can make full use of the characteristics of hardware and software in a targeted manner to achieve the advantages of simple and high-speed operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0037] Figure 1 It is a flowchart of a method for an encoding and decoding method of TP-RAID provided by an embodiment of the present invention;
[0038] Figure 2 It is a schematic structural diagram of a TP-RAID encoding and decoding system provided by an embodiment of the present invention;
[0039] Figure 3 It is a schematic structural diagram of a computer device provided by an embodiment of the present invention;
[0040] Figure 4 It is a schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention;
[0041] Figure 5 It is a calculation schematic diagram of an encoding and decoding method of TPRAID provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] To make the objectives, technical solutions, and advantages of the present invention clearer, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.
[0043] It should be noted that all the expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two entities or parameters with the same name but different identities. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation on the embodiments of the present invention. This will not be elaborated one by one in the subsequent embodiments.
[0044] What the present invention aims to solve is the problem of computing pressure when building a storage system with a RAID storage structure with a parity function in the current computer storage field.
[0045] Such asFigure 1 As shown, the present invention proposes a TP-RAID encoding and decoding method, including:
[0046] Step S1, determine the disk location of the data to be calculated in the RAID mode;
[0047] Step S2, confirm the encoding parameter information table corresponding to the data to be calculated according to the disk location, and calculate a plurality of predetermined parameters according to the encoding parameter information table; and
[0048] Step S3, calculate the data to be calculated according to the known disk data in the same stripe as the data to be calculated, the plurality of predetermined parameters, and the encoding parameter information table.
[0049] In some embodiments of the present invention, the method further includes:
[0050] In response to the non-existence of the encoding parameter information table, calculate the encoding parameter information table according to the disk location of the data to be calculated in the RAID mode.
[0051] In the embodiments of the present invention, the data to be calculated in step S1 may be the parity codes p1, p2, p3 that need to be calculated when storing data for the first time, or the lost or damaged data in the data recovery stage. The so-called lost or damaged data refers to 1 to 3 missing data in the same stripe, and this data corresponds to 1 disk in the stripe. Therefore, it is necessary to obtain the disk location of the missing data in the stripe.
[0052] In step S2, the encoding parameter information table is a list or array proposed by the present invention for representing the positional relationship of missing data, usually two. Multiple predetermined parameters for calculating the position of the missing data can be calculated with the help of the encoding parameter information table.
[0053] In step S3, after obtaining a plurality of predetermined parameters, perform an exclusive OR calculation on the plurality of predetermined parameters, the other known disk data in the stripe where the missing data is located, and the encoding information parameter table to obtain the data to be calculated.
[0054] In some embodiments of the present invention, calculating the encoding parameter information table according to the disk location of the data to be calculated in the RAID mode includes:
[0055] Generate a TP-RAID formula based on the RAID5 parity formula and the RAID6 parity formula using the finite field calculation method, and calculate the encoding parameter information table corresponding to the data to be calculated based on the TP-RAID formula;
[0056] The TP-RAID formula is:
[0057] TP-RAID:
[0058]
[0059] x ≥ 2
[0060] where d1 to d m represent the disk data under the same stripe, p1 to p3 represent the data to be calculated, and x is an exponential parameter.
[0061] In some embodiments of the present invention, it further includes:
[0062] Generate a temporary parameter list according to the coefficients of the polynomial in the TP-RAID formula, and determine the encoding parameter information table through the mapping of the disk positions corresponding to the data to be calculated in the temporary parameter list.
[0063] In some embodiments of the present invention, the method further includes:
[0064] In response to the non-existence of the multiple predetermined parameters, calculate the multiple predetermined parameters according to the disk positions corresponding to the data to be calculated and the encoding parameter information table.
[0065] In some embodiments of the present invention, the method further includes:
[0066] Obtain the multiple predetermined parameters and the encoding parameter information table corresponding to the data to be calculated according to the disk position of the data to be calculated; and
[0067] Calculate the data to be calculated according to the known disk data under the same stripe as the data to be calculated, the multiple predetermined parameters, and the encoding parameter information table.
[0068] In this embodiment, when the number of disks in the RAID mode is fixed, for the RAID array composed of a limited number of disks, the permutations and combinations of the disk positions where the missing data is located are limited. Therefore, the multiple predetermined parameters and the encoding parameter information table corresponding to different permutations and combinations can be saved and directly obtained for calculation when needed, without having to calculate them again.
[0069] In some embodiments of the present invention, the method further includes:
[0070] Generate encoding and decoding parameters for parallel calculation according to the disk positions corresponding to the data to be calculated, the encoding parameter information table, and the predetermined parameters.
[0071] In an embodiment of the present invention, the TP-RAID (RAID Triple-Parity, a RAID upgrade mode that supports triple parity) encoding and decoding method implemented by the present invention is an encoding and decoding method that upgrades from RAID5 and RAID6 to TP-RAID. That is, it can support the recovery of up to three missing disk data. For this purpose, the present invention derives a new calculation method based on the algorithm principles of the existing RAID5 and RAID6:
[0072] The algorithm principle of traditional RAID5 uses:
[0073] d1 + d2 + d3 +... + d m + p = 0 (1)
[0074] The algorithm principle of RAID6 is;
[0075]
[0076] The inventor found that the encoding and decoding algorithm of RAID is to solve the equation with p as the unknown in the above relational expression. Since the operations here use Galois field operations in storage, it can be known that the relational expressions of p in traditional RAID5 and 6 are respectively:
[0077]
[0078]
[0079] In the storage system, in order to reduce the operation complexity and ensure that the data will not overflow, the above unified and storage encoding and decoding operations are generally implemented through the Galois field. That is, in the hardware implementation, addition and subtraction are implemented through exclusive OR operations, while multiplication and division are implemented through Galois multiplication and division for different Galois field polynomials.
[0080] Based on the above-mentioned upgrade requirements from RAID5 and 6 to TP-RAID and the downgrade requirements from TP-RAID to RAID5 and 6, the algorithm relationship that TP-RAID needs to satisfy can be obtained under the premise of formulas (1) and (2):
[0081]
[0082] As shown in formula (5), the first two formulas respectively correspond to the preconditions for compatibility with RAID5 and 6 after adding a parity to meet the requirements of TP-RAID. The third formula uses a similar principle and constructs a solvable relational expression based on Vandermonde, where x is the power, and here the power is greater than or equal to 2 to meet the construction requirements of Vandermonde.
[0083] Under the relationship of formula (5), as can be seen from the above introduction, it is no longer possible to perform parallel encoding and decoding in a way similar to RAID6. Therefore, it is necessary to improve it and propose a new encoding and decoding algorithm suitable for different environments.
[0084] Generally, what the RAID algorithm calculates are its parameters, and the operation of parameters does not involve a large amount of user storage data transfer. Therefore, the operation can be completed by software or hardware. Among them, software refers to performing operations through the CPU, and hardware refers to completing the work by designing a proprietary operation IP. In a storage system, the CPU resources are limited. Therefore, generally, the software calculations required are without dependencies, and the time complexity of the operation algorithm should be as low as possible; the hardware uses a proprietary designed IP for the operation work. Therefore, what is pursued is to use as many identical operation parameters as possible and perform parallel operations with as little mutual dependence as possible.
[0085] To perform encoding and decoding, the method adopted by the present invention is: by using the substitution of unknowns, the encoding and decoding of TP-RAID are transformed into encoding and decoding conditions similar to RAID6, and then RAID6 is used for encoding and decoding. Therefore:
[0086] In step S1, the data to be obtained can be the parity check codes calculated when storing data for the first time. Taking RAID6 as an example, there are a total of 3 parity check codes p1, p2, and p3. Therefore, when storing data through RAID6, it is necessary to calculate 3 parity check codes p1, p2, and p3 and store them on the corresponding disks respectively. In addition, the data to be obtained can also be the unknown data during the data recovery phase, such as the normal disk data represented by d1-d m or it can also be the data on any one of the disks in a stripe such as the 3 parity check codes p1, p2, and p3. Since the disk damage situation is random, for the data in a stripe, it is possible that the disk storing the parity check code is damaged and the data is lost, or it is possible that the disk storing the service data is damaged and lost.
[0087] In this embodiment, the encoding parameter information table and the predetermined parameters are used to set the unknowns that replace the real data and participate in the calculation by using the RAID-TP, that is, formula (5), in the way of RAID6 encoding and decoding.
[0088] It is the parameter list and the predetermined parameters that participate in the TP-RAID calculation according to the TP-RAID encoding and decoding algorithm provided by the present invention. When storing data, it is necessary to calculate the corresponding encoding parameter information table and specify the predetermined parameters. If it is in the data recovery phase and the corresponding data saved on multiple disks in the stripe is recovered through the existing stripe data, only the saved encoding parameter information table and the predetermined parameters need to be obtained.
[0089] Specifically, to generate the encoding parameter information tables v1 and v2 similar to RAID6, it is necessary to first determine the temporary list v. The number of the temporary list v is related to the number of disks in the RAID, that is, the number of data in the stripe, and the value of the predetermined parameter can be any integer. For example, there is an array v (the temporary list v is represented by an array) {v|1, 2, 3,...}. Here, 1, 2, and 3 are the parameters used in the second line formula of the RAID6 algorithm to be implemented above. If the implemented RAID6 algorithm changes under different RAID algorithms, then this array changes based on the formula parameters of the specific second line of RAID6.
[0090] The actual relationship of the encoding and decoding algorithm parameters will change due to the load balancing arrangement method. Under the load balancing exemplified by formula (5), the parameters corresponding to the three parity checks (the coefficients of the three parity codes p1, p2, and p3 in formula (5), representing their disk positions) are respectively:
[0091]
[0092] Under different load balancings (the positions of the disks storing the parity codes within the stripe), there will be different parameters. The parameters are related to the load balancing and the position information. We usually consider using the position information to represent the parameters.
[0093] Then the data represented by the array of the predetermined parameter v at this time for the recorded positions [locate p1 , locate p2 , locate p3 are: [v p1 , v p2 , v p3 . Taking the arrangement in formula (5) as an example, [v p1 , v p2 , v p3 is: Based on the above conditions, according to the encoding method of RAID6, the values of v1 and v2 can be obtained as:
[0094]
[0095] The encoding parameter information tables v1 and v2 are equivalent to expressing the parameter information corresponding to the third parity check value of the three parity checks by using the relationship of the parameters corresponding to the other two parity check values. Then, at this time, TP-RAID can combine the encoding and decoding relational expressions of RAID6 to obtain a completely parallel decoding method to achieve the encoding and decoding characteristics similar to RAID6.
[0096] For encoding and decoding, we first generate some basic predefined parameters based on the information of v1 and v2 for subsequent operations:
[0097]
[0098] Here, p1_22 represents the predefined parameter value at the p1 position of the encoding parameter information table v1, p1_32 represents the value at the p1 position of the encoding parameter information table v2, p2_22 represents the predefined parameter value at the p2 position of the encoding parameter information table v1, and p2_32 represents the value at the p2 position of the encoding parameter information table v2. The above describes the positions of P corresponding to encoding. If it is a decoding operation, then here p are the positions of the data or check information to be solved for decoding respectively.
[0099] Meanwhile, according to the predefined parameter values obtained above, a dividend is generated:
[0100] p_deno = p1_32 * p2_22 - p2_32 * p1_22 (8)
[0101] Finally, the encoding and decoding parameters p1_22, p1_32, p2_22, p2_32, p_deno for parallel computing are generated. And at this time, based on the above parameters, the data to be solved (taking the check code as an example) can be expressed as:
[0102]
[0103] Among them, data(i) represents the known disk data at the corresponding disk position in the stripe, that is, the data of d1 to d m The data, v2(i) and v2(i) respectively represent the values of the i-th numbers in the encoding parameter information v1 and v2. The encoding and decoding parameters p1_22, p1_32, p2_22, p2_32, p_deno are calculated in the above embodiments.
[0104] It should be noted that the multiplication of data(i) in formula (9) by the encoding parameter is a finite field multiplication, that is, a binary exclusive OR operation. And the data of data(i) are generally data blocks of more than 4KB. Therefore, based on the characteristics of the exclusive OR operation, parallel computing can be performed. Taking 8bit as an example, the 4KB data (4096 * 8bit) is divided into 4096 groups of exclusive OR operation units for simultaneous operation to obtain 4096 values, and then exclusive OR calculation is performed. There is no need to perform the exclusive OR of two numbers step by step from front to back. That is, parallel computing is achieved.
[0105] In some embodiments of the present invention, the formula (9) represents the operation parameters for three check codes or data to be solved. The parameters are obtained through hardware IP operations and then output to the data multiplication and addition module. Based on the operations in formula (9) and their corresponding data respectively, multiplication operations are performed, and then all are added up to obtain the check code value of encoding or the data value to be solved of decoding.
[0106] The above example is for encoding. If it is decoding, only the position needs to be changed to the position of the data information to be decoded, and the operation relationship corresponds to all valid (surviving) data. This is exactly the same as the operation characteristics of RAID5 and RAID6.
[0107] In the above formula, based on storage requirements, all operations are implemented based on the Galois field (finite field). Here, addition and subtraction are implemented as exclusive OR operations through the Galois field, and multiplication and division respectively correspond to multiplication and division in the Galois field.
[0108] Based on the final parameter relationship of the above formula (10), all parameter operations are obtained based on v1, v2, and position information. That is to say, as long as the position relationship of encoding or decoding is determined, all the parameters required for operation can be obtained in parallel, meeting the operation requirements of the hardware, maximizing the performance of the hardware IP, and completing the operation at the fastest speed.
[0109] In some embodiments of the present invention, based on the above introduction, we know that software performs operations through the CPU during operation. However, the CPU is often limited in the storage system. Therefore, to reduce the CPU consumption, the algorithm needs to be serialized as much as possible. Then the above operations can be changed to:
[0110]
[0111] In the relational formula of the above parameter operations, p p1 and p p2 Because it is completed based on the relationship of RAID6, based on the basic characteristics of RAID6, it cannot be improved, and p p3 Based on formula (10), because it is the parameter relationship value of the third check in TP-RAID, its operation complexity is equivalent to the sum of the operation complexities of p p1 and p p2
[0112] Therefore, in a software environment, to save CPU usage and reduce operation complexity, based on the original relationship between p p1 and p p2 The operation can be improved to the operation relationship expressed by formula (11). The operation order can be p p1 , p p2 , p p3 or pp2 , p p1 , p p3 , after the operations of p p1 and p p2 are completed, their values are temporarily stored. For the third operation, just complete the operation according to formula (11).
[0113] The following proves its feasibility:
[0114]
[0115] From the proof relationship of formula (12), it can be known that under the Galois field operation, its relationship satisfies the above p p1 and p p2 relationship, which means the relationship holds and the operation is correct.
[0116] Similarly, all the above operations are also implemented based on the Galois field in storage, so this relationship holds.
[0117] Then through such improvement, the TP-RAID encoding and decoding under software can be realized. The formula is exemplified by encoding. When decoding, just replace the position information of p with the position information of the data to be decoded required. Its operation is similar to RID5, 6.
[0118] The algorithm implemented in this way reduces the algorithm complexity under software, achieves the solution relationship of mutual dependence, and liberates the CPU as much as possible by using the characteristics of software operations.
[0119] Such as Figure 5 shown Figure 5 The implementation example calculated from specific data shown in the figure is as shown. In the case of the same 4 stripes and 7 disks, a situation of TP-RAID. In the figure, d11 - d14 are data 1 - 4 of stripe 1, and the corresponding parity information is p11 - p13. In stripe 2, the data is d21 - d24, which is shown based on the load balancing method of left rotation misalignment. The positions of p21p22p23 are as shown in the figure. Then, in order to obtain TP-raid, the relationship corresponding to formula (5) under stripe 2 needs to be:
[0120] Taking it as an example, illustrate the encoding method:
[0121] 1. Generate the encoding parameter information tables v1, v2 similar to RAID6
[0122] First, an array {v|1, 2, 3,...} is set up. Here, 1, 2, 3 are the parameters used in the second - line formula of the RAID6 algorithm to be implemented above. Then, according to the above situation, when the array is {v|1, 2, 3, 4, 5, 6, 7}, the three parity parameters are as described in formula (13):
[0123] Then, the data of array v at the recorded positions [locate p1 , locate p2 , locate p3 are respectively: [v p1 , v p2 , v p3 , which is [2, 3, 4] above. Then, based on the above conditions, the values of v1 and v2 can be obtained as:
[0124] In the above formula, x = 2 is used for illustration. In fact, it should be applicable to various scenarios where x≥2. So, x is used here to explain
[0125] 2. Based on the new v1 and v2, encoding and decoding are performed in a way similar to RAID6
[0126]
[0127] p_deno = p1_32 * p2_22 - p2_32 * p1_22 is used to perform operations on the above - mentioned data and then encode:
[0128]
[0129] Among them, v1 and v2 are the arrays of v1 and v2 obtained above, and v1v2(i) is the i - th number in the array. data(i) represents the corresponding data. For example, data(1) is d21 in the above figure. Such operations can obtain the parity - check code value. However, in the circuit, the operation of the parity - check code value is done by hardware, while the operation of the parameter (the data multiplied by data(i)) can be done by hardware or software. Therefore, there are hardware and software ways to operate the parameter. According to the hardware way, parallelism should be maximized, then:
[0130]
[0131] All the above data are obtained above.
[0132] The corresponding software should be as serial as possible and reuse the previous results, then:
[0133]
[0134] The intermediate parameter operations are as described above.
[0135] The present invention proposes an encoding and decoding method for TP-RAID. The algorithm first uses the RAID algorithm as a basis to establish the basic parameter relationship of the algorithm, and then designs different algorithm implementation methods for software and hardware according to the different computing characteristics, advantages and disadvantages, and algorithm requirements of software and hardware, so as to make full use of the characteristics of software and hardware in a targeted manner and achieve the advantages of simple and high-speed operations.
[0136] In addition, it should be noted that in the method as described above, the present invention proposes to calculate by substituting the original data with an algebraic method with a smaller data value according to the algorithm principle of RAID to obtain a plurality of predetermined parameters related to the position of the data to be obtained. Then, by calculating with the predetermined parameters and the known data, since the number of disks in the RAID mode is limited, in some cases, when the temporary parameter information list remains unchanged in the same stripe, the predetermined parameters of the missing data at the same position in multiple stripes are the same. Therefore, the calculation of the predetermined parameters corresponding to the missing data in the previous calculation can be further reduced by saving the predetermined parameters of all missing position data.
[0137] As Figure 2 shown, another aspect of the present invention also proposes a TP-RAID encoding and decoding system, including:
[0138] A preprocessing module 1, configured to determine the disk position of the data to be obtained, the encoding parameter information table, and a plurality of predetermined parameters in the RAID mode;
[0139] An encoding and decoding module 2, configured to calculate the data to be obtained according to the disk position corresponding to the data to be obtained, the encoding parameter information table, the predetermined parameters, and the known disk data in the RAID mode according to the finite field calculation method.
[0140] As Figure 3 shown, yet another aspect of the present invention also proposes a computer device, including:
[0141] At least one processor 21; and
[0142] A memory 22, storing computer instructions 23 that can run on the processor. When the instructions 23 are executed by the processor 21, a TP-RAID encoding and decoding method is implemented, including:
[0143] Determine the disk position of the data to be obtained in the RAID mode;
[0144] Confirm the encoding parameter information table corresponding to the data to be obtained according to the disk position, and calculate a plurality of predetermined parameters according to the encoding parameter information table; and
[0145] Calculate the data to be obtained according to the known disk data under the same stripe of the data to be obtained, the multiple predetermined parameters, and the encoding parameter information table.
[0146] In some embodiments of the present invention, the method further includes:
[0147] In response to the non-existence of the encoding parameter information table, calculate the encoding parameter information table according to the disk position of the data to be obtained in the RAID mode.
[0148] In some embodiments of the present invention, calculating the encoding parameter information table according to the disk position of the data to be obtained in the RAID mode includes:
[0149] Generate a TP-RAID formula based on the RAID5 check formula and the RAID6 check formula using a finite field calculation method, and calculate the encoding parameter information table corresponding to the data to be obtained based on the TP-RAID formula;
[0150] The TP-RAID formula is:
[0151] TP-RAID:
[0152]
[0153] x≥2
[0154] where, d1~d m represent the disk data under the same stripe, p1~p3 represent the data to be obtained, and x is an exponential parameter.
[0155] In some embodiments of the present invention, it further includes:
[0156] Generate a temporary parameter list according to the coefficients of the polynomial in the TP-RAID formula, and determine the encoding parameter information table through the mapping of the disk position corresponding to the data to be obtained in the temporary parameter list.
[0157] In some embodiments of the present invention, the method further includes:
[0158] According to the disk position of the data to be obtained, obtain the multiple predetermined parameters and the encoding parameter information table corresponding to the data to be obtained that are saved; and
[0159] Calculate the data to be obtained according to the known disk data under the same stripe of the data to be obtained, the multiple predetermined parameters, and the encoding parameter information table.
[0160] In some embodiments of the present invention, the method further includes:
[0161] Generate encoding and decoding parameters for parallel computing according to the disk location corresponding to the data to be obtained, the encoding parameter information table, and the predetermined parameters.
[0162] As Figure 4 shown, on the other hand, the present invention also proposes a computer-readable storage medium 401, where the computer-readable storage medium 401 stores a computer program 402, and when the computer program is executed by a processor, it implements a TP-RAID encoding and decoding method, including:
[0163] Determine the disk location of the data to be obtained in the RAID mode;
[0164] Confirm the encoding parameter information table corresponding to the data to be obtained according to the disk location, and calculate multiple predetermined parameters according to the encoding parameter information table; and
[0165] Calculate the data to be obtained according to the known disk data in the same stripe as the data to be obtained, the multiple predetermined parameters, and the encoding parameter information table.
[0166] In some embodiments of the present invention, the method further includes:
[0167] In response to the non-existence of the encoding parameter information table, calculate the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode.
[0168] In some embodiments of the present invention, calculating the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode includes:
[0169] Generate a TP-RAID formula based on the RAID5 check formula and the RAID6 check formula using the finite field calculation method, and calculate the encoding parameter information table corresponding to the data to be obtained based on the TP-RAID formula;
[0170] The TP-RAID formula is:
[0171] TP-RAID:
[0172]
[0173] x≥2
[0174] where, d1~d m represent the disk data in the same stripe, p1~p3 represent the data to be obtained, and x is an exponential parameter.
[0175] In some embodiments of the present invention, it further includes:
[0176] Generate a temporary parameter list according to the coefficients of the polynomial in the TP-RAID formula, and determine the encoding parameter information table through the mapping of the disk position corresponding to the data to be obtained in the temporary parameter list.
[0177] In some embodiments of the present invention, the method further includes:
[0178] According to the disk position of the data to be obtained, obtain multiple predetermined parameters and an encoding parameter information table corresponding to the data to be obtained that are saved; and
[0179] Calculate the data to be obtained according to the known disk data, the multiple predetermined parameters, and the encoding parameter information table under the same stripe of the data to be obtained.
[0180] In some embodiments of the present invention, the method further includes:
[0181] Generate encoding and decoding parameters for parallel computing according to the disk position corresponding to the data to be obtained, the encoding parameter information table, and the predetermined parameters.
[0182] The above are exemplary embodiments disclosed by the present invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the present invention as defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein do not need to be executed in any specific order. In addition, although the elements disclosed in the embodiments of the present invention can be described or claimed in an individual form, they can also be understood as multiple unless explicitly limited to the singular.
[0183] It should be understood that, as used herein, unless the context clearly supports exceptions, the singular form "a" is also intended to include the plural form. It should also be understood that the "and / or" used herein refers to any and all possible combinations including one or more of the associated listed items.
[0184] The serial numbers of the disclosed embodiments of the present invention above are only for description and do not represent the advantages or disadvantages of the embodiments.
[0185] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk, or an optical disc, etc.
[0186] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention shall be included within the protection scope of the embodiments of the present invention.
Claims
1. A TP-RAID encoding and decoding method, characterized in that, Including: Determine the disk location of the data to be obtained in the RAID mode; Confirm the encoding parameter information table corresponding to the data to be obtained according to the disk location, and calculate a plurality of predetermined parameters according to the encoding parameter information table; And Calculate the data to be obtained according to the known disk data, the plurality of predetermined parameters and the encoding parameter information table under the same stripe of the data to be obtained; In response to the non-existence of the encoding parameter information table, calculate the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode; The calculating the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode includes: Generate a TP-RAID formula based on the RAID5 parity formula and the RAID6 parity formula by means of finite field calculation, and calculate the encoding parameter information table corresponding to the data to be obtained based on the TP-RAID formula; The TP-RAID formula is: Among them, d1~d m represent the disk data under the same belt, p1~p3 represent the data to be calculated, and x is the exponential parameter.
2. The method according to claim 1, characterized in that, Also including: Generate a temporary parameter list according to the coefficients of the polynomials in the TP-RAID formula, and determine the encoding parameter information table through the mapping of the disk location corresponding to the data to be obtained in the temporary parameter list.
3. The method according to claim 1, wherein Also including: According to the disk location of the data to be obtained, obtain the plurality of predetermined parameters and the encoding parameter information table corresponding to the data to be obtained that are stored; And Calculate the data to be obtained according to the known disk data, the plurality of predetermined parameters and the encoding parameter information table under the same stripe of the data to be obtained.
4. The method according to claim 1, characterized in that, Also including: Generate encoding and decoding parameters for parallel calculation according to the disk location, the encoding parameter information table and the predetermined parameters corresponding to the data to be obtained.
5. The method according to claim 4, wherein Also including: Generate encoding and decoding parameters for parallel calculation through the plurality of encoding and decoding parameters that have been generated.
6. A TP-RAID encoding and decoding system, characterized in that, Including: A preprocessing module configured to determine the disk location, the encoding parameter information table and a plurality of predetermined parameters of the data to be obtained in the RAID mode; An encoding and decoding module configured to calculate the data to be obtained according to the disk location, the encoding parameter information table, the predetermined parameters corresponding to the data to be obtained and the known disk data in the RAID mode according to the finite field calculation method; In response to the non-existence of the encoding parameter information table, calculate the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode; The calculating the encoding parameter information table according to the disk location of the data to be obtained in the RAID mode includes: Generate a TP-RAID formula based on the RAID5 parity formula and the RAID6 parity formula by means of finite field calculation, and calculate the encoding parameter information table corresponding to the data to be obtained based on the TP-RAID formula; The TP-RAID formula is: Among them, d1 to d m represent the disk data under the same belt, p1 to p3 represent the data to be obtained, and x is the exponential parameter.
7. A computer device, characterized in that, Including: At least one processor; And A memory storing computer instructions executable on the processor, and when the instructions are executed by the processor, the steps of the method according to any one of claims 1-5 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1-5 are implemented.
Citation Information
Patent Citations
RAID6 coding method and coding circuit
CN113296999A
RAID coding circuit and coding method
CN113297000A