Storage device data storage error correction method, electronic device and storage medium
By performing grouping processing, mapping conversion and redundant verification generation on image data, combined with parity check and finite domain operations, the problem of insufficient detection capability of even bit flip errors and data storage security in the prior art is solved, and efficient error correction and data protection are achieved.
Patent Information
- Application Number
- CN202411868708.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The existing data storage error correction technology cannot ensure the anti-interference and security of data storage while ensuring the error detection capability and error detection sensitivity of even bits.
By grouping the image data, mapping conversion and redundant verification generation are performed, and error positioning and correction are performed by combining parity and finite domain operations.
While ensuring the error detection capability and error detection sensitivity of even bits, it improves the anti-interference and security of data storage, reduces the amount and complexity of error correction calculations, and enhances data confidentiality.
Smart Images

Figure CN119806407B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage error correction, and in particular to a data storage error correction method for a storage device, an electronic device, and a storage medium. Background Art
[0002] Data storage error correction technology refers to a series of methods and mechanisms used to detect and correct data errors in data storage systems. During the data storage process, data errors may occur due to various reasons, such as physical damage to the storage medium, interference from external environmental factors, software failures, and virus attacks. These errors may cause data loss, damage, or unavailability. Data storage error correction technology can effectively reduce the impact of these errors and ensure data integrity and accuracy.
[0003] In existing data storage error correction technologies, traditional parity check methods are mainly used to detect odd-number bit flip errors, and have limited detection capabilities for even-number bit flip errors, and almost no error correction capabilities; for example, in a simple parity check system, if two bits flip at the same time, the parity bit may still be correct, resulting in the error cannot be detected; and the traditional CRC method mainly focuses on remainder detection based on polynomial division, which has a good effect on specific error modes, such as burst errors or certain multi-bit errors, but may not be sensitive enough for some other error modes; for example, periodic data errors caused by complex storage interference, multi-bit errors that cancel each other out due to error bits; and existing data storage error correction methods The technology mainly focuses on error correction and detection, and pays relatively little attention to the anti-interference and security of the data itself. For example, the patent application with publication number CN115993941A discloses a distributed data storage error correction method and system. The scheme divides the original file into multiple groups of information data; then encodes and stores them in multiple storage nodes. Although it can reduce the computational complexity of data recovery and thus improve the data recovery efficiency, it pays relatively little attention to the anti-interference and security of the data itself. Therefore, when correcting image data storage errors, the existing data storage error correction technology cannot guarantee a certain degree of data storage anti-interference and security while ensuring the error detection capability and error detection sensitivity of an even number of bit flips. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems in the prior art to a certain extent, by performing grouping processing on image data to obtain original image grouping data; then performing mapping conversion processing to obtain image group mapping data; then performing redundant check generation processing to obtain image group verification data; and performing error location and correction based on the original image grouping data, the image group mapping data and the image group verification data; so as to solve the problem that the existing data storage error correction technology cannot, when correcting image data errors, ensure a certain degree of anti-interference and security of data storage while ensuring the ability to detect an even number of bit flip errors and the error detection sensitivity.
[0005] To achieve the above objectives, in a first aspect, the present application provides a data storage error correction method for a storage device, comprising the following steps:
[0006] Performing mapping conversion processing based on the original image group data to obtain image group mapping data;
[0007] Performing redundancy check generation processing based on the image group mapping data to obtain image group check data;
[0008] Error location and correction are performed based on original image group data, image group mapping data and image group verification data.
[0009] Furthermore, grouping the image data according to the group size based on the image data size to obtain the original image group data includes the following sub-steps:
[0010] Setting the storage device to store the image in two data blocks, marked as image data and image redundant data respectively;
[0011] Obtain the number of image data, denoted as P0, set the group size of the image data to L0, L0 = 4*k, k is a positive integer; group the image data based on the group size L0 of the image data, and mark the obtained groups as primary groups; denoted as Ai, where Ai represents the i-th primary group;
[0012] Based on all primary groups, set the group size of the secondary grouping of the primary groups to 4, and group the primary groups again based on L1, and mark the resulting groups as secondary groups, denoted by Aij, where Aij represents the jth secondary group under the i-th primary group; obtain the total number of primary groups, denoted by i0; obtain the total number of secondary groups, denoted by j0;
[0013] The image data that has completed the grouping process is stored in groups and marked as original image group data. The original image group data corresponding to each image includes i0 primary groups, and each primary group includes j0 secondary groups.
[0014] Furthermore, performing mapping conversion processing based on the original image group data to obtain image group mapping data includes the following sub-steps:
[0015] Mapping conversion processing: Based on the original image group data, all primary groups in the original image group data are extracted. For any secondary group Aij in the primary group, let the 4-bit data contained in Aij be Aij=a0a1a2a3; map a0a1a2a3 to b0b1b2b3b4b5b6b7 according to the mapping conversion rule. The mapping conversion rule is as follows: b0=a0⊕a2; b1=a1∧a3; b3=a2∨a3; b4=a0↑a1; b6=a2↓a3;b7=a3⊙a0,where ⊕ represents the XOR operation of the two binary values in the corresponding digits; ∧ represents the AND operation of the two binary values in the corresponding digits; It represents the negation of the corresponding digits of the binary value; ∨ represents the OR operation of the corresponding digits of two binary values; ↓ represents the OR operation of the corresponding digits of two binary values; ↑ represents the AND-NOT operation of the corresponding digits of two binary values; ⊙ represents the XENOR operation of the corresponding digits of two binary values.
[0016] Furthermore, performing mapping conversion processing based on the original image group data to obtain image group mapping data further includes the following sub-steps:
[0017] The obtained b0b1b2b3b4b5b6b7 is recorded as Bij=b0b1b2b3b4b5b6b7 and marked as a secondary group. The primary group that has completed the mapping conversion process is marked as a primary group. Bij represents the jth secondary group under the i-th primary group.
[0018] Repeat the mapping conversion process for all primary groups in the original image group data, and obtain image group mapping data after completion.
[0019] Furthermore, performing redundancy check generation processing based on the image group mapping data to obtain image group check data includes the following sub-steps:
[0020] Based on the image group mapping data, all the first-level groups in the image group check data are extracted. For any second-level group Bij=b0b1b2b3b4b5b6b7 in the first-level group, the number of "1"s in Bij=b0b1b2b3b4b5b6b7 is calculated, and a 1-bit parity check value is generated, denoted as Vij. Vij represents the parity check value of the j-th second-level group under the i-th first-level group. When the number of "1"s in Bij=b0b1b2b3b4b5b6b7 is even, Vij=0; when the number of "1"s in Bij=b0b1b2b3b4b5b6b7 is odd, Vij=1.
[0021] Furthermore, performing redundancy check generation processing based on the image group mapping data to obtain image group check data further includes the following sub-steps:
[0022] Based on the finite field GF(2^8), set the generating polynomial of the finite field GF(2^8) to: c8*x 8 +c7*x 7 +c6*x 6 +c5*x 5 +c4*x 4 +c3*x 3 +c2*x 2 +c1*x+c0, where c1, c2, c3, c4, c5, c6, c7, and c8 are coefficients of the generating polynomial. Based on Bij=b0b1b2b3b4b5b6b7, the values of each digit of b0b1b2b3b4b5b6b7 are used as the polynomial coefficients under the finite field GF(2^8). The polynomial b0*x corresponding to Bij=b0b1b2b3b4b5b6b7 is obtained. 7 +b1*x 6 +b2*x 5 +b3*x 4 +b4*x 3 +b5*x 2 +b6*x+b7, recorded as Bij finite polynomial; using Bij finite polynomial b0*x 7 +b1*x 6 +b2*x 5 +b3*x 4 +b4*x 3 +b5*x 2 +b6*x+b7 divided by the generator polynomial c8*x 8 +c7*x 7 +c6*x 6 +c5*x 5 +c4*x 4 +c3*x 3 +c2*x 2+c1*x+c0, we get the remainder polynomial, recorded as e0*x 7 +e1*x 6 +e2*x 5 +e3*x 4 +e4*x 3 +e5*x 2 +e6*x+e7, where e0, e1, e2, e3, e4, e5, e6, and e7 are coefficients of the remainder polynomial;
[0023] Extract the coefficients e0, e1, e2, e3, e4, e5, e6, and e7 of the remainder polynomial and combine them in order to form an 8-bit number e0e1e2e3e4e5e6e7, which is marked as the finite field check value and recorded as Eij = e0e1e2e3e4e5e6e7, where Eij represents the finite field check value of the j-th secondary group under the i-th primary group;
[0024] The parity check value and the finite field check value are combined together and marked as a redundant check value, recorded as VEij; the mapping conversion process is repeated for all secondary groups in the image group mapping number to obtain the redundant check value VEij of all secondary groups; marked as image group check data.
[0025] Furthermore, error location and correction based on the original image group data, the image group mapping data, and the image group verification data includes the following sub-steps:
[0026] Merging and storing the original image group data, the image group mapping data, and the image group verification data according to the secondary group and the corresponding secondary group, and marking them as error-correctable image data;
[0027] When it is necessary to read the stored image data, first, based on the error-correctable image data, the corresponding original image group data, image group mapping data and image group verification data are split, and then the mapping conversion processing and redundant verification generation processing are re-performed based on the split original image group data to obtain regenerated image group verification data. The regenerated image group verification data is compared with the split image group verification data to determine whether all the data are completely consistent. If all the data are completely consistent, it is determined that the stored image data is error-free, the grouping processing of the original image group data is canceled, and the image data is output.
[0028] Furthermore, performing error location and correction based on the original image group data, the image group mapping data, and the image group verification data further includes the following sub-steps:
[0029] If all data are not completely consistent, obtain the location of the secondary group where the inconsistent data is located; based on the relationship between the image group mapping data and the image group verification data, correct the data of the secondary group corresponding to the secondary group where the inconsistent data is located;
[0030] If the corrected secondary group data is recombined into the original image group data, redundant check generation processing is performed again based on the image group mapping data corresponding to the re-synthesized original image group data to obtain the regenerated image group check data, and compared with the split image group check data to determine whether all the data are completely consistent. If all the data are completely consistent, the error correction is determined to be successful and the image data is output; if all the data are not completely consistent, the error correction is determined to be a failure and the image redundant data is output.
[0031] In a second aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the above method are performed.
[0032] On the third side, the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps in the above method.
[0033] Beneficial effects of the present invention include: grouping image data according to group size based on image data size to obtain original image group data; performing mapping conversion processing based on the original image group data to obtain image group mapping data; performing redundancy check generation processing based on the image group mapping data to obtain image group verification data; and performing error location and correction based on the original image group data, the image group mapping data, and the image group verification data. When correcting errors in image data storage, the present invention can ensure a certain degree of anti-interference and security of data storage while maintaining an even number of bit flip error detection capability and error detection sensitivity.
[0034] The present invention introduces a check based on finite field operations on the basis of parity check. Parity check can simply and quickly detect the situation of an odd number of bit flips, while finite field check provides another dimension of detection, which can capture more complex error patterns; dividing data into multiple groups for processing has higher flexibility in error correction; if only one group has an error, only the error correction operation needs to be performed on this group, reducing the amount of calculation and the complexity of error correction; by mapping and converting the data of the secondary group according to the mapping conversion rules, the advantage is that the original data can be effectively obfuscated through mapping through these complex logical operation combinations; this is similar to a simple data encryption process, which makes the stored data more confidential to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a flow chart of the steps of the method of the present invention;
[0036] Figure 2 A schematic diagram of error-correctable image data storage according to the present invention;
[0037] Figure 3 This is a data error correction flow chart of the present invention;
[0038] Figure 4 Schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0040] Example 1, please refer to Figure 1 As shown, in a first aspect, the present application provides a data storage error correction method for a storage device, comprising the following steps:
[0041] Step S1, grouping the image data according to the group size based on the image data size to obtain original image group data; Step S1 includes the following sub-steps:
[0042] Step S101: Setting the storage device to store images in two data blocks, marked as image data and image redundant data respectively. A data block is one of the basic units for storing data in a database. The basic units for storing data in a database are, from largest to smallest, data blocks, data pages, bytes, and bits. Storing the data in two data blocks is to separate the backup data from the original data, to prevent the accuracy of the data on the data page containing the original data and other data pages of the data block containing the original data from being lost when a database error causes an error in the original data.
[0043] Step S102: Obtain the number of image data, i.e., the image data corresponding to a single image; denoted as P0; set the group size of the image data to L0, where L0 = 4*k, and k is a positive integer; group the image data based on the group size L0, and mark the obtained group as a primary group; denoted as Ai, where Ai represents the i-th primary group; the group size should not be too large or too small. When the group size is too large, the amount of data in each group of the subsequent secondary grouping increases, and the amount of calculation will increase significantly when performing subsequent operations; when the group size is too small, the amount of subsequent redundant data increases, which reduces the overall error correction efficiency. The value range is generally [8, 32]. In this embodiment, L0 is 16;
[0044] Step S103: Based on all primary groups, the group size of the secondary grouping of the primary group is set to 4. It can also be set to other values, but it must be ensured that L0 is divisible and not too large. When the size is 4 bits, the computational complexity in the subsequent mapping conversion process is relatively small; and the primary group is grouped again based on L1, and the resulting group is marked as a secondary group, denoted by Aij, where Aij represents the jth secondary group under the i-th primary group; the total number of primary groups is obtained, denoted by i0; the total number of secondary groups is obtained, denoted by j0;
[0045] Step S104: The image data that has completed the grouping process is stored in groups and marked as original image group data. The original image group data corresponding to each image includes i0 primary groups, and each primary group includes j0 secondary groups.
[0046] In the specific implementation process, the data is divided into primary groups and secondary groups for processing, which has higher flexibility in subsequent error correction. If only one secondary group has an error, it is only necessary to perform error correction on the secondary group, without the need for complex global error correction processing on the entire data group. Compared with some traditional error correction codes, for example, the method of uniformly encoding and decoding the entire data can reduce the amount of calculation and the complexity of error correction. Moreover, in the case that some comparison data cannot completely correct the error, it is also possible to mark the erroneous subgroups and focus on these comparisons in subsequent processing, or obtain the correct comparison data from the redundant data for replacement.
[0047] Step S2, performing mapping conversion processing based on the original image group data to obtain image group mapping data; Step S2 includes the following sub-steps:
[0048] Step S201, mapping conversion processing: Based on the original image group data, all primary groups in the original image group data are extracted. For any secondary group Aij in the primary group, the 4-bit data contained in Aij is set to Aij = a0a1a2a3; a0a1a2a3 is mapped and converted to b0b1b2b3b4b5b6b7 according to the mapping conversion rule. The mapping conversion rule is as follows: b0 = a0⊕a2; b1 = a1∧a3; b3=a2∨a3; b4=a0↑a1; b6=a2↓a3;b7=a3⊙a0,where ⊕ represents the XOR operation of the two binary values in the corresponding digits; ∧ represents the AND operation of the two binary values in the corresponding digits; Represents the negation of the corresponding digits of the binary value; ∨ represents the OR operation of the corresponding digits of the two binary values; ↓ represents the OR operation of the corresponding digits of the two binary values; ↑ represents the AND-NOT operation of the corresponding digits of the two binary values; ⊙ represents the XENOR operation of the corresponding digits of the two binary values;
[0049] The XOR operation rule is that if both values are 0 or 1, the result is 0, otherwise the result is 1, for example, 1⊕1=0, 1⊕0=1; the AND operation rule is that only when both values are 1, the result is 1, otherwise it is 0, for example, 1∧1=1, 0∧1=0; the NOT operation rule is to invert the value, if the value is 0, the output is 1, if the value is 1, the output is 0, for example The OR operation rule is that as long as one of the two values is 1, the result is 1, and the result is 0 only when both values are 0, for example, 1∨0=1, 0∨0=0; the OR NOT operation rule is that only when both values are 0, the result is 1, otherwise it is 0, for example, 0↓0=1, 0↓1=0; the AND NOT operation rule is that only when both values are 1, the result is 0, otherwise it is 1, for example, 1↑1=0, 0↑1=1; the EXCLUSIVE OR operation rule is that if two values are 0 or both are 1, the result is 1, otherwise the result is 0, for example, 0⊕0=1, 1⊕0=0;
[0050] Step S202: The obtained b0b1b2b3b4b5b6b7 is recorded as Bij=b0b1b2b3b4b5b6b7 and marked as a secondary group. The primary group that has completed the mapping conversion process is marked as a primary group. Bij represents the jth secondary group under the i-th primary group. Bij=b0b1b2b3b4b5b6b7 is an 8-bit binary number. For example, b0=1, b1=0, b2=1, b3=1, b4=0, b5=0, b6=1, and b7=0, then Bij=b0b1b2b3b4b5b6b7=10110010.
[0051] Step S203, repeatedly performing mapping conversion processing on all primary groups in the original image group data, and obtaining image group mapping data after completion;
[0052] In the specific implementation process, mapping conversion rules are established to perform mapping conversion on the original image group data. The advantage is that the original data can be effectively obfuscated by mapping through these complex logical operations, making the stored data more confidential to a certain extent. Even if the data is illegally obtained during the storage process, it is difficult for the attacker to directly infer the content of the original data from the mapped sequence. Moreover, the mapping conversion operation will cause the flip of one bit to produce multiple bit changes in the mapped sequence. For example, when the a0 bit is flipped, since b0=a0⊕a2, The existence of multiple mapping relationships such as b4=a0↑a1 will cause changes in multiple bits such as b0, b2 and b4. This error diffusion characteristic makes even a single error in the original data bit easier to detect in the mapping sequence. Moreover, each mapped converted data is associated with multiple data of the original image group data. Through these complex logical relationships, more information about the original data can be provided during the error correction process. When an error is detected in the sequence after the mapping conversion, it is helpful to infer the error situation of the original data by analyzing these logical relationships during error correction. Compared with the simple bit mapping method, this complex operation can provide richer clues for the error correction process, thereby more accurately locating and correcting errors.
[0053] Step S3, performing redundancy check generation processing based on the image group mapping data to obtain image group check data; Step S3 includes the following sub-steps:
[0054] Step S301: Based on the image group mapping data, extract all the first-level groups in the image group check data. For any second-level group Bij=b0b1b2b3b4b5b6b7 in the first-level group, calculate the number of "1"s in Bij=b0b1b2b3b4b5b6b7 and generate a 1-bit parity check value, denoted as Vij, where Vij represents the parity check value of the j-th second-level group under the i-th first-level group.
[0055] Step S302: When the number of "1"s in Bij = b0b1b2b3b4b5b6b7 is an even number, Vij = 0; when the number of "1"s in Bij = b0b1b2b3b4b5b6b7 is an odd number, Vij = 1; for example, when Bij = 10110010, the number of "1"s is 4, which is an odd number, so Vij = 0;
[0056] Step S303: Based on the finite field GF(2^8), the generating polynomial of the finite field GF(2^8) is set to: c8*x8 +c7*x 7 +c6*x 6 +c5*x 5 +c4*x 4 +c3*x 3 +c2*x 2 +c1*x+c0, where c1, c2, c3, c4, c5, c6, c7, and c8 are coefficients of the generating polynomial. A finite field is a field with a finite number of elements. The finite field GF(2^8) represents a set with 2^8=256 elements. Two operations, addition and multiplication, are defined on this set. The addition operation is to add the corresponding coefficients. The multiplication operation is to multiply according to the polynomial multiplication rule and then divide the result by the selected irreducible polynomial to obtain the remainder. The generating polynomial is an irreducible polynomial. An irreducible polynomial means that on a given finite field, this polynomial cannot be decomposed into the product of two polynomials of lower degree. In this embodiment, the generating polynomial is x 8 +x 4 +x 3 +x 2 +1;
[0057] Step S304: Based on Bij=b0b1b2b3b4b5b6b7, the values of each digit of b0b1b2b3b4b5b6b7 are used as polynomial coefficients under the finite field GF(2^8); the polynomial b0*x corresponding to Bij=b0b1b2b3b4b5b6b7 is obtained. 7 +b1*x 6 +b2*x 5 +b3*x 4 +b4*x 3 +b5*x 2 +b6*x+b7, denoted as Bij finite polynomial;
[0058] Step S305, using Bij finite polynomial b0*x 7 +b1*x 6 +b2*x 5 +b3*x 4 +b4*x 3 +b5*x 2 +b6*x+b7 divided by the generator polynomial c8*x 8 +c7*x 7 +c6*x 6 +c5*x 5 +c4*x 4 +c3*x 3 +c2*x 2 +c1*x+c0, we get the remainder polynomial, recorded as e0*x 7 +e1*x6 +e2*x 5 +e3*x 4 +e4*x 3 +e5*x 2 +e6*x+e7, where e0, e1, e2, e3, e4, e5, e6, and e7 are coefficients of the remainder polynomial;
[0059] Step S306: extract the coefficients e0, e1, e2, e3, e4, e5, e6, and e7 of the remainder polynomial and combine them in order to form an 8-bit number e0e1e2e3e4e5e6e7, which is marked as a finite field check value and denoted as Eij = e0e1e2e3e4e5e6e7, where Eij represents the finite field check value of the j-th secondary group under the i-th primary group;
[0060] Step S307: Combine the parity check value and the finite field check value and mark them as a redundant check value, denoted as VEij. For example, if Vij = 0 and Eij = 00010100, then VEij = 000010100, i.e., the parity check value comes first and the finite field check value comes second. Alternatively, VEij = 000101000, i.e., the parity check value comes second and the finite field check value comes first. However, for a storage device, the combination method should be fixed. Repeat the mapping conversion process for all secondary groups in the image group mapping number to obtain redundant check values VEij for all secondary groups, which are marked as image group check data.
[0061] Compared to traditional parity checking, combining parity and finite field check values not only uses parity checking to detect errors, but also introduces checks based on finite field operations. Parity checking can quickly and easily detect odd-number bit flips, but may fail for even-number bit flips. Finite field checking, on the other hand, provides another dimension of detection, capable of capturing more complex error patterns. For example, in the case of a double-bit flip that simple parity checking may not detect, finite field checking has a higher probability of detecting the anomaly, thereby improving the overall error detection rate.
[0062] In the specific implementation process, the specific division steps for the Bij finite polynomial divided by the generator polynomial are as follows. Let the generator polynomial be x 8 +x 4 +x 3 +x 2+1, first the dividend is the Bij finite polynomial, and the divisor is the generating polynomial; the lowest order term of the dividend is x^7, and the highest order term of the divisor is x^8, and the dividend needs to be multiplied by x to obtain x*dividend; then x*dividend minus b0*generating polynomial; because the coefficient of the highest order term of the generating polynomial is 1, this can eliminate the x^8 term; in a finite field, subtraction is equivalent to addition, that is, an XOR operation; in this way, a new polynomial is obtained, denoted as R1(x), and then the above process is repeated, looking at the highest order term of R1(x), multiplying it by an appropriate power of x, and then subtracting an appropriate multiple of the generating polynomial, and repeating it several times. The number of loops can be set by yourself, and the general value range is [3, 8]. In this embodiment, the number of loops is 4 times.
[0063] Step S4, performing error location and correction based on the original image group data, the image group mapping data, and the image group verification data; Step S4 includes the following sub-steps:
[0064] Step S401, please refer to Figure 2 As shown, the original image group data, the image group mapping data, and the image group verification data are combined and stored together according to the secondary group and the corresponding secondary group, and marked as error-correctable image data; the storage format may be to store the original image group data first, and then sequentially store the image group mapping data and the image group verification data after the corresponding group according to the group;
[0065] Step S402: When the stored image data needs to be read, the error-correctable image data is first split into corresponding original image group data, image group mapping data, and image group verification data. Then, the split original image group data is re-mapped and converted, and a redundancy check is generated to obtain regenerated image group verification data.
[0066] Step S403, please refer to Figure 3 As shown, the regenerated image group verification data is compared with the split image group verification data to determine whether all data are completely consistent. If all data are completely consistent, that is, the regenerated redundant check value VEij is equal to the split redundant check value VEij; then it is determined that the stored image data is error-free, the grouping process of the original image group data is canceled, and the image data is output;
[0067] Step S404: If all data are not completely consistent, the location of the secondary group where the inconsistent data is located is obtained. For example, assuming there are four secondary groups A1, A2, A3, and A4, after reading the data, the redundant check value is recalculated and it is found that the parity check value of secondary group A1 changes from an even number of "1"s when stored to an odd number of "1"s, and the finite field check value is also different from the stored value. Then, the focus of suspicion is placed on secondary group A1. Based on the relationship between the image group mapping data and the image group check data, data correction is performed on the secondary group corresponding to the secondary group where the inconsistent data is located. For example, it is obtained that the a1 bit in secondary group A1 has been flipped. Then, the erroneous a1 can be converted back to the original a1 by reversing the mapping conversion process. For example, b0=a0⊕a2. Knowing that b0 and a2 have correct values, the correct a0 value can be calculated by b0⊕a2. Similar operations can be performed for other mapping conversion processes involving a0 to restore the original correct data of secondary group A1.
[0068] Step S405: If the corrected secondary group data is reassembled into the original image group data, redundancy check generation processing is performed again based on the image group mapping data corresponding to the reassembled original image group data to obtain regenerated image group check data. This data is then compared with the split image group check data to determine whether all data are completely consistent; that is, whether the error correction is successful.
[0069] Step S406: If all data are completely consistent, error correction is determined to be successful and the image data is output; if all data are not completely consistent, error correction is determined to have failed. If error correction fails, it means that the image data has too many errors and cannot be completely corrected by the redundant check value. In this case, a backup can be directly output, that is, the image redundant data can be output;
[0070] In the specific implementation process, once the secondary grouping that may have errors is determined, it is necessary to further determine the specific location of the error; for each subgroup, an error pattern table can be pre-established; this table records the possible error conditions corresponding to different redundant check value changes; for example, for a single-bit flip error, assuming that in the mapping conversion sequence of the secondary group A1, when the parity bit changes and the change of the finite field check value conforms to a certain range, this range is determined through pre-experimentation and analysis, and may correspond to the flip of the original data bit a0; this is because in the bit mapping process, a1 participates in the calculation of multiple bits, such as b0, b2 and b4, and a single-bit flip will cause the check bits involved in these bits to be flipped. The check value undergoes a specific change; if it is a multi-bit flip error, the error correction capability of the finite field check value can be utilized; finite field operations can detect and correct multiple erroneous bits to a certain extent; since the finite field check value is the remainder obtained by dividing the 8-bit sequence after bit mapping by the generating polynomial as an element on the finite field GF(2^8); when multi-bit flip occurs, this remainder will undergo a specific change; by analyzing the finite field check value, you can try to correct the error; specifically, by pre-establishing a finite field multi-bit error correction model, according to the difference between the current finite field check value and the correct check value, calculate which bits need to be adjusted to correct the multi-bit flip error.
[0071] Example 2, please refer to Figure 4 As shown, Figure 4 The present invention provides a schematic structural diagram of an electronic device, which may include a processor, a communication interface, a memory, and a communication bus. The processor, the communication interface, and the memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can call instructions from the memory. When the computer-readable instructions are executed by the processor, the processor executes the steps of a method for correcting data storage errors in a storage device to implement the following functions: grouping image data by group size based on image data size to obtain original image group data; performing mapping conversion processing on the original image group data to obtain image group mapping data; performing redundancy check generation processing on the image group mapping data to obtain image group verification data; and locating and correcting errors based on the original image group data, the image group mapping data, and the image group verification data.
[0072] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0073] Example 3. The present application also provides a computer-readable storage medium. The present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above storage device data storage error correction method are executed to achieve the following functions: grouping the image data according to the group size based on the image data size to obtain original image group data; performing mapping conversion processing based on the original image group data to obtain image group mapping data; performing redundant check generation processing based on the image group mapping data to obtain image group verification data; and performing error location and correction based on the original image group data, image group mapping data, and image group verification data.
[0074] Through the description of the above embodiments, the embodiments of the present invention can be provided as methods, systems or computer program products. Based on this understanding, the above technical solutions, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiment.
[0075] In the embodiments provided in this application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data storage error correction method for a storage device, characterized in that: The steps include: The image data is grouped according to the group size based on the image data size to obtain original image group data; Performing mapping conversion processing based on the original image group data to obtain image group mapping data; Performing redundancy check generation processing based on the image group mapping data to obtain image group check data; Perform error location and correction based on original image group data, image group mapping data, and image group verification data; Mapping conversion processing: Based on the original image group data, extract all primary groups in the original image group data. For any secondary group Aij in the primary group, let the 4-bit data contained in Aij be Aij=a0a1a2a3; map a0a1a2a3 to b0b1b2b3b4b5b6b7 according to the mapping conversion rules; Performing mapping conversion processing based on the original image group data to obtain image group mapping data includes the following sub-steps: The obtained b0b1b2b3b4b5b6b7 is recorded as Bij=b0b1b2b3b4b5b6b7 and marked as a secondary group. The primary group that has completed the mapping conversion process is marked as a primary group. Bij represents the jth secondary group under the i-th primary group. Repeat the mapping conversion process for all primary groups in the original image group data, and obtain image group mapping data after completion; Performing redundancy check generation processing based on the image group mapping data to obtain image group check data includes the following sub-steps: Based on the image group mapping data, extract all the first-level groups in the image group check data, and perform parity check on any second-level group Bij=b0b1b2b3b4b5b6b7 in the first-level group; Based on the finite field GF(2^8), set the generating polynomial of the finite field GF(2^8); Based on Bij=b0b1b2b3b4b5b6b7, the values of each digit of b0b1b2b3b4b5b6b7 are used as polynomial coefficients under the finite field GF(2^8); The polynomial corresponding to Bij=b0b1b2b3b4b5b6b7 is obtained, which is recorded as Bij finite polynomial; Divide the Bij finite polynomial by the generator polynomial to obtain the remainder polynomial; Extract the coefficients e0, e1, e2, e3, e4, e5, e6, and e7 of the remainder polynomial and combine them in order to form an 8-bit number e0e1e2e3e4e5e6e7, marked as the finite field check value, denoted as Eij = e0e1e2e3e4e5e6e7, where Eij represents the finite field check value of the j-th secondary group under the i-th primary group; The parity check value and the finite field check value are combined together and marked as a redundant check value, denoted as VEij; Repeat the mapping conversion process for all secondary groups in the image group mapping number to obtain the redundant check value VEij of all secondary groups; mark it as image group check data; Error location and correction based on original image group data, image group mapping data, and image group verification data includes the following sub-steps: Merging and storing the original image group data, the image group mapping data, and the image group verification data according to the secondary group and the corresponding secondary group, and marking them as error-correctable image data; When it is necessary to read the stored image data, first, based on the error-correctable image data, the corresponding original image group data, image group mapping data and image group verification data are split, and then the mapping conversion processing and redundant verification generation processing are re-performed based on the split original image group data to obtain regenerated image group verification data. The regenerated image group verification data is compared with the split image group verification data to determine whether all the data are completely consistent. If all the data are completely consistent, it is determined that the stored image data is error-free, the grouping processing of the original image group data is canceled, and the image data is output.
2. The data storage error correction method of a storage device according to claim 1, characterized in that: The image data is grouped according to the group size based on the image data size to obtain the original image group data, including the following sub-steps: Setting the storage device to store the image in two data blocks, marked as image data and image redundant data respectively; Obtain the number of image data, denoted as P0, set the group size of the image data to L0, L0=4*k, k is a positive integer; group the image data based on the group size L0 of the image data, and mark the obtained groups as primary groups; denoted as Ai, where Ai represents the i-th primary group; Based on all primary groups, set the group size of the secondary grouping of the primary groups to 4, and group the primary groups again based on L1, and mark the resulting groups as secondary groups, denoted by Aij, where Aij represents the jth secondary group under the i-th primary group; obtain the total number of primary groups, denoted by i0; obtain the total number of secondary groups, denoted by j0; The image data that has completed the grouping process is stored in groups and marked as original image group data. The original image group data corresponding to each image includes i0 primary groups, and each primary group includes j0 secondary groups.
3. The data storage error correction method of a storage device according to claim 2, characterized in that: Performing mapping conversion processing based on the original image group data to obtain image group mapping data includes the following sub-steps: The mapping conversion rules are as follows: b0=a0⊕a2; b1=a1∧a3; b2= ¬a0; b3=a2∨a3; b4=a0↑a1; b5=a1⊕¬a2; b6=a2↓a3; b7=a3⊙a0, where ⊕ represents the XOR operation of two binary values on corresponding digits; ∧ represents the AND operation of two binary values on corresponding digits; ¬ represents the NOT operation of two binary values on corresponding digits; ∨ represents the OR operation of two binary values on corresponding digits; ↓ represents the NOR operation of two binary values on corresponding digits; ↑ represents the NAND operation of two binary values on corresponding digits; ⊙ represents the XENO operation of two binary values on corresponding digits.
4. The data storage error correction method of a storage device according to claim 3, characterized in that: Performing redundancy check generation processing based on the image group mapping data to obtain image group check data includes the following sub-steps: Calculate the number of "1"s in Bij=b0b1b2b3b4b5b6b7 and generate a 1-bit parity value, denoted as Vij. Vij represents the parity value of the j-th secondary group under the i-th primary group. When the number of "1"s in Bij=b0b1b2b3b4b5b6b7 is even, Vij=0. When the number of "1" in Bij=b0b1b2b3b4b5b6b7 is odd, Vij=1.
5. The data storage error correction method of a storage device according to claim 4, characterized in that: The generating polynomial is: , where c1, c2, c3, c4, c5, c6, c7 and c8 are the coefficients of the generating polynomial; the Bij finite polynomial is not: ; The remainder polynomial is: , where e0, e1, e2, e3, e4, e5, e6, and e7 are the coefficients of the remainder polynomial.
6. The data storage error correction method of a storage device according to claim 5, characterized in that: Error location and correction based on the original image group data, the image group mapping data, and the image group verification data further includes the following sub-steps: If all data are not completely consistent, obtain the location of the secondary group where the inconsistent data is located; based on the relationship between the image group mapping data and the image group verification data, correct the data of the secondary group corresponding to the secondary group where the inconsistent data is located; If the corrected secondary group data is recombined into the original image group data, redundant check generation processing is performed again based on the image group mapping data corresponding to the re-synthesized original image group data to obtain the regenerated image group check data, and compared with the split image group check data to determine whether all the data are completely consistent. If all the data are completely consistent, the error correction is determined to be successful and the image data is output; if all the data are not completely consistent, the error correction is determined to be a failure and the image redundant data is output.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 6 are executed.
8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Distributed data storage error correction method and system
CN115993941A
Error correction coding method and device
CN107370488A
DNA storage hierarchical representation and interleaved coding method capable of containing artificial bases
CN110569974A